Skip to content

Commit ed4995e

Browse files
Drop dependency on date.h
Deleted src/tools/date.h and its CMakeLists.txt, removed references to the custom date utility from build scripts and source files, and replaced date formatting with direct timestamp output in ProtocolHandlers and StoreNotificationHandlers. This simplifies the codebase by removing an external dependency and using raw timestamps instead.
1 parent a349ab2 commit ed4995e

6 files changed

Lines changed: 3 additions & 8265 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ set (ALL_SOURCES_AND_HEADERS
200200
${FETPAPI_HEADERS}
201201
${FETPAPI_PROTOCOL_SOURCES}
202202
${FETPAPI_PROTOCOL_HEADERS}
203-
${FETPAPI_TOOLS_HEADERS}
204203
${FETPAPI_FESAPI_SOURCES}
205204
${FETPAPI_FESAPI_HEADERS}
206205
${FETPAPI_SSL_SOURCES}
@@ -224,8 +223,6 @@ target_include_directories(${PROJECT_NAME} INTERFACE
224223

225224
# organizing sources and headers in the Visual Studio Project
226225
if (WIN32)
227-
source_group ("tools" FILES ${FETPAPI_TOOLS_HEADERS})
228-
229226
set (ETP_PREFIX "etp")
230227
source_group ("${ETP_PREFIX}" FILES ${FETPAPI_SOURCES} ${FETPAPI_HEADERS})
231228
source_group ("${ETP_PREFIX}\\ProtocolHandlers" FILES ${FETPAPI_PROTOCOL_SOURCES} ${FETPAPI_PROTOCOL_HEADERS})
@@ -307,12 +304,6 @@ INSTALL (
307304
COMPONENT fetpapi_headers
308305
)
309306

310-
INSTALL (
311-
FILES ${FETPAPI_TOOLS_HEADERS}
312-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fetpapi/tools
313-
COMPONENT fetpapi_headers
314-
)
315-
316307
if (WITH_ETP_SSL)
317308
INSTALL (
318309
FILES ${FETPAPI_SSL_HEADERS}

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
set(FESAPI_TOOLS_HEADERS ${CMAKE_CURRENT_LIST_DIR}/nsDefinitions.h )
22

33
include(${CMAKE_CURRENT_LIST_DIR}/etp/CMakeLists.txt)
4-
include(${CMAKE_CURRENT_LIST_DIR}/tools/CMakeLists.txt)

src/etp/ProtocolHandlers/ProtocolHandlers.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ under the License.
2121
#include "../AbstractSession.h"
2222
#include "../EtpHelpers.h"
2323

24-
#include "../../tools/date.h"
25-
2624
using namespace ETP_NS;
2725

2826
void ProtocolHandlers::printDataObject(const Energistics::Etp::v12::Datatypes::Object::DataObject & dataObject)
@@ -43,10 +41,9 @@ void ProtocolHandlers::printDataObject(const Energistics::Etp::v12::Datatypes::O
4341
std::cout << "target count : " << dataObject.resource.targetCount.value() << std::endl;
4442
}
4543

46-
std::cout << "lastChanged : ";
44+
std::cout << "lastChanged timestamp : ";
4745
if (dataObject.resource.lastChanged >= 0) {
48-
auto duration = std::chrono::microseconds(dataObject.resource.lastChanged);
49-
std::cout << date::format("%FT%TZ", date::floor<std::chrono::microseconds>(duration));
46+
std::cout << dataObject.resource.lastChanged;
5047
}
5148
else {
5249
std::cout << "unknown";

src/etp/ProtocolHandlers/StoreNotificationHandlers.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ under the License.
2121
#include "../AbstractSession.h"
2222
#include "../EtpHelpers.h"
2323

24-
#include "../../tools/date.h"
25-
2624
using namespace ETP_NS;
2725

2826
void StoreNotificationHandlers::decodeMessageBody(const Energistics::Etp::v12::Datatypes::MessageHeader & mh, avro::DecoderPtr d)
@@ -128,8 +126,7 @@ void StoreNotificationHandlers::on_ObjectChanged(const Energistics::Etp::v12::Pr
128126
case Energistics::Etp::v12::Datatypes::Object::ObjectChangeKind::unjoinedSubscription: session->fesapi_log("unjoinedSubscription"); break;
129127
}
130128

131-
auto duration = std::chrono::microseconds(msg.change.changeTime);
132-
session->fesapi_log("on", date::format("%FT%TZ", date::floor<std::chrono::microseconds>(duration)));
129+
session->fesapi_log("on timestamp ", msg.change.changeTime);
133130

134131
printDataObject(msg.change.dataObject);
135132
}

src/tools/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)