SimGrid  3.21
Versatile Simulation of Distributed Systems
simgrid::s4u::Link Class Reference

Detailed Description

A Link represents the network facilities between hosts.

#include <Link.hpp>

Inherits simgrid::xbt::Extendable< Link >.

Public Types

enum  SharingPolicy { SharingPolicy::SPLITDUPLEX = 2, SharingPolicy::SHARED = 1, SharingPolicy::FATPIPE = 0 }
 

Public Member Functions

kernel::resource::LinkImpl * get_impl ()
 
const std::string & get_name () const
 Retrieves the name of that link as a C++ string. More...
 
const char * get_cname () const
 Retrieves the name of that link as a C string. More...
 
double get_bandwidth ()
 Get the bandwidth in bytes per second of current Link. More...
 
double get_latency ()
 Get the latency in seconds of current Link. More...
 
SharingPolicy get_sharing_policy ()
 Describes how the link is shared between flows. More...
 
double get_usage ()
 Returns the current load (in flops per second) More...
 
bool is_used ()
 Check if the Link is used (at least one flow uses the link) More...
 
void turn_on ()
 
void turn_off ()
 
void * get_data ()
 
void set_data (void *d)
 Should be used only from the C interface. More...
 
void set_state_trace (tmgr_trace_t trace)
 
void set_bandwidth_trace (tmgr_trace_t trace)
 
void set_latency_trace (tmgr_trace_t trace)
 
const char * get_property (std::string key)
 
void set_property (std::string key, std::string value)
 
const std::string & getName () const
 
const char * getCname () const
 
SharingPolicy sharingPolicy ()
 
double getUsage ()
 
bool isUsed ()
 
double bandwidth ()
 
double latency ()
 
void turnOn ()
 
void turnOff ()
 
const char * getProperty (const char *key)
 
void setProperty (std::string key, std::string value)
 
void * getData ()
 
void setData (void *d)
 
void setStateTrace (tmgr_trace_t trace)
 
void setBandwidthTrace (tmgr_trace_t trace)
 
void setLatencyTrace (tmgr_trace_t trace)
 
- Public Member Functions inherited from simgrid::xbt::Extendable< Link >
 Extendable ()
 
 ~Extendable ()
 
void * extension (std::size_t rank)
 
U * extension (Extension< Link, U > rank)
 
U * extension ()
 
void extension_set (std::size_t rank, void *value, bool use_dtor=true)
 
void extension_set (Extension< Link, U > rank, U *value, bool use_dtor=true)
 
void extension_set (U *p)
 

Static Public Member Functions

static Linkby_name (std::string name)
 Retrieve a link from its name. More...
 
static Linkby_name_or_null (std::string name)
 
static LinkbyName (const char *name)
 
- Static Public Member Functions inherited from simgrid::xbt::Extendable< Link >
static size_t extension_create (void(*deleter)(void *))
 
static Extension< Link, U > extension_create (void(*deleter)(void *))
 
static Extension< Link, U > extension_create ()
 

Static Public Attributes

static simgrid::xbt::signal< void(s4u::Link &)> on_creation
 Callback signal fired when a new Link is created. More...
 
static simgrid::xbt::signal< void(s4u::Link &)> on_destruction
 Callback signal fired when a Link is destroyed. More...
 
static simgrid::xbt::signal< void(s4u::Link &)> on_state_change
 Callback signal fired when the state of a Link changes (when it is turned on or off) More...
 
static simgrid::xbt::signal< void(s4u::Link &)> on_bandwidth_change
 Callback signal fired when the bandwidth of a Link changes. More...
 
static simgrid::xbt::signal< void(kernel::resource::NetworkAction *, s4u::Host *src, s4u::Host *dst)> on_communicate
 Callback signal fired when a communication starts. More...
 
static simgrid::xbt::signal< void(kernel::resource::NetworkAction *, kernel::resource::Action::State)> on_communication_state_change
 Callback signal fired when a communication changes it state (ready/done/cancel) More...
 

Member Enumeration Documentation

◆ SharingPolicy

Enumerator
SPLITDUPLEX 
SHARED 
FATPIPE 

Member Function Documentation

◆ get_impl()

kernel::resource::LinkImpl* simgrid::s4u::Link::get_impl ( )
inline

◆ by_name()

static Link* simgrid::s4u::Link::by_name ( std::string  name)
static

Retrieve a link from its name.

◆ by_name_or_null()

static Link* simgrid::s4u::Link::by_name_or_null ( std::string  name)
static

◆ get_name()

const std::string& simgrid::s4u::Link::get_name ( ) const

Retrieves the name of that link as a C++ string.

