Commit e80357ef authored by Jason Paryani's avatar Jason Paryani

Fix stylistic problems with DynamicStruct::as commit

parent 0e7f7116
...@@ -114,11 +114,11 @@ TEST(Any, AnyStruct) { ...@@ -114,11 +114,11 @@ TEST(Any, AnyStruct) {
checkTestMessage(root.getAnyPointerField().getAs<TestAllTypes>()); checkTestMessage(root.getAnyPointerField().getAs<TestAllTypes>());
checkTestMessage(root.asReader().getAnyPointerField().getAs<TestAllTypes>()); checkTestMessage(root.asReader().getAnyPointerField().getAs<TestAllTypes>());
auto all_types = root.getAnyPointerField().getAs<AnyStruct>().as<TestAllTypes>(); auto allTypes = root.getAnyPointerField().getAs<AnyStruct>().as<TestAllTypes>();
auto all_types_reader = root.getAnyPointerField().getAs<AnyStruct>().asReader().as<TestAllTypes>(); auto allTypesReader = root.getAnyPointerField().getAs<AnyStruct>().asReader().as<TestAllTypes>();
all_types.setInt32Field(100); allTypes.setInt32Field(100);
EXPECT_EQ(100, all_types.getInt32Field()); EXPECT_EQ(100, allTypes.getInt32Field());
EXPECT_EQ(100, all_types_reader.getInt32Field()); EXPECT_EQ(100, allTypesReader.getInt32Field());
EXPECT_EQ(48, root.getAnyPointerField().getAs<AnyStruct>().getDataSection().size()); EXPECT_EQ(48, root.getAnyPointerField().getAs<AnyStruct>().getDataSection().size());
EXPECT_EQ(20, root.getAnyPointerField().getAs<AnyStruct>().getPointerSection().size()); EXPECT_EQ(20, root.getAnyPointerField().getAs<AnyStruct>().getPointerSection().size());
......
...@@ -437,9 +437,9 @@ public: ...@@ -437,9 +437,9 @@ public:
template <typename T> template <typename T>
ReaderFor<T> as() const { ReaderFor<T> as() const {
// T must be a struct type.
return typename T::Reader(_reader); return typename T::Reader(_reader);
} }
// T must be a struct type.
private: private:
_::StructReader _reader; _::StructReader _reader;
...@@ -470,9 +470,9 @@ public: ...@@ -470,9 +470,9 @@ public:
template <typename T> template <typename T>
BuilderFor<T> as() { BuilderFor<T> as() {
// T must be a struct type.
return typename T::Builder(_builder); return typename T::Builder(_builder);
} }
// T must be a struct type.
private: private:
_::StructBuilder _builder; _::StructBuilder _builder;
friend class Orphanage; friend class Orphanage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment