A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::StructConstructor< Function > Struct Template Reference

Describe a function that constructs a structure from its field values. More...

#include "struct.h"

Collaboration diagram for ns3::StructConstructor< Function >:

Public Types

using function_type = decltype(Function)
 Type of the constructor function pointer.

Static Public Attributes

static constexpr auto function = Function
 Pointer to the function that constructs the structure.

Detailed Description

template<auto Function>
struct ns3::StructConstructor< Function >

Describe a function that constructs a structure from its field values.

C++ does not allow taking the address of a constructor. Therefore, Function must point to a static or free factory function that returns the represented structure and accepts its field values in declaration order.

struct Data
{
static Data Create(uint16_t count, double value);
};
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:492
Describe a function that constructs a structure from its field values.
Definition struct.h:262
Template Parameters
FunctionPointer to the function that constructs the structure.

Definition at line 261 of file struct.h.

Member Typedef Documentation

◆ function_type

template<auto Function>
using ns3::StructConstructor< Function >::function_type = decltype(Function)

Type of the constructor function pointer.

Definition at line 264 of file struct.h.

Member Data Documentation

◆ function

template<auto Function>
auto ns3::StructConstructor< Function >::function = Function
staticconstexpr

Pointer to the function that constructs the structure.

Definition at line 267 of file struct.h.


The documentation for this struct was generated from the following file: