Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove using namespace std from header files #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions examples/OSMPDummySensor/OSMPDummySensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#include "OSMPDummySensorConfig.h"

using namespace std;

#ifndef FMU_SHARED_OBJECT
#define FMI2_FUNCTION_PREFIX OSMPDummySensor_
#endif
Expand Down Expand Up @@ -122,7 +120,7 @@ class COSMPDummySensor {
protected:
/* Private File-based Logging just for Debugging */
#ifdef PRIVATE_LOG_PATH
static ofstream private_log_file;
static std::ofstream private_log_file;
#endif

static void fmi_verbose_log_global(const char* format, ...) {
Expand Down Expand Up @@ -157,9 +155,9 @@ class COSMPDummySensor {
#endif
#ifdef PRIVATE_LOG_PATH
if (!private_log_file.is_open())
private_log_file.open(PRIVATE_LOG_PATH, ios::out | ios::app);
private_log_file.open(PRIVATE_LOG_PATH, std::ios::out | std::ios::app);
if (private_log_file.is_open()) {
private_log_file << "OSMPDummySensor" << "::" << instanceName << "<" << ((void*)this) << ">:" << category << ": " << buffer << endl;
private_log_file << "OSMPDummySensor" << "::" << instanceName << "<" << ((void*)this) << ">:" << category << ": " << buffer << std::endl;
private_log_file.flush();
}
#endif
Expand Down Expand Up @@ -191,23 +189,23 @@ class COSMPDummySensor {

protected:
/* Members */
string instanceName;
std::string instanceName;
fmi2Type fmuType;
string fmuGUID;
string fmuResourceLocation;
std::string fmuGUID;
std::string fmuResourceLocation;
bool visible;
bool loggingOn;
set<string> loggingCategories;
std::set<std::string> loggingCategories;
fmi2CallbackFunctions functions;
fmi2Boolean boolean_vars[FMI_BOOLEAN_VARS];
fmi2Integer integer_vars[FMI_INTEGER_VARS];
fmi2Real real_vars[FMI_REAL_VARS];
string string_vars[FMI_STRING_VARS];
std::string string_vars[FMI_STRING_VARS];
bool simulation_started;
string* currentOutputBuffer;
string* lastOutputBuffer;
string* currentConfigRequestBuffer;
string* lastConfigRequestBuffer;
std::string* currentOutputBuffer;
std::string* lastOutputBuffer;
std::string* currentConfigRequestBuffer;
std::string* lastConfigRequestBuffer;

/* Simple Accessors */
fmi2Boolean fmi_valid() { return boolean_vars[FMI_BOOLEAN_VALID_IDX]; }
Expand Down
22 changes: 10 additions & 12 deletions examples/OSMPDummySource/OSMPDummySource.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#include "OSMPDummySourceConfig.h"

using namespace std;

#ifndef FMU_SHARED_OBJECT
#define FMI2_FUNCTION_PREFIX OSMPDummySource_
#endif
Expand Down Expand Up @@ -111,7 +109,7 @@ class COSMPDummySource {
protected:
/* Private File-based Logging just for Debugging */
#ifdef PRIVATE_LOG_PATH
static ofstream private_log_file;
static std::ofstream private_log_file;
#endif

static void fmi_verbose_log_global(const char* format, ...) {
Expand Down Expand Up @@ -146,9 +144,9 @@ class COSMPDummySource {
#endif
#ifdef PRIVATE_LOG_PATH
if (!private_log_file.is_open())
private_log_file.open(PRIVATE_LOG_PATH, ios::out | ios::app);
private_log_file.open(PRIVATE_LOG_PATH, std::ios::out | std::ios::app);
if (private_log_file.is_open()) {
private_log_file << "OSMPDummySource" << "::" << instanceName << "<" << ((void*)this) << ">:" << category << ": " << buffer << endl;
private_log_file << "OSMPDummySource" << "::" << instanceName << "<" << ((void*)this) << ">:" << category << ": " << buffer << std::endl;
private_log_file.flush();
}
#endif
Expand Down Expand Up @@ -180,20 +178,20 @@ class COSMPDummySource {

protected:
/* Members */
string instanceName;
std::string instanceName;
fmi2Type fmuType;
string fmuGUID;
string fmuResourceLocation;
std::string fmuGUID;
std::string fmuResourceLocation;
bool visible;
bool loggingOn;
set<string> loggingCategories;
std::set<std::string> loggingCategories;
fmi2CallbackFunctions functions;
fmi2Boolean boolean_vars[FMI_BOOLEAN_VARS];
fmi2Integer integer_vars[FMI_INTEGER_VARS];
fmi2Real real_vars[FMI_REAL_VARS];
string string_vars[FMI_STRING_VARS];
string* currentBuffer;
string* lastBuffer;
std::string string_vars[FMI_STRING_VARS];
std::string* currentBuffer;
std::string* lastBuffer;

/* Simple Accessors */
fmi2Boolean fmi_valid() { return boolean_vars[FMI_BOOLEAN_VALID_IDX]; }
Expand Down