History

TimeSeriesPlatformLibrary: Back ported bug fixes and 64-bit improvements to GEP from recent STTP updates.

J. Ritchie Carroll committed 7 years ago

Commit b4c04411 parent 7020fe527 files · +180 −125Browse files

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

Unified · Split

Source/Libraries/TimeSeriesPlatformLibrary/Samples/PublisherHandler.cpp+10−15
@@ -42,29 +42,23 @@ PublisherHandler::PublisherHandler(string name, uint16_t port, bool ipV6) : · 41 unmodified lines
42void PublisherHandler::StatusMessage(const string& message)42void PublisherHandler::StatusMessage(const string& message)
43{43{
44 // TODO: Make sure these messages get logged to an appropriate location44 // TODO: Make sure these messages get logged to an appropriate location
45 // For now, the base class just displays to console:
46 stringstream status;
47
48 status << "[" << m_name << "] " << message;
49 45
50 // Calls can come from multiple threads, so we impose a simple lock before write to console46 // Calls can come from multiple threads, so we impose a simple lock before write to console
51 s_coutLock.lock();47 ScopeLock lock(s_coutLock);
52 PublisherInstance::StatusMessage(status.str());48
53 s_coutLock.unlock();49 // For now, we just the base class to display to console:
50 PublisherInstance::StatusMessage("[" + m_name + "] " + message);
54}51}
55 52
56void PublisherHandler::ErrorMessage(const string& message)53void PublisherHandler::ErrorMessage(const string& message)
57{54{
58 // TODO: Make sure these messages get logged to an appropriate location55 // TODO: Make sure these messages get logged to an appropriate location
59 // For now, the base class just displays to console:
60 stringstream status;
61
62 status << "[" << m_name << "] " << message;
63 56
64 // Calls can come from multiple threads, so we impose a simple lock before write to console57 // Calls can come from multiple threads, so we impose a simple lock before write to console
65 s_coutLock.lock();58 ScopeLock lock(s_coutLock);
66 PublisherInstance::ErrorMessage(status.str());59
67 s_coutLock.unlock();60 // For now, we just the base class to display to console:
61 PublisherInstance::ErrorMessage("[" + m_name + "] " + message);
68}62}
69 63
70void PublisherHandler::ClientConnected(const SubscriberConnectionPtr& connection)64void PublisherHandler::ClientConnected(const SubscriberConnectionPtr& connection)
@@ -187,7 +181,8 @@ void PublisherHandler::Start() · 116 unmodified lines
187 // data type reasonable random values every 33 milliseconds181 // data type reasonable random values every 33 milliseconds
188 m_publishTimer = NewSharedPtr<Timer>(33, [this](Timer*, void*)182 m_publishTimer = NewSharedPtr<Timer>(33, [this](Timer*, void*)
189 {183 {
190 static uint32_t count = m_measurementMetadata.size();184 // If metadata can change, the following integer should not be static:
185 static uint32_t count = ConvertUInt32(m_measurementMetadata.size());
191 const int64_t timestamp = ToTicks(UtcNow());186 const int64_t timestamp = ToTicks(UtcNow());
192 vector<MeasurementPtr> measurements;187 vector<MeasurementPtr> measurements;
193 188

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