A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::ParameterLogger Class Reference

Insert , when streaming function arguments. More...

#include "log.h"

+ Collaboration diagram for ns3::ParameterLogger:

Public Member Functions

 ParameterLogger (std::ostream &os)
 Constructor.
 
template<typename T >
ParameterLoggeroperator<< (const std::vector< T > &vector)
 Overload for vectors, to print each element.
 
template<typename T >
ParameterLoggeroperator<< (const T &param)
 Write a function parameter on the output stream, separating parameters after the first by , strings.
 

Private Member Functions

void CommaRest ()
 Add , before every parameter after the first.
 

Private Attributes

bool m_first {true}
 First argument flag, doesn't get ,.
 
std::ostream & m_os
 Underlying output stream.
 

Detailed Description

Insert , when streaming function arguments.

Definition at line 426 of file log.h.

Constructor & Destructor Documentation

◆ ParameterLogger()

ns3::ParameterLogger::ParameterLogger ( std::ostream & os)

Constructor.

Parameters
[in]osUnderlying output stream.

Definition at line 512 of file log.cc.

Member Function Documentation

◆ CommaRest()

void ns3::ParameterLogger::CommaRest ( )
private

Add , before every parameter after the first.

Definition at line 518 of file log.cc.

References m_first, and m_os.

Referenced by operator<<().

+ Here is the caller graph for this function:

◆ operator<<() [1/2]

template<typename T >
ParameterLogger & ns3::ParameterLogger::operator<< ( const std::vector< T > & vector)

Overload for vectors, to print each element.

Parameters
[in]vectorThe vector of parameters
Returns
This ParameterLogger, so it's chainable.

Definition at line 487 of file log.h.

◆ operator<<() [2/2]

template<typename T >
ParameterLogger & ns3::ParameterLogger::operator<< ( const T & param)

Write a function parameter on the output stream, separating parameters after the first by , strings.

Parameters
[in]paramThe function parameter.
Returns
This ParameterLogger, so it's chainable.

Definition at line 464 of file log.h.

References CommaRest(), and m_os.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_first

bool ns3::ParameterLogger::m_first {true}
private

First argument flag, doesn't get ,.

Definition at line 459 of file log.h.

Referenced by CommaRest().

◆ m_os

std::ostream& ns3::ParameterLogger::m_os
private

Underlying output stream.

Definition at line 460 of file log.h.

Referenced by CommaRest(), and operator<<().


The documentation for this class was generated from the following files: