Skip to content
This repository was archived by the owner on Jul 24, 2022. It is now read-only.

Permit inheritance of DataStore class#133

Open
61131 wants to merge 4 commits intoNModbus4:portable-3.0from
61131:portable-3.0
Open

Permit inheritance of DataStore class#133
61131 wants to merge 4 commits intoNModbus4:portable-3.0from
61131:portable-3.0

Conversation

@61131
Copy link

@61131 61131 commented Jun 16, 2017

For a project which I am undertaking, I needed to implement a custom DataStore class for use in association with the NModbus4 library. This however was not possible due to the static nature of the ReadData and WriteData generic methods in the DataStore class. To address this issue I have made the following changes:

  • Introduced IDataStore interface definition for DataStore
  • Updated DataStore class accordingly - Note that this replaces the generic ReadData and WriteData static methods with public virtual methods allowing for inheritance and override
  • Updated ModbusSlave class and unit tests accordingly.

For minimal impact, I would propose only merging commit 7f82f61 (Added IDataStore interface class ...)

I would note that this pull request would also address issue #126 (DataStore is not replaceable)

@61131
Copy link
Author

61131 commented Jun 16, 2017

It appears that the Travis CI build failure is related to the project upgrade to Visual Studio 2017 (dd47607) and the corresponding removal of NModbus4.UnitTests/project.json.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant