nl::Weave::Profiles::SoftwareUpdate::IntegrityTypeList

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

An auxiliary class to hold a list of integrity types as a part of the image query.

Summary

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

Constructors and Destructors

IntegrityTypeList()
The default constructor for an IntegrityTypeList.

Public attributes

theLength
uint8_t
Length of the supported element list.
theList[kIntegrityType_Last]
uint8_t
Container holding supported integrity types.

Public functions

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

Public static functions

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

Public attributes

theLength

uint8_t theLength

Length of the supported element list.

Length of 0 indicates an empty list

theList

uint8_t theList[kIntegrityType_Last]

Container holding supported integrity types.

It is sized equal to the number of elements in IntegrityTypes

Public functions

IntegrityTypeList

 IntegrityTypeList()

The default constructor for an IntegrityTypeList.

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 IntegrityTypes.
[in] aList
A pointer to an array of IntegrityTypes 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 IntegrityTypeList &
) 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 &,
  IntegrityTypeList &
)

Deserialize the object from the given MessageIterator into provided IntegrityTypeList.

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)