Skip to content

Commit 288091d

Browse files
Mariusz-Trelavogel76
authored andcommitted
Refactoring - move methods' definitions into *.cpp file
1 parent 1ed291a commit 288091d

File tree

2 files changed

+27
-23
lines changed

2 files changed

+27
-23
lines changed

libraries/protocol/hive_operations.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,4 +745,28 @@ void pow2::create(const block_id_type & prev, const account_name_type & account_
745745
} FC_CAPTURE_AND_RETHROW( (*this) )
746746
}
747747

748+
void recurrent_transfer_operation::recurrent_transfer_extension_visitor::operator()( const recurrent_transfer_pair_id& recurrent_transfer_pair_id )
749+
{
750+
was_pair_id = true;
751+
pair_id = recurrent_transfer_pair_id.pair_id;
752+
}
753+
754+
uint8_t recurrent_transfer_operation::get_pair_id( const recurrent_transfer_extensions_type& _extensions, bool* explicitValue ) const
755+
{
756+
recurrent_transfer_extension_visitor _vtor;
757+
758+
for( const auto& e : _extensions )
759+
e.visit( _vtor );
760+
761+
if( explicitValue )
762+
*explicitValue = _vtor.was_pair_id;
763+
764+
return _vtor.pair_id;
765+
}
766+
767+
uint8_t recurrent_transfer_operation::get_pair_id( bool* explicitValue ) const
768+
{
769+
return get_pair_id( extensions, explicitValue );
770+
}
771+
748772
} } // hive::protocol

libraries/protocol/include/hive/protocol/hive_operations.hpp

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,12 +1083,7 @@ namespace hive { namespace protocol {
10831083

10841084
typedef void result_type;
10851085

1086-
void operator()( const recurrent_transfer_pair_id& recurrent_transfer_pair_id )
1087-
{
1088-
was_pair_id = true;
1089-
pair_id = recurrent_transfer_pair_id.pair_id;
1090-
}
1091-
1086+
void operator()( const recurrent_transfer_pair_id& recurrent_transfer_pair_id );
10921087
void operator()( const hive::void_t& ) {}
10931088
};
10941089

@@ -1114,23 +1109,8 @@ namespace hive { namespace protocol {
11141109
void get_required_active_authorities( flat_set<account_name_type>& a )const{ a.insert(from); }
11151110

11161111
/// Returns pair id specific to given operation. explicitValue if not null will be set to true if pair_id was explicitly specified in the operation.
1117-
uint8_t get_pair_id( const recurrent_transfer_extensions_type& _extensions, bool* explicitValue = nullptr ) const
1118-
{
1119-
recurrent_transfer_extension_visitor _vtor;
1120-
1121-
for( const auto& e : _extensions )
1122-
e.visit( _vtor );
1123-
1124-
if( explicitValue )
1125-
*explicitValue = _vtor.was_pair_id;
1126-
1127-
return _vtor.pair_id;
1128-
}
1129-
1130-
uint8_t get_pair_id( bool* explicitValue = nullptr ) const
1131-
{
1132-
return get_pair_id( extensions, explicitValue );
1133-
}
1112+
uint8_t get_pair_id( const recurrent_transfer_extensions_type& _extensions, bool* explicitValue = nullptr ) const;
1113+
uint8_t get_pair_id( bool* explicitValue = nullptr ) const;
11341114
};
11351115

11361116
struct witness_block_approve_operation : public base_operation

0 commit comments

Comments
 (0)