Skip to content

Commit

Permalink
Feature 2227 namespace (#2290)
Browse files Browse the repository at this point in the history
* Per #2227 changes in this commit resolve all errors from removing 'using namespace std' from all header files in the src/basic directory

* Attempt to resolve errors in GitHub actions from removing 'using namepsace std' from all src/basic/ libraries, plus removal from src/libcode/vx_gnomon/gnomon.h and src/libcode/vx_nc_util/nc_utils.h

* Attempt to fix GHA errors with compilation after removal of 'using namespace std'; locally compiles fine

* Per #2227, attempting to fix GHA compilation; Compiltion on seneca works fine

* Per #2227, attempt to resolve GHA compilation issues; seneca compilation works fine

* Per #2227, attempt to resolve GHA compilation issues; seneca compilation works fine

* Per #2227, removing namespace from vx_series_data library

* Per #2227, removing namespace std from vx_shapedata library

* Per #2227, removing namespace std from vx_data2d_grib2 and vx_data2d_grib libraries

* Per #2227, removing namespace std from vx_statistics library

* Per #2227, removing namespace std from src/tools/tc_utils

* Per #2227, removed namespace std from /src/tools/core header files

* Per #2227, clean up and continued work

* Per #2227, changes to remove namespace std and netCDF from header files

* Per #2227, resolve errors in GitHub Actions build

* Per #2227, resolve new errors in GitHub Actions build

* Per #2227, resolve new errors in GitHub Actions build

* Per #2227, resolve new errors in GitHub Actions build

* Per #2227, realign variables

* Per #2227, updating comment

* Per #2227, updating comment

* Per #2227, realign variables

* Per #2227, realign variables

* Per #2227, realign variables

* Per #2227, updating comment

* Update src/basic/vx_config/config.tab.cc

Co-authored-by: johnhg <[email protected]>

Co-authored-by: Julie Prestopnik <[email protected]>
Co-authored-by: johnhg <[email protected]>
  • Loading branch information
3 people authored Oct 4, 2022
1 parent bbcc08a commit 5466007
Show file tree
Hide file tree
Showing 256 changed files with 1,433 additions and 1,284 deletions.
2 changes: 2 additions & 0 deletions internal/test_util/libcode/vx_series_data/test_series_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
////////////////////////////////////////////////////////////////////////

using namespace std;

#include <iostream>
#include <fstream>
#include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion src/basic/vx_cal/time_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class TimeArray {

void extend(int, bool exact = true);

void dump(ostream &, int depth = 0) const;
void dump(std::ostream &, int depth = 0) const;

unixtime operator[](int) const;

Expand Down
16 changes: 8 additions & 8 deletions src/basic/vx_cal/vx_cal.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,14 @@ static const double TIME_EPSILON = 0.001;
// Bad Data Values
//

static const int bad_data_int = -9999;
static const long long bad_data_ll = -9999LL;
static const float bad_data_float = -9999.f;
static const double bad_data_double = -9999.0;
static const char bad_data_str[] = "-9999";
static const char bad_data_char = '\0';
static const char na_str[] = "NA";
static const string na_string = "NA";
static const int bad_data_int = -9999;
static const long long bad_data_ll = -9999LL;
static const float bad_data_float = -9999.f;
static const double bad_data_double = -9999.0;
static const char bad_data_str[] = "-9999";
static const char bad_data_char = '\0';
static const char na_str[] = "NA";
static const std::string na_string = "NA";


////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/basic/vx_config/config_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class MetConfig : public Dictionary {

void clear();

void dump(ostream &, int = 0) const;
void dump(std::ostream &, int = 0) const;

//
// set stuff
Expand Down
20 changes: 10 additions & 10 deletions src/basic/vx_config/config_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,34 @@ static const char conf_key_old_prepbufr_map[] = "obs_prefbufr_map"; // for ba
extern ConcatString parse_conf_version(Dictionary *dict);
extern ConcatString parse_conf_string(Dictionary *dict, const char *, bool check_empty = true);
extern GrdFileType parse_conf_file_type(Dictionary *dict);
extern map<STATLineType,STATOutputType>
extern std::map<STATLineType,STATOutputType>
parse_conf_output_flag(Dictionary *dict, const STATLineType *, int);
extern map<STATLineType,StringArray>
extern std::map<STATLineType,StringArray>
parse_conf_output_stats(Dictionary *dict);
extern int parse_conf_n_vx(Dictionary *dict);
extern Dictionary parse_conf_i_vx_dict(Dictionary *dict, int index);
extern StringArray parse_conf_tc_model(Dictionary *dict, bool error_out = default_dictionary_error_out);
extern StringArray parse_conf_message_type(Dictionary *dict, bool error_out = default_dictionary_error_out);
extern StringArray parse_conf_sid_list(Dictionary *dict, const char *);
extern void parse_sid_mask(const ConcatString &, StringArray &, ConcatString &);
extern vector<MaskLatLon>
extern std::vector<MaskLatLon>
parse_conf_llpnt_mask(Dictionary *dict);
extern StringArray parse_conf_obs_qty_inc(Dictionary *dict);
extern StringArray parse_conf_obs_qty_exc(Dictionary *dict);
extern NumArray parse_conf_ci_alpha(Dictionary *dict);
extern NumArray parse_conf_eclv_points(Dictionary *dict);
extern ClimoCDFInfo parse_conf_climo_cdf(Dictionary *dict);
extern TimeSummaryInfo parse_conf_time_summary(Dictionary *dict);
extern map<ConcatString,ConcatString> parse_conf_key_value_map(
extern std::map<ConcatString,ConcatString> parse_conf_key_value_map(
Dictionary *dict, const char *conf_key_map_name, const char *caller=0);
extern void parse_add_conf_key_value_map(
Dictionary *dict, const char *conf_key_map_name, map<ConcatString,ConcatString> *m);
extern map<ConcatString,ConcatString>
Dictionary *dict, const char *conf_key_map_name, std::map<ConcatString,ConcatString> *m);
extern std::map<ConcatString,ConcatString>
parse_conf_message_type_map(Dictionary *dict);
extern map<ConcatString,StringArray>
extern std::map<ConcatString,StringArray>
parse_conf_message_type_group_map(Dictionary *dict);
extern map<ConcatString,StringArray> parse_conf_metadata_map(Dictionary *dict);
extern map<ConcatString,ConcatString>
extern std::map<ConcatString,StringArray> parse_conf_metadata_map(Dictionary *dict);
extern std::map<ConcatString,ConcatString>
parse_conf_obs_name_map(Dictionary *dict);
extern BootInfo parse_conf_boot(Dictionary *dict);
extern RegridInfo parse_conf_regrid(Dictionary *dict, bool error_out = default_dictionary_error_out);
Expand All @@ -74,7 +74,7 @@ extern ConcatString parse_conf_tmp_dir(Dictionary *dict);
extern GridDecompType parse_conf_grid_decomp_flag(Dictionary *dict);
extern WaveletType parse_conf_wavelet_type(Dictionary *dict);
extern PlotInfo parse_conf_plot_info(Dictionary *dict);
extern map<ConcatString,ThreshArray>
extern std::map<ConcatString,ThreshArray>
parse_conf_filter_attr_map(Dictionary *dict);
extern void parse_conf_range_int(Dictionary *dict, int &beg, int &end);
extern void parse_conf_range_double(Dictionary *dict, double &beg, double &end);
Expand Down
12 changes: 6 additions & 6 deletions src/basic/vx_config/dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ class DictionaryEntry {

void clear();

void dump(ostream & out, int = 0) const;
void dump(std::ostream & out, int = 0) const;

void dump_config_format(ostream & out, int = 0) const;
void dump_config_format(std::ostream & out, int = 0) const;

//
// set stuff
Expand Down Expand Up @@ -219,9 +219,9 @@ class Dictionary {

void clear();

virtual void dump(ostream &, int = 0) const;
virtual void dump(std::ostream &, int = 0) const;

virtual void dump_config_format(ostream & out, int = 0) const;
virtual void dump_config_format(std::ostream & out, int = 0) const;

//
// set stuff
Expand Down Expand Up @@ -365,9 +365,9 @@ class DictionaryStack {

void clear();

void dump(ostream &, int = 0) const;
void dump(std::ostream &, int = 0) const;

void dump_config_format(ostream & out, int = 0) const;
void dump_config_format(std::ostream & out, int = 0) const;

//
// set stuff
Expand Down
10 changes: 5 additions & 5 deletions src/basic/vx_config/icode.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class IcodeCell {

double as_double() const;

void dump(ostream &, int depth = 0) const;
void dump(std::ostream &, int depth = 0) const;

};

Expand Down Expand Up @@ -203,7 +203,7 @@ class IcodeVector {
void add (const IcodeVector &);
void add_front (const IcodeVector &);

void dump(ostream &, int depth = 0) const;
void dump(std::ostream &, int depth = 0) const;

bool is_mark() const;
bool is_mark(int) const;
Expand Down Expand Up @@ -257,9 +257,9 @@ class CellStack {

int depth() const;

void dump_cell(ostream &, int n, int depth = 0) const;
void dump_cell(std::ostream &, int n, int depth = 0) const;

void dump(ostream &, int depth = 0) const;
void dump(std::ostream &, int depth = 0) const;

};

Expand Down Expand Up @@ -311,7 +311,7 @@ class ICVStack {

void clear();

void dump(ostream &, int depth = 0) const;
void dump(std::ostream &, int depth = 0) const;

};

Expand Down
8 changes: 3 additions & 5 deletions src/basic/vx_config/idstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

#include "indent.h"

using namespace std;

////////////////////////////////////////////////////////////////////////


Expand All @@ -50,13 +48,13 @@ class Identifier {
Identifier(const Identifier &);
Identifier & operator=(const Identifier &);

string name;
std::string name;

void clear();

void set(const char *);

void dump(ostream &, int depth = 0) const;
void dump(std::ostream &, int depth = 0) const;

};

Expand Down Expand Up @@ -143,7 +141,7 @@ class IdentifierArray {

void add(const Identifier &);

void dump(ostream &, int depth = 0) const;
void dump(std::ostream &, int depth = 0) const;

bool has(const char *) const;

Expand Down
14 changes: 7 additions & 7 deletions src/basic/vx_config/threshold.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class ThreshNode {

virtual void multiply_by(const double) = 0;

virtual void get_simple_nodes(vector<Simple_Node> &) const = 0;
virtual void get_simple_nodes(std::vector<Simple_Node> &) const = 0;

ConcatString s;
ConcatString abbr_s;
Expand Down Expand Up @@ -210,7 +210,7 @@ class Or_Node : public ThreshNode {

void multiply_by(const double);

void get_simple_nodes(vector<Simple_Node> &) const;
void get_simple_nodes(std::vector<Simple_Node> &) const;

ThreshNode * left_child;
ThreshNode * right_child;
Expand Down Expand Up @@ -259,7 +259,7 @@ class And_Node : public ThreshNode {

void multiply_by(const double);

void get_simple_nodes(vector<Simple_Node> &) const;
void get_simple_nodes(std::vector<Simple_Node> &) const;

ThreshNode * copy() const;

Expand Down Expand Up @@ -310,7 +310,7 @@ class Not_Node : public ThreshNode {

void multiply_by(const double);

void get_simple_nodes(vector<Simple_Node> &) const;
void get_simple_nodes(std::vector<Simple_Node> &) const;

ThreshNode * copy() const;

Expand Down Expand Up @@ -375,7 +375,7 @@ class Simple_Node : public ThreshNode {

bool need_perc() const;

void get_simple_nodes(vector<Simple_Node> &) const;
void get_simple_nodes(std::vector<Simple_Node> &) const;

//
// do stuff
Expand Down Expand Up @@ -421,7 +421,7 @@ class SingleThresh {
SingleThresh(const char *);
SingleThresh & operator=(const SingleThresh &);

void dump(ostream &, int = 0) const;
void dump(std::ostream &, int = 0) const;

bool operator==(const SingleThresh &) const;

Expand All @@ -446,7 +446,7 @@ class SingleThresh {
PercThreshType get_ptype() const;
double get_pvalue() const;
double get_climo_prob() const;
void get_simple_nodes(vector<Simple_Node> &) const;
void get_simple_nodes(std::vector<Simple_Node> &) const;

void multiply_by(const double);

Expand Down
4 changes: 2 additions & 2 deletions src/basic/vx_log/file_fxns.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ extern ConcatString replace_path(const char * path);

extern int met_open(const char *path, int oflag);

extern void met_open(ifstream &in, const char *path);
extern void met_open(std::ifstream &in, const char *path);

extern void met_open(ofstream &out, const char *path);
extern void met_open(std::ofstream &out, const char *path);

extern FILE * met_fopen(const char *path, const char *mode);

Expand Down
2 changes: 0 additions & 2 deletions src/basic/vx_log/vx_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

////////////////////////////////////////////////////////////////////////

using namespace std;

#include "concat_string.h"
#include "indent.h"
#include "string_array.h"
Expand Down
2 changes: 1 addition & 1 deletion src/basic/vx_math/hist.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ inline int Histogram::too_small_count () const { return ( TooSmallCount ); }
////////////////////////////////////////////////////////////////////////


extern ostream & operator<<(ostream &, const Histogram &);
extern std::ostream & operator<<(std::ostream &, const Histogram &);


////////////////////////////////////////////////////////////////////////
Expand Down
8 changes: 4 additions & 4 deletions src/basic/vx_math/is_bad_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@


inline int is_bad_data(int a) {
if(a == bad_data_int || isnan(a)) return(1);
if(a == bad_data_int || std::isnan(a)) return(1);
else return(0);
}

inline int is_bad_data(long long a) {
if(a == bad_data_ll || isnan(a)) return(1);
if(a == bad_data_ll || std::isnan(a)) return(1);
else return(0);
}

inline int is_bad_data(double a) {
if(fabs(a - bad_data_double) < default_tol || isnan(a)) return(1);
if(fabs(a - bad_data_double) < default_tol || std::isnan(a)) return(1);
else return(0);
}

inline int is_bad_data(float a) {
if(fabs(a - bad_data_float) < default_tol || isnan(a)) return(1);
if(fabs(a - bad_data_float) < default_tol || std::isnan(a)) return(1);
else return(0);
}

Expand Down
2 changes: 1 addition & 1 deletion src/basic/vx_math/pwl.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class PiecewiseLinear {

void clear();

void dump(ostream &, int depth = 0) const;
void dump(std::ostream &, int depth = 0) const;

//
// set stuff
Expand Down
4 changes: 2 additions & 2 deletions src/basic/vx_math/vx_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Vector {

void clear();

void dump(ostream &, int = 0) const;
void dump(std::ostream &, int = 0) const;

//
// set stuff
Expand Down Expand Up @@ -166,7 +166,7 @@ extern void latlon_to_vector(double lat, double lon, double & x, double & y, d
////////////////////////////////////////////////////////////////////////


extern ostream & operator<<(ostream &, const Vector &);
extern std::ostream & operator<<(std::ostream &, const Vector &);


////////////////////////////////////////////////////////////////////////
Expand Down
3 changes: 1 addition & 2 deletions src/basic/vx_util/GridOffset.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// Mod# Date Name Description
// ---- ---- ---- -----------
// 000 01-01-99 Rehak Initial version.
// 001 09-06-22 Prestopnik MET #2227 Remove namesapce std from header files
//
///////////////////////////////////////////////////////////////////////////////

Expand All @@ -29,8 +30,6 @@

///////////////////////////////////////////////////////////////////////////////

using namespace std;

class GridOffset
{
public:
Expand Down
Loading

0 comments on commit 5466007

Please sign in to comment.