Advertisement
LyffLyff

Header of Godots PoolByteArray

Feb 26th, 2023
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 16.63 KB | Source Code | 0 0
  1. #ifndef POOLARRAYS_H
  2. #define POOLARRAYS_H
  3.  
  4. #include "Defs.hpp"
  5.  
  6. #include "Color.hpp"
  7. #include "GodotGlobal.hpp"
  8. #include "String.hpp"
  9. #include "Vector2.hpp"
  10. #include "Vector3.hpp"
  11.  
  12. #include <gdnative/pool_arrays.h>
  13.  
  14. namespace godot {
  15.  
  16. class Array;
  17.  
  18. class PoolByteArray {
  19.     godot_pool_byte_array _godot_array;
  20.  
  21.     friend class String;
  22.     friend class Variant;
  23.     inline explicit PoolByteArray(godot_pool_byte_array a) {
  24.         _godot_array = a;
  25.     }
  26.  
  27. public:
  28.     class Read {
  29.         friend class PoolByteArray;
  30.         godot_pool_byte_array_read_access *_read_access;
  31.  
  32.     public:
  33.         inline Read() {
  34.             _read_access = nullptr;
  35.         }
  36.  
  37.         inline Read(const Read &p_other) {
  38.             _read_access = godot::api->godot_pool_byte_array_read_access_copy(p_other._read_access);
  39.         }
  40.  
  41.         inline ~Read() {
  42.             godot::api->godot_pool_byte_array_read_access_destroy(_read_access);
  43.         }
  44.  
  45.         inline const uint8_t *ptr() const {
  46.             return godot::api->godot_pool_byte_array_read_access_ptr(_read_access);
  47.         }
  48.  
  49.         inline const uint8_t &operator[](int p_idx) const {
  50.             return ptr()[p_idx];
  51.         }
  52.  
  53.         inline void operator=(const Read &p_other) {
  54.             godot::api->godot_pool_byte_array_read_access_operator_assign(_read_access, p_other._read_access);
  55.         }
  56.     };
  57.  
  58.     class Write {
  59.         friend class PoolByteArray;
  60.         godot_pool_byte_array_write_access *_write_access;
  61.  
  62.     public:
  63.         inline Write() {
  64.             _write_access = nullptr;
  65.         }
  66.  
  67.         inline Write(const Write &p_other) {
  68.             _write_access = godot::api->godot_pool_byte_array_write_access_copy(p_other._write_access);
  69.         }
  70.  
  71.         inline ~Write() {
  72.             godot::api->godot_pool_byte_array_write_access_destroy(_write_access);
  73.         }
  74.  
  75.         inline uint8_t *ptr() const {
  76.             return godot::api->godot_pool_byte_array_write_access_ptr(_write_access);
  77.         }
  78.  
  79.         inline uint8_t &operator[](int p_idx) const {
  80.             return ptr()[p_idx];
  81.         }
  82.  
  83.         inline void operator=(const Write &p_other) {
  84.             godot::api->godot_pool_byte_array_write_access_operator_assign(_write_access, p_other._write_access);
  85.         }
  86.     };
  87.  
  88.     PoolByteArray();
  89.     PoolByteArray(const PoolByteArray &p_other);
  90.     PoolByteArray &operator=(const PoolByteArray &p_other);
  91.  
  92.     PoolByteArray(const Array &array);
  93.  
  94.     Read read() const;
  95.  
  96.     Write write();
  97.  
  98.     void append(const uint8_t data);
  99.  
  100.     void append_array(const PoolByteArray &array);
  101.  
  102.     int insert(const int idx, const uint8_t data);
  103.  
  104.     void invert();
  105.  
  106.     void push_back(const uint8_t data);
  107.  
  108.     void remove(const int idx);
  109.  
  110.     void resize(const int size);
  111.  
  112.     void set(const int idx, const uint8_t data);
  113.  
  114.     uint8_t operator[](const int idx);
  115.  
  116.     int size() const;
  117.  
  118.     ~PoolByteArray();
  119. };
  120.  
  121. class PoolIntArray {
  122.     godot_pool_int_array _godot_array;
  123.  
  124.     friend class Variant;
  125.     explicit inline PoolIntArray(godot_pool_int_array a) {
  126.         _godot_array = a;
  127.     }
  128.  
  129. public:
  130.     class Read {
  131.         friend class PoolIntArray;
  132.         godot_pool_int_array_read_access *_read_access;
  133.  
  134.     public:
  135.         inline Read() {
  136.             _read_access = nullptr;
  137.         }
  138.  
  139.         inline Read(const Read &p_other) {
  140.             _read_access = godot::api->godot_pool_int_array_read_access_copy(p_other._read_access);
  141.         }
  142.  
  143.         inline ~Read() {
  144.             godot::api->godot_pool_int_array_read_access_destroy(_read_access);
  145.         }
  146.  
  147.         inline const int *ptr() const {
  148.             return godot::api->godot_pool_int_array_read_access_ptr(_read_access);
  149.         }
  150.  
  151.         inline const int &operator[](int p_idx) const {
  152.             return ptr()[p_idx];
  153.         }
  154.  
  155.         inline void operator=(const Read &p_other) {
  156.             godot::api->godot_pool_int_array_read_access_operator_assign(_read_access, p_other._read_access);
  157.         }
  158.     };
  159.  
  160.     class Write {
  161.         friend class PoolIntArray;
  162.         godot_pool_int_array_write_access *_write_access;
  163.  
  164.     public:
  165.         inline Write() {
  166.             _write_access = nullptr;
  167.         }
  168.  
  169.         inline Write(const Write &p_other) {
  170.             _write_access = godot::api->godot_pool_int_array_write_access_copy(p_other._write_access);
  171.         }
  172.  
  173.         inline ~Write() {
  174.             godot::api->godot_pool_int_array_write_access_destroy(_write_access);
  175.         }
  176.  
  177.         inline int *ptr() const {
  178.             return godot::api->godot_pool_int_array_write_access_ptr(_write_access);
  179.         }
  180.  
  181.         inline int &operator[](int p_idx) const {
  182.             return ptr()[p_idx];
  183.         }
  184.  
  185.         inline void operator=(const Write &p_other) {
  186.             godot::api->godot_pool_int_array_write_access_operator_assign(_write_access, p_other._write_access);
  187.         }
  188.     };
  189.  
  190.     PoolIntArray();
  191.     PoolIntArray(const PoolIntArray &p_other);
  192.     PoolIntArray &operator=(const PoolIntArray &p_other);
  193.  
  194.     PoolIntArray(const Array &array);
  195.  
  196.     Read read() const;
  197.  
  198.     Write write();
  199.  
  200.     void append(const int data);
  201.  
  202.     void append_array(const PoolIntArray &array);
  203.  
  204.     int insert(const int idx, const int data);
  205.  
  206.     void invert();
  207.  
  208.     void push_back(const int data);
  209.  
  210.     void remove(const int idx);
  211.  
  212.     void resize(const int size);
  213.  
  214.     void set(const int idx, const int data);
  215.  
  216.     int operator[](const int idx);
  217.  
  218.     int size() const;
  219.  
  220.     ~PoolIntArray();
  221. };
  222.  
  223. class PoolRealArray {
  224.     godot_pool_real_array _godot_array;
  225.  
  226.     friend class Variant;
  227.     explicit inline PoolRealArray(godot_pool_real_array a) {
  228.         _godot_array = a;
  229.     }
  230.  
  231. public:
  232.     class Read {
  233.         friend class PoolRealArray;
  234.         godot_pool_real_array_read_access *_read_access;
  235.  
  236.     public:
  237.         inline Read() {
  238.             _read_access = nullptr;
  239.         }
  240.  
  241.         inline Read(const Read &p_other) {
  242.             _read_access = godot::api->godot_pool_real_array_read_access_copy(p_other._read_access);
  243.         }
  244.  
  245.         inline ~Read() {
  246.             godot::api->godot_pool_real_array_read_access_destroy(_read_access);
  247.         }
  248.  
  249.         inline const real_t *ptr() const {
  250.             return godot::api->godot_pool_real_array_read_access_ptr(_read_access);
  251.         }
  252.  
  253.         inline const real_t &operator[](int p_idx) const {
  254.             return ptr()[p_idx];
  255.         }
  256.  
  257.         inline void operator=(const Read &p_other) {
  258.             godot::api->godot_pool_real_array_read_access_operator_assign(_read_access, p_other._read_access);
  259.         }
  260.     };
  261.  
  262.     class Write {
  263.         friend class PoolRealArray;
  264.         godot_pool_real_array_write_access *_write_access;
  265.  
  266.     public:
  267.         inline Write() {
  268.             _write_access = nullptr;
  269.         }
  270.  
  271.         inline Write(const Write &p_other) {
  272.             _write_access = godot::api->godot_pool_real_array_write_access_copy(p_other._write_access);
  273.         }
  274.  
  275.         inline ~Write() {
  276.             godot::api->godot_pool_real_array_write_access_destroy(_write_access);
  277.         }
  278.  
  279.         inline real_t *ptr() const {
  280.             return godot::api->godot_pool_real_array_write_access_ptr(_write_access);
  281.         }
  282.  
  283.         inline real_t &operator[](int p_idx) const {
  284.             return ptr()[p_idx];
  285.         }
  286.  
  287.         inline void operator=(const Write &p_other) {
  288.             godot::api->godot_pool_real_array_write_access_operator_assign(_write_access, p_other._write_access);
  289.         }
  290.     };
  291.  
  292.     PoolRealArray();
  293.     PoolRealArray(const PoolRealArray &p_other);
  294.     PoolRealArray &operator=(const PoolRealArray &p_other);
  295.  
  296.     PoolRealArray(const Array &array);
  297.  
  298.     Read read() const;
  299.  
  300.     Write write();
  301.  
  302.     void append(const real_t data);
  303.  
  304.     void append_array(const PoolRealArray &array);
  305.  
  306.     int insert(const int idx, const real_t data);
  307.  
  308.     void invert();
  309.  
  310.     void push_back(const real_t data);
  311.  
  312.     void remove(const int idx);
  313.  
  314.     void resize(const int size);
  315.  
  316.     void set(const int idx, const real_t data);
  317.  
  318.     real_t operator[](const int idx);
  319.  
  320.     int size() const;
  321.  
  322.     ~PoolRealArray();
  323. };
  324.  
  325. class PoolStringArray {
  326.     godot_pool_string_array _godot_array;
  327.  
  328.     friend class String;
  329.     friend class Variant;
  330.     explicit inline PoolStringArray(godot_pool_string_array a) {
  331.         _godot_array = a;
  332.     }
  333.  
  334. public:
  335.     class Read {
  336.         friend class PoolStringArray;
  337.         godot_pool_string_array_read_access *_read_access;
  338.  
  339.     public:
  340.         inline Read() {
  341.             _read_access = nullptr;
  342.         }
  343.  
  344.         inline Read(const Read &p_other) {
  345.             _read_access = godot::api->godot_pool_string_array_read_access_copy(p_other._read_access);
  346.         }
  347.  
  348.         inline ~Read() {
  349.             godot::api->godot_pool_string_array_read_access_destroy(_read_access);
  350.         }
  351.  
  352.         inline const String *ptr() const {
  353.             return (const String *)godot::api->godot_pool_string_array_read_access_ptr(_read_access);
  354.         }
  355.  
  356.         inline const String &operator[](int p_idx) const {
  357.             return ptr()[p_idx];
  358.         }
  359.  
  360.         inline void operator=(const Read &p_other) {
  361.             godot::api->godot_pool_string_array_read_access_operator_assign(_read_access, p_other._read_access);
  362.         }
  363.     };
  364.  
  365.     class Write {
  366.         friend class PoolStringArray;
  367.         godot_pool_string_array_write_access *_write_access;
  368.  
  369.     public:
  370.         inline Write() {
  371.             _write_access = nullptr;
  372.         }
  373.  
  374.         inline Write(const Write &p_other) {
  375.             _write_access = godot::api->godot_pool_string_array_write_access_copy(p_other._write_access);
  376.         }
  377.  
  378.         inline ~Write() {
  379.             godot::api->godot_pool_string_array_write_access_destroy(_write_access);
  380.         }
  381.  
  382.         inline String *ptr() const {
  383.             return (String *)godot::api->godot_pool_string_array_write_access_ptr(_write_access);
  384.         }
  385.  
  386.         inline String &operator[](int p_idx) const {
  387.             return ptr()[p_idx];
  388.         }
  389.  
  390.         inline void operator=(const Write &p_other) {
  391.             godot::api->godot_pool_string_array_write_access_operator_assign(_write_access, p_other._write_access);
  392.         }
  393.     };
  394.  
  395.     PoolStringArray();
  396.     PoolStringArray(const PoolStringArray &p_other);
  397.     PoolStringArray &operator=(const PoolStringArray &p_other);
  398.  
  399.     PoolStringArray(const Array &array);
  400.  
  401.     Read read() const;
  402.  
  403.     Write write();
  404.  
  405.     void append(const String &data);
  406.  
  407.     void append_array(const PoolStringArray &array);
  408.  
  409.     int insert(const int idx, const String &data);
  410.  
  411.     void invert();
  412.  
  413.     void push_back(const String &data);
  414.  
  415.     void remove(const int idx);
  416.  
  417.     void resize(const int size);
  418.  
  419.     void set(const int idx, const String &data);
  420.  
  421.     const String operator[](const int idx);
  422.  
  423.     int size() const;
  424.  
  425.     ~PoolStringArray();
  426. };
  427.  
  428. class PoolVector2Array {
  429.     godot_pool_vector2_array _godot_array;
  430.  
  431.     friend class Variant;
  432.     explicit inline PoolVector2Array(godot_pool_vector2_array a) {
  433.         _godot_array = a;
  434.     }
  435.  
  436. public:
  437.     class Read {
  438.         friend class PoolVector2Array;
  439.         godot_pool_vector2_array_read_access *_read_access;
  440.  
  441.     public:
  442.         inline Read() {
  443.             _read_access = nullptr;
  444.         }
  445.  
  446.         inline Read(const Read &p_other) {
  447.             _read_access = godot::api->godot_pool_vector2_array_read_access_copy(p_other._read_access);
  448.         }
  449.  
  450.         inline ~Read() {
  451.             godot::api->godot_pool_vector2_array_read_access_destroy(_read_access);
  452.         }
  453.  
  454.         inline const Vector2 *ptr() const {
  455.             return (const Vector2 *)godot::api->godot_pool_vector2_array_read_access_ptr(_read_access);
  456.         }
  457.  
  458.         inline const Vector2 &operator[](int p_idx) const {
  459.             return ptr()[p_idx];
  460.         }
  461.  
  462.         inline void operator=(const Read &p_other) {
  463.             godot::api->godot_pool_vector2_array_read_access_operator_assign(_read_access, p_other._read_access);
  464.         }
  465.     };
  466.  
  467.     class Write {
  468.         friend class PoolVector2Array;
  469.         godot_pool_vector2_array_write_access *_write_access;
  470.  
  471.     public:
  472.         inline Write() {
  473.             _write_access = nullptr;
  474.         }
  475.  
  476.         inline Write(const Write &p_other) {
  477.             _write_access = godot::api->godot_pool_vector2_array_write_access_copy(p_other._write_access);
  478.         }
  479.  
  480.         inline ~Write() {
  481.             godot::api->godot_pool_vector2_array_write_access_destroy(_write_access);
  482.         }
  483.  
  484.         inline Vector2 *ptr() const {
  485.             return (Vector2 *)godot::api->godot_pool_vector2_array_write_access_ptr(_write_access);
  486.         }
  487.  
  488.         inline Vector2 &operator[](int p_idx) const {
  489.             return ptr()[p_idx];
  490.         }
  491.  
  492.         inline void operator=(const Write &p_other) {
  493.             godot::api->godot_pool_vector2_array_write_access_operator_assign(_write_access, p_other._write_access);
  494.         }
  495.     };
  496.  
  497.     PoolVector2Array();
  498.     PoolVector2Array(const PoolVector2Array &p_other);
  499.     PoolVector2Array &operator=(const PoolVector2Array &p_other);
  500.  
  501.     PoolVector2Array(const Array &array);
  502.  
  503.     Read read() const;
  504.  
  505.     Write write();
  506.  
  507.     void append(const Vector2 &data);
  508.  
  509.     void append_array(const PoolVector2Array &array);
  510.  
  511.     int insert(const int idx, const Vector2 &data);
  512.  
  513.     void invert();
  514.  
  515.     void push_back(const Vector2 &data);
  516.  
  517.     void remove(const int idx);
  518.  
  519.     void resize(const int size);
  520.  
  521.     void set(const int idx, const Vector2 &data);
  522.  
  523.     const Vector2 operator[](const int idx);
  524.  
  525.     int size() const;
  526.  
  527.     ~PoolVector2Array();
  528. };
  529.  
  530. class PoolVector3Array {
  531.     godot_pool_vector3_array _godot_array;
  532.  
  533.     friend class Variant;
  534.     explicit inline PoolVector3Array(godot_pool_vector3_array a) {
  535.         _godot_array = a;
  536.     }
  537.  
  538. public:
  539.     class Read {
  540.         friend class PoolVector3Array;
  541.         godot_pool_vector3_array_read_access *_read_access;
  542.  
  543.     public:
  544.         inline Read() {
  545.             _read_access = nullptr;
  546.         }
  547.  
  548.         inline Read(const Read &p_other) {
  549.             _read_access = godot::api->godot_pool_vector3_array_read_access_copy(p_other._read_access);
  550.         }
  551.  
  552.         inline ~Read() {
  553.             godot::api->godot_pool_vector3_array_read_access_destroy(_read_access);
  554.         }
  555.  
  556.         inline const Vector3 *ptr() const {
  557.             return (const Vector3 *)godot::api->godot_pool_vector3_array_read_access_ptr(_read_access);
  558.         }
  559.  
  560.         inline const Vector3 &operator[](int p_idx) const {
  561.             return ptr()[p_idx];
  562.         }
  563.  
  564.         inline void operator=(const Read &p_other) {
  565.             godot::api->godot_pool_vector3_array_read_access_operator_assign(_read_access, p_other._read_access);
  566.         }
  567.     };
  568.  
  569.     class Write {
  570.         friend class PoolVector3Array;
  571.         godot_pool_vector3_array_write_access *_write_access;
  572.  
  573.     public:
  574.         inline Write() {
  575.             _write_access = nullptr;
  576.         }
  577.  
  578.         inline Write(const Write &p_other) {
  579.             _write_access = godot::api->godot_pool_vector3_array_write_access_copy(p_other._write_access);
  580.         }
  581.  
  582.         inline ~Write() {
  583.             godot::api->godot_pool_vector3_array_write_access_destroy(_write_access);
  584.         }
  585.  
  586.         inline Vector3 *ptr() const {
  587.             return (Vector3 *)godot::api->godot_pool_vector3_array_write_access_ptr(_write_access);
  588.         }
  589.  
  590.         inline Vector3 &operator[](int p_idx) const {
  591.             return ptr()[p_idx];
  592.         }
  593.  
  594.         inline void operator=(const Write &p_other) {
  595.             godot::api->godot_pool_vector3_array_write_access_operator_assign(_write_access, p_other._write_access);
  596.         }
  597.     };
  598.  
  599.     PoolVector3Array();
  600.     PoolVector3Array(const PoolVector3Array &p_other);
  601.     PoolVector3Array &operator=(const PoolVector3Array &p_other);
  602.  
  603.     PoolVector3Array(const Array &array);
  604.  
  605.     Read read() const;
  606.  
  607.     Write write();
  608.  
  609.     void append(const Vector3 &data);
  610.  
  611.     void append_array(const PoolVector3Array &array);
  612.  
  613.     int insert(const int idx, const Vector3 &data);
  614.  
  615.     void invert();
  616.  
  617.     void push_back(const Vector3 &data);
  618.  
  619.     void remove(const int idx);
  620.  
  621.     void resize(const int size);
  622.  
  623.     void set(const int idx, const Vector3 &data);
  624.  
  625.     const Vector3 operator[](const int idx);
  626.  
  627.     int size() const;
  628.  
  629.     ~PoolVector3Array();
  630. };
  631.  
  632. class PoolColorArray {
  633.     godot_pool_color_array _godot_array;
  634.  
  635.     friend class Variant;
  636.     explicit inline PoolColorArray(godot_pool_color_array a) {
  637.         _godot_array = a;
  638.     }
  639.  
  640. public:
  641.     class Read {
  642.         friend class PoolColorArray;
  643.         godot_pool_color_array_read_access *_read_access;
  644.  
  645.     public:
  646.         inline Read() {
  647.             _read_access = nullptr;
  648.         }
  649.  
  650.         inline Read(const Read &p_other) {
  651.             _read_access = godot::api->godot_pool_color_array_read_access_copy(p_other._read_access);
  652.         }
  653.  
  654.         inline ~Read() {
  655.             godot::api->godot_pool_color_array_read_access_destroy(_read_access);
  656.         }
  657.  
  658.         inline const Color *ptr() const {
  659.             return (const Color *)godot::api->godot_pool_color_array_read_access_ptr(_read_access);
  660.         }
  661.  
  662.         inline const Color &operator[](int p_idx) const {
  663.             return ptr()[p_idx];
  664.         }
  665.  
  666.         inline void operator=(const Read &p_other) {
  667.             godot::api->godot_pool_color_array_read_access_operator_assign(_read_access, p_other._read_access);
  668.         }
  669.     };
  670.  
  671.     class Write {
  672.         friend class PoolColorArray;
  673.         godot_pool_color_array_write_access *_write_access;
  674.  
  675.     public:
  676.         inline Write() {
  677.             _write_access = nullptr;
  678.         }
  679.  
  680.         inline Write(const Write &p_other) {
  681.             _write_access = godot::api->godot_pool_color_array_write_access_copy(p_other._write_access);
  682.         }
  683.  
  684.         inline ~Write() {
  685.             godot::api->godot_pool_color_array_write_access_destroy(_write_access);
  686.         }
  687.  
  688.         inline Color *ptr() const {
  689.             return (Color *)godot::api->godot_pool_color_array_write_access_ptr(_write_access);
  690.         }
  691.  
  692.         inline Color &operator[](int p_idx) const {
  693.             return ptr()[p_idx];
  694.         }
  695.  
  696.         inline void operator=(const Write &p_other) {
  697.             godot::api->godot_pool_color_array_write_access_operator_assign(_write_access, p_other._write_access);
  698.         }
  699.     };
  700.  
  701.     PoolColorArray();
  702.     PoolColorArray(const PoolColorArray &p_other);
  703.     PoolColorArray &operator=(const PoolColorArray &p_other);
  704.  
  705.     PoolColorArray(const Array &array);
  706.  
  707.     Read read() const;
  708.  
  709.     Write write();
  710.  
  711.     void append(const Color &data);
  712.  
  713.     void append_array(const PoolColorArray &array);
  714.  
  715.     int insert(const int idx, const Color &data);
  716.  
  717.     void invert();
  718.  
  719.     void push_back(const Color &data);
  720.  
  721.     void remove(const int idx);
  722.  
  723.     void resize(const int size);
  724.  
  725.     void set(const int idx, const Color &data);
  726.  
  727.     const Color operator[](const int idx);
  728.  
  729.     int size() const;
  730.  
  731.     ~PoolColorArray();
  732. };
  733.  
  734. } // namespace godot
  735.  
  736. #endif // POOLARRAYS_H
  737.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement