diff options
-rw-r--r-- | project2/ice/iceRows.cpp | 46 | ||||
-rw-r--r-- | project2/ice/iceRows.h | 2 | ||||
-rw-r--r-- | project2/ice/slice2Rows.cpp | 2 |
3 files changed, 26 insertions, 24 deletions
diff --git a/project2/ice/iceRows.cpp b/project2/ice/iceRows.cpp index 6e2015d..3748512 100644 --- a/project2/ice/iceRows.cpp +++ b/project2/ice/iceRows.cpp @@ -67,31 +67,33 @@ RowProcSerializer::RowProcSerializer(ExecContext * e, const RowProcessorCallback } void -RowProcSerializer::Serialize(ModelPartPtr mp) +RowProcSerializer::Serialize(ModelPartForRootPtr mp) { if (mp) { - switch (mp->GetType()) { - case mpt_Null: - return; - case mpt_Simple: - case mpt_Dictionary: - throw std::runtime_error("Not a sequence of things"); - case mpt_Complex: - { - IceRowState irs(ec, mp); - irs.IterateOver(mp, rpc); - break; - } - case mpt_Sequence: - { - IceRowState * irs = NULL; - mp->OnEachChild(boost::bind(&RowProcSerializer::SerializeRow, this, boost::ref(irs), _2)); - if (irs) { - delete irs; + mp->OnEachChild([this](const std::string &, ModelPartPtr mp, HookCommonPtr) { + switch (mp->GetType()) { + case mpt_Null: + return; + case mpt_Simple: + case mpt_Dictionary: + throw std::runtime_error("Not a sequence of things"); + case mpt_Complex: + { + IceRowState irs(ec, mp); + irs.IterateOver(mp, rpc); + break; } - break; - } - } + case mpt_Sequence: + { + IceRowState * irs = NULL; + mp->OnEachChild(boost::bind(&RowProcSerializer::SerializeRow, this, boost::ref(irs), _2)); + if (irs) { + delete irs; + } + break; + } + } + }); } } diff --git a/project2/ice/iceRows.h b/project2/ice/iceRows.h index b333eb2..77507f2 100644 --- a/project2/ice/iceRows.h +++ b/project2/ice/iceRows.h @@ -14,7 +14,7 @@ class DLL_PUBLIC RowProcSerializer : public Slicer::Serializer { public: RowProcSerializer(ExecContext *, const RowProcessorCallback &); - void Serialize(Slicer::ModelPartPtr) override; + void Serialize(Slicer::ModelPartForRootPtr) override; private: void SerializeRow(IceRowState * &, Slicer::ModelPartPtr); diff --git a/project2/ice/slice2Rows.cpp b/project2/ice/slice2Rows.cpp index 8fa17b8..a702dcf 100644 --- a/project2/ice/slice2Rows.cpp +++ b/project2/ice/slice2Rows.cpp @@ -59,7 +59,7 @@ Slice2Rows::visitOperation(const Slice::OperationPtr & o) fprintf(code, "\t\t\t\t\t\tauto result = "); CallOperation(o); fprintf(code, ";\n"); - fprintf(code, "\t\t\t\t\t\tSlicer::ModelPartPtr mp = Slicer::ModelPart::CreateFor(result);\n"); + fprintf(code, "\t\t\t\t\t\tSlicer::ModelPartForRootPtr mp = Slicer::ModelPart::CreateRootFor(result);\n"); fprintf(code, "\t\t\t\t\t\ttoRpc->Serialize(mp);\n"); fprintf(code, "\t\t\t\t\t}\n\n"); ParameterVariables(o); |