ademakov commented on code in PR #988: URL: https://github.com/apache/ignite-3/pull/988#discussion_r945547670
########## modules/platforms/cpp/schema/BinaryTupleBuilder.h: ########## @@ -0,0 +1,397 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#pragma once + +#include "BinaryTupleSchema.h" +#include "common/Types.h" + +#include <cassert> +#include <cstring> +#include <limits> +#include <type_traits> + +namespace ignite { + +/** + * @brief Binary tuple builder. + * + * A tuple builder is used to create one or more binary tuples for a given schema. + * + * Building a tuple takes two passes. On the first pass the builder finds the tuple + * layout. On the second pass it actually fills the tuple data. + * + * More precisely a tuple is built with the following call sequence: + * + * 1. Initialize the builder with the @ref start call. + * 2. Supply all elements with one or more @ref claim calls in the order that + * corresponds to the tuple schema. + * 3. Determine tuple layout with the @ref layout call. + * 4. Supply all elements again with one or more @ref append calls in the same + * order with the same values. + * 5. Finally, the resulting binary tuple is obtained with the @ref build call. + */ +class BinaryTupleBuilder { + IntT elementCount; /**< Total number of elements. */ Review Comment: Done. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
