github.com/lirm/aeron-go@v0.0.0-20230415210743-920325491dc4/aeron/flyweight/flyweight.go (about)

     1  /*
     2  Copyright 2016-2018 Stanislav Liberman
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8  http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package flyweight
    18  
    19  import "github.com/lirm/aeron-go/aeron/atomic"
    20  
    21  type Flyweight interface {
    22  	Wrap(*atomic.Buffer, int) Flyweight
    23  	Size() int
    24  	SetSize(int)
    25  }
    26  
    27  type FWBase struct {
    28  	size int
    29  }
    30  
    31  func (m *FWBase) Size() int {
    32  	return m.size
    33  }
    34  
    35  func (m *FWBase) SetSize(size int) {
    36  	m.size = size
    37  }