mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
DataSeries cleanup.
This commit is contained in:
parent
7131feefbc
commit
891c532775
6 changed files with 162 additions and 181 deletions
|
@ -24,6 +24,20 @@ bool Field::Write(SerializationFormat* fmt) const
|
|||
return (fmt->Write(name, "name") && fmt->Write((int)type, "type") && fmt->Write((int)subtype, "subtype"));
|
||||
}
|
||||
|
||||
string Field::TypeName() const
|
||||
{
|
||||
string n = type_name(type);
|
||||
|
||||
if ( (type == TYPE_TABLE) || (type == TYPE_VECTOR) )
|
||||
{
|
||||
n += "[";
|
||||
n += type_name(subtype);
|
||||
n += "]";
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
Value::~Value()
|
||||
{
|
||||
if ( (type == TYPE_ENUM || type == TYPE_STRING || type == TYPE_FILE || type == TYPE_FUNC)
|
||||
|
|
|
@ -53,6 +53,12 @@ struct Field {
|
|||
* @return False if an error occured.
|
||||
*/
|
||||
bool Write(SerializationFormat* fmt) const;
|
||||
|
||||
/**
|
||||
* Returns a textual description of the field's type. This method is
|
||||
* thread-safe.
|
||||
*/
|
||||
string TypeName() const;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -132,8 +138,8 @@ struct Value {
|
|||
|
||||
/**
|
||||
* Returns true if the type can be represented by a Value. If
|
||||
* `atomic_only` is true, will not permit composite types.
|
||||
*/
|
||||
* `atomic_only` is true, will not permit composite types. This
|
||||
* method is thread-safe. */
|
||||
static bool IsCompatibleType(BroType* t, bool atomic_only=false);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue