Note that there are some explanatory texts on larger screens.

plurals
  1. POHiding a function
    primarykey
    data
    text
    <p>I have a class holding complex scientific computations. It is set up to only allow a user to create a properly instantiated case. To properly test the code, however, requires setting internal state variables directly, since the reference documents supply this data in their test cases. Done improperly, however, it can invalidate the state.<p> So I must have the ability, a member function, to set internal variables from the unit test programs. But I want to <b>strongly discourage</b> normal users from calling this function. (Yes, a determined user can muck with anything... but I don't want to <i>advertise</i> that there is a way to do something <i>wrong</i>.)<p> It would be nice to be able to tell Intellisense to not show the function, for instance.<p> The best solution I have at the moment is to just name the function something like: DangerousSet().<p> What other options do I have?<P> <b>Follow-Up</b><p> I found David B's answer most useful to my situation. Thanks!<br> Mufasa's suggestion to use reflection was great, but harder to implement (for me).<br> Chris' suggestion of using a decorator was good, but didn't pan out.<br> BFree's suggestion on XML is also good, and was already in use, but doesn't really solve the problem.<p> Finally, BillTheLizard's suggestion that the problem is in the source documents is not something I can control. International experts publish highly technical books and journal articles for use by their community. The fact that they don't address my particular needs is a fact of life. There simply are no alternative documents.</p>
    singulars
    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.
    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