◆ get_cname()

const char* simgrid::s4u::Link::get_cname ( ) const

Retrieves the name of that link as a C string.

◆ get_bandwidth()

double simgrid::s4u::Link::get_bandwidth ( )

Get the bandwidth in bytes per second of current Link.

◆ get_latency()

double simgrid::s4u::Link::get_latency ( )

Get the latency in seconds of current Link.

◆ get_sharing_policy()

SharingPolicy simgrid::s4u::Link::get_sharing_policy ( )

Describes how the link is shared between flows.

◆ get_usage()

double simgrid::s4u::Link::get_usage ( )

Returns the current load (in flops per second)

◆ is_used()

bool simgrid::s4u::Link::is_used ( )

Check if the Link is used (at least one flow uses the link)

◆ turn_on()

void simgrid::s4u::Link::turn_on ( )

◆ turn_off()

void simgrid::s4u::Link::turn_off ( )

◆ get_data()

void* simgrid::s4u::Link::get_data ( )

◆ set_data()

void simgrid::s4u::Link::set_data ( void *  d)

Should be used only from the C interface.

Prefer extensions in C++

◆ set_state_trace()

void simgrid::s4u::Link::set_state_trace ( tmgr_trace_t  trace)

◆ set_bandwidth_trace()

void simgrid::s4u::Link::set_bandwidth_trace ( tmgr_trace_t  trace)

◆ set_latency_trace()

void simgrid::s4u::Link::set_latency_trace ( tmgr_trace_t  trace)

◆ get_property()

const char* simgrid::s4u::Link::get_property ( std::string  key)

◆ set_property()

void simgrid::s4u::Link::set_property ( std::string  key,
std::string  value 
)

◆ byName()

static Link* simgrid::s4u::Link::byName ( const char *  name)
inlinestatic

◆ getName()

const std::string& simgrid::s4u::Link::getName ( ) const
inline

◆ getCname()

const char* simgrid::s4u::Link::getCname ( ) const
inline

◆ sharingPolicy()

SharingPolicy simgrid::s4u::Link::sharingPolicy ( )
inline

◆ getUsage()

double simgrid::s4u::Link::getUsage ( )
inline

◆ isUsed()

bool simgrid::s4u::Link::isUsed ( )
inline

◆ bandwidth()

double simgrid::s4u::Link::bandwidth ( )
inline

◆ latency()

double simgrid::s4u::Link::latency ( )
inline

◆ turnOn()

void simgrid::s4u::Link::turnOn ( )
inline

◆ turnOff()

void simgrid::s4u::Link::turnOff ( )
inline

◆ getProperty()

const char* simgrid::s4u::Link::getProperty ( const char *  key)
inline

◆ setProperty()

void simgrid::s4u::Link::setProperty ( std::string  key,
std::string  value 
)
inline

◆ getData()

void* simgrid::s4u::Link::getData ( )
inline

◆ setData()

void simgrid::s4u::Link::setData ( void *  d)
inline

◆ setStateTrace()

void simgrid::s4u::Link::setStateTrace ( tmgr_trace_t  trace)
inline

◆ setBandwidthTrace()

void simgrid::s4u::Link::setBandwidthTrace ( tmgr_trace_t  trace)
inline

◆ setLatencyTrace()

void simgrid::s4u::Link::setLatencyTrace ( tmgr_trace_t  trace)
inline

Member Data Documentation

◆ on_creation

simgrid::xbt::signal<void(s4u::Link&)> simgrid::s4u::Link::on_creation
static

Callback signal fired when a new Link is created.

◆ on_destruction

simgrid::xbt::signal<void(s4u::Link&)> simgrid::s4u::Link::on_destruction
static

Callback signal fired when a Link is destroyed.

◆ on_state_change

simgrid::xbt::signal<void(s4u::Link&)> simgrid::s4u::Link::on_state_change
static

Callback signal fired when the state of a Link changes (when it is turned on or off)

◆ on_bandwidth_change

simgrid::xbt::signal<void(s4u::Link&)> simgrid::s4u::Link::on_bandwidth_change
static

Callback signal fired when the bandwidth of a Link changes.

◆ on_communicate

simgrid::xbt::signal<void(kernel::resource::NetworkAction*, s4u::Host* src, s4u::Host* dst)> simgrid::s4u::Link::on_communicate
static

Callback signal fired when a communication starts.

◆ on_communication_state_change

simgrid::xbt::signal<void(kernel::resource::NetworkAction*, kernel::resource::Action::State)> simgrid::s4u::Link::on_communication_state_change
static

Callback signal fired when a communication changes it state (ready/done/cancel)


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