Google is committed to advancing racial equity for Black communities. See how.

nl::Weave::Profiles::SoftwareUpdate::UpdateSchemeList

#include <src/lib/profiles/software-update/SoftwareUpdateProfile.h>

An auxiliary class to hold a list of update schemes as a part of the image query.

Summary

A simple wrapper, sized to hold any subset of possible update schemes. In order to accomplish this task, its size is equal to the number of elements in the UpdateSchemes is used to generate the list of supported update schemes in the ImageQuery message.

Constructors and Destructors

UpdateSchemeList()
The default constructor for an UpdateSchemeList.

Public attributes

theLength
uint8_t
Length of the supported element list.
theList[kUpdateScheme_Last]
uint8_t
Container holding supported update schemes.

Public functions

init(uint8_t, uint8_t *)
Explicitly initialize the IntegrityTypeList with an list of supported IntegrityTypes.
operator==(const UpdateSchemeList &) const
bool
An equality operator.
pack(MessageIterator &)
Serialize the object to the provided MessageIterator.

Public static functions

parse(MessageIterator &, UpdateSchemeList &)
Deserialize the object from the given MessageIterator into provided UpdateSchemeList.

Public attributes

theLength

uint8_t theLength

Length of the supported element list.

Length of 0 indicates an empty list

theList

uint8_t theList[kUpdateScheme_Last]

Container holding supported update schemes.

It is sized equal to the number of elements in UpdateSchemes

Public functions

UpdateSchemeList

 UpdateSchemeList()

The default constructor for an UpdateSchemeList.

Constructs a logically empty list. The list may be populated via the init() method or by deserializing the list from a message.

init

WEAVE_ERROR init(
  uint8_t,
  uint8_t *
)

Explicitly initialize the IntegrityTypeList with an list of supported IntegrityTypes.

Details
Parameters
[in] aLength
An 8-bit value for the length of the list. Must be less that the number of enums in UpdateSchemes.
[in] aList
A pointer to an array of UpdateSchemes values. May be NULL only if aLength is 0.
Return Values
WEAVE_NO_ERROR
On success.
WEAVE_ERROR_INVALID_LIST_LENGTH
If the length is too long

operator==

bool operator==(
  const UpdateSchemeList &
) const 

An equality operator.

Details
Parameters
another
A list to check against this list
Returns
true if the lists are equal, false otherwise

pack

WEAVE_ERROR pack(
  MessageIterator &
)

Serialize the object to the provided MessageIterator.

Details
Parameters
[in] i
An iterator over the message being packed
Return Values
WEAVE_NO_ERROR
On success.
WEAVE_ERROR_BUFFER_TOO_SMALL
If the list is too long to fit in the message.

Public static functions

parse

WEAVE_ERROR parse(
  MessageIterator &,
  UpdateSchemeList &
)

Deserialize the object from the given MessageIterator into provided UpdateSchemeList.

Details
Parameters
[in] i
An iterator over the message being parsed.
[in] aList
A reference to an object to contain the result
Return Values
WEAVE_NO_ERROR
On success.
WEAVE_ERROR_BUFFER_TOO_SMALL
Message was too short.
WEAVE_ERROR_INVALID_LIST_LENGTH
If the message contained an invalid list length (either not enough data to fill in the list or too many to fit within the limits)