flyweight

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FWBase

type FWBase struct {
	// contains filtered or unexported fields
}

func (*FWBase) SetSize

func (m *FWBase) SetSize(size int)

func (*FWBase) Size

func (m *FWBase) Size() int

type Field

type Field interface {
	Wrap(buffer *atomic.Buffer, offset int)
	Get() interface{}
}

Field is the interface for a field in a flyweight wrapper. It expects a preallocated buffer and offset into it, as arguments.

type Flyweight

type Flyweight interface {
	Wrap(*atomic.Buffer, int) Flyweight
	Size() int
	SetSize(int)
}

type Int32Field

type Int32Field struct {
	// contains filtered or unexported fields
}

Int32Field is int32 field for flyweight

func (*Int32Field) CAS

func (fld *Int32Field) CAS(curValue, newValue int32) bool

func (*Int32Field) Get

func (fld *Int32Field) Get() int32

func (*Int32Field) Set

func (fld *Int32Field) Set(value int32)

func (*Int32Field) Wrap

func (fld *Int32Field) Wrap(buffer *atomic.Buffer, offset int) int

type Int64Field

type Int64Field struct {
	// contains filtered or unexported fields
}

Int64Field is int64 field for flyweight

func (*Int64Field) CAS

func (fld *Int64Field) CAS(curValue, newValue int64) bool

func (*Int64Field) Get

func (fld *Int64Field) Get() int64

func (*Int64Field) GetAndAddInt64

func (fld *Int64Field) GetAndAddInt64(value int64) int64

func (*Int64Field) Set

func (fld *Int64Field) Set(value int64)

func (*Int64Field) Wrap

func (fld *Int64Field) Wrap(buffer *atomic.Buffer, offset int) int

type Padding

type Padding struct {
	// contains filtered or unexported fields
}

func (*Padding) Get

func (f *Padding) Get() *atomic.Buffer

func (*Padding) Wrap

func (f *Padding) Wrap(buffer *atomic.Buffer, offset int, size int32, alignment int32) int

Wrap for padding takes size to pas this particular position to and alignment as the

type RawDataField

type RawDataField struct {
	// contains filtered or unexported fields
}

func (*RawDataField) Get

func (f *RawDataField) Get() *atomic.Buffer

func (*RawDataField) Wrap

func (f *RawDataField) Wrap(buffer *atomic.Buffer, offset int, length int32) int

type StringField

type StringField struct {
	// contains filtered or unexported fields
}

StringField is string field for flyweight

func (*StringField) Get

func (fld *StringField) Get() string

func (*StringField) Set

func (fld *StringField) Set(value string)

func (*StringField) Wrap

func (fld *StringField) Wrap(buffer *atomic.Buffer, offset int, fly Flyweight, align bool) int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL