The prerequisites in the codes

 

It is always necessary to check in the codes whether the prerequisites have been met.

It can take many forms
For example, do you have all the handles of an indicator that would be used multiple times, therefore multiple handles?
Have you implemented all the set_symbols if your code uses multiple ones?
etc etc

It can also make sense simply to group everything in one place without having to create tons of separate booleans.

I propose a structure to do it.
You just need to keep it updated according to your needs.


   struct struct_pre_requisites {
     // Enumeration scoped inside the struct 
     enum ENUM_CHECK_TYPE {
      HANDLES, SYMBOLS,
      HISTORY,
      ALL
    };

     bool handles_ok;
     bool symbols_ok;
     bool history_ok;

     // Targeted check with internal scope 
     bool is_ok( const ENUM_CHECK_TYPE p_type) const {
       switch ( p_type) {
       case HANDLES :
         return ( this .handles_ok);
       case SYMBOLS :
         return ( this .symbols_ok);
       case HISTORY :
         return ( this .history_ok);
       case ALL     :
         return ( this .handles_ok && this .symbols_ok && this .history_ok);
       default       :
         return ( false );
      }
    }
  };