func (s *OpSet) HasAny(opTypes ...OperatorType) bool {
	if s == nil || (s.onlyOne == false && len(s.ots) == 0) {
		return false
	}
	if s.onlyOne {
		for _, opt := range opTypes {
			if opt == s.one {
				return true
			}
		}
		return false
	} else {
		for _, opt := range opTypes {
			_, exist := s.ots[opt]
			if exist {
				return true
			}
		}
		return false
	}
}
any one or more
package models
import (
	"bytes"
	"fmt"
	"reflect"
	"strconv"
	"sync"
	"github.com/ThinkiumGroup/go-common"
	"github.com/sirupsen/logrus"
)
type (
	OperatorType byte
	OpSet struct {
		onlyOne bool
		one     OperatorType
		ots     map[OperatorType]struct{}
	}
	Operator struct {
		Type       OperatorType
		Operations []interface{}
	}
	RawData interface {
		GetFrom() Location
		GetFromNodeID() *common.NodeID
		GetFromChainID() common.ChainID
		GetFromNetType() common.NetType
		GetEventType() EventType
		GetData() []byte
		GetObject() interface{}
		GetHash() *common.Hash
		GetPublicKey() []byte
		GetSignature() []byte
	}
	ChainEvent interface {
		GetChainID() common.ChainID
	}
	DirectiveMsg interface {
		DestChainID() common.ChainID
	}
	ThresholdEvent interface {
		ChainEvent
		Pass(threshold interface{}) bool
	}
	PubAndSig struct {
		PublicKey []byte
		Signature []byte
	}
	PubAndSigs []*PubAndSig
	Context struct {
		Op        *OpSet
		Eventer   Eventer
		ChainInfo *common.ChainInfos
		ShardInfo common.ShardInfo
		Networker Networker
		Holder    DataHolder
		Engine    Engine
		Source Location
		Dmanager DataManager
		Nmanager NetworkManager
		WorkerName string
		Logger     logrus.FieldLogger
		PAS        *PubAndSig
	}
	Eventer interface {
		common.Service
		PrintCounts()
		SetEngine(engine Engine)
		SetDataManager(manager DataManager)
		SetNetworkManager(manager NetworkManager)
		Shutdown()
		HasChainOpType(chainid common.ChainID, opType OperatorType) bool
		GetChainOpTypes(chainid common.ChainID) []OperatorType
		GetNodeOpTypes() map[common.ChainID][]string
		AddChainOpType(id common.ChainID, opType OperatorType)
		AppendChainOpType(id common.ChainID, opType OperatorType)
		RemoveChainOpType(id common.ChainID, opType OperatorType)
		ReplaceChainOpTypes(id common.ChainID, fromType OperatorType, toType OperatorType) bool
		ClearChainOpType(chainid common.ChainID)
		ResetToFailureOpType(chainid common.ChainID)
		RebuildContext(ctx *Context, newChainID common.ChainID) *Context
		SetEventThreshold(chainId common.ChainID, threshold interface{})
		PostMain(RawData)
		SyncPost(event interface{})
		Post(interface{})
		PostEvent(event interface{}, pub, sig []byte) error
		ExitChain(id common.ChainID)  
		CheckPermission(chainId common.ChainID, nodeId common.NodeID, netType common.NetType, proof []byte) error
	}
	Location struct {
		nodeID  *common.NodeID
		chainID common.ChainID
		netType common.NetType
	}
	RawDataObj struct {
		from      Location      
		eventType EventType     
		h         *common.Hash  
		data      []byte        
		pub       []byte        
		sig       []byte        
		v         interface{}   
	}
	QueueObj struct {
		From      Location      
		EventType EventType     
		H         *common.Hash  
		V         interface{}   
		P         []byte        
		S         []byte        
	}
)
var (
	RawDataPool = sync.Pool{
		New: func() interface{} {
			return new(RawDataObj)
		},
	}
	QueueObjPool = sync.Pool{
		New: func() interface{} {
			return new(QueueObj)
		},
	}
	operatorTypeNames = map[OperatorType]string{
		CtrlOp:      "CTRL",
		DataOp:      "DATA",
		CommitteeOp: "COMM",
		SpectatorOp: "SPEC",
		MemoOp:      "MEMO",
		InitialOp:   "INIT",
		StartOp:     "START",
		FailureOp:   "FAIL",
		PreelectOp:  "PELT",
	}
	TypeOfContextPtr = reflect.TypeOf((*Context)(nil))
)
func (o OperatorType) String() string {
	if n, ok := operatorTypeNames[o]; ok {
		return n
	}
	return "OperatorType-" + strconv.Itoa(int(o))
}
func NewOpSet(ots []OperatorType) *OpSet {
	if len(ots) == 0 {
		return &OpSet{
			onlyOne: false,
			one:     0,
			ots:     nil,
		}
	}
	m := make(map[OperatorType]struct{})
	for _, ot := range ots {
		m[ot] = struct{}{}
	}
	if len(m) == 1 {
		set := new(OpSet)
		set.onlyOne = true
		for k, _ := range m {
			set.one = k
		}
		return set
	} else {
		return &OpSet{
			onlyOne: false,
			one:     0,
			ots:     m,
		}
	}
}
func (s *OpSet) Has(opType OperatorType) bool {
	if s == nil || (s.onlyOne == false && len(s.ots) == 0) {
		return false
	}
	if s.onlyOne {
		return opType == s.one
	} else {
		_, exist := s.ots[opType]
		return exist
	}
}