Commit a2e746b0 authored by Ben Boeckel's avatar Ben Boeckel

clang-tidy: add 'override' keyword where applicable

Some instances were missed here due to those not being compiled with the
build settings I used; they can be picked out a lot easier now though.
parent 1f735d7f
......@@ -26,10 +26,10 @@ public:
@ARG_CLASS_NAME@Implementation(QObject* p);
~@ARG_CLASS_NAME@Implementation();
virtual QString viewName() const;
QString viewName() const override;
/// return a static constructor for derived class of qtBaseView
virtual qtSMTKViewConstructor viewConstructor();
qtSMTKViewConstructor viewConstructor() override;
protected:
qtSMTKViewConstructor view_constructor_pointer;
......
......@@ -20,10 +20,10 @@ public:
// -- 1 --
// ++ 2 ++
virtual bool ableToOperate() { return this->ensureSpecification(); }
bool ableToOperate() override { return this->ensureSpecification(); }
protected:
virtual smtk::model::OperatorResult operateInternal();
smtk::model::OperatorResult operateInternal() override;
// -- 2 --
};
......
......@@ -27,6 +27,6 @@
#define SMTK_DERIVED_TYPE(thisclass, superclass) \
typedef superclass Superclass; \
SMTK_BASE_TYPE(thisclass)
const char* classname() const override { return #thisclass; }
#endif //__smtk_SystemConfig_h
......@@ -31,9 +31,9 @@ class SMTKCORE_EXPORT DateTimeItem : public Item
public:
smtkTypeMacro(DateTimeItem);
virtual ~DateTimeItem();
virtual Item::Type type() const;
virtual bool isValid() const;
~DateTimeItem() override;
Item::Type type() const override;
bool isValid() const override;
std::size_t numberOfValues() const { return this->m_values.size(); }
bool setNumberOfValues(std::size_t newSize);
......@@ -44,7 +44,7 @@ public:
}
bool setValue(const ::smtk::common::DateTimeZonePair& val) { return this->setValue(0, val); }
bool setValue(std::size_t element, const ::smtk::common::DateTimeZonePair& val);
virtual void reset();
void reset() override;
virtual bool setToDefault(std::size_t elementIndex = 0);
// Returns true if there is a default defined and the item is curently set to it
virtual bool isUsingDefault(std::size_t elementIndex) const;
......@@ -55,12 +55,12 @@ public:
// Assigns this item to be equivalent to another. Options are processed by derived item classes.
// The options are defined in Item.h. Returns true if success and false if a problem occured.
virtual bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0);
bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0) override;
protected:
DateTimeItem(Attribute* owningAttribute, int itemPosition);
DateTimeItem(Item* owningItem, int myPosition, int mySubGroupPosition);
virtual bool setDefinition(smtk::attribute::ConstItemDefinitionPtr def);
bool setDefinition(smtk::attribute::ConstItemDefinitionPtr def) override;
ConstDateTimeItemDefinitionPtr itemDefinition() const;
std::vector< ::smtk::common::DateTimeZonePair> m_values;
std::vector<bool> m_isSet;
......
......@@ -31,8 +31,8 @@ public:
return smtk::attribute::DateTimeItemDefinitionPtr(new DateTimeItemDefinition(myName));
}
virtual ~DateTimeItemDefinition();
virtual Item::Type type() const;
~DateTimeItemDefinition() override;
Item::Type type() const override;
const ::smtk::common::DateTimeZonePair& defaultValue() const { return this->m_defaultValue; }
bool setDefaultValue(const ::smtk::common::DateTimeZonePair& value);
......@@ -60,12 +60,12 @@ public:
void setEnableCalendarPopup(bool mode) { this->m_useCalendarPopup = mode; }
bool useCalendarPopup() const { return m_useCalendarPopup; }
virtual smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const;
virtual smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const;
smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const override;
smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const override;
virtual smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const;
smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const override;
protected:
DateTimeItemDefinition(const std::string& myName);
......
......@@ -31,8 +31,8 @@ class SMTKCORE_EXPORT DirectoryItem : public FileSystemItem
public:
smtkTypeMacro(DirectoryItem);
virtual ~DirectoryItem();
virtual Item::Type type() const;
~DirectoryItem() override;
Item::Type type() const override;
protected:
DirectoryItem(Attribute* owningAttribute, int itemPosition);
......
......@@ -32,16 +32,16 @@ public:
return smtk::attribute::DirectoryItemDefinitionPtr(new DirectoryItemDefinition(myName));
}
virtual ~DirectoryItemDefinition();
~DirectoryItemDefinition() override;
virtual Item::Type type() const;
Item::Type type() const override;
virtual smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const;
virtual smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const;
smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const override;
smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const override;
virtual smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const;
smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const override;
protected:
DirectoryItemDefinition(const std::string& myName);
......
......@@ -29,14 +29,14 @@ class SMTKCORE_EXPORT DoubleItem : public ValueItemTemplate<double>
public:
smtkTypeMacro(DoubleItem);
virtual ~DoubleItem();
virtual Item::Type type() const;
~DoubleItem() override;
Item::Type type() const override;
// Assigns this item to be equivalent to another. Options are processed by derived item classes
// Returns true if success and false if a problem occured. By default, an attribute being used by this
// to represent an expression will be copied if needed. Use IGNORE_EXPRESSIONS option to prevent this
// When an expression attribute is copied, its model associations are by default not.
// Use COPY_MODEL_ASSOCIATIONS if you want them copied as well.These options are defined in Item.h .
virtual bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0);
bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0) override;
protected:
DoubleItem(Attribute* owningAttribute, int itemPosition);
......
......@@ -29,14 +29,14 @@ public:
return smtk::attribute::DoubleItemDefinitionPtr(new DoubleItemDefinition(myName));
}
virtual ~DoubleItemDefinition();
virtual Item::Type type() const;
virtual smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const;
virtual smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const;
virtual smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const;
~DoubleItemDefinition() override;
Item::Type type() const override;
smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const override;
smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const override;
smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const override;
protected:
DoubleItemDefinition(const std::string& myName);
......
......@@ -31,9 +31,9 @@ class SMTKCORE_EXPORT FileItem : public FileSystemItem
public:
smtkTypeMacro(FileItem);
virtual ~FileItem();
~FileItem() override;
Item::Type type() const;
Item::Type type() const override;
const std::vector<std::string>& recentValues() const { return this->m_recentValues; }
void addRecentValue(const std::string& val);
......@@ -41,7 +41,7 @@ public:
protected:
FileItem(Attribute* owningAttribute, int itemPosition);
FileItem(Item* owningItem, int position, int subGroupPosition);
virtual bool setDefinition(smtk::attribute::ConstItemDefinitionPtr vdef);
bool setDefinition(smtk::attribute::ConstItemDefinitionPtr vdef) override;
std::vector<std::string> m_recentValues;
......
......@@ -33,23 +33,23 @@ public:
return smtk::attribute::FileItemDefinitionPtr(new FileItemDefinition(myName));
}
virtual ~FileItemDefinition();
~FileItemDefinition() override;
virtual Item::Type type() const;
virtual bool isValueValid(const std::string& val) const;
Item::Type type() const override;
bool isValueValid(const std::string& val) const override;
// return the index of the filter that accepts val, or -1 if the value is
// invalid
int filterId(const std::string& val) const;
virtual smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const;
virtual smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const;
smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const override;
smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const override;
const std::string& getFileFilters() const { return this->m_fileFilters; }
void setFileFilters(const std::string& filters) { this->m_fileFilters = filters; }
virtual smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const;
smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const override;
protected:
FileItemDefinition(const std::string& myName);
......
......@@ -33,9 +33,9 @@ public:
typedef std::vector<std::string>::const_iterator const_iterator;
smtkTypeMacro(FileSystemItem);
virtual ~FileSystemItem();
virtual Item::Type type() const = 0;
virtual bool isValid() const;
~FileSystemItem() override;
Item::Type type() const override = 0;
bool isValid() const override;
bool shouldBeRelative() const;
bool shouldExist() const;
std::size_t numberOfValues() const { return this->m_values.size(); }
......@@ -48,7 +48,7 @@ public:
bool setValue(std::size_t element, const std::string& val);
bool appendValue(const std::string& val);
bool removeValue(int element);
virtual void reset();
void reset() override;
virtual bool setToDefault(std::size_t elementIndex = 0);
// Returns true if there is a default defined and the item is curently set to it
virtual bool isUsingDefault(std::size_t elementIndex) const;
......@@ -75,12 +75,12 @@ public:
// Assigns this item to be equivalent to another. Options are processed by derived item classes
// Returns true if success and false if a problem occured. Does not use options.
virtual bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0);
bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0) override;
protected:
FileSystemItem(Attribute* owningAttribute, int itemPosition);
FileSystemItem(Item* owningItem, int position, int subGroupPosition);
virtual bool setDefinition(smtk::attribute::ConstItemDefinitionPtr vdef);
bool setDefinition(smtk::attribute::ConstItemDefinitionPtr vdef) override;
std::vector<std::string> m_values;
std::vector<bool> m_isSet;
......
......@@ -29,9 +29,9 @@ class SMTKCORE_EXPORT FileSystemItemDefinition : public ItemDefinition
public:
smtkTypeMacro(FileSystemItemDefinition);
virtual ~FileSystemItemDefinition();
~FileSystemItemDefinition() override;
virtual Item::Type type() const;
Item::Type type() const override;
virtual bool isValueValid(const std::string& val) const;
// Returns or Sets the def's extensiblity property. If true then items from this def
......@@ -66,13 +66,13 @@ public:
void setDefaultValue(const std::string& val);
void unsetDefaultValue() { this->m_hasDefault = false; }
bool hasDefault() const { return m_hasDefault; }
virtual smtk::attribute::ItemPtr buildItem(
Attribute* owningAttribute, int itemPosition) const = 0;
virtual smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const = 0;
smtk::attribute::ItemPtr buildItem(
Attribute* owningAttribute, int itemPosition) const override = 0;
smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const override = 0;
virtual smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const = 0;
smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const override = 0;
protected:
FileSystemItemDefinition(const std::string& myName);
......
......@@ -53,9 +53,9 @@ public:
typedef std::vector<std::vector<smtk::attribute::ItemPtr> >::const_iterator const_iterator;
smtkTypeMacro(GroupItem);
virtual ~GroupItem();
virtual Item::Type type() const;
virtual bool isValid() const;
~GroupItem() override;
Item::Type type() const override;
bool isValid() const override;
std::size_t numberOfRequiredGroups() const;
std::size_t maxNumberOfGroups() const;
/**
......@@ -65,8 +65,8 @@ public:
* @param visitor a lambda function which would be applied on children items
* @param activeChildren a flag indicating whether it should be applied to active children only or not
*/
virtual void visitChildren(
std::function<void(smtk::attribute::ItemPtr, bool)> visitor, bool activeChildren = true);
void visitChildren(std::function<void(smtk::attribute::ItemPtr, bool)> visitor,
bool activeChildren = true) override;
bool isExtensible() const;
......@@ -112,7 +112,7 @@ public:
template <typename T>
typename T::ConstPtr findAs(const std::string& name) const;
virtual void reset();
void reset() override;
// Iterator-style access to values:
const_iterator begin() const;
......@@ -121,12 +121,12 @@ public:
// Assigns this item to be equivalent to another. Options are processed by derived item classes
// Returns true if success and false if a problem occured - options are use when copying sub-items.
// See Items.h for a description of these options.
virtual bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0);
bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0) override;
protected:
GroupItem(Attribute* owningAttribute, int itemPosition);
GroupItem(Item* owningItem, int myPosition, int mySubGroupPosition);
virtual bool setDefinition(smtk::attribute::ConstItemDefinitionPtr def);
bool setDefinition(smtk::attribute::ConstItemDefinitionPtr def) override;
// This method will detach all of the items directly owned by
// this group
void detachAllItems();
......
......@@ -33,8 +33,8 @@ public:
return smtk::attribute::GroupItemDefinitionPtr(new GroupItemDefinition(myName));
}
virtual ~GroupItemDefinition();
virtual Item::Type type() const;
~GroupItemDefinition() override;
Item::Type type() const override;
std::size_t numberOfItemDefinitions() const { return this->m_itemDefs.size(); }
smtk::attribute::ItemDefinitionPtr itemDefinition(int ith) const
{
......@@ -101,19 +101,19 @@ public:
bool usingCommonSubGroupLabel() const { return this->m_useCommonLabel; }
std::string subGroupLabel(std::size_t element) const;
virtual smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const;
virtual smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const;
smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const override;
smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const override;
void buildGroup(smtk::attribute::GroupItem* group, int subGroupPosition) const;
virtual void addCategory(const std::string& category);
virtual void removeCategory(const std::string& category);
void addCategory(const std::string& category) override;
void removeCategory(const std::string& category) override;
virtual smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const;
smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const override;
protected:
GroupItemDefinition(const std::string& myname);
virtual void updateCategories();
void updateCategories() override;
std::vector<smtk::attribute::ItemDefinitionPtr> m_itemDefs;
std::map<std::string, int> m_itemDefPositions;
std::vector<std::string> m_labels;
......
......@@ -29,14 +29,14 @@ class SMTKCORE_EXPORT IntItem : public ValueItemTemplate<int>
public:
smtkTypeMacro(IntItem);
virtual ~IntItem();
virtual Item::Type type() const;
~IntItem() override;
Item::Type type() const override;
// Assigns this item to be equivalent to another. Options are processed by derived item classes
// Returns true if success and false if a problem occured. By default, an attribute being used by this
// to represent an expression will be copied if needed. Use IGNORE_EXPRESSIONS option to prevent this
// When an expression attribute is copied, its model associations are by default not.
// Use COPY_MODEL_ASSOCIATIONS if you want them copied as well.These options are defined in Item.h .
virtual bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0);
bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0) override;
protected:
IntItem(Attribute* owningAttribute, int itemPosition);
......
......@@ -29,14 +29,14 @@ public:
return smtk::attribute::IntItemDefinitionPtr(new IntItemDefinition(myName));
}
virtual ~IntItemDefinition();
virtual Item::Type type() const;
virtual smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const;
virtual smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const;
virtual smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const;
~IntItemDefinition() override;
Item::Type type() const override;
smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const override;
smtk::attribute::ItemPtr buildItem(
Item* owningItem, int position, int subGroupPosition) const override;
smtk::attribute::ItemDefinitionPtr createCopy(
smtk::attribute::ItemDefinition::CopyInfo& info) const override;
protected:
IntItemDefinition(const std::string& myName);
......
......@@ -34,9 +34,9 @@ public:
typedef smtk::mesh::MeshList::iterator mesh_it;
smtkTypeMacro(MeshItem);
virtual ~MeshItem();
virtual Item::Type type() const;
virtual bool isValid() const;
~MeshItem() override;
Item::Type type() const override;
bool isValid() const override;
std::size_t numberOfRequiredValues() const;
bool isExtensible() const;
......@@ -56,10 +56,10 @@ public:
std::size_t numberOfValues() const;
bool setNumberOfValues(std::size_t newSize);
const smtk::mesh::MeshList& values() const;
virtual void reset();
void reset() override;
// Assigns this item to be equivalent to another. Options are processed by derived item classes
// Returns true if success and false if a problem occured.
virtual bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0);
bool assign(smtk::attribute::ConstItemPtr& sourceItem, unsigned int options = 0) override;
const_mesh_it begin() const;
const_mesh_it end() const;
......@@ -70,7 +70,7 @@ protected:
MeshItem(Attribute* owningAttribute, int itemPosition);
MeshItem(Item* owningItem, int position, int subGroupPosition);
virtual bool setDefinition(smtk::attribute::ConstItemDefinitionPtr vdef);
bool setDefinition(smtk::attribute::ConstItemDefinitionPtr vdef) override;
smtk::mesh::MeshList m_meshValues;
};
......
......@@ -34,9 +34,9 @@ public:
return smtk::attribute::MeshItemDefinitionPtr(new MeshItemDefinition(myName));
}