Example #1
0
  @Override
  public void marshal(ITypeMarshalBuffer buffer, boolean includeValue) throws CoreException {
    short firstBytes = ITypeMarshalBuffer.EVAL_FUNCTION_SET;
    if (fQualified) firstBytes |= FLAG_QUALIFIED;
    if (fAddressOf) firstBytes |= FLAG_ADDRESS_OF;
    if (fFunctionSet != null) {
      firstBytes |= FLAG_HAS_FUNCTION_SET;
      final ICPPFunction[] bindings = fFunctionSet.getBindings();
      final ICPPTemplateArgument[] args = fFunctionSet.getTemplateArguments();
      if (args != null) firstBytes |= FLAG_HAS_TEMPLATE_ARGS;

      buffer.putShort(firstBytes);
      buffer.putInt(bindings.length);
      for (ICPPFunction binding : bindings) {
        buffer.marshalBinding(binding);
      }
      if (args != null) {
        buffer.putInt(args.length);
        for (ICPPTemplateArgument arg : args) {
          buffer.marshalTemplateArgument(arg);
        }
      }
      buffer.marshalType(fImpliedObjectType);
    } else {
      buffer.putShort(firstBytes);
      buffer.putCharArray(fName);
    }
    marshalTemplateDefinition(buffer);
  }
Example #2
0
  @Override
  public void marshal(ITypeMarshalBuffer buffer, boolean includeValue) throws CoreException {
    includeValue = includeValue && fValue != Value.UNKNOWN;
    short firstBytes = ITypeMarshalBuffer.EVAL_FIXED;
    if (includeValue) firstBytes |= ITypeMarshalBuffer.FLAG1;
    switch (fValueCategory) {
      case PRVALUE:
        firstBytes |= ITypeMarshalBuffer.FLAG2;
        break;
      case LVALUE:
        firstBytes |= ITypeMarshalBuffer.FLAG3;
        break;
      default:
        break;
    }

    buffer.putShort(firstBytes);
    buffer.marshalType(fType);
    if (includeValue) {
      buffer.marshalValue(fValue);
    }
  }
Example #3
0
 @Override
 public void marshal(ITypeMarshalBuffer buffer) throws CoreException {
   int firstByte = ITypeMarshalBuffer.PACK_EXPANSION_TYPE;
   buffer.putByte((byte) firstByte);
   buffer.marshalType(getType());
 }