Skip to content

Commit

Permalink
Move TargetCompare into the implementation of sotauptaneclient
Browse files Browse the repository at this point in the history
It isn't used anywhere else, so move it out of the interface.

Signed-off-by: Phil Wise <[email protected]>
  • Loading branch information
cajun-rat committed Jan 30, 2022
1 parent 9d97437 commit a28317a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
13 changes: 13 additions & 0 deletions src/libaktualizr/primary/sotauptaneclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ static void report_progress_cb(event::Channel *channel, const Uptane::Target &ta
(*channel)(event);
}

/**
* A utility class to compare targets between Image and Director repositories.
* The definition of 'sameness' is in Target::MatchTarget().
*/
class TargetCompare {
public:
explicit TargetCompare(const Uptane::Target &target_in) : target(target_in) {}
bool operator()(const Uptane::Target &in) const { return (in.MatchTarget(target)); }

private:
const Uptane::Target &target;
};

SotaUptaneClient::SotaUptaneClient(Config &config_in, std::shared_ptr<INvStorage> storage_in,
std::shared_ptr<HttpInterface> http_in,
std::shared_ptr<event::Channel> events_channel_in)
Expand Down
9 changes: 0 additions & 9 deletions src/libaktualizr/primary/sotauptaneclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,4 @@ class SotaUptaneClient {
Json::Value custom_hardware_info_{Json::nullValue};
};

class TargetCompare {
public:
explicit TargetCompare(const Uptane::Target &target_in) : target(target_in) {}
bool operator()(const Uptane::Target &in) const { return (in.MatchTarget(target)); }

private:
const Uptane::Target &target;
};

#endif // SOTA_UPTANE_CLIENT_H_

0 comments on commit a28317a

Please sign in to comment.