History

TimeSeriesPlatformLibrary: (1) Improved operation of SubscriberInstance, (2) Updated function signatures for DataSubscriber to always include subscriber reference since callbacks require a static function, this allows "instance" implementations to have access to source subscriber.

J. Ritchie Carroll committed 8 years ago

Commit ddde4ba1 parent 24ecf3a7 files · +336 −230Browse files

Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Samples/SimpleSubscribe.cpp (1 of 7 files). Show all

Unified · Split

Source/Libraries/TimeSeriesPlatformLibrary/Samples/SimpleSubscribe.cpp+2−2
@@ -35,7 +35,7 @@ namespace tst = gsfts::Transport; · 34 unmodified lines
35tst::DataSubscriber Subscriber;35tst::DataSubscriber Subscriber;
36 36
37void RunSubscriber(std::string hostname, gsfts::uint16_t port);37void RunSubscriber(std::string hostname, gsfts::uint16_t port);
38void ProcessMeasurements(std::vector<gsfts::Measurement> newMeasurements);38void ProcessMeasurements(tst::DataSubscriber* source, std::vector<gsfts::Measurement> newMeasurements);
39 39
40// Sample application to demonstrate the most simple use of the subscriber API.40// Sample application to demonstrate the most simple use of the subscriber API.
41//41//
@@ -96,7 +96,7 @@ void RunSubscriber(std::string hostname, gsfts::uint16_t port) · 54 unmodified lines
96 96
97// Callback which is called when the subscriber has97// Callback which is called when the subscriber has
98// received a new packet of measurements from the publisher.98// received a new packet of measurements from the publisher.
99void ProcessMeasurements(std::vector<gsfts::Measurement> newMeasurements)99void ProcessMeasurements(tst::DataSubscriber* source, std::vector<gsfts::Measurement> newMeasurements)
100{100{
101 const std::string TimestampFormat = "%Y-%m-%d %H:%M:%S.%f";101 const std::string TimestampFormat = "%Y-%m-%d %H:%M:%S.%f";
102 const std::size_t MaxTimestampSize = 80;102 const std::size_t MaxTimestampSize = 80;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t