Skip to content

Commit 62108e5

Browse files
authored
Merge pull request #811 from UWB-Biocomputing/ShaikhDevelopment
[ISSUE-791] Refactor neuronTypeToString() from Global.cpp
2 parents 224099a + 07ef090 commit 62108e5

File tree

4 files changed

+20
-49
lines changed

4 files changed

+20
-49
lines changed

Simulator/Utils/Global.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,6 @@ string coordToString(int x, int y, int z)
5353
return ss.str();
5454
}
5555

56-
// MODEL INDEPENDENT FUNCTION NMV-BEGIN {
57-
string neuronTypeToString(vertexType t)
58-
{
59-
switch (t) {
60-
case vertexType::INH:
61-
return "INH";
62-
case vertexType::EXC:
63-
return "EXC";
64-
default:
65-
cerr << "ERROR->neuronTypeToString() failed, unknown type: " << t << endl;
66-
assert(false);
67-
return nullptr; // Must return a value -- this will probably cascade to another failure
68-
}
69-
}
70-
// } NMV-END
7156
#if defined(USE_GPU)
7257
//! CUDA device ID
7358
int g_deviceId = 0;

Simulator/Utils/Global.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -91,38 +91,6 @@ extern uint64_t g_simulationStep;
9191

9292
const int g_nMaxChunkSize = 100;
9393

94-
// NETWORK MODEL VARIABLES NMV-BEGIN {
95-
// Vertex types.
96-
// NEURO:
97-
// INH - Inhibitory neuron
98-
// EXC - Excitory neuron
99-
// NG911:
100-
// CALR: Caller radii
101-
// PSAP: PSAP nodes
102-
// EMS, FIRE, LAW: Responder nodes
103-
/*
104-
// Moved to Utils/VertexType.h
105-
enum class vertexType {
106-
// Neuro
107-
INH = 1,
108-
EXC = 2,
109-
// NG911
110-
CALR = 3,
111-
PSAP = 4,
112-
EMS = 5,
113-
FIRE = 6,
114-
LAW = 7,
115-
// UNDEF
116-
VTYPE_UNDEF = 0
117-
};
118-
// Custom streaming operator<< for the enum class vertexType
119-
inline std::ostream &operator<<(std::ostream &os, vertexType vT)
120-
{
121-
os << static_cast<int>(vT);
122-
return os;
123-
}
124-
*/
125-
12694
// Edge types.
12795
// NEURO:
12896
// II - Synapse from inhibitory neuron to inhibitory neuron.
@@ -195,8 +163,6 @@ string index2dToString(int i, int width, int height);
195163
string coordToString(int x, int y);
196164
// Converts a 3-d coordinate into a string.
197165
string coordToString(int x, int y, int z);
198-
// Converts a vertexType into a string.
199-
string neuronTypeToString(vertexType t);
200166

201167
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v)
202168
{

Simulator/Vertices/AllVertices.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@
99
#include "AllVertices.h"
1010
#include "OperationManager.h"
1111

12+
// Utility function to convert a vertexType into a string.
13+
// MODEL INDEPENDENT FUNCTION NMV-BEGIN {
14+
string vertexTypeToString(vertexType t)
15+
{
16+
switch (t) {
17+
case vertexType::INH:
18+
return "INH";
19+
case vertexType::EXC:
20+
return "EXC";
21+
default:
22+
cerr << "ERROR->vertexTypeToString() failed, unknown type: " << t << endl;
23+
assert(false);
24+
return nullptr; // Must return a value -- this will probably cascade to another failure
25+
}
26+
}
27+
// } NMV-END
28+
1229
// Default constructor
1330
AllVertices::AllVertices() : size_(0)
1431
{

Simulator/Vertices/AllVertices.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ using namespace std;
3333
// cereal
3434
#include "cereal/types/vector.hpp"
3535

36+
// Utility function to convert a vertexType into a string.
37+
string vertexTypeToString(vertexType t);
38+
3639
class Layout;
3740
class AllEdges;
3841
struct AllVerticesDeviceProperties;

0 commit comments

Comments
 (0)