예제 #1
0
void IntegerValue::SerializeTo(SerializeOutput &out) const {
  switch(GetTypeId()) {
    case Type::TINYINT:
      out.WriteByte(value_.tinyint);
      return;
    case Type::SMALLINT:
      out.WriteShort(value_.smallint);
      return;
    case Type::INTEGER:
    case Type::PARAMETER_OFFSET:
      out.WriteInt(value_.integer);
      return;
    case Type::BIGINT:
      out.WriteLong(value_.bigint);
      return;
    default:
      return;
  }
  throw Exception("type error");
}
예제 #2
0
void TimestampType::SerializeTo(const Value& val, SerializeOutput &out) const {
  out.WriteLong(val.value_.timestamp);
}