(十四)eos开发实战dapp+游戏--智能合约之数据库multi_index多key

开言:此教材只是个人学习过程记录自己理解和各种坑如有问题可提出修正,个人注重是开发动手,小白,写也是为了重复加深印象,目标此教学习实现开发一个EOS小游戏,坚持.......
 环境: Mac+EOS-1.3.0

 任务:multi_index多key

 

multi_index</*<-数据表名称*/, ,/*<-数据对象类型*/
    /*设置索引->*/indexed_by< N(查询名), const_mem_fun</*<-数据对象类型*/, 类型, &/*<-数据对象类型*/::方法名const方法> > 

 

 

后续: 

end & cend 
返回指向虚拟行的迭代器,代表刚刚过去的最后一行,不能被间接引用; 
可以向后推进,不能向前推进。 
const_iterator end() const 
const_iterator end() const

rbegin & crbegin 
返回和begin/cbegin类似的,但反向的迭代器 
const_iterator rbegin() const 
const_iterator crbegin() const

rend & crend 
返回和end/cend类似的,但反向的迭代器 
const_iterator rend() const 
const_iterator crend() const

lower_bound 
查找大于等于给定主键值的对象 
const_iterator lower_bound( uint64_t primary ) const

upper_bound 
查找大于给定主键值的对象 
const_iterator upper_bound( uint64_t primary ) const

get_index 
返回一个适当类型的二级索引 
secondary_index get_index<IndexName>() 
secondary_index get_index<IndexName>() const

iterator_to 
返回给定对象的迭代器 
const_iterator iterator_to( const object_type& obj ) const

indexed_by 
indexed_by结构体用于实例化multi_index表的索引 
indexed_by在multi_index.hpp中的定义如下:
 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值