Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / app / MessageDef / ListParser.h
1 /**
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    Copyright (c) 2016-2017 Nest Labs, Inc.
5  *
6  *    Licensed under the Apache License, Version 2.0 (the "License");
7  *    you may not use this file except in compliance with the License.
8  *    You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *    Unless required by applicable law or agreed to in writing, software
13  *    distributed under the License is distributed on an "AS IS" BASIS,
14  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *    See the License for the specific language governing permissions and
16  *    limitations under the License.
17  */
18 /**
19  *    @file
20  *      This file defines List parser in CHIP interaction model
21  *
22  */
23
24 #pragma once
25
26 #ifndef _CHIP_INTERACTION_MODEL_MESSAGE_DEF_LIST_PARSER_H
27 #define _CHIP_INTERACTION_MODEL_MESSAGE_DEF_LIST_PARSER_H
28
29 #include "Builder.h"
30 #include "Parser.h"
31 #include <core/CHIPCore.h>
32 #include <core/CHIPTLV.h>
33 #include <support/CodeUtils.h>
34 #include <support/logging/CHIPLogging.h>
35 #include <util/basic-types.h>
36
37 namespace chip {
38 namespace app {
39 class ListParser : public chip::app::Parser
40 {
41 protected:
42     ListParser();
43
44 public:
45     /**
46      *  @brief Initialize the parser object with TLVReader
47      *
48      *  @param [in] aReader A pointer to a TLVReader, which should be on the element of the array element
49      *
50      *  @return #CHIP_NO_ERROR on success
51      */
52     CHIP_ERROR Init(const chip::TLV::TLVReader & aReader);
53
54     /**
55      *  @brief Initialize the parser object with TLVReader if context tag exists
56      *
57      *  @param [in] aReader A pointer to a TLVReader, which should be on the element of the array element
58      *  @param [in] aContextTagToFind A context tag it tries to find
59      *
60      *  @return #CHIP_NO_ERROR on success
61      */
62     CHIP_ERROR InitIfPresent(const chip::TLV::TLVReader & aReader, const uint8_t aContextTagToFind);
63
64     /**
65      *  @brief Iterate to next element
66      *
67      *  @return #CHIP_NO_ERROR on success
68      */
69     CHIP_ERROR Next();
70 };
71
72 }; // namespace app
73 }; // namespace chip
74
75 #endif // _CHIP_INTERACTION_MODEL_MESSAGE_DEF_LIST_PARSER_H