Working on the Simple Data Service
The first data service I wanted to create was the simplest as well - something that could take a simple C++ variant and expose it to the Broker under a provided service name for query and update. There are two basic ways the Broker's clients interact with the data services: 'call' and 'subscribe'. The first is a "give it to me" idea, and the second is "give it to me and keep it up to date" plan. At least as far as the simple data service goes.
What I wanted to build was a very simple API for the service so that a user would be able to simply provide the variable and a service name and the rest of the "magic" would be done by the base service class. It's a nice idea - one application could then "publish" a bunch of values and services by simply gathering the data and publishing it with one of these "one-line" calls. Sweet.
Well... today was that day. It's the easiest form of the service as it's a single variant and I just need to be able to send it back to the caller and then track updates. Thankfully, I've talked a lot with the designer of the broker and know just what I want to do for tracking the changes. It's going to be a very simple transaction system where the user will have to start a transaction on the object, make changes, and then commit the changes and when that happens, the changes will be sent to all the registered listeners for that variant.
One of these registered listeners will, of course, be the service so that when the changes are sent, it can package them up and send them to all the subscribers. Pretty simple.
There were a lot of little things that needed to be worked out - especially with the transactions. But in the end, I have something that's working just fine for the simple case.
Tomorrow: Start on the conversational mode.