MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / nextId

Method nextId

source/core/StarIdMap.hpp:90–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89template <typename BaseMap>
90auto IdMapWrapper<BaseMap>::nextId() -> IdType {
91 if ((IdType)BaseMap::size() > m_max - m_min)
92 throw IdMapException("No id space left in IdMapWrapper");
93
94 IdType nextId = m_nextId;
95 while (BaseMap::contains(nextId))
96 nextId = cycleIncrement(nextId, m_min, m_max);
97 m_nextId = cycleIncrement(nextId, m_min, m_max);
98 return nextId;
99}
100
101template <typename BaseMap>
102void IdMapWrapper<BaseMap>::add(IdType id, MappedType mappedType) {

Callers 1

acceptConnectionMethod · 0.80

Calls 2

sizeFunction · 0.85
cycleIncrementFunction · 0.85

Tested by

no test coverage detected