Jump to content

Search the Community

Showing results for tags 'reflection class'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to UNIGINE Forums
    • News & Announcements
    • Getting started
  • Development
    • Content Creation
    • World Design
    • Rendering
    • Animation
    • Physics, Navigation and Path Finding
    • UI Systems
    • Sound & Video
    • Editor
    • C++ Programming
    • C# Programming
    • Networking
    • Sim IG (Image Generator)
    • VR Discussions
    • General
  • Improving UNIGINE
    • Documentation
    • Feedback for UNIGINE team
    • Bug Reports
    • Unigine SDK Beta feedback
  • Community
    • Add-on Store (https://store.unigine.com/)
    • Showcase
    • Collaboration
    • Tools, Plugins, Materials & Tutorials
    • General Discussions
  • Legacy
    • UnigineScript

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 1 result

  1. [SOLVED] Problem with Reflection Class

    Hello. Why an error occurs during processing of user class with vector by Reflection Class? For example, I have the following class: class MyClass { private: int myVector[0] = (1, 2, 3); public: MyClass() {} void addItem(int value) { myVector.append(value); } int getItem(int num) { return myVector[num]; } int getNumItems() { return myVector.size(); } }; I use this class in Init() function: int init() { MyClass my_class = new MyClass(); my_class.addItem(4); forloop(int i = 0; my_class.getNumItems()) { log.message("item[%d] = %d;\n", i, my_class.getItem(i)); } /* Output: * item[0] = 1; * item[1] = 2; * item[2] = 3; * item[3] = 4; */ Reflection my_reflection = new Reflection(); my_reflection.reflect(my_class); // here is an error return 1; } And i have following error: Assertion: '(unsigned int)index < (unsigned int)length && "Vector::operator[](): bad index" ' Update: I initialize the vector in constructor, but the probled remained. Then I just declared a variable in the class and the problem disappeared. But this variable is unused. Code: class MyClass { private: int myVector[0]; int i; public: MyClass() { myVector = (1,2,3); } void addItem(int value) { myVector.append(value); } int getItem(int num) { return myVector[num]; } int getNumItems() { return myVector.size(); } };
×
×
  • Create New...