BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
base.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cryptonomex, Inc., and contributors.
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 #pragma once
25 
28 
29 #include <fc/thread/future.hpp>
30 
31 namespace graphene { namespace protocol {
32  struct asset;
33  struct authority;
34 
86  struct void_result{};
87 
89  {
90  flat_set<object_id_type> new_objects;
91  flat_set<object_id_type> updated_objects;
92  flat_set<object_id_type> removed_objects;
93  };
94 
96 
98  {
99  template<typename T>
100  share_type calculate_fee(const T& params)const
101  {
102  return params.fee;
103  }
104  void get_required_authorities( vector<authority>& )const{}
105  void get_required_active_authorities( flat_set<account_id_type>& )const{}
106  void get_required_owner_authorities( flat_set<account_id_type>& )const{}
107  void validate()const{}
108  fc::optional< fc::future<void> > validate_parallel( uint32_t skip )const;
109 
110  static uint64_t calculate_data_fee( uint64_t bytes, uint64_t price_per_kbyte );
111  };
112 
120 
129 
131 
132 } } // graphene::protocol
133 
136 FC_REFLECT( graphene::protocol::void_result, )
137 FC_REFLECT( graphene::protocol::generic_operation_result, (new_objects)(updated_objects)(removed_objects) )
138 
139 GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION( graphene::protocol::generic_operation_result ) // impl in operations.cpp
flat_set< object_id_type > new_objects
Definition: base.hpp:90
future_extensions::flat_set_type extensions_type
Definition: base.hpp:128
static_variant< void_t > future_extensions
Definition: base.hpp:119
share_type calculate_fee(const T &params) const
Definition: base.hpp:100
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:386
Definition: api.cpp:56
flat_set< static_variant, type_lt > flat_set_type
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
FC_REFLECT_TYPENAME(fc::log_message)
void get_required_active_authorities(flat_set< account_id_type > &) const
Definition: base.hpp:105
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
Definition: types.hpp:73
flat_set< object_id_type > removed_objects
Definition: base.hpp:92
void get_required_authorities(vector< authority > &) const
Definition: base.hpp:104
flat_set< object_id_type > updated_objects
Definition: base.hpp:91
fc::static_variant< void_result, object_id_type, asset, generic_operation_result > operation_result
Definition: base.hpp:95
void get_required_owner_authorities(flat_set< account_id_type > &) const
Definition: base.hpp:106