Skip to content

Commit 4abdbb1

Browse files
author
Mykola Solianko
committed
cm: imagemanager: update storage manager itf
Signed-off-by: Mykola Solianko <[email protected]>
1 parent 1747ae1 commit 4abdbb1

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

src/core/cm/imagemanager/itf/storage.hpp

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#ifndef AOS_CORE_CM_IMAGEMANAGER_ITF_STORAGE_HPP_
88
#define AOS_CORE_CM_IMAGEMANAGER_ITF_STORAGE_HPP_
99

10+
#include <core/common/types/common.hpp>
1011
#include <core/common/types/desiredstatus.hpp>
1112

1213
namespace aos::cm::imagemanager {
@@ -15,9 +16,11 @@ namespace aos::cm::imagemanager {
1516
* Update item info.
1617
*/
1718
struct ItemInfo {
18-
StaticString<cIDLen> mItemID;
19-
StaticString<cVersionLen> mVersion;
20-
ItemState mState;
19+
StaticString<cIDLen> mItemID;
20+
StaticString<cVersionLen> mVersion;
21+
StaticString<oci::cDigestLen> mIndexDigest;
22+
ItemStateEnum mState {};
23+
uint32_t mGID {};
2124

2225
/**
2326
* Compares update item info.
@@ -27,7 +30,8 @@ struct ItemInfo {
2730
*/
2831
bool operator==(const ItemInfo& rhs) const
2932
{
30-
return mItemID == rhs.mItemID && mVersion == rhs.mVersion && mState == rhs.mState;
33+
return mItemID == rhs.mItemID && mVersion == rhs.mVersion && mIndexDigest == rhs.mIndexDigest
34+
&& mState == rhs.mState && mGID == rhs.mGID;
3135
}
3236

3337
/**
@@ -67,14 +71,24 @@ class StorageItf {
6771
virtual Error RemoveItem(const String& id, const String& version) = 0;
6872

6973
/**
70-
* Sets item state.
74+
* Updates item index digest.
7175
*
7276
* @param id ID.
73-
* @param Version Version.
77+
* @param version Version.
78+
* @param indexDigest Index digest.
79+
* @return Error.
80+
*/
81+
virtual Error UpdateItemIndexDigest(const String& id, const String& version, const String& indexDigest) = 0;
82+
83+
/**
84+
* Updates item state.
85+
*
86+
* @param id ID.
87+
* @param version Version.
7488
* @param state Item state.
7589
* @return Error.
7690
*/
77-
virtual Error SetItemState(const String& id, const String& Version, ItemState state) = 0;
91+
virtual Error UpdateItemState(const String& id, const String& version, ItemStateEnum state) = 0;
7892

7993
/**
8094
* Gets items info.

0 commit comments

Comments
 (0)