Skip to content

[ISSUE-791] Refactor neuronTypeToString() from Global.cpp #811

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

Open
wants to merge 3 commits into
base: SharedDevelopment
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
15 changes: 0 additions & 15 deletions Simulator/Utils/Global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,6 @@ string coordToString(int x, int y, int z)
return ss.str();
}

// MODEL INDEPENDENT FUNCTION NMV-BEGIN {
string neuronTypeToString(vertexType t)
{
switch (t) {
case vertexType::INH:
return "INH";
case vertexType::EXC:
return "EXC";
default:
cerr << "ERROR->neuronTypeToString() failed, unknown type: " << t << endl;
assert(false);
return nullptr; // Must return a value -- this will probably cascade to another failure
}
}
// } NMV-END
#if defined(USE_GPU)
//! CUDA device ID
int g_deviceId = 0;
Expand Down
34 changes: 0 additions & 34 deletions Simulator/Utils/Global.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,38 +91,6 @@ extern uint64_t g_simulationStep;

const int g_nMaxChunkSize = 100;

// NETWORK MODEL VARIABLES NMV-BEGIN {
// Vertex types.
// NEURO:
// INH - Inhibitory neuron
// EXC - Excitory neuron
// NG911:
// CALR: Caller radii
// PSAP: PSAP nodes
// EMS, FIRE, LAW: Responder nodes
/*
// Moved to Utils/VertexType.h
enum class vertexType {
// Neuro
INH = 1,
EXC = 2,
// NG911
CALR = 3,
PSAP = 4,
EMS = 5,
FIRE = 6,
LAW = 7,
// UNDEF
VTYPE_UNDEF = 0
};
// Custom streaming operator<< for the enum class vertexType
inline std::ostream &operator<<(std::ostream &os, vertexType vT)
{
os << static_cast<int>(vT);
return os;
}
*/

// Edge types.
// NEURO:
// II - Synapse from inhibitory neuron to inhibitory neuron.
Expand Down Expand Up @@ -195,8 +163,6 @@ string index2dToString(int i, int width, int height);
string coordToString(int x, int y);
// Converts a 3-d coordinate into a string.
string coordToString(int x, int y, int z);
// Converts a vertexType into a string.
string neuronTypeToString(vertexType t);

template <typename T> ostream &operator<<(ostream &os, const vector<T> &v)
{
Expand Down
17 changes: 17 additions & 0 deletions Simulator/Vertices/AllVertices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@
#include "AllVertices.h"
#include "OperationManager.h"

// Utility function to convert a vertexType into a string.
// MODEL INDEPENDENT FUNCTION NMV-BEGIN {
string vertexTypeToString(vertexType t)
{
switch (t) {
case vertexType::INH:
return "INH";
case vertexType::EXC:
return "EXC";
default:
cerr << "ERROR->vertexTypeToString() failed, unknown type: " << t << endl;
assert(false);
return nullptr; // Must return a value -- this will probably cascade to another failure
}
}
// } NMV-END

// Default constructor
AllVertices::AllVertices() : size_(0)
{
Expand Down
3 changes: 3 additions & 0 deletions Simulator/Vertices/AllVertices.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ using namespace std;
// cereal
#include "cereal/types/vector.hpp"

// Utility function to convert a vertexType into a string.
string vertexTypeToString(vertexType t);

class Layout;
class AllEdges;
struct AllVerticesDeviceProperties;
Expand Down