Remove redundant virtual modifiers, add override and final modifiers

depth-refraction
elsid 2 years ago
parent a09612264c
commit c03d3360d9
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -100,7 +100,7 @@ namespace CSMWorld
public:
Collection();
virtual ~Collection();
~Collection() override;
void add(const ESXRecordT& record);
///< Add a new record (modified)
@ -119,10 +119,10 @@ namespace CSMWorld
const ColumnBase& getColumn(int column) const override;
virtual void merge();
void merge();
///< Merge modified into base.
virtual void purge();
void purge();
///< Remove records that are flagged as erased.
void removeRows(int index, int count) override;

@ -276,19 +276,6 @@ void CSMWorld::RefCollection::removeRows(int index, int count)
}
}
void CSMWorld::RefCollection::appendBlankRecord(const std::string& id, UniversalId::Type type)
{
auto record = std::make_unique<Record<CellRef>>();
record->mState = Record<CellRef>::State_ModifiedOnly;
record->mModified.blank();
record->get().mId = ESM::RefId::stringRefId(id);
record->get().mIdNum = extractIdNum(id);
Collection<CellRef>::appendRecord(std::move(record));
}
void CSMWorld::RefCollection::appendBlankRecord(const ESM::RefId& id, UniversalId::Type type)
{
auto record = std::make_unique<Record<CellRef>>();
@ -316,11 +303,6 @@ void CSMWorld::RefCollection::cloneRecord(
insertRecord(std::move(copy), getAppendIndex(destination, type)); // call RefCollection::insertRecord()
}
int CSMWorld::RefCollection::searchId(std::string_view id) const
{
return searchId(extractIdNum(id));
}
int CSMWorld::RefCollection::searchId(const ESM::RefId& id) const
{
return searchId(extractIdNum(id.getRefIdString()));

@ -34,7 +34,7 @@ namespace CSMWorld
void Collection<CellRef>::insertRecord(std::unique_ptr<RecordBase> record, int index, UniversalId::Type type);
/// \brief References in cells
class RefCollection : public Collection<CellRef>
class RefCollection final : public Collection<CellRef>
{
Collection<Cell>& mCells;
std::map<unsigned int, int> mRefIndex; // CellRef index keyed by CSMWorld::CellRef::mIdNum
@ -61,20 +61,19 @@ namespace CSMWorld
std::string getNewId();
virtual void removeRows(int index, int count);
void removeRows(int index, int count) override;
virtual void appendBlankRecord(const std::string& id, UniversalId::Type type = UniversalId::Type_None);
virtual void appendBlankRecord(const ESM::RefId& id, UniversalId::Type type = UniversalId::Type_None);
void appendBlankRecord(const ESM::RefId& id, UniversalId::Type type = UniversalId::Type_None) override;
virtual void cloneRecord(const ESM::RefId& origin, const ESM::RefId& destination, const UniversalId::Type type);
void cloneRecord(
const ESM::RefId& origin, const ESM::RefId& destination, const UniversalId::Type type) override;
virtual int searchId(std::string_view id) const;
virtual int searchId(const ESM::RefId& id) const;
int searchId(const ESM::RefId& id) const override;
virtual void appendRecord(std::unique_ptr<RecordBase> record, UniversalId::Type type = UniversalId::Type_None);
void appendRecord(std::unique_ptr<RecordBase> record, UniversalId::Type type = UniversalId::Type_None) override;
virtual void insertRecord(
std::unique_ptr<RecordBase> record, int index, UniversalId::Type type = UniversalId::Type_None);
void insertRecord(
std::unique_ptr<RecordBase> record, int index, UniversalId::Type type = UniversalId::Type_None) override;
};
}

@ -14,7 +14,7 @@ namespace CSMWorld
/// \brief Single type collection of top level records that are associated with cells
template <typename ESXRecordT>
class SubCellCollection : public NestedIdCollection<ESXRecordT>
class SubCellCollection final : public NestedIdCollection<ESXRecordT>
{
const IdCollection<Cell>& mCells;

Loading…
Cancel
Save