-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uprotocol 1.5 #61
Closed
MelamudMichael
wants to merge
12
commits into
eclipse-uprotocol:main
from
moniercoding:uprotocol-1.5
Closed
Uprotocol 1.5 #61
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ab082e6
Update CONTRIBUTORS.adoc (#31)
9e314c3
Creating a uAttributes Builder Class
monierabdullah b88c632
UAttributesBuilder, #include protobuf files
monierabdullah 9360a9d
Resolving Code Review Comments
monierabdullah c7060ee
UAttributes builder class, changes to #include protobuf files
monierabdullah 0e37da9
Merge remote-tracking branch 'up-cpp-main/main' into uprotocol-1.5
MelamudMichael 7e16970
Adjusting code to use protobuf files
monierabdullah f93f5b9
Deleting unused test files
monierabdullah 171acb7
fixing compilation issues
MelamudMichael 905f3ca
cleanup
MelamudMichael 32b0e02
Merge remote-tracking branch 'origin/main' into uprotocol-1.5
MelamudMichael cdbd960
Update conanfile.py
MelamudMichael File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
## Changelog | ||
|
||
- June 04 2023 17:52:23 Giorgio Zoppi <giorgio.zoppi@iotdbe.com> | ||
- June 04 2024 17:52:23 Giorgio Zoppi <giorgio.zoppi@iotdbe.com> | ||
* Restructuring old code and deleting unused code. | ||
* Adding coverage and ctest support | ||
- June 10 2023 17:52:23 Giorgio Zoppi <giorgio.zoppi@iotdbe.com> | ||
- June 10 2024 17:52:23 Giorgio Zoppi <giorgio.zoppi@iotdbe.com> | ||
* Cleanup uuid as much it was possible | ||
* Replaced current Meyer's singleton | ||
* Separate include directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* Copyright (c) 2024 General Motors GTO LLC | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-FileType: SOURCE | ||
* SPDX-FileCopyrightText: 2024 General Motors GTO LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef _UATTRIBUTESBUILDER_ | ||
#define _UATTRIBUTESBUILDER_ | ||
|
||
#include <string> | ||
#include <up-core-api/uattributes.pb.h> | ||
#include <up-core-api/uuid.pb.h> | ||
|
||
using namespace uprotocol::v1; | ||
|
||
namespace uprotocol::utransport { | ||
|
||
class UAttributesBuilder { | ||
private: | ||
uprotocol::v1::UAttributes attributes_; | ||
|
||
public: | ||
UAttributesBuilder() { | ||
attributes_.Clear(); | ||
} | ||
|
||
UAttributesBuilder(const uprotocol::v1::UUID& id, uprotocol::v1::UMessageType type, uprotocol::v1::UPriority priority) { | ||
attributes_.Clear(); | ||
attributes_.mutable_id()->CopyFrom(id); | ||
attributes_.set_type(type); | ||
attributes_.set_priority(priority); | ||
} | ||
|
||
UAttributesBuilder& setToken(const std::string& token) { | ||
attributes_.set_token(token); | ||
return *this; | ||
} | ||
|
||
UAttributesBuilder& setId(const uprotocol::v1::UUID& id) { | ||
attributes_.mutable_id()->CopyFrom(id); | ||
return *this; | ||
} | ||
|
||
UAttributesBuilder& setSink(const uprotocol::v1::UUri& sink) { | ||
attributes_.mutable_sink()->CopyFrom(sink); | ||
return *this; | ||
} | ||
|
||
UAttributesBuilder& setReqid(const uprotocol::v1::UUID& reqid) { | ||
attributes_.mutable_reqid()->CopyFrom(reqid); | ||
return *this; | ||
} | ||
|
||
UAttributesBuilder& setType(uprotocol::v1::UMessageType type) { | ||
attributes_.set_type(type); | ||
return *this; | ||
} | ||
|
||
UAttributesBuilder& setPriority(uprotocol::v1::UPriority priority) { | ||
attributes_.set_priority(priority); | ||
return *this; | ||
} | ||
|
||
UAttributesBuilder& setTtl(int32_t ttl) { | ||
attributes_.set_ttl(ttl); | ||
return *this; | ||
} | ||
|
||
UAttributesBuilder& setPermissionLevel(int32_t permission_level) { | ||
attributes_.set_permission_level(permission_level); | ||
return *this; | ||
} | ||
|
||
UAttributesBuilder& setCommstatus(int32_t commstatus) { | ||
attributes_.set_commstatus(commstatus); | ||
return *this; | ||
} | ||
|
||
uprotocol::v1::UAttributes build() const { | ||
return attributes_; | ||
} | ||
}; | ||
|
||
} // namespace uprotocol::utransport | ||
|
||
#endif /* _UATTRIBUTESBUILDER_*/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we need is uProtocol based uAttributes builder meaning we build publish, notification, request, and response headers, otherwise you leave the complexity of building these types (and ensuring the right information is populated) up to the app developer who will more often than not miss something that is mandatory.