-
Notifications
You must be signed in to change notification settings - Fork 6
common: iamclient: add current node info provider interface #385
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -37,4 +37,4 @@ class FileServerItf { | |
|
||
} // namespace aos::cm::fileserver | ||
|
||
#endif // AOS_CORE_CM_FILESERVER_HPP_ | ||
#endif |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,31 @@ | ||
# | ||
# Copyright (C) 2025 EPAM Systems, Inc. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# ###################################################################################################################### | ||
# Target name | ||
# ###################################################################################################################### | ||
|
||
set(TARGET_NAME iamclient) | ||
|
||
# ###################################################################################################################### | ||
# Headers | ||
# ###################################################################################################################### | ||
|
||
set(HEADERS itf/currentnodeinfoprovider.hpp) | ||
|
||
# ###################################################################################################################### | ||
# Target | ||
# ###################################################################################################################### | ||
|
||
add_module(TARGET_NAME ${TARGET_NAME} HEADERS ${HEADERS}) | ||
|
||
# ###################################################################################################################### | ||
# Tests | ||
# ###################################################################################################################### | ||
|
||
if(WITH_TEST) | ||
add_subdirectory(tests) | ||
endif() |
This file contains hidden or 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,69 @@ | ||
/* | ||
* Copyright (C) 2025 EPAM Systems, Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef AOS_CORE_COMMON_IAMCLIENT_ITF_CURRENTNODEINFOPROVIDER_HPP_ | ||
#define AOS_CORE_COMMON_IAMCLIENT_ITF_CURRENTNODEINFOPROVIDER_HPP_ | ||
|
||
#include <core/common/types/common.hpp> | ||
|
||
namespace aos::iamclient { | ||
|
||
/** | ||
* Interface for receiving notification about changing current node information. | ||
*/ | ||
class CurrentNodeInfoListenerItf { | ||
public: | ||
/** | ||
* Destructor. | ||
*/ | ||
virtual ~CurrentNodeInfoListenerItf() = default; | ||
|
||
/** | ||
* Notifies about current node info changed. | ||
* | ||
* @param info current node information. | ||
*/ | ||
virtual void OnCurrentNodeInfoChanged(const NodeInfo& info) = 0; | ||
}; | ||
|
||
/** | ||
* Current node information provider interface. | ||
*/ | ||
class CurrentNodeInfoProviderItf { | ||
public: | ||
/** | ||
* Destructor. | ||
*/ | ||
virtual ~CurrentNodeInfoProviderItf() = default; | ||
|
||
/** | ||
* Returns current node info . | ||
* | ||
* @param[out] nodeInfo current node information. | ||
* @return Error. | ||
*/ | ||
virtual Error GetCurrentNodeInfo(NodeInfo& nodeInfo) const = 0; | ||
|
||
/** | ||
* Subscribes current node info notifications. | ||
* | ||
* @param listener current node info listener. | ||
* @return Error. | ||
*/ | ||
virtual Error SubscribeListener(CurrentNodeInfoListenerItf& listener) = 0; | ||
|
||
/** | ||
* Unsubscribes from current node info notifications. | ||
* | ||
* @param listener current node info listener. | ||
* @return Error. | ||
*/ | ||
virtual Error UnsubscribeListener(CurrentNodeInfoListenerItf& listener) = 0; | ||
}; | ||
|
||
} // namespace aos::iamclient | ||
|
||
#endif |
This file contains hidden or 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,33 @@ | ||
# | ||
# Copyright (C) 2025 EPAM Systems, Inc. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
set(TARGET_NAME iamclient_test) | ||
|
||
# ###################################################################################################################### | ||
# Sources | ||
# ###################################################################################################################### | ||
|
||
set(SOURCES iamclient.cpp) | ||
|
||
# ###################################################################################################################### | ||
# Libraries | ||
# ###################################################################################################################### | ||
|
||
set(LIBRARIES aos::core::cm::iamclient GTest::gmock_main) | ||
|
||
# ###################################################################################################################### | ||
# Target | ||
# ###################################################################################################################### | ||
|
||
add_test( | ||
TARGET_NAME | ||
${TARGET_NAME} | ||
LOG_MODULE | ||
SOURCES | ||
${SOURCES} | ||
LIBRARIES | ||
${LIBRARIES} | ||
) |
This file contains hidden or 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,7 @@ | ||
/* | ||
* Copyright (C) 2025 EPAM Systems, Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <core/common/iamclient/itf/currentnodeinfoprovider.hpp> |
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -192,4 +192,4 @@ struct Host { | |
|
||
} // namespace aos | ||
|
||
#endif // AOS_CORE_COMMON_TYPES_NETWORK_HPP_ | ||
#endif |
This file contains hidden or 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 |
---|---|---|
|
@@ -73,4 +73,4 @@ struct FunctionServicePermissions { | |
|
||
} // namespace aos | ||
|
||
#endif // AOS_CORE_COMMON_TYPES_PERMISSIONS_HPP_ | ||
#endif |
This file contains hidden or 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 |
---|---|---|
|
@@ -194,4 +194,4 @@ struct UnitStatus { | |
|
||
} // namespace aos | ||
|
||
#endif // AOS_CORE_COMMON_TYPES_UNITSTATUS_HPP_ | ||
#endif |
This file contains hidden or 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 |
---|---|---|
|
@@ -292,4 +292,4 @@ class CNIItf { | |
|
||
} // namespace aos::sm::cni | ||
|
||
#endif // AOS_SM_CNI_HPP_ | ||
#endif |
This file contains hidden or 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 |
---|---|---|
|
@@ -43,4 +43,4 @@ | |
*/ | ||
#define AOS_CONFIG_LAUNCHER_RUNTIME_DIR "/tmp/aos/runtime" | ||
|
||
#endif // AOS_CORE_TESTCONFIG_HPP_ | ||
#endif |
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.
Add an empty line