// Code generated by counterfeiter. DO NOT EDIT.
package fakes

import (
	"sync"

	"code.cloudfoundry.org/garden-external-networker/port_allocator"
)

type Tracker struct {
	AcquireOneStub        func(*port_allocator.Pool, string) (uint32, error)
	acquireOneMutex       sync.RWMutex
	acquireOneArgsForCall []struct {
		arg1 *port_allocator.Pool
		arg2 string
	}
	acquireOneReturns struct {
		result1 uint32
		result2 error
	}
	acquireOneReturnsOnCall map[int]struct {
		result1 uint32
		result2 error
	}
	InRangeStub        func(uint32) bool
	inRangeMutex       sync.RWMutex
	inRangeArgsForCall []struct {
		arg1 uint32
	}
	inRangeReturns struct {
		result1 bool
	}
	inRangeReturnsOnCall map[int]struct {
		result1 bool
	}
	ReleaseAllStub        func(*port_allocator.Pool, string) error
	releaseAllMutex       sync.RWMutex
	releaseAllArgsForCall []struct {
		arg1 *port_allocator.Pool
		arg2 string
	}
	releaseAllReturns struct {
		result1 error
	}
	releaseAllReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *Tracker) AcquireOne(arg1 *port_allocator.Pool, arg2 string) (uint32, error) {
	fake.acquireOneMutex.Lock()
	ret, specificReturn := fake.acquireOneReturnsOnCall[len(fake.acquireOneArgsForCall)]
	fake.acquireOneArgsForCall = append(fake.acquireOneArgsForCall, struct {
		arg1 *port_allocator.Pool
		arg2 string
	}{arg1, arg2})
	stub := fake.AcquireOneStub
	fakeReturns := fake.acquireOneReturns
	fake.recordInvocation("AcquireOne", []interface{}{arg1, arg2})
	fake.acquireOneMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *Tracker) AcquireOneCallCount() int {
	fake.acquireOneMutex.RLock()
	defer fake.acquireOneMutex.RUnlock()
	return len(fake.acquireOneArgsForCall)
}

func (fake *Tracker) AcquireOneCalls(stub func(*port_allocator.Pool, string) (uint32, error)) {
	fake.acquireOneMutex.Lock()
	defer fake.acquireOneMutex.Unlock()
	fake.AcquireOneStub = stub
}

func (fake *Tracker) AcquireOneArgsForCall(i int) (*port_allocator.Pool, string) {
	fake.acquireOneMutex.RLock()
	defer fake.acquireOneMutex.RUnlock()
	argsForCall := fake.acquireOneArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *Tracker) AcquireOneReturns(result1 uint32, result2 error) {
	fake.acquireOneMutex.Lock()
	defer fake.acquireOneMutex.Unlock()
	fake.AcquireOneStub = nil
	fake.acquireOneReturns = struct {
		result1 uint32
		result2 error
	}{result1, result2}
}

func (fake *Tracker) AcquireOneReturnsOnCall(i int, result1 uint32, result2 error) {
	fake.acquireOneMutex.Lock()
	defer fake.acquireOneMutex.Unlock()
	fake.AcquireOneStub = nil
	if fake.acquireOneReturnsOnCall == nil {
		fake.acquireOneReturnsOnCall = make(map[int]struct {
			result1 uint32
			result2 error
		})
	}
	fake.acquireOneReturnsOnCall[i] = struct {
		result1 uint32
		result2 error
	}{result1, result2}
}

func (fake *Tracker) InRange(arg1 uint32) bool {
	fake.inRangeMutex.Lock()
	ret, specificReturn := fake.inRangeReturnsOnCall[len(fake.inRangeArgsForCall)]
	fake.inRangeArgsForCall = append(fake.inRangeArgsForCall, struct {
		arg1 uint32
	}{arg1})
	stub := fake.InRangeStub
	fakeReturns := fake.inRangeReturns
	fake.recordInvocation("InRange", []interface{}{arg1})
	fake.inRangeMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *Tracker) InRangeCallCount() int {
	fake.inRangeMutex.RLock()
	defer fake.inRangeMutex.RUnlock()
	return len(fake.inRangeArgsForCall)
}

func (fake *Tracker) InRangeCalls(stub func(uint32) bool) {
	fake.inRangeMutex.Lock()
	defer fake.inRangeMutex.Unlock()
	fake.InRangeStub = stub
}

func (fake *Tracker) InRangeArgsForCall(i int) uint32 {
	fake.inRangeMutex.RLock()
	defer fake.inRangeMutex.RUnlock()
	argsForCall := fake.inRangeArgsForCall[i]
	return argsForCall.arg1
}

func (fake *Tracker) InRangeReturns(result1 bool) {
	fake.inRangeMutex.Lock()
	defer fake.inRangeMutex.Unlock()
	fake.InRangeStub = nil
	fake.inRangeReturns = struct {
		result1 bool
	}{result1}
}

func (fake *Tracker) InRangeReturnsOnCall(i int, result1 bool) {
	fake.inRangeMutex.Lock()
	defer fake.inRangeMutex.Unlock()
	fake.InRangeStub = nil
	if fake.inRangeReturnsOnCall == nil {
		fake.inRangeReturnsOnCall = make(map[int]struct {
			result1 bool
		})
	}
	fake.inRangeReturnsOnCall[i] = struct {
		result1 bool
	}{result1}
}

func (fake *Tracker) ReleaseAll(arg1 *port_allocator.Pool, arg2 string) error {
	fake.releaseAllMutex.Lock()
	ret, specificReturn := fake.releaseAllReturnsOnCall[len(fake.releaseAllArgsForCall)]
	fake.releaseAllArgsForCall = append(fake.releaseAllArgsForCall, struct {
		arg1 *port_allocator.Pool
		arg2 string
	}{arg1, arg2})
	stub := fake.ReleaseAllStub
	fakeReturns := fake.releaseAllReturns
	fake.recordInvocation("ReleaseAll", []interface{}{arg1, arg2})
	fake.releaseAllMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *Tracker) ReleaseAllCallCount() int {
	fake.releaseAllMutex.RLock()
	defer fake.releaseAllMutex.RUnlock()
	return len(fake.releaseAllArgsForCall)
}

func (fake *Tracker) ReleaseAllCalls(stub func(*port_allocator.Pool, string) error) {
	fake.releaseAllMutex.Lock()
	defer fake.releaseAllMutex.Unlock()
	fake.ReleaseAllStub = stub
}

func (fake *Tracker) ReleaseAllArgsForCall(i int) (*port_allocator.Pool, string) {
	fake.releaseAllMutex.RLock()
	defer fake.releaseAllMutex.RUnlock()
	argsForCall := fake.releaseAllArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *Tracker) ReleaseAllReturns(result1 error) {
	fake.releaseAllMutex.Lock()
	defer fake.releaseAllMutex.Unlock()
	fake.ReleaseAllStub = nil
	fake.releaseAllReturns = struct {
		result1 error
	}{result1}
}

func (fake *Tracker) ReleaseAllReturnsOnCall(i int, result1 error) {
	fake.releaseAllMutex.Lock()
	defer fake.releaseAllMutex.Unlock()
	fake.ReleaseAllStub = nil
	if fake.releaseAllReturnsOnCall == nil {
		fake.releaseAllReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.releaseAllReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *Tracker) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.acquireOneMutex.RLock()
	defer fake.acquireOneMutex.RUnlock()
	fake.inRangeMutex.RLock()
	defer fake.inRangeMutex.RUnlock()
	fake.releaseAllMutex.RLock()
	defer fake.releaseAllMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *Tracker) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}
