Get cache modes which have any of the provided traits

Signed-off-by: Daniel Madej <daniel.madej@intel.com>
This commit is contained in:
Daniel Madej 2020-02-07 16:53:09 +01:00
parent d568bec1e3
commit 081a05a635

View File

@ -57,6 +57,12 @@ class CacheMode(Enum):
m for m in CacheMode if all(map(lambda t: t in CacheMode.get_traits(m), flags)) m for m in CacheMode if all(map(lambda t: t in CacheMode.get_traits(m), flags))
] ]
@staticmethod
def with_any_trait(flags: CacheModeTrait):
return [
m for m in CacheMode if any(map(lambda t: t in CacheMode.get_traits(m), flags))
]
class SeqCutOffPolicy(Enum): class SeqCutOffPolicy(Enum):
full = 0 full = 0