blob: ab34622febfb3631b2f71043964e9a677e4f87f5 [file] [log] [blame]
/*
*
* Copyright (c) 2017 Nest Labs, Inc.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _NEST_TEST_TRAIT__TEST_E_TRAIT_H_
#define _NEST_TEST_TRAIT__TEST_E_TRAIT_H_
#include <Weave/Profiles/data-management/DataManagement.h>
#include <Weave/Support/SerializationUtils.h>
#include <weave/common/DayOfWeekEnum.h>
#include <nest/test/trait/StructEStructSchema.h>
#include <nest/test/trait/CommonStructEStructSchema.h>
#include <nest/test/trait/NullableEStructSchema.h>
namespace Schema {
namespace Nest {
namespace Test {
namespace Trait {
namespace TestETrait {
extern const nl::Weave::Profiles::DataManagement::TraitSchemaEngine TraitSchema;
enum {
kWeaveProfileId = (0x235aU << 16) | 0xfe06U
};
//
// Events
//
struct teH_array {
uint32_t num;
uint32_t *buf;
};
struct teI_array {
uint32_t num;
Schema::Nest::Test::Trait::TestCommonTrait::CommonStructE *buf;
};
struct TestEEvent
{
uint32_t teA;
int32_t teB;
bool teC;
int32_t teD;
Schema::Nest::Test::Trait::TestETrait::StructE teE;
int32_t teF;
Schema::Nest::Test::Trait::TestCommonTrait::CommonStructE teG;
teH_array teH;
teI_array teI;
int16_t teJ;
void SetTeJNull(void);
void SetTeJPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsTeJPresent(void);
#endif
nl::SerializedByteString teK;
uint32_t teL;
uint64_t teM;
void SetTeMNull(void);
void SetTeMPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsTeMPresent(void);
#endif
nl::SerializedByteString teN;
void SetTeNNull(void);
void SetTeNPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsTeNPresent(void);
#endif
uint32_t teO;
int64_t teP;
void SetTePNull(void);
void SetTePPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsTePPresent(void);
#endif
int64_t teQ;
uint32_t teR;
uint32_t teS;
void SetTeSNull(void);
void SetTeSPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsTeSPresent(void);
#endif
uint8_t __nullified_fields__[5/8 + 1];
// Statically-known Event Struct Attributes:
enum {
kWeaveProfileId = (0x235aU << 16) | 0xfe06U,
kEventTypeId = 0x1U
};
static const nl::SchemaFieldDescriptor FieldSchema;
static const nl::Weave::Profiles::DataManagement::EventSchema Schema;
};
inline void TestEEvent::SetTeJNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 0);
}
inline void TestEEvent::SetTeJPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 0);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestEEvent::IsTeJPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 0));
}
#endif
inline void TestEEvent::SetTeMNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 1);
}
inline void TestEEvent::SetTeMPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 1);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestEEvent::IsTeMPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 1));
}
#endif
inline void TestEEvent::SetTeNNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 2);
}
inline void TestEEvent::SetTeNPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 2);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestEEvent::IsTeNPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 2));
}
#endif
inline void TestEEvent::SetTePNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 3);
}
inline void TestEEvent::SetTePPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 3);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestEEvent::IsTePPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 3));
}
#endif
inline void TestEEvent::SetTeSNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 4);
}
inline void TestEEvent::SetTeSPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 4);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestEEvent::IsTeSPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 4));
}
#endif
struct TestENullableEvent
{
uint32_t neA;
void SetNeANull(void);
void SetNeAPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsNeAPresent(void);
#endif
int32_t neB;
void SetNeBNull(void);
void SetNeBPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsNeBPresent(void);
#endif
bool neC;
void SetNeCNull(void);
void SetNeCPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsNeCPresent(void);
#endif
const char * neD;
void SetNeDNull(void);
void SetNeDPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsNeDPresent(void);
#endif
int16_t neE;
void SetNeENull(void);
void SetNeEPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsNeEPresent(void);
#endif
uint32_t neF;
void SetNeFNull(void);
void SetNeFPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsNeFPresent(void);
#endif
int32_t neG;
void SetNeGNull(void);
void SetNeGPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsNeGPresent(void);
#endif
bool neH;
void SetNeHNull(void);
void SetNeHPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsNeHPresent(void);
#endif
const char * neI;
void SetNeINull(void);
void SetNeIPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsNeIPresent(void);
#endif
Schema::Nest::Test::Trait::TestETrait::NullableE neJ;
void SetNeJNull(void);
void SetNeJPresent(void);
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
bool IsNeJPresent(void);
#endif
uint8_t __nullified_fields__[10/8 + 1];
// Statically-known Event Struct Attributes:
enum {
kWeaveProfileId = (0x235aU << 16) | 0xfe06U,
kEventTypeId = 0x2U
};
static const nl::SchemaFieldDescriptor FieldSchema;
static const nl::Weave::Profiles::DataManagement::EventSchema Schema;
};
inline void TestENullableEvent::SetNeANull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 0);
}
inline void TestENullableEvent::SetNeAPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 0);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestENullableEvent::IsNeAPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 0));
}
#endif
inline void TestENullableEvent::SetNeBNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 1);
}
inline void TestENullableEvent::SetNeBPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 1);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestENullableEvent::IsNeBPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 1));
}
#endif
inline void TestENullableEvent::SetNeCNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 2);
}
inline void TestENullableEvent::SetNeCPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 2);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestENullableEvent::IsNeCPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 2));
}
#endif
inline void TestENullableEvent::SetNeDNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 3);
}
inline void TestENullableEvent::SetNeDPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 3);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestENullableEvent::IsNeDPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 3));
}
#endif
inline void TestENullableEvent::SetNeENull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 4);
}
inline void TestENullableEvent::SetNeEPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 4);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestENullableEvent::IsNeEPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 4));
}
#endif
inline void TestENullableEvent::SetNeFNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 5);
}
inline void TestENullableEvent::SetNeFPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 5);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestENullableEvent::IsNeFPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 5));
}
#endif
inline void TestENullableEvent::SetNeGNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 6);
}
inline void TestENullableEvent::SetNeGPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 6);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestENullableEvent::IsNeGPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 6));
}
#endif
inline void TestENullableEvent::SetNeHNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 7);
}
inline void TestENullableEvent::SetNeHPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 7);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestENullableEvent::IsNeHPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 7));
}
#endif
inline void TestENullableEvent::SetNeINull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 8);
}
inline void TestENullableEvent::SetNeIPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 8);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestENullableEvent::IsNeIPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 8));
}
#endif
inline void TestENullableEvent::SetNeJNull(void)
{
SET_FIELD_NULLIFIED_BIT(__nullified_fields__, 9);
}
inline void TestENullableEvent::SetNeJPresent(void)
{
CLEAR_FIELD_NULLIFIED_BIT(__nullified_fields__, 9);
}
#if WEAVE_CONFIG_SERIALIZATION_ENABLE_DESERIALIZATION
inline bool TestENullableEvent::IsNeJPresent(void)
{
return (!GET_FIELD_NULLIFIED_BIT(__nullified_fields__, 9));
}
#endif
//
// Enums
//
enum EnumE {
ENUM_E_VALUE_1 = 1,
ENUM_E_VALUE_2 = 2,
ENUM_E_VALUE_3 = 3,
};
} // namespace TestETrait
}
}
}
}
#endif // _NEST_TEST_TRAIT__TEST_E_TRAIT_H_