#ifndef __INDICES_H__ #define __INDICES_H__ /** types d'indices utilisés * * utiliser ces types permet d'être prévenu à la compilation * lorsqu'on se trompe dans l'ordre des indices pour accéder * à des tableaux multidimensionnels */ typedef enum {} timestep_t ; typedef enum {} tlen_t ; typedef enum {} week_t ; typedef enum {} wlen_t ; typedef enum {} scenario_t ; typedef enum {} powerplants1_t ; typedef enum {} powerplants2_t ; typedef enum {} constraint_t ; typedef enum {} campaign_t ; typedef enum {} points_t ; inline campaign_t operator++(campaign_t & k) { k = (campaign_t) (k + 1) ; return k; } inline scenario_t operator+(scenario_t h, tlen_t d) { return (scenario_t) ((int)h+(int)d) ;} inline scenario_t operator++(scenario_t & h) { h = h + (tlen_t) 1 ; return h; } inline tlen_t operator-(timestep_t h1, timestep_t h2) { return (tlen_t)( (int)h1-(int)h2 ); } inline timestep_t operator+(timestep_t h, tlen_t d) { return (timestep_t) ((int)h+(int)d) ;} inline timestep_t operator++(timestep_t & h) { h = h + (tlen_t) 1 ; return h; } inline wlen_t operator-(week_t h1, week_t h2) { return (wlen_t)( (int)h1-(int)h2 ); } inline week_t operator+(week_t h, wlen_t d) { return (week_t) ((int)h+(int)d) ;} inline week_t operator++(week_t & h) { h = h + (wlen_t) 1 ; return h; } /* foncteurs et fonctions utilitaires */ // Foncteur servant à libérer un pointeur - applicable à n'importe quel type struct Delete { template void operator ()(T*& p) const { delete p; p = (T*) 0; } }; #endif