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
4242 void PublisherHandler::StatusMessage(const string& message)
4343 {
4444 // 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;
4945
5046 // Calls can come from multiple threads, so we impose a simple lock before write to console
51− s_coutLock.lock();
52− PublisherInstance::StatusMessage(status.str());
53− s_coutLock.unlock();
47+ ScopeLock lock(s_coutLock);
48+
49+ // For now, we just the base class to display to console:
50+ PublisherInstance::StatusMessage("[" + m_name + "] " + message);
5451 }
5552
5653 void PublisherHandler::ErrorMessage(const string& message)
5754 {
5855 // 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;
6356
6457 // Calls can come from multiple threads, so we impose a simple lock before write to console
65− s_coutLock.lock();
66− PublisherInstance::ErrorMessage(status.str());
67− s_coutLock.unlock();
58+ ScopeLock lock(s_coutLock);
59+
60+ // For now, we just the base class to display to console:
61+ PublisherInstance::ErrorMessage("[" + m_name + "] " + message);
6862 }
6963
7064 void PublisherHandler::ClientConnected(const SubscriberConnectionPtr& connection)
@@ -187,7 +181,8 @@ void PublisherHandler::Start() · 116 unmodified lines
187181 // data type reasonable random values every 33 milliseconds
188182 m_publishTimer = NewSharedPtr<Timer>(33, [this](Timer*, void*)
189183 {
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());
191186 const int64_t timestamp = ToTicks(UtcNow());
192187 vector<MeasurementPtr> measurements;
193188

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