查看单个帖子
旧 2009-05-07, 12:04 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】protocol extension

protocol extension
protocol extension
hi,
i am using the protocol extension and i have a few questions.
i see the odread example:
// extension protocol.
m_entitydumper = oddbentity_dumper::createobjet();
oddbentity::desc->addx(oddbentity_dumper::desc(), m_entitydumper);
// after
odsmartptr<oddbentity_dumpler> pent = pentity;
pent->dump(...);
1) if i haven磘 added oddbentity->addx then what happens?
2) i don't understand what do it exacty addx.
3) what do it exacty pent = pentity ?
thank you.
if you removed the addx() from the code, it would simply not 'dump' that object it was removed from.
if you do not call
oddbentity::desc->addx(oddbentity_dumper::desc(), m_entitydumper);
oddbentityptr pentity = .....
pentity->queryx(oddbentity_dumper::desc())
will return null
odsmartptr<oddbentity_dumpler> pent = pentity;
will throw an exception.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)