WSF
wsf::comm::medium::Container Class Reference

#include <WsfCommMediumContainer.hpp>

Inheritance diagram for wsf::comm::medium::Container:

Public Types

enum  InputAction : int { cNONE , cADD , cEDIT , cDELETE }

Public Member Functions

 Container (const WsfScenario &aScenario)
 Container (const Container &aSrc)
virtual ~Container ()=default
MediumGetMedium () const
void SetMedium (std::shared_ptr< Medium > aMedium)
virtual bool ProcessInput (UtInput &aInput)
virtual bool Initialize (double aSimTime)
void SetSimulation (WsfSimulation *aSimPtr)
virtual bool ProcessContainerInput (UtInput &aInput, InputAction aAction=cNONE)
const std::set< TypeIdentifier > & GetValidMediums () const
void AddValidMedium (TypeIdentifier aValue)
void AddForbiddenMedium (TypeIdentifier aValue)
bool IsValidMedium (TypeIdentifier aValue) const
 Returns true if the provided TypeIdentifier is valid for this container.
void SetDefaultMedium (TypeIdentifier aValue)
TypeIdentifier GetDefaultMedium () const
virtual bool AddDefaultMedium ()
const WsfScenarioGetScenario () const

Detailed Description

A class container for usage of medium objects. Provides the API for usage of the medium object, as well as some convenience methods for using mediums. Mediums are maintained by the type list, and shared pointer instances are provided to containers - thus, the medium held by any given container may be shared between multiple containers.

Member Enumeration Documentation

◆ InputAction

Enumerator
cNONE 
cADD 
cEDIT 
cDELETE 

Constructor & Destructor Documentation

◆ Container() [1/2]

wsf::comm::medium::Container::Container ( const WsfScenario & aScenario)
inline

◆ Container() [2/2]

wsf::comm::medium::Container::Container ( const Container & aSrc)

References Container().

◆ ~Container()

virtual wsf::comm::medium::Container::~Container ( )
virtualdefault

Member Function Documentation

◆ AddDefaultMedium()

bool wsf::comm::medium::Container::AddDefaultMedium ( )
virtual

A public helper method, indicating to the container that it should use the default medium type, and acquire a copy if it. This is only valid if a medium is not currently assigned.

References AddDefaultMedium(), and wsf::comm::Types::Get().

Referenced by AddDefaultMedium(), and ProcessInput().

◆ AddForbiddenMedium()

void wsf::comm::medium::Container::AddForbiddenMedium ( TypeIdentifier aValue)

Adds a forbidden medium type for the parent of this container. This allows the removal of types that may not be valid for this particular instance.

References AddForbiddenMedium().

Referenced by AddForbiddenMedium().

◆ AddValidMedium()

void wsf::comm::medium::Container::AddValidMedium ( TypeIdentifier aValue)

Add a valid medium type for use by the parent of this container. This is only successful if a medium type has not been forbidden, either by the parent of the container itself, or one of its derivations.

References AddValidMedium().

Referenced by AddValidMedium().

◆ GetDefaultMedium()

TypeIdentifier wsf::comm::medium::Container::GetDefaultMedium ( ) const
inline

◆ GetMedium()

◆ GetScenario()

const WsfScenario & wsf::comm::medium::Container::GetScenario ( ) const
inline

◆ GetValidMediums()

const std::set< TypeIdentifier > & wsf::comm::medium::Container::GetValidMediums ( ) const
inline

◆ Initialize()

bool wsf::comm::medium::Container::Initialize ( double aSimTime)
virtual

◆ IsValidMedium()

bool wsf::comm::medium::Container::IsValidMedium ( TypeIdentifier aValue) const

Returns true if the provided TypeIdentifier is valid for this container.

References IsValidMedium().

Referenced by IsValidMedium(), and wsf::comm::medium::Types::LoadMedium().

◆ ProcessContainerInput()

bool wsf::comm::medium::Container::ProcessContainerInput ( UtInput & aInput,
InputAction aAction = cNONE )
virtual

A method for processing medium input for the container parent. An additional parameter is provided to qualify the scope of the action being taken common to all mediums and akin to components, being adding, editing, or deleting.

References cADD, cDELETE, cEDIT, wsf::comm::Types::Get(), ProcessContainerInput(), and ProcessInput().

Referenced by ProcessContainerInput().

◆ ProcessInput()

bool wsf::comm::medium::Container::ProcessInput ( UtInput & aInput)
virtual

In the base container implementation, ProcessInput primarily provides support for legacy input that was formerly found in physical layer implementations. This allows for legacy input to still be supported, while handling it properly using the medium objects without replicating the functionality.

Reimplemented in wsf::comm::medium::ContainerComponent< PARENT >.

References AddDefaultMedium(), wsf::comm::medium::Types::Get(), ProcessInput(), and SetMedium().

Referenced by ProcessContainerInput(), ProcessInput(), and wsf::comm::medium::ContainerComponent< PARENT >::ProcessInput().

◆ SetDefaultMedium()

void wsf::comm::medium::Container::SetDefaultMedium ( TypeIdentifier aValue)

Sets/gets the default medium for the parent object. Medium usage does not require explicit input for backward compatibility, so a default medium is required.

The set function is ignored if the TypeIdentifier provided is a forbidden medium.

References SetDefaultMedium().

Referenced by SetDefaultMedium().

◆ SetMedium()

void wsf::comm::medium::Container::SetMedium ( std::shared_ptr< Medium > aMedium)
inline

◆ SetSimulation()

void wsf::comm::medium::Container::SetSimulation ( WsfSimulation * aSimPtr)
inline

Required simulation object for subsequent provision to medium instances. Mediums require a simulation instance for runtime query and modification.


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved