mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
use embedded interface types
R=r DELTA=205 (1 added, 157 deleted, 47 changed) OCL=25071 CL=25073
This commit is contained in:
parent
b4af09ab56
commit
dfad8ea647
3 changed files with 48 additions and 204 deletions
|
|
@ -66,11 +66,7 @@ type creatorFn func(typ Type, addr Addr) Value
|
|||
// -- Missing
|
||||
|
||||
type MissingValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
Value;
|
||||
}
|
||||
|
||||
type missingValueStruct struct {
|
||||
|
|
@ -84,12 +80,7 @@ func missingCreator(typ Type, addr Addr) Value {
|
|||
// -- Int
|
||||
|
||||
type IntValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() int;
|
||||
Set(int);
|
||||
}
|
||||
|
|
@ -113,12 +104,7 @@ func (v *intValueStruct) Set(i int) {
|
|||
// -- Int8
|
||||
|
||||
type Int8Value interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() int8;
|
||||
Set(int8);
|
||||
}
|
||||
|
|
@ -142,12 +128,7 @@ func (v *int8ValueStruct) Set(i int8) {
|
|||
// -- Int16
|
||||
|
||||
type Int16Value interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() int16;
|
||||
Set(int16);
|
||||
}
|
||||
|
|
@ -171,12 +152,7 @@ func (v *int16ValueStruct) Set(i int16) {
|
|||
// -- Int32
|
||||
|
||||
type Int32Value interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() int32;
|
||||
Set(int32);
|
||||
}
|
||||
|
|
@ -200,12 +176,7 @@ func (v *int32ValueStruct) Set(i int32) {
|
|||
// -- Int64
|
||||
|
||||
type Int64Value interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() int64;
|
||||
Set(int64);
|
||||
}
|
||||
|
|
@ -229,12 +200,7 @@ func (v *int64ValueStruct) Set(i int64) {
|
|||
// -- Uint
|
||||
|
||||
type UintValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() uint;
|
||||
Set(uint);
|
||||
}
|
||||
|
|
@ -258,12 +224,7 @@ func (v *uintValueStruct) Set(i uint) {
|
|||
// -- Uint8
|
||||
|
||||
type Uint8Value interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() uint8;
|
||||
Set(uint8);
|
||||
}
|
||||
|
|
@ -287,12 +248,7 @@ func (v *uint8ValueStruct) Set(i uint8) {
|
|||
// -- Uint16
|
||||
|
||||
type Uint16Value interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() uint16;
|
||||
Set(uint16);
|
||||
}
|
||||
|
|
@ -316,12 +272,7 @@ func (v *uint16ValueStruct) Set(i uint16) {
|
|||
// -- Uint32
|
||||
|
||||
type Uint32Value interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() uint32;
|
||||
Set(uint32);
|
||||
}
|
||||
|
|
@ -345,12 +296,7 @@ func (v *uint32ValueStruct) Set(i uint32) {
|
|||
// -- Uint64
|
||||
|
||||
type Uint64Value interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() uint64;
|
||||
Set(uint64);
|
||||
}
|
||||
|
|
@ -374,12 +320,7 @@ func (v *uint64ValueStruct) Set(i uint64) {
|
|||
// -- Uintptr
|
||||
|
||||
type UintptrValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() uintptr;
|
||||
Set(uintptr);
|
||||
}
|
||||
|
|
@ -403,12 +344,7 @@ func (v *uintptrValueStruct) Set(i uintptr) {
|
|||
// -- Float
|
||||
|
||||
type FloatValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() float;
|
||||
Set(float);
|
||||
}
|
||||
|
|
@ -432,12 +368,7 @@ func (v *floatValueStruct) Set(f float) {
|
|||
// -- Float32
|
||||
|
||||
type Float32Value interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() float32;
|
||||
Set(float32);
|
||||
}
|
||||
|
|
@ -461,12 +392,7 @@ func (v *float32ValueStruct) Set(f float32) {
|
|||
// -- Float64
|
||||
|
||||
type Float64Value interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() float64;
|
||||
Set(float64);
|
||||
}
|
||||
|
|
@ -490,12 +416,7 @@ func (v *float64ValueStruct) Set(f float64) {
|
|||
// -- Float80
|
||||
|
||||
type Float80Value interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() float80;
|
||||
Set(float80);
|
||||
}
|
||||
|
|
@ -522,12 +443,7 @@ func (v *Float80ValueStruct) Set(f float80) {
|
|||
// -- String
|
||||
|
||||
type StringValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() string;
|
||||
Set(string);
|
||||
}
|
||||
|
|
@ -551,12 +467,7 @@ func (v *stringValueStruct) Set(s string) {
|
|||
// -- Bool
|
||||
|
||||
type BoolValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() bool;
|
||||
Set(bool);
|
||||
}
|
||||
|
|
@ -580,12 +491,7 @@ func (v *boolValueStruct) Set(b bool) {
|
|||
// -- Pointer
|
||||
|
||||
type PtrValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Sub() Value;
|
||||
Get() Addr;
|
||||
SetSub(Value);
|
||||
|
|
@ -621,12 +527,7 @@ func ptrCreator(typ Type, addr Addr) Value {
|
|||
// Slices and arrays are represented by the same interface.
|
||||
|
||||
type ArrayValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
IsSlice() bool;
|
||||
Len() int;
|
||||
Cap() int;
|
||||
|
|
@ -759,12 +660,7 @@ func arrayCreator(typ Type, addr Addr) Value {
|
|||
// -- Map TODO: finish and test
|
||||
|
||||
type MapValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Len() int;
|
||||
Elem(key Value) Value;
|
||||
}
|
||||
|
|
@ -789,11 +685,7 @@ func (v *mapValueStruct) Elem(key Value) Value {
|
|||
// -- Chan
|
||||
|
||||
type ChanValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
Value;
|
||||
}
|
||||
|
||||
type chanValueStruct struct {
|
||||
|
|
@ -807,12 +699,7 @@ func chanCreator(typ Type, addr Addr) Value {
|
|||
// -- Struct
|
||||
|
||||
type StructValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Len() int;
|
||||
Field(i int) Value;
|
||||
}
|
||||
|
|
@ -846,12 +733,7 @@ func structCreator(typ Type, addr Addr) Value {
|
|||
// -- Interface
|
||||
|
||||
type InterfaceValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
|
||||
Value;
|
||||
Get() interface {};
|
||||
}
|
||||
|
||||
|
|
@ -870,11 +752,7 @@ func interfaceCreator(typ Type, addr Addr) Value {
|
|||
// -- Func
|
||||
|
||||
type FuncValue interface {
|
||||
// TODO: Value;
|
||||
Kind() int;
|
||||
Type() Type;
|
||||
Addr() Addr;
|
||||
Interface() interface {};
|
||||
Value;
|
||||
}
|
||||
|
||||
type funcValueStruct struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue