Skip to content

Commit d6462a2

Browse files
committed
Rename and update class
Signed-off-by: Arjo Chakravarty <arjoc@google.com>
1 parent 27558cd commit d6462a2

4 files changed

+17
-13
lines changed

src/SystemContainer.hpp src/SystemContainer.hh

+14-10
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
#include <cstddef>
2323
#include <functional>
2424

25+
#include "gz/sim/config.hh"
26+
2527
namespace gz
2628
{
2729
namespace sim
2830
{
31+
inline namespace GZ_SIM_VERSION_NAMESPACE {
2932
//////////////////////////////////////////////////
3033
/// This container implements a simple masked vector.
3134
/// Using a masked vector for systems ensures that
@@ -103,7 +106,7 @@ namespace gz
103106
private: std::vector<std::size_t> freeSpots;
104107

105108
//////////////////////////////////////////
106-
class iterator {
109+
class Iterator {
107110
std::size_t num;
108111
SystemContainer<T>* parent;
109112
public:
@@ -112,12 +115,12 @@ namespace gz
112115
using difference_type = long;
113116
using pointer = T*;
114117
using reference = T&;
115-
explicit iterator(SystemContainer<T>* _parent, std::size_t _num = 0) :
118+
explicit Iterator(SystemContainer<T>* _parent, std::size_t _num = 0) :
116119
num(_num), parent(_parent)
117120
{
118121

119122
}
120-
iterator& operator++() {
123+
Iterator& operator++() {
121124
auto end = parent->end();
122125
// O(n) for now
123126
do {
@@ -126,36 +129,37 @@ namespace gz
126129

127130
return *this;
128131
}
129-
bool operator==(iterator other) const { return num == other.num; }
130-
bool operator!=(iterator other) const { return !(*this == other); }
132+
bool operator==(Iterator other) const { return num == other.num; }
133+
bool operator!=(Iterator other) const { return !(*this == other); }
131134
T& operator*() const {
132135
return parent->systems[num];
133136
}
134137
};
135138

136139
//////////////////////////////////////////
137-
public: iterator begin()
140+
public: Iterator begin()
138141
{
139-
return iterator(this);
142+
return Iterator(this);
140143
}
141144

142145
//////////////////////////////////////////
143-
public: iterator end()
146+
public: Iterator end()
144147
{
145148
auto lastIdx = this->occupied.size();
146149

147150
if (lastIdx == 0)
148151
{
149-
return iterator(this);
152+
return Iterator(this);
150153
}
151154

152155
while(!this->occupied[lastIdx-1] && lastIdx != 0)
153156
{
154157
lastIdx--;
155158
}
156-
return iterator(this, lastIdx);
159+
return Iterator(this, lastIdx);
157160
}
158161
};
162+
}
159163
}
160164
}
161165

src/SystemContainer_TEST.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
#include <gtest/gtest.h>
1818
#include <unordered_set>
19-
#include "SystemContainer.hpp"
19+
#include "SystemContainer.hh"
2020

2121
using namespace gz::sim;
2222

src/SystemManager.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include <gz/common/StringUtils.hh>
2424

25-
#include "SystemContainer.hpp"
25+
#include "SystemContainer.hh"
2626
#include "SystemInternal.hh"
2727
#include "gz/sim/components/SystemPluginInfo.hh"
2828
#include "gz/sim/Conversions.hh"

src/SystemManager.hh

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "gz/sim/SystemLoader.hh"
3535
#include "gz/sim/Types.hh"
3636

37-
#include "SystemContainer.hpp"
37+
#include "SystemContainer.hh"
3838
#include "SystemInternal.hh"
3939

4040
namespace gz

0 commit comments

Comments
 (0)