Skip to content

Commit

Permalink
Make GetDeviceTypes pure virtual since we have an impl now
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Dec 18, 2024
1 parent aa7cc8f commit d1a87c5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/app/data-model-provider/MetadataTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,7 @@ class ProviderMetadataTree
{
return std::make_unique<NullMetadataIterator<EndpointId, EndpointInfo>>();
}
virtual std::unique_ptr<ElementIterator<DeviceTypeEntry>> GetDeviceTypes(EndpointId endpointId)
{
return std::make_unique<NullElementIterator<DeviceTypeEntry>>();
}
virtual std::unique_ptr<ElementIterator<DeviceTypeEntry>> GetDeviceTypes(EndpointId endpointId) = 0;
virtual std::unique_ptr<ElementIterator<SemanticTag>> GetSemanticTags(EndpointId endpointId)
{
return std::make_unique<NullElementIterator<SemanticTag>>();
Expand Down
6 changes: 6 additions & 0 deletions src/app/tests/test-interaction-model-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ class TestImCustomDataModel : public DataModel::Provider
ConcreteCommandPath FirstGeneratedCommand(const ConcreteClusterPath & cluster) override;
ConcreteCommandPath NextGeneratedCommand(const ConcreteCommandPath & before) override;
void Temporary_ReportAttributeChanged(const AttributePathParams & path) override {}

// NULL implementations
std::unique_ptr<DataModel::ElementIterator<DataModel::DeviceTypeEntry>> GetDeviceTypes(EndpointId endpointId) override
{
return std::make_unique<DataModel::NullElementIterator<DataModel::DeviceTypeEntry>>();
}
};

} // namespace app
Expand Down
6 changes: 6 additions & 0 deletions src/controller/tests/data_model/DataModelFixtures.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ class CustomDataModel : public DataModel::Provider
ConcreteCommandPath FirstGeneratedCommand(const ConcreteClusterPath & cluster) override;
ConcreteCommandPath NextGeneratedCommand(const ConcreteCommandPath & before) override;
void Temporary_ReportAttributeChanged(const AttributePathParams & path) override {}

// NULL implementations
std::unique_ptr<DataModel::ElementIterator<DataModel::DeviceTypeEntry>> GetDeviceTypes(EndpointId endpointId) override
{
return std::make_unique<DataModel::NullElementIterator<DataModel::DeviceTypeEntry>>();
}
};

} // namespace DataModelTests
Expand Down

0 comments on commit d1a87c5

Please sign in to comment.