@@ -117,25 +117,29 @@ class smspec_node {
117117 return this ->cmp (other) > 0 ;
118118 }
119119
120- int get_R1 () const ;
121- int get_R2 () const ;
122- const char *get_gen_key1 () const ;
123- const char *get_gen_key2 () const ;
124- rd_smspec_var_type get_var_type () const ;
125- int get_num () const ;
126- const char *get_wgname () const ;
127- const char *get_keyword () const ;
128- const char *get_unit () const ;
129- bool is_rate () const ;
130- bool is_total () const ;
131- bool is_historical () const ;
132- bool need_nums () const ;
120+ [[nodiscard]] int get_R1 () const ;
121+ [[nodiscard]] int get_R2 () const ;
122+ [[nodiscard]] const char *get_gen_key1 () const ;
123+ [[nodiscard]] const char *get_gen_key2 () const ;
124+ [[nodiscard]] rd_smspec_var_type get_var_type () const { return var_type; } ;
125+ [[nodiscard]] int get_num () const { return num; } ;
126+ [[nodiscard]] const char *get_wgname () const ;
127+ [[nodiscard]] const char *get_keyword () const ;
128+ [[nodiscard]] const char *get_unit () const ;
129+ [[nodiscard]] bool is_rate () const { return rate_variable; } ;
130+ [[nodiscard]] bool is_total () const { return total_variable; } ;
131+ [[nodiscard]] bool is_historical () const { return historical; } ;
132+ [[nodiscard]] bool need_nums () const ;
133133 void fprintf__ (FILE *stream) const ;
134- int get_params_index () const ;
135- float get_default () const ;
136- const std::array<int , 3 > &get_ijk () const ;
137- const char *get_lgr_name () const ;
138- const std::array<int , 3 > &get_lgr_ijk () const ;
134+ [[nodiscard]] int get_params_index () const { return params_index; };
135+ [[nodiscard]] float get_default () const { return default_value; };
136+ // Will be garbage for smspec_nodes which do not have i,j,k
137+ [[nodiscard]] const std::array<int , 3 > &get_ijk () const { return ijk; };
138+ [[nodiscard]] const char *get_lgr_name () const ;
139+ // Will be garbage for smspec_nodes which are not related to an LGR.
140+ [[nodiscard]] const std::array<int , 3 > &get_lgr_ijk () const {
141+ return lgr_ijk;
142+ };
139143};
140144
141145} // namespace rd
0 commit comments