本文整理汇总了C++中Constant::marshal方法的典型用法代码示例。如果您正苦于以下问题:C++ Constant::marshal方法的具体用法?C++ Constant::marshal怎么用?C++ Constant::marshal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constant
的用法示例。
在下文中一共展示了Constant::marshal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConstantClass
INLINE
Constant *Constant::dispatchMarshal(Stream &stream, JVM_U1 tag)
{
Constant *constant = NULL;
switch(tag)
{
case 7:
constant = new ConstantClass();
break;
case 9:
constant = new ConstantFieldRef();
break;
case 10:
constant = new ConstantMethodRef();
break;
case 11:
constant = new ConstantInterfaceMethodRef();
break;
case 8:
constant = new ConstantString();
break;
case 3:
constant = new ConstantInteger();
break;
case 4:
constant = new ConstantFloat();
break;
case 5:
constant = new ConstantLong();
break;
case 6:
constant = new ConstantDouble();
break;
case 12:
constant = new ConstantNameAndType();
break;
case 1:
constant = new ConstantUtf8();
break;
case 15:
constant = new ConstantMethodHandle();
break;
case 16:
constant = new ConstantMethodType();
break;
case 18:
constant = new ConstantInvokeDynamic();
break;
default:
ERROR("tag is %d, this should not happened!", tag);
break;
}
if(constant != NULL)
{
constant->tag_ = tag;
if(constant->marshal(stream) == false)
{
ERROR("constant %d marshal failed! this constant object will be removed.", tag);
delete constant;
return NULL;
}
}
return constant;
}