Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make large groups of protected internal class functions public?
    primarykey
    data
    text
    <p>Say I have my own built class (I won't cite an example due to length) X, and in the protected section, has a class Y (from an external library I cannot modify, and cannot use inheritance from the class as the member definitions are hidden).</p> <p>Class Y has about 40 functions. 20 of those I don't want the user to be able to access or modify as it would entail broken functionality (prevented by protected status in class X currently), but the other 20 functions I want the user to be able to access and thus modify class Y (<em>almost</em> as if they had direct access minus the so-called 'dangerous' functions).</p> <p>Without writing out 20 functions in class X which are exact duplicates of class Y, is there any easier and faster way to grant the user access to the 20 or so functions (like some sort of function forwarding ability or something)?</p> <p><strong>Expanded note:</strong></p> <p>It's a bit tricky, because there's a library function that takes a class Y (but won't accept a class X, and people complain at me for casting between classes). Class X is supposed to automate and store information for class Y's operations, <strong>be able return a (const) class Y for the function</strong>, and allow the user to modify the simple things (such as position of the object) but not the automated things (images, image loop).</p> <p>Class X being a type of class Y works in automated functions but doesn't allow class X to return a class Y (not being able to reference itself, a modified version of class Y, again, people will complain at me for casting between classes).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload