adamdebreceni commented on a change in pull request #839:
URL: https://github.com/apache/nifi-minifi-cpp/pull/839#discussion_r493460194
##########
File path: libminifi/include/utils/Id.h
##########
@@ -43,107 +44,41 @@ class uuid;
#define UUID_TIME_STR "time"
#define UUID_WINDOWS_STR "windows"
-
namespace org {
namespace apache {
namespace nifi {
namespace minifi {
namespace utils {
-template<typename T, typename C>
-class IdentifierBase {
+class Identifier {
+ friend struct IdentifierTestAccessor;
public:
- IdentifierBase(T myid) { // NOLINT
- copyInto(myid);
- }
-
- IdentifierBase(const IdentifierBase &other) {
- copyInto(other.id_);
- }
-
- IdentifierBase(IdentifierBase &&other)
- : converted_(std::move(other.converted_)) {
- copyInto(other.id_);
- }
-
- IdentifierBase() = default;
-
- IdentifierBase &operator=(const IdentifierBase &other) {
- copyInto(other.id_);
- return *this;
- }
-
- IdentifierBase &operator=(T o) {
- copyInto(o);
- return *this;
- }
+ using Data = std::array<uint8_t, 16>;
- void getIdentifier(T other) const {
- copyOutOf(other);
- }
+ Identifier() = default;
+ explicit Identifier(const Data& data);
+ explicit Identifier(const std::string& data);
Review comment:
as the PR I was referring to has just been merged I gave a try to
removing the `std::string` assignment one, but there are numerous places it is
in use, and most places would need careful thinking if we can handle the error
and if so how, so I would still do it in a separate PR
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]