/* PURPOSE: (Defines the STLIPTest class, which serves as a testbed for various STL container types instantiated with C++ types such as int, double, char, etc.) LIBRARY_DEPENDENCIES: ( () ) */ #ifndef STL_IP_TEST_HH #define STL_IP_TEST_HH #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "test_classes/include/container_types.hh" struct TestStructure { int a; double b; }; class STLIPTest { friend class InputProcessor; public: STLIPTest() = default; ~STLIPTest() = default; //STLs //Char Types //inline char16_t to_char16_t(char c) {return static_cast(c);} // Python doesn't have a char16_t type, so we use int for compatibility // Add a character to the vector (accepts int for Python compatibility) void addCharToVector(std::vector& vec, int value) { vec.push_back(static_cast(value)); } // Get a character from the vector (returns as int for Python compatibility) int getCharFromVector(std::vector& vec, size_t index) { if (index >= vec.size()) { // Handle out of bounds access throw std::out_of_range("Index out of bounds"); } // Convert char16_t to int when returning to Python return static_cast(vec[index]); } // Python doesn't have a char32_t type, so we use int for compatibility // Add a character to the vector (accepts int for Python compatibility) void addCharToVector(std::vector& vec, int value) { vec.push_back(static_cast(value)); } // Get a character from the vector (returns as int for Python compatibility) int getCharFromVector(std::vector& vec, size_t index) { if (index >= vec.size()) { // Handle out of bounds access throw std::out_of_range("Index out of bounds"); } // Convert char16_t to int when returning to Python return static_cast(vec[index]); } STLContainerTypes char_types; STLContainerTypes signed_char_types; STLContainerTypes unsigned_char_types; STLContainerTypes char16_t_types; STLContainerTypes char32_t_types; STLContainerTypes short_int_types; STLContainerTypes unsigned_short_int_types; STLContainerTypes int_types; STLContainerTypes unsigned_int_types; STLContainerTypes long_int_types; STLContainerTypes unsigned_long_int_types; STLContainerTypes long_long_int_types; STLContainerTypes unsigned_long_long_int_types; STLContainerTypes float_types; STLContainerTypes double_types; STLContainerTypes long_double_types; }; #endif