P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::MarshaledFrom Struct Reference

Public Member Functions

 MarshaledFrom (gress_t gress, cstring name)
 
 MarshaledFrom (gress_t gress, cstring name, size_t pre_padding)
 
bool operator== (const MarshaledFrom &other) const
 
void toJSON (JSONGenerator &json) const
 JSON serialization/deserialization.
 
std::string toString () const
 

Static Public Member Functions

static MarshaledFrom fromJSON (JSONLoader &json)
 

Public Attributes

cstring field_name
 
gress_t gress
 
size_t pre_padding
 

Friends

P4::JSONGeneratoroperator<< (P4::JSONGenerator &out, const MarshaledFrom &c)
 
std::ostream & operator<< (std::ostream &s, const MarshaledFrom &m)
 

Member Function Documentation

◆ toString()

std::string MarshaledFrom::toString ( ) const

Copyright (C) 2024 Intel Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0

Member Data Documentation

◆ pre_padding

size_t P4::MarshaledFrom::pre_padding

Here the pre and post is in network order, which means, on the wire the oreder is [pre_padding, field, post_padding]. TODO: currently, we do not have post_padding. When we create padding for those marshalable fields, we append paddings before the field.