From 28bb39b54834767c778dd73de85d1528dce77cc9 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Sat, 23 Jan 2021 10:27:49 -0800 Subject: [PATCH] helper predicate for identifying type tags associated with aggregates --- src/Type.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Type.h b/src/Type.h index cae2429719..fc5e1aa6c9 100644 --- a/src/Type.h +++ b/src/Type.h @@ -920,6 +920,12 @@ inline bool IsVector(TypeTag t) { return (t == TYPE_VECTOR); } // True if the given type type is a string. inline bool IsString(TypeTag t) { return (t == TYPE_STRING); } +// True if the given type is a container aggregate. +inline bool IsAggr(TypeTag tag) + { + return tag == TYPE_VECTOR || tag == TYPE_TABLE || tag == TYPE_RECORD; + } + // True if the given type tag corresponds to the error type. inline bool IsErrorType(TypeTag t) { return (t == TYPE_ERROR); }