Line data Source code
1 : /**
2 : * Copyright Soramitsu Co., Ltd. All Rights Reserved.
3 : * SPDX-License-Identifier: Apache-2.0
4 : */
5 :
6 : #ifndef IROHA_MODEL_BLOCKS_QUERY_BUILDER_HPP
7 : #define IROHA_MODEL_BLOCKS_QUERY_BUILDER_HPP
8 :
9 : #include "builders/protobuf/queries.hpp"
10 : #include "builders/protobuf/unsigned_proto.hpp"
11 :
12 : namespace shared_model {
13 : namespace bindings {
14 :
15 : /**
16 : * Wrapper class for query builder. Designed only for SWIG bindings,
17 : * don't use in other cases.
18 : */
19 : class ModelBlocksQueryBuilder {
20 : private:
21 : template <int Sp>
22 : explicit ModelBlocksQueryBuilder(
23 : const proto::TemplateBlocksQueryBuilder<Sp> &o)
24 0 : : builder_(o) {}
25 :
26 : proto::TemplateBlocksQueryBuilder<
27 : (1 << shared_model::proto::TemplateBlocksQueryBuilder<>::total) - 1>
28 : builder_;
29 :
30 : public:
31 : ModelBlocksQueryBuilder();
32 :
33 : /**
34 : * Sets created time to the blocks query
35 : * @param created_time time of creation of query
36 : * @return builder with created time
37 : */
38 : ModelBlocksQueryBuilder createdTime(
39 : interface::types::TimestampType created_time);
40 :
41 : /**
42 : * Sets creator account id
43 : * @param creator_account_id
44 : * @return builder with creator account id
45 : */
46 : ModelBlocksQueryBuilder creatorAccountId(
47 : const interface::types::AccountIdType &creator_account_id);
48 :
49 : /**
50 : * Sets query counter
51 : * @param query_counter counter for blocks query
52 : * @return BlocksQuery with query counter
53 : */
54 : ModelBlocksQueryBuilder queryCounter(
55 : interface::types::CounterType query_counter);
56 :
57 : /**
58 : * Builds BlocksQuery
59 : * @return UnsignedWrapper of proto::BlocksQuery
60 : */
61 : proto::UnsignedWrapper<proto::BlocksQuery> build();
62 : };
63 :
64 : } // namespace bindings
65 : } // namespace shared_model
66 :
67 : #endif // IROHA_MODEL_BLOCKS_QUERY_BUILDER_HPP
|